query_id
stringlengths
32
32
query
stringlengths
7
4.32k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
00410598bacaf9316b2c6b889aa96480
GoString returns the string representation. API parameter values that are decorated as "sensitive" in the API will not be included in the string output. The member name will be present, but the value will be replaced with "sensitive".
[ { "docid": "bcdd355e78ac6683142877b193092e3e", "score": "0.0", "text": "func (s ListIntegrationAssociationsOutput) GoString() string {\n\treturn s.String()\n}", "title": "" } ]
[ { "docid": "d5612f7ba09e736647ac5e632243a30b", "score": "0.5972343", "text": "func (s BotMember) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "b4630d33b70c5844b5e64ade660963a3", "score": "0.59660137", "text": "func (s Member) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "b4630d33b70c5844b5e64ade660963a3", "score": "0.59660137", "text": "func (s Member) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "b4630d33b70c5844b5e64ade660963a3", "score": "0.59660137", "text": "func (s Member) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "b4630d33b70c5844b5e64ade660963a3", "score": "0.59660137", "text": "func (s Member) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "b4630d33b70c5844b5e64ade660963a3", "score": "0.59660137", "text": "func (s Member) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "fe413ac07f0cc84c1812307664cca5c0", "score": "0.58277494", "text": "func deriveGoString(this *MyStruct) string {\n\tbuf := bytes.NewBuffer(nil)\n\tfmt.Fprintf(buf, \"func() *gostring.MyStruct {\\n\")\n\tif this == nil {\n\t\tfmt.Fprintf(buf, \"return nil\\n\")\n\t} else {\n\t\tfmt.Fprintf(buf, \"this := &gostring.MyStruct{}\\n\")\n\t\tfmt.Fprintf(buf, \"this.Int64 = %#v\\n\", this.Int64)\n\t\tif this.StringPtr != nil {\n\t\t\tfmt.Fprintf(buf, \"this.StringPtr = func (v string) *string { return &v }(%#v)\\n\", *this.StringPtr)\n\t\t}\n\t\tfmt.Fprintf(buf, \"return this\\n\")\n\t}\n\tfmt.Fprintf(buf, \"}()\\n\")\n\treturn buf.String()\n}", "title": "" }, { "docid": "1918ba7d7432948a4b58121035f828ce", "score": "0.5795115", "text": "func (p Params) String() string {\n\tvar sb strings.Builder\n\tsb.WriteString(\"Params: \\n\")\n\tsb.WriteString(fmt.Sprintf(\"ACLKey: %v\\n\", p.ACL))\n\tsb.WriteString(fmt.Sprintf(\"DAOOwnerKey: %s\\n\", p.DAOOwner))\n\tsb.WriteString(fmt.Sprintf(\"UpgradeKey: %v\\n\", p.Upgrade))\n\treturn sb.String()\n}", "title": "" }, { "docid": "86cff2e54daa28be218bf1caddc829f8", "score": "0.57886565", "text": "func (v Struct) String() string {\n\tdata, err := v.MarshalJSON()\n\tif err != nil {\n\t\treturn fmt.Sprintf(`{\"error\": %v}`, err)\n\t}\n\treturn string(data)\n}", "title": "" }, { "docid": "796d3da09122d3a6eda8d85cd2072b9e", "score": "0.57803094", "text": "func (s GetMemberOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "de2779b21a0c4435f4cf673825eb1442", "score": "0.5764692", "text": "func (p *PluginAPI) String() string {\n\tvar lines []string\n\tlines = append(lines, \"Struct PluginAPI:\")\n\tlines = append(lines, \"\\t- Generated on: 2016-12-06 08:06:59.815134005 +0100 CET\")\n\tlines = append(lines, \"\\t- Command: go-bind-plugin -plugin-path plugin.so -plugin-package ./plugin -output-name PluginAPI -output-path plugin_api.go -output-package main -dereference-vars -rebuild\")\n\tlines = append(lines, \"\\nPlugin info:\")\n\tlines = append(lines, \"\\t- package: github.com/wendigo/go-bind-plugin-example/plugin\")\n\tlines = append(lines, \"\\t- sha256 sum: 303cd891bd37c209c0ad0798673bd871af8e6bae3673cc7c261abb54e76e6ae9\")\n\tlines = append(lines, \"\\t- size: 2578348 bytes\")\n\tlines = append(lines, \"\\nExported functions (2):\")\n\tlines = append(lines, \"\\t- CalculateSin func(float64) (float64)\")\n\tlines = append(lines, \"\\t- SayHello func(string)\")\n\n\tlines = append(lines, \"\\nExported variables (1):\")\n\tlines = append(lines, \"\\t- CurrentYear int\")\n\n\treturn strings.Join(lines, \"\\n\")\n}", "title": "" }, { "docid": "3901139e74a3c7073fb661bd90272907", "score": "0.5755617", "text": "func (s FeatureParameter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "acb5f15fa51a789751deffe7cde15980", "score": "0.57170886", "text": "func (bs *Bindings) String() string {\r\n\treturn \"PARAM=VALUE\"\r\n}", "title": "" }, { "docid": "1cdad9caaf72275da4ef3e46c448a1a3", "score": "0.5697086", "text": "func (p *Parms) String() string {\n\tout, _ := json.MarshalIndent(p, \"\", \"\\t\")\n\treturn string(out)\n}", "title": "" }, { "docid": "7fdd9d07690703691d426379ec8d9a7a", "score": "0.56940645", "text": "func (s MemberFrameworkAttributes) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "f0c8ec069ef4f371f74a77c1fff342eb", "score": "0.5667433", "text": "func (s Api) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "f0c8ec069ef4f371f74a77c1fff342eb", "score": "0.5667433", "text": "func (s Api) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "74841839d2e20d32eda2604b690f38eb", "score": "0.56571585", "text": "func (s CreateMemberOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "74841839d2e20d32eda2604b690f38eb", "score": "0.56571585", "text": "func (s CreateMemberOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "540636a34adb1a7967a6f8d5aa0c8445", "score": "0.5648506", "text": "func (s UpdateParam) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "9a2a32846e9d15057aac9e2f35e87213", "score": "0.56295896", "text": "func String(name, val string) Field {\n\treturn Field(zap.String(name, val))\n}", "title": "" }, { "docid": "947af2e687894d6d29a03e631290b565", "score": "0.561751", "text": "func (s CognitoMemberDefinition) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "be5fe10413aca4c98011d6d93dfe98a4", "score": "0.5608239", "text": "func (s GetMemberInput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "c8c4ae4808f93da388e9d506cd9913ca", "score": "0.5605517", "text": "func (pc ParamChange) String() string {\n\treturn fmt.Sprintf(`Param Change:\n Subspace: %s\n Key: %s\n Subkey: %X\n Value: %X\n`, pc.Subspace, pc.Key, pc.Subkey, pc.Value)\n}", "title": "" }, { "docid": "d9ee2b223b7036b0844ac2370527fbfe", "score": "0.5600498", "text": "func (p Params) String() string {\n\treturn fmt.Sprintf(`Distribution Params:\n Community Tax: %s\n Withdraw Addr Enabled: %t`,\n\t\tp.CommunityTax, p.WithdrawAddrEnabled)\n}", "title": "" }, { "docid": "e26540770e51fd568fbc7de170aeb593", "score": "0.5596325", "text": "func (s SomeStruct) String() string {\n\treturn fmt.Sprintf(\"p1: %T %+v; p2: %T %+v\", s.p1, s.p1, s.p2, s.p2)\n}", "title": "" }, { "docid": "332c8c86d87b0654fa614312ec4429f0", "score": "0.55884933", "text": "func (p Provider) String() string {\n\tjp, _ := json.Marshal(p)\n\treturn string(jp)\n}", "title": "" }, { "docid": "d276cf09182d09730c046fea89169f72", "score": "0.5585225", "text": "func (g *Generic) String() string {\n\tparamStr := make([]string, len(g.Params))\n\tfor i, pr := range g.Params {\n\t\tparamStr[i] = pr.String()\n\t}\n\n\treturn fmt.Sprintf(\"{Header: %s, Params: %s}\",\n\t\tg.Header.String(),\n\t\tparamStr,\n\t)\n}", "title": "" }, { "docid": "1f8cd632fedb20ae2db50fc88345f4ca", "score": "0.5579801", "text": "func (p Params) String() string {\n\treturn fmt.Sprintf(\n\t\t\"TokenCourse: %d\\n\"+\n\t\t\t\"SubscriptionPrice: %d\\n\"+\n\t\t\t\"VPNGBPrice: %d\\n\"+\n\t\t\t\"StorageGBPrice: %d\\n\"+\n\t\t\t\"BaseVPNGb: %d\\n\"+\n\t\t\t\"BaseStorageGb: %d\\n\"+\n\t\t\t\"CouseChangeSigners: %v\\n\",\n\t\tp.TokenCourse,\n\t\tp.SubscriptionPrice,\n\t\tp.VPNGBPrice,\n\t\tp.StorageGBPrice,\n\t\tp.BaseVPNGb,\n\t\tp.BaseStorageGb,\n\t\tp.CourseChangeSigners,\n\t)\n}", "title": "" }, { "docid": "5c518cab9a26cf655d1488d854d900db", "score": "0.5579521", "text": "func (s ApiCallDetails) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "b4d16e7e1a6908eb2f72037bb06b0461", "score": "0.5571026", "text": "func String(param interface{}) string {\n\tvar v string\n\tif param != nil {\n\t\tv = param.(string)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "bbc0a707148f9155b8d783f7e43faf92", "score": "0.5546587", "text": "func (vl VerbLevel) String() string {\n\treturn fmt.Sprintf(\"%d=%s\", vl, vl.Name())\n}", "title": "" }, { "docid": "6fd9f1d4d485cf6d2559650a970dc32b", "score": "0.5535005", "text": "func (s UpdateMemberOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "dd68b301cb40d6e731300f1c215fe2a2", "score": "0.5529285", "text": "func (v *Service) String() string {\n\tif v == nil {\n\t\treturn \"<nil>\"\n\t}\n\n\tvar fields [6]string\n\ti := 0\n\tfields[i] = fmt.Sprintf(\"Name: %v\", v.Name)\n\ti++\n\tfields[i] = fmt.Sprintf(\"ThriftName: %v\", v.ThriftName)\n\ti++\n\tif v.ParentID != nil {\n\t\tfields[i] = fmt.Sprintf(\"ParentID: %v\", *(v.ParentID))\n\t\ti++\n\t}\n\tfields[i] = fmt.Sprintf(\"Functions: %v\", v.Functions)\n\ti++\n\tfields[i] = fmt.Sprintf(\"ModuleID: %v\", v.ModuleID)\n\ti++\n\tif v.Annotations != nil {\n\t\tfields[i] = fmt.Sprintf(\"Annotations: %v\", v.Annotations)\n\t\ti++\n\t}\n\n\treturn fmt.Sprintf(\"Service{%v}\", strings.Join(fields[:i], \", \"))\n}", "title": "" }, { "docid": "3ffc25a4edc5ca7652c4750de89130eb", "score": "0.55236137", "text": "func (s Parameter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "3ffc25a4edc5ca7652c4750de89130eb", "score": "0.5522052", "text": "func (s Parameter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "3ffc25a4edc5ca7652c4750de89130eb", "score": "0.5522052", "text": "func (s Parameter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "1fc7be125648c218f16c96443de5ac5a", "score": "0.550183", "text": "func (s VirtualServiceProvider) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "cdfef40083c53bb9723ce783f15375e4", "score": "0.5500519", "text": "func (c CliParams) String() string {\n\tnameFmt := \"%20s: \"\n\tlines := []string{\n\t\tfmt.Sprintf(nameFmt+\"%t\", \"Debug\", c.Debug),\n\t\tfmt.Sprintf(nameFmt+\"%t\", \"Help Printed\", c.HelpPrinted),\n\t\tfmt.Sprintf(nameFmt+\"%q\", \"Errors\", c.Errors),\n\t\tfmt.Sprintf(nameFmt+\"%s\", \"Input File\", c.InputFile),\n\t\tfmt.Sprintf(nameFmt+\"%d\", \"Count\", c.Count),\n\t\tfmt.Sprintf(nameFmt+\"%s\", \"Points\", c.Points),\n\t}\n\treturn strings.Join(lines, \"\\n\") + \"\\n\"\n}", "title": "" }, { "docid": "8d24224fe2d09199e308710466d5c714", "score": "0.5497302", "text": "func (p paramHeader) String() string {\n\treturn fmt.Sprintf(\"%s (%d): %s\", p.typ, p.len, p.raw)\n}", "title": "" }, { "docid": "90965527fa89e64e83e14cc67d92714c", "score": "0.5496386", "text": "func Struct2String(st interface{}) string {\n\tvt := reflect.TypeOf(st)\n\tvv := reflect.ValueOf(st)\n\tvar str = \"\"\n\tfor i := 0; i < vt.NumField(); i++ {\n\t\tf := vt.Field(i)\n\t\tfmt.Println(f)\n\t\tv := vv.Field(i)\n\t\tfmt.Println(v)\n\t\tchKey := f.Tag.Get(\"json\")\n\t\tswitch v.Kind() {\n\t\tcase reflect.String:\n\t\t\tif s, ok := v.Interface().(string); ok && s != \"\" {\n\t\t\t\tstr += \"\\\"\" + chKey + \"\\\"\" + \":\" + \"\\\"\" + s + \"\\\"\" + \",\"\n\t\t\t}\n\t\tcase reflect.Int:\n\t\t\tif i, ok := v.Interface().(int); ok && i != 0 {\n\t\t\t\ts := strconv.Itoa(i)\n\t\t\t\tstr += \"\\\"\" + chKey + \"\\\"\" + \":\" + \"\\\"\" + s + \"\\\"\" + \",\"\n\n\t\t\t}\n\t\tcase reflect.Uint64:\n\t\t\tif u64, ok := v.Interface().(uint64); ok && u64 != 0 {\n\t\t\t\ts := strconv.Itoa(int(u64))\n\t\t\t\tstr += \"\\\"\" + chKey + \"\\\"\" + \":\" + \"\\\"\" + s + \"\\\"\" + \",\"\n\n\t\t\t}\n\t\tcase reflect.Int64:\n\t\t\tif i64, ok := v.Interface().(int64); ok && i64 != 0 {\n\t\t\t\ts := strconv.Itoa(int(i64))\n\t\t\t\tstr += \"\\\"\" + chKey + \"\\\"\" + \":\" + \"\\\"\" + s + \"\\\"\" + \",\"\n\n\t\t\t}\n\n\t\tcase reflect.Uint:\n\t\t\tif u, ok := v.Interface().(uint); ok && u != 0 {\n\t\t\t\ts := strconv.Itoa(int(u))\n\t\t\t\tstr += \"\\\"\" + chKey + \"\\\"\" + \":\" + \"\\\"\" + s + \"\\\"\" + \",\"\n\n\t\t\t}\n\n\t\tcase reflect.Slice:\n\t\t\tl := v.Len()\n\t\t\tstri := \"\"\n\n\t\t\tfor i := 0; i < l; i++ {\n\t\t\t\tvi := v.Index(i).Interface()\n\t\t\t\tvtype := reflect.TypeOf(vi)\n\n\t\t\t\tif vtype.Name() == \"string\" {\n\t\t\t\t\tstri += \"\\\"\" + vi.(string) + \"\\\"\" + \",\"\n\t\t\t\t} else if vtype.Name() == \"uint\" {\n\t\t\t\t\tss := strconv.Itoa(int(vi.(uint)))\n\t\t\t\t\tstri += \"\\\"\" + ss + \"\\\"\" + \",\"\n\t\t\t\t} else if vtype.Name() == \"int\" {\n\t\t\t\t\tss := strconv.Itoa(vi.(int))\n\t\t\t\t\tstri += \"\\\"\" + ss + \"\\\"\" + \",\"\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tif stri != \"\" {\n\t\t\t\tstri = stri[:len(stri)-1]\n\t\t\t\tstri = \"[\" + stri + \"]\"\n\t\t\t\tstr += \"\\\"\" + chKey + \"\\\"\" + \":\" + stri + \",\"\n\t\t\t}\n\t\tdefault:\n\t\t\tglog.Error(\"unsupport common query type: \" + string(chKey))\n\t\t\treturn \"\"\n\n\t\t}\n\t}\n\tstr = str[:len(str)-1]\n\tstr = \"{\" + str + \"}\"\n\tfmt.Println(str)\n\treturn str\n}", "title": "" }, { "docid": "1349808747e8de15d5370d22518fa43c", "score": "0.54963446", "text": "func (m Struct) String() string {\n\tif m.Type != nil {\n\t\treturn m.Type.String()\n\t}\n\tif m.AnonymousType != nil {\n\t\treturn m.AnonymousType.String()\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "39d7f12638a8500530687c2993aec529", "score": "0.5492613", "text": "func (m *Fields) String() string {\n\treturn m.ProtoFields().String()\n}", "title": "" }, { "docid": "2fc1b2ea1d2dc3b92ae03f3c915fc03e", "score": "0.54882467", "text": "func (p *Param) String() string {\n\tswitch p.ParameterKind {\n\tcase variable, variableDecl:\n\t\treturn strconv.Quote(\"$\" + p.Name)\n\tcase declaration:\n\t\treturn p.Name\n\tcase stringConstant:\n\t\treturn strconv.Quote(p.Name)\n\tcase otherConstant:\n\t\treturn p.Name\n\tcase ignored:\n\t\treturn \"\"\n\tdefault:\n\t\treturn \"<not supported>\"\n\t}\n}", "title": "" }, { "docid": "844a81f1d0eca520ae47087c72a631f9", "score": "0.5482777", "text": "func (s OidcMemberDefinition) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "cfa8e2073c069b97f059aff0859d888a", "score": "0.5475792", "text": "func (_struct Struct) String() string {\n\treturn fmt.Sprintf(\"struct:%s\", _struct.Name())\n}", "title": "" }, { "docid": "c5ac32b50515a01e38f8086951fb488b", "score": "0.54744244", "text": "func (s CreateMemberInput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "c5ac32b50515a01e38f8086951fb488b", "score": "0.54744244", "text": "func (s CreateMemberInput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "70654039945d2320f4eee3aa3a793d94", "score": "0.54618174", "text": "func (s KeyValuePair) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "70654039945d2320f4eee3aa3a793d94", "score": "0.54618174", "text": "func (s KeyValuePair) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "70654039945d2320f4eee3aa3a793d94", "score": "0.546168", "text": "func (s KeyValuePair) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "0763cdfe3b89f2f4d83053ed67f8ca3e", "score": "0.54559284", "text": "func (s UpdateMemberInput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "498d5e67ce1e86ab266d1abca2d48628", "score": "0.5443622", "text": "func (v Value) String() string {\n\tif sp, ok := v.any.(stringptr); ok {\n\t\t// Inlining this code makes a huge difference.\n\t\tvar s string\n\t\thdr := (*reflect.StringHeader)(unsafe.Pointer(&s))\n\t\thdr.Data = uintptr(sp)\n\t\thdr.Len = int(v.num)\n\t\treturn s\n\t}\n\tvar buf []byte\n\treturn string(v.append(buf))\n}", "title": "" }, { "docid": "faed4e1bb0db60dcb2c6f36e3c1066ed", "score": "0.544317", "text": "func (k *key) String() string {\n\treturn \"api context value \" + k.name\n}", "title": "" }, { "docid": "3d29636fde22fff60ec1419e6a474619", "score": "0.5442269", "text": "func (s OutputParameter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "015df2e8b9c6d3d1971a27e371c5b417", "score": "0.5436579", "text": "func (b *binding) String() string {\n\tvar index string\n\tif len(b.Input.StructFieldIndex) > 0 {\n\t\tindex = strconv.Itoa(b.Input.StructFieldIndex[0])\n\t\tfor _, i := range b.Input.StructFieldIndex[1:] {\n\t\t\tindex += fmt.Sprintf(\".%d\", i)\n\t\t}\n\t} else {\n\t\tindex = strconv.Itoa(b.Input.Index)\n\t}\n\n\treturn fmt.Sprintf(\"[%s:%s] maps to [%s]\", index, b.Input.Type.String(), b.Dependency)\n}", "title": "" }, { "docid": "88d88e2a43e2ff091793f31f1de09861", "score": "0.5427817", "text": "func (p Providers) String() string {\n\tjp, _ := json.Marshal(p)\n\treturn string(jp)\n}", "title": "" }, { "docid": "1e89f691f0ca1e346e18ac407cb71020", "score": "0.54250544", "text": "func (v *Argument) String() string {\n\tif v == nil {\n\t\treturn \"<nil>\"\n\t}\n\n\tvar fields [3]string\n\ti := 0\n\tfields[i] = fmt.Sprintf(\"Name: %v\", v.Name)\n\ti++\n\tfields[i] = fmt.Sprintf(\"Type: %v\", v.Type)\n\ti++\n\tif v.Annotations != nil {\n\t\tfields[i] = fmt.Sprintf(\"Annotations: %v\", v.Annotations)\n\t\ti++\n\t}\n\n\treturn fmt.Sprintf(\"Argument{%v}\", strings.Join(fields[:i], \", \"))\n}", "title": "" }, { "docid": "afa587d9da57d0e282ba78c7d2d2b6bd", "score": "0.5403453", "text": "func valueString(v reflect.Value, opts tagOptions, sf reflect.StructField) string {\n\tfor v.Kind() == reflect.Ptr {\n\t\tif v.IsNil() {\n\t\t\treturn \"\"\n\t\t}\n\t\tv = v.Elem()\n\t}\n\n\tif v.Kind() == reflect.Bool && opts.Contains(\"int\") {\n\t\tif v.Bool() {\n\t\t\treturn \"1\"\n\t\t}\n\t\treturn \"0\"\n\t}\n\n\tif v.Type() == timeType {\n\t\tt := v.Interface().(time.Time)\n\t\tif opts.Contains(\"unix\") {\n\t\t\treturn strconv.FormatInt(t.Unix(), 10)\n\t\t}\n\t\tif opts.Contains(\"unixmilli\") {\n\t\t\treturn strconv.FormatInt((t.UnixNano() / 1e6), 10)\n\t\t}\n\t\tif opts.Contains(\"unixnano\") {\n\t\t\treturn strconv.FormatInt(t.UnixNano(), 10)\n\t\t}\n\t\tif layout := sf.Tag.Get(\"layout\"); layout != \"\" {\n\t\t\treturn t.Format(layout)\n\t\t}\n\t\treturn t.Format(time.RFC3339)\n\t}\n\n\treturn fmt.Sprint(v.Interface())\n}", "title": "" }, { "docid": "2dfe657e573ecf06637fc2e4e700b49f", "score": "0.54031956", "text": "func String(v interface{}) string {\n\treturn StringWithOptions(v, nil)\n}", "title": "" }, { "docid": "fc5a5ad42da54884cfd84053b31bb46a", "score": "0.54010916", "text": "func (o *Webchatmemberinfo) String() string {\n\tj, _ := json.Marshal(o)\n\tstr, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\\\u`, `\\u`, -1))\n\n\treturn str\n}", "title": "" }, { "docid": "9670499c6928849359a95e69aff066d8", "score": "0.5391195", "text": "func (s UseCase) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "7810f5262bc9faa785879a38fa9b775d", "score": "0.5387395", "text": "func (s MemberDefinition) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "9c66cccdde8c717e9a130db2918369c1", "score": "0.5386851", "text": "func (s ParameterStringFilter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "7fa9ae680372df047f172b65f4ed06b4", "score": "0.53827846", "text": "func (s ApiKey) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "07756aecfbfa7ae7208809e98ffe14ee", "score": "0.53760403", "text": "func Format(arg interface{}) string {\n\n\tif arg == nil {\n\t\treturn \"<nil>\"\n\t}\n\n\tswitch v := arg.(type) {\n\tcase error:\n\t\treturn fmt.Sprintf(\"%v\", v)\n\tcase int:\n\t\treturn fmt.Sprintf(\"%d\", v)\n\tcase int64:\n\t\treturn fmt.Sprintf(\"%d\", v)\n\tcase bool:\n\t\tif v {\n\t\t\treturn \"true\"\n\t\t}\n\t\treturn \"false\"\n\tcase float64:\n\t\treturn fmt.Sprintf(\"%v\", v)\n\tcase map[string]interface{}:\n\t\tvar b strings.Builder\n\t\t// Make a list of the keys, ignoring hidden members whose name\n\t\t// starts with \"__\"\n\t\tkeys := make([]string, 0)\n\t\tfor k := range v {\n\t\t\tif len(k) < 2 || k[0:2] != \"__\" {\n\t\t\t\tkeys = append(keys, k)\n\t\t\t}\n\t\t}\n\t\tsort.Strings(keys)\n\n\t\tb.WriteString(\"{\")\n\t\tfor n, k := range keys {\n\t\t\ti := v[k]\n\t\t\tif n > 0 {\n\t\t\t\tb.WriteString(\",\")\n\t\t\t}\n\t\t\tb.WriteRune(' ')\n\t\t\tb.WriteString(k)\n\t\t\tb.WriteString(\": \")\n\t\t\tb.WriteString(Format(i))\n\t\t}\n\t\tb.WriteString(\" }\")\n\t\treturn b.String()\n\n\tcase []interface{}:\n\t\tvar b strings.Builder\n\t\tb.WriteRune('[')\n\n\t\tfor n, i := range v {\n\t\t\tif n > 0 {\n\t\t\t\tb.WriteString(\", \")\n\t\t\t}\n\t\t\tb.WriteString(Format(i))\n\t\t}\n\t\tb.WriteRune(']')\n\t\treturn b.String()\n\n\tcase string:\n\t\treturn \"\\\"\" + v + \"\\\"\"\n\n\tdefault:\n\t\tvv := reflect.ValueOf(v)\n\n\t\t// IF it's an internal function, show it's name. If it is a standard builtin from the\n\t\t// function library, show the short form of the name.\n\t\tif vv.Kind() == reflect.Func {\n\t\t\tif ui.IsActive(ui.DebugLogger) {\n\t\t\t\tname := runtime.FuncForPC(reflect.ValueOf(v).Pointer()).Name()\n\t\t\t\tname = strings.Replace(name, \"github.com/tucats/gopackages/\", \"\", 1)\n\t\t\t\tname = strings.Replace(name, \"github.com/tucats/gopackages/runtime.\", \"\", 1)\n\t\t\t\treturn \"builtin \" + name\n\t\t\t} else {\n\t\t\t\treturn \"builtin\"\n\t\t\t}\n\t\t}\n\n\t\t// If it's a bytecode.Bytecode pointer, use reflection to get the\n\t\t// Name field value and use that with the name. A function literal\n\t\t// will have no name.\n\t\tif vv.Kind() == reflect.Ptr {\n\t\t\tts := vv.String()\n\t\t\tif ts == \"<*bytecode.ByteCode Value>\" {\n\t\t\t\te := reflect.ValueOf(v).Elem()\n\t\t\t\tif ui.IsActive(ui.DebugLogger) {\n\t\t\t\t\tname := GetString(e.Field(0).Interface())\n\t\t\t\t\treturn \"func \" + name\n\t\t\t\t} else {\n\t\t\t\t\treturn \"func\"\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn fmt.Sprintf(\"ptr %s\", ts)\n\t\t}\n\n\t\tif strings.HasPrefix(vv.String(), \"<bytecode.StackMarker\") {\n\t\t\te := reflect.ValueOf(v).Field(0)\n\t\t\tname := GetString(e.Interface())\n\t\t\treturn fmt.Sprintf(\"<%s>\", name)\n\t\t}\n\n\t\tif strings.HasPrefix(vv.String(), \"<bytecode.CallFrame\") {\n\t\t\te := reflect.ValueOf(v).Field(0)\n\t\t\tmodule := GetString(e.Interface())\n\t\t\te = reflect.ValueOf(v).Field(1)\n\t\t\tline := GetInt(e.Interface())\n\t\t\treturn fmt.Sprintf(\"<frame %s:%d>\", module, line)\n\t\t}\n\n\t\tif ui.IsActive(ui.DebugLogger) {\n\t\t\treturn fmt.Sprintf(\"kind %v %#v\", vv.Kind(), v)\n\t\t}\n\t\treturn fmt.Sprintf(\"kind %v %v\", vv.Kind(), v)\n\t}\n}", "title": "" }, { "docid": "a1a197d01d3356cc58146d848344edad", "score": "0.53728163", "text": "func (s GetApiOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "b97895ab172f3c3bfc19eea555032fed", "score": "0.53680325", "text": "func (s VirtualGateway) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "d7f44fd5d8a4877e8cb88d194df9992e", "score": "0.53636086", "text": "func (s DBParameterGroup) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "805f9eaf50d4ca9966df5d30317541b8", "score": "0.535848", "text": "func (v *ServiceGenerator_Generate_Args) String() string {\n\tif v == nil {\n\t\treturn \"<nil>\"\n\t}\n\n\tvar fields [1]string\n\ti := 0\n\tif v.Request != nil {\n\t\tfields[i] = fmt.Sprintf(\"Request: %v\", v.Request)\n\t\ti++\n\t}\n\n\treturn fmt.Sprintf(\"ServiceGenerator_Generate_Args{%v}\", strings.Join(fields[:i], \", \"))\n}", "title": "" }, { "docid": "73c0cab2005d31098ef74dae88190f1f", "score": "0.535813", "text": "func (s CreateMembersOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "73c0cab2005d31098ef74dae88190f1f", "score": "0.535813", "text": "func (s CreateMembersOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "95412ff336fbc5b06f35ed4ffea03a0d", "score": "0.5353382", "text": "func (this *Name) String() string {\n\tif this.DoubleValue != nil {\n\t\treturn this.Before.String() + strconv.FormatFloat(this.GetDoubleValue(), 'f', -1, 64)\n\t}\n\tif this.IntValue != nil {\n\t\treturn this.Before.String() + strconv.FormatInt(this.GetIntValue(), 10)\n\t}\n\tif this.UintValue != nil {\n\t\treturn this.Before.String() + \"uint(\" + strconv.FormatUint(this.GetUintValue(), 10) + \")\"\n\t}\n\tif this.BoolValue != nil {\n\t\treturn this.Before.String() + strconv.FormatBool(this.GetBoolValue())\n\t}\n\tif this.StringValue != nil {\n\t\tif isId(this.GetStringValue()) {\n\t\t\treturn this.Before.String() + this.GetStringValue()\n\t\t}\n\t\treturn this.Before.String() + strconv.Quote(this.GetStringValue())\n\t}\n\tif this.BytesValue != nil {\n\t\treturn this.Before.String() + fmt.Sprintf(\"%#v\", this.GetBytesValue())\n\t}\n\tpanic(\"unreachable\")\n}", "title": "" }, { "docid": "11c90d6ee574cda9903fc75bee8832a0", "score": "0.53370744", "text": "func (s DBClusterMember) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "90faaf1f49275808b1cf90892b5cabaf", "score": "0.5335552", "text": "func (b *BitSet) String() string {\n\tm := b.Members()\n\ts := make([]byte, 0, 4*len(m))\n\ts = append(s, '{')\n\tfor _, i := range m {\n\t\ts = append(s, fmt.Sprintf(\" %d\", i)...)\n\t}\n\treturn string(append(s, \" }\"...))\n}", "title": "" }, { "docid": "cf74941b482b7a2a8b7fc968d6b30327", "score": "0.5335339", "text": "func (s ServiceFlags) String() string {\n\tvar str []string\n\n\tstr = append(str, string(s.SVCType()))\n\tif s&serviceFlagExtLocalScope != 0 {\n\t\tstr = append(str, string(SVCTrafficPolicyLocal))\n\t}\n\tif s&serviceFlagIntLocalScope != 0 {\n\t\tstr = append(str, \"Internal\"+string(SVCTrafficPolicyLocal))\n\t}\n\tif s&serviceFlagTwoScopes != 0 {\n\t\tstr = append(str, \"two-scopes\")\n\t}\n\tif s&serviceFlagSessionAffinity != 0 {\n\t\tstr = append(str, \"sessionAffinity\")\n\t}\n\tif s&serviceFlagRoutable == 0 {\n\t\tstr = append(str, \"non-routable\")\n\t}\n\tif s&serviceFlagSourceRange != 0 {\n\t\tstr = append(str, \"check source-range\")\n\t}\n\tif s&serviceFlagNat46x64 != 0 {\n\t\tstr = append(str, \"46x64\")\n\t}\n\tif s&serviceFlagL7LoadBalancer != 0 {\n\t\tstr = append(str, \"l7-load-balancer\")\n\t}\n\tif s&serviceFlagLoopback != 0 {\n\t\tstr = append(str, \"loopback\")\n\t}\n\n\treturn strings.Join(str, \", \")\n}", "title": "" }, { "docid": "ecb2b8d2d35038266c47a6c30b80ab8d", "score": "0.53333896", "text": "func (g Groups) String() string {\n\tjg, _ := json.Marshal(g)\n\treturn string(jg)\n}", "title": "" }, { "docid": "773ad15412af46740aafdd1afa28c4c8", "score": "0.53247327", "text": "func (s SigningProfileParameter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "0180a328e152f607e55b36879703cf07", "score": "0.53233093", "text": "func (mf *mapFlags) String() string {\n\tkvs := make([]string, 0, len(mf.kv))\n\tfor k, v := range mf.kv {\n\t\tkvs = append(kvs, fmt.Sprintf(\"-%s=%s\", k, v))\n\t}\n\treturn strings.Join(kvs, \" \")\n}", "title": "" }, { "docid": "86c6ff3636cf0c4b0e477cba21a3618f", "score": "0.5313489", "text": "func (m JModifier) String() string {\n\tstr := \"\"\n\tif m&PRIVATE != 0 {\n\t\tstr = cat(str, \"private\")\n\t}\n\tif m&PROTECTED != 0 {\n\t\tstr = cat(str, \"protected\")\n\t}\n\tif m&PUBLIC != 0 {\n\t\tstr = cat(str, \"public\")\n\t}\n\tif m&STATIC != 0 {\n\t\tstr = cat(str, \"static\")\n\t}\n\tif m&FINAL != 0 {\n\t\tstr = cat(str, \"final\")\n\t}\n\tif str != \"\" {\n\t\tstr += \" \"\n\t}\n\treturn str\n}", "title": "" }, { "docid": "0ad07a9b9869d52130b409848ad40f06", "score": "0.5311528", "text": "func (g GetObjectInput) String() string {\n\treturn helper.Prettify(g)\n}", "title": "" }, { "docid": "3c6ea52c31fecb017c6fe640de94e2bc", "score": "0.5309984", "text": "func (P ConnectionParams) String() string {\n\treturn P.string(true, false)\n}", "title": "" }, { "docid": "1d4e7d34766971f14676e1ed1bb0333d", "score": "0.5308925", "text": "func (s DocumentParameter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "703f1405e08be3ad196f01e0383dac4b", "score": "0.5308519", "text": "func (t *Struct) String() string { return t.Name }", "title": "" }, { "docid": "a47b4009eb0fdc75f9d01fcc9dbf38a2", "score": "0.53069043", "text": "func (c *Cmd) String(p StringParam) *string {\n\tinto := new(string)\n\tvalue := values.NewString(into, p.value())\n\n\tswitch x := p.(type) {\n\tcase StringOpt:\n\t\tc.mkOpt(container.Container{Name: x.Name, Desc: x.Desc, EnvVar: x.EnvVar, HideValue: x.HideValue, Value: value, ValueSetByUser: x.SetByUser})\n\tcase StringArg:\n\t\tc.mkArg(container.Container{Name: x.Name, Desc: x.Desc, EnvVar: x.EnvVar, HideValue: x.HideValue, Value: value, ValueSetByUser: x.SetByUser})\n\tdefault:\n\t\tpanic(fmt.Sprintf(\"Unhandled param %v\", p))\n\t}\n\n\treturn into\n}", "title": "" }, { "docid": "decd8e9f3b4aa59eb22e199be9f77f20", "score": "0.5306069", "text": "func (o ExportPolicyCreateRequest) String() string {\n\treturn ToString(reflect.ValueOf(o))\n}", "title": "" }, { "docid": "d00241105253d4428c22acb51ad5ae04", "score": "0.530535", "text": "func (obj KeyColumnUsage) String() string {\n\tif data, err := json.Marshal(obj); err != nil {\n\t\treturn fmt.Sprintf(\"<KeyColumnUsage>\")\n\t} else {\n\t\treturn string(data)\n\t}\n}", "title": "" }, { "docid": "2e5cf7aeadef29bfb22dee4204766b1b", "score": "0.5304928", "text": "func (s CreateApiOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "447719bdb220732b4bce8c4dc6d60e01", "score": "0.5303592", "text": "func (p *Parameters) String() string {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\treturn fmt.Sprintf(\"%s%s%s\", p.URL.String(), p.Headers.String(), p.TLSClient.String())\n}", "title": "" }, { "docid": "621894444e85b1dadecdc7c588e9c52b", "score": "0.5298738", "text": "func (p *VCardProperty) String() string {\n\treturn fmt.Sprintf(\" %s (type=%s, parameters=%v): %v\", p.Name, p.Type, p.Parameters, p.Value)\n}", "title": "" }, { "docid": "1b2a8352876879325a645931b300d9b0", "score": "0.5296363", "text": "func (a APIType) String() string {\n\tswitch a {\n\tcase EGL:\n\t\treturn \"EGL\"\n\tcase GLES2:\n\t\treturn \"GLES2\"\n\tcase GLES3:\n\t\treturn \"GLES3\"\n\tcase GLES31:\n\t\treturn \"GLES31\"\n\tcase VK:\n\t\treturn \"VK\"\n\t}\n\treturn fmt.Sprintf(\"UNKNOWN (%d)\", a)\n}", "title": "" }, { "docid": "7657ce98c9091c9009ef40f193e1f111", "score": "0.528619", "text": "func (opt OptNameOnly) String() string {\n\treturn \"OptNameOnly: \" + strconv.FormatBool(bool(opt))\n}", "title": "" }, { "docid": "dcd98e1d24da09b3d784b9efa32d91e9", "score": "0.52859807", "text": "func (pv MockPV) String() string {\n\tmpv, _ := pv.GetPubKey() // mockPV will never return an error, ignored here\n\treturn fmt.Sprintf(\"MockPV{%v}\", mpv.Address())\n}", "title": "" }, { "docid": "b73fb1a90cfbf19d9f4af1907aebd320", "score": "0.52823204", "text": "func (s GetApiInput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "e3de9d748bc3a8216c3e1839feabaed8", "score": "0.5282303", "text": "func (s AdMarkerPassthrough) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "0186e0dbb461d117707ba8002c53825c", "score": "0.52794826", "text": "func String(group InstanceGroup) string {\n\tvar buffer bytes.Buffer\n\twriteString := func(s string) {\n\t\t_, _ = buffer.WriteString(s)\n\t}\n\twriteString(\"app=\")\n\twriteString(group.App())\n\twriteString(\" account=\")\n\twriteString(group.Account())\n\tregion, ok := group.Region()\n\tif ok {\n\t\twriteString(\" region=\")\n\t\twriteString(region)\n\t}\n\tstack, ok := group.Stack()\n\tif ok {\n\t\twriteString(\" stack=\")\n\t\twriteString(stack)\n\t}\n\tcluster, ok := group.Cluster()\n\tif ok {\n\t\twriteString(\" cluster=\")\n\t\twriteString(cluster)\n\t}\n\n\treturn buffer.String()\n}", "title": "" }, { "docid": "8b1fc195738be037bde65b478aa60e90", "score": "0.52783513", "text": "func (o VolumeInfinitevolAttributesType) String() string {\n\treturn ToString(reflect.ValueOf(o))\n}", "title": "" }, { "docid": "4873139562b1e1270fb504c8a70a35e5", "score": "0.5273046", "text": "func (v Vector) String() string {\n\treturn fmt.Sprintf(\"%v:%v\", v.Gate, v.Valve)\n}", "title": "" }, { "docid": "f03cd35a740e74ed99ab0128f55710f1", "score": "0.5271403", "text": "func (s WorkflowParameter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "6a27d4f86d8ca5217b4512f4ac5316b1", "score": "0.52666306", "text": "func (s ModifyVpcAttributeOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "a09fa60eb76413dee9fd910b59301e2c", "score": "0.5261972", "text": "func (sv SV) String() string {\n\tif !sv.hasBeenSet {\n\t\treturn \"\"\n\t}\n\n\tb := \"\"\n\tpr := \"\"\n\tif len(sv.buildIDs) > 0 {\n\t\tb = \"+\" + strings.Join(sv.buildIDs, \".\")\n\t}\n\tif len(sv.preRelIDs) > 0 {\n\t\tpr = \"-\" + strings.Join(sv.preRelIDs, \".\")\n\t}\n\treturn fmt.Sprintf(\"v%d.%d.%d%s%s\", sv.major, sv.minor, sv.patch, pr, b)\n}", "title": "" } ]
87c6b39c70d2a16dda26cfec88f422be
argvForExec takes the os.Args from parameterstoreexec, ensures there's a subcommand specified, and returns a new argv ready for syscall.Exec().
[ { "docid": "2e2c75e76cd928db0a2e4a51e2e5a1d5", "score": "0.7931235", "text": "func argvForExec(osargs []string) ([]string, error) {\n\targc := len(osargs)\n\tswitch argc {\n\tcase 0:\n\t\treturn nil, errors.New(\"empty osargs\")\n\tcase 1:\n\t\treturn nil, errors.New(osargs[0] + \" expected program as first argument\")\n\tdefault:\n\t\treturn osargs[1:argc], nil\n\t}\n}", "title": "" } ]
[ { "docid": "27f4ab26247e661a42f75519c07f74d1", "score": "0.5956806", "text": "func ParseFakeExecCmdArgs() (string, []string) {\n\targs := os.Args\n\tfor len(args) > 0 {\n\t\tif args[0] == \"--\" {\n\t\t\targs = args[1:]\n\t\t\tbreak\n\t\t}\n\t\targs = args[1:]\n\t}\n\n\tif len(args) < 2 {\n\t\tfmt.Fprintf(os.Stderr, \"No command\\n\")\n\t\tos.Exit(2)\n\t}\n\n\treturn args[0], args[1:]\n}", "title": "" }, { "docid": "d2aeba103ef502f181b85d7c52736dc5", "score": "0.5869791", "text": "func (c *clientV2) Exec(argv, environ []string) error {\n\tif c.config.Command != \"\" {\n\t\tcmd := append([]string{c.config.Command}, argv...)\n\n\t\targv = []string{\n\t\t\t\"/bin/sh\",\n\t\t\t\"-c\",\n\t\t\tstrings.Join(cmd, \" \"),\n\t\t}\n\t}\n\n\tif c.config.EntryPoint != \"\" {\n\t\tepArgv, err := shellwords.Parse(c.config.EntryPoint)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\targv = append(epArgv, argv...)\n\t}\n\n\targv0, err := exec.LookPath(argv[0])\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tenv := make([]string, len(environ), len(environ)+len(c.config.Envs))\n\tcopy(env, environ)\n\n\tfor k, v := range c.config.Envs {\n\t\tdata, err := base64Decode(v)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif replaced := replaceEnvVar(env, k, string(data)); !replaced {\n\t\t\tenv = append(env, k+\"=\"+string(data))\n\t\t}\n\t}\n\n\tfor path, val := range c.config.Files {\n\t\tdata, err := base64Decode(val)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tf, err := os.Create(path)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t_, err = f.Write(data)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif err := f.Close(); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn execFunc(argv0, argv, env)\n}", "title": "" }, { "docid": "74d63fc4f3f2f826c2b7e5dad9ea9fa6", "score": "0.57942504", "text": "func (be *BdsExec) ExecuteCommandArgs() int {\n\tif DEBUG {\n\t\tlog.Print(\"Debug: ExecuteCommandArgs\\n\")\n\t}\n\n\tminArgs := 6\n\n\tif len(be.args) < minArgs {\n\t\tbe.Usage(\"Invalid number of parameters for 'exec' command\")\n\t}\n\n\t// Parse command line args\n\tcmdIdx := 2\n\ttimeStr := be.args[cmdIdx]\n\tcmdIdx = cmdIdx + 1\n\tbe.outFile = be.args[cmdIdx]\n\tcmdIdx = cmdIdx + 1\n\tbe.errFile = be.args[cmdIdx]\n\tcmdIdx = cmdIdx + 1\n\tbe.exitFile = be.args[cmdIdx]\n\tcmdIdx = cmdIdx + 1\n\tbe.command = be.args[cmdIdx]\n\tcmdIdx = cmdIdx + 1\n\n\t// Append other arguments\n\tbe.cmdargs = []string{be.command}\n\tfor _, arg := range be.args[minArgs:] {\n\t\tbe.cmdargs = append(be.cmdargs, arg)\n\t}\n\n\t// Parse time argument\n\ttimeSecs, err := strconv.Atoi(timeStr)\n\tif err != nil {\n\t\tlog.Fatalf(\"Invalid time: '%s'\\n\", timeStr)\n\t}\n\tbe.timeSecs = timeSecs\n\n\t// Show PID info (parent process is expecting this line first)\n\tfmt.Printf(\"%d\\n\", syscall.Getpid())\n\tos.Stdout.Sync()\n\n\t// Execute command\n\tbe.executeCommand()\n\n\tif DEBUG {\n\t\tlog.Printf(\"Debug, ExecuteCommandArgs: Exit code %d\\n\", be.exitCode)\n\t}\n\n\treturn be.exitCode\n}", "title": "" }, { "docid": "ae60ecb2b93e4fd300cc2cbac5ab6d3a", "score": "0.5570003", "text": "func (cmd *DispatchCommand) Exec(ctx *CLI, args []string) (Command, error) {\n\tif len(args) == 0 {\n\t\treturn cmd, fmt.Errorf(\"No subcommand provided\")\n\t}\n\n\tif args[0] == cmd.name {\n\t\targs = args[1:]\n\t}\n\n\tif len(args) == 0 {\n\t\treturn cmd, fmt.Errorf(\"No subcommand provided\")\n\t}\n\n\tsubcommand, found := cmd.subcommands[args[0]]\n\tif !found {\n\t\treturn cmd, fmt.Errorf(\"Unknown command: %q\", args[0])\n\t}\n\n\treturn ctx.Execute(subcommand, args[1:])\n}", "title": "" }, { "docid": "0841600c6369d57b68c208ae21677f95", "score": "0.55375344", "text": "func runExec(cmd *cobra.Command, args []string) {\n\tvars := make(map[string]string)\n\tif exe.vars != \"\" {\n\t\tvs := strings.Split(exe.vars, \",\")\n\t\tfor _, kvs := range vs {\n\t\t\tkv := strings.Split(kvs, \":\")\n\t\t\tif len(kv) != 2 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvars[kv[0]] = kv[1]\n\t\t}\n\t}\n\n\tif conn == nil {\n\t\trunExecWeb(cmd, vars)\n\t\treturn\n\t}\n\n\trunExecDB(cmd, vars)\n}", "title": "" }, { "docid": "dae1ba531a3ea2b15df4905c24bac723", "score": "0.5534528", "text": "func execvpe(file string, paths, argv, envv []string) error {\n\tif dir, _ := filepath.Split(file); dir != \"\" {\n\t\treturn syscall.Exec(file, argv, envv)\n\t}\n\n\tvar err error = syscall.ENOENT\n\n\tfor _, base := range paths {\n\t\tabspath := filepath.Join(base, file)\n\t\terr = syscall.Exec(abspath, argv, envv)\n\n\t\tif ec, ok := err.(syscall.Errno); ok {\n\t\t\tswitch ec {\n\t\t\tcase syscall.EACCES:\n\t\t\t\tcontinue\n\t\t\tcase syscall.ENOENT:\n\t\t\t\tcontinue\n\t\t\tcase syscall.ENOTDIR:\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tbreak\n\t}\n\n\treturn err\n}", "title": "" }, { "docid": "04570437fb93e3b88459cd8df7044a19", "score": "0.54940844", "text": "func Exec(cmd types.String, argsIn ...types.String) (types.String, error) {\n\targs := make([]string, len(argsIn))\n\tfor i, arg := range argsIn {\n\t\targs[i] = string(arg)\n\t}\n\toutput, err := exec.Command(string(cmd)).Output()\n\treturn types.String(output), err\n}", "title": "" }, { "docid": "b84b073dc617369baacba2b9efd2bc3d", "score": "0.5489387", "text": "func execCommand(cfg *Cfg, cliArgs []string, strict, fallback bool) error {\n\tif len(cliArgs) < 1 {\n\t\t// TODO show usage?\n\t\treturn ErrMissingCommand\n\t}\n\n\texecHandler, err := cfg.GetHandlerFor(cliArgs[0], strict, fallback)\n\tif err != nil {\n\t\treturn err\n\t}\n\twrappedCommand := execHandler.BuildCommand(cliArgs)\n\n\tbinary, err := exec.LookPath(wrappedCommand[0])\n\tif err != nil {\n\t\treturn err\n\t}\n\targs := []string{path.Base(wrappedCommand[0])}\n\targs = append(args, wrappedCommand[1:]...)\n\n\tenv := os.Environ()\n\n\terr = syscall.Exec(binary, args, env)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "5792315a4c1691a71bc69105a72f9981", "score": "0.54842913", "text": "func prepareCmdArgs(command string, argv []string) []string {\n\tcmdArgv := []string{extensionPrefix + command}\n\tcmdSplit := strings.Split(argv[0], command+\":\")\n\n\tif len(cmdSplit) > 1 {\n\t\tcmdArgv = append(cmdArgv, cmdSplit[1])\n\t}\n\n\treturn append(cmdArgv, argv[1:]...)\n}", "title": "" }, { "docid": "987b956b6908506bdca1b471020d45e2", "score": "0.54362625", "text": "func Exec(argv0 string, argv []string, envv []string) error {\n\tvar (\n\t\t_v0 error\n\t)\n\tfor {\n\t\t_v0 = unix.Exec(argv0, argv, envv)\n\t\tif _v0 != syscall.EINTR {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn _v0\n}", "title": "" }, { "docid": "ef885b24691a60878d00622325bff34b", "score": "0.54113376", "text": "func fakeExecCommand(command string, args ...string) *exec.Cmd {\n\n\tpassedInCommand = command\n\tpassedInArgs = args\n\n\tcs := []string{\"-test.run=TestHelperProcess\", \"--\", command}\n\tcs = append(cs, args...)\n\tcmd := exec.Command(os.Args[0], cs...)\n\tcmd.Env = []string{\"GO_WANT_HELPER_PROCESS=1\"}\n\treturn cmd\n}", "title": "" }, { "docid": "480fb6359d81d692920b37fb45dd9631", "score": "0.536061", "text": "func (c *Cmd) Exec(args []string) error {\n\tc.flag.Uint64Var(&version, \"version\", 0, \"\")\n\tc.flag.Parse(args)\n\n\t// Load config\n\tconfig = core.MustNewConfig(*dirPath).WithEnv(*env)\n\treturn c.Run(c, c.flag.Args()...)\n}", "title": "" }, { "docid": "59a30334feae41aa02f08c4e12485749", "score": "0.53457785", "text": "func Exec(args []string) {\n\tpath, err := exec.LookPath(args[0])\n\tif err != nil {\n\t\tos.Exit(1)\n\t}\n\terr = syscall.Exec(path, args, os.Environ())\n\tif err != nil {\n\t\tos.Exit(1)\n\t}\n}", "title": "" }, { "docid": "50e027006c9e14051dfac4284ef9355c", "score": "0.5336881", "text": "func Exec(name string, arg ...string) error {\n\tpath, err := exec.LookPath(name)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := CloseExtraFds(); err != nil {\n\t\treturn err\n\t}\n\tlogrus.Debugf(\"Execing %s %s\", name, strings.Join(arg, \" \"))\n\treturn syscall.Exec(path, append([]string{name}, arg...), os.Environ())\n}", "title": "" }, { "docid": "4d26311091d41d0b49299910f7997ee4", "score": "0.53273064", "text": "func Exec(exe string, args ...string) (outStr string, err error) {\n\tcommand := builder.NewCommand(exe, args...)\n\ts := NewShell()\n\toutStr, err = s.Exec(command)\n\treturn\n}", "title": "" }, { "docid": "699d8bb3b092a1692c2cfe3befd0ae91", "score": "0.5319998", "text": "func Exec(exe string, args ...string) (outStr string, err error) {\n\tvar (\n\t\tcmd *exec.Cmd\n\t\tout []byte\n\t)\n\n\tif exe == \"docker-compose\" {\n\t\targs = append(dockerComposeDefaultArgs(), args...)\n\t}\n\n\tcmd = exec.Command(exe, args...)\n\tcmd.Env = os.Environ()\n\tcmd.Stdin = os.Stdin\n\n\tout, err = cmd.CombinedOutput()\n\toutStr = strings.TrimSpace(string(out))\n\treturn\n}", "title": "" }, { "docid": "6de20cf6bf9035c4b82b39a4f5d2cb48", "score": "0.53117985", "text": "func (env *Env) Exec(opts *ExecOpts, p *prog.Prog) (output []byte, info *ProgInfo, hanged bool, err0 error) {\n\t// Copy-in serialized program.\n\tprogSize, err := p.SerializeForExec(env.in)\n\tif err != nil {\n\t\terr0 = fmt.Errorf(\"failed to serialize: %v\", err)\n\t\treturn\n\t}\n\tvar progData []byte\n\tif env.config.Flags&FlagUseShmem == 0 {\n\t\tprogData = env.in[:progSize]\n\t\tlog.Logf(3, \"progData : %v\", progData)\n\t}\n\t// Zero out the first two words (ncmd and nsig), so that we don't have garbage there\n\t// if executor crashes before writing non-garbage there.\n\tfor i := 0; i < 4; i++ {\n\t\tenv.out[i] = 0\n\t}\n\n\tatomic.AddUint64(&env.StatExecs, 1)\n\tif env.cmd == nil {\n\t\tif p.Target.OS == \"akaros\" {\n\t\t\t// On akaros executor is actually ssh,\n\t\t\t// starting them too frequently leads to timeouts.\n\t\t\t<-rateLimit.C\n\t\t}\n\t\ttmpDirPath := \"./\"\n\t\tif p.Target.OS == \"fuchsia\" {\n\t\t\ttmpDirPath = \"/data/\"\n\t\t}\n\t\tatomic.AddUint64(&env.StatRestarts, 1)\n\t\tenv.cmd, err0 = makeCommand(env.pid, env.bin, env.config, env.inFile, env.outFile, env.out, tmpDirPath)\n\t\t//log.Logf(3, \"env.cmd : %v\", env.cmd)\n\t\tif err0 != nil {\n\t\t\treturn\n\t\t}\n\t}\n\toutput, hanged, err0 = env.cmd.exec(opts, progData)\n\tif err0 != nil {\n\t\tenv.cmd.close()\n\t\tenv.cmd = nil\n\t\treturn\n\t}\n\n\tinfo, err0 = env.parseOutput(p)\n\tif info != nil && env.config.Flags&FlagSignal == 0 {\n\t\taddFallbackSignal(p, info)\n\t}\n\tif env.config.Flags&FlagUseForkServer == 0 {\n\t\tenv.cmd.close()\n\t\tenv.cmd = nil\n\t}\n\treturn\n}", "title": "" }, { "docid": "23f91f24dfe13290cddcfcb20a5dc8ae", "score": "0.53068197", "text": "func (commands CommandMap) Exec(arguments []string) error {\n\tcommand, arguments, err := commands.Find(arguments)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn command.Exec(arguments)\n}", "title": "" }, { "docid": "aedceb943479b8a9d4878419a992a48c", "score": "0.5271058", "text": "func prepareProcessExec(c *Container, cmd []string, tty bool) (processFile string, retErr error) {\n\tf, err := os.CreateTemp(\"\", \"exec-process-\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tf.Close()\n\tprocessFile = f.Name()\n\tdefer func() {\n\t\tif retErr != nil {\n\t\t\tos.RemoveAll(processFile)\n\t\t}\n\t}()\n\n\t// It's important to make a spec copy here to not overwrite the initial\n\t// process spec\n\tpspec := *c.Spec().Process\n\tpspec.Args = cmd\n\t// We need to default this to false else it will inherit terminal as true\n\t// from the container.\n\tpspec.Terminal = false\n\tif tty {\n\t\tpspec.Terminal = true\n\t}\n\tprocessJSON, err := json.Marshal(pspec)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif err := os.WriteFile(processFile, processJSON, 0o644); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn processFile, nil\n}", "title": "" }, { "docid": "c6739c4f19f3a84fec998eaf672f35b5", "score": "0.52554065", "text": "func (ef *ExecFlags) NewExecOptions(vmMatch string, command ...string) (eo *ExecOptions, err error) {\n\teo = &ExecOptions{\n\t\tExecFlags: ef,\n\t\tcommand: command,\n\t}\n\n\teo.vm, err = getVMForMatch(vmMatch)\n\treturn\n}", "title": "" }, { "docid": "3dc9138ee52da9894ec6653db3e3cbb9", "score": "0.52402055", "text": "func execCmd(e *packfile.Exec, ctxDir string) (*exec.Cmd, io.Closer, error) {\n\tif e.Inline != \"\" && e.Path != \"\" {\n\t\treturn nil, nil, xerrors.New(\"both inline and path specified\")\n\t}\n\tshell := e.Shell\n\tparts := strings.SplitN(shell, \" \", 2)\n\tif len(parts) == 0 {\n\t\treturn nil, nil, xerrors.New(\"missing shell\")\n\t}\n\tvar args []string\n\tif len(parts) > 1 {\n\t\tshell = parts[0]\n\t\targs = append(args, parts[1])\n\t}\n\tif e.Inline != \"\" {\n\t\tf, err := ioutil.TempFile(\"\", \"packfile.\")\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tdefer f.Close()\n\t\tif _, err := f.WriteString(e.Inline); err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\treturn exec.Command(shell, append(args, f.Name())...), rmCloser{f.Name()}, nil\n\t}\n\n\tif e.Path == \"\" {\n\t\treturn nil, nil, xerrors.New(\"missing executable\")\n\t}\n\n\treturn exec.Command(shell, append(args, filepath.Join(ctxDir, e.Path))...), nopCloser{}, nil\n}", "title": "" }, { "docid": "31c4bf1993e85f6a649634fa37fcb0b3", "score": "0.5236229", "text": "func prepareProcessExec(c *Container, cmd, env []string, tty bool, cwd, user, sessionID string) (*os.File, error) {\n\tf, err := ioutil.TempFile(c.execBundlePath(sessionID), \"exec-process-\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tpspec := c.config.Spec.Process\n\tpspec.Args = cmd\n\t// We need to default this to false else it will inherit terminal as true\n\t// from the container.\n\tpspec.Terminal = false\n\tif tty {\n\t\tpspec.Terminal = true\n\t}\n\tif len(env) > 0 {\n\t\tpspec.Env = append(pspec.Env, env...)\n\t}\n\n\tif cwd != \"\" {\n\t\tpspec.Cwd = cwd\n\n\t}\n\t// If user was set, look it up in the container to get a UID to use on\n\t// the host\n\tif user != \"\" {\n\t\texecUser, err := lookup.GetUserGroupInfo(c.state.Mountpoint, user, nil)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tsgids := make([]uint32, 0, len(execUser.Sgids))\n\t\tfor _, sgid := range execUser.Sgids {\n\t\t\tsgids = append(sgids, uint32(sgid))\n\t\t}\n\t\tprocessUser := spec.User{\n\t\t\tUID: uint32(execUser.Uid),\n\t\t\tGID: uint32(execUser.Gid),\n\t\t\tAdditionalGids: sgids,\n\t\t}\n\n\t\tpspec.User = processUser\n\t}\n\n\tprocessJSON, err := json.Marshal(pspec)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := ioutil.WriteFile(f.Name(), processJSON, 0644); err != nil {\n\t\treturn nil, err\n\t}\n\treturn f, nil\n}", "title": "" }, { "docid": "8aa0b026ff50e42f39e17e9252f1a050", "score": "0.5234377", "text": "func (st *statement) Exec(args []driver.Value) (driver.Result, error) {\n\tnargs := make([]driver.NamedValue, len(args))\n\tfor i, arg := range args {\n\t\tnargs[i].Ordinal = i + 1\n\t\tnargs[i].Value = arg\n\t}\n\treturn st.ExecContext(context.Background(), nargs)\n}", "title": "" }, { "docid": "61a834c31aed835d8e8555dc516dd9af", "score": "0.5225149", "text": "func UpdateExecID(bytes []byte, t *testing.T) []byte {\n\traw := UnmarshalIntoEmptyInterface(bytes, t)\n\n\tvar execRefReader struct {\n\t\tExecRef string\n\t}\n\tif err := json.Unmarshal(bytes, &execRefReader); err != nil {\n\t\tt.Fatal(\"read execRef using json.Unmarshal:\", err)\n\t}\n\n\tvar ok bool\n\traw[\"ExecID\"], ok = execIDs[execRefReader.ExecRef]\n\tif !ok {\n\t\tt.Fatal(\"execID not available for ref=\", execRefReader.ExecRef)\n\t}\n\tnewBytes, err := json.Marshal(raw)\n\tt.MustNil(err)\n\treturn newBytes\n}", "title": "" }, { "docid": "2e9906cdd1d96c866451e632dd496fc7", "score": "0.52211666", "text": "func TestCmdExec(t *testing.T) {\n\tassert := asrt.New(t)\n\torigDir, err := os.Getwd()\n\trequire.NoError(t, err)\n\n\tsite := TestSites[0]\n\terr = os.Chdir(site.Dir)\n\trequire.NoError(t, err)\n\n\tt.Cleanup(func() {\n\t\terr = os.Chdir(origDir)\n\t\tassert.NoError(err)\n\t})\n\tapp, err := ddevapp.GetActiveApp(site.Name)\n\tassert.NoError(err)\n\n\t// Test default invocation\n\tout, err := exec.RunHostCommand(DdevBin, \"exec\", \"pwd\")\n\tassert.NoError(err)\n\tassert.Contains(out, \"/var/www/html\")\n\n\t// Test specifying service\n\tout, err = exec.RunHostCommand(DdevBin, \"-s\", \"db\", \"exec\", \"pwd\")\n\tassert.NoError(err)\n\tassert.Contains(out, \"/\")\n\n\t// Test specifying working directory\n\tout, err = exec.RunHostCommand(DdevBin, \"exec\", \"-d\", \"/bin\", \"pwd\")\n\tassert.NoError(err)\n\tassert.Contains(out, \"/bin\")\n\n\t// Test specifying service and working directory\n\tout, err = exec.RunHostCommand(DdevBin, \"exec\", \"-s\", \"db\", \"-d\", \"/var\", \"pwd\")\n\tassert.NoError(err)\n\tassert.Contains(out, \"/var\")\n\n\t// Test with raw cmd\n\tout, err = exec.RunHostCommand(DdevBin, \"exec\", \"--raw\", \"--\", \"ls\", \"/usr/local\")\n\tassert.NoError(err)\n\n\tassert.True(strings.HasPrefix(out, \"bin\\netc\\ngames\"), \"expected '%v' to start with 'bin\\\\netc\\\\games\\\\include'\", out)\n\n\t// Test sudo\n\tout, err = exec.RunHostCommand(DdevBin, \"exec\", \"sudo\", \"whoami\")\n\tassert.NoError(err)\n\tassert.Contains(out, \"root\")\n\n\t// Test that an nonexistent working directory generates an error\n\tout, err = exec.RunHostCommand(DdevBin, \"exec\", \"-d\", \"/does/not/exist\", \"pwd\")\n\tassert.Error(err)\n\tassert.Contains(out, \"no such file or directory\")\n\n\t_, err = exec.RunHostCommand(DdevBin, \"exec\", \"ls >/var/www/html/TestCmdExec-${OSTYPE}.txt\")\n\tassert.NoError(err)\n\terr = app.MutagenSyncFlush()\n\tassert.NoError(err)\n\tassert.FileExists(filepath.Join(site.Dir, \"TestCmdExec-linux-gnu.txt\"))\n\n\t_, err = exec.RunHostCommand(DdevBin, \"exec\", \"ls >/dev/null && touch /var/www/html/TestCmdExec-touch-all-in-one.txt\")\n\tassert.NoError(err)\n\n\t// We just created in the container, must flush before looking for it on host\n\terr = app.MutagenSyncFlush()\n\tassert.NoError(err)\n\n\tassert.FileExists(filepath.Join(site.Dir, \"TestCmdExec-touch-all-in-one.txt\"))\n\n\t_, err = exec.RunHostCommand(DdevBin, \"exec\", \"true\", \"&&\", \"touch\", \"/var/www/html/TestCmdExec-touch-separate-args.txt\")\n\tassert.NoError(err)\n\n\terr = app.MutagenSyncFlush()\n\tassert.NoError(err)\n\n\tassert.FileExists(filepath.Join(site.Dir, \"TestCmdExec-touch-separate-args.txt\"))\n\n\tbashPath := util.FindBashPath()\n\t// Make sure we can pipe things into ddev exec and have them work in stdin inside container\n\tfilename := t.Name() + \"_junk.txt\"\n\tddevBinForBash := dockerutil.MassageWindowsHostMountpoint(DdevBin)\n\t_, err = exec.RunHostCommand(bashPath, \"-c\", fmt.Sprintf(`printf \"This file was piped into ddev exec\" | %s exec \"cat >/var/www/html/%s\"`, ddevBinForBash, filename))\n\tassert.NoError(err)\n\terr = app.MutagenSyncFlush()\n\tassert.NoError(err)\n\trequire.FileExists(t, filepath.Join(site.Dir, filename))\n\n\tcontent, err := os.ReadFile(filepath.Join(site.Dir, filename))\n\tassert.NoError(err)\n\tassert.Equal(\"This file was piped into ddev exec\", string(content))\n\n\t// Make sure that redirection of output from ddev exec works\n\tf, err := os.CreateTemp(\"\", \"\")\n\terr = f.Close()\n\tassert.NoError(err)\n\tdefer os.Remove(f.Name()) // nolint: errcheck\n\n\tbashTempName := dockerutil.MassageWindowsHostMountpoint(f.Name())\n\t_, err = exec.RunHostCommand(bashPath, \"-c\", fmt.Sprintf(\"%s exec ls -l //usr/local/bin/composer >%s\", ddevBinForBash, bashTempName))\n\n\tout, err = fileutil.ReadFileIntoString(f.Name())\n\tassert.NoError(err)\n\tassert.Contains(out, \"/usr/local/bin/composer\")\n}", "title": "" }, { "docid": "2ab35b2988343fa1923255ae44cae5d0", "score": "0.52206814", "text": "func (e *ExecCmdTestHelper) ExecCommand(command string, args ...string) *exec.Cmd {\n\tcs := []string{\"-test.run=\" + e.testHelperFuncName, \"--\", command}\n\tcs = append(cs, args...)\n\tcmd := exec.Command(os.Args[0], cs...)\n\n\tfullCommand := command\n\n\tif len(args) > 0 {\n\t\tfullCommand = command + \" \" + strings.Join(args, \" \")\n\t}\n\n\tbase64Command := base64.StdEncoding.EncodeToString([]byte(strings.Fields(fullCommand)[0]))\n\n\tif len(e.testResults[base64Command]) == 0 {\n\t\tfmt.Println(\"No result was setup for command: \", fullCommand)\n\t\treturn nil\n\t}\n\n\t// Retrieve next result\n\tmockResults := e.testResults[base64Command][0]\n\n\t// Remove current result so that next time it will use next result that was setup. If no next result, re-use same result.\n\tif len(e.testResults[base64Command]) > 1 {\n\t\te.testResults[base64Command] = e.testResults[base64Command][1:]\n\t}\n\n\tar := execTestArgsKey + \"=\" + strings.Join(args, \" \")\n\tstdout := execTestStdOutputKey + \"=\" + mockResults.stdOut\n\tstderr := execTestStdErrorKey + \"=\" + mockResults.stdErr\n\texitCode := execTestExitCodeKey + \"=\" + strconv.FormatInt(int64(mockResults.exitCode), 10)\n\tdelay := execTestDelayKey + \"=\" + strconv.FormatInt(int64(mockResults.delay), 10)\n\tcmd.Env = []string{\"GO_WANT_HELPER_PROCESS=1\", stdout, stderr, exitCode, delay, ar}\n\n\treturn cmd\n}", "title": "" }, { "docid": "e52579d92caf35c2e0b3b9fa79b97db9", "score": "0.5171569", "text": "func forkExec(files []*os.File) (int, *os.File, error) {\n\t// Get the path name for the executable that started the current process.\n\tpath, err := os.Executable()\n\tif err != nil {\n\t\treturn -1, nil, err\n\t}\n\t// @TODO: remove\n\t// Fix the path name after the evaluation of any symbolic links.\n\tpath, err = filepath.EvalSymlinks(path)\n\tif err != nil {\n\t\treturn -1, nil, err\n\t}\n\n\tfds, err := syscall.Socketpair(syscall.AF_UNIX, syscall.SOCK_STREAM, 0)\n\tif err != nil {\n\t\treturn -1, nil, err\n\t}\n\tf0 := os.NewFile(uintptr(fds[0]), \"s|0\")\n\tf1 := os.NewFile(uintptr(fds[1]), \"s|1\")\n\tfiles = append(files, f1)\n\n\t// Start the original executable with the original working directory.\n\tprocess, err := os.StartProcess(path, os.Args, &os.ProcAttr{\n\t\tDir: originalWD,\n\t\tEnv: prepareEnv(len(files)),\n\t\tFiles: append([]*os.File{os.Stdin, os.Stdout, os.Stderr}, files...),\n\t})\n\tif err != nil {\n\t\treturn -1, nil, err\n\t}\n\n\treturn process.Pid, f0, nil\n}", "title": "" }, { "docid": "5e703da408328cf9bd375d8b55f581bc", "score": "0.51703554", "text": "func (s *Supervisor) Exec(ctx context.Context, _ struct{}, _ *struct{}) error {\n\ts.mu.Lock()\n\tvar (\n\t\tenviron = append(os.Environ(), s.environ...)\n\t\tpath = s.binaryPath\n\t)\n\ts.mu.Unlock()\n\tif path == \"\" {\n\t\treturn errors.E(errors.Invalid, \"Supervisor.Exec: no binary set\")\n\t}\n\tlog.Printf(\"exec %s %s\", path, strings.Join(os.Args, \" \"))\n\treturn syscall.Exec(path, os.Args, environ)\n}", "title": "" }, { "docid": "a42bb96f3c5a724bfc73b0a857fd33bc", "score": "0.514617", "text": "func (d Dreck) execCmd(parts []string, trigger string) (*exec.Cmd, error) {\n\n\tcmd := exec.Command(parts[0], parts[1:]...)\n\tfor i := range parts {\n\t\tif !sanitize(parts[i]) {\n\t\t\treturn nil, fmt.Errorf(\"exec: %q doesn't adhere to the sanitize checks\", parts[i])\n\t\t}\n\t}\n\n\t// run as d.user, if not empty\n\tif d.user != \"\" {\n\t\tuid, gid, err := userID(d.user)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tcmd.SysProcAttr = &syscall.SysProcAttr{}\n\t\tcmd.SysProcAttr.Credential = &syscall.Credential{Uid: uid, Gid: gid}\n\t}\n\n\t// extend environment\n\tenv := os.Environ()\n\tenv = append(env, fmt.Sprintf(\"GITHUB_TRIGGER=%s\", trigger))\n\tfor e, v := range d.env {\n\t\tenv = append(env, fmt.Sprintf(\"%s=%s\", e, v))\n\t}\n\tcmd.Env = env\n\n\treturn cmd, nil\n}", "title": "" }, { "docid": "8b7fb253e72fcf3c0800ce4343b27213", "score": "0.513684", "text": "func Exec(ctx context.Context, e Execable, cmd string, args []string, opts ExecOptions) (ExecCommand, error) {\n\tsubmitMethodInvocation(ctx, e, \"Exec\")\n\treturn e.Exec(ctx, cmd, args, opts)\n}", "title": "" }, { "docid": "25c548a9ed9ba693b70786f313c912b0", "score": "0.51347464", "text": "func fakeExecCommand(command string, args ...string) *exec.Cmd {\n\tcs := []string{\"-test.run=TestHelperProcess\", \"--\", command}\n\tcs = append(cs, args...)\n\tcmd := exec.Command(os.Args[0], cs...)\n\tcmd.Env = []string{\"GO_WANT_HELPER_PROCESS=1\"}\n\treturn cmd\n}", "title": "" }, { "docid": "25c548a9ed9ba693b70786f313c912b0", "score": "0.51347464", "text": "func fakeExecCommand(command string, args ...string) *exec.Cmd {\n\tcs := []string{\"-test.run=TestHelperProcess\", \"--\", command}\n\tcs = append(cs, args...)\n\tcmd := exec.Command(os.Args[0], cs...)\n\tcmd.Env = []string{\"GO_WANT_HELPER_PROCESS=1\"}\n\treturn cmd\n}", "title": "" }, { "docid": "25c548a9ed9ba693b70786f313c912b0", "score": "0.51347464", "text": "func fakeExecCommand(command string, args ...string) *exec.Cmd {\n\tcs := []string{\"-test.run=TestHelperProcess\", \"--\", command}\n\tcs = append(cs, args...)\n\tcmd := exec.Command(os.Args[0], cs...)\n\tcmd.Env = []string{\"GO_WANT_HELPER_PROCESS=1\"}\n\treturn cmd\n}", "title": "" }, { "docid": "25f6e99b4cb83a6212bb0a278932cc67", "score": "0.51216406", "text": "func TestCmdExecBadArgs(t *testing.T) {\n\t// Change to the first DevTestSite for the duration of this test.\n\tdefer TestSites[0].Chdir()()\n\tassert := asrt.New(t)\n\n\targs := []string{\"exec\"}\n\tout, err := exec.RunCommand(DdevBin, args)\n\tassert.Error(err)\n\tassert.Contains(string(out), \"Usage:\")\n}", "title": "" }, { "docid": "07b5998c3da98f27659f04cda80aec25", "score": "0.51215905", "text": "func (t TreeCommand) Exec([]string) error {\n\treturn nil\n}", "title": "" }, { "docid": "897c53824e766baa097a2498c8ebf59b", "score": "0.5072733", "text": "func ExecCmdBytes(cmdName string, args ...string) ([]byte, []byte, error) {\n\treturn ExecCmdDirBytes(\"\", cmdName, args...)\n}", "title": "" }, { "docid": "14587981922baa1712f631c15070cf96", "score": "0.50539523", "text": "func commandAndArgs(uf *unit.File, c corev1.Container) []string {\n\t// If command and/or args are given we need to override the ExecStart\n\texecStart := uf.Contents[\"Service\"][\"ExecStart\"]\n\tcmdargs := execStart\n\tif len(execStart) == 1 {\n\t\tcmdargs = strings.Fields(execStart[0])\n\t}\n\tif len(cmdargs) == 0 {\n\t\tcmdargs = make([]string, 1)\n\t}\n\n\tif c.Command != nil {\n\t\tif cmd := c.Command[0]; !path.IsAbs(cmd) {\n\t\t\tfullpath, err := exec.LookPath(cmd)\n\t\t\tif err == nil {\n\t\t\t\tc.Command[0] = fullpath\n\t\t\t}\n\t\t}\n\t\tcmdargs[0] = strings.Join(c.Command, \" \") // TODO(miek) some args might be included here. Does this needs quoting?\n\t}\n\tif c.Args != nil {\n\t\tif len(cmdargs) > 0 {\n\t\t\tcmdargs = cmdargs[:1]\n\t\t}\n\t\t// quote the arguments\n\t\tfor _, a := range c.Args {\n\t\t\tcmdargs = append(cmdargs, fmt.Sprintf(\"%q\", a))\n\n\t\t}\n\t}\n\n\treturn cmdargs\n}", "title": "" }, { "docid": "05f8b755ac4604eafa6053750a88578c", "score": "0.50519574", "text": "func execCommand(name string, arg ...string) *exec.Cmd {\n\treturn exec.Command(name, arg...)\n}", "title": "" }, { "docid": "ccffb6719fc9ff4f07f595bbf9c89fe8", "score": "0.50248903", "text": "func SyscallCommandNotReturn(args []string) {\n //args2 := []string{\"ls\", \"-a\", \"-l\", \"-h\"}\n //args2 := []string{\"git\", \"clone\", \"git@github.com:runscripts/script.git\", \"/Users/tobe/Desktop/temp/script\"}\n\n log.Info(\"Start to execute command \" + args[0])\n\n binary, lookErr := exec.LookPath(args[0])\n\n if lookErr != nil {\n log.Error(\"Error to find the command \" + args[0])\n panic(lookErr)\n }\n\n env := os.Environ()\n\n execErr := syscall.Exec(binary, args, env)\n if execErr != nil {\n log.Error(\"Error to execute command \" + args[0])\n panic(execErr)\n }\n\n}", "title": "" }, { "docid": "3fa2552c0f2fd8e29d61d4bb826850fe", "score": "0.49923012", "text": "func mockExecCommandReturns(stdout, stderr string, retcode int) *exec.Cmd {\n\tcmd := exec.Command(os.Args[0], \"-test.run=TestExecHelperProcess\") //nolint:gosec //Rook controls the input to the exec arguments\n\tcmd.Env = append(os.Environ(),\n\t\t\"GO_WANT_HELPER_PROCESS=1\",\n\t\tfmt.Sprintf(\"GO_HELPER_PROCESS_STDOUT=%s\", stdout),\n\t\tfmt.Sprintf(\"GO_HELPER_PROCESS_STDERR=%s\", stderr),\n\t\tfmt.Sprintf(\"GO_HELPER_PROCESS_RETCODE=%d\", retcode),\n\t)\n\treturn cmd\n}", "title": "" }, { "docid": "ac0a8bf4bb12cb56fa8932c6513117be", "score": "0.49781933", "text": "func setupExecAllocator(opts ...ExecAllocatorOption) *ExecAllocator {\n\tep := &ExecAllocator{\n\t\tinitFlags: make(map[string]interface{}),\n\t}\n\tfor _, o := range opts {\n\t\to(ep)\n\t}\n\tif ep.execPath == \"\" {\n\t\tep.execPath = findExecPath()\n\t}\n\treturn ep\n}", "title": "" }, { "docid": "8c154e1daad255e8a3b5023e1b4c99f3", "score": "0.49762395", "text": "func fakeExecCmd(testName string, testRunName string, command string, args ...string) *exec.Cmd {\n\tcs := []string{fmt.Sprintf(\"-test.run=%s\", testName), \"--\", testRunName}\n\tcs = append(cs, command)\n\tcs = append(cs, args...)\n\tcmd := exec.Command(os.Args[0], cs...)\n\tcmd.Env = []string{\"GO_TEST_PROCESS=1\"}\n\treturn cmd\n}", "title": "" }, { "docid": "d683da1ccb8a09e5975b51b8ede1b73f", "score": "0.49734426", "text": "func (util *Utility) ExeCommand(\n\tlog log.T,\n\tcmd string,\n\tworkingDir string,\n\toutputRoot string,\n\tstdOut string,\n\tstdErr string,\n\tisAsync bool) (int, updateconstants.UpdateScriptExitCode, error) { // pid, exitCode, error\n\n\tparts := strings.Fields(cmd)\n\tpid := -1\n\tvar updateExitCode updateconstants.UpdateScriptExitCode = -1\n\n\tif isAsync {\n\t\tcommand := execCommand(parts[0], parts[1:]...)\n\t\tcommand.Dir = workingDir\n\t\tutil.setCommandEnvironmentVariables(command)\n\t\tprepareProcess(command)\n\t\t// Start command asynchronously\n\t\terr := cmdStart(command)\n\t\tif err != nil {\n\t\t\treturn pid, updateExitCode, err\n\t\t}\n\t\tpid = GetCommandPid(command)\n\t} else {\n\t\ttempCmd := setPlatformSpecificCommand(parts)\n\t\tcommand := execCommand(tempCmd[0], tempCmd[1:]...)\n\t\tcommand.Dir = workingDir\n\t\tstdoutWriter, stderrWriter, err := setExeOutErr(outputRoot, stdOut, stdErr)\n\t\tif err != nil {\n\t\t\treturn pid, updateExitCode, err\n\t\t}\n\t\tdefer stdoutWriter.Close()\n\t\tdefer stderrWriter.Close()\n\n\t\tcommand.Stdout = stdoutWriter\n\t\tcommand.Stderr = stderrWriter\n\n\t\terr = cmdStart(command)\n\t\tif err != nil {\n\t\t\treturn pid, updateExitCode, err\n\t\t}\n\n\t\tpid = GetCommandPid(command)\n\n\t\tvar timeout = updateconstants.DefaultUpdateExecutionTimeoutInSeconds\n\t\tif util.CustomUpdateExecutionTimeoutInSeconds != 0 {\n\t\t\ttimeout = util.CustomUpdateExecutionTimeoutInSeconds\n\t\t}\n\t\ttimer := time.NewTimer(time.Duration(timeout) * time.Second)\n\t\tgo killProcessOnTimeout(log, command, timer)\n\t\terr = command.Wait()\n\t\ttimedOut := !timer.Stop()\n\t\tif err != nil {\n\t\t\tlog.Debugf(\"command returned error %v\", err)\n\t\t\tif exitErr, ok := err.(*exec.ExitError); ok {\n\t\t\t\t// The program has exited with an exit code != 0\n\t\t\t\tif status, ok := exitErr.Sys().(syscall.WaitStatus); ok {\n\t\t\t\t\texitCode := status.ExitStatus()\n\t\t\t\t\tif exitCode == -1 && timedOut {\n\t\t\t\t\t\t// set appropriate exit code based on cancel or timeout\n\t\t\t\t\t\texitCode = appconfig.CommandStoppedPreemptivelyExitCode\n\t\t\t\t\t\tlog.Infof(\"The execution of command was timedout.\")\n\t\t\t\t\t}\n\t\t\t\t\tupdateExitCode = updateconstants.UpdateScriptExitCode(exitCode)\n\t\t\t\t\terr = fmt.Errorf(\"The execution of command returned Exit Status: %d \\n %v\", exitCode, err.Error())\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn pid, updateExitCode, err\n\t\t}\n\t}\n\treturn pid, updateExitCode, nil\n}", "title": "" }, { "docid": "717c49a689b04d5909355e180774290a", "score": "0.49689573", "text": "func (es *execShim) Exec(containerID string, cmd []string, in io.Reader, out, errOut io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize) error {\n\tuuid, appName, err := parseContainerID(containerID)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// TODO(euank): Make it possible to use \"k8s.io/kubernetes/pkg/util/exec.Cmd\"\n\t// by adding more methods (for mocking)\n\tcmdList := []string{\"app\", \"exec\", \"--app=\" + appName, uuid}\n\tcmdList = append(cmdList, cmd...)\n\trktCommand := es.cli.Command(cmdList[0], cmdList[1:]...)\n\texecCmd := exec.Command(rktCommand[0], rktCommand[1:]...)\n\tglog.V(5).Infof(\"executing command: %v\", execCmd.Args)\n\n\tif tty {\n\t\treturn execWithTty(execCmd, in, out, resize)\n\t}\n\n\tif in != nil {\n\t\texecCmd.Stdin = in\n\t}\n\texecCmd.Stdout = out\n\texecCmd.Stderr = errOut\n\n\tif err := execCmd.Start(); err != nil {\n\t\tglog.Warningf(\"error running exec: %v\", err)\n\t\treturn err\n\t}\n\n\tif err := execCmd.Wait(); err != nil {\n\t\tglog.Warningf(\"error waiting for exec: %v\", err)\n\t\treturn newRktExitError(err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "de3c33c88a9ca61e4d25d75e0d936381", "score": "0.49668515", "text": "func CmdExec(t *testing.T, cmd string) {\n\tt.Helper()\n\targs := strings.Split(cmd, \" \")\n\tif err := exec.Command(args[0], args[1:]...).Run(); err != nil {\n\t\tt.Errorf(\"cmd (%s) exec: %v\", cmd, err)\n\t}\n}", "title": "" }, { "docid": "29bdc86f28fbdcc2e83f38a902415157", "score": "0.49659887", "text": "func Exec(t *hm.Task, command string, args ...string) *Executor {\n\tvar target Target\n\tt.Target.GetExt(&target)\n\tcmd := exec.Command(command, args...)\n\tcmd.Env = append([]string{}, os.Environ()...)\n\tcmd.Env = append(cmd.Env, target.Env...)\n\tfor name, value := range t.Plan.Env {\n\t\tcmd.Env = append(cmd.Env, name+\"=\"+value)\n\t}\n\tcmd.Env = append(cmd.Env, t.EnvVars()...)\n\tcmd.Dir = filepath.Join(t.Project().BaseDir, t.Target.WorkingDir())\n\treturn &Executor{\n\t\tTask: t,\n\t\tCmd: cmd,\n\t\tConsole: target.Console || t.Target.Exec,\n\t\tStdout: true,\n\t\tStderr: true,\n\t\tLogToTask: true,\n\t}\n}", "title": "" }, { "docid": "fc8bad202c31dee520ebbb4e81a82a4a", "score": "0.49613875", "text": "func (j DeployCmd) CommandExec() error {\n\n\tprintln(\"deploy\")\n\n\tappNode := app.NewAppNode(\"node\")\n\n\treturn appNode.Start()\n}", "title": "" }, { "docid": "1e1bebd33c0d399d04a6f25644ea1182", "score": "0.4936725", "text": "func GetExecAddr(exec string, addressID int32) (string, error) {\n\tif ok := types.IsAllowExecName([]byte(exec), []byte(exec)); !ok {\n\t\treturn \"\", types.ErrExecNameNotAllow\n\t}\n\taddrResult, err := address.GetExecAddress(exec, addressID)\n\treturn addrResult, err\n}", "title": "" }, { "docid": "12dcea922cd98ffdcf5d94c0af68cecf", "score": "0.49181765", "text": "func (subC *ServerSubConn) Exec(expected int, format string, args ...interface{}) (int, string, error) {\n\treturn subC.cmd(expected, format, args...)\n}", "title": "" }, { "docid": "4a16a7400a27d6b7be33c62671abe294", "score": "0.49109915", "text": "func (e *Executor) Exec(o Output, args []string) error {\n\tfor _, arg := range args {\n\t\tisDir, err := afero.IsDir(e.fs, arg)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif isDir {\n\t\t\te.handleDir(o, arg)\n\t\t\tcontinue\n\t\t}\n\n\t\texists, err := afero.Exists(e.fs, arg)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif exists {\n\t\t\to.HandleFile(arg)\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "1df1e94cea3d692fb0cd058be33f0480", "score": "0.4909836", "text": "func (t *testFakeCtx) Exec(ctx context.Context, cmd string, args []string) ([]byte, int, error) {\n\tselect {\n\tcase t.execs <- 1:\n\tdefault:\n\t}\n\tif t.ExecFunc == nil {\n\t\t// Default impl is just \"ok\"\n\t\treturn []byte(\"ok\"), 0, nil\n\t}\n\treturn t.ExecFunc(ctx, cmd, args)\n}", "title": "" }, { "docid": "071a153784b697c49d4fa0714553a3a2", "score": "0.4896938", "text": "func ExecCmd(args []string) error {\n\tconfig.Debug(\"ExecCmd args: \", strings.Join(args, \", \"))\n\tif len(args) < 1 {\n\t\treturn nil\n\t}\n\n\tcommand := cmd.FindCommand(args[0])\n\tif command != nil && !(args[0] == \"sync\" && len(args) > 1) {\n\t\treturn command.Handle(cmd.NewRequest(command, cfg, args[1:]))\n\t}\n\n\tcatchAllHandler := cmd.GetAPIHandler()\n\treturn catchAllHandler.Handle(cmd.NewRequest(catchAllHandler, cfg, args))\n}", "title": "" }, { "docid": "c32e91a61eef10f90a9e9f99777657e2", "score": "0.48858336", "text": "func (stmt *statement) Exec(args []driver.Value) (driver.Result, error) {\n\treturn stmt.ExecContext(context.Background(), dblib.ValuesToNamedValues(args))\n}", "title": "" }, { "docid": "be6ad18118d3694cc3386a3b9b325ae2", "score": "0.48824203", "text": "func GetFakeExecRunCommands() []v1.ExecCommand {\n\treturn []v1.ExecCommand{\n\t\t{\n\t\t\tCommandLine: \"ls -a\",\n\t\t\tComponent: \"alias1\",\n\t\t\tLabeledCommand: v1.LabeledCommand{\n\t\t\t\tBaseCommand: v1.BaseCommand{\n\t\t\t\t\tGroup: &v1.CommandGroup{\n\t\t\t\t\t\tKind: v1.RunCommandGroupKind,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\tWorkingDir: \"/root\",\n\t\t},\n\t}\n}", "title": "" }, { "docid": "99d543f28917f0af79837270c267207c", "score": "0.48820257", "text": "func (e *MultiExec) Exec(code []byte, arg string, env interface{}) (ExecResult, error) {\n\terrs := []error{}\n\tfor _, each := range e.nextExecOrder() {\n\t\tres, err := each.Exec(code, arg, env)\n\t\tif err == nil || err == ErrExecutionimeout {\n\t\t\treturn res, err\n\t\t} else {\n\t\t\terrs = append(errs, err)\n\t\t}\n\t}\n\treturn ExecResult{}, &MultiError{errs: errs}\n}", "title": "" }, { "docid": "1c0566a6610a957ed22fc1a23c2a469c", "score": "0.48798978", "text": "func (c *Config) Exec(command string, args []string) (err error) {\n\tvar exec execFunc\n\tvar after afterFunc\n\n\tcertFile := path.Join(c.DataDir, \"cert.pem\")\n\tkeyFile := path.Join(c.DataDir, \"key.pem\")\n\n\tc.certs = certs.New(c.logger)\n\tc.certs.CheckCreateTLS(keyFile, certFile, c.CertNames)\n\tc.certs.LoadTLS(keyFile, certFile)\n\n\tswitch command {\n\tcase \"list-tokens\":\n\t\texec = c.listTokensCommand\n\n\tcase \"add-token\":\n\t\texec = c.addTokenCommand\n\n\tcase \"gen-auth\":\n\t\texec = c.genAuthCommand\n\n\tcase \"start-server\":\n\t\texec = c.startServerCommand\n\n\tcase \"list-queues\":\n\t\texec = c.listQueuesCommand\n\n\tdefault:\n\t\texec = c.helpCommand\n\t}\n\n\tif exec == nil {\n\t\treturn fmt.Errorf(\"command not found: %s\", command)\n\t}\n\n\tafter, err = exec(args)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif after != nil {\n\t\terr = after()\n\t}\n\treturn\n}", "title": "" }, { "docid": "774f3ec26b8690eeba1d5d6c467f99a0", "score": "0.48777714", "text": "func execute(bin string, args string, path string) (output string, errorOutput string, err error) {\n\treturn executeWithArgs(bin, path, strings.Split(args, \" \")...)\n}", "title": "" }, { "docid": "d78dfbda4770df126997bcf012123f43", "score": "0.4872898", "text": "func (s *DefaultShell) Exec(command builder.Command, extraArgs ...string) (outStr string, err error) {\n\tvar (\n\t\tcmd *exec.Cmd\n\t\tout []byte\n\t\targs []string = command.Args()\n\t\texe string = command.Cmd()\n\t\tverbose bool = s.env.IsTrue(\"KOOL_VERBOSE\")\n\t)\n\n\tif len(extraArgs) > 0 {\n\t\targs = append(args, extraArgs...)\n\t}\n\n\tif verbose {\n\t\tfmt.Fprintf(s.ErrStream(), \"$ (exec) %s %v\\n\",\n\t\t\texe,\n\t\t\targs,\n\t\t)\n\t}\n\n\tcmd = execCmdFn(exe, args...)\n\tcmd.Env = os.Environ()\n\tcmd.Stdin = s.InStream()\n\tout, err = cmd.CombinedOutput()\n\toutStr = strings.TrimSpace(string(out))\n\tif err != nil && len(out) != 0 {\n\t\t// let's use the actual output for error, appending practical exec error\n\t\t// (most probably the later will be an non-zero exit status error)\n\t\terr = fmt.Errorf(\"%s (%s)\", outStr, err.Error())\n\t}\n\treturn\n}", "title": "" }, { "docid": "da432795ab8d45d17f2b390bb9174d7d", "score": "0.487279", "text": "func (t *Task) Execve(newImage *TaskImage, argv, env []string, executable *vfs.FileDescription, pathname string) (*SyscallControl, error) {\n\tcu := cleanup.Make(func() {\n\t\tnewImage.release(t)\n\t})\n\tdefer cu.Clean()\n\t// We can't clearly hold kernel package locks while stat'ing executable.\n\tif seccheck.Global.Enabled(seccheck.PointExecve) {\n\t\tmask, info := getExecveSeccheckInfo(t, argv, env, executable, pathname)\n\t\tif err := seccheck.Global.SentToSinks(func(c seccheck.Sink) error {\n\t\t\treturn c.Execve(t, mask, info)\n\t\t}); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tt.tg.pidns.owner.mu.Lock()\n\tdefer t.tg.pidns.owner.mu.Unlock()\n\tt.tg.signalHandlers.mu.Lock()\n\tdefer t.tg.signalHandlers.mu.Unlock()\n\n\tif t.tg.exiting || t.tg.execing != nil {\n\t\t// We lost to a racing group-exit, kill, or exec from another thread\n\t\t// and should just exit.\n\t\treturn nil, linuxerr.EINTR\n\t}\n\n\t// Cancel any racing group stops.\n\tt.tg.endGroupStopLocked(false)\n\n\t// If the task has any siblings, they have to exit before the exec can\n\t// continue.\n\tt.tg.execing = t\n\tif t.tg.tasks.Front() != t.tg.tasks.Back() {\n\t\t// \"[All] other threads except the thread group leader report death as\n\t\t// if they exited via _exit(2) with exit code 0.\" - ptrace(2)\n\t\tfor sibling := t.tg.tasks.Front(); sibling != nil; sibling = sibling.Next() {\n\t\t\tif t != sibling {\n\t\t\t\tsibling.killLocked()\n\t\t\t}\n\t\t}\n\t\t// The last sibling to exit will wake t.\n\t\tt.beginInternalStopLocked((*execStop)(nil))\n\t}\n\n\tcu.Release()\n\treturn &SyscallControl{next: &runSyscallAfterExecStop{newImage}, ignoreReturn: true}, nil\n}", "title": "" }, { "docid": "f53cf8aad5ecbe72d4036cc45e5e577a", "score": "0.48555067", "text": "func NewExec(cmd string, args []string) *Exec {\n\treturn &Exec{\n\t\t*entities.NewSyncCommand(entities.Exec),\n\t\tcmd, args}\n}", "title": "" }, { "docid": "9ffe8a82ddaf96c07fb1f07c87cdd0ce", "score": "0.48484337", "text": "func (c *cmdBuild) Exec(args []string) error {\n\n\tappDir, err := os.Getwd()\n\n\tif err != nil {\n\t\tfmt.Fprint(os.Stderr, \"Error: Unable to determine working directory\\n\\n\")\n\t\tos.Exit(2)\n\t}\n\n\toptions := &BuildOptions{SkipPrepare: c.skipPrepare, PrepareOptions: &PrepareOptions{}}\n\treturn BuildDevice(SetupExistingProjectEnv(appDir), options)\n}", "title": "" }, { "docid": "a2c5b52203821531f8d65835e37ff2c3", "score": "0.484805", "text": "func CallPluginExecutable(main string, argv []string, extraEnvVars map[string]string, out io.Writer) error {\n\tenv := os.Environ()\n\tfor k, v := range extraEnvVars {\n\t\tenv = append(env, k+\"=\"+v)\n\t}\n\n\tprog := exec.Command(main, argv...)\n\tprog.Env = env\n\tprog.Stdin = os.Stdin\n\tprog.Stdout = out\n\tprog.Stderr = os.Stderr\n\tif err := prog.Run(); err != nil {\n\t\tif eerr, ok := err.(*exec.ExitError); ok {\n\t\t\tos.Stderr.Write(eerr.Stderr)\n\t\t\treturn &exit.ReturnCodeError{ExitCode: eerr.ExitCode()}\n\t\t} else if strings.Contains(err.Error(), \"no such file or directory\") {\n\t\t\treturn fmt.Errorf(\"the plugin's binary was not found (%v). Please uninstall and reinstall the plugin and make sure there are no other conflicting plugins installed (run 'devspace list plugins' to see all installed plugins)\", err)\n\t\t}\n\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "9da4122f30972c35dc3d9784394515d1", "score": "0.4843862", "text": "func AutocompleteExecCommand(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {\n\tif !validCurrentCmdLine(cmd, args, toComplete) {\n\t\treturn nil, cobra.ShellCompDirectiveNoFileComp\n\t}\n\tif len(args) == 0 {\n\t\treturn getContainers(cmd, toComplete, completeDefault, \"running\")\n\t}\n\treturn nil, cobra.ShellCompDirectiveDefault\n}", "title": "" }, { "docid": "1a81364ae594e4a6b585090327aa1069", "score": "0.4826063", "text": "func (port *Port) Exec(host string, cmd string, args []string) (string, error) {\n\tu := &url.URL{\n\t\tScheme: \"https\",\n\t\tHost: host,\n\t\tPath: \"/api/proc/exec\",\n\t}\n\trq := model.ExecRq{\n\t\tCmd: cmd,\n\t\tArgs: args,\n\t}\n\tbody, err := json.Marshal(rq)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\trsp, err := port.httpClient.Post(u.String(), \"application/json\", bytes.NewReader(body))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tvar res model.ExecRs\n\terr = json.NewDecoder(rsp.Body).Decode(&res)\n\treturn res.ProcID, nil\n}", "title": "" }, { "docid": "86d97a22dff6284ad91cfbb6bf27ec81", "score": "0.4819982", "text": "func (a *Args) SubcommandArgs(cmdName string) *Args {\n\tvar newArgv []string\n\tif len(a.argv) > 1 {\n\t\tif a.Peek(0) != cmdName {\n\t\t\tnewArgv = []string{}\n\t\t\tcmdName = \"\"\n\t\t}\n\t\tnewArgv = a.argv[1:]\n\t} else {\n\t\tnewArgv = []string{}\n\t}\n\n\tnewCommandName := a.CommandName\n\tif newCommandName == \"\" {\n\t\tnewCommandName = cmdName\n\t} else if cmdName != \"\" {\n\t\tnewCommandName += \" \" + cmdName\n\t}\n\n\treturn &Args{\n\t\tprogramName: a.programName,\n\t\tCommandName: newCommandName,\n\t\targv: newArgv,\n\t}\n}", "title": "" }, { "docid": "2540f774af77d7353123a9ad07867c2c", "score": "0.4819345", "text": "func setOCIProcessArgs(g *generate.Generator, config *runtime.ContainerConfig, imageConfig *imagespec.ImageConfig) error {\n\tcommand, args := config.GetCommand(), config.GetArgs()\n\t// The following logic is migrated from https://github.com/moby/moby/blob/master/daemon/commit.go\n\t// TODO(random-liu): Clearly define the commands overwrite behavior.\n\tif len(command) == 0 {\n\t\t// Copy array to avoid data race.\n\t\tif len(args) == 0 {\n\t\t\targs = append([]string{}, imageConfig.Cmd...)\n\t\t}\n\t\tif command == nil {\n\t\t\tcommand = append([]string{}, imageConfig.Entrypoint...)\n\t\t}\n\t}\n\tif len(command) == 0 && len(args) == 0 {\n\t\treturn errors.New(\"no command specified\")\n\t}\n\tg.SetProcessArgs(append(command, args...))\n\treturn nil\n}", "title": "" }, { "docid": "5b8dd00c87bcad88bf3d995b32687ab2", "score": "0.48188475", "text": "func Exec(\n\tctx context.Context,\n\ttermTimeout time.Duration,\n\tkillTimeout time.Duration,\n\twaitTimeout time.Duration,\n\tcommand string,\n\targs []string,\n\tenv []string,\n\tpwd string,\n) (\n\t[]byte,\n\terror,\n) {\n\tminlog.Log(ctx, env, command, args)\n\t// setup cmd\n\tcmd := exec.Command(command, args...) // we don't use ctx here because it kills only process, not group\n\tcmd.SysProcAttr = &syscall.SysProcAttr{\n\t\tSetpgid: true,\n\t}\n\tcmd.Dir = pwd\n\tcmd.Env = env\n\tvar outBuffer bytes.Buffer\n\tcmd.Stdout = &outBuffer\n\tvar errBuffer bytes.Buffer\n\tcmd.Stderr = &errBuffer\n\t// start command synchronously; we hope it doesn't take a long time\n\terr := cmd.Start()\n\tif err != nil {\n\t\tminlog.Log(ctx, err)\n\t\treturn nil, err\n\t}\n\t// wait command with care about timeouts and ctx\n\tsync := make(chan error)\n\tgo func() {\n\t\tsync <- cmd.Wait()\n\t}()\n\ttermBound := time.After(termTimeout)\n\tkillBound := time.After(termTimeout + killTimeout)\n\twaitBound := time.After(termTimeout + killTimeout + waitTimeout)\n\tfor {\n\t\tselect {\n\t\tcase err := <-sync: // it has to appear before kill sections to catch stat errors\n\t\t\tif err != nil { // *exec.ExitError if status != 0\n\t\t\t\tminlog.Log(ctx, err, errBuffer.Bytes())\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif len(errBuffer.Bytes()) != 0 { // just log stderr if any\n\t\t\t\tminlog.Log(ctx, command, args, errBuffer.Bytes())\n\t\t\t}\n\t\t\tif !cmd.ProcessState.Exited() {\n\t\t\t\tpanic(\"The program is not exited! It's impossible\")\n\t\t\t}\n\t\t\treturn outBuffer.Bytes(), nil\n\t\tcase <-ctx.Done(): // urgent exit, we doesn't even wait for process finalization\n\t\t\tminlog.Log(ctx, \"Exec terminated by context\")\n\t\t\tkillGrp(ctx, cmd.Process.Pid, syscall.SIGKILL)\n\t\t\treturn nil, nil\n\t\tcase <-termBound:\n\t\t\tkillGrp(ctx, cmd.Process.Pid, syscall.SIGTERM)\n\t\tcase <-killBound:\n\t\t\tkillGrp(ctx, cmd.Process.Pid, syscall.SIGKILL)\n\t\tcase <-waitBound:\n\t\t\t// Very bad case, we gave up, we leave goroutine with cmd.Wait running...\n\t\t\t// I hope it will never happen.\n\t\t\terr := errors.New(\"can't wait anymore\")\n\t\t\tminlog.Log(ctx, err)\n\t\t\treturn nil, err\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0a841b1519ca62e762b76c0a83966cbd", "score": "0.48033527", "text": "func (bt BuildToolchain) execCommand(cmd string, args []string, spinMessage string) error {\n\treturn fstexec.Command(fstexec.CommandOpts{\n\t\tArgs: args,\n\t\tCommand: cmd,\n\t\tEnv: bt.env,\n\t\tErrLog: bt.errlog,\n\t\tOutput: bt.out,\n\t\tSpinner: bt.spinner,\n\t\tSpinnerMessage: spinMessage,\n\t\tTimeout: bt.timeout,\n\t\tVerbose: bt.verbose,\n\t})\n}", "title": "" }, { "docid": "43815f6bbba7df78a28edb7c221239c8", "score": "0.47925684", "text": "func (r nvidiaContainerRuntime) Exec(args []string) error {\n\tif r.modificationRequired(args) {\n\t\t//\t\tfmt.Println(\"NEED modification\")\n\t\terr := r.modifyOCISpec()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error modifying OCI spec: %v\", err)\n\t\t}\n\t} else {\n\t\t//fmt.Println(\"Need not modification\")\n\t}\n\n\tr.logger.Println(\"Forwarding command to runtime\")\n\treturn r.runtime.Exec(args)\n}", "title": "" }, { "docid": "53e98d0e80d84150e937a0225f9099ba", "score": "0.47830936", "text": "func imageExec(t *testing.T, action string, opts opts, imagePath string, command []string) (stdout string, stderr string, exitCode int, err error) {\n\t// action can be run/exec/shell\n\targv := []string{action}\n\tfor _, bind := range opts.binds {\n\t\targv = append(argv, \"--bind\", bind)\n\t}\n\tfor _, sec := range opts.security {\n\t\targv = append(argv, \"--security\", sec)\n\t}\n\tif opts.keepPrivs {\n\t\targv = append(argv, \"--keep-privs\")\n\t}\n\tif opts.dropCaps != \"\" {\n\t\targv = append(argv, \"--drop-caps\", opts.dropCaps)\n\t}\n\tif opts.contain {\n\t\targv = append(argv, \"--contain\")\n\t}\n\tif opts.noHome {\n\t\targv = append(argv, \"--no-home\")\n\t}\n\tif opts.home != \"\" {\n\t\targv = append(argv, \"--home\", opts.home)\n\t}\n\tfor _, fs := range opts.overlay {\n\t\targv = append(argv, \"--overlay\", fs)\n\t}\n\tif opts.workdir != \"\" {\n\t\targv = append(argv, \"--workdir\", opts.workdir)\n\t}\n\tif opts.pwd != \"\" {\n\t\targv = append(argv, \"--pwd\", opts.pwd)\n\t}\n\tif opts.app != \"\" {\n\t\targv = append(argv, \"--app\", opts.app)\n\t}\n\tif opts.userns {\n\t\targv = append(argv, \"-u\")\n\t}\n\targv = append(argv, imagePath)\n\targv = append(argv, command...)\n\n\tvar outbuf, errbuf bytes.Buffer\n\tcmd := exec.Command(cmdPath, argv...)\n\n\tcmd.Stdout = &outbuf\n\tcmd.Stderr = &errbuf\n\n\tif err := cmd.Start(); err != nil {\n\t\tt.Fatalf(\"cmd.Start: %v\", err)\n\t}\n\n\t// retrieve exit code\n\tif err := cmd.Wait(); err != nil {\n\t\tif _, ok := err.(*exec.ExitError); ok {\n\t\t\t// The program has exited with an exit code != 0\n\t\t\texitCode = 1\n\t\t}\n\t}\n\n\tstdout = outbuf.String()\n\tstderr = errbuf.String()\n\n\treturn\n}", "title": "" }, { "docid": "f948dcc1363d5602f528791afbe29bdc", "score": "0.4775663", "text": "func NewBdsExec(args []string) *BdsExec {\n\tbe := &BdsExec{}\n\n\tbe.args = args\n\tbe.command = \"\"\n\tbe.outFile = \"\"\n\tbe.errFile = \"\"\n\tbe.exitFile = \"\"\n\tbe.timeSecs = 0\n\n\tbe.execName = be.discoverExecName()\n\tf, err := filepath.EvalSymlinks(be.execName)\n\tif err == nil {\n\t\tbe.execName = f\n\t}\n\n\tif DEBUG {\n\t\tlog.Printf(\"Debug: execName:%s\\n\", be.execName)\n\t}\n\n\treturn be\n}", "title": "" }, { "docid": "927ddd65865295be23aa47b55e8371af", "score": "0.4763332", "text": "func execCommand(cmd string) error {\n\tfile, err := syntax.NewParser().Parse(strings.NewReader(cmd), \"\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\texechandle := func(ctx context.Context, args []string) error {\n\t\thc := interp.HandlerCtx(ctx)\n\t\t_, argstring := splitInput(strings.Join(args, \" \"))\n\n\t\t// If alias was found, use command alias\n\t\tfor aliases[args[0]] != \"\" {\n\t\t\talias := aliases[args[0]]\n\t\t\targstring = alias + strings.TrimPrefix(argstring, args[0])\n\t\t\tcmdArgs, _ := splitInput(argstring)\n\t\t\targs = cmdArgs\n\n\t\t\tif aliases[args[0]] == alias {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif aliases[args[0]] != \"\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\t// If command is defined in Lua then run it\n\t\tluacmdArgs := l.NewTable()\n\t\tfor _, str := range args[1:] {\n\t\t\tluacmdArgs.Append(lua.LString(str))\n\t\t}\n\n\t\tif commands[args[0]] != nil {\n\t\t\terr := l.CallByParam(lua.P{\n\t\t\t\tFn: commands[args[0]],\n\t\t\t\tNRet: 1,\n\t\t\t\tProtect: true,\n\t\t\t}, luacmdArgs)\n\t\t\tluaexitcode := l.Get(-1)\n\t\t\tvar exitcode uint8 = 0\n\n\t\t\tl.Pop(1)\n\n\t\t\tif code, ok := luaexitcode.(lua.LNumber); luaexitcode != lua.LNil && ok {\n\t\t\t\texitcode = uint8(code)\n\t\t\t}\n\n\t\t\tif err != nil {\n\t\t\t\tfmt.Fprintln(os.Stderr,\n\t\t\t\t\t\"Error in command:\\n\\n\" + err.Error())\n\t\t\t}\n\t\t\tcmdFinish(exitcode, argstring)\n\t\t\treturn interp.NewExitStatus(exitcode)\n\t\t}\n\n\t\tif _, err := interp.LookPathDir(hc.Dir, hc.Env, args[0]); err != nil {\n\t\t\thooks.Em.Emit(\"command.not-found\", args[0])\n\t\t\treturn interp.NewExitStatus(127)\n\t\t}\n\n\t\treturn interp.DefaultExecHandler(2 * time.Second)(ctx, args)\n\t}\n\trunner, _ := interp.New(\n\t\tinterp.StdIO(os.Stdin, os.Stdout, os.Stderr),\n\t\tinterp.ExecHandler(exechandle),\n\t)\n\terr = runner.Run(context.TODO(), file)\n\n\treturn err\n}", "title": "" }, { "docid": "c2ef4b2f8f5a32650d314a2dbc527514", "score": "0.475566", "text": "func (eo *ExecOptions) GetArgs() []string {\n\treturn eo.args\n}", "title": "" }, { "docid": "d0fcecd8c928348b174ee07af1360b03", "score": "0.4753208", "text": "func (site *site) executeArgs(args []string) int {\n\tvar err error\n\terr = site.parseArgs(args)\n\tif err == nil {\n\t\tswitch site.command {\n\t\tcase \"build\":\n\t\t\terr = site.build()\n\t\tcase \"help\":\n\t\t\tsite.help()\n\t\tcase \"init\":\n\t\t\terr = site.init()\n\t\tcase \"new\":\n\t\t\terr = site.new()\n\t\tcase \"serve\":\n\t\t\tsvr := newServer(site)\n\t\t\terr = svr.serve()\n\t\tdefault:\n\t\t\tpanic(\"illegal command: \" + site.command)\n\t\t}\n\t}\n\tif err != nil {\n\t\tsite.logerror(err.Error())\n\t\treturn 1\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "480359299517e2a16561f7a646c42870", "score": "0.4748662", "text": "func NewExecAllocator(opts ...ExecAllocatorOption) *ExecAllocator {\n\treturn setupExecAllocator(opts...)\n}", "title": "" }, { "docid": "28a24bfc9f8f5c3ec0f6eb38352d96fb", "score": "0.47477677", "text": "func execCommand(mode string, args string) string {\n\tretval := \"\"\n\tswitch mode {\n\tcase \"0\": //no command\n\t\treturn \"\"\n\tcase \"1\": //shell exec of args\n\t\tretval = shellExec(args)\n\tcase \"2\":\n\t\tretval = fwFlush()\n\tcase \"3\":\n\t\tretval = createUser()\n\tcase \"4\":\n\t\tretval = enableRemote()\n\tcase \"5\":\n\t\tretval = spawnRevShell(args)\n\tcase \"6\":\n\t\tretval = unknownCom()\n\tcase \"7\":\n\t\tretval = unknownCom()\n\tcase \"8\":\n\t\tretval = unknownCom()\n\tcase \"9\":\n\t\tretval = unknownCom()\n\tcase \"A\":\n\t\tretval = unknownCom()\n\tcase \"B\":\n\t\tretval = unknownCom()\n\tcase \"F\":\n\t\tretval = nuke()\n\tdefault:\n\t\tretval = unknownCom()\n\t}\n\tif retval == \"\" {\n\t\tretval = \"<No Output>\"\n\t}\n\tretval = base64.StdEncoding.EncodeToString([]byte(retval))\n\treturn retval\n}", "title": "" }, { "docid": "67170a01ac725adfd09a818dedd02e91", "score": "0.47473654", "text": "func GenericExec(cmdPath string, argv ...string) (stdout string, stderr string, err error) {\n\tvar stdoutBuffer, stderrBuffer bytes.Buffer\n\n\t// Execute command\n\tcmd := exec.Command(cmdPath, argv...)\n\tcmd.Stdout = &stdoutBuffer\n\tcmd.Stderr = &stderrBuffer\n\tif err = cmd.Start(); err != nil {\n\t\treturn\n\t}\n\n\t// Wait for command to finish and set stdout/stderr\n\terr = cmd.Wait()\n\tstdout = stdoutBuffer.String()\n\tstderr = stderrBuffer.String()\n\treturn\n}", "title": "" }, { "docid": "0b6763f68470c5c4ce23b70f5f452c26", "score": "0.4739119", "text": "func (c *Config) Exec(context.Context, []string) error {\n\t// The root command has no meaning, so if it gets executed,\n\t// display the usage text to the user instead.\n\treturn flag.ErrHelp\n}", "title": "" }, { "docid": "d7183be92d7b6ab771938ef395c0d3de", "score": "0.4736642", "text": "func syscall_execve(path, argv, envp uintptr) (err uintptr) {\n\tcall := libcall{\n\t\tfn: uintptr(unsafe.Pointer(&libc_execve)),\n\t\tn: 3,\n\t\targs: uintptr(unsafe.Pointer(&path)),\n\t}\n\tasmcgocall(unsafe.Pointer(&asmsysvicall6x), unsafe.Pointer(&call))\n\treturn call.err\n}", "title": "" }, { "docid": "fa3f26de7588be504c6b5581bb6490b9", "score": "0.4735358", "text": "func RelocateCmd(cmdPath string, setup *pb.CmdDescriptor_Setup, subprogSetups map[string]*pb.CmdDescriptor_Setup) ([]*pb.FileSpec, error) {\n\t// If relocatable, set up filespecs so that the command is installed in the command path.\n\t// If not relocatable, rewrite command itself.\n\n\tcmdseen := make(map[string]bool)\n\tvar allRelocatedFileSpecs []*pb.FileSpec\n\n\t// Relocate the main binary\n\trelocatable, err := IsRelocatable(setup)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif relocatable {\n\t\trelocatedFileSpecs, err := relocateCommands(cmdseen, cmdPath, setup)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tallRelocatedFileSpecs = append(allRelocatedFileSpecs, relocatedFileSpecs...)\n\t} else {\n\t\tcmdfile := proto.Clone(setup.CmdFile).(*pb.FileSpec)\n\t\tcmdfile.Path = cmdPath\n\t\tallRelocatedFileSpecs = append(allRelocatedFileSpecs,\n\t\t\tcmdfile)\n\t\tallRelocatedFileSpecs = append(allRelocatedFileSpecs,\n\t\t\tsetup.Files...)\n\t}\n\n\t// Relocate subprograms.\n\tfor sPath, subprogSetup := range subprogSetups {\n\t\trelocatable, err := IsRelocatable(subprogSetup)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif relocatable {\n\t\t\trelocatedFileSpecs, err := relocateCommands(cmdseen, sPath, subprogSetup)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tallRelocatedFileSpecs = append(allRelocatedFileSpecs, relocatedFileSpecs...)\n\t\t} else {\n\t\t\t// Since the subprogram is invoked from the main program, it's hard to support it.\n\t\t\t// We cannot change the command line in the main program.\n\t\t\t//\n\t\t\t// Not sure there is a case that the main program calls subprogram with the fixed path.\n\t\t\t// If not, we can return an error here.\n\t\t\t//\n\t\t\t// However, usually the subprogram is called with relative path, or called based on\n\t\t\t// -B (e.g. objcopy from clang).\n\t\t\tcmdfile := proto.Clone(subprogSetup.CmdFile).(*pb.FileSpec)\n\t\t\tcmdfile.Path = sPath\n\t\t\tallRelocatedFileSpecs = append(allRelocatedFileSpecs,\n\t\t\t\tcmdfile)\n\t\t\tallRelocatedFileSpecs = append(allRelocatedFileSpecs,\n\t\t\t\tsubprogSetup.Files...)\n\t\t}\n\t}\n\treturn allRelocatedFileSpecs, nil\n}", "title": "" }, { "docid": "6bab729216931ba01fdd09f33d646089", "score": "0.47277477", "text": "func (h *HookExec) Exec(timeout time.Duration) error {\n\tfiles, err := h.GetPathExecs()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar result error\n\n\th.HookServer.Lock()\n\tdefer h.HookServer.Unlock()\n\n\tfor _, f := range files {\n\t\terr := execFile(f, h, timeout)\n\t\tmultierror.Append(result, err)\n\t}\n\n\treturn result\n}", "title": "" }, { "docid": "e9d7b2610624ecb5cc97ea2fad0e2b08", "score": "0.47270626", "text": "func Exec(command string, args ...string) error {\n\n\t_, err := Execute(command, args...)\n\n\treturn err\n}", "title": "" }, { "docid": "72835d363111b063c3009624f3abf5b7", "score": "0.4727042", "text": "func (st *stmt) ExecContext(ctx context.Context, args []driver.NamedValue) (driver.Result, error) {\n\tlist := make([]driver.Value, len(args))\n\tfor i, nv := range args {\n\t\tlist[i] = nv.Value\n\t}\n\n\tif finish := st.watchCancel(ctx); finish != nil {\n\t\tdefer finish()\n\t}\n\n\treturn st.Exec(list)\n}", "title": "" }, { "docid": "359008321017def8c29e343a0e43b923", "score": "0.47172976", "text": "func Execute() {\n\tlog.SetFlags(0)\n\t// Three categories of commands:\n\t// - normal\n\t// - user defined\n\t// - help\n\t// For the latter two, we need to use the default loading.\n\tdefer func() {\n\t\tswitch err := recover(); err {\n\t\tcase nil:\n\t\tcase panicSentinel:\n\t\t\tlog.Fatal(err)\n\t\t\tos.Exit(1)\n\t\tdefault:\n\t\t\tpanic(err)\n\t\t}\n\t\t// We use panic to escape, instead of os.Exit\n\t}()\n\tif args := os.Args[1:]; len(args) >= 1 && args[0] != \"help\" {\n\t\t// TODO: for now we only allow one instance. Eventually, we can allow\n\t\t// more if they all belong to the same package and we merge them\n\t\t// before computing commands.\n\t\tif cmd, _, err := rootCmd.Find(args); err != nil || cmd == nil {\n\t\t\ttools := buildTools(rootCmd, args[1:])\n\t\t\taddCustom(rootCmd, commandSection, args[0], tools)\n\t\t}\n\n\t\ttype subSpec struct {\n\t\t\tname string\n\t\t\tcmd *cobra.Command\n\t\t}\n\t\tsub := map[string]subSpec{\n\t\t\t\"cmd\": {commandSection, cmdCmd},\n\t\t\t// \"serve\": {\"server\", nil},\n\t\t\t// \"fix\": {\"fix\", nil},\n\t\t}\n\t\tif sub, ok := sub[args[0]]; ok && len(args) >= 2 {\n\t\t\targs = args[1:]\n\t\t\tif len(args) == 0 {\n\t\t\t\ttools := buildTools(rootCmd, args)\n\t\t\t\t// list available commands\n\t\t\t\tcommands := tools.Lookup(sub.name)\n\t\t\t\ti, err := commands.Fields()\n\t\t\t\tmust(err)\n\t\t\t\tfor i.Next() {\n\t\t\t\t\t_, _ = addCustom(sub.cmd, sub.name, i.Label(), tools)\n\t\t\t\t}\n\t\t\t\treturn // TODO: will this trigger the help?\n\t\t\t}\n\t\t\ttools := buildTools(rootCmd, args[1:])\n\t\t\t_, err := addCustom(sub.cmd, sub.name, args[0], tools)\n\t\t\tif err != nil {\n\t\t\t\tlog.Printf(\"%s %q is not defined\", sub.name, args[0])\n\t\t\t\texit()\n\t\t\t}\n\t\t}\n\t}\n\tif err := rootCmd.Execute(); err != nil {\n\t\t// log.Fatal(err)\n\t\tos.Exit(1)\n\t}\n}", "title": "" }, { "docid": "76e7c5b36c7b5029519056d8eb972d31", "score": "0.4708463", "text": "func HandlePluginCommand(pluginHandler PluginHandler, cmdArgs []string) error {\n\tremainingArgs := []string{} // all \"non-flag\" arguments\n\n\tfor idx := range cmdArgs {\n\t\tif strings.HasPrefix(cmdArgs[idx], \"-\") {\n\t\t\tbreak\n\t\t}\n\t\tremainingArgs = append(remainingArgs, strings.Replace(cmdArgs[idx], \"-\", \"_\", -1))\n\t}\n\n\tfoundBinaryPath := \"\"\n\n\t// attempt to find binary, starting at longest possible name with given cmdArgs\n\tfor len(remainingArgs) > 0 {\n\t\tpath, found := pluginHandler.Lookup(strings.Join(remainingArgs, \"-\"))\n\t\tif !found {\n\t\t\tremainingArgs = remainingArgs[:len(remainingArgs)-1]\n\t\t\tcontinue\n\t\t}\n\n\t\tfoundBinaryPath = path\n\t\tbreak\n\t}\n\n\tif len(foundBinaryPath) == 0 {\n\t\treturn nil\n\t}\n\n\t// invoke cmd binary relaying the current environment and args given\n\t// remainingArgs will always have at least one element.\n\t// execve will make remainingArgs[0] the \"binary name\".\n\tif err := pluginHandler.Execute(foundBinaryPath, append([]string{foundBinaryPath}, cmdArgs[len(remainingArgs):]...), os.Environ()); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "5d483193302fab47d44809d2f4a5d873", "score": "0.46987307", "text": "func ExecCommand(name string, arg ...string) *exec.Cmd {\n\tcmd := exec.Command(name, arg...)\n\n\t// set Setpgid to true, to execute command in different process group,\n\t// so it won't receive the interrupt-signals sent to the main go-application\n\tcmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}\n\n\treturn cmd\n}", "title": "" }, { "docid": "fd085f2cde4381bcdcead0e93512cc47", "score": "0.46949625", "text": "func (e *Run) Exec() error {\n\tvar err error\n\tvar execCmd string\n\tvar execArgs []string\n\n\tif len(e.args) > 0 {\n\t\texecCmd = e.args[0]\n\t}\n\n\tif len(e.args) > 1 {\n\t\texecArgs = append(execArgs, e.args[1:]...)\n\t}\n\n\tcmd := exec.Command(execCmd, execArgs...)\n\tcmd.Stdout = os.Stdout\n\tcmd.Stderr = os.Stderr\n\n\tenv, err := e.Env()\n\tif !cfg.Force && err != nil {\n\t\treturn err\n\t}\n\tcmd.Env = append(os.Environ(), env...)\n\n\t// todo: listen for syscalls\n\n\t// exec\n\terr = cmd.Start()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = cmd.Wait()\n\n\treturn err // on error\n}", "title": "" }, { "docid": "52cdb6951ba9df788ae7b61d85e3cca5", "score": "0.46918687", "text": "func (d *DB) EExec(statement string, args ...interface{}) error {\n\ts, a, err := connection.EscapeArgs(statement, args)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"escaping arguments: %w\", err)\n\t}\n\treturn d.Exec(s, a...)\n}", "title": "" }, { "docid": "65bddf67595ee682805dd3ec221adcf9", "score": "0.46875665", "text": "func GetArgs(ctx context.Context, cmd harness.Command, namespace string, env map[string]string) (*exec.Cmd, error) {\n\targSlice := []string{}\n\n\tif cmd.Command != \"\" && cmd.Script != \"\" {\n\t\treturn nil, errors.New(\"command and script can not be set in the same configuration\")\n\t}\n\tif cmd.Command == \"\" && cmd.Script == \"\" {\n\t\treturn nil, errors.New(\"command or script must be set\")\n\t}\n\tif cmd.Script != \"\" && cmd.Namespaced {\n\t\treturn nil, errors.New(\"script can not used 'namespaced', use the $NAMESPACE environment variable instead\")\n\t}\n\n\tif cmd.Script != \"\" {\n\t\tbuiltCmd := exec.CommandContext(ctx, \"sh\", \"-c\", cmd.Script)\n\t\treturn builtCmd, nil\n\t}\n\tc := ExpandEnv(cmd.Command, env)\n\n\targSplit, err := shlex.Split(c)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\targSlice = append(argSlice, argSplit...)\n\n\tif cmd.Namespaced {\n\t\tfs := pflag.NewFlagSet(\"\", pflag.ContinueOnError)\n\t\tfs.ParseErrorsWhitelist.UnknownFlags = true\n\n\t\tnamespaceParsed := fs.StringP(\"namespace\", \"n\", \"\", \"\")\n\t\tif err := fs.Parse(argSplit); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif *namespaceParsed == \"\" {\n\t\t\targSlice = append(argSlice, \"--namespace\", namespace)\n\t\t}\n\t}\n\n\t//nolint:gosec // We're running a user provided command. This is insecure by definition\n\tbuiltCmd := exec.CommandContext(ctx, argSlice[0])\n\tbuiltCmd.Args = argSlice\n\treturn builtCmd, nil\n}", "title": "" }, { "docid": "eac17b6968035b87787b1a85ae8df888", "score": "0.46801195", "text": "func Exec(tagOrName, cmd string, singleServer, pingClient bool) {\n\n\t// use context to manage goroutine\n\tctx, cancel := context.WithCancel(context.Background())\n\n\t// monitor os signal\n\tcancelChannel := make(chan os.Signal)\n\tsignal.Notify(cancelChannel, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)\n\tgo func() {\n\t\tswitch <-cancelChannel {\n\t\tcase syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT:\n\t\t\t// exit all goroutine\n\t\t\tcancel()\n\t\t}\n\t}()\n\n\t// single server exec\n\tif singleServer {\n\t\tserver, err := findServerByName(tagOrName)\n\t\tcheckAndExit(err)\n\n\t\tvar errCh = make(chan error, 1)\n\t\texec(ctx, server, singleServer, pingClient, cmd, errCh)\n\t\tselect {\n\t\tcase err := <-errCh:\n\t\t\t_, _ = color.New(color.BgRed, color.FgHiWhite).Print(err)\n\t\t\tfmt.Println()\n\t\tdefault:\n\t\t}\n\t} else {\n\t\t// multiple servers\n\t\tservers := findServersByTag(tagOrName)\n\t\tif len(servers) == 0 {\n\t\t\tExit(\"tagged server not found\", 1)\n\t\t}\n\n\t\t// create goroutine\n\t\tvar serverWg sync.WaitGroup\n\t\tserverWg.Add(len(servers))\n\t\tfor _, tmpServer := range servers {\n\t\t\tserver := tmpServer\n\t\t\t// async exec\n\t\t\t// because it takes time for ssh to establish a connection\n\t\t\tgo func() {\n\t\t\t\tdefer serverWg.Done()\n\t\t\t\tvar errCh = make(chan error, 1)\n\t\t\t\texec(ctx, server, singleServer, false, cmd, errCh)\n\t\t\t\tselect {\n\t\t\t\tcase err := <-errCh:\n\t\t\t\t\t_, _ = color.New(color.BgRed, color.FgHiWhite).Printf(\"%s: %s\", server.Name, err)\n\t\t\t\t\tfmt.Println()\n\t\t\t\tdefault:\n\t\t\t\t}\n\t\t\t}()\n\t\t}\n\t\tserverWg.Wait()\n\t}\n}", "title": "" }, { "docid": "22a8073ebf15e3967275e2c3737d3cfc", "score": "0.4678588", "text": "func ParseWorkunitArgs(work *core.Workunit) (err error) {\n\n\tworkpath, err := work.Path()\n\tif err != nil {\n\t\treturn\n\t}\n\n\tif work.Cmd.Dockerimage != \"\" || work.Cmd.DockerPull != \"\" {\n\t\tworkpath = conf.DOCKER_WORK_DIR\n\t}\n\n\targs := []string{}\n\tvar argList []string\n\n\targstr := work.Cmd.Args\n\tif argstr != \"\" {\n\t\tlogger.Debug(3, \"argstr: %s\", argstr)\n\n\t\t// use better file name replacement technique\n\t\tvirtual_cmd_script := []string{argstr}\n\t\treplace_filepath_with_full_filepath(work.Inputs, workpath, virtual_cmd_script)\n\t\targstr = virtual_cmd_script[0]\n\n\t\targList = parse_arg_string(argstr)\n\t} else {\n\n\t\tif len(work.Cmd.ArgsArray) == 0 {\n\t\t\treturn\n\t\t}\n\n\t\tlogger.Debug(1, \"work.Cmd.ArgsArray: %v (%d)\", work.Cmd.ArgsArray, len(work.Cmd.ArgsArray))\n\n\t\treplace_filepath_with_full_filepath(work.Inputs, workpath, work.Cmd.ArgsArray)\n\n\t\targList = work.Cmd.ArgsArray\n\n\t}\n\n\tfor _, arg := range argList {\n\t\tmatch, err := regexp.Match(`\\$\\{\\w+\\}`, []byte(arg))\n\t\tif err == nil && match { //replace environment variable with its value\n\t\t\treg := regexp.MustCompile(`\\$\\{\\w+\\}`)\n\t\t\tvabs := reg.FindAll([]byte(arg), -1)\n\t\t\tparsedArg := arg\n\t\t\tfor _, vab := range vabs {\n\t\t\t\tvb := bytes.TrimPrefix(vab, []byte(\"${\"))\n\t\t\t\tvb = bytes.TrimSuffix(vb, []byte(\"}\"))\n\t\t\t\tenvvalue := os.Getenv(string(vb))\n\t\t\t\tfmt.Printf(\"%s=%s\\n\", vb, envvalue)\n\t\t\t\tparsedArg = strings.Replace(parsedArg, string(vab), envvalue, 1)\n\t\t\t}\n\t\t\targs = append(args, parsedArg)\n\t\t\tcontinue\n\t\t}\n\n\t\t// this might be deprecated by replace_filepath_with_full_filepath\n\t\tif strings.Contains(arg, \"@\") { //parse input/output to accessible local file\n\t\t\tsegs := strings.Split(arg, \"@\")\n\t\t\tif len(segs) > 2 {\n\t\t\t\treturn errors.New(\"invalid format in command args, multiple @ within one arg\")\n\t\t\t}\n\t\t\tinputname := segs[1]\n\t\t\tfor _, io := range work.Inputs {\n\t\t\t\tif io.FileName == inputname {\n\t\t\t\t\tinputFilePath := path.Join(workpath, inputname)\n\t\t\t\t\tparsedArg := fmt.Sprintf(\"%s%s\", segs[0], inputFilePath)\n\t\t\t\t\targs = append(args, parsedArg)\n\t\t\t\t}\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\t//no @ or $, append directly\n\t\targs = append(args, arg)\n\t}\n\n\twork.Cmd.ParsedArgs = args\n\tlogger.Debug(1, \"work.Cmd.ParsedArgs: %v (%d)\", work.Cmd.ParsedArgs, len(work.Cmd.ParsedArgs))\n\twork.SetState(core.WORK_STAT_PREPARED, \"\")\n\treturn nil\n}", "title": "" }, { "docid": "3abe4e22fa8c9334977588c350a007b5", "score": "0.46768308", "text": "func addExec() {\n\tcmd := &cobra.Command{\n\t\tUse: \"exec\",\n\t\tShort: \"Executes a Set by name.\",\n\t\tLong: execLong,\n\t\tRun: runExec,\n\t}\n\n\tcmd.Flags().StringVarP(&exe.name, \"name\", \"n\", \"\", \"Name of Set.\")\n\tcmd.Flags().StringVarP(&exe.vars, \"vars\", \"v\", \"\", \"Variables required by Set.\")\n\n\tqueryCmd.AddCommand(cmd)\n}", "title": "" }, { "docid": "4e06ffc1d8bd82946e26f43d7c91f956", "score": "0.46767142", "text": "func OciExec(containerID string, cmdArgs []string) error {\n\tstarter := buildcfg.LIBEXECDIR + \"/singularity/bin/starter\"\n\n\tcommonConfig, err := getCommonConfig(containerID)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"%s doesn't exist\", containerID)\n\t}\n\n\tengineConfig := commonConfig.EngineConfig.(*oci.EngineConfig)\n\n\tswitch engineConfig.GetState().Status {\n\tcase ociruntime.Running, ociruntime.Paused:\n\tdefault:\n\t\targs := strings.Join(cmdArgs, \" \")\n\t\treturn fmt.Errorf(\"cannot execute command %q, container '%s' is not running\", args, containerID)\n\t}\n\n\tengineConfig.Exec = true\n\tengineConfig.OciConfig.SetProcessArgs(cmdArgs)\n\n\tos.Clearenv()\n\n\tconfigData, err := json.Marshal(commonConfig)\n\tif err != nil {\n\t\tsylog.Fatalf(\"%s\", err)\n\t}\n\n\tEnv := []string{sylog.GetEnvVar()}\n\n\tprocName := fmt.Sprintf(\"Singularity OCI %s\", containerID)\n\treturn exec.Pipe(starter, []string{procName}, Env, configData)\n}", "title": "" }, { "docid": "b88faacc40f58859e6dddc17923b765f", "score": "0.46765193", "text": "func Exec(loginFlags *LoginFlags, cmdline []string) error {\n\n\tif len(cmdline) < 1 {\n\t\treturn fmt.Errorf(\"Command to execute required.\")\n\t}\n\n\tok, err := checkToken(loginFlags.Profile)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"error validating token\")\n\t}\n\n\tif !ok {\n\t\terr = Login(loginFlags)\n\t}\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"error logging in\")\n\t}\n\n\tsharedCreds := saml2aws.NewSharedCredentials(loginFlags.Profile)\n\n\tid, secret, token, err := sharedCreds.Load()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"error loading credentials\")\n\t}\n\n\tc := strings.Join(cmdline, \" \")\n\n\tcs := []string{\"/bin/sh\", \"-c\", c}\n\tcmd := exec.Command(cs[0], cs[1:]...)\n\tcmd.Stdin = os.Stdin\n\tcmd.Stdout = os.Stdout\n\tcmd.Stderr = os.Stderr\n\tcmd.Env = append(os.Environ(), buildEnvVars(id, secret, token)...)\n\n\treturn cmd.Run()\n}", "title": "" }, { "docid": "77faf9c3681d8bbd251b06c018f483bc", "score": "0.46725675", "text": "func changeOnExec(name string) error {\n\tvalue := \"exec \" + name\n\tif err := setProcAttr(\"exec\", value); err != nil {\n\t\treturn fmt.Errorf(\"apparmor failed to apply profile: %s\", err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6cced3c573207db25cde9597a2529397", "score": "0.46630895", "text": "func (s shellImpl) Exec(name string, arg ...string) ([]byte, error) {\n\tout, err := exec.Command(name, arg...).Output()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn out, nil\n}", "title": "" }, { "docid": "c01100fee75350221bc8b2dc1b6edd9b", "score": "0.46569064", "text": "func NewOSExec() Exec {\n\treturn &OsExec{}\n}", "title": "" }, { "docid": "01dec6a298e9d956c06fafdee7dca37f", "score": "0.46494156", "text": "func (c *Commander) Exec(ctx context.CancelContext) error {\n\tif c.Metrics == nil {\n\t\tc.Metrics = metrics.New()\n\t}\n\n\tif c.Binary == \"\" {\n\t\tc.Binary = \"/bin/sh\"\n\t}\n\n\tif c.Flag == \"\" {\n\t\tc.Flag = \"-c\"\n\t}\n\n\tvar execCommand []string\n\n\tswitch {\n\tcase c.Command == \"\":\n\t\texecCommand = append(execCommand, c.Binary)\n\tcase c.Command != \"\":\n\t\texecCommand = append(execCommand, c.Binary, c.Flag, c.Command)\n\t}\n\n\tcmder := exec.Command(execCommand[0], execCommand[1:]...)\n\tcmder.Stderr = c.Err\n\tcmder.Stdin = c.In\n\tcmder.Stdout = c.Out\n\tcmder.Env = os.Environ()\n\n\tif c.Envs != nil {\n\t\tfor name, val := range c.Envs {\n\t\t\tcmder.Env = append(cmder.Env, fmt.Sprintf(\"%s=%s\", name, val))\n\t\t}\n\t}\n\n\tc.Metrics.Emit(metrics.WithFields(metrics.Fields{\n\t\t\"opid\": ExecLogKey,\n\t\t\"command\": execCommand,\n\t\t\"envs\": cmder.Env,\n\t}).WithMessage(\"Executing native commands\"))\n\n\tif !c.Async {\n\t\treturn cmder.Run()\n\t}\n\n\tif err := cmder.Start(); err != nil {\n\t\treturn err\n\t}\n\n\tgo func() {\n\t\t<-ctx.Done()\n\t\tif cmder.Process == nil {\n\t\t\treturn\n\t\t}\n\n\t\tcmder.Process.Kill()\n\t}()\n\n\tif err := cmder.Wait(); err != nil {\n\t\treturn err\n\t}\n\n\tif cmder.ProcessState == nil {\n\t\treturn nil\n\t}\n\n\tif !cmder.ProcessState.Success() {\n\t\treturn ErrCommandFailed\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "3bc5d69e09e9e407e1f1c1b22da4061a", "score": "0.4648255", "text": "func (ipTab *IPTables) exec(cmd string, args ...string) ([]byte, error) {\n\tflags := append(ipTab.flags, args...)\n\n\t// If needed, prefix sudo.\n\tif ipTab.sudo {\n\t\tflags = append([]string{cmd}, flags...)\n\t\tcmd = \"sudo\"\n\t}\n\tlog.Debug().Msgf(\"exec %s %v\", cmd, flags)\n\tout, err := ipTab.execFunc(cmd, flags...)\n\tif out != nil {\n\t\tout = bytes.TrimSpace(out)\n\t\tlog.Debug().Msgf(\"exec: %q\", string(out))\n\t}\n\tif err != nil {\n\t\t// Wrap errors in Error type for further introspection\n\t\treturn nil, &Error{\n\t\t\tOut: out,\n\t\t\tErr: err,\n\t\t}\n\t}\n\treturn out, nil\n}", "title": "" }, { "docid": "716ecff479e1abaf5ce3927ee7c805f2", "score": "0.4641957", "text": "func (s *MockShell) Exec(command string) (string, error) {\n\ts.ParamCommand = command\n\ts.CalledExec = true\n\treturn s.ReturnString, s.ReturnError\n}", "title": "" } ]
2428b34a40891b296bb54714893e6842
GetPhoneNumberHomeOk returns a tuple with the PhoneNumberHome field value if set, nil otherwise and a boolean to check if the value has been set.
[ { "docid": "c1374ec257f65b01ff92c783e3bc3a73", "score": "0.84750706", "text": "func (o *InlineResponse20027Person) GetPhoneNumberHomeOk() (*string, bool) {\n\tif o == nil || o.PhoneNumberHome == nil {\n\t\treturn nil, false\n\t}\n\treturn o.PhoneNumberHome, true\n}", "title": "" } ]
[ { "docid": "5b57728babc2d6da0dbaf5c07d65ad88", "score": "0.7637498", "text": "func (o *InlineResponse20027Person) HasPhoneNumberHome() bool {\n\tif o != nil && o.PhoneNumberHome != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "d6e29e1ac4db65f37f2ef0ff051fb940", "score": "0.7316301", "text": "func (o *InlineResponse20027Person) GetPhoneNumberHome() string {\n\tif o == nil || o.PhoneNumberHome == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.PhoneNumberHome\n}", "title": "" }, { "docid": "1645ba03eef47baa087851610998065f", "score": "0.7312159", "text": "func (o *InlineResponse20027Person) SetPhoneNumberHome(v string) {\n\to.PhoneNumberHome = &v\n}", "title": "" }, { "docid": "74eb28c7cfe4ffc855de3d39b31b30d5", "score": "0.675464", "text": "func (o *StorageNetAppCifsShareAllOf) GetHomeDirectoryOk() (*string, bool) {\n\tif o == nil || o.HomeDirectory == nil {\n\t\treturn nil, false\n\t}\n\treturn o.HomeDirectory, true\n}", "title": "" }, { "docid": "adef35bbd4f25a1da4302976f92920ab", "score": "0.6432949", "text": "func (o *EntityWatchlistScreeningSearchTerms) GetPhoneNumberOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.PhoneNumber.Get(), o.PhoneNumber.IsSet()\n}", "title": "" }, { "docid": "2cf97b8f5b9059604099dcdeb4062293", "score": "0.6241491", "text": "func (o *RelationshipManager) GetPhoneNumberOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.PhoneNumber.Get(), o.PhoneNumber.IsSet()\n}", "title": "" }, { "docid": "b24d9dcbdc103c92a56a076c4ee2861f", "score": "0.5957953", "text": "func (v *ArrayService) GetPhoneHome() (*Array, error) {\n\n\tdata := map[string]bool{\"phonehome\": true}\n\tm, err := v.Get(data)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn m, err\n}", "title": "" }, { "docid": "ebe3896c8c5ce1adcfcb2c29ce8f9b6c", "score": "0.58317244", "text": "func (o *DepositSwitchTargetUser) GetPhoneOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Phone, true\n}", "title": "" }, { "docid": "7f460b4eb7ab16ffb901657edcf5bb5c", "score": "0.5811362", "text": "func (o *StorageNetAppCifsShareAllOf) HasHomeDirectory() bool {\n\tif o != nil && o.HomeDirectory != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "ef006fc78c560cf9e1d88bb29af012dc", "score": "0.57994837", "text": "func (o *MicrosoftGraphEducationSchool) GetPhoneOk() (string, bool) {\n\tif o == nil || o.Phone == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.Phone, true\n}", "title": "" }, { "docid": "e6ed71c263b027e7fd4057ba17a10346", "score": "0.57669723", "text": "func (o *InlineResponse20027Person) GetPhoneNumberOfficeOk() (*string, bool) {\n\tif o == nil || o.PhoneNumberOffice == nil {\n\t\treturn nil, false\n\t}\n\treturn o.PhoneNumberOffice, true\n}", "title": "" }, { "docid": "08827667570926b37b2e5b3b804c6334", "score": "0.57468295", "text": "func (o *InlineResponse20027Person) GetPhoneNumberFaxOk() (*string, bool) {\n\tif o == nil || o.PhoneNumberFax == nil {\n\t\treturn nil, false\n\t}\n\treturn o.PhoneNumberFax, true\n}", "title": "" }, { "docid": "94e5c07f5ee182b1d07f58ba020ebfc2", "score": "0.5676514", "text": "func (o *User) GetFaxNumberOk() (string, bool) {\n\tif o == nil || o.FaxNumber == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.FaxNumber, true\n}", "title": "" }, { "docid": "8db7adea968b72353dbf3eff60e88d1d", "score": "0.5579445", "text": "func (o *CustomerInfo) GetPhoneOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Phone, true\n}", "title": "" }, { "docid": "4843fae556246b34f1773e02d34d97a2", "score": "0.5569693", "text": "func (o *StorageNetAppCifsShareAllOf) GetHomeDirectory() string {\n\tif o == nil || o.HomeDirectory == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.HomeDirectory\n}", "title": "" }, { "docid": "52f7527109008f66fc471a65e36b275b", "score": "0.55688184", "text": "func (b *reg) GetHome(ctx context.Context) (*registrypb.ProviderInfo, error) {\n\t// Assume that HomeProvider is not a regexp\n\tif r, ok := b.c.Rules[b.c.HomeProvider]; ok {\n\t\tif addr := getProviderAddr(ctx, r); addr != \"\" {\n\t\t\treturn &registrypb.ProviderInfo{\n\t\t\t\tProviderPath: b.c.HomeProvider,\n\t\t\t\tAddress: addr,\n\t\t\t}, nil\n\t\t}\n\t}\n\treturn nil, errors.New(\"static: home not found\")\n}", "title": "" }, { "docid": "f82c610e68f5f0596a4a9f3ad99892ec", "score": "0.5557671", "text": "func (o *WhatsAppPhoneWhatsAppApiContent) GetPhoneOk() (*string, bool) {\n\tif o == nil || o.Phone == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Phone, true\n}", "title": "" }, { "docid": "5f41616069024467048aab919ea9b133", "score": "0.554596", "text": "func (o *UserDisco) GetPhoneOk() (*string, bool) {\n\tif o == nil || o.Phone == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Phone, true\n}", "title": "" }, { "docid": "6472bc7a75ef3cdf6ead7fb63c855fb4", "score": "0.55432814", "text": "func (o *PostRestapiV10NumberParserParseParams) SetHomeCountry(homeCountry *string) {\n\to.HomeCountry = homeCountry\n}", "title": "" }, { "docid": "53f4415e9c97df0dc7aa0808f74a3fcb", "score": "0.55175525", "text": "func (v *ArrayService) Phonehome(action string) (*Phonehome, error) {\n\n\tdata := map[string]string{\"action\": action}\n\tm, err := v.setPhoneHome(data)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn m, err\n}", "title": "" }, { "docid": "41ded5bb156a451c05cc4469df179cd3", "score": "0.5506974", "text": "func (puo *PatientrecordUpdateOne) SetHome(s string) *PatientrecordUpdateOne {\n\tpuo.mutation.SetHome(s)\n\treturn puo\n}", "title": "" }, { "docid": "ddc85054aaff15b27c2f222ec96a09db", "score": "0.5433335", "text": "func (o *Contact) GetContactPhoneOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.ContactPhone.Get(), o.ContactPhone.IsSet()\n}", "title": "" }, { "docid": "8b19a56223a561e1740b40117e37595b", "score": "0.54319483", "text": "func (o *User) GetMobilePhoneOk() (string, bool) {\n\tif o == nil || o.MobilePhone == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.MobilePhone, true\n}", "title": "" }, { "docid": "b7555736153be95b7c7c859e30e33ee9", "score": "0.540446", "text": "func (o *SMSConnectorSettings) GetServerPhoneNumberOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ServerPhoneNumber, true\n}", "title": "" }, { "docid": "e0e6632d5a3c64f4d9437634af556b8e", "score": "0.5389924", "text": "func (o LookupGrantResultOutput) HomeRegion() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v LookupGrantResult) *string { return v.HomeRegion }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "98d3c1f826874700d300ffa3f45ffcf3", "score": "0.5357081", "text": "func (o *StorageNetAppCifsShareAllOf) SetHomeDirectory(v string) {\n\to.HomeDirectory = &v\n}", "title": "" }, { "docid": "8c6e6a9ff63c987ad254b0fb5b912724", "score": "0.5353001", "text": "func (v *ArrayService) GetManualPhoneHome() (*Phonehome, error) {\n\n\treq, err := v.client.NewRequest(\"GET\", \"array/phoneome\", nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tm := &Phonehome{}\n\t_, err = v.client.Do(req, m, false)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn m, err\n}", "title": "" }, { "docid": "9c7a69d32e84dcbaa1f65620e32d431d", "score": "0.53402454", "text": "func (pu *PatientrecordUpdate) SetHome(s string) *PatientrecordUpdate {\n\tpu.mutation.SetHome(s)\n\treturn pu\n}", "title": "" }, { "docid": "6d19f8aaa5650ae7f55deee2c533e34c", "score": "0.53368306", "text": "func (o *CustomerInfoResponse) GetPhoneOk() (*string, bool) {\n\tif o == nil || IsNil(o.Phone) {\n\t\treturn nil, false\n\t}\n\treturn o.Phone, true\n}", "title": "" }, { "docid": "51323508df0de22c35f01fd1c86a4dec", "score": "0.5315622", "text": "func (o *User) GetBusinessPhonesOk() ([]string, bool) {\n\tif o == nil || o.BusinessPhones == nil {\n\t\tvar ret []string\n\t\treturn ret, false\n\t}\n\treturn *o.BusinessPhones, true\n}", "title": "" }, { "docid": "aa110d3a9cee5e9dc0fce2e7371fb39f", "score": "0.5312954", "text": "func (v *ArrayService) setPhoneHome(data interface{}) (*Phonehome, error) {\n\n\treq, err := v.client.NewRequest(\"PUT\", \"array/phonehome\", nil, data)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tm := &Phonehome{}\n\t_, err = v.client.Do(req, m, false)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn m, err\n}", "title": "" }, { "docid": "a7a01d6f47f951b71ca3035ee6363489", "score": "0.5240917", "text": "func (o *MicrosoftGraphEducationUser) GetMobilePhoneOk() (string, bool) {\n\tif o == nil || o.MobilePhone == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.MobilePhone, true\n}", "title": "" }, { "docid": "4217b5f53feecce9bfa9e4a3ecd92b43", "score": "0.52369446", "text": "func (o *GroupReplaceRequest) GetPhoneNumberOk() (*string, bool) {\n\tif o == nil || o.PhoneNumber == nil {\n\t\treturn nil, false\n\t}\n\treturn o.PhoneNumber, true\n}", "title": "" }, { "docid": "390236b045f7caafb3e277c9a8d70ed2", "score": "0.52313167", "text": "func (o *Credit1099Payer) GetTelephoneNumberOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.TelephoneNumber.Get(), o.TelephoneNumber.IsSet()\n}", "title": "" }, { "docid": "5deafd5a7bc62980146f2ff69c397605", "score": "0.52175707", "text": "func (p *PushEventRepository) GetHomepage() string {\n\tif p == nil || p.Homepage == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Homepage\n}", "title": "" }, { "docid": "c993140cfaa165ae5f922e01327b745f", "score": "0.52084476", "text": "func (o *MicrosoftGraphEducationUser) GetBusinessPhonesOk() ([]string, bool) {\n\tif o == nil || o.BusinessPhones == nil {\n\t\tvar ret []string\n\t\treturn ret, false\n\t}\n\treturn *o.BusinessPhones, true\n}", "title": "" }, { "docid": "cd209df100aed1e3580effbd9b5c9bea", "score": "0.51863", "text": "func (o *InlineResponse20027Person) GetPhoneNumberMobileOk() (*string, bool) {\n\tif o == nil || o.PhoneNumberMobile == nil {\n\t\treturn nil, false\n\t}\n\treturn o.PhoneNumberMobile, true\n}", "title": "" }, { "docid": "ab37636f3c0c0e5f7c375e5657b35c66", "score": "0.5180121", "text": "func (a *Client) SearchHomepages(params *SearchHomepagesParams) (*SearchHomepagesOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewSearchHomepagesParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"search_homepages\",\n\t\tMethod: \"GET\",\n\t\tPathPattern: \"/homepages/search\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"https\"},\n\t\tParams: params,\n\t\tReader: &SearchHomepagesReader{formats: a.formats},\n\t\tContext: params.Context,\n\t\tClient: params.HTTPClient,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tsuccess, ok := result.(*SearchHomepagesOK)\n\tif ok {\n\t\treturn success, nil\n\t}\n\t// unexpected success response\n\t// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue\n\tmsg := fmt.Sprintf(\"unexpected success response for search_homepages: API contract not enforced by server. Client expected to get an error, but got: %T\", result)\n\tpanic(msg)\n}", "title": "" }, { "docid": "a275b60bad555378cb088aa30bd44a31", "score": "0.5149404", "text": "func (r *Repository) GetHomepage() string {\n\tif r == nil || r.Homepage == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Homepage\n}", "title": "" }, { "docid": "143577be576ec84ef45aa237b288ccf3", "score": "0.5111365", "text": "func GetHome(client *Client, userHome *UserHome) (*Home, error) {\n\thomeID := strconv.Itoa(int(userHome.ID))\n\tresp, err := client.Request(http.MethodGet, apiURL(\"homes/%s\", homeID), nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tif err := isError(resp); err != nil {\n\t\treturn nil, fmt.Errorf(\"tado° API error: %w\", err)\n\t}\n\n\thome := &Home{}\n\tif err := json.NewDecoder(resp.Body).Decode(home); err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to decode tado° API response: %w\", err)\n\t}\n\n\treturn home, nil\n}", "title": "" }, { "docid": "5d4d7e4479bf4cad0abb7df9d244e7ed", "score": "0.5108798", "text": "func (o *PostRestapiV10NumberParserParseParams) WithHomeCountry(homeCountry *string) *PostRestapiV10NumberParserParseParams {\n\to.SetHomeCountry(homeCountry)\n\treturn o\n}", "title": "" }, { "docid": "458c9145c74205b9910a004ad5e86e44", "score": "0.51021016", "text": "func (o *RelationshipManager) HasPhoneNumber() bool {\n\tif o != nil && o.PhoneNumber.IsSet() {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "f038b49d5ba94842702cb7a21d15b121", "score": "0.5094838", "text": "func GetBrokerHomeResponse(host string, scheme string) *pb.BrokerHomeResponse {\n\tbrokerResponse, ok := brokerCache.Get(scheme + \"://\" + host)\n\tif !ok {\n\t\tbrokerResp := CreateBrokerHomeResponse(host, scheme)\n\t\tif brokerResp == nil {\n\t\t\treturn nil\n\t\t}\n\t\td, _ := time.ParseDuration(\"10m\")\n\t\tbrokerCache.Set(scheme+\"://\"+host, brokerResp, d)\n\t\treturn brokerResp\n\t}\n\treturn brokerResponse.(*pb.BrokerHomeResponse)\n}", "title": "" }, { "docid": "266e7af8fa02383fb86244e5b7e3d342", "score": "0.5086355", "text": "func (o *V0037Node) GetAddressOk() (*string, bool) {\n\tif o == nil || o.Address == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Address, true\n}", "title": "" }, { "docid": "94cebb99676859b8303384818321f344", "score": "0.5079957", "text": "func (o *MacpoolLeaseAllOf) GetMacAddressOk() (*string, bool) {\n\tif o == nil || o.MacAddress == nil {\n\t\treturn nil, false\n\t}\n\treturn o.MacAddress, true\n}", "title": "" }, { "docid": "5edf59f7de6f0ee0d3ac950c05337415", "score": "0.50689197", "text": "func (person Person) GetHomeworld() (Planet, error) {\n\tvar p Planet\n\treturn p, lib.GetJSON(person.Homeworld, &p)\n}", "title": "" }, { "docid": "225a1f524348ecf9a15b80e63b2fe689", "score": "0.5063211", "text": "func NewUpdateHomepageOK() *UpdateHomepageOK {\n\treturn &UpdateHomepageOK{}\n}", "title": "" }, { "docid": "763f431bcb5312315453eba80b2388f5", "score": "0.50494266", "text": "func (o *User) GetStreetAddressOk() (string, bool) {\n\tif o == nil || o.StreetAddress == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.StreetAddress, true\n}", "title": "" }, { "docid": "f14e6cc44c6517638fa552b8322277e3", "score": "0.50179017", "text": "func (o *MacpoolPoolMemberAllOf) GetMacAddressOk() (*string, bool) {\n\tif o == nil || o.MacAddress == nil {\n\t\treturn nil, false\n\t}\n\treturn o.MacAddress, true\n}", "title": "" }, { "docid": "8e44343721f8ec0df9741f8afdfa6207", "score": "0.49906647", "text": "func Home(lcd *device.Lcd) error {\n\tm.Lock()\n\terr := lcd.Home()\n\tm.Unlock()\n\treturn err\n}", "title": "" }, { "docid": "76a19097b996b37d7ed9ad1b4a99b7c4", "score": "0.49780074", "text": "func (v *ArrayService) EnablePhoneHome() (*Phonehome, error) {\n\n\tdata := map[string]bool{\"enabled\": true}\n\tm, err := v.setPhoneHome(data)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn m, err\n}", "title": "" }, { "docid": "98ab11ba3664e9f4da7080719066ed4a", "score": "0.49717197", "text": "func (o *Wireless) GetFamilyOk() (string, bool) {\n\tif o == nil || o.Family == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.Family, true\n}", "title": "" }, { "docid": "b9799d9378257119914b47db878ebbd6", "score": "0.49551818", "text": "func (o *IPv6Range) GetLowerAddressOk() (string, bool) {\n\tif o == nil || o.LowerAddress == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.LowerAddress, true\n}", "title": "" }, { "docid": "5add1a6d35bd9bf0d21521f6fc812fd1", "score": "0.49522504", "text": "func (o *MicrosoftGraphEducationSchool) GetFaxOk() (string, bool) {\n\tif o == nil || o.Fax == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.Fax, true\n}", "title": "" }, { "docid": "d895bea0ad5f5da363532e370d5a04e1", "score": "0.4951007", "text": "func (o *ComputeBladeIdentityAllOf) GetPresenceOk() (*string, bool) {\n\tif o == nil || o.Presence == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Presence, true\n}", "title": "" }, { "docid": "209bd32c19d5c7f4cccc91b0bb4d058c", "score": "0.49257603", "text": "func (o *AppVersion) GetNumberOk() (*int32, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Number, true\n}", "title": "" }, { "docid": "c7f5df7f8630a9d152ea6bfb1e3308a2", "score": "0.49235755", "text": "func (o *MicrosoftGraphEducationSchool) GetAddressOk() (AnyOfmicrosoftGraphPhysicalAddress, bool) {\n\tif o == nil || o.Address == nil {\n\t\tvar ret AnyOfmicrosoftGraphPhysicalAddress\n\t\treturn ret, false\n\t}\n\treturn *o.Address, true\n}", "title": "" }, { "docid": "4097bb4ea207abc4cdbfd7f1ef503d6b", "score": "0.49221957", "text": "func Home() Place {\n\treturn home\n}", "title": "" }, { "docid": "dcb9c9e6d985cf5da5eb347512a156ea", "score": "0.4921064", "text": "func (m *CleaningroomMutation) Phonenumber() (r string, exists bool) {\n\tv := m.phonenumber\n\tif v == nil {\n\t\treturn\n\t}\n\treturn *v, true\n}", "title": "" }, { "docid": "543cfb92d3123632ff13bb644d18ff36", "score": "0.49100196", "text": "func (o *MicrosoftGraphEducationUser) GetMailingAddressOk() (AnyOfmicrosoftGraphPhysicalAddress, bool) {\n\tif o == nil || o.MailingAddress == nil {\n\t\tvar ret AnyOfmicrosoftGraphPhysicalAddress\n\t\treturn ret, false\n\t}\n\treturn *o.MailingAddress, true\n}", "title": "" }, { "docid": "758eb49ce2bc57e384e47d3b310e6e3c", "score": "0.49009222", "text": "func (o *PaymentInitiationRecipient) GetAddressOk() (*PaymentInitiationAddress, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Address.Get(), o.Address.IsSet()\n}", "title": "" }, { "docid": "39cac494167d8a2f484d1d7aef72ba39", "score": "0.48744562", "text": "func (o *User) GetOfficeLocationOk() (string, bool) {\n\tif o == nil || o.OfficeLocation == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.OfficeLocation, true\n}", "title": "" }, { "docid": "bcf511faeaa9374b4bc3330ec686ede8", "score": "0.4871056", "text": "func (o *V0037Node) GetArchitectureOk() (*string, bool) {\n\tif o == nil || o.Architecture == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Architecture, true\n}", "title": "" }, { "docid": "220623239ad46310e0a3af2949101bde", "score": "0.48600987", "text": "func GetHome() string {\n\treturn env[\"HOME\"]\n}", "title": "" }, { "docid": "f56eaec4d5ec925d9cff1866203e94b5", "score": "0.48551768", "text": "func (o *VirtualizationVmwareVirtualMachineAllOf) GetMacAddressOk() ([]string, bool) {\n\tif o == nil || o.MacAddress == nil {\n\t\treturn nil, false\n\t}\n\treturn o.MacAddress, true\n}", "title": "" }, { "docid": "69c4223ca05fd42aaa86f50cb193d035", "score": "0.48473617", "text": "func (o *operation) HomeNode() *node {\n\tif o.homeNodePtr == nil {\n\t\tif o.homeNode != \"\" {\n\t\t\to.homeNodePtr, _ = o.services.store.getNode(o.homeNode)\n\t\t}\n\t\tif o.homeNodePtr == nil {\n\t\t\to.homeNodePtr = o.network.active[0]\n\t\t}\n\t}\n\treturn o.homeNodePtr\n}", "title": "" }, { "docid": "211792bc1ec0348021e97bb5ffa00f69", "score": "0.48339987", "text": "func (o *InlineResponse20027Person) GetPhoneNumberOfficeExtOk() (*string, bool) {\n\tif o == nil || o.PhoneNumberOfficeExt == nil {\n\t\treturn nil, false\n\t}\n\treturn o.PhoneNumberOfficeExt, true\n}", "title": "" }, { "docid": "1ce6d2701cd3a8a363ba04f7c3082c40", "score": "0.48256913", "text": "func Home() string {\n\treturn home\n}", "title": "" }, { "docid": "8480a9d09ceaca6301c172e6b76a38c4", "score": "0.48240894", "text": "func (o *ActivateTenantRequest) GetCompanyAddressOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.CompanyAddress, true\n}", "title": "" }, { "docid": "93e0e6f207cd494c855d57041c16461a", "score": "0.47998264", "text": "func (o *StorageVdMemberEpAllOf) GetPresenceOk() (*string, bool) {\n\tif o == nil || o.Presence == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Presence, true\n}", "title": "" }, { "docid": "a792bf662cab4900b33b4bb17769bfc1", "score": "0.47896904", "text": "func (o *StorageHitachiPortAllOf) GetIpv6LinkLocalAddressOk() (*string, bool) {\n\tif o == nil || o.Ipv6LinkLocalAddress == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Ipv6LinkLocalAddress, true\n}", "title": "" }, { "docid": "7b256454075b5684e03aeb0b4fcd9bc8", "score": "0.47807944", "text": "func GetHome() (homeDir string, err_code int, err_Str string) {\n\t//Detect OS using the runtime.GOOS\n\tif runtime.GOOS == \"windows\" {\n\t\thomeDir = os.Getenv(\"USERPROFILE\")\n\t\tWINDOWS = true\n\t} else {\n\t\thomeDir = os.Getenv(\"HOME\")\n\t}\n\n\tif homeDir == \"\" {\n\t\t_, werr := io.WriteString(W, ERRHOME)\n\t\tif werr != nil {\n\t\t\treturn \"\", errors.WRITER_OUTPUT, werr.Error()\n\t\t}\n\t}\n\treturn homeDir, 0, \"\"\n}", "title": "" }, { "docid": "611c8255c7b58a2f2f208e84386ad0ff", "score": "0.4779656", "text": "func (o *MicrosoftGraphEducationUser) GetOfficeLocationOk() (string, bool) {\n\tif o == nil || o.OfficeLocation == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.OfficeLocation, true\n}", "title": "" }, { "docid": "d31521a870dcd1845db0e7745754e4c9", "score": "0.47735676", "text": "func HomeFolder() string {\n\tif runtime.GOOS == \"windows\" {\n\t\treturn os.Getenv(\"USERPROFILE\")\n\t}\n\n\treturn os.Getenv(\"HOME\")\n}", "title": "" }, { "docid": "9135dd85e070afb0acc82b5a6432231f", "score": "0.47725815", "text": "func (o *EquipmentFanModule) GetPartNumberOk() (*string, bool) {\n\tif o == nil || o.PartNumber == nil {\n\t\treturn nil, false\n\t}\n\treturn o.PartNumber, true\n}", "title": "" }, { "docid": "dcc980f59a633d22d5a06917ec04924c", "score": "0.4767284", "text": "func (o *DKSharesInfo) GetAddressOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Address, true\n}", "title": "" }, { "docid": "3991966137c05a90d058de63561d7a0f", "score": "0.47638932", "text": "func (obj *MessengerUser) HasPhoneNumber() bool {\n\tproxyResult := /*pr4*/ C.vssq_messenger_user_has_phone_number(obj.cCtx)\n\n\truntime.KeepAlive(obj)\n\n\treturn bool(proxyResult) /* r9 */\n}", "title": "" }, { "docid": "01a081841157943b1985dd23a9b297a8", "score": "0.47608325", "text": "func (o *InlineResponse20027Person) HasPhoneNumberOffice() bool {\n\tif o != nil && o.PhoneNumberOffice != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "011fab8aaf988e198a6f69f3933bffa3", "score": "0.47495112", "text": "func (o *Account) GetPrimaryOk() (*bool, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Primary, true\n}", "title": "" }, { "docid": "98931f86a1246d30c3f020c7e5834874", "score": "0.47461852", "text": "func (m *UserMutation) PhoneNumber() (r string, exists bool) {\n\tv := m.phone_number\n\tif v == nil {\n\t\treturn\n\t}\n\treturn *v, true\n}", "title": "" }, { "docid": "8d48d010b8b7a6fad6ac3c021be9f45f", "score": "0.47263235", "text": "func Home() string {\n\tif runtime.GOOS == \"windows\" {\n\t\thome := os.Getenv(\"HOMEDRIVE\") + os.Getenv(\"HOMEPATH\")\n\t\tif home == \"\" {\n\t\t\thome = os.Getenv(\"USERPROFILE\")\n\t\t}\n\t\treturn home\n\t}\n\treturn os.Getenv(\"HOME\")\n}", "title": "" }, { "docid": "39b901d0b643b931e4b85528b8f475c1", "score": "0.4720192", "text": "func (o *InlineResponse20027Person) HasPhoneNumberFax() bool {\n\tif o != nil && o.PhoneNumberFax != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "4848869ff92b30362f6145d79a5e362e", "score": "0.47164625", "text": "func (o *V0037JobProperties) GetCpuBindingHintOk() (*string, bool) {\n\tif o == nil || o.CpuBindingHint == nil {\n\t\treturn nil, false\n\t}\n\treturn o.CpuBindingHint, true\n}", "title": "" }, { "docid": "d94c39111a80f5978a37b802f95f2c61", "score": "0.47114882", "text": "func (l *List) Home() *Element {\n\tif l == nil {\n\t\treturn nil\n\t}\n\t//\tif l.root == nil { return l.root }\n\treturn l.root.Away()\n}", "title": "" }, { "docid": "ff22e2ca98013b2fa9f8a4693c9f1ab8", "score": "0.4706699", "text": "func (conf blah) Home() string {\n\treturn homeDir\n}", "title": "" }, { "docid": "8a23a1c9f6b4910492219fe35ec3e3a7", "score": "0.46942604", "text": "func (o *ActivateTenantRequest) GetCompanyOrgNumberOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.CompanyOrgNumber, true\n}", "title": "" }, { "docid": "ca5af2faa8bb2715556e8ba2eaad1078", "score": "0.46717665", "text": "func (a *Client) AllHomepages(params *AllHomepagesParams) (*AllHomepagesOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewAllHomepagesParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"all_homepages\",\n\t\tMethod: \"GET\",\n\t\tPathPattern: \"/homepages\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"https\"},\n\t\tParams: params,\n\t\tReader: &AllHomepagesReader{formats: a.formats},\n\t\tContext: params.Context,\n\t\tClient: params.HTTPClient,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tsuccess, ok := result.(*AllHomepagesOK)\n\tif ok {\n\t\treturn success, nil\n\t}\n\t// unexpected success response\n\t// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue\n\tmsg := fmt.Sprintf(\"unexpected success response for all_homepages: API contract not enforced by server. Client expected to get an error, but got: %T\", result)\n\tpanic(msg)\n}", "title": "" }, { "docid": "36cef6f6c7a3793dd172f99a3c896ff3", "score": "0.46691608", "text": "func CreateBrokerHomeResponse(host string, scheme string) *pb.BrokerHomeResponse {\n\n\tvar apiEntries map[string]*pb.BrokerAPIInfoEntry\n\tapiEntries = make(map[string]*pb.BrokerAPIInfoEntry)\n\n\tfor k := range brokerAPILinksValues {\n\t\tapiEntries[k] = &pb.BrokerAPIInfoEntry{\n\t\t\tHref: GetBrokerHomeLinksAPIS(scheme, host, k),\n\t\t\tTitle: brokerAPILinksTitles[k],\n\t\t\tTemplated: brokerAPILinksTempl[k],\n\t\t}\n\t}\n\n\tcuries := []*pb.BrokerAPIInfoEntry{}\n\tcuries = append(curies, &pb.BrokerAPIInfoEntry{\n\t\tName: \"pb\",\n\t\tHref: GenerateBrokerAPIPath(scheme, host, BROKER_CURIES_URL,\n\t\t\tstrings.NewReplacer(\":rel\", \"{rel}\")),\n\t})\n\n\treturn &pb.BrokerHomeResponse{\n\t\tResponse: pb.CreateResponse(pb.Response_SUCCESS, \"Broker Home.\"),\n\t\tXLinks: apiEntries,\n\t\tCuries: curies,\n\t}\n}", "title": "" }, { "docid": "d4426250373c593c9fac4a327714ed1e", "score": "0.46688062", "text": "func (o *V0037JobProperties) GetSpreadJobOk() (*bool, bool) {\n\tif o == nil || o.SpreadJob == nil {\n\t\treturn nil, false\n\t}\n\treturn o.SpreadJob, true\n}", "title": "" }, { "docid": "fb83e370b2cf621eabdabce41c413993", "score": "0.46627173", "text": "func (o *ExpenseApplicationsIndexResponseExpenseApplications) GetApplicationNumberOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ApplicationNumber, true\n}", "title": "" }, { "docid": "e40fe702bdf144ff375f4405c51d457d", "score": "0.46527103", "text": "func (a TwitterApi) GetHomeTimeline(v url.Values) (timeline []Tweet, err error) {\n\tv = cleanValues(v)\n\tif val := v.Get(\"include_entities\"); val == \"\" {\n\t\tv.Set(\"include_entities\", \"true\")\n\t}\n\n\tresponse_ch := make(chan response)\n\ta.queryQueue <- query{a.baseUrl + \"/statuses/home_timeline.json\", v, &timeline, _GET, response_ch}\n\treturn timeline, (<-response_ch).err\n}", "title": "" }, { "docid": "8abc4e2248c7730723102507e8453af3", "score": "0.46521735", "text": "func (f *Files) FindHome() (string, error) {\n\thome, err := homedir.Dir()\n\tif err != nil {\n\t\treturn \"\", errors.New(\"Could not find home dir\")\n\t}\n\n\treturn home, nil\n}", "title": "" }, { "docid": "ed6285bd1503c07d32b212951cdce8e5", "score": "0.46496543", "text": "func likelyHomeRouterIPWindows() (ret netaddr.IP, ok bool) {\n\tcmd := exec.Command(\"route\", \"print\", \"-4\")\n\tcmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true}\n\tstdout, err := cmd.StdoutPipe()\n\tif err != nil {\n\t\treturn\n\t}\n\tif err := cmd.Start(); err != nil {\n\t\treturn\n\t}\n\tdefer cmd.Wait()\n\n\tvar f []mem.RO\n\tlineread.Reader(stdout, func(lineb []byte) error {\n\t\tline := mem.B(lineb)\n\t\tif !mem.Contains(line, mem.S(\"0.0.0.0\")) {\n\t\t\treturn nil\n\t\t}\n\t\tf = mem.AppendFields(f[:0], line)\n\t\tif len(f) < 3 || !f[0].EqualString(\"0.0.0.0\") || !f[1].EqualString(\"0.0.0.0\") {\n\t\t\treturn nil\n\t\t}\n\t\tipm := f[2]\n\t\tip, err := netaddr.ParseIP(string(mem.Append(nil, ipm)))\n\t\tif err == nil && isPrivateIP(ip) {\n\t\t\tret = ip\n\t\t}\n\t\treturn nil\n\t})\n\treturn ret, !ret.IsZero()\n}", "title": "" }, { "docid": "807cf35f8934bc2ac25ae752f529be5c", "score": "0.46414387", "text": "func GetHome() string {\n\thome := os.Getenv(\"HOME\")\n\tif home == \"\" {\n\t\thome = filepath.Join(os.Getenv(\"HOMEDRIVE\"), os.Getenv(\"HOMEPATH\"))\n\t}\n\treturn home\n}", "title": "" }, { "docid": "a0aab85cd6d6b36ccef73ca79e14a4e1", "score": "0.46398973", "text": "func (o *IPv6Range) GetUpperAddressOk() (string, bool) {\n\tif o == nil || o.UpperAddress == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.UpperAddress, true\n}", "title": "" }, { "docid": "c92dc38591e97471cf8a0d37d39fbe60", "score": "0.46385643", "text": "func (o *JsonEnvironment) GetRoothashOk() (*string, bool) {\n\tif o == nil || o.Roothash == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Roothash, true\n}", "title": "" }, { "docid": "be99fa26921688c926e2da299421aa5e", "score": "0.46345964", "text": "func (o *Credit1099Payer) GetAddressOk() (*CreditPayStubAddress, bool) {\n\tif o == nil || o.Address == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Address, true\n}", "title": "" }, { "docid": "f1c9ca16934058644a832c33ebf7f160", "score": "0.4629281", "text": "func testGetHome(t *testing.T, c *TestContext) {\n\ttcc := []TestCase{\n\t\t*c.UserCheckTestCase, // 0 : token empty\n\t\t{\n\t\t\tToken: c.Config.Users.User.Token,\n\t\t\tRespContains: []string{`\"Commitment\":`, `\"Payment\":`, `\"ImportLog\":[`,\n\t\t\t\t`\"Programmation\":[`, `\"PaymentCreditSum\":`,\n\t\t\t\t`\"HomeMessage\":{\"Title\":\"Message du jour\",\"Body\":\"Corps du message\"}`,\n\t\t\t\t`\"AveragePayment\":[`, `\"CsfWeekTrend\":`,\n\t\t\t\t`\"FlowStockDelays\":`, `\"PaymentRate\":`},\n\t\t\tCount: 4,\n\t\t\tCountItemName: `\"Month\"`,\n\t\t\tStatusCode: http.StatusOK}, // 1 : ok\n\t}\n\tf := func(tc TestCase) *httpexpect.Response {\n\t\treturn c.E.GET(\"/api/home\").\n\t\t\tWithHeader(\"Authorization\", \"Bearer \"+tc.Token).Expect()\n\t}\n\tfor _, r := range chkFactory(tcc, f, \"GetHomes\") {\n\t\tt.Error(r)\n\t}\n}", "title": "" }, { "docid": "9de9e57294e8afb50f2e6f2b7ca8d256", "score": "0.46258187", "text": "func (m *IosDeviceFeaturesConfiguration) GetHomeScreenPages()([]IosHomeScreenPageable) {\n val, err := m.GetBackingStore().Get(\"homeScreenPages\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.([]IosHomeScreenPageable)\n }\n return nil\n}", "title": "" }, { "docid": "24cec504e784b3a8984da999675a389d", "score": "0.46221206", "text": "func (r *Trail) HomeRegion() pulumi.StringOutput {\n\treturn (pulumi.StringOutput)(r.s.State[\"homeRegion\"])\n}", "title": "" } ]
1dd10aa7b8233d5dc944fc9d9a911f8e
Retained sets the retained configuration property and returns the builder struct for further updates.
[ { "docid": "b741d57218b8199aaa56f5d510d13bb3", "score": "0.70631796", "text": "func (mocb *mqttOptionalConfigurationBuilder) Retained(retained bool) *mqttOptionalConfigurationBuilder {\n\tmocb.options[pkg.Retained] = strconv.FormatBool(retained)\n\treturn mocb\n}", "title": "" } ]
[ { "docid": "315f4672f872b481bbeacc871a9916dd", "score": "0.58068025", "text": "func Retained(retained bool) msgOptions {\n\treturn func(msg *msg) {\n\t\tmsg.retained = retained\n\t}\n}", "title": "" }, { "docid": "bd2b73b2af81075db9130a7cef90b8a5", "score": "0.5211622", "text": "func Retain(retain bool) CreateOption {\n\treturn func(c *CreateOptions) {\n\t\tc.retain = retain\n\t}\n}", "title": "" }, { "docid": "b92e69d0f6d234d31204a906f7ccfd6f", "score": "0.51935685", "text": "func (s HelpPassportConfigArray) Retain(keep func(x HelpPassportConfig) bool) HelpPassportConfigArray {\n\tn := 0\n\tfor _, x := range s {\n\t\tif keep(x) {\n\t\t\ts[n] = x\n\t\t\tn++\n\t\t}\n\t}\n\ts = s[:n]\n\n\treturn s\n}", "title": "" }, { "docid": "07b5e2a3677b826f5bcb205d28a74f30", "score": "0.51739687", "text": "func Get() *Configuration {\n\tif cfg == nil {\n\t\tcfg = &Configuration{}\n\t\tcfg.initSignalHandler()\n\t\tcfg.Notify.BootstrapKeyChanged = NewChanNotify()\n\t\tcfg.Notify.CertificateRefresh = NewChanNotify()\n\t\tcfg.Notify.Reload = NewChanNotify()\n\t\tcfg.Notify.Shutdown = NewChanNotify()\n\t}\n\treturn cfg\n}", "title": "" }, { "docid": "a9b23853cc2e6fad0d47bce1e7634163", "score": "0.51086557", "text": "func (cfg *appConfig) copy() appConfig { return *cfg }", "title": "" }, { "docid": "087da475ce0a948c21f65ff57ed7f313", "score": "0.5036308", "text": "func newConfig() Config {\n\treturn Config{\n\t\tDefaultContainerConfig: newDefaultContainerConfig(),\n\t\tContainersConfig: map[string]ContainerConfig{},\n\t\tExclude: []string{},\n\t}\n}", "title": "" }, { "docid": "c53e5a97a227dec8fd808abfe1576d4d", "score": "0.49629602", "text": "func (builder *Builder) Restore() *Builder {\n\treturn builder.With(Restore)\n}", "title": "" }, { "docid": "4a9488b267a36ad721f50a7d9b6e0884", "score": "0.4922296", "text": "func (rb *PipelineConfigBuilder) Build() PipelineConfig {\n\treturn *rb.v\n}", "title": "" }, { "docid": "0b3e96096544298185aec477ced20790", "score": "0.49133056", "text": "func Get() *Config {\n\tif conf != nil {\n\t\treturn conf\n\t} else {\n\t\treturn make()\n\t}\n}", "title": "" }, { "docid": "000981a2b69fc88baafde85ae643111f", "score": "0.4903685", "text": "func (s HelpPassportConfigClassArray) Retain(keep func(x HelpPassportConfigClass) bool) HelpPassportConfigClassArray {\n\tn := 0\n\tfor _, x := range s {\n\t\tif keep(x) {\n\t\t\ts[n] = x\n\t\t\tn++\n\t\t}\n\t}\n\ts = s[:n]\n\n\treturn s\n}", "title": "" }, { "docid": "eecca6115c69e6454681f4ba86145823", "score": "0.48692787", "text": "func newConfig(old *Config, vars Vars) *Config {\n\tv := mergeVars(old.Vars, vars)\n\n\treturn &Config{\n\t\tAppID: old.AppID,\n\t\tVars: v,\n\t}\n}", "title": "" }, { "docid": "2b3b8e809fbdebead5a18fca8fca94f3", "score": "0.48642755", "text": "func (c *config) Build() *dataX.Config {\n\treturn &dataX.Config{}\n}", "title": "" }, { "docid": "7a640d8a38cffc76b48c5f7fb1317702", "score": "0.485712", "text": "func (c *CachedMarkerIndexBranchIDMapping) Retain() *CachedMarkerIndexBranchIDMapping {\n\treturn &CachedMarkerIndexBranchIDMapping{c.CachedObject.Retain()}\n}", "title": "" }, { "docid": "b18911991e6c0e014f6d12f5ba154755", "score": "0.4836847", "text": "func (f *factory) Builder() *resource.Builder {\n\treturn resource.NewBuilder(f.kubeConfigFlags)\n}", "title": "" }, { "docid": "0ebbe4be0967773f0381fc8593efca99", "score": "0.47383854", "text": "func (c *Config) Build() *Godim {\n\tif c.appProfile == nil {\n\t\tc.appProfile = newAppProfile()\n\t}\n\tc.appProfile.lock()\n\tif c.activateES {\n\t\tc.eventSwitch = NewEventSwitch(c.bufferSize)\n\t}\n\treturn NewGodim(c)\n}", "title": "" }, { "docid": "3333e4cd38750e42f2fe2a2ee31838e9", "score": "0.4732498", "text": "func (c *Container) Config() *ContainerConfig {\n\treturnConfig := new(ContainerConfig)\n\tdeepcopier.Copy(c.config).To(returnConfig)\n\n\treturn returnConfig\n}", "title": "" }, { "docid": "c2a8511547c4dcbbb8db86327eb912e9", "score": "0.4725948", "text": "func Get() *Config {\n\treturn configuration\n}", "title": "" }, { "docid": "9e5594b6a07d2ce2a82886df0f094929", "score": "0.47106472", "text": "func C() *AppConfig {\n\treturn Config\n}", "title": "" }, { "docid": "175bde2266e97e588671cbc349e5de81", "score": "0.47088796", "text": "func (c *CachedMessage) Retain() *CachedMessage {\n\treturn &CachedMessage{c.CachedObject.Retain()}\n}", "title": "" }, { "docid": "1bce762e7d810316c9c1d90a613bd2d8", "score": "0.46662304", "text": "func Get() *Builder {\n\tb := pool.Get().(*Builder)\n\tb.bb.Reset()\n\tb.locked = false\n\treturn b\n}", "title": "" }, { "docid": "d3a3ee8e0fa02ce08ba59265a8ba51af", "score": "0.4658592", "text": "func (stackEntry *valuePayloadPropagationStackEntry) Retain() *valuePayloadPropagationStackEntry {\n\treturn &valuePayloadPropagationStackEntry{\n\t\tCachedPayload: stackEntry.CachedPayload.Retain(),\n\t\tCachedPayloadMetadata: stackEntry.CachedPayloadMetadata.Retain(),\n\t\tCachedTransaction: stackEntry.CachedTransaction.Retain(),\n\t\tCachedTransactionMetadata: stackEntry.CachedTransactionMetadata.Retain(),\n\t}\n}", "title": "" }, { "docid": "d9626e3e5cdf90a39659ca7cdb6a0391", "score": "0.4657871", "text": "func (cb *ConfigBuilder) Build() *gojmx.JMXConfig {\n\treturn cb.config\n}", "title": "" }, { "docid": "dcdb90d51e02cc81d88d0f0de69c6b93", "score": "0.4637701", "text": "func Get() *Config {\n\treturn &c\n}", "title": "" }, { "docid": "7563c83c08aea4452ab8e476601b1500", "score": "0.4635763", "text": "func (builder *Builder) Conceal() *Builder {\n\treturn builder.With(Conceal)\n}", "title": "" }, { "docid": "b7197557d5bd76b512b953280fbaa6ea", "score": "0.46334693", "text": "func (mocb *mqttOptionalConfigurationBuilder) Build() map[string]string {\n\treturn mocb.options\n}", "title": "" }, { "docid": "5b4e0ab3a8f0b392fb5fd16f14fb8f2e", "score": "0.46240526", "text": "func (builder *appGwConfigBuilder) Build() *network.ApplicationGatewayPropertiesFormat {\n\tconfig := builder.appGwConfig\n\treturn &config\n}", "title": "" }, { "docid": "463c92bb0c05138525d247cbf8e753d0", "score": "0.46017635", "text": "func (mocb *mqttOptionalConfigurationBuilder) KeepAlive(keepAlive int) *mqttOptionalConfigurationBuilder {\n\tmocb.options[pkg.KeepAlive] = strconv.Itoa(keepAlive)\n\treturn mocb\n}", "title": "" }, { "docid": "81c90ac260d1e347583d9f4d6e3dc368", "score": "0.4568527", "text": "func (c *delayedCore) With(fields []zapcore.Field) zapcore.Core {\n\tclone := c.clone()\n\taddFields(clone.enc, fields)\n\treturn clone\n}", "title": "" }, { "docid": "405f75de6448ccb3e4d9bd42bc6f9a28", "score": "0.4568424", "text": "func (c *Conn) Config() *ConnConfig { return c.config.Copy() }", "title": "" }, { "docid": "b59386c377fb6903b04c9b371ec7022a", "score": "0.45633852", "text": "func (*ProducerComponent) Settings() *ProducerConfig { return &ProducerConfig{} }", "title": "" }, { "docid": "a163fcae90cc6ff9cfd0f9fa44e554e0", "score": "0.45608902", "text": "func (c *CachedChild) Retain() *CachedChild {\n\treturn &CachedChild{c.CachedObject.Retain()}\n}", "title": "" }, { "docid": "42b2854e1ad6ea716f9a17106b7aa332", "score": "0.4557728", "text": "func Get() Config {\n\treturn c\n}", "title": "" }, { "docid": "ed22eeb5ff64be757900bf5c64496374", "score": "0.4545559", "text": "func (rb *DelayedDataCheckConfigBuilder) Build() DelayedDataCheckConfig {\n\treturn *rb.v\n}", "title": "" }, { "docid": "4cbe001ce4299ba7eeb35b2bf221e264", "score": "0.45410925", "text": "func ProdKeepDims(value bool) ProdAttr {\n\treturn func(m optionalAttr) {\n\t\tm[\"keep_dims\"] = value\n\t}\n}", "title": "" }, { "docid": "5528e2dda57269e59ef18b243a4070a3", "score": "0.4532803", "text": "func (c *Circuit) Config() Config {\n\tc.notThreadSafeConfigMu.Lock()\n\tdefer c.notThreadSafeConfigMu.Unlock()\n\treturn c.notThreadSafeConfig\n}", "title": "" }, { "docid": "17d5816c6910908c8fac091723c67600", "score": "0.45321473", "text": "func (client *Client) Retain(ctx context.Context, req *pb.RetainRequest) (err error) {\n\tdefer mon.Task()(&ctx)(&err)\n\t_, err = client.client.Retain(ctx, req)\n\treturn Error.Wrap(err)\n}", "title": "" }, { "docid": "35258e06f78444067cacf1db12f327e9", "score": "0.45293647", "text": "func (d MessagesDhConfigNotModified) construct() MessagesDhConfigClass { return &d }", "title": "" }, { "docid": "e7d6d41158076d95c38f6fd6239706a3", "score": "0.4526946", "text": "func (b *chunkBuilder) withConfig(config *compiledcfg.ProjectConfig) *chunkBuilder {\n\tb.config = config\n\treturn b\n}", "title": "" }, { "docid": "bb2f059f680566c21f98a493f268c324", "score": "0.45233828", "text": "func (c *Config) Release() error {\n\tif C.munmap(unsafe.Pointer(c.config), C.sizeof_struct_cConfig) != 0 {\n\t\treturn fmt.Errorf(\"failed to release starter memory\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "65c713f87ea91db4cdff1b7b6d62bcd6", "score": "0.45212385", "text": "func newConfiguration() *configuration {\n\treturn &configuration{\n\t\tUseSSL: true,\n\t\tLocation: \"us-east-1\",\n\t\tMaxBackups: 5,\n\t\tBackupPrefix: \"backup-\",\n\t}\n}", "title": "" }, { "docid": "9d2e4acb44a41146fe914d0d5a6ad266", "score": "0.4503211", "text": "func (d *Decoder) Config() *Config {\n\treturn d.cfg\n}", "title": "" }, { "docid": "6e213014ea4b5fece493ab0dd50a4f05", "score": "0.44931033", "text": "func (lens Lens) Config() lenses.LensConfig {\n\treturn lenses.LensConfig{\n\t\tName: name,\n\t\tTitle: title,\n\t\tPriority: priority,\n\t}\n}", "title": "" }, { "docid": "b3a020f698490d25ef6391281f9d208f", "score": "0.4492353", "text": "func Get() Config {\n\treturn _conf\n}", "title": "" }, { "docid": "12ab34039e7996c287ec05d544e58a50", "score": "0.4483826", "text": "func newConfig() *bqConfig {\n\treturn &bqConfig{\n\t\tarenaSize: cDefaultArenaSize,\n\t\tmaxInMemArenas: cMinMaxInMemArenas,\n\t}\n}", "title": "" }, { "docid": "f9674f7d2695ad9c9ecc3e6ed396e06f", "score": "0.44695103", "text": "func (ref *Config) ProducerConfig() *sarama.Config {\n\treturn &ref.Config.Config\n}", "title": "" }, { "docid": "1369e4be7ea18395b69062f8655c04cb", "score": "0.44549924", "text": "func Get() *Config {\n\treturn &config\n}", "title": "" }, { "docid": "1369e4be7ea18395b69062f8655c04cb", "score": "0.44549924", "text": "func Get() *Config {\n\treturn &config\n}", "title": "" }, { "docid": "77cb25be33830438f03772c9e1cbbe64", "score": "0.44505802", "text": "func ToInternal(in *Config, old *api.Config, setVersionFields bool) (*api.Config, error) {\n\tc := &api.Config{}\n\tif old != nil {\n\t\tc = old.DeepCopy()\n\t}\n\n\t// setting c.PluginVersion = in.PluginVersion is done up-front by the plugin\n\t// code. It could be done here as well (gated by setVersionFields) but\n\t// would/should be a no-op. To simplify the logic, we don't do it.\n\n\tc.ComponentLogLevel.APIServer = &in.ComponentLogLevel.APIServer\n\tc.ComponentLogLevel.ControllerManager = &in.ComponentLogLevel.ControllerManager\n\tc.ComponentLogLevel.Node = &in.ComponentLogLevel.Node\n\n\tc.SecurityPatchPackages = in.SecurityPatchPackages\n\tc.SSHSourceAddressPrefixes = in.SSHSourceAddressPrefixes\n\n\tif setVersionFields {\n\t\tinVersion, found := in.Versions[c.PluginVersion]\n\t\tif !found {\n\t\t\treturn nil, fmt.Errorf(\"version %q not found\", c.PluginVersion)\n\t\t}\n\n\t\t// Generic offering configurables\n\t\tc.ImageOffer = inVersion.ImageOffer\n\t\tc.ImagePublisher = inVersion.ImagePublisher\n\t\tc.ImageSKU = inVersion.ImageSKU\n\t\tc.ImageVersion = inVersion.ImageVersion\n\n\t\t// Container images configuration\n\t\tc.Images.AlertManager = inVersion.Images.AlertManager\n\t\tc.Images.AnsibleServiceBroker = inVersion.Images.AnsibleServiceBroker\n\t\tc.Images.ClusterMonitoringOperator = inVersion.Images.ClusterMonitoringOperator\n\t\tc.Images.ConfigReloader = inVersion.Images.ConfigReloader\n\t\tc.Images.Console = inVersion.Images.Console\n\t\tc.Images.ControlPlane = inVersion.Images.ControlPlane\n\t\tc.Images.Grafana = inVersion.Images.Grafana\n\t\tc.Images.KubeRbacProxy = inVersion.Images.KubeRbacProxy\n\t\tc.Images.KubeStateMetrics = inVersion.Images.KubeStateMetrics\n\t\tc.Images.Node = inVersion.Images.Node\n\t\tc.Images.NodeExporter = inVersion.Images.NodeExporter\n\t\tc.Images.OAuthProxy = inVersion.Images.OAuthProxy\n\t\tc.Images.Prometheus = inVersion.Images.Prometheus\n\t\tc.Images.PrometheusConfigReloader = inVersion.Images.PrometheusConfigReloader\n\t\tc.Images.PrometheusOperator = inVersion.Images.PrometheusOperator\n\t\tc.Images.Registry = inVersion.Images.Registry\n\t\tc.Images.RegistryConsole = inVersion.Images.RegistryConsole\n\t\tc.Images.Router = inVersion.Images.Router\n\t\tc.Images.ServiceCatalog = inVersion.Images.ServiceCatalog\n\t\tc.Images.TemplateServiceBroker = inVersion.Images.TemplateServiceBroker\n\t\tc.Images.WebConsole = inVersion.Images.WebConsole\n\n\t\tc.Images.Format = inVersion.Images.Format\n\n\t\tc.Images.Httpd = inVersion.Images.Httpd\n\t\tc.Images.MasterEtcd = inVersion.Images.MasterEtcd\n\n\t\tc.Images.GenevaLogging = inVersion.Images.GenevaLogging\n\t\tc.Images.GenevaStatsd = inVersion.Images.GenevaStatsd\n\t\tc.Images.GenevaTDAgent = inVersion.Images.GenevaTDAgent\n\n\t\tc.Images.AzureControllers = inVersion.Images.AzureControllers\n\t\tc.Images.Canary = inVersion.Images.Canary\n\t\tc.Images.AroAdmissionController = inVersion.Images.AroAdmissionController\n\t\tc.Images.EtcdBackup = inVersion.Images.EtcdBackup\n\t\tc.Images.MetricsBridge = inVersion.Images.MetricsBridge\n\t\tc.Images.Startup = inVersion.Images.Startup\n\t\tc.Images.Sync = inVersion.Images.Sync\n\t\tc.Images.TLSProxy = inVersion.Images.TLSProxy\n\n\t\tc.Images.LogAnalyticsAgent = inVersion.Images.LogAnalyticsAgent\n\t\tc.Images.MetricsServer = inVersion.Images.MetricsServer\n\t}\n\n\t// use setVersionFields to override the secrets below otherwise\n\t// they become un-updatable..\n\tif c.Certificates.GenevaLogging.Key == nil || setVersionFields {\n\t\tc.Certificates.GenevaLogging.Key = in.Certificates.GenevaLogging.Key\n\t}\n\tif c.Certificates.GenevaLogging.Cert == nil || setVersionFields {\n\t\tc.Certificates.GenevaLogging.Cert = in.Certificates.GenevaLogging.Cert\n\t}\n\tif c.Certificates.GenevaMetrics.Key == nil || setVersionFields {\n\t\tc.Certificates.GenevaMetrics.Key = in.Certificates.GenevaMetrics.Key\n\t}\n\tif c.Certificates.GenevaMetrics.Cert == nil || setVersionFields {\n\t\tc.Certificates.GenevaMetrics.Cert = in.Certificates.GenevaMetrics.Cert\n\t}\n\tif c.Certificates.PackageRepository.Key == nil || setVersionFields {\n\t\tc.Certificates.PackageRepository.Key = in.Certificates.PackageRepository.Key\n\t}\n\tif c.Certificates.PackageRepository.Cert == nil || setVersionFields {\n\t\tc.Certificates.PackageRepository.Cert = in.Certificates.PackageRepository.Cert\n\t}\n\n\t// Geneva integration configurables\n\tif c.GenevaLoggingSector == \"\" {\n\t\tc.GenevaLoggingSector = in.GenevaLoggingSector\n\t}\n\tif c.GenevaLoggingAccount == \"\" {\n\t\tc.GenevaLoggingAccount = in.GenevaLoggingAccount\n\t}\n\tif c.GenevaLoggingNamespace == \"\" {\n\t\tc.GenevaLoggingNamespace = in.GenevaLoggingNamespace\n\t}\n\tif c.GenevaLoggingControlPlaneAccount == \"\" {\n\t\tc.GenevaLoggingControlPlaneAccount = in.GenevaLoggingControlPlaneAccount\n\t}\n\tif c.GenevaLoggingControlPlaneEnvironment == \"\" {\n\t\tc.GenevaLoggingControlPlaneEnvironment = in.GenevaLoggingControlPlaneEnvironment\n\t}\n\tif c.GenevaLoggingControlPlaneRegion == \"\" {\n\t\tc.GenevaLoggingControlPlaneRegion = in.GenevaLoggingControlPlaneRegion\n\t}\n\tif c.GenevaMetricsAccount == \"\" {\n\t\tc.GenevaMetricsAccount = in.GenevaMetricsAccount\n\t}\n\tif c.GenevaMetricsEndpoint == \"\" {\n\t\tc.GenevaMetricsEndpoint = in.GenevaMetricsEndpoint\n\t}\n\n\tif c.Images.ImagePullSecret == nil || setVersionFields {\n\t\tc.Images.ImagePullSecret = in.ImagePullSecret\n\t}\n\tif c.Images.GenevaImagePullSecret == nil || setVersionFields {\n\t\tc.Images.GenevaImagePullSecret = in.GenevaImagePullSecret\n\t}\n\n\treturn c, nil\n}", "title": "" }, { "docid": "d8867abd118e55cca782e19cbb6961f0", "score": "0.445034", "text": "func (c *CachedPersistableEvent) Retain() *CachedPersistableEvent {\n\treturn &CachedPersistableEvent{c.CachedObject.Retain()}\n}", "title": "" }, { "docid": "14fcd65e6cbd8cac46eaaba71d50abc2", "score": "0.44483986", "text": "func Get() *Config {\n\tonce.Do(func() {\n\t\tinstance = set()\n\t})\n\treturn instance\n}", "title": "" }, { "docid": "ffd76e60f1b20357dc76f90a1e2c62e8", "score": "0.44443437", "text": "func (b *DiffConfigBuilder) Build() (DiffConfig, error) {\n\terr := b.diffConfig.Validate()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn b.diffConfig, nil\n}", "title": "" }, { "docid": "168e0f15445d6851c2ccbd309c7849e8", "score": "0.44439763", "text": "func (co *serverConfig) Build() serverConfig {\n\n\treturn serverConfig{\n\t\tURL: co.URL,\n\t\tRetry: co.Retry,\n\t\tRetryWaitTime: co.RetryWaitTime,\n\t}\n}", "title": "" }, { "docid": "96b8611a372db3f26638ba8d68408b72", "score": "0.4437928", "text": "func (op *outputRenewalCache) Config() *config.BotConfig {\n\treturn op.cfg\n}", "title": "" }, { "docid": "cb9f8d405b1710049fc5f23064491f19", "score": "0.44316658", "text": "func (old ContainerConfig) Copy() ContainerConfig {\n\t// Copy all fields\n\tres := old\n\n\t// Make deep copy of slices\n\t// none yet - placeholder\n\n\treturn res\n}", "title": "" }, { "docid": "c055c58cabccab745afdff7cbec2759f", "score": "0.44266266", "text": "func WithBuilder(builder BuilderFn) Option {\n\treturn func(c *Config) {\n\t\tc.Builder = builder\n\t}\n}", "title": "" }, { "docid": "75ab57b09b662d63145e36af38c6cb11", "score": "0.44202164", "text": "func newConfig() (*rest.Config, error) {\n // try in cluster config first, it should fail quickly on lack of env vars\n cfg, err := inClusterConfig()\n if err != nil {\n cfg, err = clientcmd.BuildConfigFromFlags(\"\", clientcmd.RecommendedHomeFile)\n if err != nil {\n return nil, errors.Wrap(err, \"failed to get InClusterConfig and Config from kube_config\")\n }\n }\n return cfg, nil\n}", "title": "" }, { "docid": "5d36079ac4d672ad56a335bd871cc20f", "score": "0.44132304", "text": "func New() *Config {\n\treturn &Config{\n\t\tOptions: AppConfig{\n\t\t\tHoldtime: 12 * time.Hour, // do not retry a successful device backup before this holdtime\n\t\t\tScanInterval: 10 * time.Minute, // interval for scanning device table\n\t\t\tMaxConcurrency: 20, // limit for concurrent backup jobs\n\t\t\tMaxConfigFiles: 120, // limit for per-device saved files\n\t\t\tMaxConfigLoadSize: 10000000, // 10M limit max config file size for loading to memory\n\t\t},\n\t\tDevices: []DevConfig{},\n\t}\n}", "title": "" }, { "docid": "6dc69baa70711191ff52d643b1476cae", "score": "0.44086635", "text": "func newVal(size int) *Val {\n\treturn &Val{\n\t\tmetadata: make([]Meta, size),\n\t}\n}", "title": "" }, { "docid": "74bc2bc80e65b98f0b004e860ac2a277", "score": "0.44017678", "text": "func Get() *Config {\n\tonce.Do(func() {\n\t\tenvType := os.Getenv(\"WAKEUP_ENV\")\n\t\tif envType == \"\" {\n\t\t\tenvType = \"dev\"\n\t\t}\n\t\tif err := configor.New(&configor.Config{Environment: envType}).Load(&config, \"config.json\"); err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tconfigBytes, err := json.MarshalIndent(config, \"\", \" \")\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tfmt.Println(\"Configuration:\", string(configBytes))\n\t})\n\treturn &config\n}", "title": "" }, { "docid": "d89075503172f0f0c6f3184b3375b207", "score": "0.4395887", "text": "func Get() Configuration {\n\tvar cfg Configuration\n\n\t// Parse any arguments that may have been passed\n\tconfigPath, verbose, debug, checkonly := parseArguments()\n\n\t// Read the config file\n\tconfigFile, err := ioutil.ReadFile(configPath)\n\tif err != nil {\n\t\tfmt.Println(\"Unable to read configuration file: \", err)\n\t\tos.Exit(1)\n\t}\n\n\t// Parse the config into a struct\n\terr = yaml.Unmarshal(configFile, &cfg)\n\tif err != nil {\n\t\tfmt.Println(\"Unable to parse yaml configuration: \", err)\n\t\tos.Exit(1)\n\t}\n\n\t// If Manifest wasnt provided, exit\n\tif cfg.Manifest == \"\" {\n\t\tfmt.Println(\"Invalid configuration - Manifest: \", err)\n\t\tos.Exit(1)\n\t}\n\n\t// If URL wasnt provided, exit\n\tif cfg.URL == \"\" {\n\t\tfmt.Println(\"Invalid configuration - URL: \", err)\n\t\tos.Exit(1)\n\t}\n\n\t// If URLPackages wasn't provided, use the repo URL\n\tif cfg.URLPackages == \"\" {\n\t\tcfg.URLPackages = cfg.URL\n\t}\n\n\t// If AppDataPath wasn't provided, configure a default\n\tif cfg.AppDataPath == \"\" {\n\t\tcfg.AppDataPath = filepath.Join(os.Getenv(\"ProgramData\"), \"gorilla/\")\n\t} else {\n\t\tcfg.AppDataPath = filepath.Clean(cfg.AppDataPath)\n\t}\n\n\t// Set the verbosity\n\tif verbose && !cfg.Verbose {\n\t\tcfg.Verbose = true\n\t}\n\n\t// Set the debug and verbose\n\tif debug && !cfg.Debug {\n\t\tcfg.Debug = true\n\t\tcfg.Verbose = true\n\t}\n\n\tif checkonly && !cfg.CheckOnly {\n\t\tcfg.CheckOnly = true\n\t}\n\n\t// Set the cache path\n\tcfg.CachePath = filepath.Join(cfg.AppDataPath, \"cache\")\n\n\t// Add to GorillaReport\n\treport.Items[\"Manifest\"] = cfg.Manifest\n\treport.Items[\"Catalog\"] = cfg.Catalogs\n\n\treturn cfg\n}", "title": "" }, { "docid": "49b9f62cb3c6218af93c8fb66f12c131", "score": "0.43799144", "text": "func Get() *Config {\n\tif c == nil {\n\t\tInit(\"\")\n\t}\n\n\treturn c\n}", "title": "" }, { "docid": "7f3549a960deba319f24242e24a12cf7", "score": "0.4378271", "text": "func Get() *Config {\n\treturn config\n}", "title": "" }, { "docid": "c25b6147f844211a3edbff8db07f2472", "score": "0.43732145", "text": "func reset() {\n\tConfiguration = &ConfigurationStruct{}\n\tConfiguration.Service.ReadMaxLimit = 100\n}", "title": "" }, { "docid": "d531d1e84ce1fdc94dd745340d812ea8", "score": "0.43665248", "text": "func (c *Consumer) Configuration() (config api.ConsumerConfig) {\n\treturn *c.cfg\n}", "title": "" }, { "docid": "967a37380a39e88c3fb25100bdab1819", "score": "0.4365742", "text": "func newConfigHandler() *configHandler {\n return &configHandler {\n database: map[string]Config{},\n }\n}", "title": "" }, { "docid": "e5a2f1585ec9b8e21b2a775f4771abd2", "score": "0.43571752", "text": "func make() *Config {\n\t// instantiating configuration\n\tconf = &Config{}\n\n\t// filling the structure\n\terr := iterateTemplate(conf, false)\n\n\tcheckError(err)\n\n\t// parsing set flags\n\tflag.Parse()\n\n\tif conf.Basic.Debug {\n\t\tprintConfToLog(conf)\n\t}\n\n\treturn conf\n}", "title": "" }, { "docid": "e4ff20a1f0219b4fae33b823dd50dcd6", "score": "0.4348517", "text": "func newConfig() *Config {\n\t// TODO: use config as default, allow setting some values per-job\n\t// and prevent config changes affecting already-running tasks\n\treturn &Config{\n\t\tPath: DefaultPath,\n\t\tDatastorePrefix: \"MP_\",\n\t\tDefaultQueue: \"\",\n\t\tShards: 8,\n\t\tOversampling: 32,\n\t\tLeaseDuration: time.Duration(30) * time.Second,\n\t\tLeaseTimeout: time.Duration(10)*time.Minute + time.Duration(30)*time.Second,\n\t\tTaskTimeout: time.Duration(10)*time.Minute - time.Duration(30)*time.Second,\n\t\tCursorTimeout: time.Duration(50) * time.Second,\n\t\tRetries: 31,\n\t\tLogVerbose: false,\n\t\tHost: \"\",\n\t}\n}", "title": "" }, { "docid": "62dcc26f69480634a32e81cd92532538", "score": "0.4345089", "text": "func emptyConf() *configuration {\n\tconf := &configuration{}\n\tconf.chainMgrConf = &chainmgmt.ChainMgrConf{}\n\tconf.batchConf = &chainmgmt.BatchConf{}\n\tconf.txConf = &txConf{}\n\tconf.dataConf = &dataConf{}\n\treturn conf\n}", "title": "" }, { "docid": "b5beda91916d166b52dde25633eb6d35", "score": "0.4341304", "text": "func newConfig(appName string, pathToKeybase string, log Log, ignoreSnooze bool) (*config, error) {\n\tcfg := newDefaultConfig(appName, pathToKeybase, log, ignoreSnooze)\n\terr := cfg.load()\n\treturn &cfg, err\n}", "title": "" }, { "docid": "c6cf22c8cee45f58074ebf06b38b3ea0", "score": "0.4331771", "text": "func (rb *SmoothingModelContainerBuilder) Build() SmoothingModelContainer {\n\treturn *rb.v\n}", "title": "" }, { "docid": "3f6b50b15016cdd918e4d29b15496c8d", "score": "0.43311825", "text": "func newConfig() *config {\n\treturn &config{\n\t\tAddr: \":80\",\n\t\tCacheSize: 1000,\n\t\tLogLevel: \"info\",\n\t\tRequestTimeout: 3000,\n\t\tTargetAddr: \"https://places.aviasales.ru\",\n\t}\n}", "title": "" }, { "docid": "bd66503051074cd45353e67a7f94a869", "score": "0.4328482", "text": "func Get() Config {\n\treturn conf\n}", "title": "" }, { "docid": "384bca22d6058f7b9eed9583eae7673c", "score": "0.432803", "text": "func (b *AutoscalerScaleDownConfigBuilder) Build() (object *AutoscalerScaleDownConfig, err error) {\n\tobject = new(AutoscalerScaleDownConfig)\n\tobject.bitmap_ = b.bitmap_\n\tobject.delayAfterAdd = b.delayAfterAdd\n\tobject.delayAfterDelete = b.delayAfterDelete\n\tobject.delayAfterFailure = b.delayAfterFailure\n\tobject.enabled = b.enabled\n\tobject.unneededTime = b.unneededTime\n\tobject.utilizationThreshold = b.utilizationThreshold\n\treturn\n}", "title": "" }, { "docid": "cfda258a359a473f29f0b1a41335bac8", "score": "0.42978722", "text": "func (b *ClusterBuilder) ExternalConfiguration(value *ExternalConfigurationBuilder) *ClusterBuilder {\n\tb.externalConfiguration = value\n\tif value != nil {\n\t\tb.bitmap_ |= 524288\n\t} else {\n\t\tb.bitmap_ &^= 524288\n\t}\n\treturn b\n}", "title": "" }, { "docid": "fcc5ca22f14c5cd4356783733991645f", "score": "0.42951417", "text": "func (b *Builder) Build() Interface {\n\tswitch {\n\tcase b.path != \"\":\n\t\tfSys := fs.NewDocumentFs()\n\t\treturn NewKubeConfig(FromFile(b.path, fSys), InjectFilePath(b.path, fSys), InjectTempRoot(b.root))\n\tcase b.fromParent():\n\t\t// TODO add method that would get kubeconfig from parent cluster and glue it together\n\t\t// with parent kubeconfig if needed\n\t\treturn NewKubeConfig(func() ([]byte, error) {\n\t\t\treturn nil, errors.ErrNotImplemented{}\n\t\t})\n\tcase b.bundlePath != \"\":\n\t\treturn NewKubeConfig(FromBundle(b.bundlePath), InjectTempRoot(b.root))\n\tdefault:\n\t\tfSys := fs.NewDocumentFs()\n\t\t// return default path to kubeconfig file in airship workdir\n\t\tpath := filepath.Join(util.UserHomeDir(), config.AirshipConfigDir, KubeconfigDefaultFileName)\n\t\treturn NewKubeConfig(FromFile(path, fSys), InjectFilePath(path, fSys), InjectTempRoot(b.root))\n\t}\n}", "title": "" }, { "docid": "de51ccdca2ea4a35f4d5c8a6af896a43", "score": "0.42835313", "text": "func (c Config) Build() (*Gaffer, error) {\n\n\t// Initialise Gaffer object\n\tg := &Gaffer{\n\t\tConfig: c,\n\t\tedge_buffer: map[EdgeKey]*Edge{},\n\t\tentity_buffer: map[EntityKey]*Entity{},\n\t\tbufferq: make(chan *Update, 5000),\n\t\tloadq: make(chan *map[string]interface{}, 50),\n\t}\n\n\t// Start loader and buffer manager goroutines\n\tgo g.Loader()\n\tgo g.BufferManager()\n\n\treturn g, nil\n}", "title": "" }, { "docid": "a0f2258701f98e0acb377880e980ffda", "score": "0.42761767", "text": "func (s *Services) Config() *Configuration { return &s.config }", "title": "" }, { "docid": "a9f6338f31205c8d2ac4712289c920b5", "score": "0.4259489", "text": "func (rb *IndexSettingsBuilder) Build() IndexSettings {\n\treturn *rb.v\n}", "title": "" }, { "docid": "1aca91637594edc8e76e9d05900bd50d", "score": "0.4255255", "text": "func (_UpkeepRegistrationRequests *UpkeepRegistrationRequestsCaller) GetRegistrationConfig(opts *bind.CallOpts) (struct {\n\tEnabled bool\n\tWindowSizeInBlocks uint32\n\tAllowedPerWindow uint16\n\tKeeperRegistry common.Address\n\tMinLINKJuels *big.Int\n\tWindowStart uint64\n\tApprovedInCurrentWindow uint16\n}, error) {\n\tvar out []interface{}\n\terr := _UpkeepRegistrationRequests.contract.Call(opts, &out, \"getRegistrationConfig\")\n\n\toutstruct := new(struct {\n\t\tEnabled bool\n\t\tWindowSizeInBlocks uint32\n\t\tAllowedPerWindow uint16\n\t\tKeeperRegistry common.Address\n\t\tMinLINKJuels *big.Int\n\t\tWindowStart uint64\n\t\tApprovedInCurrentWindow uint16\n\t})\n\tif err != nil {\n\t\treturn *outstruct, err\n\t}\n\n\toutstruct.Enabled = *abi.ConvertType(out[0], new(bool)).(*bool)\n\toutstruct.WindowSizeInBlocks = *abi.ConvertType(out[1], new(uint32)).(*uint32)\n\toutstruct.AllowedPerWindow = *abi.ConvertType(out[2], new(uint16)).(*uint16)\n\toutstruct.KeeperRegistry = *abi.ConvertType(out[3], new(common.Address)).(*common.Address)\n\toutstruct.MinLINKJuels = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int)\n\toutstruct.WindowStart = *abi.ConvertType(out[5], new(uint64)).(*uint64)\n\toutstruct.ApprovedInCurrentWindow = *abi.ConvertType(out[6], new(uint16)).(*uint16)\n\n\treturn *outstruct, err\n\n}", "title": "" }, { "docid": "d7132432d226778c368ba0f3e1308ec3", "score": "0.42544812", "text": "func (desc *Description) With(key string, byteStart int, byteCount int) *Description {\n\tcloned := desc.clone()\n\tcloned.lastField = &entry{start: byteStart, count: byteCount}\n\tcloned.fields[key] = cloned.lastField\n\n\treturn cloned\n}", "title": "" }, { "docid": "1aa4b3dfa2768f348dac9543c7781d76", "score": "0.4254139", "text": "func (s EncryptedChatDiscardedArray) Retain(keep func(x EncryptedChatDiscarded) bool) EncryptedChatDiscardedArray {\n\tn := 0\n\tfor _, x := range s {\n\t\tif keep(x) {\n\t\t\ts[n] = x\n\t\t\tn++\n\t\t}\n\t}\n\ts = s[:n]\n\n\treturn s\n}", "title": "" }, { "docid": "30643b53eb79fabcfb32ba54b507d362", "score": "0.42535827", "text": "func New(filename string) *Config {\n\tconfig := Config{filename, nil}\n\tconfig.Reload()\n\tgo config.watch()\n\treturn &config\n}", "title": "" }, { "docid": "fec0676de218d1d54ace2f427085fb2a", "score": "0.42533424", "text": "func (builder *Builder) BlackF() *Builder {\n\treturn builder.With(BlackF)\n}", "title": "" }, { "docid": "551e550e771c1158b05901e9112f0919", "score": "0.4246649", "text": "func (c Configuration) Clone() Configuration {\n\treturn Configuration{\n\t\tEDATool: c.EDATool,\n\t\tInputFile: c.InputFile,\n\t\tOutputFile: c.OutputFile,\n\t\tLastUpdated: c.LastUpdated,\n\t}\n}", "title": "" }, { "docid": "2d8447cce1d43ecfa69cf6d767a686ab", "score": "0.4242021", "text": "func (w *Wioctl) Config() *Config {\n\tw.lock.Lock()\n\tcfg := w.cfg\n\tw.lock.Unlock()\n\treturn cfg\n}", "title": "" }, { "docid": "e3f9eee833500ec23ba004f078584d12", "score": "0.42255068", "text": "func BuildConfiguration() *BuildConfigurationApplyConfiguration {\n\treturn &BuildConfigurationApplyConfiguration{}\n}", "title": "" }, { "docid": "77bcbacb92e8d3d93c33cc81d1e142df", "score": "0.4221285", "text": "func (config *Config) Build() (Buffer, error) {\n\tswitch config.BufferType {\n\tcase \"memory\", \"\":\n\t\treturn NewMemoryBuffer(config), nil\n\tdefault:\n\t\treturn nil, errors.NewError(\n\t\t\tfmt.Sprintf(\"Invalid buffer type %s\", config.BufferType),\n\t\t\t\"The only supported buffer type is 'memory'\",\n\t\t)\n\t}\n}", "title": "" }, { "docid": "812e84c096bdfa972b12cf5416c1d821", "score": "0.42202508", "text": "func (serv *Server) Config() Config {\n return serv.config\n}", "title": "" }, { "docid": "cd9b637e419c0a8e3a06fa144d177044", "score": "0.42201132", "text": "func (a *app) UseRouter(router http.Handler) App {\n\ta.logDebugInfo(\"UseBuilder\")\n\ta.router = router\n\ta.safeLogInfo(\"Added ConfigurationBuilder\")\n\treturn a\n}", "title": "" }, { "docid": "02fcb1195b25be678bfb4da7e5d46971", "score": "0.42172208", "text": "func newOptions() (*Options, error) {\n\to := &Options{\n\t\tconfig: new(componentconfig.CoordinatorConfiguration),\n\t}\n\treturn o, nil\n}", "title": "" }, { "docid": "ffbe0717efe3cca2b90302cdcee6b182", "score": "0.42170537", "text": "func (c *Cache) Configuration() *config.CachingConfig {\n\treturn c.Config\n}", "title": "" }, { "docid": "931b19e950ef232152245fe535b366b9", "score": "0.42136085", "text": "func ProductionConfig() (*Configuration, error) {\n\tc, err := getFlags()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tsc, err := spotifyclient.GetSpotfiyClient(os.Getenv(\"SPOTIFY_ID\"), os.Getenv(\"SPOTIFY_SECRET\"))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tc.Sc = sc\n\n\tS3C, err := s3.GetS3(false)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tc.S3C = S3C\n\n\treturn c, nil\n}", "title": "" }, { "docid": "000dbf561dccbd65c0d9aae7587e8699", "score": "0.4210664", "text": "func New() *Config {\n\tcfg := &Config{}\n\tcfg.SetDefaults()\n\tcfg.ChangedCH = make(chan bool)\n\treturn cfg\n}", "title": "" }, { "docid": "917eba4be7b166827499d5765b13b7a9", "score": "0.42065343", "text": "func (bs *bootstrap) Config() *Config {\n\treturn bs.config\n}", "title": "" }, { "docid": "98426c89aa522f4741bdf6ccf35c2c64", "score": "0.42033723", "text": "func Builder() builder {\n\treturn builder{\n\t\tfields: make(map[string]interface{}),\n\t\tcontextFields: make(map[string]interface{}),\n\t}\n}", "title": "" }, { "docid": "ecf24ef4a42961eb5e1f404a92274e63", "score": "0.41995636", "text": "func New() Builder {\n\treturn newBuilder()\n}", "title": "" }, { "docid": "3fb51b5fa230852c5b0a3382798b9ee4", "score": "0.41911107", "text": "func (lens Lens) Config() lenses.LensConfig {\n\treturn lenses.LensConfig{\n\t\tName: \"html\",\n\t\tTitle: \"HTML\",\n\t\tPriority: 3,\n\t\tHideTitle: true,\n\t}\n}", "title": "" }, { "docid": "bcafb5a60e9b5bf5a746b50ee3962c46", "score": "0.41908348", "text": "func NewConfig() *component {\n\treturn &component{\n\t\tEnableDefaultStorageClass: true,\n\t\tEnableVolumeScheduling: true,\n\t\tEnableVolumeResizing: true,\n\t\tEnableVolumeSnapshot: true,\n\t\tReclaimPolicy: \"Retain\",\n\t}\n}", "title": "" }, { "docid": "ad093ccf3ab57004c78ea0f0ced4fad4", "score": "0.41905594", "text": "func BuildConfig(opt ClientOptions) (*rest.Config, error) {\n\tvar cfg *rest.Config\n\tvar err error\n\n\tmaster := opt.Master\n\tkubeconfig := opt.KubeConfig\n\tcfg, err = clientcmd.BuildConfigFromFlags(master, kubeconfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcfg.QPS = opt.QPS\n\tcfg.Burst = opt.Burst\n\n\treturn cfg, nil\n}", "title": "" }, { "docid": "f758f00ffa2eac5d76813aef53294982", "score": "0.41771552", "text": "func New(ctx context.Context, opt Opt) (*Builder, error) {\n\treqHandler := newReqBodyHandler(tracing.DefaultTransport)\n\n\tc, err := newController(ctx, reqHandler, opt)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tb := &Builder{\n\t\tcontroller: c,\n\t\tdnsconfig: opt.DNSConfig,\n\t\treqBodyHandler: reqHandler,\n\t\tjobs: map[string]*buildJob{},\n\t\tuseSnapshotter: opt.UseSnapshotter,\n\t}\n\treturn b, nil\n}", "title": "" } ]
cc4222554f6d76abf7c40515acfcbb3c
MustParse is like Parse but it panics if the constraint string is invalid.
[ { "docid": "34460f012d0ab55d4ff3e7154f5e9fd3", "score": "0.6545292", "text": "func (s ConstraintStr) MustParse() Constraints {\n\tret, err := s.Parse()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ret\n}", "title": "" } ]
[ { "docid": "cc265639ffa92e95be89b9f194354ba8", "score": "0.6622124", "text": "func (s ConstraintStr) Parse() (Constraints, error) {\n\traw, err := version.NewConstraint(string(s))\n\tif err != nil {\n\t\treturn Constraints{}, err\n\t}\n\treturn Constraints{raw}, nil\n}", "title": "" }, { "docid": "f2e5e7e95fa79155a0264d2b66c8e662", "score": "0.6027029", "text": "func FromString(s string) Query {\n\tparts := str.ToArgv(s)\n\n\t// the fieldless constraint is any parts that do not produce\n\t// another type of constraint. Ie, the resulting string.\n\tvar fieldless []string\n\n\tvar cs []Constraint\n\tfor _, p := range parts {\n\t\top, field, valueStr := splitPart(p)\n\n\t\tif op == \"\" && field == \"\" {\n\t\t\tfieldless = append(fieldless, valueStr)\n\t\t\tcontinue\n\t\t}\n\n\t\tswitch op {\n\t\tcase \"eq\":\n\t\t\top = operator.Equal\n\n\t\tcase \"\":\n\t\t\t// default empty ops to equal.\n\t\t\t//\n\t\t\t// in the future it should probably translate to some type of loose\n\t\t\t// operator, maybe fts?\n\t\t\top = operator.Equal\n\t\t}\n\n\t\tv := value.String(valueStr)\n\n\t\tcs = append(cs, Constraint{\n\t\t\tOperator: op,\n\t\t\tField: &field,\n\t\t\tValue: &v,\n\t\t})\n\t}\n\n\tif len(fieldless) != 0 {\n\t\tv := value.String(strings.Join(fieldless, \" \"))\n\t\tcs = append(cs, Constraint{\n\t\t\tOperator: operator.Equal,\n\t\t\tValue: &v,\n\t\t})\n\t}\n\n\tif len(cs) == 1 {\n\t\treturn New().Const(cs[0])\n\t}\n\n\treturn New().And(cs...)\n}", "title": "" }, { "docid": "a25bf2f410a325c1cd60b29d0524b35d", "score": "0.568748", "text": "func RequireFromString(value string) Decimal {\n\td := decimal.RequireFromString(value)\n\treturn Decimal{decimal: d, formula: d.String()}\n}", "title": "" }, { "docid": "7b3e946dace420fdf16a57bbc8596075", "score": "0.5600997", "text": "func (pc ParseContext) MustParseString(ctx context.Context, s string) ast.Branch {\n\treturn pc.MustParse(ctx, parser.NewScanner(s))\n}", "title": "" }, { "docid": "ce5544b398df2d89f9aa40c5432ba6cf", "score": "0.55923355", "text": "func (semver *Semver) FromString(input string) {\n\tif !IsValid(input) {\n\t\tpanic(fmt.Errorf(\"'%s' does not follow semver\", input))\n\t}\n\tmatches := regexp.\n\t\tMustCompile(semverRegex).\n\t\tFindStringSubmatch(input)\n\tsemver.Prefix = matches[1]\n\tvar err error\n\tsemver.Major, err = strconv.Atoi(matches[2])\n\tif err != nil {\n\t\tsemver.Major = InvalidNumber\n\t}\n\tsemver.Minor, err = strconv.Atoi(matches[3])\n\tif err != nil {\n\t\tsemver.Minor = InvalidNumber\n\t}\n\tsemver.Patch, err = strconv.Atoi(matches[4])\n\tif err != nil {\n\t\tsemver.Patch = InvalidNumber\n\t}\n\tsemver.Label = strings.Trim(matches[5], \"-\")\n\tsemver.LabelIteration, err = strconv.Atoi(strings.Trim(matches[6], \".\"))\n\tif err != nil {\n\t\tsemver.LabelIteration = InvalidNumber\n\t}\n}", "title": "" }, { "docid": "56ab3bbb1cc3bc89a52a760a55396573", "score": "0.5448015", "text": "func (c AssetConverter) MustFromString(s string) Asset {\n\ta, e := c.FromString(s)\n\tif e != nil {\n\t\tlog.Fatal(e)\n\t}\n\treturn a\n}", "title": "" }, { "docid": "794996559e4ff6ff673ac1b1ad78c252", "score": "0.5439987", "text": "func MustParse(input string) T {\n\tt, err := Parse(input)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn t\n}", "title": "" }, { "docid": "9063fb696f80d4ed4aa9b6856db4bc5a", "score": "0.53940845", "text": "func FromString(input string) *ParseTree {\n\tp := NewParser(strings.NewReader(input))\n\ttree, err := p.Next()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\t_, err = p.Next()\n\tif err != io.EOF {\n\t\tpanic(ResidualInput)\n\t}\n\treturn tree\n}", "title": "" }, { "docid": "f51a6100345d89b2abb0103f9970ec8e", "score": "0.5329257", "text": "func MustParseExprString(s string) Expr {\n\texpr, err := ParseExprString(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn expr\n}", "title": "" }, { "docid": "2f48aa0e66ae1c7626b0dc30f7f93706", "score": "0.52570355", "text": "func must_from_string(t *testing.T, ctx *Context, s string, file_path string, line_original string) Quad {\n\n\tif ctx.Error() != nil {\n\t\tt.Fatalf(\"Test failed in test file %s for line %s. At entry of must_from_string(%s), there is already an error %s\", file_path, line_original, s, ctx.Error())\n\t}\n\n\tif len(s) > 0 && s[0] == '\\'' { // delete opening quote if any\n\t\ts = s[1:]\n\n\t\tassert(s[len(s)-1] == '\\'') // delete closing quote\n\t\ts = s[:len(s)-1]\n\t}\n\n\tq := ctx.FromString(s)\n\n\tif ctx.Error() != nil {\n\t\tt.Fatalf(\"Test failed in test file %s for line %s. must_from_string(%s) failed. %s\", file_path, line_original, s, ctx.Error())\n\t}\n\n\t// we take this occasion to also test the conversion string --> Quad --> string --> Quad\n\n\tq2 := ctx.FromString(q.String())\n\n\tif ctx.Error() != nil {\n\t\tt.Fatalf(\"Test failed in test file %s for line %s. must_from_string(%s) failed. %s\", file_path, line_original, s, ctx.Error())\n\t}\n\n\tif q2.QuadToString() != q.QuadToString() { // in particular, we can have the case -0 --> \"0\" --> 0\n\t\tif q2.IsZero() && q.IsZero() { // because FromString() always discard the \"-\" sign for 0 values. In financial applications, displaying \"-0\" is strange, and we prefer to avoid it.\n\t\t\treturn q\n\t\t}\n\n\t\tt.Fatalf(\"q2 %s != q %s %v %v\", q2, q, q2.QuadToString(), q.QuadToString())\n\t}\n\n\treturn q\n}", "title": "" }, { "docid": "cac958dad8262d9b38a61bfeaaa20511", "score": "0.52223104", "text": "func FromString(l string) Priority {\n\tswitch strings.TrimSpace(strings.ToLower(l)) {\n\tcase \"emergency\":\n\t\treturn Emergency\n\tcase \"alert\":\n\t\treturn Alert\n\tcase \"critical\":\n\t\treturn Critical\n\tcase \"error\":\n\t\treturn Error\n\tcase \"warning\":\n\t\treturn Warning\n\tcase \"notice\":\n\t\treturn Notice\n\tcase \"info\":\n\t\treturn Info\n\tcase \"debug\":\n\t\treturn Debug\n\tcase \"trace\":\n\t\treturn Trace\n\tdefault:\n\t\treturn Invalid\n\t}\n}", "title": "" }, { "docid": "69d313cd3ba25c0f370c005ade3a4e6e", "score": "0.5180465", "text": "func MustParse(s string) UTC {\n\tt, err := Parse(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn t\n}", "title": "" }, { "docid": "1ab28799cd814b3b08cdc4df4185c054", "score": "0.5158758", "text": "func MustParse(input string) (a PCIAddress) {\n\tvar e error\n\tif a, e = Parse(input); e != nil {\n\t\tpanic(e)\n\t}\n\treturn a\n}", "title": "" }, { "docid": "e7f59e1560556a2b8677b2fbad305cbf", "score": "0.5119847", "text": "func MustParse(s string) Expression {\n\te, err := Parse(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn e\n}", "title": "" }, { "docid": "9cd5c94eee28fd83d237f4ded8e47644", "score": "0.50905293", "text": "func Parse(intvl string) (Interval, error) {\n\tintvl = strings.TrimSpace(intvl)\n\tnidx := -1\n\tfor idx, c := range intvl {\n\t\tif c < '0' || c > '9' {\n\t\t\tbreak\n\t\t}\n\t\tnidx = idx\n\t}\n\n\tvar qty int64\n\tif nidx < 0 {\n\t\tqty = 1\n\n\t} else {\n\t\tvar err error\n\t\tqty, err = strconv.ParseInt(intvl[:nidx+1], 10, 64)\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\tunit, err := ParseUnit(intvl[nidx+1:])\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif err := Validate(unit, Qty(qty)); err != nil {\n\t\treturn 0, err\n\t}\n\treturn Raw(Qty(qty), unit), err\n}", "title": "" }, { "docid": "fbf76b0f7f2f76066e2096d7e08efb0e", "score": "0.50624555", "text": "func (uuid *UUID) MustFromString(in string) {\n\tif err := unmarshalText(\"UUID\", \"MustFromString\", uuid.a[:], []byte(in)); err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "a7c232abe4a1f634052881ed61263402", "score": "0.50360006", "text": "func MustParse(s string) UUID {\n\tu, err := Parse(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn u\n}", "title": "" }, { "docid": "61d9c0ef35fc03af14a901933889ea96", "score": "0.5003257", "text": "func Compile(constraint string) (semver.Range, error) {\n\treturn semver.ParseRange(constraint)\n}", "title": "" }, { "docid": "83a5c1e8d419bf13a197624f7df3b10e", "score": "0.49907008", "text": "func RequireFromStringWithName(name string, value string) Decimal {\n\td := decimal.RequireFromString(value)\n\treturn Decimal{name: name, decimal: d, vars: name, formula: d.String()}\n}", "title": "" }, { "docid": "d689f1f97728025702856a4d0eda403c", "score": "0.49732122", "text": "func StrMin(name string, input string, param string) {\n\n\tmin, _ := strconv.Atoi(param)\n\n\tif utf8.RuneCountInString(input) < min {\n\n\t\toutput := fmt.Sprintf(\"Minimum %s characters.\", strconv.Itoa(min))\n\n\t\taddError(name, output)\n\t}\n}", "title": "" }, { "docid": "b5ae7ae6069a0ab99d9048c174956004", "score": "0.4962387", "text": "func MustParse(ip string) IP {\n\tx, err := Parse(ip)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn x\n}", "title": "" }, { "docid": "a9980d1497eff36153510184fc5e91b7", "score": "0.49534234", "text": "func MustParse(ccy string) Currency {\n\tc, err := Parse(ccy)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn *c\n}", "title": "" }, { "docid": "cefd3b599af29dbeb57d8569d669200b", "score": "0.49528015", "text": "func (c *Context) NewFromString(s string) (*Decimal, Condition, error) {\n\td := new(Decimal)\n\treturn c.SetString(d, s)\n}", "title": "" }, { "docid": "dac739d785ab663be17cabacae9c8316", "score": "0.4951179", "text": "func Parse(str string) (Amount, error) {\n\tcleanAmountString := cleanAmountStringPattern.ReplaceAllLiteralString(str, \"\")\n\tminorUnitAmount, err := strconv.ParseInt(cleanAmountString, 10, 64)\n\tif err != nil {\n\t\treturn FromMinorUnit(0), err\n\t}\n\treturn FromMinorUnit(minorUnitAmount), nil\n}", "title": "" }, { "docid": "cd88849a5da0906e7ccbcb6690c415e3", "score": "0.49435693", "text": "func NewConstraint(v string) (Constraints, error) {\n\tvs := strings.Split(v, \",\")\n\tresult := make([]*Constraint, len(vs))\n\tfor i, single := range vs {\n\t\tc, err := parseSingle(single)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tresult[i] = c\n\t}\n\n\treturn Constraints(result), nil\n}", "title": "" }, { "docid": "15002399f9362ce8bf9160be760d5313", "score": "0.49175987", "text": "func MustFromString(in string) UUID {\n\tvar uuid UUID\n\terr := unmarshalText(\"\", \"MustFromString\", uuid.a[:], []byte(in))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn uuid\n}", "title": "" }, { "docid": "ade3ee449c15c39baf904d08aa4a2c8f", "score": "0.4917174", "text": "func MustParse(s string) *Query {\n\tq, err := New(s)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"failed to parse %s: %v\", s, err))\n\t}\n\treturn q\n}", "title": "" }, { "docid": "f63a027dd934d0af2bc448afec572456", "score": "0.4912105", "text": "func TestParse(t *testing.T) {\n\tp, err := parse(testPvlString)\n\tif err != nil {\n\t\tt.Fatalf(\"parse failed: %v\", err)\n\t}\n\tif p.PvlVersion < 0 {\n\t\tt.Fatalf(\"version should be >=0: %v\", p.PvlVersion)\n\t}\n}", "title": "" }, { "docid": "a4618e1f9b612df2ad523e5966fbbf57", "score": "0.4911964", "text": "func ParseCapacityString(in interface{}) (uint64, error) {\n\tvar cap uint64\n\n\tjsonIn, ok := in.(json.Number)\n\tif ok {\n\t\tin = jsonIn.String()\n\t}\n\n\tswitch inp := in.(type) {\n\tcase nil:\n\t\t// return default of zero\n\tcase string:\n\t\tif inp == \"\" {\n\t\t\treturn cap, nil\n\t\t}\n\n\t\tmatches := validCapacityString.FindStringSubmatch(inp)\n\n\t\t// no sub-groups means we couldn't parse it\n\t\tif len(matches) <= 1 {\n\t\t\treturn cap, errors.New(\"could not parse capacity from input\")\n\t\t}\n\n\t\tvar multiplier uint64 = 1\n\t\tswitch strings.ToLower(matches[2]) {\n\t\tcase \"kb\":\n\t\t\tmultiplier = 1000\n\t\tcase \"kib\":\n\t\t\tmultiplier = 1024\n\t\tcase \"mb\":\n\t\t\tmultiplier = 1000 * 1000\n\t\tcase \"mib\":\n\t\t\tmultiplier = 1024 * 1024\n\t\tcase \"gb\":\n\t\t\tmultiplier = 1000 * 1000 * 1000\n\t\tcase \"gib\":\n\t\t\tmultiplier = 1024 * 1024 * 1024\n\t\tcase \"tb\":\n\t\t\tmultiplier = 1000 * 1000 * 1000 * 1000\n\t\tcase \"tib\":\n\t\t\tmultiplier = 1024 * 1024 * 1024 * 1024\n\t\t}\n\n\t\tsize, err := strconv.ParseUint(matches[1], 10, 64)\n\t\tif err != nil {\n\t\t\treturn cap, err\n\t\t}\n\n\t\tcap = size * multiplier\n\tcase int:\n\t\tcap = uint64(inp)\n\tcase int32:\n\t\tcap = uint64(inp)\n\tcase int64:\n\t\tcap = uint64(inp)\n\tcase uint:\n\t\tcap = uint64(inp)\n\tcase uint32:\n\t\tcap = uint64(inp)\n\tcase uint64:\n\t\tcap = uint64(inp)\n\tcase float32:\n\t\tcap = uint64(inp)\n\tcase float64:\n\t\tcap = uint64(inp)\n\tdefault:\n\t\treturn cap, errors.New(\"could not parse capacity from input\")\n\t}\n\n\treturn cap, nil\n}", "title": "" }, { "docid": "73b616084a6e77f2c481639160d6cb1d", "score": "0.49092752", "text": "func MustParse(s string) RequestID {\n\tparsed, err := Parse(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn parsed\n}", "title": "" }, { "docid": "b604109dfc84cbe1049fd5b3fd21db5f", "score": "0.48957968", "text": "func MustParse(s string) ID {\n\treturn ID(ulid.MustParse(s))\n}", "title": "" }, { "docid": "01d11dedbeea276800eb4fd825860dd5", "score": "0.48692262", "text": "func MustCompile(constraint string) semver.Range {\n\tverCheck, err := Compile(constraint)\n\tif err != nil {\n\t\tpanic(fmt.Errorf(\"cannot compile go-version constraint '%s' %s\", constraint, err))\n\t}\n\treturn verCheck\n}", "title": "" }, { "docid": "ece25146455d3858597afe44449363d7", "score": "0.48518807", "text": "func ParseUnit(sstr string) (unit Unit, err error) {\n\tips := strings.ToLower(strings.TrimSpace(sstr))\n\tswitch ips {\n\tcase \"s\", \"sec\", \"secs\", \"second\", \"seconds\":\n\t\tunit = Second\n\n\tcase \"min\", \"mins\", \"minute\", \"minutes\":\n\t\tunit = Minute\n\n\tcase \"h\", \"hr\", \"hrs\", \"hour\", \"hours\":\n\t\tunit = Hour\n\n\tcase \"d\", \"ds\", \"day\", \"days\":\n\t\tunit = Day\n\n\tcase \"w\", \"ws\", \"wk\", \"wks\", \"week\", \"weeks\":\n\t\tunit = Week\n\n\tcase \"mo\", \"mos\", \"mnth\", \"mnths\", \"month\", \"months\":\n\t\tunit = Month\n\n\tcase \"y\", \"ys\", \"yr\", \"yrs\", \"year\", \"years\":\n\t\tunit = Year\n\n\tdefault:\n\t\terr = fmt.Errorf(\"interval: unknown unit %q\", sstr)\n\t}\n\treturn\n}", "title": "" }, { "docid": "fada7fadddcd108628a6bd3587b274bd", "score": "0.48290956", "text": "func MustParse(s Spec, e error) Spec {\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn s\n}", "title": "" }, { "docid": "5ff64cc0a9765966c8d2cec284e50bc0", "score": "0.48234606", "text": "func Parse(s string) (CPUSet, error) {\n\tcpuset := New()\n\ts = strings.TrimSpace(s)\n\tif s == \"\" {\n\t\treturn cpuset, nil\n\t}\n\tsets := strings.Split(s, \",\")\n\tfor _, set := range sets {\n\t\tbounds := strings.Split(set, \"-\")\n\t\tif len(bounds) == 1 {\n\t\t\tv, err := strconv.Atoi(bounds[0])\n\t\t\tif err != nil {\n\t\t\t\treturn New(), err\n\t\t\t}\n\n\t\t\tif v > math.MaxUint16 {\n\t\t\t\treturn New(), fmt.Errorf(\"failed to parse element %s, more than max allowed cores\", set)\n\t\t\t}\n\t\t\tcpuset.cpus[uint16(v)] = struct{}{}\n\t\t\tcontinue\n\t\t}\n\t\tif len(bounds) > 2 {\n\t\t\treturn New(), fmt.Errorf(\"failed to parse element %s, more than 1 '-' found\", set)\n\t\t}\n\n\t\tlower, err := strconv.Atoi(bounds[0])\n\t\tif err != nil {\n\t\t\treturn New(), err\n\t\t}\n\t\tupper, err := strconv.Atoi(bounds[1])\n\t\tif err != nil {\n\t\t\treturn New(), err\n\t\t}\n\n\t\tfor v := lower; v <= upper; v++ {\n\t\t\tif v > math.MaxUint16 {\n\t\t\t\treturn New(), fmt.Errorf(\"failed to parse element %s, more than max allowed cores\", set)\n\t\t\t}\n\t\t\tcpuset.cpus[uint16(v)] = struct{}{}\n\t\t}\n\t}\n\n\treturn cpuset, nil\n}", "title": "" }, { "docid": "fe866ea5bade678bab21cfb7772f8b51", "score": "0.48211455", "text": "func ValidateString(input interface{}) error {\n\tv, ok := input.(string)\n\tif !ok {\n\t\treturn fmt.Errorf(\"input param is not a string\")\n\t}\n\n\tif len(v) < 3 {\n\t\treturn fmt.Errorf(\"lenght less than 3\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "4b9e051206dc413b23ad806a91804ff9", "score": "0.476048", "text": "func MustParseVersion(v string) *semver.Version {\n\tver, err := ParseVersion(v)\n\tif err != nil {\n\t\tlog.Fatal(\"version string is illegal\", zap.Error(err))\n\t}\n\treturn ver\n}", "title": "" }, { "docid": "65bc0ece3398d8e21c9fb9fa449b77c7", "score": "0.47590932", "text": "func ValidateFromString(src string, rules ...ValidationRule) (float64, error) {\n\tsrc = strings.TrimSpace(src)\n\tif src == \"\" {\n\t\treturn validate(src, 0, rules...)\n\t}\n\n\tvalue, err := strconv.ParseFloat(src, 64)\n\tif nil != err {\n\t\terr = vError.Errors{vError.ValidationError{\n\t\t\tType: Type,\n\t\t\tData: map[string]interface{}{\n\t\t\t\t\"value\": value,\n\t\t\t},\n\t\t\tFormat: NotAnIntErrorFormat,\n\t\t}}\n\t\treturn value, err\n\t}\n\n\treturn validate(src, value, rules...)\n}", "title": "" }, { "docid": "8d74092c653433c61f839bf1df9011ea", "score": "0.4750624", "text": "func semverFromString(s string) semver {\n\t_, err := isSemver(s)\n\tcheckIfError(err)\n\tr, err := regexp.Compile(semverRegex)\n\tmajor, err := strconv.Atoi(r.FindStringSubmatch(s)[1])\n\tcheckIfError(err)\n\tminor, err := strconv.Atoi(r.FindStringSubmatch(s)[2])\n\tcheckIfError(err)\n\tpatch, err := strconv.Atoi(r.FindStringSubmatch(s)[3])\n\tcheckIfError(err)\n\treturn semver{major, minor, patch}\n}", "title": "" }, { "docid": "d944a467d624da2c267c5bcdf1ceb093", "score": "0.47421402", "text": "func MustParseAmount(in string) Amount {\n\tret, err := ParseAmount(in)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ret\n}", "title": "" }, { "docid": "d8976d594a6ff83a0ae422ff8e63e2d3", "score": "0.47354826", "text": "func (f *ParsedFlags) MustString(name string) string {\n\tval, err := f.GetString(name)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn val\n}", "title": "" }, { "docid": "c7931d8aae1f8ced8bc99e5229001592", "score": "0.47324264", "text": "func parseString(v starlark.Value) (string, error) {\n\tswitch val := v.(type) {\n\tcase starlark.NoneType:\n\t\treturn \"\", nil\n\tcase starlark.String:\n\t\treturn string(val), nil\n\t}\n\treturn \"\", fmt.Errorf(\"expected a string, got %s\", v.Type())\n}", "title": "" }, { "docid": "6599a470c06a364f7a03a8a758f666b3", "score": "0.4726662", "text": "func FromString(versionString string) CiliumVersion {\n\t// string to parse: \"0.13.90 a722bdb 2018-01-09T22:32:37+01:00 go version go1.9 linux/amd64\"\n\tfields := strings.Split(versionString, \" \")\n\tif len(fields) != 7 {\n\t\treturn CiliumVersion{}\n\t}\n\n\tcver := CiliumVersion{\n\t\tVersion: fields[0],\n\t\tRevision: fields[1],\n\t\tAuthorDate: fields[2],\n\t\tGoRuntimeVersion: fields[5],\n\t\tArch: fields[6],\n\t}\n\treturn cver\n}", "title": "" }, { "docid": "29b56c65b9ee75a9de95e27d1c7ebea1", "score": "0.46974042", "text": "func (s *StringValue) Validate(f *flag.Flag) error { return s.v.Validate(f) }", "title": "" }, { "docid": "ccae07ee871af27f286d55f15acadb34", "score": "0.46704784", "text": "func NewFromString(s string) (TimeRange, error) {\n\treturn parseDurationRange(s)\n}", "title": "" }, { "docid": "dd9f37cf018b1b1df8661aa3872d1b32", "score": "0.4669901", "text": "func SemverParseTolerant(v string) (semver.Version, error) {\n\tver, err := semver.ParseTolerant(v)\n\tif err == nil {\n\t\treturn ver, nil\n\t}\n\tver, strictErr := semver.Parse(v)\n\tif strictErr == nil {\n\t\treturn ver, nil\n\t}\n\treturn semver.Version{}, err\n}", "title": "" }, { "docid": "944bffe4dfa59b23b69cbefaf3e73fa7", "score": "0.46579784", "text": "func ParseConstraint(expr string) (Constraint, error) {\n\tc := Constraint{}\n\tfor _, field := range strings.Fields(expr) {\n\t\topt, err := ParseOption(field)\n\t\tif err != nil {\n\t\t\treturn c, err\n\t\t}\n\t\tc = append(c, opt)\n\t}\n\treturn c, nil\n}", "title": "" }, { "docid": "96a592378bc410c589336adb812bdb2e", "score": "0.46540377", "text": "func Must(s string, err error) string {\n\tif err != nil {\n\t\tglog.Fatal(err)\n\t}\n\treturn s\n}", "title": "" }, { "docid": "5debd4151cde9d0553aacc76bd80802e", "score": "0.46417478", "text": "func (t *Type) FromString(s string) bool {\n\tvar g object.Type\n\n\tok := g.FromString(s)\n\n\tif ok {\n\t\t*t = TypeFromV2(g)\n\t}\n\n\treturn ok\n}", "title": "" }, { "docid": "437c9ad8f005e82ec11041487d5d0233", "score": "0.46407977", "text": "func NewFromString(s string) (*Decimal, Condition, error) {\n\treturn BaseContext.NewFromString(s)\n}", "title": "" }, { "docid": "993f6c5ab3b24aa05b3e7fa5e6a2a034", "score": "0.46387094", "text": "func (s satisfy) Parse(ing *networking.Ingress) (interface{}, error) {\n\tsatisfy, err := parser.GetStringAnnotation(\"satisfy\", ing)\n\n\tif err != nil || (satisfy != \"any\" && satisfy != \"all\") {\n\t\tsatisfy = \"\"\n\t}\n\n\treturn satisfy, nil\n}", "title": "" }, { "docid": "720c8e88b4f25de6e363ac060deec594", "score": "0.46378538", "text": "func FromStr(s string) (BCBP, error) {\n\tif len(s) < 60 {\n\t\treturn BCBP{}, ErrInsufficientData\n\t}\n\n\tif !ascii(s) {\n\t\treturn BCBP{}, ErrNonASCII\n\t}\n\n\tif s[0:1] != \"M\" {\n\t\treturn BCBP{}, ErrUnsupportedFormat\n\t}\n\n\treturn fromStr(s)\n}", "title": "" }, { "docid": "d417314da30685c851c3561d3f1163e2", "score": "0.46123898", "text": "func (ps *ProcessingStatus) FromString(s string) error {\n\tswitch s {\n\tcase \"pending\":\n\t\t*ps = Pending\n\tcase \"processing\":\n\t\t*ps = Processing\n\tcase \"completed\":\n\t\t*ps = Completed\n\tcase \"error\":\n\t\t*ps = Error\n\tdefault:\n\t\treturn errors.New(\"unknown processing status '\" + s + \"'\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "375b5129dfe442b6626821aa079ec7b5", "score": "0.4601053", "text": "func (pr *Parser) Validate(s string, opts Options) Err {\n\treturn pr.validate(s, opts)\n}", "title": "" }, { "docid": "fb61aaee44bf7f4cc86f110418ff994c", "score": "0.4598047", "text": "func (amount *Amount) FromString(value string) (err error) {\n\tnumberString, currencyString, err := extractFromString(value)\n\tif err != nil {\n\t\treturn\n\t}\n\tbase, _ := toBase(numberString, currencyString)\n\tamount.Value = uint(base)\n\tif float64(amount.Value) != base {\n\t\terr = errors.New(\"The number lost some precision. Check your value and unit\")\n\t}\n\treturn\n}", "title": "" }, { "docid": "f259d65029c85010c6baecda08690295", "score": "0.45979035", "text": "func (tx *Transaction) ParseRequestString(data string) error {\n\tbuf := bufio.NewReader(strings.NewReader(data))\n\treq, err := http.ReadRequest(buf)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = tx.ParseRequestObjectHeaders(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = tx.ParseRequestObjectBody(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5334bb56515711e260bfd40be701d2b3", "score": "0.45908564", "text": "func VariableFromString(str string) *Variable {\n\tvar value interface{}\n\tif strings.HasPrefix(str, \"\\\"\") && strings.HasSuffix(str, \"\\\"\") && len(str) >= 2 {\n\t\tvalue = str[1 : len(str)-1]\n\t} else {\n\t\tdeci, err := number.FromString(str)\n\t\tif err == nil {\n\t\t\tvalue = deci\n\t\t} else {\n\t\t\tvalue = str\n\t\t}\n\t}\n\treturn &Variable{\n\t\tValue: value,\n\t}\n}", "title": "" }, { "docid": "130f357265dd3cb846c46de4a7bdb9c3", "score": "0.4576457", "text": "func MustCompile(expr string) Value { return Value{regexp.MustCompile(expr)} }", "title": "" }, { "docid": "39adb26bb057378f31737365eab0c966", "score": "0.45694968", "text": "func builtinCheckString(env *lisp.LEnv, name string, constraints []*lisp.LVal) *lisp.LVal {\n\trest := builtinCheckAny(env, constraints)\n\t// NB these aren't normal functions - they aren't looking for an array of args\n\treturn lisp.Fun(GenSymbol(), lisp.Formals(\"input\"), func(env *lisp.LEnv, input *lisp.LVal) *lisp.LVal {\n\t\tif input.Type != lisp.LString {\n\t\t\treturn lisp.ErrorConditionf(WrongType, \"Input was not a string for type %s\", name)\n\t\t}\n\t\treturn rest.FunData().Builtin(env, input)\n\t})\n}", "title": "" }, { "docid": "e6fa09342e8b4e9ac6b6d15af52c649a", "score": "0.45668012", "text": "func mustParseCurrency(str string) common.BigInt {\n\tparsed, err := unit.ParseCurrency(str)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn parsed\n}", "title": "" }, { "docid": "1114733808ab781f52b7be3970a1f995", "score": "0.45586735", "text": "func MustParse(y yarn.Yarn, name string) yarn.Yarn {\n\tyarn, err := Parse(y, name)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn yarn\n}", "title": "" }, { "docid": "823917050cec502ae13a9ea450f3ff46", "score": "0.45559475", "text": "func parseCapacityUnit(capacity string) string {\n\t// ToDo Use parsing factor for Ki->K,Gi->G, etc conversion\n\tif strings.HasSuffix(capacity, BinaryCapacityUnitSuffix) {\n\t\tnewCapacity := strings.TrimSuffix(capacity, BinaryCapacityUnitSuffix)\n\t\treturn newCapacity\n\t}\n\treturn capacity\n}", "title": "" }, { "docid": "36956640a30059e4a0aa536d5deed4df", "score": "0.45535216", "text": "func String(e string) Code {\n\tif e == \"\" {\n\t\treturn OK\n\t}\n\t// try error string\n\ti, err := strconv.Atoi(e)\n\tif err != nil {\n\t\treturn ServerErr\n\t}\n\treturn Code(i)\n}", "title": "" }, { "docid": "36956640a30059e4a0aa536d5deed4df", "score": "0.45535216", "text": "func String(e string) Code {\n\tif e == \"\" {\n\t\treturn OK\n\t}\n\t// try error string\n\ti, err := strconv.Atoi(e)\n\tif err != nil {\n\t\treturn ServerErr\n\t}\n\treturn Code(i)\n}", "title": "" }, { "docid": "36956640a30059e4a0aa536d5deed4df", "score": "0.45535216", "text": "func String(e string) Code {\n\tif e == \"\" {\n\t\treturn OK\n\t}\n\t// try error string\n\ti, err := strconv.Atoi(e)\n\tif err != nil {\n\t\treturn ServerErr\n\t}\n\treturn Code(i)\n}", "title": "" }, { "docid": "d4c85d4e338f7d4c3e00debe33fa7b93", "score": "0.45528144", "text": "func ParseString(s string) (*Graph, error) {\n\treturn ParseBytes([]byte(s))\n}", "title": "" }, { "docid": "b83f480c43b9b276de903b3f7bf1ce78", "score": "0.45511448", "text": "func FromString(data string) (*Value, error) {\n\tr := NewReader(strings.NewReader(data))\n\tv, _, err := r.ReadValue()\n\treturn v, err\n}", "title": "" }, { "docid": "97694680a70770ade56f83b3db97e7d4", "score": "0.4542992", "text": "func (v *v1) FromString(encodedAddr string) (*AddrV1, error) {\n\tpayload, err := v.decodeBech32(encodedAddr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn v.FromBytes(payload)\n}", "title": "" }, { "docid": "0cef19f0281564670a11e81519d66236", "score": "0.45362678", "text": "func MustNewAssetCodeFromString(code string) AssetCode {\n\ta, err := NewAssetCodeFromString(code)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn a\n}", "title": "" }, { "docid": "4da4d96fe71aa3d92067af8b3949197d", "score": "0.4526507", "text": "func SanitizeString(value string, rules StringRules, errorCreator ErrorCreator) (string, error) {\n\tif rules.TrimSpace {\n\t\tvalue = strings.TrimSpace(value)\n\t}\n\tif rules.Required && value == \"\" {\n\t\treturn \"\", errorCreator(fmt.Sprintf(\"Value is required but missing.\"))\n\t}\n\tif rules.ToLower {\n\t\tvalue = strings.ToLower(value)\n\t}\n\tif rules.ValidValues != nil {\n\t\tif isValidValue(value, rules.ValidValues) {\n\t\t\treturn value, nil\n\t\t}\n\t\tif rules.DefaultValue != \"\" {\n\t\t\treturn rules.DefaultValue, nil\n\t\t}\n\t\treturn \"\", errorCreator(fmt.Sprintf(\"Not one of the allowed values.\"))\n\t}\n\tlength := len(value)\n\tif rules.Length > 0 && length != rules.Length {\n\t\treturn \"\", errorCreator(fmt.Sprintf(\"Length must be exactly %d.\", rules.Length))\n\t}\n\tif rules.MinLength > 0 && length < rules.MinLength {\n\t\treturn \"\", errorCreator(fmt.Sprintf(\"Minimum length is %d.\", rules.MinLength))\n\t}\n\tif rules.MaxLength > 0 && length > rules.MaxLength {\n\t\treturn \"\", errorCreator(fmt.Sprintf(\"Maximum length is %d.\", rules.MaxLength))\n\t}\n\tif rules.Regex != \"\" {\n\t\tisMatch, err := regexp.MatchString(rules.Regex, value)\n\t\tif err != nil || !isMatch {\n\t\t\treturn \"\", errorCreator(fmt.Sprintf(\"Failed to match regex.\"))\n\t\t}\n\t}\n\treturn value, nil\n}", "title": "" }, { "docid": "2692ebfc60d24eb5765c1cdea58746aa", "score": "0.45155385", "text": "func TestString(t *testing.T) {\n\ttests := []string{\n\t\t\"x * y\",\n\t\t\"x / x\",\n\t\t\"y - x\",\n\t\t\"sin(x)\",\n\t\t\"-x\",\n\t\t\"+y\",\n\t\t\"sqrt(A / pi)\",\n\t\t\"pow(x, 3) + pow(y, 3)\",\n\t\t\"2 * 2 + 2\",\n\t\t\"2 * (2 + 2)\",\n\t\t\"5 / 9 * (F - 32)\",\n\t}\n\tfor _, expr := range tests {\n\t\tfmt.Printf(\"\\n%s\\n\", expr)\n\n\t\te, _ := Parse(expr)\n\t\tgot := e.String()\n\n\t\tif got != expr {\n\t\t\tt.Errorf(\"want \\\"%s\\\" got \\\"%s\\\"\\n\", expr, got)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "46883570f70db17db314c8f05c243784", "score": "0.4511429", "text": "func newQTypeFromString(t, s, ss string) QType {\n\tswitch t {\n\tcase \"CS\":\n\t\treturn ConstantSum\n\tcase \"DB\":\n\t\treturn Description\n\tcase \"Matrix\":\n\t\tif s == \"MaxDiff\" {\n\t\t\treturn MaxDiff\n\t\t} else if ss == \"MultipleAnswer\" {\n\t\t\treturn MatrixMultiResponse\n\t\t}\n\t\treturn MatrixSingleResponse\n\tcase \"Meta\":\n\t\treturn Meta\n\tcase \"MC\":\n\t\tif s == \"MAVR\" || s == \"MAHR\" || s == \"MACOL\" || s == \"MSB\" {\n\t\t\treturn MultipleChoiceMultiResponse\n\t\t} else if s == \"NPS\" {\n\t\t\treturn NPS\n\t\t}\n\t\treturn MultipleChoiceSingleResponse\n\tcase \"PGR\":\n\t\treturn PickGroupRank\n\tcase \"RO\":\n\t\treturn RankOrder\n\tcase \"TE\":\n\t\tif s == \"FORM\" {\n\t\t\treturn Form\n\t\t}\n\t\treturn TextEntry\n\tcase \"Timing\":\n\t\treturn Timing\n\t}\n\n\treturn Unknown\n}", "title": "" }, { "docid": "d0365ee06e205717f5edcb3c799e685a", "score": "0.45097202", "text": "func (t *Type) FromString(s string) error {\n\tswitch s = strings.ToLower(s); s {\n\tcase \"sequence\":\n\t\t*t = Sequence\n\tcase \"epoch\":\n\t\t*t = Epoch\n\tdefault:\n\t\treturn ErrFeedTypeNotFound\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "68a1543ca95e2516582469b626ca0a63", "score": "0.45068252", "text": "func (rp *RequestParamValue) Parse(s string) (err error) {\r\n\tswitch rp.Type {\r\n\tcase Int:\r\n\t\trp.IntValue, err = strconv.ParseInt(s, 10, 64)\r\n\tcase Float:\r\n\t\trp.FloatValue, err = strconv.ParseFloat(s, 32)\r\n\tcase String:\r\n\t\trp.StringValue = s\r\n\tcase IntArray:\r\n\t\trp.IntArray, err = parseListOfInt(s)\r\n\tcase StringArray:\r\n\t\trp.StringArray = strings.Split(s, \",\")\r\n\tcase IntStringMap:\r\n\t\trp.IntStringMap, err = parseIntName(s)\r\n\tcase FloatStringMap:\r\n\t\trp.FloatStringMap, err = parseFloatName(s)\r\n\tcase IntFloatMap:\r\n\t\trp.IntFloatMap, err = parseIntFloat(s)\r\n\tdefault:\r\n\t\terr = fmt.Errorf(\"Неизвестный тип параметра '%d'\", rp.Type)\r\n\t}\r\n\treturn\r\n}", "title": "" }, { "docid": "f74b581ae334477bb6afec9c5dd4a602", "score": "0.45060498", "text": "func Parse(input string) (U, error) {\n\tinput = strings.TrimSpace(input)\n\tif input == \"\" {\n\t\treturn &Nil{}, nil\n\t}\n\n\tp := &Parser{Buffer: input}\n\tp.Init()\n\n\terr := p.Parse()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tp.Execute()\n\treturn p.Result, nil\n}", "title": "" }, { "docid": "9504b69ac6b1b8df3f1439722c58b907", "score": "0.44945544", "text": "func (ef StdErrflow) CheckString(value string, err error) string {\n\tef.errflow.ImplementCheck(recover(), err)\n\treturn value\n}", "title": "" }, { "docid": "a08d484d0e613fa14753e65772884f0a", "score": "0.449413", "text": "func MustParse() {\n\tif err := Parse(); err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "904a5e60e30dfd4267f96513df4906f6", "score": "0.4491998", "text": "func ParseCost(s string) Cost {\n\treturn costStrings[s]\n}", "title": "" }, { "docid": "904a5e60e30dfd4267f96513df4906f6", "score": "0.4491998", "text": "func ParseCost(s string) Cost {\n\treturn costStrings[s]\n}", "title": "" }, { "docid": "904a5e60e30dfd4267f96513df4906f6", "score": "0.4491998", "text": "func ParseCost(s string) Cost {\n\treturn costStrings[s]\n}", "title": "" }, { "docid": "a5881b03f6185abdde2703e939d7125b", "score": "0.44869614", "text": "func validateGcpProjectString(project string) (err error) {\n\tif len(project) == 0 {\n\t\terr = errors.New(\"GCP project string needs to be set\")\n\t}\n\treturn\n}", "title": "" }, { "docid": "9a686431b14e1633107aefb5ee92599c", "score": "0.4485401", "text": "func newValidRange(rangeStr string) AddressRange {\n\tra, err := newRange(rangeStr)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"addressrange: cannot parse: %s: %s\", rangeStr, err.Error()))\n\t}\n\treturn ra\n}", "title": "" }, { "docid": "0dbb2d9b964eadf8c8f3815c9f79c002", "score": "0.4483259", "text": "func MustParse(cronLine string) *Expression {\n\texpr, err := Parse(cronLine)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn expr\n}", "title": "" }, { "docid": "d23b8909bf869489379698530754230f", "score": "0.44797522", "text": "func MustParseVersion(in string) *GoVersion {\n\tv, err := ParseVersion(in)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "499224d2dfb343626f80378e532ee375", "score": "0.44760334", "text": "func NewFromString(value string) (Decimal, error) {\n\td, err := decimal.NewFromString(value)\n\tif err != nil {\n\t\treturn Decimal{}, err\n\t}\n\n\treturn Decimal{decimal: d, formula: d.String()}, nil\n}", "title": "" }, { "docid": "505d78ce532d48de780ebe6744623196", "score": "0.4460638", "text": "func (t systemStringType) MustConvert(v interface{}) interface{} {\n\tvalue, _, err := t.Convert(v)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn value\n}", "title": "" }, { "docid": "bd3396906cda4b1fe44a26ad445f0f24", "score": "0.44510806", "text": "func MustString(f FromStringer, raw string) []undeck.Card {\n\tvar c, err = FromString(f, raw)\n\n\tif err != nil {\n\t\tlog.Fatalln(err)\n\t}\n\n\treturn c\n}", "title": "" }, { "docid": "1312ab6068dbf3f104adb0f8a512f7a2", "score": "0.44484755", "text": "func newFromString(s *string) *Vector {\n if len(*s) == 0 {\n return newEmpty(0)\n }\n // len > 0\n // remove all white spaces\n tmp := strings.ReplaceAll(*s, \" \", \"\")\n v := newEmpty(len(tmp))\n for i, bit := range tmp {\n switch {\n case bit == '1':\n v.body[i/wordSize] ^= (1 << (wordSize - (i % wordSize) - 1))\n case bit == '0':\n default:\n e := fmt.Errorf(\"vector: parse string %s error, unexpected symbol %c in position %d, possible only {' ', '0', '1', '-'}\",\n tmp, bit, i)\n panic(e)\n }\n }\n return v\n}", "title": "" }, { "docid": "324bafdaf43afcce9aa634ae6a1c3356", "score": "0.4442077", "text": "func mandatoryStringr(str, err string) Stringr {\n\ts := Stringr{}\n\ts.Value = str\n\tif str == \"\" {\n\t\ts.IsValid = false\n\t\ts.Error = fmt.Errorf(err)\n\t}\n\treturn s\n}", "title": "" }, { "docid": "736af763da0a6585af76c1f00c88a454", "score": "0.44415405", "text": "func FromString(s string) Graph {\n lines := strings.Split(s, \"\\n\")\n return NewGraph(lines)\n}", "title": "" }, { "docid": "69674165f63bf49ccd549e000175d1a3", "score": "0.4436871", "text": "func (p *Pair) FromString(s string) error {\n\treturn p.UnmarshalText([]byte(s))\n}", "title": "" }, { "docid": "b8e1bc674476b958791469ab24d58f3c", "score": "0.44286054", "text": "func (op *Operation) FromString(s string) bool {\n\tvar g netmap.Operation\n\n\tok := g.FromString(s)\n\n\tif ok {\n\t\t*op = OperationFromV2(g)\n\t}\n\n\treturn ok\n}", "title": "" }, { "docid": "1f92389ad788315888d74352b899626b", "score": "0.44281155", "text": "func (l MinLength) Valid(v interface{}) error {\n\tval, ok := v.(string)\n\tif !ok {\n\t\tpanic(fmt.Sprintf(\"wrong data type, expected string, got: %T\", v))\n\t}\n\n\tif utf8.RuneCountInString(val) < l.Min {\n\t\treturn l.Err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "dd4f1660abf516e2972269250c74c2c5", "score": "0.44167247", "text": "func String(location string) StringValidatorBuilder {\n\treturn &stringValidator{\n\t\tlocation: location,\n\t}\n}", "title": "" }, { "docid": "3ebe931a4cb81f66606f28a8e4add78b", "score": "0.44162232", "text": "func TestReadLineBadTopic(t *testing.T) {\n r,err := ResultFromLine(\"s401 Q0 LA110990-0013 0 13.74717580250855 BB2c1.0\")\n if err != nil {\n switch err := err.(type) {\n case *strconv.NumError:\n if err.Func != \"ParseInt\" {\n t.Error(\"Error produced not from parse int: got\",err.Func)\n }\n default:\n t.Error(\"Strconv error wasn't produced correctly: got\",err)\n }\n } else {\n t.Error(\"Expected error but got\",err)\n }\n if r != nil {\n t.Error(\"Expected nil response but got\",r)\n }\n}", "title": "" }, { "docid": "c131069b5ad9864c269432cddb128b0c", "score": "0.44145653", "text": "func MustParse(source string) *Template {\n\tresult, err := Parse(source)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn result\n}", "title": "" }, { "docid": "198d2ced6c2f5764d27bb41351da3057", "score": "0.44127405", "text": "func normalizedUnitString(unitStr string) string {\n\tswitch unitStr {\n\tcase `in`:\n\t\treturn `\"`\n\t}\n\treturn unitStr\n}", "title": "" }, { "docid": "f966e1d845f1dd126339dc95d027380a", "score": "0.44094652", "text": "func Parse(input string) (T, error) {\n\tvar err error\n\tif strings.HasPrefix(input, \"#\") {\n\t\tinput, err = FragmentUnescape(input)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn ParseStringRepresentation(input)\n}", "title": "" }, { "docid": "0239aab76a52cad85b22e2996ed909a2", "score": "0.44063106", "text": "func ParseString(input string) (node *Node, err error) {\n\treturn Parse([]byte(input))\n}", "title": "" }, { "docid": "6f1bebdcff1d5a012046060a7b9081ba", "score": "0.44054073", "text": "func (r *CheckRuleRequest) FromJsonString(s string) error {\n\tf := make(map[string]interface{})\n\tif err := json.Unmarshal([]byte(s), &f); err != nil {\n\t\treturn err\n\t}\n\t\n\tif len(f) > 0 {\n\t\treturn tcerr.NewTencentCloudSDKError(\"ClientError.BuildRequestError\", \"CheckRuleRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" } ]
afd6d6cfa9107163217e627a9b741d21
update group details api
[ { "docid": "faee4b22f88df1f53356b3eaad3649d4", "score": "0.82273614", "text": "func UpdateGroupDetails(c *gin.Context) {\n // get session\n session, err := store.Get(c.Request, \"session\")\n if err != nil {\n c.JSON(http.StatusInternalServerError, gin.H{\"error\": err.Error()})\n\t\treturn\n }\n // check if authenticated\n if !(isAuthenticated(session)) {\n c.JSON(http.StatusUnauthorized, gin.H{\"error\": \"Access denied\"})\n\t\treturn\n }\n // get id and check that its valid\n id_param := c.Param(\"id\")\n id, err := primitive.ObjectIDFromHex(id_param)\n if err != nil {\n c.JSON(http.StatusBadRequest, gin.H{\"error\": \"Invalid id \" + id_param})\n\t\treturn\n }\n // find the matching group\n var group Group\n err = groups.FindOne(context.TODO(), bson.M{\"_id\": id}).Decode(&group)\n if err != nil {\n c.JSON(http.StatusNotFound, gin.H{\"error\": \"Group \" + id_param + \" not found\"})\n\t\treturn\n }\n // verify that updater is owner of group\n if session.Values[\"_id\"].(*primitive.ObjectID).Hex() != group.Createdby.Hex() {\n c.JSON(http.StatusForbidden, gin.H{\"error\": \"Forbidden\"})\n\t\treturn\n }\n // get update credentials\n var updatedGroup GroupUpdate\n if err := c.ShouldBindJSON(&updatedGroup); err != nil {\n \tc.JSON(http.StatusBadRequest, gin.H{\"error\": \"One or more required fields is missing\"})\n\t\treturn\n\t}\n\n // verify inputs\n if errs := validate.Struct(updatedGroup); errs != nil {\n\t c.JSON(http.StatusBadRequest, gin.H{\"error\": \"One or more fields is formatted incorrectly\"})\n\t\treturn\n }\n\n if updatedGroup.Name != \"\" {\n group.Name = updatedGroup.Name\n }\n if updatedGroup.About != \"\" {\n group.About = updatedGroup.About\n }\n if updatedGroup.Visibility != \"\" {\n group.Visibility = updatedGroup.Visibility\n }\n // save group into db\n _, err = groups.UpdateOne(context.TODO(), bson.M{\"_id\": id}, bson.M{\"$set\": bson.M{\"name\": group.Name, \"about\": group.About, \"visibility\": group.Visibility}})\n if err != nil {\n c.JSON(http.StatusInternalServerError, gin.H{\"error\": err.Error()})\n\t return\n }\n // send response\n c.JSON(http.StatusOK, gin.H{\n \"_id\": id,\n \"createdby\": group.Createdby,\n \"creatorrole\": group.Creatorrole,\n \"name\": group.Name,\n \"about\": group.About,\n \"visibility\": group.Visibility,\n \"groupmembers\": group.Groupmembers,\n })\n}", "title": "" } ]
[ { "docid": "262e7e2e00896723e7b76112f1656dfa", "score": "0.7453624", "text": "func UpdateGroup(db *gorm.DB, w http.ResponseWriter, r *http.Request) {\n\tvar p UpdateGroupRequest\n\tdecoder := json.NewDecoder(r.Body)\n\tif err := decoder.Decode(&p); err != nil {\n\t\trespondWithError(w, http.StatusBadRequest, \"Invalid request payload\")\n\t\treturn\n\t}\n\tdefer r.Body.Close()\n\n\tgroup := models.Group{ID: p.ID}\n\tif GetGroupByID(db, &group, w) == 0 {\n\t\treturn\n\t}\n\n\tif p.Name != \"\" {\n\t\tgroup.Name = p.Name\n\t}\n\tif p.AdminID != 0 {\n\t\tgroup.AdminID = p.AdminID\n\t}\n\n\tif err := group.UpdateGroup(db); err != nil {\n\t\trespondWithError(w, http.StatusInternalServerError, err.Error())\n\t\treturn\n\t}\n\n\tvar gr GroupResponse\n\tpopulateGroupResponse(&group, &gr)\n\n\trespondWithJSON(w, http.StatusOK, gr)\n}", "title": "" }, { "docid": "e519ada42ec087416f88126b7828e071", "score": "0.74429154", "text": "func (a Groups) UpdateGroup(id string, groupUpdateItem GroupUpdateItem) (*GroupItem, *APIResponse, error) {\n\n\tvar httpMethod = \"Put\"\n\t// create path and map variables\n\tpath := a.Configuration.BasePath + \"/groups/{id}\"\n\tpath = strings.Replace(path, \"{\"+\"id\"+\"}\", fmt.Sprintf(\"%v\", id), -1)\n\n\n\theaderParams := make(map[string]string)\n\tqueryParams := url.Values{}\n\tformParams := make(map[string]string)\n\tvar postBody interface{}\n\tvar fileName string\n\tvar fileBytes []byte\n\t// authentication '(PasswordGrant)' required\n\t// oauth required\n\tif a.Configuration.AccessToken != \"\"{\n\t\theaderParams[\"Authorization\"] = \"Bearer \" + a.Configuration.AccessToken\n\t}\n\t// add default headers if any\n\tfor key := range a.Configuration.DefaultHeader {\n\t\theaderParams[key] = a.Configuration.DefaultHeader[key]\n\t}\n\n\n\t// to determine the Content-Type header\n\tlocalVarHttpContentTypes := []string{ \"application/vnd.api+json\", }\n\n\t// set Content-Type header\n\tlocalVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes)\n\tif localVarHttpContentType != \"\" {\n\t\theaderParams[\"Content-Type\"] = localVarHttpContentType\n\t}\n\t// to determine the Accept header\n\tlocalVarHttpHeaderAccepts := []string{\n\t\t\"application/vnd.api+json\",\n\t}\n\n\t// set Accept header\n\tlocalVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts)\n\tif localVarHttpHeaderAccept != \"\" {\n\t\theaderParams[\"Accept\"] = localVarHttpHeaderAccept\n\t}\n\t// body params\n\tpostBody = &groupUpdateItem\n\n\tvar successPayload = new(GroupItem)\n\thttpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes)\n\tif err != nil {\n\t\treturn successPayload, NewAPIResponse(httpResponse.RawResponse), err\n\t}\n\terr = json.Unmarshal(httpResponse.Body(), &successPayload)\n\treturn successPayload, NewAPIResponse(httpResponse.RawResponse), err\n}", "title": "" }, { "docid": "b25caec8b3c9036838948bef3ad004a0", "score": "0.7404472", "text": "func (e Endpoints) UpdateGroup(ctx context.Context, groupid string, name string, desc string) (err error) {\n\trequest := UpdateGroupRequest{\n\t\tDesc: desc,\n\t\tGroupid: groupid,\n\t\tName: name,\n\t}\n\t_, err = e.UpdateGroupEndpoint(ctx, request)\n\treturn\n}", "title": "" }, { "docid": "eaac207a15b83d5dc7e0a1bdb90ae439", "score": "0.73539335", "text": "func (handler *restHandler) putGroup(w http.ResponseWriter, r *http.Request) {\n\tid := chi.URLParam(r, \"id\")\n\tvar groupmembers GroupMembers\n\tdefer r.Body.Close()\n\terr := json.NewDecoder(r.Body).Decode(&groupmembers)\n\tif err != nil {\n\t\twriteErr(w, err, http.StatusBadRequest)\n\t\treturn\n\t}\n\tgroupmembers.GroupName = id // if they are different sync them\n\tgroup, err := models.FindPlanetGroup(r.Context(), handler.db, id)\n\tif err != nil {\n\t\twriteErr(w, err, http.StatusNotFound)\n\t\treturn\n\t}\n\tfor _, userid := range groupmembers.Users {\n\t\tuser, err := models.FindPlanetUser(r.Context(), handler.db, userid)\n\t\tif err != nil {\n\t\t\twriteErr(w, errors.Wrapf(err, \"invalid user %s\", userid), http.StatusNotFound)\n\t\t\treturn\n\t\t}\n\t\tgroup.AddUserPlanetUsers(r.Context(), handler.db, false, user)\n\t}\n\n}", "title": "" }, { "docid": "c36994452a602de9ad85e87a9df2ad35", "score": "0.7242441", "text": "func (js JsonStorage)GroupUpdate(w http.ResponseWriter, r *http.Request, groupname string, grpupd *data.GROUPUPD) {\n\tif groupname != \"\" {\n\t\tJRepo.uLock.Lock()\n\t\tdefer JRepo.uLock.Unlock() \n\t\tif oldmembers, ok := JRepo.js.Repogrp[groupname]; ok {\n\t\t\tvar aux = make(map[string]int8)\n\t\t\t// create a map of new set of members\n\t\t\tfor _, uid := range grpupd.Members {\n\t\t\t\taux[uid] = 0\n\t\t\t}\n\t\t\t// circle through old set and remove group name from each member not in new list\n\t\t\tfor _, userid := range (oldmembers) {\n\t\t\t\tif _, ok := aux[userid]; !ok {\n\t\t\t\t\tremoveReference(userid, groupname)\n\t\t\t\t} else {\n\t\t\t\t\taux[userid] = 1\n\t\t\t\t}\n\t\t\t}\n\t\t\t// finally add group name for users not already in oldmember list\n\t\t\tfor k, v := range aux {\n\t\t\t\tif v == 0 {\n\t\t\t\t\taddReference(k, groupname)\n\t\t\t\t}\n\t\t\t}\n\t\t\t// ... and replace old set with new one\n\t\t\tJRepo.js.Repogrp[groupname] = grpupd.Members\n\t\t\tdata.ServerResponse(w, r, http.StatusOK, data.STRING_DATA, \"Group \"+groupname+\" was successfully updated\")\n\t\t} else {\n\t\t\tdata.ServerResponse(w, r, http.StatusNotAcceptable, data.STRING_DATA, http.StatusText(http.StatusNotAcceptable))\n\t\t}\n\t} else {\n\t\tdata.ServerResponse(w, r, http.StatusBadRequest, data.STRING_DATA, http.StatusText(http.StatusBadRequest))\n\t}\n}", "title": "" }, { "docid": "8fefa1c8d0eaff555b2db77b79365be8", "score": "0.72419745", "text": "func (dc *DoitClient) UpdateGroup(d *Domain, g *Group) error {\n\treq, err := http.NewRequest(\"PUT\", dc.createAPIURL(\"group\", g.Name, \"\", d.Name), nil)\n\treq.Header.Add(\"Content-Type\", JSONMime)\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = ioutil.ReadAll(res.Body)\n\tres.Body.Close()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif res.StatusCode == 200 {\n\t\treturn nil\n\t}\n\treturn errors.New(res.Status)\n}", "title": "" }, { "docid": "d808c3b55b05d829ce848a6bca7ae0a5", "score": "0.7227225", "text": "func (group *Group) Update(body []byte) (GroupResp, error) {\n\tbody = patchMetadataType(body, \"SP.Group\")\n\tclient := NewHTTPClient(group.client)\n\treturn client.Update(group.endpoint, bytes.NewBuffer(body), group.config)\n}", "title": "" }, { "docid": "c5acc739fe7492dfe80aa52b77f4e421", "score": "0.7108832", "text": "func (gs *GroupService) UpdateGroup(rq *http.Request, args *GroupArgs, reply *GroupReply) error {\n\tgroup, err := gs.Stor.GetGroup(args.ID)\n\tif err != nil {\n\t\treturn err\n\t}\n\tgroup.Title = args.Title\n\terr = gs.Stor.UpdateGroup(group)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tgroups, err := gs.Stor.GetAllGroups()\n\tif err != nil {\n\t\treturn nil\n\t}\n\treply.Message = \"Group was successfully update\"\n\treply.Groups = groups\n\treturn nil\n}", "title": "" }, { "docid": "eeb5b0657b4b50aaa10308acfc15d309", "score": "0.7009592", "text": "func (a *GroupApiService) UpdateGroup(ctx _context.Context, uuid string) ApiUpdateGroupRequest {\n\treturn ApiUpdateGroupRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t\tuuid: uuid,\n\t}\n}", "title": "" }, { "docid": "b720edcd511f6f48789aec5620b7bf49", "score": "0.6851774", "text": "func (client *StringGroupClient) Update(obj *models.StringGroup) (*models.StringGroup, error) {\n\tvar robj *models.StringGroup\n\tpath := client.getAPIPath(obj.UUID)\n\terr := client.aviSession.Put(path, obj, &robj)\n\treturn robj, err\n}", "title": "" }, { "docid": "2482579b110ddb80a6e17b9f418ee472", "score": "0.6848216", "text": "func (a *GroupsApiService) UpdateGroup(ctx _context.Context, groupGuid string) ApiUpdateGroupRequest {\n\treturn ApiUpdateGroupRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t\tgroupGuid: groupGuid,\n\t}\n}", "title": "" }, { "docid": "4b14f391f7453c557a27517a8c4e8368", "score": "0.68210137", "text": "func (s *Service) UpdateGroup(c context.Context, g model.Group) (id int, err error) {\n\treturn s.d.UpdateGroup(c, g)\n}", "title": "" }, { "docid": "234cc11a1d454165b0e438d89f99083b", "score": "0.68185025", "text": "func groupUpdate(ctx context.Context, client MinioAdmin, groupName string, expectedGroup *models.UpdateGroupRequest) (*madmin.GroupDesc, error) {\n\texpectedMembers := expectedGroup.Members\n\texpectedStatus := *expectedGroup.Status\n\t// get current members and status\n\tgroupDescription, err := groupInfo(ctx, client, groupName)\n\tif err != nil {\n\t\tLogInfo(\"error getting group info: %v\", err)\n\t\treturn nil, err\n\t}\n\t// update group members\n\terr = addOrDeleteMembers(ctx, client, groupDescription, expectedMembers)\n\tif err != nil {\n\t\tLogInfo(\"error updating group: %v\", err)\n\t\treturn nil, err\n\t}\n\t// update group status only if different from current status\n\tif expectedStatus != groupDescription.Status {\n\t\terr = setGroupStatus(ctx, client, groupDescription.Name, expectedStatus)\n\t\tif err != nil {\n\t\t\tLogInfo(\"error updating group's status: %v\", err)\n\t\t\treturn nil, err\n\t\t}\n\t}\n\t// return latest group info to verify that changes were applied correctly\n\tgroupDescription, err = groupInfo(ctx, client, groupName)\n\tif err != nil {\n\t\tLogInfo(\"error getting group info: %v\", err)\n\t\treturn nil, err\n\t}\n\treturn groupDescription, nil\n}", "title": "" }, { "docid": "3d3a3bb21c2acca3e230381bbf4d7a98", "score": "0.6784594", "text": "func (a *OCIGroupsApiService) GroupsUpdate(ctx context.Context, id int32, command CreateGroupCommand) (Group, *http.Response, error) {\n\tvar (\n\t\tlocalVarHttpMethod = strings.ToUpper(\"Put\")\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarFileName string\n\t\tlocalVarFileBytes []byte\n\t\tsuccessPayload Group\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/groups/{id}\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"id\"+\"}\", fmt.Sprintf(\"%v\", id), -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := url.Values{}\n\tlocalVarFormParams := url.Values{}\n\n\t// to determine the Content-Type header\n\tlocalVarHttpContentTypes := []string{\"application/json\", \"text/json\", \"application/xml\", \"text/xml\", \"application/x-www-form-urlencoded\"}\n\n\t// set Content-Type header\n\tlocalVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)\n\tif localVarHttpContentType != \"\" {\n\t\tlocalVarHeaderParams[\"Content-Type\"] = localVarHttpContentType\n\t}\n\n\t// to determine the Accept header\n\tlocalVarHttpHeaderAccepts := []string{\n\t\t\"application/json\",\n\t\t\"text/json\",\n\t\t\"application/xml\",\n\t\t\"text/xml\",\n\t}\n\n\t// set Accept header\n\tlocalVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)\n\tif localVarHttpHeaderAccept != \"\" {\n\t\tlocalVarHeaderParams[\"Accept\"] = localVarHttpHeaderAccept\n\t}\n\t// body params\n\tlocalVarPostBody = &command\n\tr, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)\n\tif err != nil {\n\t\treturn successPayload, nil, err\n\t}\n\n\tlocalVarHttpResponse, err := a.client.callAPI(r)\n\tif err != nil || localVarHttpResponse == nil {\n\t\treturn successPayload, localVarHttpResponse, err\n\t}\n\tdefer localVarHttpResponse.Body.Close()\n\tif localVarHttpResponse.StatusCode >= 300 {\n\t\tbodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)\n\t\treturn successPayload, localVarHttpResponse, reportError(\"Status: %v, Body: %s\", localVarHttpResponse.Status, bodyBytes)\n\t}\n\n\tif err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {\n\t\treturn successPayload, localVarHttpResponse, err\n\t}\n\n\treturn successPayload, localVarHttpResponse, err\n}", "title": "" }, { "docid": "59cdf1377514660dcffea78d5eb22ae9", "score": "0.67219573", "text": "func (gs *GroupService) Update(ctx context.Context, group resources.Group,\n\tblueprint blueprint.Interface, updateType UpdateType) (*resources.Group, error) {\n\tgroupID, err := group.ID()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tblueprintText, err := blueprint.Render()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresArr, err := gs.call(ctx, \"one.group.update\", groupID, blueprintText, updateType)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn gs.RetrieveInfo(ctx, int(resArr[resultIndex].ResultInt()))\n}", "title": "" }, { "docid": "f35946f4d26dde200d7d271fcea2ff2c", "score": "0.6691423", "text": "func UpdateGroup(ctx context.Context, c *api.Client, groupID, name string, operations []GroupMembershipOperation) error {\n\t// for some reason the groups index api call does not give back the groups_users even though it is supposed to, so i have to do this...\n\tgroups, err := c.GetGroups(ctx, &api.GetGroupsOptions{\n\t\tContainGroupUser: true,\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Getting Groups: %w\", err)\n\t}\n\n\tvar currentMemberships []api.GroupMembership\n\tfor _, g := range groups {\n\t\tif g.ID == groupID {\n\t\t\tcurrentMemberships = g.GroupUsers\n\t\t\tbreak\n\t\t}\n\t}\n\tif currentMemberships == nil {\n\t\treturn fmt.Errorf(\"Cannot Find Group with ID %v\", groupID)\n\t}\n\n\trequest := api.GroupUpdate{\n\t\tName: name,\n\t\tGroupChanges: []api.GroupMembership{},\n\t\tSecrets: []api.Secret{},\n\t}\n\n\t// Generate Group Membership changes based on current Group Memberships\n\tfor _, operation := range operations {\n\t\tmembership, err := getMembershipByUserID(currentMemberships, operation.UserID)\n\t\tif err != nil {\n\t\t\t// Membership does not Exist so we can only create a new one\n\t\t\tif operation.Delete {\n\t\t\t\treturn fmt.Errorf(\"Cannot Delete User %v as it has no membership\", operation.UserID)\n\t\t\t}\n\t\t\trequest.GroupChanges = append(request.GroupChanges, api.GroupMembership{\n\t\t\t\tUserID: operation.UserID,\n\t\t\t\tIsAdmin: operation.IsGroupManager,\n\t\t\t})\n\t\t} else {\n\t\t\t// Membership Exists so we can modify or delete it\n\t\t\trequest.GroupChanges = append(request.GroupChanges, api.GroupMembership{\n\t\t\t\tID: membership.ID,\n\t\t\t\tIsAdmin: operation.IsGroupManager,\n\t\t\t\tDelete: operation.Delete,\n\t\t\t})\n\t\t}\n\t}\n\n\tdryrun, err := c.UpdateGroupDryRun(ctx, groupID, request)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Update Group Dryrun: %w\", err)\n\t}\n\n\tvar users []api.User\n\t// We can skip Getting users if we don't need to reencrypt any secrets\n\tif len(dryrun.DryRun.SecretsNeeded) != 0 {\n\t\tusers, err = c.GetUsers(ctx, &api.GetUsersOptions{})\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Getting Users: %w\", err)\n\t\t}\n\t}\n\n\t// The API gives it back nested so we just put it into a list here\n\tsecrets := []api.Secret{}\n\tfor _, container := range dryrun.DryRun.Secrets {\n\t\tsecrets = append(secrets, container.Secret...)\n\t}\n\n\tdecryptedSecretCache := map[string]string{}\n\tfor _, container := range dryrun.DryRun.SecretsNeeded {\n\t\tmissingSecret := container.Secret\n\t\t// Deduplicate Secret Decrypting for when adding multiple users to a group\n\t\tif decryptedSecretCache[missingSecret.ResourceID] == \"\" {\n\t\t\tsecret, err := getSecretByResourceID(secrets, missingSecret.ResourceID)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"Get Secret from Dryrun Response: %w\", err)\n\t\t\t}\n\n\t\t\tmsg, err := c.DecryptMessage(secret.Data)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"Decrypting Secret: %w\", err)\n\t\t\t}\n\n\t\t\tdecryptedSecretCache[missingSecret.ResourceID] = msg\n\t\t}\n\n\t\tpubkey, err := getPublicKeyByUserID(missingSecret.UserID, users)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Get pubkey for User: %w\", err)\n\t\t}\n\n\t\tnewSecretData, err := c.EncryptMessageWithPublicKey(pubkey, decryptedSecretCache[missingSecret.ResourceID])\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Encrypting Secret: %w\", err)\n\t\t}\n\t\trequest.Secrets = append(request.Secrets, api.Secret{\n\t\t\tUserID: missingSecret.UserID,\n\t\t\tResourceID: missingSecret.ResourceID,\n\t\t\tData: newSecretData,\n\t\t})\n\t}\n\n\t_, err = c.UpdateGroup(ctx, groupID, request)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Updating Group: %w\", err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3dd74653718e9d03c6539b8de8366268", "score": "0.6681363", "text": "func (a *AffinityGroupService) Update(group *types.AffinityGroup) string {\n\n}", "title": "" }, { "docid": "b79af039b99e2a342d4ae3887067b95d", "score": "0.66294277", "text": "func (a *GroupsApiService) UpdateGroupExecute(r ApiUpdateGroupRequest) (Group, *_nethttp.Response, error) {\n\tvar (\n\t\tlocalVarHTTPMethod = _nethttp.MethodPatch\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarFormFileName string\n\t\tlocalVarFileName string\n\t\tlocalVarFileBytes []byte\n\t\tlocalVarReturnValue Group\n\t)\n\n\tlocalBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, \"GroupsApiService.UpdateGroup\")\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}\n\t}\n\n\tlocalVarPath := localBasePath + \"/groups/{group_guid}\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"group_guid\"+\"}\", _neturl.PathEscape(parameterToString(r.groupGuid, \"\")), -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := _neturl.Values{}\n\tlocalVarFormParams := _neturl.Values{}\n\tif r.groupUpdate == nil {\n\t\treturn localVarReturnValue, nil, reportError(\"groupUpdate is required and must be specified\")\n\t}\n\n\t// to determine the Content-Type header\n\tlocalVarHTTPContentTypes := []string{\"application/json\"}\n\n\t// set Content-Type header\n\tlocalVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)\n\tif localVarHTTPContentType != \"\" {\n\t\tlocalVarHeaderParams[\"Content-Type\"] = localVarHTTPContentType\n\t}\n\n\t// to determine the Accept header\n\tlocalVarHTTPHeaderAccepts := []string{\"application/json\"}\n\n\t// set Accept header\n\tlocalVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)\n\tif localVarHTTPHeaderAccept != \"\" {\n\t\tlocalVarHeaderParams[\"Accept\"] = localVarHTTPHeaderAccept\n\t}\n\t// body params\n\tlocalVarPostBody = r.groupUpdate\n\treq, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, err\n\t}\n\n\tlocalVarHTTPResponse, err := a.client.callAPI(req)\n\tif err != nil || localVarHTTPResponse == nil {\n\t\treturn localVarReturnValue, localVarHTTPResponse, err\n\t}\n\n\tlocalVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)\n\tlocalVarHTTPResponse.Body.Close()\n\tlocalVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody))\n\tif err != nil {\n\t\treturn localVarReturnValue, localVarHTTPResponse, err\n\t}\n\n\tif localVarHTTPResponse.StatusCode >= 300 {\n\t\tnewErr := GenericOpenAPIError{\n\t\t\tbody: localVarBody,\n\t\t\terror: localVarHTTPResponse.Status,\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 400 {\n\t\t\tvar v BadRequest\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 403 {\n\t\t\tvar v Forbidden\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 404 {\n\t\t\tvar v NotFound\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 422 {\n\t\t\tvar v UnprocessableEntity\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 503 {\n\t\t\tvar v TemporarilyUnavailable\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 500 {\n\t\t\tvar v InternalError\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t}\n\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t}\n\n\terr = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\tif err != nil {\n\t\tnewErr := GenericOpenAPIError{\n\t\t\tbody: localVarBody,\n\t\t\terror: err.Error(),\n\t\t}\n\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t}\n\n\treturn localVarReturnValue, localVarHTTPResponse, nil\n}", "title": "" }, { "docid": "c28e76b20790a39ea5fd594d045bbac2", "score": "0.6602343", "text": "func (client *SyncGroupsClient) update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, parameters SyncGroup, options *SyncGroupsBeginUpdateOptions) (*http.Response, error) {\n\treq, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, databaseName, syncGroupName, parameters, options)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresp, err := client.pl.Do(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) {\n\t\treturn nil, client.updateHandleError(resp)\n\t}\n\treturn resp, nil\n}", "title": "" }, { "docid": "7567014ea64122f1266bda414110e8c3", "score": "0.6577657", "text": "func (svc *ResourceGroupsService) Update(data ResourceGroup) (\n\tresponse ResourceGroupResponse,\n\terr error,\n) {\n\tif data == nil {\n\t\terr = errors.New(\"resource group must not be empty\")\n\t\treturn\n\t}\n\tguid := data.ID()\n\tdata.ResetResourceGUID()\n\n\terr = svc.update(guid, data, &response)\n\tif err != nil {\n\t\treturn\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "5776b1ed8a975d1eff4f12d5363c134e", "score": "0.6516058", "text": "func (r *CalendarGroupRequest) Update(ctx context.Context, reqObj *CalendarGroup) error {\n\treturn r.JSONRequest(ctx, \"PATCH\", \"\", reqObj, nil)\n}", "title": "" }, { "docid": "2803add302444b5145bffd9170e2bcbe", "score": "0.6515556", "text": "func (um *UserManager) UpsertGroup(group Group, opts *UpsertGroupOptions) error {\n\tif group.Name == \"\" {\n\t\treturn makeInvalidArgumentsError(\"group name cannot be empty\")\n\t}\n\tif opts == nil {\n\t\topts = &UpsertGroupOptions{}\n\t}\n\n\tstart := time.Now()\n\tdefer um.meter.ValueRecord(meterValueServiceManagement, \"manager_users_upsert_group\", start)\n\n\tpath := fmt.Sprintf(\"/settings/rbac/groups/%s\", url.PathEscape(group.Name))\n\tspan := createSpan(um.tracer, opts.ParentSpan, \"manager_users_upsert_group\", \"management\")\n\tspan.SetAttribute(\"db.operation\", \"PUT \"+path)\n\tdefer span.End()\n\n\tvar reqRoleStrs []string\n\tfor _, roleData := range group.Roles {\n\t\tif roleData.Bucket == \"\" {\n\t\t\treqRoleStrs = append(reqRoleStrs, roleData.Name)\n\t\t} else {\n\t\t\treqRoleStrs = append(reqRoleStrs, fmt.Sprintf(\"%s[%s]\", roleData.Name, roleData.Bucket))\n\t\t}\n\t}\n\n\treqForm := make(url.Values)\n\treqForm.Add(\"description\", group.Description)\n\treqForm.Add(\"ldap_group_ref\", group.LDAPGroupReference)\n\treqForm.Add(\"roles\", strings.Join(reqRoleStrs, \",\"))\n\n\treq := mgmtRequest{\n\t\tService: ServiceTypeManagement,\n\t\tMethod: \"PUT\",\n\t\tPath: path,\n\t\tBody: []byte(reqForm.Encode()),\n\t\tContentType: \"application/x-www-form-urlencoded\",\n\t\tRetryStrategy: opts.RetryStrategy,\n\t\tUniqueID: uuid.New().String(),\n\t\tTimeout: opts.Timeout,\n\t\tparentSpanCtx: span.Context(),\n\t}\n\n\tresp, err := um.provider.executeMgmtRequest(opts.Context, req)\n\tif err != nil {\n\t\treturn makeGenericMgmtError(err, &req, resp, \"\")\n\t}\n\tdefer ensureBodyClosed(resp.Body)\n\n\tif resp.StatusCode < 200 || resp.StatusCode >= 300 {\n\t\tusrErr := um.tryParseErrorMessage(&req, resp)\n\t\tif usrErr != nil {\n\t\t\treturn usrErr\n\t\t}\n\t\treturn makeMgmtBadStatusError(\"failed to upsert group\", &req, resp)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "ec0922aa26d64ac9ceb11c99d527fad7", "score": "0.6515341", "text": "func (g *Groups) UpdateGroupDetails(groupGUID string, prefs Group) (Group, error) {\n\tpayload, err := prefs.marshal()\n\tif err != nil {\n\t\treturn Group{}, err\n\t}\n\n\tdata, err := g.Call(fmt.Sprintf(groupDetailsEndpoint, groupGUID), http.MethodPatch, payload)\n\tif err != nil {\n\t\treturn Group{}, err\n\t}\n\n\treturn unmarshalGroupDetails(data)\n}", "title": "" }, { "docid": "54a6132c2ce96cb80b75132c7855a59d", "score": "0.65145063", "text": "func (x *awsElastigroupService) Update(ctx context.Context, group InstanceGroup) error {\n\tinput := &awseg.UpdateGroupInput{\n\t\tGroup: group.Obj().(*awseg.Group),\n\t}\n\n\t_, err := x.svc.Update(ctx, input)\n\treturn err\n}", "title": "" }, { "docid": "a0791dee6e42e24db69d884a2e0f2918", "score": "0.64870626", "text": "func GroupCRUD(w http.ResponseWriter, r *http.Request) {\n\tswitch r.Method {\n\tcase \"OPTIONS\":\n\t\tlog.Println(\"/board_settings OPTIONS received\")\n\n\t\tw.Header().Set(\"Access-Control-Allow-Origin\", \"*\")\n\t\tw.Header().Set(\"Access-Control-Allow-Headers\", \"*\")\n\t\tw.Header().Set(\"Access-Control-Allow-Methods\", \"*\")\n\t\tw.Header().Set(\"content-type\", \"application/json\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t\tn, _ := fmt.Fprintf(w, string(\"\"))\n\t\tfmt.Println(n)\n\n\t\tlog.Println(\"/board_settings OPTIONS answered\")\n\n\tcase \"POST\":\n\n\t\tfmt.Println(\"POST group data\")\n\n\t\tvar incomingData GroupPost\n\n\t\terr := json.NewDecoder(r.Body).Decode(&incomingData)\n\t\tif err != nil {\n\t\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\n\t\t//Check if the group exists\n\t\tvar group SGroup\n\t\t// db.LogMode(dbLogMode)\n\t\tDb.First(&group, \"name = ?\", incomingData.Name)\n\t\tfmt.Println(group.Name)\n\t\tif group.Name == \"\" {\n\t\t\tDb.Create(&SGroup{Name: incomingData.Name})\n\t\t} else {\n\t\t\tw.WriteHeader(http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\n\t\tDb.First(&group, \"name = ?\", incomingData.Name)\n\t\taddedRecordString, _ := json.Marshal(group)\n\n\t\tw.Header().Set(\"Access-Control-Allow-Origin\", \"*\")\n\t\tw.Header().Set(\"content-type\", \"application/json\")\n\t\tw.WriteHeader(http.StatusOK)\n\t\tn, _ := fmt.Fprintf(w, string(addedRecordString))\n\t\tfmt.Println(n)\n\n\tcase \"PATCH\":\n\tcase \"DELETE\":\n\tcase \"GET\":\n\tdefault:\n\t\tn, _ := fmt.Fprintf(w, \"Sorry, only OPTIONS,GET,POST,PATCH methods are supported. '\"+r.Method+\"' received\")\n\t\tlog.Println(n)\n\t\tlog.Println(\"/todo PATCH done\\n\\n\")\n\t}\n}", "title": "" }, { "docid": "78dcfea552bc54202f69ddee49ac5577", "score": "0.6453621", "text": "func (a *GroupApiService) UpdateGroupExecute(r ApiUpdateGroupRequest) (GroupOut, *_nethttp.Response, error) {\n\tvar (\n\t\tlocalVarHTTPMethod = _nethttp.MethodPut\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarFormFileName string\n\t\tlocalVarFileName string\n\t\tlocalVarFileBytes []byte\n\t\tlocalVarReturnValue GroupOut\n\t)\n\n\tlocalBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, \"GroupApiService.UpdateGroup\")\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}\n\t}\n\n\tlocalVarPath := localBasePath + \"/groups/{uuid}/\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"uuid\"+\"}\", _neturl.PathEscape(parameterToString(r.uuid, \"\")), -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := _neturl.Values{}\n\tlocalVarFormParams := _neturl.Values{}\n\tif r.group == nil {\n\t\treturn localVarReturnValue, nil, reportError(\"group is required and must be specified\")\n\t}\n\n\t// to determine the Content-Type header\n\tlocalVarHTTPContentTypes := []string{\"application/json\"}\n\n\t// set Content-Type header\n\tlocalVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)\n\tif localVarHTTPContentType != \"\" {\n\t\tlocalVarHeaderParams[\"Content-Type\"] = localVarHTTPContentType\n\t}\n\n\t// to determine the Accept header\n\tlocalVarHTTPHeaderAccepts := []string{\"application/json\", \"*/*\"}\n\n\t// set Accept header\n\tlocalVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)\n\tif localVarHTTPHeaderAccept != \"\" {\n\t\tlocalVarHeaderParams[\"Accept\"] = localVarHTTPHeaderAccept\n\t}\n\t// body params\n\tlocalVarPostBody = r.group\n\treq, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, err\n\t}\n\n\tlocalVarHTTPResponse, err := a.client.callAPI(req)\n\tif err != nil || localVarHTTPResponse == nil {\n\t\treturn localVarReturnValue, localVarHTTPResponse, err\n\t}\n\n\tlocalVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)\n\tlocalVarHTTPResponse.Body.Close()\n\tlocalVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody))\n\tif err != nil {\n\t\treturn localVarReturnValue, localVarHTTPResponse, err\n\t}\n\n\tif localVarHTTPResponse.StatusCode >= 300 {\n\t\tnewErr := GenericOpenAPIError{\n\t\t\tbody: localVarBody,\n\t\t\terror: localVarHTTPResponse.Status,\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 403 {\n\t\t\tvar v Error403\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 404 {\n\t\t\tvar v Error\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 500 {\n\t\t\tvar v Error\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t}\n\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t}\n\n\terr = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\tif err != nil {\n\t\tnewErr := GenericOpenAPIError{\n\t\t\tbody: localVarBody,\n\t\t\terror: err.Error(),\n\t\t}\n\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t}\n\n\treturn localVarReturnValue, localVarHTTPResponse, nil\n}", "title": "" }, { "docid": "209b4fdf1945234b5385887bf10aa13b", "score": "0.64363015", "text": "func (m *MgoDL) UpdateGroup(group *models.ThingGroup) error {\n\tsess := m.Session.Copy()\n\tdefer sess.Clone()\n\tgroup.UpdatedAt = time.Now()\n\tif err := sess.DB(DBName).C(THING_GROUP_COLLECTION).UpdateId(group.ID, group); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4b9f0096bb9e32a49a51d6a198c58fbe", "score": "0.64359725", "text": "func UpdateGroupInfo(ownerID string, groupID string, password string, public bool) error {\n\n\t// start db transaction\n\ttx, err := db.SQL.Begin()\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn errors.New(\"database error\")\n\t}\n\n\tdefer tx.Commit()\n\n\t// check if user is group owner\n\t// check if user exists in group\n\tvar validOwner bool\n\terr = tx.QueryRow(`SELECT EXISTS(SELECT 1 FROM \"Group\" WHERE id = ? AND ownerID = ?);`,\n\t\tgroupID, ownerID).Scan(&validOwner)\n\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn errors.New(\"database error\")\n\t}\n\n\t// if user is owner\n\tif !validOwner {\n\t\treturn errors.New(\"Invalid group owner.\")\n\t}\n\n\t// check if the password is updated\n\tif password != \"\" {\n\n\t\t// hash the password before storing in the database\n\t\tpasswordHash, err := utils.GenerateHash(password)\n\n\t\tif err != nil {\n\t\t\tlog.Println(err)\n\t\t\treturn errors.New(\"Error hashing password\")\n\t\t}\n\n\t\t_, err = tx.Exec(`UPDATE \"Group\" SET \"public\" = ?, \"password\" = ? WHERE \"id\" = ?;`, public, passwordHash, groupID)\n\t} else {\n\n\t\t// set password to null if password is blank\n\t\t_, err = tx.Exec(`UPDATE \"Group\" SET \"public\" = ?, \"password\" = NULL WHERE \"id\" = ?;`, public, groupID)\n\t}\n\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn errors.New(\"database error\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "8ffe91d1e1e2ea607e9f53c7de0b1a88", "score": "0.6393538", "text": "func (c *Client) UpdateGroup(dn, name string, description string) error {\n\n\treq := ldap.NewModifyRequest(dn, []ldap.Control{})\n\n\tif description == \"\" {\n\t\treq.Delete(\"description\", []string{})\n\t} else {\n\t\treq.Replace(\"description\", []string{description})\n\t}\n\n\treturn c.Conn.Modify(req)\n}", "title": "" }, { "docid": "a60a8348d4224c40b83b0c5f30b8bf5f", "score": "0.6389636", "text": "func (c *client) UpdateGroup(id int64, group *Group) (*Group, error) {\n\tin := &APIPayload{Group: group}\n\tout := new(APIPayload)\n\terr := c.put(fmt.Sprintf(\"/api/v2/groups/%d.json\", id), in, out)\n\treturn out.Group, err\n}", "title": "" }, { "docid": "3d33e668362189b8d9b26f3181eececb", "score": "0.6375787", "text": "func (s *ServiceOp) Update(ctx context.Context, input *UpdateGroupInput) (*UpdateGroupOutput, error) {\n\tpath, err := uritemplates.Expand(\"/gcp/gce/group/{groupId}\", uritemplates.Values{\n\t\t\"groupId\": spotinst.StringValue(input.Group.ID),\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// We do NOT need the ID anymore, so let's drop it.\n\tinput.Group.ID = nil\n\n\tr := client.NewRequest(http.MethodPut, path)\n\tr.Obj = input\n\n\tresp, err := client.RequireOK(s.Client.Do(ctx, r))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tgs, err := groupsFromHttpResponse(resp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\toutput := new(UpdateGroupOutput)\n\tif len(gs) > 0 {\n\t\toutput.Group = gs[0]\n\t}\n\n\treturn output, nil\n}", "title": "" }, { "docid": "dacf2c3b3dbdfff0ba6434f1e77d6c6f", "score": "0.6323487", "text": "func (s *UserService) UpdateGroup(ctx context.Context, ID string, body *Group) (*Group, *Response, error) {\n\tdata := new(Group)\n\tresp, err := s.client.SendRequest(ctx, RequestOptions{\n\t\tMethod: \"PUT\",\n\t\tPath: \"user/\" + s.client.TenantName + \"/groups/\" + ID,\n\t\tBody: body,\n\t\tResponseData: data,\n\t})\n\treturn data, resp, err\n}", "title": "" }, { "docid": "099887c2b149967617ddb1e3fd6e2bca", "score": "0.63155735", "text": "func (m Manager) UpdateGroup(g *Group) error {\n\treturn errors.Trace(m.store.UpdateGroup(g))\n}", "title": "" }, { "docid": "456475f6a5c9016f2f24d3d23a1c12c8", "score": "0.63047713", "text": "func (a *TenantsApiService) UpdateUserGroup(ctx context.Context, id string, body UserGroupEntity) (UserGroupEntity, *http.Response, error) {\n\tvar (\n\t\tlocalVarHttpMethod = strings.ToUpper(\"Put\")\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarFileName string\n\t\tlocalVarFileBytes []byte\n\t\tlocalVarReturnValue UserGroupEntity\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/tenants/user-groups/{id}\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"id\"+\"}\", fmt.Sprintf(\"%v\", id), -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := url.Values{}\n\tlocalVarFormParams := url.Values{}\n\n\t// to determine the Content-Type header\n\tlocalVarHttpContentTypes := []string{\"application/json\"}\n\n\t// set Content-Type header\n\tlocalVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)\n\tif localVarHttpContentType != \"\" {\n\t\tlocalVarHeaderParams[\"Content-Type\"] = localVarHttpContentType\n\t}\n\n\t// to determine the Accept header\n\tlocalVarHttpHeaderAccepts := []string{\"application/json\"}\n\n\t// set Accept header\n\tlocalVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)\n\tif localVarHttpHeaderAccept != \"\" {\n\t\tlocalVarHeaderParams[\"Accept\"] = localVarHttpHeaderAccept\n\t}\n\t// body params\n\tlocalVarPostBody = &body\n\tr, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, err\n\t}\n\n\tlocalVarHttpResponse, err := a.client.callAPI(r)\n\tif err != nil || localVarHttpResponse == nil {\n\t\treturn localVarReturnValue, localVarHttpResponse, err\n\t}\n\n\tlocalVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)\n\tlocalVarHttpResponse.Body.Close()\n\tif err != nil {\n\t\treturn localVarReturnValue, localVarHttpResponse, err\n\t}\n\n\tif localVarHttpResponse.StatusCode < 300 {\n\t\t// If we succeed, return the data, otherwise pass on to decode error.\n\t\terr = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get(\"Content-Type\"));\n\t\tif err == nil { \n\t\t\treturn localVarReturnValue, localVarHttpResponse, err\n\t\t}\n\t}\n\n\tif localVarHttpResponse.StatusCode >= 300 {\n\t\tnewErr := GenericSwaggerError{\n\t\t\tbody: localVarBody,\n\t\t\terror: localVarHttpResponse.Status,\n\t\t}\n\t\t\n\t\tif localVarHttpResponse.StatusCode == 200 {\n\t\t\tvar v UserGroupEntity\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get(\"Content-Type\"));\n\t\t\t\tif err != nil {\n\t\t\t\t\tnewErr.error = err.Error()\n\t\t\t\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t\t\t\t}\n\t\t\t\tnewErr.model = v\n\t\t\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t\t}\n\t\t\n\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t}\n\n\treturn localVarReturnValue, localVarHttpResponse, nil\n}", "title": "" }, { "docid": "97055d39b4c58fe002903a6b6a51be4f", "score": "0.6301062", "text": "func (a *Client) ModifyGroup(params *ModifyGroupParams, authInfo runtime.ClientAuthInfoWriter) (*ModifyGroupOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewModifyGroupParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"ModifyGroup\",\n\t\tMethod: \"PATCH\",\n\t\tPathPattern: \"/v1/groups\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"http\", \"https\"},\n\t\tParams: params,\n\t\tReader: &ModifyGroupReader{formats: a.formats},\n\t\tAuthInfo: authInfo,\n\t\tContext: params.Context,\n\t\tClient: params.HTTPClient,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn result.(*ModifyGroupOK), nil\n\n}", "title": "" }, { "docid": "f881f673941dcf61ab72ad13c81f18fe", "score": "0.630042", "text": "func (c ChannelGroupService) Update(id string, channelGroup model.ChannelGroup) exception.HttpError {\n\tdb := database.DBConn\n\n\t// Exists\n\tif db.First(&channelGroup, id); channelGroup.ID == 0 {\n\t\treturn exception.HttpError{\n\t\t\tErr: fmt.Errorf(\"channel group %s not found\", id),\n\t\t\tStatusCode: 404,\n\t\t}\n\t}\n\n\tdb.Model(&model.ChannelGroup{}).Where(\"id = ?\", id).Updates(&channelGroup)\n\n\treturn exception.HttpError{}\n}", "title": "" }, { "docid": "23ae4f1b76f0a6a207835f84f3869d69", "score": "0.6296599", "text": "func (wg *WxGroup) Update(ctx context.Context, db DB) error {\n\tswitch {\n\tcase !wg._exists: // doesn't exist\n\t\treturn logerror(&ErrUpdateFailed{ErrDoesNotExist})\n\tcase wg._deleted: // deleted\n\t\treturn logerror(&ErrUpdateFailed{ErrMarkedForDeletion})\n\t}\n\t// update with primary key\n\tconst sqlstr = `UPDATE wx_group SET ` +\n\t\t`name = $1, comment = $2, active_period = $3, quiet_period = $4, active_num = $5, quiet_num = $6 ` +\n\t\t`WHERE group_id = $7`\n\t// run\n\tlogf(sqlstr, wg.Name, wg.Comment, wg.ActivePeriod, wg.QuietPeriod, wg.ActiveNum, wg.QuietNum, wg.GroupID)\n\tif _, err := db.ExecContext(ctx, sqlstr, wg.Name, wg.Comment, wg.ActivePeriod, wg.QuietPeriod, wg.ActiveNum, wg.QuietNum, wg.GroupID); err != nil {\n\t\treturn logerror(err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4823229512e6f0c0a65c603223db2820", "score": "0.62737334", "text": "func (client *ManagementGroupsClient) updateCreateRequest(ctx context.Context, groupID string, patchGroupRequest PatchManagementGroupRequest, options *ManagementGroupsUpdateOptions) (*policy.Request, error) {\n\turlPath := \"/providers/Microsoft.Management/managementGroups/{groupId}\"\n\tif groupID == \"\" {\n\t\treturn nil, errors.New(\"parameter groupID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{groupId}\", url.PathEscape(groupID))\n\treq, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2021-04-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\tif options != nil && options.CacheControl != nil {\n\t\treq.Raw().Header.Set(\"Cache-Control\", *options.CacheControl)\n\t}\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, runtime.MarshalAsJSON(req, patchGroupRequest)\n}", "title": "" }, { "docid": "45349580677b0f6f47b952c739fa9f02", "score": "0.62116325", "text": "func (a *SensitiveDataScannerApi) UpdateScanningGroup(ctx _context.Context, groupId string, body SensitiveDataScannerGroupUpdateRequest) (SensitiveDataScannerGroupUpdateResponse, *_nethttp.Response, error) {\n\tvar (\n\t\tlocalVarHTTPMethod = _nethttp.MethodPatch\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarReturnValue SensitiveDataScannerGroupUpdateResponse\n\t)\n\n\tlocalBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, \"v2.SensitiveDataScannerApi.UpdateScanningGroup\")\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}\n\t}\n\n\tlocalVarPath := localBasePath + \"/api/v2/sensitive-data-scanner/config/groups/{group_id}\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"group_id\"+\"}\", _neturl.PathEscape(datadog.ParameterToString(groupId, \"\")), -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := _neturl.Values{}\n\tlocalVarFormParams := _neturl.Values{}\n\tlocalVarHeaderParams[\"Content-Type\"] = \"application/json\"\n\tlocalVarHeaderParams[\"Accept\"] = \"application/json\"\n\n\t// body params\n\tlocalVarPostBody = &body\n\tdatadog.SetAuthKeys(\n\t\tctx,\n\t\t&localVarHeaderParams,\n\t\t[2]string{\"apiKeyAuth\", \"DD-API-KEY\"},\n\t\t[2]string{\"appKeyAuth\", \"DD-APPLICATION-KEY\"},\n\t)\n\treq, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil)\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, err\n\t}\n\n\tlocalVarHTTPResponse, err := a.Client.CallAPI(req)\n\tif err != nil || localVarHTTPResponse == nil {\n\t\treturn localVarReturnValue, localVarHTTPResponse, err\n\t}\n\n\tlocalVarBody, err := datadog.ReadBody(localVarHTTPResponse)\n\tif err != nil {\n\t\treturn localVarReturnValue, localVarHTTPResponse, err\n\t}\n\n\tif localVarHTTPResponse.StatusCode >= 300 {\n\t\tnewErr := datadog.GenericOpenAPIError{\n\t\t\tErrorBody: localVarBody,\n\t\t\tErrorMessage: localVarHTTPResponse.Status,\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 {\n\t\t\tvar v APIErrorResponse\n\t\t\terr = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.ErrorModel = v\n\t\t}\n\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t}\n\n\terr = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\tif err != nil {\n\t\tnewErr := datadog.GenericOpenAPIError{\n\t\t\tErrorBody: localVarBody,\n\t\t\tErrorMessage: err.Error(),\n\t\t}\n\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t}\n\n\treturn localVarReturnValue, localVarHTTPResponse, nil\n}", "title": "" }, { "docid": "8c95e0b578ae126638d5ff5228608127", "score": "0.6211277", "text": "func (u GroupUpdater) Update() error {\n\treturn u.db.Updates(u.fields).Error\n}", "title": "" }, { "docid": "26e6a25e867c5992432f96dca9051f54", "score": "0.6204546", "text": "func (o *Group) Update(db *gorm.DB, fields ...groupDBSchemaField) error {\n\tdbNameToFieldName := map[string]interface{}{\n\t\t\"id\": o.ID,\n\t\t\"created_at\": o.CreatedAt,\n\t\t\"updated_at\": o.UpdatedAt,\n\t\t\"deleted_at\": o.DeletedAt,\n\t\t\"name\": o.Name,\n\t\t\"owner_id\": o.OwnerID,\n\t\t\"counters\": o.Counters,\n\t}\n\tu := map[string]interface{}{}\n\tfor _, f := range fields {\n\t\tfs := string(f)\n\t\tu[fs] = dbNameToFieldName[fs]\n\t}\n\tif err := db.Model(o).Updates(u).Error; err != nil {\n\t\tif err == gorm.ErrRecordNotFound {\n\t\t\treturn err\n\t\t}\n\n\t\treturn fmt.Errorf(\"can't update Group %v fields %v: %s\",\n\t\t\to, fields, err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "c85a386de1cf81dff87ea5eb73076601", "score": "0.62034464", "text": "func (sqlite *Store) UpdateUserGroup(userGroup *data.UserGroup) (err error) {\n\tqueryStr := `UPDATE orek_user_group SET\n\t\t\tname = :name,\n\t\t\towner = :owner,\n\t\t\tdescription = :description\n\t\tWHERE group_id = :group_id`\n\t_, err = sqlite.NamedExec(queryStr, userGroup)\n\tlogIfError(err)\n\treturn err\n}", "title": "" }, { "docid": "b8fce4b2af9b1cffd4351172e051b05b", "score": "0.6203392", "text": "func updateCollectorGroup(d *schema.ResourceData, m interface{}) error {\n\td.Partial(true)\n\tclient := m.(*lmclient.LMSdkGo)\n\tgroup := makeDeviceCollectorGroupObject(d)\n\t// get Id\n\tid, a := strconv.Atoi(d.Id())\n\tif a != nil {\n\t\treturn a\n\t}\n\n\t// list of available properties\n\ts := []string{\"name\", \"description\", \"properties\"}\n\n\t// loops through array of properties to see which one has changed, the ones that did not change are removed from the list\n\tfor _, v := range s {\n\t\tif d.HasChange(v) {\n\t\t} else {\n\t\t\ts = remove(s, v)\n\t\t}\n\t}\n\n\tparams := lm.NewUpdateCollectorGroupByIDParams()\n\tparams.ID = int32(id)\n\tparams.SetBody(&group)\n\n\t// makes a bulk update for all properties that were changed\n\trestCollectorGroupResponse, err := client.LM.UpdateCollectorGroupByID(params)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor _, v := range s {\n\t\td.SetPartial(v)\n\t}\n\n\tlog.Printf(\"payload response %v\", restCollectorGroupResponse.Payload)\n\td.Partial(false)\n\treturn nil\n}", "title": "" }, { "docid": "68091b2292d409d4f2d35835fa97b9be", "score": "0.6202245", "text": "func EditUserGroup(anode map[string]string) (err error) {\n //check if role name already exists\n groups, err := ndb.GetUserGroups()\n for x := range groups {\n if groups[x][\"group\"] == anode[\"group\"] && x != anode[\"id\"] {\n return errors.New(\"This group is already in use\")\n }\n }\n\n //update name\n err = ndb.UpdateUserGroup(anode[\"id\"], \"group\", anode[\"group\"])\n if err != nil {\n logs.Error(\"master/EditUserGroup Error updating group name: \" + err.Error())\n return err\n }\n\n return err\n}", "title": "" }, { "docid": "e5f9ee1cdebbce07566a3f80a8d9e744", "score": "0.6178581", "text": "func Groups(w http.ResponseWriter, r *http.Request) {\n\tswitch r.Method {\n\tcase \"OPTIONS\":\n\tcase \"GET\":\n\n\t\ttype APIHTTPResponseJSONGroups struct {\n\t\t\tAPI string `json:\"api\"`\n\t\t\tTotal int `json:\"total\"`\n\t\t\tEntity []SGroup `json:\"entity\"`\n\t\t}\n\n\t\tvar Response APIHTTPResponseJSONGroups\n\n\t\tDb.Find(&Response.Entity)\n\n\t\tResponse.API = Version\n\t\tResponse.Total = len(Response.Entity)\n\t\taddedRecordString, _ := json.Marshal(Response)\n\t\tw.Header().Set(\"content-type\", \"application/json\")\n\t\tw.WriteHeader(http.StatusOK)\n\t\tn, _ := fmt.Fprintf(w, string(addedRecordString))\n\t\tfmt.Println(n)\n\n\tdefault:\n\t\tn, _ := fmt.Fprintf(w, \"Sorry, only OPTIONS,GET,POST,PATCH methods are supported. '\"+r.Method+\"' received\")\n\t\tlog.Println(n)\n\t\tlog.Println(\"/todo PATCH done\\n\\n\")\n\t}\n}", "title": "" }, { "docid": "4311392b0a159395a9dd57a3ebcd8a8b", "score": "0.6150689", "text": "func (p *PostgresProvider) Update(ctx context.Context, id, adminID int64, name string) error {\n\n\ttx, err := p.DB.BeginTx(ctx, nil)\n\n\tdefer tx.Rollback()\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Check if the group exists and the user want to update is the admin\n\tquery := fmt.Sprintf(`SELECT EXISTS( SELECT 1 FROM %s WHERE id=%d AND admin_id=%d)`,\n\t\tp.TableName, id, adminID)\n\n\tstmt, err := tx.PrepareContext(ctx, query)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\texists := false\n\n\terr = stmt.QueryRowContext(ctx).Scan(&exists)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif !exists {\n\t\treturn ErrorUpdateGroup\n\t}\n\n\t// Update the group infos\n\tquery = fmt.Sprintf(`UPDATE %s SET name='%s' WHERE id=%d`, p.TableName, name, id)\n\n\tstmt, err = tx.PrepareContext(ctx, query)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = stmt.ExecContext(ctx)\n\n\ttx.Commit()\n\n\treturn err\n}", "title": "" }, { "docid": "6e8b1f4c0029def0a4a83f924b026b3e", "score": "0.6142911", "text": "func SetGroup(params LightsAuthAndBody) {\n\n\tif params.Body.Effect != \"none\" && params.Body.Effect != \"colorloop\" {\n\t\tparams.Body.Effect = \"\"\n\t}\n\n\tif params.Body.Scene == \"potato\" {\n\t\tparams.Body.Scene = \"\"\n\t}\n\n\tupdate := utils.UpdateObject{\n\t\tURL: fmt.Sprintf(\"https://%s/api/%s/groups/%s/action\", params.Auth.HueIP, params.Auth.HueUser, params.Auth.Item),\n\t\tClient: utils.GetClient(),\n\t\tBody: utils.LightsBodyOptions{\n\t\t\tOn: params.Body.On,\n\t\t\tBrightness: params.Body.Brightness,\n\t\t\tSaturation: params.Body.Saturation,\n\t\t\tHue: params.Body.Hue,\n\t\t\tEffect: params.Body.Effect,\n\t\t\tScene: params.Body.Scene,\n\t\t}}\n\n\tres := utils.UpdateItem(update)\n\t//Convert the body to type string\n\tsb := string(res)\n\tlog.Println(sb)\n}", "title": "" }, { "docid": "ec864e7a7b16d433b78998e0b77bf721", "score": "0.6128983", "text": "func (c *FusionAuthClient) UpdateGroup(groupId string, request GroupRequest) (*GroupResponse, *Errors, error) {\n\treturn c.UpdateGroupWithContext(context.TODO(), groupId, request)\n}", "title": "" }, { "docid": "d729a5e4eba04c619ef408188bc76257", "score": "0.6101994", "text": "func (self *Group) Update() {\n self.Object.Call(\"update\")\n}", "title": "" }, { "docid": "0f9ffc13064f4926822484cdc1730068", "score": "0.6100498", "text": "func resourceADGroupObjectUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {\n\tlog.Infof(\"Updating AD Group object\")\n\n\tapi := meta.(APIInterface)\n\n\tvar diags diag.Diagnostics\n\n\toldOU, newOU := d.GetChange(\"base_ou\")\n\toldName, newName := d.GetChange(\"name\")\n\t// let's try to update in parts\n\td.Partial(true)\n\toldUserBase, newUserBase := d.GetChange(\"user_base\")\n\tlog.Infof(\"New userBase: %s\", newUserBase)\n\n\toldMember, newMember := d.GetChange(\"member\")\n\tnewMemberList := make([]string, 0)\n\tfor _, m := range newMember.(*schema.Set).List() {\n\t\tnewMemberList = append(newMemberList, m.(string))\n\t}\n\toldMemberList := make([]string, 0)\n\tfor _, m := range oldMember.(*schema.Set).List() {\n\t\toldMemberList = append(oldMemberList, m.(string))\n\t}\n\tlog.Infof(\"Old members %s, New mebmers %s\", oldMember, newMemberList)\n\tif d.HasChange(\"member\") {\n\t\tignoreMembersUnknownByTerraform := d.Get(\"ignore_members_unknown_by_terraform\").(bool)\n\t\tif err := api.updateGroupMembers(\n\t\t\toldName.(string),\n\t\t\toldOU.(string),\n\t\t\toldUserBase.(string),\n\t\t\toldMemberList,\n\t\t\tnewMemberList,\n\t\t\tignoreMembersUnknownByTerraform); err != nil {\n\t\t\treturn diag.Errorf(\"resourceADGroupObjectUpdate - update members - %s\", err)\n\t\t}\n\n\t}\n\t// check name\n\tif d.HasChange(\"name\") {\n\t\tif err := api.renameGroup(oldName.(string), oldOU.(string), newName.(string)); err != nil {\n\t\t\treturn diag.Errorf(\"resourceADGroupObjectUpdate - update group name - %s\", err)\n\t\t}\n\t}\n\n\t// check base_ou\n\tif d.HasChange(\"base_ou\") {\n\t\tif err := api.moveGroup(newName.(string), oldOU.(string), newOU.(string)); err != nil {\n\t\t\treturn diag.Errorf(\"resourceADGroupObjectUpdate - move ou - %s\", err)\n\t\t}\n\t}\n\t// check description\n\tif d.HasChange(\"description\") {\n\t\tif err := api.updateGroupDescription(newName.(string), newOU.(string), d.Get(\"description\").(string)); err != nil {\n\t\t\treturn diag.Errorf(\"resourceADGroupObjectUpdate - update description - %s\", err)\n\t\t}\n\t}\n\n\td.Partial(false)\n\td.SetId(strings.ToLower(fmt.Sprintf(\"cn=%s,%s\", newName.(string), newOU.(string))))\n\n\tresourceADGroupObjectRead(ctx, d, meta)\n\treturn diags\n}", "title": "" }, { "docid": "62079e503e6334682bbfb7ccf1cf17ed", "score": "0.6097885", "text": "func updateStepGroup(tx *gorm.DB, groupIDs ...uint64) error {\n\tfor _, v := range groupIDs {\n\t\tif v == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tvar stepGroup []TestPlanV2Step\n\t\tif err := tx.Where(\"group_id = ?\", v).Order(\"id\").Find(&stepGroup).Error; err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif len(stepGroup) > 0 {\n\t\t\tif err := tx.Model(&TestPlanV2Step{}).Where(\"group_id = ?\", v).Update(\"group_id\", stepGroup[0].ID).Error; err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "718daf9cedc68a0559622b784dc034ae", "score": "0.6095501", "text": "func (group RSSGroup) Save(context *Context) error {\n\t_, err := context.Db.Query(\"UPDATE `groups` SET `name`=? WHERE `id`=?\", group.Name, group.ID)\n\tif err != nil {\n\t\tlogger.Error(fmt.Sprintf(\"Error updating group: %s\", err.Error()))\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cef5fc7968a235f96e7b3122809a378f", "score": "0.6093795", "text": "func (ghandler *GroupHandler) UpdateGroupProfilePicture( response http.ResponseWriter , request *http.Request ){\n\tresponse.Header().Set(\"Content-Type\" , \"application/json\")\n\tlang := GetSetLang(ghandler ,response , request )\n\tsession := ghandler.Session.GetSession(request)\n\tres := &struct{\n\t\tSuccess bool `json:\"success\"`\n\t\tMessage string `json:\"message\"`\n\t\tImageurl string `json:\"imageurl\"`\n\t}{\n\t\tSuccess: false,\n\t\tMessage: translation.Translate(lang , \"Invalid Input \"),\n\t}\n\tera := request.ParseMultipartForm(99999999999)\n\tif era != nil {\n\t\tresponse.Write(Helper.MarshalThis(res))\n\t\treturn \n\t}\n\tgroupid := request.FormValue(\"group_id\")\n\tfile , header , er := request.FormFile(\"image\")\n\tif er != nil || groupid==\"\" {\n\t\t// fmt.Println(er)\n\t\tres.Message = translation.Translate( lang , \" Invalid Input \")\n\t\tresponse.Write(Helper.MarshalThis(res))\n\t\treturn\n\t} \n\tif isImage := Helper.IsImage(header.Filename); !isImage {\n\t\tres.Message =translation.Translate( lang , \" Invalid Input / Only Image Files are Allowed ... \")\n\t\tresponse.Write(Helper.MarshalThis(res))\n\t\treturn\n\t}\n\trandomName := \"assets/img/GroupImage/\"+Helper.GenerateRandomString(5 , Helper.CHARACTERS)+ \".\"+Helper.GetExtension(header.Filename)\n\tgroup := ghandler.GroupSer.GetGroupByID(groupid)\n\tif group== nil{\n\t\tres.Message =translation.Translate( lang , \" There is no group by this id : \" + groupid)\n\t\tresponse.Write(Helper.MarshalThis(res))\n\t\treturn\n\t}\n\tif group.OwnerID != session.UserID {\n\t\tres.Message =translation.Translate( lang , \" UnAuthorized User ... \\nYou Are not allowed to Modify this Group\")\n\t\tresponse.Write(Helper.MarshalThis(res))\n\t\treturn\n\t}\n\tnewImage , ere := os.Create(entity.PathToTemplates + randomName) \n\t_ , copyError := io.Copy(newImage , file)\n\tif copyError != nil || ere != nil {\n\t\tresponse.WriteHeader(http.StatusInternalServerError)\n\t\tres.Message =translation.Translate( lang , \" INTERNAL SERVER ERROR \")\n\t\tresponse.Write(Helper.MarshalThis(res))\n\t\treturn\n\t}\n\tdefer newImage.Close()\n\tdefer file.Close()\n\tif group.Imageurl != \"\" {\n\t\tos.Remove(entity.PathToTemplates+ group.Imageurl)\n\t}\n\tgroup.Imageurl= randomName\n\tgroup = ghandler.GroupSer.UpdateGroup(group)\n\tif group == nil {\n\t\tresponse.WriteHeader(http.StatusInternalServerError)\n\t\tres.Message =translation.Translate( lang , \" INTERNAL SERVER ERROR \")\n\t\tresponse.Write(Helper.MarshalThis(res))\n\n\t\tfmt.Println(\"Here.................\")\n\t\t\n\t\tos.Remove(entity.PathToTemplates+ randomName)\n\n\t\treturn\n\t}\n\tres.Imageurl= randomName\n\tres.Success = true\n\tres.Message =translation.Translate( lang , \" Update Was Succesful \")\n\tresponse.Write(Helper.MarshalThis(res))\n}", "title": "" }, { "docid": "98d29dd6fcf0b7c9138186da8b8a4a3f", "score": "0.6093153", "text": "func ExampleClient_Update() {\n\tcred, err := azidentity.NewDefaultAzureCredential(nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to obtain a credential: %v\", err)\n\t}\n\tctx := context.Background()\n\tclientFactory, err := armmanagementgroups.NewClientFactory(cred, nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to create client: %v\", err)\n\t}\n\tres, err := clientFactory.NewClient().Update(ctx, \"ChildGroup\", armmanagementgroups.PatchManagementGroupRequest{\n\t\tDisplayName: to.Ptr(\"AlternateDisplayName\"),\n\t\tParentGroupID: to.Ptr(\"/providers/Microsoft.Management/managementGroups/AlternateRootGroup\"),\n\t}, &armmanagementgroups.ClientUpdateOptions{CacheControl: to.Ptr(\"no-cache\")})\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to finish the request: %v\", err)\n\t}\n\t// You could use response here. We use blank identifier for just demo purposes.\n\t_ = res\n\t// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.\n\t// res.ManagementGroup = armmanagementgroups.ManagementGroup{\n\t// \tName: to.Ptr(\"ChildGroup\"),\n\t// \tType: to.Ptr(\"Microsoft.Management/managementGroups\"),\n\t// \tID: to.Ptr(\"/providers/Microsoft.Management/managementGroups/ChildGroup\"),\n\t// \tProperties: &armmanagementgroups.ManagementGroupProperties{\n\t// \t\tDisplayName: to.Ptr(\"AlternateDisplayName\"),\n\t// \t\tTenantID: to.Ptr(\"20000000-0000-0000-0000-000000000000\"),\n\t// \t\tDetails: &armmanagementgroups.ManagementGroupDetails{\n\t// \t\t\tParent: &armmanagementgroups.ParentGroupInfo{\n\t// \t\t\t\tName: to.Ptr(\"AlternateRootGroup\"),\n\t// \t\t\t\tDisplayName: to.Ptr(\"AlternateRootGroup\"),\n\t// \t\t\t\tID: to.Ptr(\"/providers/Microsoft.Management/managementGroups/AlternateRootGroup\"),\n\t// \t\t\t},\n\t// \t\t\tUpdatedBy: to.Ptr(\"bd490e30-04cb-433e-b8c8-6066959a8bab\"),\n\t// \t\t\tUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, \"2018-01-25T02:46:59.0545645Z\"); return t}()),\n\t// \t\t\tVersion: to.Ptr[int32](2),\n\t// \t\t},\n\t// \t},\n\t// }\n}", "title": "" }, { "docid": "ace6f865f66296fdf19558cb7671d3f6", "score": "0.6089123", "text": "func setGroup(t *testing.T, url string) {\n\tiURL := url + enServicePath\n\tfor i, gName := range groupsName {\n\t\tokURLJ := cr.URL{URL: fmt.Sprintf(\"%v/%v\", enServicePath + servicePath[groupsIdx], gName)}\n\t\tspecificURL := iURL + fmt.Sprintf(cr.ConvertCommandToRequest(urlCommands[handleUmGroupCommand]), gName)\n\t\taddDataVerifyResults(t, specificURL, okURLJ, true)\n\t\tverifyLen(t, enPath + groupsPath, groupsPath, i+1)\n\t}\n\tsetUm(t, url)\n\tgName := groupsName[0]\n\tfor _, uName := range usersName {\n\t\tokURLJ := cr.URL{URL: fmt.Sprintf(\"%v%v/%v%v/%v\", enServicePath + servicePath[groupsIdx], groupsPath, gName, servicePath[usersIdx], uName)}\n\t\tspecificURL := iURL + fmt.Sprintf(cr.ConvertCommandToRequest(urlCommands[addToGroupCommand]), gName, userIDToken, uName)\n\t\taddDataVerifyResults(t, specificURL, okURLJ, false)\n\t}\n}", "title": "" }, { "docid": "225510ac2072f41c4f9a4de7252cd82e", "score": "0.6008036", "text": "func (ag *AdGroup) Update(ctx context.Context, key ...interface{}) error {\n\tvar err error\n\tvar dbConn *sql.DB\n\n\t// if deleted, bail\n\tif ag._deleted {\n\t\treturn errors.New(\"update failed: marked for deletion\")\n\t}\n\n\ttx, err := components.M.GetConnFromCtx(ctx)\n\tif err != nil {\n\t\tdbConn, err = components.M.GetMasterConn()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\ttableName, err := GetAdGroupTableName(key...)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// sql query\n\tsqlstr := `UPDATE ` + tableName + ` SET ` +\n\t\t`title = ?, addby = ?, updated = ?, created = ?, status = ?` +\n\t\t` WHERE agid = ?`\n\n\t// run query\n\tutils.GetTraceLog(ctx).Debug(\"DB\", zap.String(\"SQL\", fmt.Sprint(sqlstr, ag.Title, ag.Addby, ag.Updated, ag.Created, ag.Status, ag.Agid)))\n\tif tx != nil {\n\t\t_, err = tx.Exec(sqlstr, ag.Title, ag.Addby, ag.Updated, ag.Created, ag.Status, ag.Agid)\n\t} else {\n\t\t_, err = dbConn.Exec(sqlstr, ag.Title, ag.Addby, ag.Updated, ag.Created, ag.Status, ag.Agid)\n\t}\n\treturn err\n}", "title": "" }, { "docid": "34dd3d3c5370787202fb0c1224849415", "score": "0.5995953", "text": "func (a *AccountingApiService) UpdateContactGroup(ctx _context.Context, xeroTenantId string, contactGroupID string, contactGroups ContactGroups) (ContactGroups, *_nethttp.Response, error) {\n\tvar (\n\t\tlocalVarHTTPMethod = _nethttp.MethodPost\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarFormFileName string\n\t\tlocalVarFileName string\n\t\tlocalVarFileBytes []byte\n\t\tlocalVarReturnValue ContactGroups\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/ContactGroups/{ContactGroupID}\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"ContactGroupID\"+\"}\", _neturl.PathEscape(parameterToString(contactGroupID, \"\")) , -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := _neturl.Values{}\n\tlocalVarFormParams := _neturl.Values{}\n\n\t// to determine the Content-Type header\n\tlocalVarHTTPContentTypes := []string{\"application/json\"}\n\n\t// set Content-Type header\n\tlocalVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)\n\tif localVarHTTPContentType != \"\" {\n\t\tlocalVarHeaderParams[\"Content-Type\"] = localVarHTTPContentType\n\t}\n\n\t// to determine the Accept header\n\tlocalVarHTTPHeaderAccepts := []string{\"application/json\"}\n\n\t// set Accept header\n\tlocalVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)\n\tif localVarHTTPHeaderAccept != \"\" {\n\t\tlocalVarHeaderParams[\"Accept\"] = localVarHTTPHeaderAccept\n\t}\n\tlocalVarHeaderParams[\"xero-tenant-id\"] = parameterToString(xeroTenantId, \"\")\n\t// body params\n\tlocalVarPostBody = &contactGroups\n\tr, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, err\n\t}\n\n\tlocalVarHTTPResponse, err := a.client.callAPI(r)\n\tif err != nil || localVarHTTPResponse == nil {\n\t\treturn localVarReturnValue, localVarHTTPResponse, err\n\t}\n\n\tlocalVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)\n\tlocalVarHTTPResponse.Body.Close()\n\tif err != nil {\n\t\treturn localVarReturnValue, localVarHTTPResponse, err\n\t}\n\n\tif localVarHTTPResponse.StatusCode >= 300 {\n\t\tnewErr := GenericOpenAPIError{\n\t\t\tbody: localVarBody,\n\t\t\terror: localVarHTTPResponse.Status,\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 400 {\n\t\t\tvar v Error\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t}\n\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t}\n\n\terr = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\tif err != nil {\n\t\tnewErr := GenericOpenAPIError{\n\t\t\tbody: localVarBody,\n\t\t\terror: err.Error(),\n\t\t}\n\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t}\n\n\treturn localVarReturnValue, localVarHTTPResponse, nil\n}", "title": "" }, { "docid": "fe85f15a995e3470e2cab939790c67f5", "score": "0.5991909", "text": "func (c *Client) ModifyRoGroupInfo(request *ModifyRoGroupInfoRequest) (response *ModifyRoGroupInfoResponse, err error) {\n if request == nil {\n request = NewModifyRoGroupInfoRequest()\n }\n response = NewModifyRoGroupInfoResponse()\n err = c.Send(request, response)\n return\n}", "title": "" }, { "docid": "9b04a0367883b18bcf7a4afe4cc03af1", "score": "0.5989482", "text": "func (state *GroupsManager) Save(filter utils.Filter, updates utils.Updates) error {\n\tif u, ok := updates[\"$set\"]; ok {\n\t\tup := u.(map[string]interface{})\n\t\tup[\"updated_at\"] = time.Now()\n\t\tupdates[\"$set\"] = up\n\t} else {\n\t\tupdates[\"$set\"] = map[string]interface{}{\"updated_at\": time.Now()}\n\t}\n\n\trequestData := utils.UpdateOptions{\n\t\tFilter: filter,\n\t\tUpdates: updates,\n\t}\n\n\tdata, err := bson.MarshalJSON(&requestData)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn state.conn.Publish(\"groups.update.send\", data)\n}", "title": "" }, { "docid": "d7207db2d1987d855156e97e75b0c5a5", "score": "0.59875923", "text": "func (client *FailoverGroupsClient) update(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, parameters FailoverGroupUpdate, options *FailoverGroupsBeginUpdateOptions) (*http.Response, error) {\n\treq, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, failoverGroupName, parameters, options)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresp, err := client.pl.Do(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) {\n\t\treturn nil, client.updateHandleError(resp)\n\t}\n\treturn resp, nil\n}", "title": "" }, { "docid": "83760ef77b9c0e0322b20ad04e313cbc", "score": "0.5959976", "text": "func getUpdateGroupResponse(session *models.Principal, params admin_api.UpdateGroupParams) (*models.Group, *models.Error) {\n\tctx := context.Background()\n\tif params.Name == \"\" {\n\t\treturn nil, prepareError(errGroupNameNotInRequest)\n\t}\n\tif params.Body == nil {\n\t\treturn nil, prepareError(errGroupBodyNotInRequest)\n\n\t}\n\texpectedGroupUpdate := params.Body\n\tgroupName := params.Name\n\n\tmAdmin, err := newAdminClient(session)\n\tif err != nil {\n\t\treturn nil, prepareError(err)\n\t}\n\t// create a MinIO Admin Client interface implementation\n\t// defining the client to be used\n\tadminClient := adminClient{client: mAdmin}\n\n\tgroupUpdated, err := groupUpdate(ctx, adminClient, groupName, expectedGroupUpdate)\n\tif err != nil {\n\t\treturn nil, prepareError(err)\n\t}\n\tgroupResponse := &models.Group{\n\t\tName: groupUpdated.Name,\n\t\tMembers: groupUpdated.Members,\n\t\tPolicy: groupUpdated.Policy,\n\t\tStatus: groupUpdated.Status,\n\t}\n\treturn groupResponse, nil\n}", "title": "" }, { "docid": "bec8e8b347be78015c2f1c0e5a0b4b16", "score": "0.5952681", "text": "func (groupRepository *GroupRepository) UpdateUserGroup(userID, userGroupID int64) error {\n\tvar err error\n\tsqlQuery := \"update grup_pengguna set grup_id = ? where pengguna_id = ?\"\n\tstmt, err := groupRepository.Database.Prepare(sqlQuery)\n\n\tif err != nil {\n\t\tfmt.Println(\"error when prepare insert user group\")\n\t}\n\n\t_, err = stmt.Exec(userGroupID, userID)\n\n\treturn err\n}", "title": "" }, { "docid": "5ed842573a46bff4f1b6fe75585938d2", "score": "0.59250265", "text": "func (ghandler *GroupHandler) LeaveGroup(response http.ResponseWriter , request *http.Request) {\n\tresponse.Header().Set(\"Content-Type\" , \"application/json\")\n\tlang := GetSetLang(ghandler , response ,request)\n\tsession := ghandler.Session.GetSession(request)\n\tgroupID := request.FormValue(\"group_id\")\n\tres :=struct{\n\t\tSuccess bool `json:\"success\"`\n\t\tMessage string `json:\"message\"`\n\t\tGroupID string `json:\"group_id\"`\n\t}{\n\t\tSuccess : false ,\n\t\tMessage: translation.Translate(lang ,\"Invalid Input missing variable \") + \"group_id\",\n\t}\n\tif groupID == \"\"{\n\t\tresponse.Write(Helper.MarshalThis(res))\n\t\treturn \n\t}\n\tres.GroupID= groupID\n\t// user := \n\tgroup := ghandler.GroupSer.GetGroupByID(groupID)\n\tuser := ghandler.UserSer.GetUserByEmailAndID(session.Email , session.UserID)\n\tif user == nil {\n\t\tres.Message=translation.Translate(lang , \" UnAuthorized User \") \n\t\tghandler.Session.DeleteSession(response , request)\n\t\tresponse.Write(Helper.MarshalThis(res))\n\t\treturn\n\t}\n\tif group == nil {\n\t\tres.Message = translation.Translate(lang , \"Group with ID \") + groupID + translation.Translate(lang ,\" Not Found \")\n\t\tresponse.Write(Helper.MarshalThis(res))\n\t\treturn \n\t}\n\tfor _ , mem := range group.MembersID {\n\t\tif mem== session.UserID {\n\t\t\tgroup.MembersID = func()[]string{\n\t\t\t\tval := []string{}\n\t\t\t\tfor _ , v := range group.MembersID {\n\t\t\t\t\tif v != session.UserID {\n\t\t\t\t\t\tval = append(val , v)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn val \n\t\t\t}()\n\t\t\tgroup.MembersCount--\n\t\t\tgroup = ghandler.GroupSer.UpdateGroup(group)\n\t\t\t\n\t\t\tuser.MyGroups = func()[]string { \n\t\t\t\tval := []string{}\n\t\t\tfor _ , v := range user.MyGroups {\n\t\t\t\tif v != group.ID {\n\t\t\t\t\tval = append(val, v)\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn val \n\t\t\t}()\n\t\t\tuser= ghandler.UserSer.SaveUser(user)\n\t\t\tif group == nil || user == nil {\n\t\t\t\tres.Message = translation.Translate(lang , \" INTERNAL SERVER ERROR \") \n\t\t\t\tresponse.Write(Helper.MarshalThis(res))\n\t\t\t\treturn \n\t\t\t}\n\t\t\tres.Success = true \n\t\t\tres.Message = translation.Translate(lang , \" You have succesfuly left a group \") \n\t\t\tresponse.Write(Helper.MarshalThis(res))\n\t\t\treturn \n\t\t}\n\t}\n\tres.Message =fmt.Sprintf( translation.Translate(lang , \" You are not a member at group Named : \\\"%s\\\" \"), group.GroupName )\n\tresponse.Write(Helper.MarshalThis(res))\n}", "title": "" }, { "docid": "2a81e4dbf8bc208ce257ffac0ceedc73", "score": "0.59207183", "text": "func (handler *restHandler) postGroup(w http.ResponseWriter, r *http.Request) {\n\tvar group models.PlanetGroup\n\tdefer r.Body.Close()\n\terr := json.NewDecoder(r.Body).Decode(&group)\n\tif err != nil {\n\t\twriteErr(w, err, http.StatusBadRequest)\n\t\treturn\n\t}\n\tif err := group.Insert(r.Context(), handler.db, boil.Infer()); err != nil {\n\t\twriteErr(w, err, http.StatusInternalServerError)\n\t}\n\n}", "title": "" }, { "docid": "9976c4843689e773657ee29ff3ca23d7", "score": "0.5897781", "text": "func (a LtmApi) PutDataGroupInternal(id string, object LtmDataGroupInternal) (*LtmDataGroupInternal, error) {\n\n\tvar httpMethod = \"Put\"\n\t// create path and map variables\n\tpath := a.configuration.BasePath + \"/tm/ltm/dataGroup/internal/{id}\"\n\tpath = strings.Replace(path, \"{\"+\"id\"+\"}\", fmt.Sprintf(\"%v\", id), -1)\n\n\theaderParams := make(map[string]string)\n\tqueryParams := url.Values{}\n\tformParams := make(map[string]string)\n\tvar postBody interface{}\n\tvar fileName string\n\tvar fileBytes []byte\n\t// authentication '(token)' required\n\t// set key with prefix in header\n\theaderParams[\"X-F5-Auth-Token\"] = a.configuration.getAPIKeyWithPrefix(\"X-F5-Auth-Token\")\n\t// add default headers if any\n\tfor key := range a.configuration.DefaultHeader {\n\t\theaderParams[key] = a.configuration.DefaultHeader[key]\n\t}\n\n\t// to determine the Content-Type header\n\tlocalVarHttpContentTypes := []string{\n\t\t\"application/json\",\n\t}\n\n\t// set Content-Type header\n\tlocalVarHttpContentType := a.configuration.restClient.selectHeaderContentType(localVarHttpContentTypes)\n\tif localVarHttpContentType != \"\" {\n\t\theaderParams[\"Content-Type\"] = localVarHttpContentType\n\t}\n\t// to determine the Accept header\n\tlocalVarHttpHeaderAccepts := []string{\n\t\t\"aplication/json\",\n\t}\n\n\t// set Accept header\n\tlocalVarHttpHeaderAccept := a.configuration.restClient.SelectHeaderAccept(localVarHttpHeaderAccepts)\n\tif localVarHttpHeaderAccept != \"\" {\n\t\theaderParams[\"Accept\"] = localVarHttpHeaderAccept\n\t}\n\t// body params\n\tpostBody = &object\n\n\thttpResponse, err := a.configuration.restClient.callAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes)\n\tvar successPayload = new(LtmDataGroupInternal)\n\tif err == nil && httpResponse.StatusCode() == 200 {\n\t\terr = json.Unmarshal(httpResponse.Body(), &successPayload)\n\t}\n\terr = NewAPIResponse(httpResponse, err)\n\tif err != nil {\n\t\treturn nil, err\n\t} else {\n\t\treturn successPayload, err\n\t}\n\n}", "title": "" }, { "docid": "c51f16c0f01c25810b0d711ae7a28c69", "score": "0.58908457", "text": "func (c *Client) UpdateGroupWithParams(groupID string, group *Group, force bool) (deploymentID, version string, err error) {\n\toptions := &RequestOptions{\n\t\tPath: fmt.Sprintf(\"groups/%s\", groupID),\n\t\tDatas: group,\n\t\tMethod: \"PUT\",\n\t\tParams: &Parameters{Force: force},\n\t}\n\tresp := &response{}\n\terr = c.unmarshalJSON(options, []int{http.StatusOK}, resp)\n\tdeploymentID = resp.DeploymentID\n\tversion = resp.Version\n\treturn\n}", "title": "" }, { "docid": "09bef2931d343845a4990b5d03bf760d", "score": "0.58904576", "text": "func (a Groups) DeleteGroup(id string) (*ResultSuccess, *APIResponse, error) {\n\n\tvar httpMethod = \"Delete\"\n\t// create path and map variables\n\tpath := a.Configuration.BasePath + \"/groups/{id}\"\n\tpath = strings.Replace(path, \"{\"+\"id\"+\"}\", fmt.Sprintf(\"%v\", id), -1)\n\n\n\theaderParams := make(map[string]string)\n\tqueryParams := url.Values{}\n\tformParams := make(map[string]string)\n\tvar postBody interface{}\n\tvar fileName string\n\tvar fileBytes []byte\n\t// authentication '(PasswordGrant)' required\n\t// oauth required\n\tif a.Configuration.AccessToken != \"\"{\n\t\theaderParams[\"Authorization\"] = \"Bearer \" + a.Configuration.AccessToken\n\t}\n\t// add default headers if any\n\tfor key := range a.Configuration.DefaultHeader {\n\t\theaderParams[key] = a.Configuration.DefaultHeader[key]\n\t}\n\n\n\t// to determine the Content-Type header\n\tlocalVarHttpContentTypes := []string{ \"application/vnd.api+json\", }\n\n\t// set Content-Type header\n\tlocalVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes)\n\tif localVarHttpContentType != \"\" {\n\t\theaderParams[\"Content-Type\"] = localVarHttpContentType\n\t}\n\t// to determine the Accept header\n\tlocalVarHttpHeaderAccepts := []string{\n\t\t\"application/vnd.api+json\",\n\t}\n\n\t// set Accept header\n\tlocalVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts)\n\tif localVarHttpHeaderAccept != \"\" {\n\t\theaderParams[\"Accept\"] = localVarHttpHeaderAccept\n\t}\n\tvar successPayload = new(ResultSuccess)\n\thttpResponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes)\n\tif err != nil {\n\t\treturn successPayload, NewAPIResponse(httpResponse.RawResponse), err\n\t}\n\terr = json.Unmarshal(httpResponse.Body(), &successPayload)\n\treturn successPayload, NewAPIResponse(httpResponse.RawResponse), err\n}", "title": "" }, { "docid": "6b797167dffb0ee146a387b0b355a656", "score": "0.5865612", "text": "func (k *ACLGroupsCollection) Update(aclGroup ACLGroup) error {\n\ttxn := k.db.Txn(true)\n\tdefer txn.Abort()\n\terr := txn.Insert(aclGroupTableName, &aclGroup)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"update failed\")\n\t}\n\ttxn.Commit()\n\treturn nil\n}", "title": "" }, { "docid": "27c8071366785533d3abbf61cd6f8800", "score": "0.5845393", "text": "func TestUpdateNodeGroupInternal(t *testing.T) {\n\tth.SetupHTTP()\n\tdefer th.TeardownHTTP()\n\n\thandleUpdateNodeGroupInternal(t)\n\n\tsc := fake.ServiceClient()\n\tsc.Endpoint = sc.Endpoint + \"v1/\"\n\n\tupdateOpts := []nodegroups.UpdateOptsBuilder{\n\t\tnodegroups.UpdateOpts{\n\t\t\tOp: nodegroups.ReplaceOp,\n\t\t\tPath: \"/name\",\n\t\t\tValue: \"newname\",\n\t\t},\n\t}\n\n\t_, err := nodegroups.Update(sc, clusterUUID, nodeGroup2UUID, updateOpts).Extract()\n\tth.AssertEquals(t, true, err != nil)\n\t_, isBadRequest := err.(gophercloud.ErrDefault400)\n\tth.AssertEquals(t, true, isBadRequest)\n}", "title": "" }, { "docid": "d65b42b325819ce51c60e5fc3cf8ace2", "score": "0.5833926", "text": "func (s *IMService) UpdateQuickReplyGroup(ctx echo.Context) (err error) {\n\tentID := ctx.Get(middleware.AgentEntIDKey).(string)\n\tagentID := ctx.Get(middleware.AgentIDKey).(string)\n\tif !conf.IMConf.Debug {\n\t\tif msg := hasPerm(entID, agentID, \"online_agent_config\", \"config_ent_quick_reply\"); msg != nil {\n\t\t\treturn noPermResp(ctx, msg)\n\t\t}\n\t}\n\n\tgroupID := ctx.Param(\"group_id\")\n\treq := &UpdateQuickReplyGroupReq{}\n\tif err = ctx.Bind(req); err != nil {\n\t\treturn\n\t}\n\n\tif groupID == \"\" {\n\t\treturn invalidParameterResp(ctx, \"group_id is empty\")\n\t}\n\n\treply, err := models.QuickreplyGroupByID(db.Mysql, groupID)\n\tif err != nil {\n\t\treturn dbErrResp(ctx, err.Error())\n\t}\n\tif req.Title != \"\" {\n\t\treply.Title = req.Title\n\t}\n\n\tif req.Position != nil {\n\t\tgroups, err := models.QuickGroups(db.Mysql, entID, reply.CreatorType)\n\t\tif err != nil {\n\t\t\treturn dbErrResp(ctx, err.Error())\n\t\t}\n\n\t\tvar currentPosition = -1\n\t\tfor i, g := range groups {\n\t\t\tif g.ID == groupID {\n\t\t\t\tcurrentPosition = i\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\ttargetPosition := *req.Position\n\t\tgroupsRank := QuickReplyGroupsRankImpl(groups)\n\t\tnewRank := getNewRank(currentPosition, targetPosition, groupsRank)\n\t\tif newRank != -1 {\n\t\t\treply.Rank = newRank\n\t\t}\n\t}\n\n\tif err = reply.Update(db.Mysql); err != nil {\n\t\treturn jsonResponse(ctx, &ErrMsg{Code: common.DBErr, Message: err.Error()})\n\t}\n\n\tgroup := adapter.ConvertModelQKReplyGroupToGroup(reply)\n\tgo s.sendQkReplyGroupEvent(agentID, QuickReplyGroupUpdate, group)\n\n\treturn jsonResponse(ctx, group)\n}", "title": "" }, { "docid": "5ab6484436a8035338cf79e5b8e34f04", "score": "0.5832524", "text": "func (a SysApi) PatchHaGroup(id string, object SysHaGroup) (*SysHaGroup, error) {\n\n\tvar httpMethod = \"Patch\"\n\t// create path and map variables\n\tpath := a.configuration.BasePath + \"/tm/sys/haGroup/{id}\"\n\tpath = strings.Replace(path, \"{\"+\"id\"+\"}\", fmt.Sprintf(\"%v\", id), -1)\n\n\theaderParams := make(map[string]string)\n\tqueryParams := url.Values{}\n\tformParams := make(map[string]string)\n\tvar postBody interface{}\n\tvar fileName string\n\tvar fileBytes []byte\n\t// authentication '(token)' required\n\t// set key with prefix in header\n\theaderParams[\"X-F5-Auth-Token\"] = a.configuration.getAPIKeyWithPrefix(\"X-F5-Auth-Token\")\n\t// add default headers if any\n\tfor key := range a.configuration.DefaultHeader {\n\t\theaderParams[key] = a.configuration.DefaultHeader[key]\n\t}\n\n\t// to determine the Content-Type header\n\tlocalVarHttpContentTypes := []string{\n\t\t\"application/json\",\n\t}\n\n\t// set Content-Type header\n\tlocalVarHttpContentType := a.configuration.restClient.selectHeaderContentType(localVarHttpContentTypes)\n\tif localVarHttpContentType != \"\" {\n\t\theaderParams[\"Content-Type\"] = localVarHttpContentType\n\t}\n\t// to determine the Accept header\n\tlocalVarHttpHeaderAccepts := []string{\n\t\t\"aplication/json\",\n\t}\n\n\t// set Accept header\n\tlocalVarHttpHeaderAccept := a.configuration.restClient.SelectHeaderAccept(localVarHttpHeaderAccepts)\n\tif localVarHttpHeaderAccept != \"\" {\n\t\theaderParams[\"Accept\"] = localVarHttpHeaderAccept\n\t}\n\t// body params\n\tpostBody = &object\n\n\thttpResponse, err := a.configuration.restClient.callAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes)\n\tvar successPayload = new(SysHaGroup)\n\tif err == nil && httpResponse.StatusCode() == 200 {\n\t\terr = json.Unmarshal(httpResponse.Body(), &successPayload)\n\t}\n\terr = NewAPIResponse(httpResponse, err)\n\tif err != nil {\n\t\treturn nil, err\n\t} else {\n\t\treturn successPayload, err\n\t}\n\n}", "title": "" }, { "docid": "f75102b583756a3908b588d2300d7679", "score": "0.5823931", "text": "func (i instrument) PatchGroup(w http.ResponseWriter, r *http.Request) {\n\ti.next.PatchGroup(w, r)\n}", "title": "" }, { "docid": "01b50d1bce821515bfc90afae0671eca", "score": "0.5816571", "text": "func (js JsonStorage) GroupAdd(w http.ResponseWriter, r *http.Request, group *data.GROUP) {\n\tif group.Gname != \"\" {\n\t\tJRepo.uLock.Lock()\n\t\tdefer JRepo.uLock.Unlock() \n\t\tif _, ok := JRepo.js.Repogrp[group.Gname]; !ok {\n\t\t\tJRepo.js.Repogrp[group.Gname] = []string{}\n\t\t\tdata.ServerResponse(w, r, http.StatusOK, data.STRING_DATA, \"Group \"+group.Gname+\" added successfully\")\n\t\t} else {\n\t\t\tdata.ServerResponse(w, r, http.StatusInternalServerError, data.STRING_DATA, \"Group \"+group.Gname+\" already exists\")\n\t\t}\n\t} else {\n\t\tdata.ServerResponse(w, r, http.StatusBadRequest, data.STRING_DATA, http.StatusText(http.StatusBadRequest))\n\t}\n}", "title": "" }, { "docid": "2ce19bd2bcf4d5c61a6ebe3b444c8373", "score": "0.5807789", "text": "func editGroupPrompt(newBudget *budgetapi.Budget) error {\n\tfor {\n\n\t\tavailableGroups := newBudget.Groups\n\n\t\tvar options []string\n\t\tfor _, group := range availableGroups {\n\t\t\tgroupOption := (group.Name + \" $\" + strconv.FormatFloat(group.GroupPrice, 'g', 10, 64))\n\t\t\toptions = append(options, groupOption)\n\t\t}\n\n\t\tselectGroupPrompt := promptui.Select{\n\t\t\tLabel: \"Select Group\",\n\t\t\tItems: options,\n\t\t}\n\n\t\tchosenIndex, _, err := selectGroupPrompt.Run()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t//Makes sure Done has not been chosen. Checks to see if the last option was not chosen.\n\n\t\tif chosenIndex == len(options)-1 {\n\t\t\treturn nil\n\t\t}\n\t\tchosenGroup := availableGroups[chosenIndex]\n\n\t\tgroupTotal, err := promptForNumber(\"Group Budget Total\")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tchosenGroup.GroupPrice = groupTotal\n\n\t\ttotal := sumGroupTotals(newBudget)\n\n\t\t//need to call budgetService\n\n\t\tif total > newBudget.TotalPrice {\n\t\t\tfmt.Println(\"Group Totals Exceed Budget Total of\", newBudget.TotalPrice)\n\t\t}\n\n\t\ttime.Sleep(500 * time.Millisecond)\n\t}\n}", "title": "" }, { "docid": "fac95e421ecc54451b27562a268f8a79", "score": "0.580276", "text": "func (s *UsergroupsService) Update(usergroup string) *UsergroupsUpdateCall {\n\tvar call UsergroupsUpdateCall\n\tcall.service = s\n\tcall.usergroup = usergroup\n\treturn &call\n}", "title": "" }, { "docid": "8a8d652158be7ebdbfe3442f03aebf52", "score": "0.5795341", "text": "func (c *Client) Update(aadGroup *aadgroupsyncv1.AADGroupSync) (*aadgroupsyncv1.AADGroupSync, error) {\n\n\tc.Log.Infof(\"Updating aadgroupsyncs.aad.microsoft.com: %s\", aadGroup.ObjectMeta.Name)\n\n\taadGroup, err := c.Client.Update(aadGroup)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn aadGroup, nil\n}", "title": "" }, { "docid": "2b702b5c58121ab378e5f805507f7cb9", "score": "0.57816154", "text": "func (a *MembershipApiService) SetMobilityGroup(ctx context.Context, mgName string, mobilityGroup MobilityGroup) (*http.Response, error) {\n\tvar (\n\t\tlocalVarHttpMethod = strings.ToUpper(\"Put\")\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarFileName string\n\t\tlocalVarFileBytes []byte\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/mg/{mgName}\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"mgName\"+\"}\", fmt.Sprintf(\"%v\", mgName), -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := url.Values{}\n\tlocalVarFormParams := url.Values{}\n\n\t// to determine the Content-Type header\n\tlocalVarHttpContentTypes := []string{\"application/json\"}\n\n\t// set Content-Type header\n\tlocalVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)\n\tif localVarHttpContentType != \"\" {\n\t\tlocalVarHeaderParams[\"Content-Type\"] = localVarHttpContentType\n\t}\n\n\t// to determine the Accept header\n\tlocalVarHttpHeaderAccepts := []string{\"application/json\"}\n\n\t// set Accept header\n\tlocalVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)\n\tif localVarHttpHeaderAccept != \"\" {\n\t\tlocalVarHeaderParams[\"Accept\"] = localVarHttpHeaderAccept\n\t}\n\t// body params\n\tlocalVarPostBody = &mobilityGroup\n\tr, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tlocalVarHttpResponse, err := a.client.callAPI(r)\n\tif err != nil || localVarHttpResponse == nil {\n\t\treturn localVarHttpResponse, err\n\t}\n\n\tlocalVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)\n\tlocalVarHttpResponse.Body.Close()\n\tif err != nil {\n\t\treturn localVarHttpResponse, err\n\t}\n\n\tif localVarHttpResponse.StatusCode >= 300 {\n\t\tnewErr := GenericSwaggerError{\n\t\t\tbody: localVarBody,\n\t\t\terror: localVarHttpResponse.Status,\n\t\t}\n\n\t\treturn localVarHttpResponse, newErr\n\t}\n\n\treturn localVarHttpResponse, nil\n}", "title": "" }, { "docid": "567ab582f80ada464dc6fd12bc487253", "score": "0.5770132", "text": "func DeleteGroup(c *gin.Context) {\n // get session\n session, err := store.Get(c.Request, \"session\")\n if err != nil {\n c.JSON(http.StatusInternalServerError, gin.H{\"error\": err.Error()})\n\t\treturn\n }\n // check if authenticated\n if !(isAuthenticated(session)) {\n c.JSON(http.StatusUnauthorized, gin.H{\"error\": \"Access denied\"})\n\t\treturn\n }\n // get id and check that its valid\n id_param := c.Param(\"id\")\n id, err := primitive.ObjectIDFromHex(id_param)\n if err != nil {\n c.JSON(http.StatusBadRequest, gin.H{\"error\": \"Invalid id \" + id_param})\n\t\treturn\n }\n // find the matching group\n var group Group\n err = groups.FindOne(context.TODO(), bson.M{\"_id\": id}).Decode(&group)\n if err != nil {\n c.JSON(http.StatusNotFound, gin.H{\"error\": \"Group \" + id_param + \" not found\"})\n\t\treturn\n }\n // verify that deleter is owner of group\n if session.Values[\"_id\"].(*primitive.ObjectID).Hex() != group.Createdby.Hex() {\n c.JSON(http.StatusForbidden, gin.H{\"error\": \"Forbidden\"})\n\t\treturn\n }\n // delete group from db\n _, err = groups.DeleteOne(context.TODO(), bson.M{\"_id\": id})\n if err != nil {\n c.JSON(http.StatusInternalServerError, gin.H{\"error\": err.Error()})\n\t return\n }\n // send response\n c.JSON(http.StatusOK, gin.H{\n \"_id\": id,\n \"createdby\": group.Createdby,\n \"creatorrole\": group.Creatorrole,\n \"name\": group.Name,\n \"about\": group.About,\n \"visibility\": group.Visibility,\n \"groupmembers\": group.Groupmembers,\n })\n}", "title": "" }, { "docid": "e4a3dba7a31bfabbb61e84b208232e79", "score": "0.57633305", "text": "func updateDataGroup(\n\tintDgMap InternalDataGroupMap,\n\tname string,\n\tpartition string,\n\tnamespace string,\n\tkey string,\n\tvalue string,\n) {\n\tmapKey := NameRef{\n\t\tName: name,\n\t\tPartition: partition,\n\t}\n\tnsDg, found := intDgMap[mapKey]\n\tif !found {\n\t\tnsDg = make(DataGroupNamespaceMap)\n\t\tintDgMap[mapKey] = nsDg\n\t}\n\tdg, found := nsDg[namespace]\n\tif found {\n\t\tdg.AddOrUpdateRecord(key, value)\n\t} else {\n\t\tnewDg := InternalDataGroup{\n\t\t\tName: name,\n\t\t\tPartition: partition,\n\t\t}\n\t\tnewDg.AddOrUpdateRecord(key, value)\n\t\tnsDg[namespace] = &newDg\n\t}\n}", "title": "" }, { "docid": "825789b70a728ea524355633184e98b0", "score": "0.5758031", "text": "func (c *FusionAuthClient) PatchGroup(groupId string, request map[string]interface{}) (*GroupResponse, *Errors, error) {\n\treturn c.PatchGroupWithContext(context.TODO(), groupId, request)\n}", "title": "" }, { "docid": "0d747c68392e5034d6647bd1e2697360", "score": "0.5727401", "text": "func Update(c *golangsdk.ServiceClient, id string, opts UpdateOptsBuilder) (r UpdateResult) {\n\tb, err := opts.ToGroupUpdateMap()\n\tif err != nil {\n\t\tr.Err = err\n\t\treturn\n\t}\n\treqOpt := &golangsdk.RequestOpts{OkCodes: []int{200}}\n\t_, r.Err = c.Put(resourceURL(c, id), b, nil, reqOpt)\n\treturn\n}", "title": "" }, { "docid": "d77730302925c026f1e4b0c595a81b69", "score": "0.5721963", "text": "func Update(c *golangsdk.ServiceClient, id string, opts UpdateOpts) (r UpdateResult) {\n\tb, err := opts.ToIpGroupUpdateMap()\n\tif err != nil {\n\t\tr.Err = err\n\t\treturn\n\t}\n\t_, r.Err = c.Put(resourceURL(c, id), b, &r.Body, &golangsdk.RequestOpts{\n\t\tOkCodes: []int{200, 202},\n\t})\n\treturn\n}", "title": "" }, { "docid": "f96dc494dcf294a854a3fe554515905d", "score": "0.57033885", "text": "func (js JsonStorage) GroupDelete(w http.ResponseWriter, r *http.Request, groupname string) {\n\tif groupname != \"\" {\n\t\tJRepo.uLock.Lock()\n\t\tdefer JRepo.uLock.Unlock() \n\t\tif _, ok := JRepo.js.Repogrp[groupname]; ok {\n\t\t\t// if groupname exists, remove all references to it for each member in its list\n\t\t\tif v, ok2 := JRepo.js.Repogrp[groupname]; ok2 {\n\t\t\t\tremoveAllReference(&v, groupname)\n\t\t\t}\n\t\t\t// then remove group name from map\n\t\t\tdelete(JRepo.js.Repogrp, groupname)\n\t\t\tdata.ServerResponse(w, r, http.StatusOK, data.STRING_DATA, \"Group \"+groupname+\" successfully deleted\")\n\t\t} else {\n\t\t\tdata.ServerResponse(w, r, http.StatusNotFound, data.STRING_DATA, http.StatusText(http.StatusNotFound))\n\t\t}\n\t} else {\n\t\tdata.ServerResponse(w, r, http.StatusBadRequest, data.STRING_DATA, http.StatusText(http.StatusBadRequest))\n\t}\n}", "title": "" }, { "docid": "c48fad2ff1287262826819ef6fb2d052", "score": "0.56972414", "text": "func (s *uniCtrlGroup) addGroup(w http.ResponseWriter, r *http.Request) {\n\tvar reqBody struct {\n\t\tName string `json:\"name\"`\n\t\tStudyYearID string `json:\"study_year_id\"`\n\t}\n\tif err := render.DecodeJSON(http.MaxBytesReader(w, r.Body, hardBodyLimit), &reqBody); err != nil {\n\t\trest.SendErrorJSON(w, r, http.StatusBadRequest, err, \"can't bind group\", rest.ErrDecode)\n\t\treturn\n\t}\n\n\tid, err := s.dataService.AddGroup(reqBody.Name, reqBody.StudyYearID)\n\tif err != nil {\n\t\trest.SendErrorJSON(w, r, http.StatusInternalServerError, err, \"can't add group\", rest.ErrInternal)\n\t\treturn\n\t}\n\n\tfinalGroup, err := s.dataService.GetGroup(id)\n\tif err != nil {\n\t\trest.SendErrorJSON(w, r, http.StatusInternalServerError, err, \"can't load added group\", rest.ErrInternal)\n\t\treturn\n\t}\n\n\trender.Status(r, http.StatusOK)\n\trender.JSON(w, r, finalGroup)\n}", "title": "" }, { "docid": "e113ab6281b0e6ae506543aa4f7537d8", "score": "0.56962925", "text": "func (a LtmApi) PatchDataGroupInternal(id string, object LtmDataGroupInternal) (*LtmDataGroupInternal, error) {\n\n\tvar httpMethod = \"Patch\"\n\t// create path and map variables\n\tpath := a.configuration.BasePath + \"/tm/ltm/dataGroup/internal/{id}\"\n\tpath = strings.Replace(path, \"{\"+\"id\"+\"}\", fmt.Sprintf(\"%v\", id), -1)\n\n\theaderParams := make(map[string]string)\n\tqueryParams := url.Values{}\n\tformParams := make(map[string]string)\n\tvar postBody interface{}\n\tvar fileName string\n\tvar fileBytes []byte\n\t// authentication '(token)' required\n\t// set key with prefix in header\n\theaderParams[\"X-F5-Auth-Token\"] = a.configuration.getAPIKeyWithPrefix(\"X-F5-Auth-Token\")\n\t// add default headers if any\n\tfor key := range a.configuration.DefaultHeader {\n\t\theaderParams[key] = a.configuration.DefaultHeader[key]\n\t}\n\n\t// to determine the Content-Type header\n\tlocalVarHttpContentTypes := []string{\n\t\t\"application/json\",\n\t}\n\n\t// set Content-Type header\n\tlocalVarHttpContentType := a.configuration.restClient.selectHeaderContentType(localVarHttpContentTypes)\n\tif localVarHttpContentType != \"\" {\n\t\theaderParams[\"Content-Type\"] = localVarHttpContentType\n\t}\n\t// to determine the Accept header\n\tlocalVarHttpHeaderAccepts := []string{\n\t\t\"aplication/json\",\n\t}\n\n\t// set Accept header\n\tlocalVarHttpHeaderAccept := a.configuration.restClient.SelectHeaderAccept(localVarHttpHeaderAccepts)\n\tif localVarHttpHeaderAccept != \"\" {\n\t\theaderParams[\"Accept\"] = localVarHttpHeaderAccept\n\t}\n\t// body params\n\tpostBody = &object\n\n\thttpResponse, err := a.configuration.restClient.callAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, fileName, fileBytes)\n\tvar successPayload = new(LtmDataGroupInternal)\n\tif err == nil && httpResponse.StatusCode() == 200 {\n\t\terr = json.Unmarshal(httpResponse.Body(), &successPayload)\n\t}\n\terr = NewAPIResponse(httpResponse, err)\n\tif err != nil {\n\t\treturn nil, err\n\t} else {\n\t\treturn successPayload, err\n\t}\n\n}", "title": "" }, { "docid": "f3e3958a59cd610ea2644367da327c03", "score": "0.5682466", "text": "func (as *adminService) CreateOrUpdateGroupIfNescessary(group GoogleGroup) error {\n\tif *verbose {\n\t\tlog.Printf(\"adminService.CreateOrUpdateGroupIfNecessary %s\", group.EmailId)\n\t}\n\n\tgrp, err := as.client.GetGroup(group.EmailId)\n\tif err != nil {\n\t\tif as.checkForAPIErr404(err) {\n\t\t\tif !config.ConfirmChanges {\n\t\t\t\tlog.Printf(\"dry-run: would create group %q\\n\", group.EmailId)\n\t\t\t} else {\n\t\t\t\tlog.Printf(\"Trying to create group: %q\\n\", group.EmailId)\n\t\t\t\tg := admin.Group{\n\t\t\t\t\tEmail: group.EmailId,\n\t\t\t\t}\n\t\t\t\tif group.Name != \"\" {\n\t\t\t\t\tg.Name = group.Name\n\t\t\t\t}\n\t\t\t\tif group.Description != \"\" {\n\t\t\t\t\tg.Description = group.Description\n\t\t\t\t}\n\t\t\t\tg4, err := as.client.InsertGroup(&g)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"unable to add new group %q: %w\", group.EmailId, err)\n\t\t\t\t}\n\t\t\t\tlog.Printf(\"> Successfully created group %s\\n\", g4.Email)\n\t\t\t}\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"unable to fetch group %q: %w\", group.EmailId, err)\n\t\t}\n\t} else {\n\t\tif group.Name != \"\" && grp.Name != group.Name ||\n\t\t\tgroup.Description != \"\" && grp.Description != group.Description {\n\t\t\tif !config.ConfirmChanges {\n\t\t\t\tlog.Printf(\"dry-run: would update group name/description %q\\n\", group.EmailId)\n\t\t\t} else {\n\t\t\t\tlog.Printf(\"Trying to update group: %q\\n\", group.EmailId)\n\t\t\t\tg := admin.Group{\n\t\t\t\t\tEmail: group.EmailId,\n\t\t\t\t}\n\t\t\t\tif group.Name != \"\" {\n\t\t\t\t\tg.Name = group.Name\n\t\t\t\t}\n\t\t\t\tif group.Description != \"\" {\n\t\t\t\t\tg.Description = group.Description\n\t\t\t\t}\n\t\t\t\tg4, err := as.client.UpdateGroup(group.EmailId, &g)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"unable to update group %q: %w\", group.EmailId, err)\n\t\t\t\t}\n\t\t\t\tlog.Printf(\"> Successfully updated group %s\\n\", g4.Email)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c0fbb0b085b4a558bb0e20cd865f0a4b", "score": "0.56721234", "text": "func (p *LogProject) UpdateMachineGroup(m *MachineGroup) (err error) {\n\tbody, err := json.Marshal(m)\n\tif err != nil {\n\t\treturn\n\t}\n\n\th := map[string]string{\n\t\t\"x-sls-bodyrawsize\": fmt.Sprintf(\"%v\", len(body)),\n\t\t\"Content-Type\": \"application/json\",\n\t\t\"Accept-Encoding\": \"deflate\", // TODO: support lz4\n\t}\n\n\tr, err := request(p, \"PUT\", \"/machinegroups/\"+m.Name, h, body)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tbody, err = io.ReadAll(r.Body)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tif r.StatusCode != http.StatusOK {\n\t\terrMsg := &errorMessage{}\n\t\terr = json.Unmarshal(body, errMsg)\n\t\tif err != nil {\n\t\t\terr = fmt.Errorf(\"failed to update machine group\")\n\t\t\tdump, _ := httputil.DumpResponse(r, true)\n\t\t\tfmt.Printf(\"%s\\n\", dump)\n\t\t\treturn\n\t\t}\n\t\terr = fmt.Errorf(\"%v:%v\", errMsg.Code, errMsg.Message)\n\t\treturn\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "4e2c35e556b7faac8bd0c216adcd9eda", "score": "0.56576824", "text": "func populateGroupAttributes(d *schema.ResourceData, group client.Group) error {\n\t// Set ID\n\tstrID := fmt.Sprint(group.ID)\n\td.SetId(strID)\n\n\treturn nil\n}", "title": "" }, { "docid": "2f5666364b598119036285de12eea340", "score": "0.56483686", "text": "func GetGroupDetails(c *gin.Context) {\n // get session\n session, err := store.Get(c.Request, \"session\")\n if err != nil {\n c.JSON(http.StatusInternalServerError, gin.H{\"error\": err.Error()})\n\t\treturn\n }\n // check if authenticated\n if !(isAuthenticated(session)) {\n c.JSON(http.StatusUnauthorized, gin.H{\"error\": \"Access denied\"})\n\t\treturn\n }\n // get id and check that its valid\n id_param := c.Param(\"id\")\n id, err := primitive.ObjectIDFromHex(id_param)\n if err != nil {\n c.JSON(http.StatusBadRequest, gin.H{\"error\": \"Invalid id \" + id_param})\n\t\treturn\n }\n // find the matching group\n var group Group\n err = groups.FindOne(context.TODO(), bson.M{\"_id\": id}).Decode(&group)\n if err != nil {\n c.JSON(http.StatusNotFound, gin.H{\"error\": \"Group \" + id_param + \" not found\"})\n\t\treturn\n }\n // send response\n c.JSON(http.StatusOK, gin.H{\n \"_id\": id,\n \"createdby\": group.Createdby,\n \"creatorrole\": group.Creatorrole,\n \"name\": group.Name,\n \"about\": group.About,\n \"visibility\": group.Visibility,\n \"groupmembers\": group.Groupmembers,\n })\n}", "title": "" }, { "docid": "06df22f2e875f6a4522b21c3ce0df895", "score": "0.5630815", "text": "func updateGroupMembers(ctx context.Context, client MinioAdmin, group string, members []string, isRemove bool) error {\n\tgAddRemove := madmin.GroupAddRemove{\n\t\tGroup: group,\n\t\tMembers: members,\n\t\tIsRemove: isRemove,\n\t}\n\terr := client.updateGroupMembers(ctx, gAddRemove)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2a3557dddc6e2dbd3406486d681ab8a3", "score": "0.56274873", "text": "func (as *AutoScaling) UpdateAutoScalingGroup(asg *AutoScalingGroup) (resp *SimpleResp, err error) {\n\tparams := makeParams(\"UpdateAutoScalingGroup\")\n\n\tparams[\"AutoScalingGroupName\"] = asg.AutoScalingGroupName\n\tparams[\"MaxSize\"] = strconv.Itoa(asg.MaxSize)\n\tparams[\"MinSize\"] = strconv.Itoa(asg.MinSize)\n\tparams[\"DesiredCapacity\"] = strconv.Itoa(asg.DesiredCapacity)\n\n\tif asg.DefaultCooldown > 0 {\n\t\tparams[\"DefaultCooldown\"] = strconv.Itoa(asg.DefaultCooldown)\n\t}\n\tif asg.HealthCheckGracePeriod > 0 {\n\t\tparams[\"HealthCheckGracePeriod\"] = strconv.Itoa(asg.HealthCheckGracePeriod)\n\t}\n\tif asg.HealthCheckType != \"\" {\n\t\tparams[\"HealthCheckType\"] = asg.HealthCheckType\n\t}\n\tif asg.LaunchConfigurationName != \"\" {\n\t\tparams[\"LaunchConfigurationName\"] = asg.LaunchConfigurationName\n\t}\n\tif asg.PlacementGroup != \"\" {\n\t\tparams[\"PlacementGroup\"] = asg.PlacementGroup\n\t}\n\tif asg.VPCZoneIdentifier != \"\" {\n\t\tparams[\"VPCZoneIdentifier\"] = asg.VPCZoneIdentifier\n\t}\n\n\tif len(asg.AvailabilityZones) > 0 {\n\t\taddParamsList(params, \"AvailabilityZones.member\", asg.AvailabilityZones)\n\t}\n\tif len(asg.TerminationPolicies) > 0 {\n\t\taddParamsList(params, \"TerminationPolicies.member\", asg.TerminationPolicies)\n\t}\n\n\tresp = new(SimpleResp)\n\tif err := as.query(params, resp); err != nil {\n\t\treturn nil, err\n\t}\n\treturn resp, nil\n}", "title": "" }, { "docid": "22489e888f6a8c0be164ccebf93c2ba4", "score": "0.5625885", "text": "func (c *RPCClient) UpdateEndpointGroupAPI(params UpdateEndpointGroupParams) error {\n\treq := &RPCMessage{API: \"system_api\", Method: \"update_endpoint_group\", Params: params}\n\treturn c.Call(req, nil)\n}", "title": "" }, { "docid": "66e1d824122aedcbf8e33e33efe60ff3", "score": "0.5624131", "text": "func updateGroupListComplter() {\n\tqp := url.Values{}\n\tqp[\"maxResults\"] = []string{\"500\"}\n\tgrpList(qp)\n}", "title": "" }, { "docid": "effdc7e8e3d617ccd0e566cf800a9403", "score": "0.5597816", "text": "func (self *Group) PostUpdate() {\n self.Object.Call(\"postUpdate\")\n}", "title": "" }, { "docid": "bc1eaa4911ab7286146ec4a9190f1d16", "score": "0.5595298", "text": "func (h adminGroupPUTHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\t_, err := h.env.AdminFromSession(w, r)\n\n\tif err != nil {\n\t\tjsonErrorWithCodeText(w, http.StatusUnauthorized, errors.Trace(err))\n\t\treturn\n\t}\n\n\tgroup := struct {\n\t\tId int64 `json:\"id\"`\n\t\tName string `json:\"name\"`\n\t\tEmails []string `json:\"emails\"`\n\t}{}\n\n\terr = json.NewDecoder(r.Body).Decode(&group)\n\n\tif err != nil && err != io.EOF {\n\t\tjsonErrorWithCodeText(w, http.StatusInternalServerError, errors.Trace(err))\n\t\treturn\n\t}\n\n\t// TODO: finish this function\n\n\tjsonError(w, http.StatusServiceUnavailable, \"Unimplemented\", nil)\n}", "title": "" }, { "docid": "22bd55fe3445cc3cdeba96e3c07f795f", "score": "0.5585023", "text": "func (js JsonStorage) GroupGet(w http.ResponseWriter, r *http.Request, groupname string) {\n\tJRepo.uLock.RLock()\n\tdefer JRepo.uLock.RUnlock() \n\tif grp, ok := JRepo.js.Repogrp[groupname]; ok {\n\t\tbody, mok := json.Marshal(grp)\n\t\tif mok == nil {\n\t\t\tdata.ServerResponse(w, r, http.StatusOK, data.JSON_DATA, string(body))\n\t\t} else {\n\t\t\tdata.ServerResponse(w, r, http.StatusInternalServerError, data.STRING_DATA, http.StatusText(http.StatusInternalServerError))\n\t\t}\n\t} else {\n\t\tdata.ServerResponse(w, r, http.StatusNotFound, data.STRING_DATA, http.StatusText(http.StatusNotFound))\n\t}\n}", "title": "" }, { "docid": "71f591c3f25540b9803511a281daec03", "score": "0.5583155", "text": "func (vcd *TestVCD) test_GroupCRUD(check *C) {\n\tfmt.Printf(\"Running: %s\\n\", \"test_GroupCRUD\")\n\tadminOrg, err := vcd.client.GetAdminOrgByName(vcd.org.Org.Name)\n\tcheck.Assert(err, IsNil)\n\tcheck.Assert(adminOrg, NotNil)\n\n\ttype groupTestData struct {\n\t\tname string\n\t\tsecondName string\n\t\troleName string\n\t\tsecondRole string\n\t\tproviderType string\n\t}\n\tgroupData := []groupTestData{\n\t\t{\n\t\t\tname: \"ship_crew\",\n\t\t\tsecondName: \"admin_staff\",\n\t\t\troleName: OrgUserRoleOrganizationAdministrator,\n\t\t\tsecondRole: OrgUserRoleVappAuthor,\n\t\t\tproviderType: OrgUserProviderIntegrated,\n\t\t},\n\t\t{\n\t\t\tname: \"admin_staff\",\n\t\t\tsecondName: \"ship_crew\",\n\t\t\troleName: OrgUserRoleVappAuthor,\n\t\t\tsecondRole: OrgUserRoleVappUser,\n\t\t\tproviderType: OrgUserProviderIntegrated,\n\t\t},\n\t\t// SAML must be configured in vCD Org to make providerType=OrgUserProviderSAML tests work\n\t\t// {\n\t\t// \tname: \"test_group_vapp_user\",\n\t\t// \troleName: OrgUserRoleVappUser,\n\t\t// \tsecondRole: OrgUserRoleConsoleAccessOnly,\n\t\t// \tproviderType: OrgUserProviderSAML,\n\t\t// },\n\t\t// {\n\t\t// \tname: \"test_group_console_access\",\n\t\t// \troleName: OrgUserRoleConsoleAccessOnly,\n\t\t// \tsecondRole: OrgUserRoleCatalogAuthor,\n\t\t// \tproviderType: OrgUserProviderSAML,\n\t\t// },\n\t\t// {\n\t\t// \tname: \"test_group_catalog_author\",\n\t\t// \troleName: OrgUserRoleCatalogAuthor,\n\t\t// \tsecondRole: OrgUserRoleOrganizationAdministrator,\n\t\t// \tproviderType: OrgUserProviderSAML,\n\t\t// },\n\t\t// {\n\t\t// \tname: \"test_group_defered_to_identity_provider\",\n\t\t// \troleName: OrgUserRoleDeferToIdentityProvider,\n\t\t// \tsecondRole: OrgUserRoleOrganizationAdministrator,\n\t\t// \tproviderType: OrgUserProviderSAML,\n\t\t// },\n\t}\n\n\tfor _, gd := range groupData {\n\n\t\trole, err := adminOrg.GetRoleReference(gd.roleName)\n\t\tcheck.Assert(err, IsNil)\n\n\t\tgroupDefinition := types.Group{\n\t\t\tName: gd.name,\n\t\t\tRole: role,\n\t\t\tProviderType: gd.providerType,\n\t\t}\n\n\t\tnewGroup := NewGroup(adminOrg.client, adminOrg)\n\t\tnewGroup.Group = &groupDefinition\n\t\tif testVerbose {\n\t\t\tfmt.Printf(\"# creating '%s' group '%s' with role '%s'\\n\", gd.providerType, gd.name, gd.roleName)\n\t\t}\n\t\tcreatedGroup, err := adminOrg.CreateGroup(newGroup.Group)\n\t\tcheck.Assert(err, IsNil)\n\t\tAddToCleanupList(gd.name, \"group\", newGroup.AdminOrg.AdminOrg.Name, \"test_GroupCRUD\")\n\n\t\tfoundGroup, err := adminOrg.GetGroupByName(gd.name, true)\n\t\tcheck.Assert(err, IsNil)\n\n\t\tcheck.Assert(foundGroup.Group.Href, Equals, createdGroup.Group.Href)\n\t\tcheck.Assert(foundGroup.Group.Name, Equals, createdGroup.Group.Name)\n\n\t\t// Setup for update\n\t\tsecondRole, err := adminOrg.GetRoleReference(gd.secondRole)\n\t\tcheck.Assert(err, IsNil)\n\t\tcreatedGroup.Group.Role = secondRole\n\n\t\tif testVerbose {\n\t\t\tfmt.Printf(\"# updating '%s' group '%s' to role '%s'\\n\", gd.providerType, gd.name, gd.secondRole)\n\t\t}\n\t\terr = createdGroup.Update()\n\t\tcheck.Assert(err, IsNil)\n\n\t\tfoundGroup2, err := adminOrg.GetGroupByName(gd.name, true)\n\t\tcheck.Assert(err, IsNil)\n\t\tcheck.Assert(foundGroup2.Group.Href, Equals, createdGroup.Group.Href)\n\t\tcheck.Assert(foundGroup2.Group.Name, Equals, createdGroup.Group.Name)\n\n\t\tif testVerbose {\n\t\t\tfmt.Printf(\"# removing '%s' group '%s'\\n\", gd.providerType, gd.name)\n\t\t}\n\t\terr = createdGroup.Delete()\n\t\tcheck.Assert(err, IsNil)\n\t}\n}", "title": "" }, { "docid": "f6b57b250aab3649c9d1bc6aacf6fc93", "score": "0.5571014", "text": "func (ghandler *GroupHandler) JoinGroup( response http.ResponseWriter , request *http.Request ){\n\tresponse.Header().Set(\"Content-Type\" , \"application/json\")\n\tlang := GetSetLang(ghandler , response , request )\n\tres := struct{\n\t\tSuccess bool `json:\"success\"`\n\t\tMessage string `json:\"message\"`\n\t\tGroupID string `json:\"group_id\"`\n\t}{\n\t\tSuccess: false ,\n\t\tMessage: translation.Translate(lang , \"Invalid Input ...\"),\n\t}\n\tgroupid := request.FormValue(\"group_id\")\n\tif groupid == \"\" {\n\t\tresponse.Write(Helper.MarshalThis(res))\n\t\treturn \n\t}\n\tsession := ghandler.Session.GetSession(request)\n\tif session== nil {\n\t\tres.Message=translation.Translate(lang , \" UnAuthorized User \")\n\t\tresponse.Write(Helper.MarshalThis(res))\n\t\treturn\n\t}\n\tres.GroupID= groupid\n\tgroup := ghandler.GroupSer.GetGroupByID(groupid)\n\tuser := ghandler.UserSer.GetUserByEmailAndID(session.Email , session.UserID)\n\tif user == nil {\n\t\tres.Message=translation.Translate(lang , \" UnAuthorized User \") \n\t\tghandler.Session.DeleteSession(response , request)\n\t\tresponse.Write(Helper.MarshalThis(res))\n\t\treturn\n\t}\n\tif group==nil {\n\t\tres.Message=translation.Translate(lang , \" No Group IS Registered By this ID \") + groupid\n\t\tresponse.Write(Helper.MarshalThis(res))\n\t\treturn\n\t}\n\tmembers := group.MembersID\n\tfor _ , id := range members {\n\t\tif id == session.UserID {\n\t\t\tres.Message=translation.Translate(lang , \" You Are Already A member \")\n\t\t\tresponse.Write(Helper.MarshalThis(res))\n\t\t\treturn\n\t\t}\n\t}\n\tgroup.MembersID= append(group.MembersID, session.UserID)\n\tgroup.MembersCount++\n\t\n\tgroup = ghandler.GroupSer.UpdateGroup(group)\n\tuser.MyGroups = append(user.MyGroups, group.ID)\n\tuser = ghandler.UserSer.SaveUser(user)\n\tif group == nil || user==nil {\n\t\t// fmt.Println(\"While Saving the Group \" )\n\t\tresponse.WriteHeader(http.StatusInternalServerError)\n\t\tres.Message=translation.Translate(lang , \" Internal Server Error \")\n\t\tresponse.Write(Helper.MarshalThis(res))\n\t\treturn\n\t}\n\tresponse.WriteHeader(http.StatusOK)\n\tres.Success = true\n\tres.Message= translation.Translate(lang , \" You Joined Group : \") +group.GroupName + translation.Translate(lang , \" Succesfully !\") \n\tresponse.Write(Helper.MarshalThis(res))\n}", "title": "" }, { "docid": "b56b492a1c4b8b178a90ebf86942e10e", "score": "0.5564965", "text": "func (m *MockGroupsClientAPI) Update(arg0 context.Context, arg1 string, arg2 resources.GroupPatchable) (resources.Group, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"Update\", arg0, arg1, arg2)\n\tret0, _ := ret[0].(resources.Group)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "3fe3d0e3a276aaf1c3374a2aaa0b5661", "score": "0.5563228", "text": "func (client *SyncGroupsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, parameters SyncGroup, options *SyncGroupsBeginUpdateOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif serverName == \"\" {\n\t\treturn nil, errors.New(\"parameter serverName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{serverName}\", url.PathEscape(serverName))\n\tif databaseName == \"\" {\n\t\treturn nil, errors.New(\"parameter databaseName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{databaseName}\", url.PathEscape(databaseName))\n\tif syncGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter syncGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{syncGroupName}\", url.PathEscape(syncGroupName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2020-11-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, runtime.MarshalAsJSON(req, parameters)\n}", "title": "" } ]
9c846ab9550031514ee6dee5328d5dfd
WithEntitlementClazz adds the entitlementClazz to the public get user entitlement ownership by item id params
[ { "docid": "1fc862ff62a5fd307db01fde40188be8", "score": "0.74010605", "text": "func (o *PublicGetUserEntitlementOwnershipByItemIDParams) WithEntitlementClazz(entitlementClazz *string) *PublicGetUserEntitlementOwnershipByItemIDParams {\n\to.SetEntitlementClazz(entitlementClazz)\n\treturn o\n}", "title": "" } ]
[ { "docid": "b3aa4f269c89fc9b482065b748e7b3be", "score": "0.64204407", "text": "func (o *PublicGetUserEntitlementOwnershipByItemIDParams) SetEntitlementClazz(entitlementClazz *string) {\n\to.EntitlementClazz = entitlementClazz\n}", "title": "" }, { "docid": "bbffa40cfe050f25a5fe16824057e388", "score": "0.5402575", "text": "func (o *PublicGetUserEntitlementOwnershipByItemIDParams) WithHTTPClient(client *http.Client) *PublicGetUserEntitlementOwnershipByItemIDParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "54afeb0608954dd8ae2eea7d5a1dd884", "score": "0.53813183", "text": "func (o *PublicGetUserEntitlementOwnershipByItemIDParams) WithUserID(userID string) *PublicGetUserEntitlementOwnershipByItemIDParams {\n\to.SetUserID(userID)\n\treturn o\n}", "title": "" }, { "docid": "e3fa8ac30f95b8a9f31b3107ac9969be", "score": "0.5351498", "text": "func (o *PublicGetUserEntitlementOwnershipByItemIDParams) WithContext(ctx context.Context) *PublicGetUserEntitlementOwnershipByItemIDParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "9b02a39b9dc3edc4e845862543caac3f", "score": "0.5299992", "text": "func (o *PublicGetUserEntitlementOwnershipByItemIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param namespace\n\tif err := r.SetPathParam(\"namespace\", o.Namespace); err != nil {\n\t\treturn err\n\t}\n\n\t// path param userId\n\tif err := r.SetPathParam(\"userId\", o.UserID); err != nil {\n\t\treturn err\n\t}\n\n\tif o.EntitlementClazz != nil {\n\n\t\t// query param entitlementClazz\n\t\tvar qrEntitlementClazz string\n\t\tif o.EntitlementClazz != nil {\n\t\t\tqrEntitlementClazz = *o.EntitlementClazz\n\t\t}\n\t\tqEntitlementClazz := qrEntitlementClazz\n\t\tif qEntitlementClazz != \"\" {\n\t\t\tif err := r.SetQueryParam(\"entitlementClazz\", qEntitlementClazz); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// query param itemId\n\tqrItemID := o.ItemID\n\tqItemID := qrItemID\n\tif qItemID != \"\" {\n\t\tif err := r.SetQueryParam(\"itemId\", qItemID); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// setting the default header value\n\tif err := r.SetHeaderParam(\"User-Agent\", utils.UserAgentGen()); err != nil {\n\t\treturn err\n\t}\n\n\tif err := r.SetHeaderParam(\"X-Amzn-Trace-Id\", utils.AmazonTraceIDGen()); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "d1a5623153507d428622bd5bc8223523", "score": "0.5086369", "text": "func NewPublicGetUserEntitlementOwnershipByItemIDParamsWithHTTPClient(client *http.Client) *PublicGetUserEntitlementOwnershipByItemIDParams {\n\tvar ()\n\treturn &PublicGetUserEntitlementOwnershipByItemIDParams{\n\t\tHTTPClient: client,\n\t}\n}", "title": "" }, { "docid": "42da504037a6821a233917b46668dbc8", "score": "0.4944062", "text": "func (o *PublicGetUserEntitlementOwnershipByItemIDParams) WithTimeout(timeout time.Duration) *PublicGetUserEntitlementOwnershipByItemIDParams {\n\to.SetTimeout(timeout)\n\treturn o\n}", "title": "" }, { "docid": "d9a9f7f7807607afc4425176795556ec", "score": "0.48232597", "text": "func NewPublicGetUserEntitlementOwnershipByItemIDParams() *PublicGetUserEntitlementOwnershipByItemIDParams {\n\tvar ()\n\treturn &PublicGetUserEntitlementOwnershipByItemIDParams{\n\n\t\ttimeout: cr.DefaultTimeout,\n\t}\n}", "title": "" }, { "docid": "193bc24ae0865858d9b5be3574bf175a", "score": "0.47548473", "text": "func GetEntitlement(ctx context.Context, entitlementEndpoint string, entitlementResource EntitlementResource, userAccesToken string) (string, error) {\n\tb, err := json.Marshal(entitlementResource)\n\tif err != nil {\n\t\tlog.Error(ctx, map[string]interface{}{\n\t\t\t\"entitlement_resource\": entitlementResource,\n\t\t\t\"err\": err.Error(),\n\t\t}, \"Unable to marshal keyclaok entitlement resource struct\")\n\t\treturn \"\", errors.NewInternalError(\"Unable to marshal keyclaok entitlement resource struct \" + err.Error())\n\t}\n\n\treq, err := http.NewRequest(\"POST\", entitlementEndpoint, strings.NewReader(string(b)))\n\tif err != nil {\n\t\tlog.Error(ctx, map[string]interface{}{\n\t\t\t\"err\": err.Error(),\n\t\t}, \"Unable to crete http request\")\n\t\treturn \"\", errors.NewInternalError(\"unable to crete http request \" + err.Error())\n\t}\n\treq.Header.Add(\"Content-Type\", \"application/json\")\n\treq.Header.Add(\"Authorization\", \"Bearer \"+userAccesToken)\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tlog.Error(ctx, map[string]interface{}{\n\t\t\t\"entitlement_resource\": entitlementResource,\n\t\t\t\"err\": err.Error(),\n\t\t}, \"Unable to obtain entitlement resource\")\n\t\treturn \"\", errors.NewInternalError(\"unable to obtain entitlement resource \" + err.Error())\n\t}\n\tswitch res.StatusCode {\n\tcase http.StatusOK:\n\t\t// OK\n\tcase http.StatusForbidden:\n\t\treturn \"\", errors.NewUnauthorizedError(\"not authorized\")\n\tdefault:\n\t\tlog.Error(ctx, map[string]interface{}{\n\t\t\t\"entitlement_resource\": entitlementResource,\n\t\t\t\"response_status\": res.Status,\n\t\t\t\"response_body\": rest.ReadBody(res.Body),\n\t\t}, \"Unable to update the Keycloak permission\")\n\t\treturn \"\", errors.NewInternalError(\"unable to obtain entitlement resource. Response status: \" + res.Status + \". Responce body: \" + rest.ReadBody(res.Body))\n\t}\n\tjsonString := rest.ReadBody(res.Body)\n\n\tvar r entitlementResult\n\terr = json.Unmarshal([]byte(jsonString), &r)\n\tif err != nil {\n\t\tlog.Error(ctx, map[string]interface{}{\n\t\t\t\"entitlement_resource\": entitlementResource,\n\t\t\t\"json_string\": jsonString,\n\t\t}, \"Unable to unmarshal json with the obtain entitlement request result\")\n\t\treturn \"\", errors.NewInternalError(fmt.Sprintf(\"error when unmarshal json with the obtain entitlement request result %s \", jsonString) + err.Error())\n\t}\n\n\treturn r.Rpt, nil\n}", "title": "" }, { "docid": "7daa3f65a9bc16ee584330b8ea14c4f7", "score": "0.46601784", "text": "func (aaa *EntitlementService) PublicGetUserEntitlementOwnershipByItemIds(input *entitlement.PublicGetUserEntitlementOwnershipByItemIdsParams) ([]*platformclientmodels.EntitlementOwnership, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, err := aaa.Client.Entitlement.PublicGetUserEntitlementOwnershipByItemIds(input, client.BearerToken(*token.AccessToken))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "title": "" }, { "docid": "ff657d7c79dadf7c52a31f5d1cf3d668", "score": "0.46539658", "text": "func (aaa *EntitlementService) QueryUserEntitlementsByAppType(input *entitlement.QueryUserEntitlementsByAppTypeParams) (*platformclientmodels.AppEntitlementPagingSlicedResult, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, err := aaa.Client.Entitlement.QueryUserEntitlementsByAppType(input, client.BearerToken(*token.AccessToken))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "title": "" }, { "docid": "bbf6b8e82d8a8257d6491ba08cc03c63", "score": "0.464915", "text": "func (aaa *EntitlementService) GetUserEntitlementOwnershipByItemIds(input *entitlement.GetUserEntitlementOwnershipByItemIdsParams) ([]*platformclientmodels.EntitlementOwnership, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, err := aaa.Client.Entitlement.GetUserEntitlementOwnershipByItemIds(input, client.BearerToken(*token.AccessToken))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "title": "" }, { "docid": "bfac03be5219ee5c5f4760ce16202888", "score": "0.4630951", "text": "func NewPublicGetUserEntitlementOwnershipByItemIDParamsWithTimeout(timeout time.Duration) *PublicGetUserEntitlementOwnershipByItemIDParams {\n\tvar ()\n\treturn &PublicGetUserEntitlementOwnershipByItemIDParams{\n\n\t\ttimeout: timeout,\n\t}\n}", "title": "" }, { "docid": "27ec4060fdb9a4311a850d45a528b9af", "score": "0.45945317", "text": "func (aaa *EntitlementService) PublicGetMyEntitlementOwnershipByItemID(input *entitlement.PublicGetMyEntitlementOwnershipByItemIDParams) (*platformclientmodels.TimedOwnership, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, err := aaa.Client.Entitlement.PublicGetMyEntitlementOwnershipByItemID(input, client.BearerToken(*token.AccessToken))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "title": "" }, { "docid": "958702fc01f9162e34873bb29c4f4565", "score": "0.45894557", "text": "func (aaa *EntitlementService) GetUserEntitlementOwnershipByItemID(input *entitlement.GetUserEntitlementOwnershipByItemIDParams) (*platformclientmodels.TimedOwnership, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, err := aaa.Client.Entitlement.GetUserEntitlementOwnershipByItemID(input, client.BearerToken(*token.AccessToken))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "title": "" }, { "docid": "4a287d1ca787248c274e22003cc5dbbe", "score": "0.45783523", "text": "func (aaa *EntitlementService) PublicGetUserEntitlementOwnershipByItemID(input *entitlement.PublicGetUserEntitlementOwnershipByItemIDParams) (*platformclientmodels.TimedOwnership, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, err := aaa.Client.Entitlement.PublicGetUserEntitlementOwnershipByItemID(input, client.BearerToken(*token.AccessToken))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "title": "" }, { "docid": "6932dd5e255f5d818712971f52a35de9", "score": "0.45620045", "text": "func (aaa *EntitlementService) GetUserEntitlementByItemID(input *entitlement.GetUserEntitlementByItemIDParams) (*platformclientmodels.EntitlementInfo, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, notFound, err := aaa.Client.Entitlement.GetUserEntitlementByItemID(input, client.BearerToken(*token.AccessToken))\n\tif notFound != nil {\n\t\treturn nil, notFound\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "title": "" }, { "docid": "4cdd6a307131f6017cbec748743e456f", "score": "0.45580345", "text": "func (o *PublicGetUserEntitlementOwnershipByItemIDParams) WithNamespace(namespace string) *PublicGetUserEntitlementOwnershipByItemIDParams {\n\to.SetNamespace(namespace)\n\treturn o\n}", "title": "" }, { "docid": "c33bbcf0cbc4c4077289aa83f025947d", "score": "0.45517623", "text": "func (aaa *EntitlementService) GetUserEntitlement(input *entitlement.GetUserEntitlementParams) (*platformclientmodels.EntitlementInfo, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, notFound, err := aaa.Client.Entitlement.GetUserEntitlement(input, client.BearerToken(*token.AccessToken))\n\tif notFound != nil {\n\t\treturn nil, notFound\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "title": "" }, { "docid": "d9f82f9630bb70083b665fffc45306e1", "score": "0.452487", "text": "func (o *PublicGetUserEntitlementOwnershipByItemIDParams) WithItemID(itemID string) *PublicGetUserEntitlementOwnershipByItemIDParams {\n\to.SetItemID(itemID)\n\treturn o\n}", "title": "" }, { "docid": "29f31d39d672df310c378c51b6121b6a", "score": "0.44467112", "text": "func (aaa *EntitlementService) PublicGetUserEntitlementByItemID(input *entitlement.PublicGetUserEntitlementByItemIDParams) (*platformclientmodels.EntitlementInfo, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, notFound, err := aaa.Client.Entitlement.PublicGetUserEntitlementByItemID(input, client.BearerToken(*token.AccessToken))\n\tif notFound != nil {\n\t\treturn nil, notFound\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "title": "" }, { "docid": "288508021e51afc23cbe1e211f24ba96", "score": "0.44437742", "text": "func (m *UsersEducationUserItemRequestBuilder) Get(ctx context.Context, requestConfiguration *UsersEducationUserItemRequestBuilderGetRequestConfiguration)(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.EducationUserable, error) {\n requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return nil, err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n }\n res, err := m.requestAdapter.Send(ctx, requestInfo, iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.CreateEducationUserFromDiscriminatorValue, errorMapping)\n if err != nil {\n return nil, err\n }\n if res == nil {\n return nil, nil\n }\n return res.(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.EducationUserable), nil\n}", "title": "" }, { "docid": "4cc6310a55115ce91ff0d57719bbf2c5", "score": "0.44003156", "text": "func (m *UsersEducationUserItemRequestBuilder) Get(ctx context.Context, requestConfiguration *UsersEducationUserItemRequestBuilderGetRequestConfiguration)(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.EducationUserable, error) {\n requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return nil, err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n }\n res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.CreateEducationUserFromDiscriminatorValue, errorMapping)\n if err != nil {\n return nil, err\n }\n if res == nil {\n return nil, nil\n }\n return res.(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.EducationUserable), nil\n}", "title": "" }, { "docid": "425f69898788e04ea50bfafdf8e8276e", "score": "0.43939614", "text": "func (aaa *EntitlementService) PublicQueryUserEntitlementsByAppType(input *entitlement.PublicQueryUserEntitlementsByAppTypeParams) (*platformclientmodels.AppEntitlementPagingSlicedResult, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, err := aaa.Client.Entitlement.PublicQueryUserEntitlementsByAppType(input, client.BearerToken(*token.AccessToken))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "title": "" }, { "docid": "731345b6bf6d47b2ac35de7ab1f6bd22", "score": "0.43813044", "text": "func (a *EducationClassApiService) AddUserToClass(ctx context.Context, classId string) ApiAddUserToClassRequest {\n\treturn ApiAddUserToClassRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t\tclassId: classId,\n\t}\n}", "title": "" }, { "docid": "9e9f75a3c16ac919f25c942a91d3e5e5", "score": "0.4303133", "text": "func (aaa *EntitlementService) PublicGetUserEntitlement(input *entitlement.PublicGetUserEntitlementParams) (*platformclientmodels.EntitlementInfo, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, notFound, err := aaa.Client.Entitlement.PublicGetUserEntitlement(input, client.BearerToken(*token.AccessToken))\n\tif notFound != nil {\n\t\treturn nil, notFound\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "title": "" }, { "docid": "f66981106489b5243dcdca0db0739040", "score": "0.4285313", "text": "func (m *ItemProfileCertificationsPersonCertificationItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemProfileCertificationsPersonCertificationItemRequestBuilderGetRequestConfiguration)(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PersonCertificationable, error) {\n requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return nil, err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreatePersonCertificationFromDiscriminatorValue, errorMapping)\n if err != nil {\n return nil, err\n }\n if res == nil {\n return nil, nil\n }\n return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PersonCertificationable), nil\n}", "title": "" }, { "docid": "9bcf006441d7f8ca51d3e576ea516016", "score": "0.42063007", "text": "func (aaa *EntitlementService) PublicGetMyAppEntitlementOwnershipByAppID(input *entitlement.PublicGetMyAppEntitlementOwnershipByAppIDParams) (*platformclientmodels.Ownership, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, err := aaa.Client.Entitlement.PublicGetMyAppEntitlementOwnershipByAppID(input, client.BearerToken(*token.AccessToken))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "title": "" }, { "docid": "50fd93c1e265f436cf1f144c235118e0", "score": "0.4151857", "text": "func (aaa *EntitlementService) PublicGetUserAppEntitlementOwnershipByAppID(input *entitlement.PublicGetUserAppEntitlementOwnershipByAppIDParams) (*platformclientmodels.Ownership, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, err := aaa.Client.Entitlement.PublicGetUserAppEntitlementOwnershipByAppID(input, client.BearerToken(*token.AccessToken))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "title": "" }, { "docid": "ad4bf45274927dd6292049050937622b", "score": "0.4101003", "text": "func (aaa *EntitlementService) PublicSellUserEntitlement(input *entitlement.PublicSellUserEntitlementParams) (*platformclientmodels.EntitlementSoldResult, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, notFound, conflict, err := aaa.Client.Entitlement.PublicSellUserEntitlement(input, client.BearerToken(*token.AccessToken))\n\tif notFound != nil {\n\t\treturn nil, notFound\n\t}\n\tif conflict != nil {\n\t\treturn nil, conflict\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "title": "" }, { "docid": "3c857d33bb8fc20fd64b4796da5b6306", "score": "0.40643337", "text": "func (aaa *EntitlementService) SellUserEntitlement(input *entitlement.SellUserEntitlementParams) (*platformclientmodels.EntitlementSoldResult, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, notFound, conflict, err := aaa.Client.Entitlement.SellUserEntitlement(input, client.BearerToken(*token.AccessToken))\n\tif notFound != nil {\n\t\treturn nil, notFound\n\t}\n\tif conflict != nil {\n\t\treturn nil, conflict\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "title": "" }, { "docid": "eb7acd602de30cce10c0d51cbea3d84a", "score": "0.4046998", "text": "func (aaa *EntitlementService) PublicGetUserAppEntitlementByAppID(input *entitlement.PublicGetUserAppEntitlementByAppIDParams) (*platformclientmodels.AppEntitlementInfo, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, notFound, err := aaa.Client.Entitlement.PublicGetUserAppEntitlementByAppID(input, client.BearerToken(*token.AccessToken))\n\tif notFound != nil {\n\t\treturn nil, notFound\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "title": "" }, { "docid": "941ee60da39deb4bd886c2206df44a48", "score": "0.4043138", "text": "func (aaa *EntitlementService) GetUserAppEntitlementOwnershipByAppID(input *entitlement.GetUserAppEntitlementOwnershipByAppIDParams) (*platformclientmodels.Ownership, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, err := aaa.Client.Entitlement.GetUserAppEntitlementOwnershipByAppID(input, client.BearerToken(*token.AccessToken))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "title": "" }, { "docid": "971313b0e9da39c71890a1dcc32cf679", "score": "0.40374804", "text": "func (m *EntitlementManagementAssignmentRequestsRequestBuilder) FilterByCurrentUserWithOn(on *string)(*EntitlementManagementAssignmentRequestsFilterByCurrentUserWithOnRequestBuilder) {\n return NewEntitlementManagementAssignmentRequestsFilterByCurrentUserWithOnRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter, on)\n}", "title": "" }, { "docid": "d63b80bc2b95dda69b656f05da37f70d", "score": "0.40312523", "text": "func (aaa *EntitlementService) PublicQueryUserEntitlements(input *entitlement.PublicQueryUserEntitlementsParams) (*platformclientmodels.EntitlementPagingSlicedResult, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, err := aaa.Client.Entitlement.PublicQueryUserEntitlements(input, client.BearerToken(*token.AccessToken))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "title": "" }, { "docid": "138bd5850eea78a17759b022bfa2809b", "score": "0.40206838", "text": "func (aaa *EntitlementService) GetUserAppEntitlementByAppID(input *entitlement.GetUserAppEntitlementByAppIDParams) (*platformclientmodels.AppEntitlementInfo, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, notFound, err := aaa.Client.Entitlement.GetUserAppEntitlementByAppID(input, client.BearerToken(*token.AccessToken))\n\tif notFound != nil {\n\t\treturn nil, notFound\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "title": "" }, { "docid": "5561460c83048f5c4b4be05c957805d5", "score": "0.40120274", "text": "func (aaa *EntitlementService) ExistsAnyUserActiveEntitlementByItemIds(input *entitlement.ExistsAnyUserActiveEntitlementByItemIdsParams) (*platformclientmodels.Ownership, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, err := aaa.Client.Entitlement.ExistsAnyUserActiveEntitlementByItemIds(input, client.BearerToken(*token.AccessToken))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "title": "" }, { "docid": "d06debcc007499cb5be6bcca44a9bb72", "score": "0.4010581", "text": "func (_Expertise *ExpertiseTransactorSession) AddAchievement(id string, category string) (*types.Transaction, error) {\n\treturn _Expertise.Contract.AddAchievement(&_Expertise.TransactOpts, id, category)\n}", "title": "" }, { "docid": "86511f1ed5f91424a68513d5a493e019", "score": "0.40027833", "text": "func (m *UserEntitlement) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateAccessLevel(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateDateCreated(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateExtensions(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateGroupAssignments(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateID(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateLastAccessedDate(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateProjectEntitlements(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateUser(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2c549a4e7826b0d81e17ec8295837535", "score": "0.40022773", "text": "func (aaa *EntitlementService) GrantUserEntitlement(input *entitlement.GrantUserEntitlementParams) ([]*platformclientmodels.StackableEntitlementInfo, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcreated, notFound, unprocessableEntity, err := aaa.Client.Entitlement.GrantUserEntitlement(input, client.BearerToken(*token.AccessToken))\n\tif notFound != nil {\n\t\treturn nil, notFound\n\t}\n\tif unprocessableEntity != nil {\n\t\treturn nil, unprocessableEntity\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn created.GetPayload(), nil\n}", "title": "" }, { "docid": "843d3403c8fb6f025c109aaa24dcdc2b", "score": "0.3990964", "text": "func (m *EntitlementManagementAccessPackageAssignmentPoliciesItemCustomExtensionHandlersCustomExtensionHandlerItemRequestBuilder) Get(ctx context.Context, requestConfiguration *EntitlementManagementAccessPackageAssignmentPoliciesItemCustomExtensionHandlersCustomExtensionHandlerItemRequestBuilderGetRequestConfiguration)(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CustomExtensionHandlerable, error) {\n requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return nil, err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateCustomExtensionHandlerFromDiscriminatorValue, errorMapping)\n if err != nil {\n return nil, err\n }\n if res == nil {\n return nil, nil\n }\n return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CustomExtensionHandlerable), nil\n}", "title": "" }, { "docid": "95e7da8396d5db9be88383fd5a0c7f3d", "score": "0.39879823", "text": "func (m *UsersEducationUserItemRequestBuilder) TaughtClassesById(id string)(*UsersItemTaughtClassesEducationClassItemRequestBuilder) {\n urlTplParams := make(map[string]string)\n for idx, item := range m.pathParameters {\n urlTplParams[idx] = item\n }\n if id != \"\" {\n urlTplParams[\"educationClass%2Did\"] = id\n }\n return NewUsersItemTaughtClassesEducationClassItemRequestBuilderInternal(urlTplParams, m.requestAdapter)\n}", "title": "" }, { "docid": "606aac827e79d5d3665ea6882483f53c", "score": "0.3978995", "text": "func (m *EntitlementManagementRequestBuilder) Get(ctx context.Context, requestConfiguration *EntitlementManagementRequestBuilderGetRequestConfiguration)(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.EntitlementManagementable, error) {\n requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return nil, err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateEntitlementManagementFromDiscriminatorValue, errorMapping)\n if err != nil {\n return nil, err\n }\n if res == nil {\n return nil, nil\n }\n return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.EntitlementManagementable), nil\n}", "title": "" }, { "docid": "3dc9ad830db21f976fe6bd63455d1a0b", "score": "0.39747053", "text": "func (o *System) SetEntitlementStatus(v string) {\n\to.EntitlementStatus = &v\n}", "title": "" }, { "docid": "859acaf6e8d7e81bdf617172ea257474", "score": "0.39595968", "text": "func (aaa *EntitlementService) GetUserActiveEntitlementsByItemIds(input *entitlement.GetUserActiveEntitlementsByItemIdsParams) ([]*platformclientmodels.EntitlementInfo, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, err := aaa.Client.Entitlement.GetUserActiveEntitlementsByItemIds(input, client.BearerToken(*token.AccessToken))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "title": "" }, { "docid": "4be852e826ddcce699a57286f3b88b11", "score": "0.39484406", "text": "func (aaa *EntitlementService) PublicGetMyEntitlementOwnershipBySku(input *entitlement.PublicGetMyEntitlementOwnershipBySkuParams) (*platformclientmodels.TimedOwnership, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, err := aaa.Client.Entitlement.PublicGetMyEntitlementOwnershipBySku(input, client.BearerToken(*token.AccessToken))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "title": "" }, { "docid": "4d8e1b8f5b3f94d2a11295df20ac5f05", "score": "0.39440554", "text": "func (_Expertise *ExpertiseSession) AddAchievement(id string, category string) (*types.Transaction, error) {\n\treturn _Expertise.Contract.AddAchievement(&_Expertise.TransactOpts, id, category)\n}", "title": "" }, { "docid": "f25b496f9b1c394cbf5742d16a583611", "score": "0.39401764", "text": "func (aaa *EntitlementService) PublicGetUserEntitlementBySku(input *entitlement.PublicGetUserEntitlementBySkuParams) (*platformclientmodels.EntitlementInfo, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, notFound, err := aaa.Client.Entitlement.PublicGetUserEntitlementBySku(input, client.BearerToken(*token.AccessToken))\n\tif notFound != nil {\n\t\treturn nil, notFound\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "title": "" }, { "docid": "23ea016c521c6eaf7373d8a26e04ca04", "score": "0.39163247", "text": "func (m *B2xUserFlowsB2xIdentityUserFlowItemRequestBuilder) Get(ctx context.Context, requestConfiguration *B2xUserFlowsB2xIdentityUserFlowItemRequestBuilderGetRequestConfiguration)(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.B2xIdentityUserFlowable, error) {\n requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return nil, err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n }\n res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.CreateB2xIdentityUserFlowFromDiscriminatorValue, errorMapping)\n if err != nil {\n return nil, err\n }\n if res == nil {\n return nil, nil\n }\n return res.(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.B2xIdentityUserFlowable), nil\n}", "title": "" }, { "docid": "9a0cbcec20c2e690d0c239c85b1b6902", "score": "0.3911874", "text": "func (aaa *EntitlementService) EnableUserEntitlement(input *entitlement.EnableUserEntitlementParams) (*platformclientmodels.EntitlementInfo, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, notFound, conflict, err := aaa.Client.Entitlement.EnableUserEntitlement(input, client.BearerToken(*token.AccessToken))\n\tif notFound != nil {\n\t\treturn nil, notFound\n\t}\n\tif conflict != nil {\n\t\treturn nil, conflict\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "title": "" }, { "docid": "45948a87ed73d160314c50f26d13b2e6", "score": "0.39068168", "text": "func (m *ServicePrincipalItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ServicePrincipalItemRequestBuilderGetRequestConfiguration)(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.ServicePrincipalable, error) {\n requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return nil, err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n }\n res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.CreateServicePrincipalFromDiscriminatorValue, errorMapping)\n if err != nil {\n return nil, err\n }\n if res == nil {\n return nil, nil\n }\n return res.(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.ServicePrincipalable), nil\n}", "title": "" }, { "docid": "9ad166f651b6cda4c451ccf2db81b515", "score": "0.38930005", "text": "func (m *RiskyUsersRiskyUserItemRequestBuilder) Get(ctx context.Context, requestConfiguration *RiskyUsersRiskyUserItemRequestBuilderGetRequestConfiguration)(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.RiskyUserable, error) {\n requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return nil, err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n }\n res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.CreateRiskyUserFromDiscriminatorValue, errorMapping)\n if err != nil {\n return nil, err\n }\n if res == nil {\n return nil, nil\n }\n return res.(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.RiskyUserable), nil\n}", "title": "" }, { "docid": "aea6931fd86619074c2186199c1ef1c9", "score": "0.3888788", "text": "func NewEntitlementManagementAccessPackageAssignmentPoliciesItemCustomExtensionHandlersCustomExtensionHandlerItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EntitlementManagementAccessPackageAssignmentPoliciesItemCustomExtensionHandlersCustomExtensionHandlerItemRequestBuilder) {\n urlParams := make(map[string]string)\n urlParams[\"request-raw-url\"] = rawUrl\n return NewEntitlementManagementAccessPackageAssignmentPoliciesItemCustomExtensionHandlersCustomExtensionHandlerItemRequestBuilderInternal(urlParams, requestAdapter)\n}", "title": "" }, { "docid": "b421ab1b007eb06ba13af280ea0a0dce", "score": "0.38642284", "text": "func tmplUserArg(tmplCtx *templates.Context) interface{} {\n\treturn func(v interface{}) (interface{}, error) {\n\t\tif tmplCtx.IncreaseCheckGenericAPICall() {\n\t\t\treturn nil, templates.ErrTooManyAPICalls\n\t\t}\n\n\t\tif num := templates.ToInt64(v); num != 0 {\n\t\t\t// Assume it's an id\n\t\t\tmember, _ := bot.GetMember(tmplCtx.GS.ID, num)\n\t\t\tif member != nil {\n\t\t\t\treturn &member.User, nil\n\t\t\t}\n\n\t\t\treturn nil, nil\n\t\t}\n\n\t\tif str, ok := v.(string); ok {\n\t\t\t// Mention string\n\t\t\tif len(str) < 5 {\n\t\t\t\treturn nil, nil\n\t\t\t}\n\n\t\t\tstr = strings.TrimSpace(str)\n\n\t\t\tif strings.HasPrefix(str, \"<@\") && strings.HasSuffix(str, \">\") {\n\t\t\t\ttrimmed := str[2 : len(str)-1]\n\t\t\t\tif trimmed[0] == '!' {\n\t\t\t\t\ttrimmed = trimmed[1:]\n\t\t\t\t}\n\n\t\t\t\tid, _ := strconv.ParseInt(trimmed, 10, 64)\n\t\t\t\tmember, _ := bot.GetMember(tmplCtx.GS.ID, id)\n\t\t\t\tif member != nil {\n\t\t\t\t\t// Found member\n\t\t\t\t\treturn &member.User, nil\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// No more cases we can handle\n\t\t\treturn nil, nil\n\t\t}\n\n\t\t// Just return whatever we passed\n\t\treturn v, nil\n\t}\n}", "title": "" }, { "docid": "7d087bac9778cd53d0d05bd89c80b284", "score": "0.38570973", "text": "func (m *ItemProfilePatentsRequestBuilder) ByItemPatentId(itemPatentId string)(*ItemProfilePatentsItemPatentItemRequestBuilder) {\n urlTplParams := make(map[string]string)\n for idx, item := range m.BaseRequestBuilder.PathParameters {\n urlTplParams[idx] = item\n }\n if itemPatentId != \"\" {\n urlTplParams[\"itemPatent%2Did\"] = itemPatentId\n }\n return NewItemProfilePatentsItemPatentItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter)\n}", "title": "" }, { "docid": "2ae0148554db68cffcc82c4e1abf5d88", "score": "0.38539347", "text": "func (aaa *EntitlementService) GetEntitlement(input *entitlement.GetEntitlementParams) (*platformclientmodels.EntitlementInfo, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, notFound, err := aaa.Client.Entitlement.GetEntitlement(input, client.BearerToken(*token.AccessToken))\n\tif notFound != nil {\n\t\treturn nil, notFound\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "title": "" }, { "docid": "d5917b09250163fbbf7068140835463a", "score": "0.38437012", "text": "func (m *InboundSharedUserProfilesInboundSharedUserProfileUserItemRequestBuilder) Get(ctx context.Context, requestConfiguration *InboundSharedUserProfilesInboundSharedUserProfileUserItemRequestBuilderGetRequestConfiguration)(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.InboundSharedUserProfileable, error) {\n requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return nil, err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateInboundSharedUserProfileFromDiscriminatorValue, errorMapping)\n if err != nil {\n return nil, err\n }\n if res == nil {\n return nil, nil\n }\n return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.InboundSharedUserProfileable), nil\n}", "title": "" }, { "docid": "5c0aa3317efd2fd6de6396c84a574abd", "score": "0.38401774", "text": "func (p *TUserAccountServiceClient) GetUserAccountByUidAndType(ctx context.Context, uid int64, appid TAppId, currencyType TCurrencyType) (r *TUserAccount, err error) {\n var _args51 TUserAccountServiceGetUserAccountByUidAndTypeArgs\n _args51.UID = uid\n _args51.Appid = appid\n _args51.CurrencyType = currencyType\n var _result52 TUserAccountServiceGetUserAccountByUidAndTypeResult\n if err = p.c.Call(ctx, \"getUserAccountByUidAndType\", &_args51, &_result52); err != nil {\n return\n }\n return _result52.GetSuccess(), nil\n}", "title": "" }, { "docid": "9d4f28b161f72267a41e23733e9f2a7f", "score": "0.38312963", "text": "func (s *ConsentService) UserConsentsByUserID(languageAlpha2Code string, userID int64, headers map[string]string, log logger.Logger) (response models.OperationResponseOfPublicUserConsentsListModel, err error) {\n\tq := url.Values{}\n\tq.Add(\"languageAlpha2Code\", languageAlpha2Code)\n\tq.Add(\"userId\", fmt.Sprintf(\"%d\", userID))\n\terr = s.client.apiReq(http.MethodPost, \"/Consent/UserConsents\", &q, nil, &response, &headers, log)\n\treturn\n}", "title": "" }, { "docid": "55043bead57ec65e96cf0820c3409c73", "score": "0.3826098", "text": "func (aaa *EntitlementService) PublicGetUserEntitlementOwnershipBySku(input *entitlement.PublicGetUserEntitlementOwnershipBySkuParams) (*platformclientmodels.TimedOwnership, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, err := aaa.Client.Entitlement.PublicGetUserEntitlementOwnershipBySku(input, client.BearerToken(*token.AccessToken))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "title": "" }, { "docid": "f36c6bed0939bf7428a971ecc0ce1897", "score": "0.38236216", "text": "func (r ApiGetIamUserGroupListRequest) At(at string) ApiGetIamUserGroupListRequest {\n\tr.at = &at\n\treturn r\n}", "title": "" }, { "docid": "cf6f2fa3e9c8eabe30e8947d591d5897", "score": "0.38168085", "text": "func (aaa *EntitlementService) PublicConsumeUserEntitlement(input *entitlement.PublicConsumeUserEntitlementParams) (*platformclientmodels.EntitlementDecrementResult, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, badRequest, notFound, conflict, err := aaa.Client.Entitlement.PublicConsumeUserEntitlement(input, client.BearerToken(*token.AccessToken))\n\tif badRequest != nil {\n\t\treturn nil, badRequest\n\t}\n\tif notFound != nil {\n\t\treturn nil, notFound\n\t}\n\tif conflict != nil {\n\t\treturn nil, conflict\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "title": "" }, { "docid": "067e7b0727f866697279a64736307b6a", "score": "0.38136238", "text": "func (_Expertise *ExpertiseTransactor) AddAchievement(opts *bind.TransactOpts, id string, category string) (*types.Transaction, error) {\n\treturn _Expertise.contract.Transact(opts, \"addAchievement\", id, category)\n}", "title": "" }, { "docid": "793e86241f981864c8d02974ed103c90", "score": "0.37980855", "text": "func (m *ItemApprovalsRequestBuilder) FilterByCurrentUserWithOn(on *string)(*ItemApprovalsFilterByCurrentUserWithOnRequestBuilder) {\n return NewItemApprovalsFilterByCurrentUserWithOnRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter, on)\n}", "title": "" }, { "docid": "f2408a317b77384e3452bdedb725a60c", "score": "0.37856162", "text": "func (aaa *EntitlementService) GetUserEntitlementBySku(input *entitlement.GetUserEntitlementBySkuParams) (*platformclientmodels.EntitlementInfo, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, notFound, err := aaa.Client.Entitlement.GetUserEntitlementBySku(input, client.BearerToken(*token.AccessToken))\n\tif notFound != nil {\n\t\treturn nil, notFound\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "title": "" }, { "docid": "208ec99f9b4f84bf5d8152d604c51566", "score": "0.37676325", "text": "func (p *TCurrencyServiceClient) GetChannelAccountByUidAndType(ctx context.Context, uid int64, sid int64, appid TAppId, currencyType TCurrencyType) (r *TChannelAccount, err error) {\n var _args20 TCurrencyServiceGetChannelAccountByUidAndTypeArgs\n _args20.UID = uid\n _args20.Sid = sid\n _args20.Appid = appid\n _args20.CurrencyType = currencyType\n var _result21 TCurrencyServiceGetChannelAccountByUidAndTypeResult\n if err = p.c.Call(ctx, \"getChannelAccountByUidAndType\", &_args20, &_result21); err != nil {\n return\n }\n return _result21.GetSuccess(), nil\n}", "title": "" }, { "docid": "a4da2ae8c435c739236afa7f990c9501", "score": "0.3767141", "text": "func WithUser(ctx context.Context, id, email string) context.Context {\n\treturn context.WithValue(ctx, userKey, entity.User{ID: id, Email: email})\n}", "title": "" }, { "docid": "30c2cd8b81c635002c5fa5ccaf9b48cf", "score": "0.37670386", "text": "func (m *ItemAppConsentRequestsForApprovalItemUserConsentRequestsUserConsentRequestItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemAppConsentRequestsForApprovalItemUserConsentRequestsUserConsentRequestItemRequestBuilderGetRequestConfiguration)(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.UserConsentRequestable, error) {\n requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return nil, err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateUserConsentRequestFromDiscriminatorValue, errorMapping)\n if err != nil {\n return nil, err\n }\n if res == nil {\n return nil, nil\n }\n return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.UserConsentRequestable), nil\n}", "title": "" }, { "docid": "a37d6149d486620b5a3ce4ce89e3f027", "score": "0.37639815", "text": "func GetUser(w http.ResponseWriter, r *http.Request) {\n\tpattern, _ := regexp.Compile(`/users/(\\d+)`)\n\tmatches := pattern.FindStringSubmatch(r.URL.Path)\n\n\tif len(matches) > 0 {\n\t\tids, _ := strconv.Atoi(matches[1])\n\t\tid := uint(ids)\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\taccouunt, err := models.GetUser(id)\n\t\tif err != nil {\n\t\t\tw.Write([]byte(err.Error()))\n\t\t} else {\n\t\t\tresponse, _ := json.Marshal(accouunt)\n\t\t\tw.Write(response)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d75b16ff969676bce53b91bb0d5ac087", "score": "0.3759613", "text": "func (aaa *EntitlementService) QueryUserEntitlements(input *entitlement.QueryUserEntitlementsParams) (*platformclientmodels.EntitlementPagingSlicedResult, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, err := aaa.Client.Entitlement.QueryUserEntitlements(input, client.BearerToken(*token.AccessToken))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "title": "" }, { "docid": "dcc6948d9ba832b28247b99486520dc7", "score": "0.375781", "text": "func (s *SmartContract) enrollUser(APIstub shim.ChaincodeStubInterface, args []string) pb.Response {\n\tif len(args) != 2 {\n\t\treturn shim.Error(\"Incorrect number of arguments. Expecting 2\")\n\t}\n\n\tfor _, value := range userList {\n\t\tif value.userID == args[0]{\n\t\t\treturn shim.Error(\"userID already exits\")\n\t\t}\n\t}\n\n\tvar user = User{userID: args[0], userKey: args[1], Token: \"0\"}\n\n\tuserList = append(userList, user)\n\n\treturn shim.Success(nil)\n}", "title": "" }, { "docid": "18e885e5b0ac56182306e5be6d460607", "score": "0.3756125", "text": "func (a *UserLibraryApiService) GetItem(ctx _context.Context, userId string, itemId string) (BaseItemDto, *_nethttp.Response, error) {\n\tvar (\n\t\tlocalVarHTTPMethod = _nethttp.MethodGet\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarFormFileName string\n\t\tlocalVarFileName string\n\t\tlocalVarFileBytes []byte\n\t\tlocalVarReturnValue BaseItemDto\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/Users/{userId}/Items/{itemId}\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"userId\"+\"}\", _neturl.QueryEscape(parameterToString(userId, \"\")) , -1)\n\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"itemId\"+\"}\", _neturl.QueryEscape(parameterToString(itemId, \"\")) , -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := _neturl.Values{}\n\tlocalVarFormParams := _neturl.Values{}\n\n\t// to determine the Content-Type header\n\tlocalVarHTTPContentTypes := []string{}\n\n\t// set Content-Type header\n\tlocalVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)\n\tif localVarHTTPContentType != \"\" {\n\t\tlocalVarHeaderParams[\"Content-Type\"] = localVarHTTPContentType\n\t}\n\n\t// to determine the Accept header\n\tlocalVarHTTPHeaderAccepts := []string{\"application/json\", \"application/json; profile=CamelCase\", \"application/json; profile=PascalCase\"}\n\n\t// set Accept header\n\tlocalVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)\n\tif localVarHTTPHeaderAccept != \"\" {\n\t\tlocalVarHeaderParams[\"Accept\"] = localVarHTTPHeaderAccept\n\t}\n\tif ctx != nil {\n\t\t// API Key Authentication\n\t\tif auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {\n\t\t\tvar key string\n\t\t\tif auth.Prefix != \"\" {\n\t\t\t\tkey = auth.Prefix + \" \" + auth.Key\n\t\t\t} else {\n\t\t\t\tkey = auth.Key\n\t\t\t}\n\t\t\tlocalVarHeaderParams[\"X-Emby-Authorization\"] = key\n\t\t}\n\t}\n\tr, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, err\n\t}\n\n\tlocalVarHTTPResponse, err := a.client.callAPI(r)\n\tif err != nil || localVarHTTPResponse == nil {\n\t\treturn localVarReturnValue, localVarHTTPResponse, err\n\t}\n\n\tlocalVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)\n\tlocalVarHTTPResponse.Body.Close()\n\tif err != nil {\n\t\treturn localVarReturnValue, localVarHTTPResponse, err\n\t}\n\n\tif localVarHTTPResponse.StatusCode >= 300 {\n\t\tnewErr := GenericOpenAPIError{\n\t\t\tbody: localVarBody,\n\t\t\terror: localVarHTTPResponse.Status,\n\t\t}\n\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t}\n\n\terr = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\tif err != nil {\n\t\tnewErr := GenericOpenAPIError{\n\t\t\tbody: localVarBody,\n\t\t\terror: err.Error(),\n\t\t}\n\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t}\n\n\treturn localVarReturnValue, localVarHTTPResponse, nil\n}", "title": "" }, { "docid": "2d3511fa6cfa15679e1c4701692efdf5", "score": "0.3755957", "text": "func (m *ClassesEducationClassItemRequestBuilder) MembersById(id string)(*ClassesItemMembersEducationUserItemRequestBuilder) {\n urlTplParams := make(map[string]string)\n for idx, item := range m.pathParameters {\n urlTplParams[idx] = item\n }\n if id != \"\" {\n urlTplParams[\"educationUser%2Did\"] = id\n }\n return NewClassesItemMembersEducationUserItemRequestBuilderInternal(urlTplParams, m.requestAdapter)\n}", "title": "" }, { "docid": "49fb7c2c0f7ef753d3e587f7b7ff234d", "score": "0.37475842", "text": "func ApiClassItem(w http.ResponseWriter, r *http.Request) {\n\tvar cid int\n\tvar err error\n\n\tvar p pageErrorStr\n\tif cid, err = strconv.Atoi(r.FormValue(\"cid\")); err != nil || cid <= 0 {\n\t\tp.Error = \"invalid cid (classid) \" // Extra space for next if statement\n\t}\n\n\tvar yr int\n\tif yr, err = strconv.Atoi(r.FormValue(\"yrwk\")); err != nil || yr <= 0 {\n\t\tp.Error += \"invalid yearweek\"\n\t}\n\n\tif p.Error != \"\" {\n\t\twriteJSON(w, r, p)\n\t\treturn\n\t}\n\n\tls, err := lesson.FetchAll(cid, yr)\n\tif err != nil {\n\t\tp := pageErrorStr{\n\t\t\tError: \"cannot fetch class items\",\n\t\t}\n\t\twriteJSON(w, r, p)\n\t\treturn\n\t}\n\n\twriteJSON(w, r, ls)\n}", "title": "" }, { "docid": "b1573212f98ed9c3d00059d90dd33141", "score": "0.37414035", "text": "func NewEntitlementManagementAccessPackageCatalogsItemAccessPackageResourcesItemAccessPackageResourceScopesAccessPackageResourceScopeItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EntitlementManagementAccessPackageCatalogsItemAccessPackageResourcesItemAccessPackageResourceScopesAccessPackageResourceScopeItemRequestBuilder) {\n m := &EntitlementManagementAccessPackageCatalogsItemAccessPackageResourcesItemAccessPackageResourceScopesAccessPackageResourceScopeItemRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/identityGovernance/entitlementManagement/accessPackageCatalogs/{accessPackageCatalog%2Did}/accessPackageResources/{accessPackageResource%2Did}/accessPackageResourceScopes/{accessPackageResourceScope%2Did}{?%24select,%24expand}\", pathParameters),\n }\n return m\n}", "title": "" }, { "docid": "afb3d2a52e534085d2cd4d62b2647bb5", "score": "0.37388194", "text": "func (o AuthnsList) Append(objects ...elemental.Identifiable) elemental.Identifiables {\n\n\tout := append(AuthnsList{}, o...)\n\tfor _, obj := range objects {\n\t\tout = append(out, obj.(*Authn))\n\t}\n\n\treturn out\n}", "title": "" }, { "docid": "d5b9744f2119c5e5c54993ebfdbb1f57", "score": "0.37310186", "text": "func (r *EducationUserClassesCollectionRequest) Add(ctx context.Context, reqObj *EducationClass) (resObj *EducationClass, err error) {\n\terr = r.JSONRequest(ctx, \"POST\", \"\", reqObj, &resObj)\n\treturn\n}", "title": "" }, { "docid": "cd1b9e4a1ee0cf4c43b0f067114e16cf", "score": "0.3719994", "text": "func AppendUserIDToRequest(r *http.Request, uid string) {\n\tr.Header.Add(userHeader, uid)\n}", "title": "" }, { "docid": "0a89e914fd4f391ab6907ce66dc994e7", "score": "0.37181276", "text": "func (m *IdentityGovernance) SetEntitlementManagement(value EntitlementManagementable)() {\n m.entitlementManagement = value\n}", "title": "" }, { "docid": "8e9e012e84ea5ff8fb6bbcd075085e2b", "score": "0.37171656", "text": "func (o *PublicGetUserEntitlementOwnershipByItemIDParams) SetHTTPClient(client *http.Client) {\n\to.HTTPClient = client\n}", "title": "" }, { "docid": "c211b658dc2c893e8f8409065e4905f8", "score": "0.37064296", "text": "func NewEntitlementManagementAccessPackageResourcesItemAccessPackageResourceScopesItemAccessPackageResourceAccessPackageResourceRolesAccessPackageResourceRoleItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EntitlementManagementAccessPackageResourcesItemAccessPackageResourceScopesItemAccessPackageResourceAccessPackageResourceRolesAccessPackageResourceRoleItemRequestBuilder) {\n m := &EntitlementManagementAccessPackageResourcesItemAccessPackageResourceScopesItemAccessPackageResourceAccessPackageResourceRolesAccessPackageResourceRoleItemRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/identityGovernance/entitlementManagement/accessPackageResources/{accessPackageResource%2Did}/accessPackageResourceScopes/{accessPackageResourceScope%2Did}/accessPackageResource/accessPackageResourceRoles/{accessPackageResourceRole%2Did}{?%24select,%24expand}\", pathParameters),\n }\n return m\n}", "title": "" }, { "docid": "0f1e01c7b5a7f0af853df866f49c256f", "score": "0.36936945", "text": "func (m *EntitlementManagementAccessPackageResourcesItemAccessPackageResourceScopesItemAccessPackageResourceAccessPackageResourceRolesAccessPackageResourceRoleItemRequestBuilder) Get(ctx context.Context, requestConfiguration *EntitlementManagementAccessPackageResourcesItemAccessPackageResourceScopesItemAccessPackageResourceAccessPackageResourceRolesAccessPackageResourceRoleItemRequestBuilderGetRequestConfiguration)(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.AccessPackageResourceRoleable, error) {\n requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return nil, err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateAccessPackageResourceRoleFromDiscriminatorValue, errorMapping)\n if err != nil {\n return nil, err\n }\n if res == nil {\n return nil, nil\n }\n return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.AccessPackageResourceRoleable), nil\n}", "title": "" }, { "docid": "b799d815a5fd6e6e19cac2d4f7b34d16", "score": "0.36861217", "text": "func (aaa *EntitlementService) ConsumeUserEntitlement(input *entitlement.ConsumeUserEntitlementParams) (*platformclientmodels.EntitlementDecrementResult, error) {\n\ttoken, err := aaa.TokenRepository.GetToken()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tok, badRequest, notFound, conflict, err := aaa.Client.Entitlement.ConsumeUserEntitlement(input, client.BearerToken(*token.AccessToken))\n\tif badRequest != nil {\n\t\treturn nil, badRequest\n\t}\n\tif notFound != nil {\n\t\treturn nil, notFound\n\t}\n\tif conflict != nil {\n\t\treturn nil, conflict\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ok.GetPayload(), nil\n}", "title": "" }, { "docid": "81f7ce2fc3bcf33aba45f4992edf6895", "score": "0.36633748", "text": "func (o *GetImageVulnerabilitiesByTypeImageIDParams) WithContext(ctx context.Context) *GetImageVulnerabilitiesByTypeImageIDParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "21788b4f2abadf5c163a6fa72cb1c2fe", "score": "0.36626786", "text": "func (client *UserAssignedIdentitiesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *UserAssignedIdentitiesClientListByResourceGroupOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2023-01-31\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "title": "" }, { "docid": "c2a53cbccb01f0e9eb8093fa0313ccf0", "score": "0.36567992", "text": "func NewEntitlementManagement()(*EntitlementManagement) {\n m := &EntitlementManagement{\n Entity: *NewEntity(),\n }\n return m\n}", "title": "" }, { "docid": "779b419910e9f1dea260624cd4f6231d", "score": "0.36564764", "text": "func (h *Contract) AddMemberItinAct(w http.ResponseWriter, r *http.Request) {\n\tvar mTemp, mRel []string\n\n\trole := h.GetUserRole(r.Context())\n\tif role == \"admin\" {\n\t\th.SendUnAuthorizedData(w)\n\t\treturn\n\t}\n\n\t// Initial response handler\n\tvar res response.ItinMemberResponse\n\n\t// Binding request\n\treq := request.MemberItinReq{}\n\tif err := h.Bind(r, &req); err != nil {\n\t\th.SendBadRequest(w, err.Error())\n\t\treturn\n\t}\n\n\t// Validate request of struct request\n\tif err := h.Validator.Driver.Struct(req); err != nil {\n\t\th.SendRequestValidationError(w, err.(validator.ValidationErrors))\n\t\treturn\n\t}\n\n\t// Check request start date & end date\n\tif req.StartDate != \"\" && req.EndDate != \"\" {\n\t\tstartDate, err := time.Parse(\"2006-01-02 15:04:05\", req.StartDate)\n\t\tif err != nil {\n\t\t\th.SendBadRequest(w, err.Error())\n\t\t\treturn\n\t\t}\n\t\tendDate, err := time.Parse(\"2006-01-02 15:04:05\", req.EndDate)\n\t\tif err != nil {\n\t\t\th.SendBadRequest(w, err.Error())\n\t\t\treturn\n\t\t}\n\t\tif startDate.After(endDate) {\n\t\t\th.SendBadRequest(w, \"Start date should not be more end date\")\n\t\t\treturn\n\t\t}\n\t}\n\n\t// Check db context\n\tctx := context.Background()\n\tdb, err := h.DB.Acquire(ctx)\n\tif err != nil {\n\t\th.SendBadRequest(w, err.Error())\n\t\treturn\n\t}\n\tdefer db.Release()\n\n\t// Formatting request member itin\n\tmemberItinFormatted, err := req.ToMemberItinEnt(true)\n\tif err != nil {\n\t\th.SendBadRequest(w, err.Error())\n\t\treturn\n\t}\n\n\t// Model db transaction\n\tm := model.Contract{App: h.App}\n\ttx, err := db.Begin(ctx)\n\tif err != nil {\n\t\th.SendBadRequest(w, err.Error())\n\t\treturn\n\t}\n\n\t// Assign created by member code member id\n\tmemberCode := h.GetUserCode(r.Context())\n\tif req.MemberCode != \"\" {\n\t\tmemberCode = req.MemberCode\n\t}\n\tmemberOwner, _ := m.GetMemberByCode(db, ctx, memberCode)\n\tif memberOwner.ID == 0 {\n\t\th.SendNotfound(w, \"Member not found.\")\n\t\ttx.Rollback(ctx)\n\t\treturn\n\t}\n\tmemberItinFormatted.CreatedBy = memberOwner.ID\n\n\t// Create member itin\n\tmemberItinCreated, err := m.AddMemberItin(tx, ctx, memberItinFormatted)\n\tif err != nil {\n\t\th.SendBadRequest(w, psql.ParseErr(err))\n\t\ttx.Rollback(ctx)\n\t\treturn\n\t}\n\tmemberItinCreated.MemberEnt = memberOwner\n\tmemberOwnerID := memberOwner.ID\n\tactivityProcess := fmt.Sprintf(\"Add New Trip Itin %s\", memberItinCreated.Title)\n\n\t// Adjust user TC input member itin\n\tvar userTcID int32\n\tif role == \"tc\" {\n\t\t// Validation if tc create member itin for member\n\t\tif len(req.GroupChatCode) <= 0 {\n\t\t\th.SendBadRequest(w, \"Group chat code required\")\n\t\t\treturn\n\t\t}\n\n\t\t// Assign user TC ID\n\t\ttcCode := h.GetUserCode(r.Context())\n\t\tuserTc, _ := m.GetUserByCode(db, ctx, tcCode)\n\t\tif userTc.ID == 0 {\n\t\t\th.SendNotfound(w, \"User TC not found.\")\n\t\t\ttx.Rollback(ctx)\n\t\t\treturn\n\t\t}\n\t\tuserTcID = userTc.ID\n\n\t\t// Set acivity process if itin made by tc\n\t\tactivityProcess = fmt.Sprintf(\"Add New Trip Itin %s for %s\", memberItinCreated.Title, memberOwner.Name)\n\t}\n\n\t// Assign member itin to chat group\n\tvar chatGroupID int32\n\tif len(req.GroupChatCode) > 0 {\n\t\t// Validation chat group existing\n\t\tchatGroup, err := m.GetGroupChatByCode(db, ctx, req.GroupChatCode)\n\t\tif err != nil && chatGroup.ID <= 0 {\n\t\t\th.SendNotfound(w, fmt.Sprintf(\"Chat Group with code %s not found.\", req.GroupChatCode))\n\t\t\ttx.Rollback(ctx)\n\t\t\treturn\n\t\t}\n\t\tif chatGroup.MemberItin.ID > 0 {\n\t\t\th.SendNotfound(w, fmt.Sprintf(\"Itinerary on chat %s has been created\", chatGroup.Name))\n\t\t\ttx.Rollback(ctx)\n\t\t\treturn\n\t\t}\n\t\tchatGroupID = chatGroup.ID\n\t\terr = m.UpdateItinMemberToChat(ctx, tx, memberItinCreated.ID, userTcID, req.GroupChatCode)\n\t\tif err != nil {\n\t\t\th.SendBadRequest(w, err.Error())\n\t\t\ttx.Rollback(ctx)\n\t\t\treturn\n\t\t}\n\t\tmemberItinCreated.ChatGroupCode = req.GroupChatCode\n\t}\n\n\t// Assign member itin relation group member or assign member temporary\n\tvar memberItinGroups []map[string]interface{}\n\tmemberItinGroups = append(memberItinGroups, map[string]interface{}{\n\t\t\"member_code\": memberOwner.MemberCode,\n\t\t\"member_name\": memberOwner.Name,\n\t\t\"member_username\": memberOwner.Username,\n\t\t\"member_email\": memberOwner.Email,\n\t\t\"member_img\": memberOwner.Img.String,\n\t\t\"is_owner\": true,\n\t\t\"itin_code\": memberItinCreated.ItinCode,\n\t})\n\tif len(req.GroupMembers) > 0 {\n\t\t// Append list email temporary\n\t\tvar tempListEmail []string\n\t\tfor _, groupMember := range req.GroupMembers {\n\t\t\tmemberGroupEmail := fmt.Sprintf(\"%s\", groupMember[\"member_email\"])\n\t\t\tif memberGroupEmail != \"\" && memberOwner.Email != memberGroupEmail {\n\t\t\t\tif !utils.IsEmail(memberGroupEmail) {\n\t\t\t\t\th.SendBadRequest(w, fmt.Sprintf(\"Email %s is invalid.\", memberGroupEmail))\n\t\t\t\t\ttx.Rollback(ctx)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\ttempListEmail = append(tempListEmail, memberGroupEmail)\n\t\t\t}\n\t\t}\n\n\t\t// Append list email temporary & list member id temporary by member exist\n\t\tvar tempListTempsEmail []string\n\t\tvar tempListRelationMemberID []int32\n\t\tif len(tempListEmail) > 0 {\n\t\t\tfor i := 0; i < len(tempListEmail); i++ {\n\t\t\t\tmemberGroup, _ := m.GetMemberByEmail(db, ctx, fmt.Sprintf(\"%v\", tempListEmail[i]))\n\t\t\t\tif memberGroup.ID != 0 {\n\t\t\t\t\ttempListRelationMemberID = append(tempListRelationMemberID, memberGroup.ID)\n\t\t\t\t} else {\n\t\t\t\t\ttempListTempsEmail = append(tempListTempsEmail, tempListEmail[i])\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Assign adjustment member itin relation\n\t\tarrInt32 := new(array.ArrInt32)\n\t\tlistTempsMemberIDFiltered := arrInt32.Unique(tempListRelationMemberID)\n\t\tif len(listTempsMemberIDFiltered) > 0 {\n\t\t\tfor i := 0; i < len(listTempsMemberIDFiltered); i++ {\n\t\t\t\tmemberGroupID := listTempsMemberIDFiltered[i]\n\t\t\t\tmemberGroup, _ := m.GetMemberBy(db, ctx, \"id\", fmt.Sprintf(\"%d\", memberGroupID))\n\t\t\t\tmemberItinRelationFormatted := model.MemberItinRelationEnt{\n\t\t\t\t\tMemberItinID: memberItinCreated.ID,\n\t\t\t\t\tMemberID: memberGroupID,\n\t\t\t\t}\n\t\t\t\tmemberItinRelationCreated, err := m.AddMemberItinRelation(tx, ctx, memberItinRelationFormatted)\n\t\t\t\tif err != nil {\n\t\t\t\t\th.SendBadRequest(w, psql.ParseErr(err))\n\t\t\t\t\ttx.Rollback(ctx)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tmemberItinRelationCreated.MemberEnt = memberGroup\n\t\t\t\tmemberItinRelationCreated.MemberItinEnt = memberItinCreated\n\t\t\t\tmemberItinGroups = append(memberItinGroups, map[string]interface{}{\n\t\t\t\t\t\"member_code\": memberItinRelationCreated.MemberEnt.MemberCode,\n\t\t\t\t\t\"member_name\": memberItinRelationCreated.MemberEnt.Name,\n\t\t\t\t\t\"member_username\": memberItinRelationCreated.MemberEnt.Username,\n\t\t\t\t\t\"member_email\": memberItinRelationCreated.MemberEnt.Email,\n\t\t\t\t\t\"member_img\": memberItinRelationCreated.MemberEnt.Img.String,\n\t\t\t\t\t\"is_owner\": false,\n\t\t\t\t\t\"itin_code\": memberItinCreated.ItinCode,\n\t\t\t\t})\n\n\t\t\t\t// append email member for query add to chat group relation\n\t\t\t\tmRel = append(mRel, \"(\"+strconv.Itoa(int(memberGroup.ID))+\",\"+strconv.Itoa(int(chatGroupID))+\",current_timestamp)\")\n\t\t\t}\n\t\t}\n\n\t\t// Assign adjustment member itin temp\n\t\tarrStr := new(array.ArrStr)\n\t\tlistTempsEmailFiltered := arrStr.Unique(tempListTempsEmail)\n\t\tif len(listTempsEmailFiltered) > 0 {\n\t\t\tfor i := 0; i < len(listTempsEmailFiltered); i++ {\n\t\t\t\tmemberTempEmail := listTempsEmailFiltered[i]\n\t\t\t\tmemberTempFormatted := model.MemberTemporaryEnt{\n\t\t\t\t\tEmail: memberTempEmail,\n\t\t\t\t\tMemberItinID: memberItinCreated.ID,\n\t\t\t\t}\n\t\t\t\tmemberTempCreated, err := m.AddMemberTemporary(tx, ctx, memberTempFormatted)\n\t\t\t\tif err != nil {\n\t\t\t\t\th.SendBadRequest(w, psql.ParseErr(err))\n\t\t\t\t\ttx.Rollback(ctx)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tmemberTempCreated.MemberItin = memberItinCreated\n\t\t\t\tmemberItinGroups = append(memberItinGroups, map[string]interface{}{\n\t\t\t\t\t\"member_code\": \"\",\n\t\t\t\t\t\"member_name\": \"\",\n\t\t\t\t\t\"member_username\": \"\",\n\t\t\t\t\t\"member_email\": memberTempCreated.Email,\n\t\t\t\t\t\"member_img\": \"\",\n\t\t\t\t\t\"is_owner\": false,\n\t\t\t\t\t\"itin_code\": memberItinCreated.ItinCode,\n\t\t\t\t})\n\t\t\t\tdataEmail := model.DataEmailInviteItinMember{\n\t\t\t\t\tSender: memberOwner.Name,\n\t\t\t\t\tURL: \"https://panoramatest.page.link/test\",\n\t\t\t\t\tItineraryName: memberItinCreated.Title,\n\t\t\t\t\tEmailInvite: memberTempCreated.Email,\n\t\t\t\t}\n\t\t\t\tsubject := fmt.Sprintf(\"[Panorama] Invitation Trip %s\", dataEmail.ItineraryName)\n\t\t\t\terr = m.SendingMail(model.ActInviteGroupItinMember, subject, dataEmail.EmailInvite, dataEmail)\n\t\t\t\tif err != nil {\n\t\t\t\t\tfmt.Printf(\"error send email to %s : %s\", memberTempCreated.Email, err.Error())\n\t\t\t\t\ttx.Rollback(ctx)\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\t// append email member for query add to chat group temporary\n\t\t\t\tmTemp = append(mTemp, \"('\"+memberTempCreated.Email+\"',\"+strconv.Itoa(int(chatGroupID))+\",current_timestamp)\")\n\t\t\t}\n\t\t}\n\n\t\t// Add member temporary to chat member temporary\n\t\tif len(mTemp) > 0 {\n\t\t\terr = m.AddChatMemberTempBatch(ctx, tx, strings.Join(mTemp, \",\"))\n\t\t\tif err != nil {\n\t\t\t\th.SendBadRequest(w, psql.ParseErr(err))\n\t\t\t\ttx.Rollback(ctx)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\t// Add member is active to chat group relation\n\t\tif len(mRel) > 0 {\n\t\t\terr = m.AddChatGroupRelationBatch(ctx, tx, strings.Join(mRel, \",\"))\n\t\t\tif err != nil {\n\t\t\t\th.SendBadRequest(w, psql.ParseErr(err))\n\t\t\t\ttx.Rollback(ctx)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tmemberItinCreated.GroupMembers = memberItinGroups\n\n\t// Activity user logging in process\n\tlog := model.LogActivityUserEnt{\n\t\tUserID: int64(memberOwnerID),\n\t\tRole: h.GetUserRole(r.Context()),\n\t\tTitle: \"Add New Itin\",\n\t\tActivity: activityProcess,\n\t\tEventType: r.Method,\n\t}\n\t_, err = m.AddLogActivity(tx, ctx, log)\n\tif err != nil {\n\t\th.SendBadRequest(w, err.Error())\n\t\ttx.Rollback(ctx)\n\t\treturn\n\t}\n\n\t// Commit transaction\n\terr = tx.Commit(ctx)\n\tif err != nil {\n\t\th.SendBadRequest(w, err.Error())\n\t\ttx.Rollback(ctx)\n\t\treturn\n\t}\n\n\th.SendSuccess(w, res.Transform(memberItinCreated), nil)\n}", "title": "" }, { "docid": "040699e0510e84147a391f9e955b7c58", "score": "0.365258", "text": "func (sr *Server) helperGetItemsOfOwner(w http.ResponseWriter, r *http.Request) {\n\tif err := r.ParseForm(); err != nil {\n fmt.Print(w, \"ParseForm() err: %v\", err)\n return\n }\n userId := r.FormValue(\"userid\")\n\tjson.NewEncoder(w).Encode(sr.bm.GetItemsOfOwner(userId, sr.bcServer))\n}", "title": "" }, { "docid": "577d4f0cba976f5b0a78004924aa0259", "score": "0.36517185", "text": "func (m *IdentityGovernance) GetEntitlementManagement()(EntitlementManagementable) {\n return m.entitlementManagement\n}", "title": "" }, { "docid": "e0ff42745070428d18d78e3d32c55f40", "score": "0.36432612", "text": "func (r *EducationUserTaughtClassesCollectionRequest) Add(ctx context.Context, reqObj *EducationClass) (resObj *EducationClass, err error) {\n\terr = r.JSONRequest(ctx, \"POST\", \"\", reqObj, &resObj)\n\treturn\n}", "title": "" }, { "docid": "f5f11ddc37e532c6779c7144d8196245", "score": "0.3641539", "text": "func (client BaseClient) GetApplicationUserAssociations(ctx context.Context, applicationID int32, userID *int32, ACL *int32, page *int32, pageSize *int32, sortOrder string, sortBy string) (result ListUserApplicationModel, err error) {\n if err := validation.Validate([]validation.Validation{\n { TargetValue: page,\n Constraints: []validation.Constraint{\t{Target: \"page\", Name: validation.Null, Rule: false ,\n Chain: []validation.Constraint{\t{Target: \"page\", Name: validation.InclusiveMaximum, Rule: 2147483647, Chain: nil },\n \t{Target: \"page\", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil },\n }}}},\n { TargetValue: pageSize,\n Constraints: []validation.Constraint{\t{Target: \"pageSize\", Name: validation.Null, Rule: false ,\n Chain: []validation.Constraint{\t{Target: \"pageSize\", Name: validation.InclusiveMaximum, Rule: 1000, Chain: nil },\n \t{Target: \"pageSize\", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil },\n }}}}}); err != nil {\n return result, validation.NewErrorWithValidationError(err, \"softheonenterpriseapiclient.BaseClient\",\"GetApplicationUserAssociations\")\n }\n\n req, err := client.GetApplicationUserAssociationsPreparer(ctx, applicationID, userID, ACL, page, pageSize, sortOrder, sortBy)\n if err != nil {\n err = autorest.NewErrorWithError(err, \"softheonenterpriseapiclient.BaseClient\", \"GetApplicationUserAssociations\", nil , \"Failure preparing request\")\n return\n }\n\n resp, err := client.GetApplicationUserAssociationsSender(req)\n if err != nil {\n result.Response = autorest.Response{Response: resp}\n err = autorest.NewErrorWithError(err, \"softheonenterpriseapiclient.BaseClient\", \"GetApplicationUserAssociations\", resp, \"Failure sending request\")\n return\n }\n\n result, err = client.GetApplicationUserAssociationsResponder(resp)\n if err != nil {\n err = autorest.NewErrorWithError(err, \"softheonenterpriseapiclient.BaseClient\", \"GetApplicationUserAssociations\", resp, \"Failure responding to request\")\n }\n\n return\n }", "title": "" }, { "docid": "bb15f11c4e762adc2e1dcc02b81dd3f5", "score": "0.36410284", "text": "func (sliir *ShoppingListItemImageRepository) GetByUserGUID(userGUID string, relations string) []*ShoppingListItemImage {\n\tshoppingListItemImage := []*ShoppingListItemImage{}\n\n\tDB := sliir.DB.Model(&ShoppingListItemImage{})\n\n\tif relations != \"\" {\n\t\tDB = sliir.LoadRelations(DB, relations)\n\t}\n\n\tDB.Where(&ShoppingListItemImage{UserGUID: userGUID}).Find(&shoppingListItemImage)\n\n\treturn shoppingListItemImage\n}", "title": "" }, { "docid": "a4658bbd0f7bc0acfdf2b7ae82d7b4d4", "score": "0.36391208", "text": "func (m *UsersEducationUserItemRequestBuilder) ClassesById(id string)(*UsersItemClassesEducationClassItemRequestBuilder) {\n urlTplParams := make(map[string]string)\n for idx, item := range m.pathParameters {\n urlTplParams[idx] = item\n }\n if id != \"\" {\n urlTplParams[\"educationClass%2Did\"] = id\n }\n return NewUsersItemClassesEducationClassItemRequestBuilderInternal(urlTplParams, m.requestAdapter)\n}", "title": "" }, { "docid": "c7b1481e8adcbd7669f37426833132a6", "score": "0.36300135", "text": "func (m *Invitation) GetInvitedUser()(Userable) {\n return m.invitedUser\n}", "title": "" }, { "docid": "98ea6e59db12689a9e10673a99fd7632", "score": "0.36293393", "text": "func AddAuthorizedKeysUserNoContent(t goatest.TInterface, ctx context.Context, service *goa.Service, ctrl app.UserController, payload *app.UserAuthorizedKey) http.ResponseWriter {\n\t// Setup service\n\tvar (\n\t\tlogBuf bytes.Buffer\n\n\t\trespSetter goatest.ResponseSetterFunc = func(r interface{}) {}\n\t)\n\tif service == nil {\n\t\tservice = goatest.Service(&logBuf, respSetter)\n\t} else {\n\t\tlogger := log.New(&logBuf, \"\", log.Ltime)\n\t\tservice.WithLogger(goa.NewLogger(logger))\n\t\tnewEncoder := func(io.Writer) goa.Encoder { return respSetter }\n\t\tservice.Encoder = goa.NewHTTPEncoder() // Make sure the code ends up using this decoder\n\t\tservice.Encoder.Register(newEncoder, \"*/*\")\n\t}\n\n\t// Validate payload\n\terr := payload.Validate()\n\tif err != nil {\n\t\te, ok := err.(goa.ServiceError)\n\t\tif !ok {\n\t\t\tpanic(err) // bug\n\t\t}\n\t\tt.Errorf(\"unexpected payload validation error: %+v\", e)\n\t\treturn nil\n\t}\n\n\t// Setup request context\n\trw := httptest.NewRecorder()\n\tu := &url.URL{\n\t\tPath: fmt.Sprintf(\"/api/v2/user/config/authorizedKeys\"),\n\t}\n\treq, _err := http.NewRequest(\"PUT\", u.String(), nil)\n\tif _err != nil {\n\t\tpanic(\"invalid test \" + _err.Error()) // bug\n\t}\n\tprms := url.Values{}\n\tif ctx == nil {\n\t\tctx = context.Background()\n\t}\n\tgoaCtx := goa.NewContext(goa.WithAction(ctx, \"UserTest\"), rw, req, prms)\n\taddAuthorizedKeysCtx, __err := app.NewAddAuthorizedKeysUserContext(goaCtx, req, service)\n\tif __err != nil {\n\t\t_e, _ok := __err.(goa.ServiceError)\n\t\tif !_ok {\n\t\t\tpanic(\"invalid test data \" + __err.Error()) // bug\n\t\t}\n\t\tt.Errorf(\"unexpected parameter validation error: %+v\", _e)\n\t\treturn nil\n\t}\n\taddAuthorizedKeysCtx.Payload = payload\n\n\t// Perform action\n\t__err = ctrl.AddAuthorizedKeys(addAuthorizedKeysCtx)\n\n\t// Validate response\n\tif __err != nil {\n\t\tt.Fatalf(\"controller returned %+v, logs:\\n%s\", __err, logBuf.String())\n\t}\n\tif rw.Code != 204 {\n\t\tt.Errorf(\"invalid response status code: got %+v, expected 204\", rw.Code)\n\t}\n\n\t// Return results\n\treturn rw\n}", "title": "" }, { "docid": "c62bcf164c612b28e84bbc6d7a757044", "score": "0.3623885", "text": "func (m *EntitlementManagementAccessPackageAssignmentPoliciesItemCustomExtensionHandlersCustomExtensionHandlerItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *EntitlementManagementAccessPackageAssignmentPoliciesItemCustomExtensionHandlersCustomExtensionHandlerItemRequestBuilderGetRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {\n requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()\n requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate\n requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters\n requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET\n requestInfo.Headers.Add(\"Accept\", \"application/json\")\n if requestConfiguration != nil {\n if requestConfiguration.QueryParameters != nil {\n requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters))\n }\n requestInfo.Headers.AddAll(requestConfiguration.Headers)\n requestInfo.AddRequestOptions(requestConfiguration.Options)\n }\n return requestInfo, nil\n}", "title": "" }, { "docid": "a28941e7799df8d00177d95d3785a267", "score": "0.36210716", "text": "func (m *Invitation) SetInvitedUserType(value *string)() {\n m.invitedUserType = value\n}", "title": "" }, { "docid": "109597e64c21a9b178741f0ec465932c", "score": "0.3615187", "text": "func NewGetUsersByTypeUsingGETForbidden() *GetUsersByTypeUsingGETForbidden {\n\treturn &GetUsersByTypeUsingGETForbidden{}\n}", "title": "" }, { "docid": "723521d65e550737552946a9d58844ec", "score": "0.35949135", "text": "func (o *GetImageVulnerabilitiesByTypeImageIDParams) WithHTTPClient(client *http.Client) *GetImageVulnerabilitiesByTypeImageIDParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "a1faad0a7d4c64ea26f454b15f5b7849", "score": "0.3592458", "text": "func (client BaseClient) GetUserByIDMethodResponder(resp *http.Response) (result UserType, err error) {\n err = autorest.Respond(\n resp,\n client.ByInspecting(),\n azure.WithErrorUnlessStatusCode(http.StatusOK),\n autorest.ByUnmarshallingJSON(&result),\n autorest.ByClosing())\n result.Response = autorest.Response{Response: resp}\n return\n }", "title": "" } ]
99a7231cd4eee10a5064ac04c6475955
SetTemplateParameters sets the TemplateParameters field's value.
[ { "docid": "c6e06cce7122c9885a7317d30dc3cc64", "score": "0.7669062", "text": "func (s *CreateNodeFromTemplateJobInput) SetTemplateParameters(v map[string]*string) *CreateNodeFromTemplateJobInput {\n\ts.TemplateParameters = v\n\treturn s\n}", "title": "" } ]
[ { "docid": "5f0bb799db8a165ca49e1a7a335a5b43", "score": "0.7717426", "text": "func (s *DescribeNodeFromTemplateJobOutput) SetTemplateParameters(v map[string]*string) *DescribeNodeFromTemplateJobOutput {\n\ts.TemplateParameters = v\n\treturn s\n}", "title": "" }, { "docid": "1fc35f5c8fbe3b0404f8d4843e4b784f", "score": "0.6555189", "text": "func (o *UpdateCampaignTemplate) SetTemplateParams(v []CampaignTemplateParams) {\n\to.TemplateParams = &v\n}", "title": "" }, { "docid": "46ace375325d406187e3367ce3fceab3", "score": "0.6283806", "text": "func (s *ValidateTemplateOutput) SetParameters(v []*TemplateParameter) *ValidateTemplateOutput {\n\ts.Parameters = v\n\treturn s\n}", "title": "" }, { "docid": "f349ffd2b62f9bf0199ee2bbe84eacc1", "score": "0.6214337", "text": "func (tr *Configuration) SetParameters(params map[string]interface{}) error {\n\tp, err := json.TFParser.Marshal(params)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn json.TFParser.Unmarshal(p, &tr.Spec.ForProvider)\n}", "title": "" }, { "docid": "4332374a91aee35bbbfa8e61b1bdf7f5", "score": "0.6047334", "text": "func SetTemplate(name string, params PictureParams) {\n\ttemplates[name] = params\n}", "title": "" }, { "docid": "8778b4fb01b559d71643561c03c96713", "score": "0.58718616", "text": "func (tr *Broker) SetParameters(params map[string]interface{}) error {\n\tp, err := json.TFParser.Marshal(params)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn json.TFParser.Unmarshal(p, &tr.Spec.ForProvider)\n}", "title": "" }, { "docid": "760a39fa0c72503b3c087f18754a02bf", "score": "0.57713246", "text": "func (s *EstimateTemplateCostInput) SetParameters(v []*Parameter) *EstimateTemplateCostInput {\n\ts.Parameters = v\n\treturn s\n}", "title": "" }, { "docid": "dbdc42bb37a21419053119be732c27ac", "score": "0.5750727", "text": "func (s *GetTemplateSummaryOutput) SetParameters(v []*ParameterDeclaration) *GetTemplateSummaryOutput {\n\ts.Parameters = v\n\treturn s\n}", "title": "" }, { "docid": "0ea68f29c66ed6d44a1031862fd358af", "score": "0.5712508", "text": "func (m *PingCheck) SetTemplate(val interface{}) {\n\tm.templateField = val\n}", "title": "" }, { "docid": "e4d6e99ab50bffd8711e48fdbf27e8bf", "score": "0.56901956", "text": "func (_BondingManager *BondingManagerTransactor) SetParameters(opts *bind.TransactOpts, _unbondingPeriod uint64, _numTranscoders *big.Int, _numActiveTranscoders *big.Int) (*types.Transaction, error) {\n\treturn _BondingManager.contract.Transact(opts, \"setParameters\", _unbondingPeriod, _numTranscoders, _numActiveTranscoders)\n}", "title": "" }, { "docid": "cc6d22d4161f4b2d809814fdd1409215", "score": "0.56311435", "text": "func (me *Server) SetTemplate(tmpName string, tmp interfaces.ITemplate) {\n\tme.templates[tmpName] = tmp\n\treturn\n}", "title": "" }, { "docid": "ab733e6b57199461126b4f68b9fb7422", "score": "0.5450803", "text": "func (o GoogleCloudDatapipelinesV1LaunchTemplateParametersOutput) Parameters() pulumi.StringMapOutput {\n\treturn o.ApplyT(func(v GoogleCloudDatapipelinesV1LaunchTemplateParameters) map[string]string { return v.Parameters }).(pulumi.StringMapOutput)\n}", "title": "" }, { "docid": "9568f61e9dee45db3a3f6e1a9e801f0b", "score": "0.5422135", "text": "func (x *NetworkConfig) SetParameters(v []*NetworkConfig_Parameter) {\n\tif x != nil {\n\t\tx.Parameters = v\n\t}\n}", "title": "" }, { "docid": "68e99ef23d17d20d0e4194cf4f4f24b5", "score": "0.5420028", "text": "func (_BondingManager *BondingManagerTransactorSession) SetParameters(_unbondingPeriod uint64, _numTranscoders *big.Int, _numActiveTranscoders *big.Int) (*types.Transaction, error) {\n\treturn _BondingManager.Contract.SetParameters(&_BondingManager.TransactOpts, _unbondingPeriod, _numTranscoders, _numActiveTranscoders)\n}", "title": "" }, { "docid": "69c7a238df884a3203a023a8260dd419", "score": "0.5402985", "text": "func (this *TelephoneNumber) SetParameters(p *core.NameValueList) {\n\tthis.parms = p\n}", "title": "" }, { "docid": "e0d1e14bae9ffe3b3eb445123de340d8", "score": "0.5397546", "text": "func (o *DeviceConfigWeb) SetParameters(v map[string]DeviceParameterWeb) {\n\to.Parameters = &v\n}", "title": "" }, { "docid": "d199087a8b753e9de538bd8c981bd728", "score": "0.5380628", "text": "func (b *BaseReader) SetParameters(values map[string]string) {\r\n\tb.parameters = values\r\n}", "title": "" }, { "docid": "85cf6a9085cea98fbeeb984296ea06f8", "score": "0.53553176", "text": "func (o GoogleCloudDatapipelinesV1LaunchTemplateParametersResponseOutput) Parameters() pulumi.StringMapOutput {\n\treturn o.ApplyT(func(v GoogleCloudDatapipelinesV1LaunchTemplateParametersResponse) map[string]string {\n\t\treturn v.Parameters\n\t}).(pulumi.StringMapOutput)\n}", "title": "" }, { "docid": "9e09aa27dcaa8f98462fd564d8dce2de", "score": "0.53404415", "text": "func (p *BindPacket) SetParameters(values []base.BoundValue) {\n\t// See \"Bind\" description in https://www.postgresql.org/docs/current/protocol-message-formats.html\n\t// If there are no parameters then don't bother.\n\tif len(values) == 0 {\n\t\tp.paramFormats = nil\n\t\treturn\n\t}\n\t// Check if all parameters have the same format. We can optimize storage if that's true.\n\tallSame := true\n\tformat := base.TextFormat\n\tif len(values) > 0 {\n\t\tformat = values[0].Format()\n\t\tfor _, value := range values[1:] {\n\t\t\tif value.Format() != format {\n\t\t\t\tallSame = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\t// If all parameters have the same format then mention it only once.\n\t// Otherwise, we need to explicitly specify formats.\n\tif allSame {\n\t\tp.paramFormats = make([]uint16, 1)\n\t\tswitch format {\n\t\tcase base.TextFormat:\n\t\t\tp.paramFormats[0] = bindFormatText\n\t\tcase base.BinaryFormat:\n\t\t\tp.paramFormats[0] = bindFormatBinary\n\t\t}\n\t} else {\n\t\tp.paramFormats = make([]uint16, len(values))\n\t\tfor i := range p.paramFormats {\n\t\t\tswitch values[i].Format() {\n\t\t\tcase base.TextFormat:\n\t\t\t\tp.paramFormats[i] = bindFormatText\n\t\t\tcase base.BinaryFormat:\n\t\t\t\tp.paramFormats[i] = bindFormatBinary\n\t\t\t}\n\t\t}\n\t}\n\t// Finally, replace parameter values. Reuse the top-level array if we can.\n\tif len(values) != len(p.paramValues) {\n\t\tp.paramValues = make([][]byte, len(values))\n\t}\n\tfor i := range p.paramValues {\n\t\tvalue, err := values[i].GetData(nil)\n\t\tif err != nil {\n\t\t\tlog.WithError(err).Errorln(\"Can't get BoundValue data\")\n\t\t\treturn\n\t\t}\n\t\tp.paramValues[i] = value\n\t}\n}", "title": "" }, { "docid": "6a4b5f145f98240f9651b7da85bc5e8f", "score": "0.5324584", "text": "func (_BondingManager *BondingManagerSession) SetParameters(_unbondingPeriod uint64, _numTranscoders *big.Int, _numActiveTranscoders *big.Int) (*types.Transaction, error) {\n\treturn _BondingManager.Contract.SetParameters(&_BondingManager.TransactOpts, _unbondingPeriod, _numTranscoders, _numActiveTranscoders)\n}", "title": "" }, { "docid": "c065a1fcc7133e02e05cee5fbd335b59", "score": "0.5320401", "text": "func (s *IndependentTrainer) SetParameters(p []float64) {\n\tif len(p) != s.NumParameters() {\n\t\tpanic(\"sink: parameter size mismatch\")\n\t}\n\trm := s.featureWeights.RawMatrix()\n\tcopy(rm.Data, p)\n}", "title": "" }, { "docid": "216e578a118c87166919b19d71006525", "score": "0.5317146", "text": "func (s *Stack) SetParameters(v []*Parameter) *Stack {\n\ts.Parameters = v\n\treturn s\n}", "title": "" }, { "docid": "5f2a6e55635ec90b65e18db96c49c975", "score": "0.5241278", "text": "func (s *CreateChangeSetInput) SetParameters(v []*Parameter) *CreateChangeSetInput {\n\ts.Parameters = v\n\treturn s\n}", "title": "" }, { "docid": "62d0965f8583e8f8c2406d89a0c7828c", "score": "0.52221984", "text": "func (o GoogleCloudDatapipelinesV1LaunchTemplateParametersPtrOutput) Parameters() pulumi.StringMapOutput {\n\treturn o.ApplyT(func(v *GoogleCloudDatapipelinesV1LaunchTemplateParameters) map[string]string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Parameters\n\t}).(pulumi.StringMapOutput)\n}", "title": "" }, { "docid": "db02b0ea9c0f8ff14a728edf569434ea", "score": "0.5206426", "text": "func (rule *Regex) SetParameters(params []string) error {\n\trule.Lock()\n\tdefer rule.Unlock()\n\n\tif len(params) == 0 {\n\t\treturn fmt.Errorf(\"regex pattern not exists\")\n\t}\n\n\tif params[0] == \"\" {\n\t\treturn fmt.Errorf(\"regex pattern is empty\")\n\t}\n\n\trule.RegexPattern = params[0]\n\treturn nil\n}", "title": "" }, { "docid": "05088e53de51dacaab3da4efa8904b49", "score": "0.5162437", "text": "func (s *UpdateStackInput) SetParameters(v []*Parameter) *UpdateStackInput {\n\ts.Parameters = v\n\treturn s\n}", "title": "" }, { "docid": "e1b9b8bef6104dbbdbd87c938da0eceb", "score": "0.5152035", "text": "func (s *CreateStackInput) SetParameters(v []*Parameter) *CreateStackInput {\n\ts.Parameters = v\n\treturn s\n}", "title": "" }, { "docid": "a3389b5e72b4ad49779959650a7c3deb", "score": "0.5151548", "text": "func (opt *GuacamoleConfiguration) SetParameters(parameters map[string]string) {\n\topt.parameters = make(map[string]string)\n\tfor k, v := range parameters {\n\t\topt.SetParameter(k, v)\n\t}\n}", "title": "" }, { "docid": "741524567946bbe3cb58da987d13962d", "score": "0.5135341", "text": "func (cli *CLI) SetTemplate(template string) {\n\tcli.template = template\n}", "title": "" }, { "docid": "0945a9c204bfe285813ff39f22e6e643", "score": "0.5123577", "text": "func (m *Message) SetSubstitutions(variables []Variables) {\n\tm.TemplateVariables = variables\n}", "title": "" }, { "docid": "930a31aa05abf962ec4f5f09d5ef0622", "score": "0.51105726", "text": "func (s *DescribeChangeSetOutput) SetParameters(v []*Parameter) *DescribeChangeSetOutput {\n\ts.Parameters = v\n\treturn s\n}", "title": "" }, { "docid": "277d2f40696c440e7d7b976ad5e3f098", "score": "0.50039077", "text": "func (self *Parameters) SetParams(m map[string]interface{}) {\n\tself.Lock()\n\tdefer self.Unlock()\n\tself.params = m\n}", "title": "" }, { "docid": "1bc33128ec6883eb6dffa929ab210375", "score": "0.4998527", "text": "func (m *ListInfo) SetTemplate(value *string)() {\n err := m.GetBackingStore().Set(\"template\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "f908222fbbfb2b3cdf6d634b15ee0ec7", "score": "0.49395448", "text": "func (v *Item) SetTemplate(s string) {\n\tv.template = filepath.Join(v.folder, s)\n}", "title": "" }, { "docid": "995abd0ddb2472707cd7f89d157f648a", "score": "0.49042842", "text": "func (v *VirtualMachine) SetBackupParameters(req *SetBackupParametersRequest) error {\n\tvar (\n\t\tpath = fmt.Sprintf(\"/virtual_machines/%s/backup_parameters\", v.Id)\n\t)\n\n\theader := map[string]string{\"Content-Type\": \"application/vnd.simplivity.v1.11+json\"}\n\tresp, err := commonClient.DoRequest(\"POST\", path, \"\", req, header)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn err\n\t}\n\n\ttask, err := commonClient.Tasks.WaitForTask(resp)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn err\n\t}\n\n\tresources := task.AffectedResources\n\tif len(resources) < 1 {\n\t\terr_message := \"Set backup parameters operation was not successful. Error code:\" + string(task.ErrorCode)\n\t\treturn errors.New(err_message)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "31c579798d8f0796eeb7066e256fc1b0", "score": "0.4894601", "text": "func (o *Dashboard) SetTemplateVariables(v []DashboardTemplateVariable) {\n\to.TemplateVariables = v\n}", "title": "" }, { "docid": "0e18f5930f7082c956fcd0e6c0ea0a19", "score": "0.48934004", "text": "func (suo *ServerUpdateOne) SetTemplate(s string) *ServerUpdateOne {\n\tsuo.mutation.SetTemplate(s)\n\treturn suo\n}", "title": "" }, { "docid": "162fbb1a6f8a9a5412a325e1dbcc3b3e", "score": "0.48871058", "text": "func NewDeviceTemplatesSetParams() *DeviceTemplatesSetParams {\n\tvar ()\n\treturn &DeviceTemplatesSetParams{\n\n\t\ttimeout: cr.DefaultTimeout,\n\t}\n}", "title": "" }, { "docid": "b9da441ec7e789808964e9c6669c1512", "score": "0.48695633", "text": "func (o *UpdateCampaignTemplate) GetTemplateParams() []CampaignTemplateParams {\n\tif o == nil || o.TemplateParams == nil {\n\t\tvar ret []CampaignTemplateParams\n\t\treturn ret\n\t}\n\treturn *o.TemplateParams\n}", "title": "" }, { "docid": "00c224532b61ef6c45bae0883a92cace", "score": "0.4847695", "text": "func (o FlexTemplateJobOutput) Parameters() pulumi.MapOutput {\n\treturn o.ApplyT(func(v *FlexTemplateJob) pulumi.MapOutput { return v.Parameters }).(pulumi.MapOutput)\n}", "title": "" }, { "docid": "c836d449514554ca6f657b593ab4ee8f", "score": "0.48401773", "text": "func NewTemplateUpdateParams() *TemplateUpdateParams {\n\tvar ()\n\treturn &TemplateUpdateParams{\n\n\t\ttimeout: cr.DefaultTimeout,\n\t}\n}", "title": "" }, { "docid": "a26638a825625f9dcaca3188075e192e", "score": "0.48320124", "text": "func (su *ServerUpdate) SetTemplate(s string) *ServerUpdate {\n\tsu.mutation.SetTemplate(s)\n\treturn su\n}", "title": "" }, { "docid": "789416d801ab9a287709a0d57d209258", "score": "0.48299074", "text": "func (in *LaunchTemplateParameters) DeepCopy() *LaunchTemplateParameters {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(LaunchTemplateParameters)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "789416d801ab9a287709a0d57d209258", "score": "0.48299074", "text": "func (in *LaunchTemplateParameters) DeepCopy() *LaunchTemplateParameters {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(LaunchTemplateParameters)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "99f5b1371a074e156aca602bb40f252f", "score": "0.48054966", "text": "func (m *ListInfo) SetTemplate(value *string)() {\n m.template = value\n}", "title": "" }, { "docid": "43d8cedad94ad762affb4d1f52dcfc79", "score": "0.47816792", "text": "func (m *MocktemplateConfigurer) Parameters() ([]*cloudformation.Parameter, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"Parameters\")\n\tret0, _ := ret[0].([]*cloudformation.Parameter)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "a3ff9b7492bc3a2284fa082d97a4e7aa", "score": "0.47735202", "text": "func (in *ActionMailTemplateTranslationIndexInput) SelectParameters(params ...string) *ActionMailTemplateTranslationIndexInput {\n\tif in._selectedParameters == nil {\n\t\tin._selectedParameters = make(map[string]interface{})\n\t}\n\n\tfor _, param := range params {\n\t\tin._selectedParameters[param] = nil\n\t}\n\n\treturn in\n}", "title": "" }, { "docid": "c64f44bf778b3930fe7866b35197cbc7", "score": "0.4771461", "text": "func (net *Net) SetParametersSlice(src []float64) {\n\tif len(src) != net.totalNumParameters {\n\t\tpanic(\"length of src does not match len of net\")\n\t}\n\tcopy(net.parametersSlice, src)\n}", "title": "" }, { "docid": "ba0678d31ca11d7faff94d7ecc952ff1", "score": "0.47372985", "text": "func NewConfigurationPolicyTemplatesItemSettingTemplatesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ConfigurationPolicyTemplatesItemSettingTemplatesRequestBuilder) {\n m := &ConfigurationPolicyTemplatesItemSettingTemplatesRequestBuilder{\n BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, \"{+baseurl}/deviceManagement/configurationPolicyTemplates/{deviceManagementConfigurationPolicyTemplate%2Did}/settingTemplates{?%24top,%24skip,%24search,%24filter,%24count,%24orderby,%24select,%24expand}\", pathParameters),\n }\n return m\n}", "title": "" }, { "docid": "88e9dde57752b14130efd391c3328936", "score": "0.47319335", "text": "func (o *TemplateApply) SetTemplate(v TemplateApplyTemplate) {\n\to.Template = &v\n}", "title": "" }, { "docid": "8e1006bb2d14a4b78a121cf1979de317", "score": "0.47139275", "text": "func (ptc *PropertyTypeCreate) SetProjectTemplate(p *ProjectTemplate) *PropertyTypeCreate {\n\treturn ptc.SetProjectTemplateID(p.ID)\n}", "title": "" }, { "docid": "60e94ecaee6fb7646b5b6943bdb7e6b6", "score": "0.471205", "text": "func (o TemplateMetadataResponseOutput) Parameters() ParameterMetadataResponseArrayOutput {\n\treturn o.ApplyT(func(v TemplateMetadataResponse) []ParameterMetadataResponse { return v.Parameters }).(ParameterMetadataResponseArrayOutput)\n}", "title": "" }, { "docid": "7d9d748dc61f94cec32133687c6bee76", "score": "0.47051093", "text": "func TransformTemplate(tpl *templatev1.Template, templateProcessor templateprocessorclient.TemplateProcessorInterface, namespace string, parameters map[string]string, ignoreUnknownParameters bool) (*templatev1.Template, error) {\n\t// only set values that match what's expected by the template.\n\tfor k, value := range parameters {\n\t\tv := templateprocessing.GetParameterByName(tpl, k)\n\t\tif v != nil {\n\t\t\tv.Value = value\n\t\t\tv.Generate = \"\"\n\t\t} else if !ignoreUnknownParameters {\n\t\t\treturn nil, fmt.Errorf(\"unexpected parameter name %q\", k)\n\t\t}\n\t}\n\n\tname := localOrRemoteName(tpl.ObjectMeta, namespace)\n\n\t// transform the template\n\tresult, err := templateProcessor.Process(tpl)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error processing template %q: %v\", name, err)\n\t}\n\n\treturn result, nil\n}", "title": "" }, { "docid": "ff5a5fc5160380bfc4d35743ecd0a7ed", "score": "0.4690163", "text": "func SetParameterValuesIntoSCtx(sctx sessionctx.Context, isNonPrep bool, markers []ast.ParamMarkerExpr, params []expression.Expression) error {\n\tvars := sctx.GetSessionVars()\n\tvars.PlanCacheParams.Reset()\n\tfor i, usingParam := range params {\n\t\tval, err := usingParam.Eval(chunk.Row{})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif isGetVarBinaryLiteral(sctx, usingParam) {\n\t\t\tbinVal, convErr := val.ToBytes()\n\t\t\tif convErr != nil {\n\t\t\t\treturn convErr\n\t\t\t}\n\t\t\tval.SetBinaryLiteral(binVal)\n\t\t}\n\t\tif markers != nil {\n\t\t\tparam := markers[i].(*driver.ParamMarkerExpr)\n\t\t\tparam.Datum = val\n\t\t\tparam.InExecute = true\n\t\t}\n\t\tvars.PlanCacheParams.Append(val)\n\t}\n\tif vars.StmtCtx.EnableOptimizerDebugTrace && len(vars.PlanCacheParams.AllParamValues()) > 0 {\n\t\tvals := vars.PlanCacheParams.AllParamValues()\n\t\tvalStrs := make([]string, len(vals))\n\t\tfor i, val := range vals {\n\t\t\tvalStrs[i] = val.String()\n\t\t}\n\t\tdebugtrace.RecordAnyValuesWithNames(sctx, \"Parameter datums for EXECUTE\", valStrs)\n\t}\n\tvars.PlanCacheParams.SetForNonPrepCache(isNonPrep)\n\treturn nil\n}", "title": "" }, { "docid": "21ed522ba205311345a49fa8236f8efe", "score": "0.46886915", "text": "func (in *SetPodSecurityPolicyTemplateInput) DeepCopy() *SetPodSecurityPolicyTemplateInput {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(SetPodSecurityPolicyTemplateInput)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "3bcf8b745ca2a2271c06f8397ee464b7", "score": "0.4669096", "text": "func (a *Dynamic) SetParameter(index int, value interface{}) {\n\tindex = a.info.parameters[index]\n\ta.object.Fields[index] = value\n}", "title": "" }, { "docid": "a717210762ffb9fc859a24f274a71b5b", "score": "0.46511364", "text": "func ModifyTemplate(cli bce.Client, args *ModifyTemplateArgs) error {\n\tif err := CheckError(args != nil, \"ModifyTemplateArgs can not be nil\"); err != nil {\n\t\treturn err\n\t}\n\tif err := CheckError(len(args.TemplateId) > 0, \"templateId can not be blank\"); err != nil {\n\t\treturn err\n\t}\n\tif err := CheckError(len(args.Content) > 0, \"content can not be blank\"); err != nil {\n\t\treturn err\n\t}\n\tif err := CheckError(len(args.CountryType) > 0, \"countryType can not be blank\"); err != nil {\n\t\treturn err\n\t}\n\tif err := CheckError(len(args.Name) > 0, \"name can not be blank\"); err != nil {\n\t\treturn err\n\t}\n\tif err := CheckError(len(args.SmsType) > 0, \"smsType can not be blank\"); err != nil {\n\t\treturn err\n\t}\n\treq := &bce.BceRequest{}\n\treq.SetUri(REQUEST_URI_TEMPLATE + bce.URI_PREFIX + args.TemplateId)\n\treq.SetMethod(http.PUT)\n\treq.SetHeader(http.CONTENT_TYPE, bce.DEFAULT_CONTENT_TYPE)\n\tjsonBytes, jsonErr := json.Marshal(args)\n\tif jsonErr != nil {\n\t\treturn jsonErr\n\t}\n\tbody, err := bce.NewBodyFromBytes(jsonBytes)\n\tif err != nil {\n\t\treturn err\n\t}\n\treq.SetBody(body)\n\tresp := &bce.BceResponse{}\n\tif err := cli.SendRequest(req, resp); err != nil {\n\t\treturn err\n\t}\n\tif resp.IsFail() {\n\t\treturn resp.ServiceError()\n\t}\n\tdefer func() { resp.Body().Close() }()\n\treturn nil\n}", "title": "" }, { "docid": "ae0878286566d92cb0e1e65ec0ad779f", "score": "0.46413755", "text": "func (o *Output) SetParameters(p Parameters) {\n\n\to.SetName(p.MeasureName)\n\to.SetABins(p.ABins)\n\to.SetWBins(p.WBins)\n\to.SetSBins(p.SBins)\n\to.SetGlobalBins(p.GlobalBins)\n\to.SetIterations(p.Iterations)\n\to.SetNormalisation(p.NormalisationMin, p.NormalisationMax)\n\tif p.UseContinuous {\n\t\to.SetK(p.K)\n\t\to.SetContinuousMode(p.ContinuousMode)\n\t}\n\n\to.SetUseContinuous(p.UseContinuous)\n\to.SetUseStateDependent(p.UseStateDependent)\n\to.SetGlobalFile(p.GlobalFile)\n\to.SetWFile(p.WFile)\n\to.SetAFile(p.AFile)\n\to.SetSFile(p.SFile)\n\n\to.SetWIndices(p.WIndices)\n\to.SetAIndices(p.AIndices)\n\to.SetSIndices(p.SIndices)\n\n\to.SetDomainWMinMax(p.WorldMin, p.WorldMax)\n\to.SetDomainAMinMax(p.ActuatorMin, p.ActuatorMax)\n\to.SetDomainSMinMax(p.SensorMin, p.SensorMax)\n\to.SetDomainName(p.DFile)\n\n}", "title": "" }, { "docid": "4c19cf0146dd8862f03ff81588e34515", "score": "0.46193013", "text": "func (m *UnifiedRoleDefinition) SetTemplateId(value *string)() {\n m.templateId = value\n}", "title": "" }, { "docid": "6d5246f5b19b20439c88ff640243fb52", "score": "0.4610223", "text": "func (o TemplateMetadataResponsePtrOutput) Parameters() ParameterMetadataResponseArrayOutput {\n\treturn o.ApplyT(func(v *TemplateMetadataResponse) []ParameterMetadataResponse {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Parameters\n\t}).(ParameterMetadataResponseArrayOutput)\n}", "title": "" }, { "docid": "31b08f5a1de0054286706b10df85fb56", "score": "0.4605951", "text": "func (o *Dashboard) SetTemplateVariablePresets(v []DashboardTemplateVariablePreset) {\n\to.TemplateVariablePresets = v\n}", "title": "" }, { "docid": "6faff083e6466cbe294e1efab9d820ea", "score": "0.45942315", "text": "func SetParameters(parameters string) {\n\tgetopt.SetParameters(parameters)\n}", "title": "" }, { "docid": "83dfae68abf405d5822a97b4b4c19eb3", "score": "0.45861596", "text": "func (client *Client) SetTdlibParameters(req *SetTdlibParametersRequest) (*Ok, error) {\n\tresult, err := client.Send(Request{\n\t\tmeta: meta{\n\t\t\tType: \"setTdlibParameters\",\n\t\t},\n\t\tData: map[string]interface{}{\n\t\t\t\"parameters\": req.Parameters,\n\t\t},\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif result.Type == \"error\" {\n\t\treturn nil, buildResponseError(result.Data)\n\t}\n\n\treturn UnmarshalOk(result.Data)\n}", "title": "" }, { "docid": "ec20974437c58d67ae87b71ab50506e2", "score": "0.45842534", "text": "func (r *resolver) templateParams(s *scope, l ast.TemplateParams) ([]sem.TemplateParam, error) {\n\tout := []sem.TemplateParam{}\n\tfor _, ast := range l {\n\t\tparam, err := r.templateParam(ast)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\ts.declare(param, ast.Source)\n\t\tout = append(out, param)\n\t}\n\treturn out, nil\n}", "title": "" }, { "docid": "16cb56c1ff0f0cebc5eeac9c59de21ef", "score": "0.4579708", "text": "func (ptc *PropertyTypeCreate) SetProjectTemplateID(id int) *PropertyTypeCreate {\n\tptc.mutation.SetProjectTemplateID(id)\n\treturn ptc\n}", "title": "" }, { "docid": "43b0ad26ebc215059d18d66ae372a872", "score": "0.45789632", "text": "func (o *ControllersPublicV2ProxyListTemplatesParams) SetTimeout(timeout time.Duration) {\n\to.timeout = timeout\n}", "title": "" }, { "docid": "bcf9a7aabfd47b084b44e91bcd62d429", "score": "0.45563832", "text": "func (o *DeviceTemplatesSetParams) SetTimeout(timeout time.Duration) {\n\to.timeout = timeout\n}", "title": "" }, { "docid": "ab99516247045f10d64909aefc8dcde6", "score": "0.45544988", "text": "func (o *DeviceTemplatesSetParams) WithTimeout(timeout time.Duration) *DeviceTemplatesSetParams {\n\to.SetTimeout(timeout)\n\treturn o\n}", "title": "" }, { "docid": "0c31c2bdbc6572ec8caa5d2da6f23308", "score": "0.45485753", "text": "func (o *CreateSMTPTemplateParams) SetSMTPTemplate(sMTPTemplate *models.CreateSMTPTemplate) {\n\to.SMTPTemplate = sMTPTemplate\n}", "title": "" }, { "docid": "cc0ce53efcf8cde400184b984432a38c", "score": "0.45477495", "text": "func (o *Register) SetTemplateId(v int32) {\n\to.TemplateId = &v\n}", "title": "" }, { "docid": "bf8746efdfd8e6d75904863d097d9614", "score": "0.45327294", "text": "func (_options *CreateManagedKeyOptions) SetTemplateName(templateName string) *CreateManagedKeyOptions {\n\t_options.TemplateName = core.StringPtr(templateName)\n\treturn _options\n}", "title": "" }, { "docid": "4d28426145ef731ddaef83e447f057cd", "score": "0.45275047", "text": "func NewTemplateParameter() *TemplateParameterBuilder {\n\treturn &TemplateParameterBuilder{}\n}", "title": "" }, { "docid": "13b8c8e4503df052cd262980e6d1da3b", "score": "0.45274174", "text": "func (o *UpdateCampaignTemplate) HasTemplateParams() bool {\n\tif o != nil && o.TemplateParams != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "3c4e836ffc88265f1c4f391adfe2ff9f", "score": "0.45262894", "text": "func (m *smsTemplate) SetTemplateName(val *string) {\n\tm.templateNameField = val\n}", "title": "" }, { "docid": "e8cd4698671d42e3b8a6e108c8441f92", "score": "0.4525123", "text": "func ApplyParameters(b *buildv1alpha1.Build, tr *v1alpha1.TaskRun, defaults ...v1alpha1.TaskParam) *buildv1alpha1.Build {\n\t// This assumes that the TaskRun inputs have been validated against what the Task requests.\n\treplacements := map[string]string{}\n\t// Set all the default replacements\n\tfor _, p := range defaults {\n\t\tif p.Default != \"\" {\n\t\t\treplacements[fmt.Sprintf(\"inputs.params.%s\", p.Name)] = p.Default\n\t\t}\n\t}\n\t// Set and overwrite params with the ones from the TaskRun\n\tfor _, p := range tr.Spec.Inputs.Params {\n\t\treplacements[fmt.Sprintf(\"inputs.params.%s\", p.Name)] = p.Value\n\t}\n\n\treturn builder.ApplyReplacements(b, replacements)\n}", "title": "" }, { "docid": "858fd99ae6f988fed10ec3837a640a12", "score": "0.45122275", "text": "func (o *GetV1ChecklistTemplatesParams) SetTimeout(timeout time.Duration) {\n\to.timeout = timeout\n}", "title": "" }, { "docid": "0befa79d6c19da3373793bd9c33274b8", "score": "0.44971773", "text": "func NewDeviceTemplatesSetParamsWithTimeout(timeout time.Duration) *DeviceTemplatesSetParams {\n\tvar ()\n\treturn &DeviceTemplatesSetParams{\n\n\t\ttimeout: timeout,\n\t}\n}", "title": "" }, { "docid": "52ae7187b72ac2d9b68ef449b3d82f7e", "score": "0.44910666", "text": "func (in *LaunchTemplateSpecificationParameters) DeepCopy() *LaunchTemplateSpecificationParameters {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(LaunchTemplateSpecificationParameters)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "6e24f2e9b9e3f38a42b9abd3cfb43aa8", "score": "0.44854918", "text": "func (c *templateClient) SetValue(param *SetParam) error {\n\t// todo\n\treturn nil\n}", "title": "" }, { "docid": "916040b04bd31eda38e320ff1b35cb08", "score": "0.44854593", "text": "func (n *jsiiProxy_NestedStack) SetParameter(name *string, value *string) {\n\t_jsii_.InvokeVoid(\n\t\tn,\n\t\t\"setParameter\",\n\t\t[]interface{}{name, value},\n\t)\n}", "title": "" }, { "docid": "8d6e1d5dd22f18b783da60517823642f", "score": "0.448242", "text": "func (mr *MocktemplateConfigurerMockRecorder) Parameters() *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Parameters\", reflect.TypeOf((*MocktemplateConfigurer)(nil).Parameters))\n}", "title": "" }, { "docid": "95ff89a5efa21bf5b2df272094e28354", "score": "0.4475861", "text": "func (s *ActionTypeExecutor) SetPolicyStatementsTemplate(v string) *ActionTypeExecutor {\n\ts.PolicyStatementsTemplate = &v\n\treturn s\n}", "title": "" }, { "docid": "cc3eb8de708c64f9c2f74bccc3cbce3b", "score": "0.44415152", "text": "func (in *ActionMailTemplateTranslationIndexMetaGlobalInput) SelectParameters(params ...string) *ActionMailTemplateTranslationIndexMetaGlobalInput {\n\tif in._selectedParameters == nil {\n\t\tin._selectedParameters = make(map[string]interface{})\n\t}\n\n\tfor _, param := range params {\n\t\tin._selectedParameters[param] = nil\n\t}\n\n\treturn in\n}", "title": "" }, { "docid": "b77420e6cbcb19b7f0fcf5e17f291f8f", "score": "0.4429883", "text": "func (m *Message) SetTemplateID(templateid string) {\n\tm.TemplateID = templateid\n}", "title": "" }, { "docid": "cc0a6af8f151bf11226a7c953ff3513d", "score": "0.4421193", "text": "func (self *Parameters) SetBodyParams(m map[string]interface{}) {\n\tself.Lock()\n\tdefer self.Unlock()\n\tself.bodyParams = m\n}", "title": "" }, { "docid": "d1eca6b4cc01b5496d2e9f572d54336f", "score": "0.4416369", "text": "func (client *Client) ModifyParameters(request *ModifyParametersRequest) (_result *ModifyParametersResponse, _err error) {\n\truntime := &util.RuntimeOptions{}\n\t_result = &ModifyParametersResponse{}\n\t_body, _err := client.ModifyParametersWithOptions(request, runtime)\n\tif _err != nil {\n\t\treturn _result, _err\n\t}\n\t_result = _body\n\treturn _result, _err\n}", "title": "" }, { "docid": "207b573799b9baaed59e8288cc8853fa", "score": "0.44107088", "text": "func (b *SwaggerBuilder) Parameters(v ParameterMap) *SwaggerBuilder {\n\tb.lock.Lock()\n\tdefer b.lock.Unlock()\n\tif b.target == nil {\n\t\treturn b\n\t}\n\tb.target.parameters = v\n\treturn b\n}", "title": "" }, { "docid": "710c290dd8ca7b0cdd2a4947687155b2", "score": "0.44093707", "text": "func (o GoogleCloudDatapipelinesV1LaunchTemplateRequestResponseOutput) LaunchParameters() GoogleCloudDatapipelinesV1LaunchTemplateParametersResponseOutput {\n\treturn o.ApplyT(func(v GoogleCloudDatapipelinesV1LaunchTemplateRequestResponse) GoogleCloudDatapipelinesV1LaunchTemplateParametersResponse {\n\t\treturn v.LaunchParameters\n\t}).(GoogleCloudDatapipelinesV1LaunchTemplateParametersResponseOutput)\n}", "title": "" }, { "docid": "61612a9c5e717aa6e662e3dc84ec5d5b", "score": "0.44015127", "text": "func (templater *Templater) SetTemplateFile(id string, file string) error {\n\tbytes, err := ioutil.ReadFile(file)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn templater.SetTemplateString(id, string(bytes))\n}", "title": "" }, { "docid": "1d88fc156a77a9f20eb1dea700e021ef", "score": "0.44014463", "text": "func (templater *Templater) SetTemplateString(id string, body string) error {\n\ttpl, err := template.New(\"\").Parse(body)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif templater.templates == nil {\n\t\ttemplater.templates = make(map[string]*template.Template, 1)\n\t}\n\n\ttemplater.templates[id] = tpl\n\treturn nil\n}", "title": "" }, { "docid": "307c6825a08be0f8b62fa6dcc7151df9", "score": "0.4387094", "text": "func (o *ListClusterTemplateInstancesParams) SetTimeout(timeout time.Duration) {\n\to.timeout = timeout\n}", "title": "" }, { "docid": "d5c465eabb470a33dd712813abd76e28", "score": "0.4385116", "text": "func (transaction *ContractCreateTransaction) SetConstructorParameters(params *ContractFunctionParameters) *ContractCreateTransaction {\n\ttransaction._RequireNotFrozen()\n\ttransaction.parameters = params._Build(nil)\n\treturn transaction\n}", "title": "" }, { "docid": "3340edf11c84254a004d373c3df50783", "score": "0.43847194", "text": "func (o *IdentityVerificationCreateResponse) SetTemplate(v IdentityVerificationTemplateReference) {\n\to.Template = v\n}", "title": "" }, { "docid": "3f9fba9984acf05fb4e30c2e16778607", "score": "0.4380569", "text": "func (s *ViewContent) SetTemplate(v string) *ViewContent {\n\ts.Template = &v\n\treturn s\n}", "title": "" }, { "docid": "03cdfd299bc22646065dbba3f89bb564", "score": "0.43749133", "text": "func (s *UpdateStackInput) SetTemplateBody(v string) *UpdateStackInput {\n\ts.TemplateBody = &v\n\treturn s\n}", "title": "" }, { "docid": "ea6a20e51b98d6395dc61a00a7782905", "score": "0.4372347", "text": "func (o *DnsViewDataData) SetViewClassParameters(v []ApiClassParameterOutputEntry) {\n\to.ViewClassParameters = &v\n}", "title": "" }, { "docid": "743da1aafec0b460bb213056dccdeb1b", "score": "0.43666708", "text": "func (options *UpdateTemplateOptions) SetTemplateName(templateName string) *UpdateTemplateOptions {\n\toptions.TemplateName = core.StringPtr(templateName)\n\treturn options\n}", "title": "" }, { "docid": "c79520a775528df42b42cbb92d7abaf1", "score": "0.4363258", "text": "func (in *OverrideLaunchTemplateSpecificationParameters) DeepCopy() *OverrideLaunchTemplateSpecificationParameters {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(OverrideLaunchTemplateSpecificationParameters)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "a3f1bb5eea361a594a3e89a822177fb3", "score": "0.4361731", "text": "func (o *GetV1ChecklistTemplatesParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "b26c8ccd7b7ffa43de112919424abbca", "score": "0.43577614", "text": "func NewTemplateProperties(name string, cores float32, ram float32, storageSize float32) *TemplateProperties {\n\tthis := TemplateProperties{}\n\n\tthis.Name = &name\n\tthis.Cores = &cores\n\tthis.Ram = &ram\n\tthis.StorageSize = &storageSize\n\n\treturn &this\n}", "title": "" } ]
d2befeabfe3d8924dab425dad4aa515f
Returns the number of elements within the map.
[ { "docid": "b57c48304f2c1494ebfea814e87e1b3a", "score": "0.65624815", "text": "func (m ConcurrentMap) Count() int {\n\tcount := 0\n\tfor i := 0; i < len(m); i++ {\n\t\tshard := m[i]\n\t\tshard.RLock()\n\t\tcount += len(shard.items)\n\t\tshard.RUnlock()\n\t}\n\treturn count\n}", "title": "" } ]
[ { "docid": "e0e7e79ca4cc46ba21456ac024239ff0", "score": "0.79388684", "text": "func (m *Map) Count() int {\n\treturn len(m.array)\n}", "title": "" }, { "docid": "aae6a6f542aeed8409660f1d195fd417", "score": "0.77060735", "text": "func (m *Map) Len() int { return m.len }", "title": "" }, { "docid": "7558e7f051e3dcb2ef6cfe4bbdc59edd", "score": "0.7667116", "text": "func (m *HashMap) Len() int {\n\tm.mux.RLock()\n\tlength := len(m.m)\n\tm.mux.RUnlock()\n\treturn length\n}", "title": "" }, { "docid": "0a9f0da49307f83f1cede4752a5c28f8", "score": "0.7637193", "text": "func (m Map) Len() int {\n\treturn int(m.len)\n}", "title": "" }, { "docid": "69ff0c84cae5126577045ae1ec362749", "score": "0.76166964", "text": "func (d *Map[K, V]) Len() int {\n\treturn d.ht[0].used + d.ht[1].used\n}", "title": "" }, { "docid": "c46ce94c6df672c98f4737ebe72a7c1d", "score": "0.7556883", "text": "func (h *Map) Len() int {\n\tl := 0\n\tfor _, v4 := range h.name4 {\n\t\tl += len(v4)\n\t}\n\tfor _, v6 := range h.name6 {\n\t\tl += len(v6)\n\t}\n\tfor _, a := range h.addr {\n\t\tl += len(a)\n\t}\n\treturn l\n}", "title": "" }, { "docid": "7413abfad4fc599068db6e73fdc38986", "score": "0.7498256", "text": "func (m *Map) size() int {\n\ttable := (*mapTable)(atomic.LoadPointer(&m.table))\n\treturn int(sumSize(table))\n}", "title": "" }, { "docid": "8dc75cd7461ad0ca816360bfb33c1fdc", "score": "0.74519753", "text": "func (m *Map) Size() int {\n\tm.mu.RLock()\n\tlength := len(m.data)\n\tm.mu.RUnlock()\n\treturn length\n}", "title": "" }, { "docid": "6bd76447f6a893b16246de247a45f4bf", "score": "0.74133074", "text": "func (m *HashMap) Len() int {\n\treturn len(m.m)\n}", "title": "" }, { "docid": "367932ce5c2e95b128b54d35fe3bbd66", "score": "0.7289002", "text": "func (m *Map) Size() int {\n\treturn len(m.m)\n}", "title": "" }, { "docid": "367932ce5c2e95b128b54d35fe3bbd66", "score": "0.7289002", "text": "func (m *Map) Size() int {\n\treturn len(m.m)\n}", "title": "" }, { "docid": "6a99c84cd24cc64c20437c00c1039fac", "score": "0.7267693", "text": "func (e *ENGAmiiboMap) Len() int { return len(*e) }", "title": "" }, { "docid": "ef99de23b34b762edd291668d8c24b31", "score": "0.72525585", "text": "func (m *linkedMap) len() int {\n\treturn len(m.m)\n}", "title": "" }, { "docid": "30d8a782ba48111d53cab508c884bd64", "score": "0.7199719", "text": "func (pm *PendingMap) Size() int {\n\tpm.mu.RLock()\n\tdefer pm.mu.RUnlock()\n\n\tvar size int\n\tfor _, v := range pm.data {\n\t\tsize += len(v)\n\t}\n\treturn size\n}", "title": "" }, { "docid": "fa3a94f01395ac781e55c4c89fb9b7c2", "score": "0.7149034", "text": "func (r SortedIntToStringMap) Size() int { return r.root.size() }", "title": "" }, { "docid": "90093ee92cc320841a9b1f6f2593c889", "score": "0.71109486", "text": "func (mm *MultiMap[K, V]) Size() int {\n\tmm.locker.RLock()\n\tdefer mm.locker.RUnlock()\n\n\treturn mm.tree.Size()\n}", "title": "" }, { "docid": "f20a212321a4de4487e274819728a49b", "score": "0.7101244", "text": "func (o *OrderedMap) Len() int {\n\tfor {\n\t\tif atomic.CompareAndSwapUintptr(&o.lock, 0, 1) {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tlength := len(o.i)\n\n\tatomic.StoreUintptr(&o.lock, 0)\n\treturn length\n}", "title": "" }, { "docid": "09cfcc59a14bf84b82feaa16ed284e23", "score": "0.7097804", "text": "func (m CMap) Len() int {\n\tvar l int\n\tm.read(func() {\n\t\tl = len(m.m)\n\t})\n\treturn l\n}", "title": "" }, { "docid": "b702d42f323df13a3eaf63da0e0dfb93", "score": "0.7093925", "text": "func (m *HandleMap) Len() int {\n\tl := len(m.ints) + len(m.strs)\n\tfor _, v := range m.partitionInts {\n\t\tl += len(v)\n\t}\n\tfor _, v := range m.partitionStrs {\n\t\tl += len(v)\n\t}\n\treturn l\n}", "title": "" }, { "docid": "a1a41d25a43fe0e17145b9afc83adbbb", "score": "0.70805377", "text": "func (m *StrAnyMap) Size() int {\n\tm.mu.RLock()\n\tlength := len(m.data)\n\tm.mu.RUnlock()\n\treturn length\n}", "title": "" }, { "docid": "78ee1d54b89aed1b9622095e4108bb86", "score": "0.70692194", "text": "func (s *OrderedMap) Len() int {\n\treturn len(s.keys)\n}", "title": "" }, { "docid": "d323b38be9b95af2f47f0b9bd9da7731", "score": "0.70306575", "text": "func (m *OSMap) Len() int {\n\treturn m.length\n}", "title": "" }, { "docid": "5c5d6180a1ac5353cb01c164d74b1c59", "score": "0.7017477", "text": "func (m HamtMap) Size() int {\n\treturn m.myMap.Size()\n}", "title": "" }, { "docid": "a4f91b63b7930b4c8f6332ec50a0dd5b", "score": "0.7013164", "text": "func (s *SafeMap) Len() int {\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\n\treturn s.len()\n}", "title": "" }, { "docid": "3395490e52eacbf06f7a3b279bc6f1bb", "score": "0.7012092", "text": "func (m *MemAwareMap[K, V]) Len() int {\n\treturn len(m.M)\n}", "title": "" }, { "docid": "47d297f415cafc55c5cc0b76acce5b8e", "score": "0.6982507", "text": "func (om *OrderedMap) Len() int {\n\treturn len(om.m)\n}", "title": "" }, { "docid": "f15cd878cb139cb32079466f9dd2b2f8", "score": "0.69673836", "text": "func (m *Map) Size() int {\n\treturn m.tree.Size()\n}", "title": "" }, { "docid": "d05e54f81a0e32253f7522fcd258242b", "score": "0.69532114", "text": "func (d *LazyStringerMap) Len() int {\n\td.lazyInit() // non-nil me ...\n\td.l.RLock() // protect me, and ...\n\tdefer d.l.RUnlock() // release me, let me go ...\n\treturn len(d.val)\n}", "title": "" }, { "docid": "e6f89c1db5c75e496856a5aa9ae92cce", "score": "0.69251734", "text": "func ( j *Jtree ) Get_ele_count( name string ) ( int ) {\n\t\n\tthing := j.jmap[name]\n\tif thing == nil {\n\t\treturn -1\n\t}\n\t\n\ta, ok := thing.( []interface{} )\n\tif ! ok {\n\t\treturn -1\n\t}\n\n\treturn len( a )\n}", "title": "" }, { "docid": "c0a778669072cf1dc1b1ea42f934bed0", "score": "0.691807", "text": "func (s *SafeMap) len() int {\n\treturn len(s.storage)\n}", "title": "" }, { "docid": "e98e666516548440d13ebb7cd117d948", "score": "0.6913788", "text": "func (hm *HashMap) Size() uint64 {\n\treturn hm.set.Size()\n}", "title": "" }, { "docid": "a68a44d1c5cbec27bf60df636846f33c", "score": "0.6904262", "text": "func (c *ConcurrentMap) Length() int {\n\tc.RLock()\n\tdefer c.RUnlock()\n\n\treturn len(c.data)\n}", "title": "" }, { "docid": "6c66bc591dd2e5f12ee70ef1429805dd", "score": "0.688636", "text": "func (h *SafeHashMap) Len() int {\n\treturn len(h.data)\n}", "title": "" }, { "docid": "13f5607227113f9086cc7fe01857d8d6", "score": "0.68806297", "text": "func (em *ExipreMap) Size() int {\n\tem.mu.RLock()\n\tdefer em.mu.RUnlock()\n\treturn len(em.store)\n}", "title": "" }, { "docid": "9716aafbc15b2753a467668284565936", "score": "0.68657804", "text": "func (m *ShardMap) Size() int {\n\tm.RLock()\n\tsize := 0\n\tfor _, a := range m.aggregators {\n\t\ta.RLock()\n\t\tsize += a.Size()\n\t\ta.RUnlock()\n\t}\n\tm.RUnlock()\n\treturn size\n}", "title": "" }, { "docid": "ba5cdaf9a551ea800c086d3fb117a635", "score": "0.68540746", "text": "func (m *PageMap) Len() int {\n\treturn m.size\n}", "title": "" }, { "docid": "cf98d37ac10c47acb4694cabccc9c148", "score": "0.684615", "text": "func (m CiMap) Count() int {\n\tcount := 0\n\tfor i := 0; i < CiMapShardCount; i++ {\n\t\tshard := m[i]\n\t\tshard.RLock()\n\t\tcount += len(shard.items)\n\t\tshard.RUnlock()\n\t}\n\treturn count\n}", "title": "" }, { "docid": "70bd73ee98335b7a6d4c923c6a01226d", "score": "0.6833959", "text": "func MapLen(inmap [26]int) int {\n s:=0\n for i:=0; i<26; i++{\n s += inmap[i]\n }\n return s\n}", "title": "" }, { "docid": "bfa90945e762be3e5789397a0101968d", "score": "0.6827688", "text": "func (r *ConcurrentMap) Count() int {\n\tr.Lock()\n\tdefer r.Unlock()\n\treturn len(r.m)\n}", "title": "" }, { "docid": "4dd8d66b7d6fb05d266782f4ac4b2412", "score": "0.68117654", "text": "func (h *HashMap) Count() (int, error) {\n\tvar value sql.NullInt32\n\trows, err := h.host.db.Query(fmt.Sprintf(\"SELECT COUNT(*) FROM (SELECT DISTINCT %s FROM %s) as temp\", ownerCol, h.table))\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif rows == nil {\n\t\treturn 0, ErrNoAvailableValues\n\t}\n\tdefer rows.Close()\n\trows.Next()\n\terr = rows.Scan(&value)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn int(value.Int32), nil\n}", "title": "" }, { "docid": "1854423a0619fe55660bd8d9060bac81", "score": "0.68101317", "text": "func (pm *PendingMap) Len() int {\n\tpm.mu.RLock()\n\tdefer pm.mu.RUnlock()\n\n\treturn len(pm.data)\n}", "title": "" }, { "docid": "a3701748818f57c4d63e050b31e48163", "score": "0.6805263", "text": "func (b *MapBuilder) Len() int { return b.listBuilder.Len() }", "title": "" }, { "docid": "58f9c85894b3044876e199cf5e89fe8f", "score": "0.6796042", "text": "func (lm *LMap) Len() (ln int) {\n\tlm.l.RLock()\n\tln = len(lm.m)\n\tlm.l.RUnlock()\n\treturn\n}", "title": "" }, { "docid": "06a26cf5d3b5dfc1148d0471016f10cc", "score": "0.6768615", "text": "func (m *Map) Size() uint32 {\n\treturn m.size\n}", "title": "" }, { "docid": "bdec1e22a02207b64dc4c70037ab6270", "score": "0.6766933", "text": "func maplen(m unsafe.Pointer) int", "title": "" }, { "docid": "8fc1b239b96c1e5a70e182f9b5023c18", "score": "0.67642134", "text": "func (o *OrderedDict) Len() int {\n\treturn len(o.Map)\n}", "title": "" }, { "docid": "78d599742eb3fde8dd4289aa3c6c1d7d", "score": "0.67529243", "text": "func (tm *TypeMap) Len() int {\n\treturn len(tm.Keys)\n}", "title": "" }, { "docid": "c75338e6627d0f0b41f4e81baafa1d3f", "score": "0.6736735", "text": "func (m myMap) NKeys() int {\n\treturn 0\n}", "title": "" }, { "docid": "c75338e6627d0f0b41f4e81baafa1d3f", "score": "0.6736735", "text": "func (m myMap) NKeys() int {\n\treturn 0\n}", "title": "" }, { "docid": "c751eb90449dbffdd31816295a546d74", "score": "0.6729463", "text": "func (cm *ConnMap) Size() int {\n size := cm.m.Count()\n return size\n}", "title": "" }, { "docid": "30698d95aa8c8d39e0892c6597d30385", "score": "0.6718334", "text": "func getSyncMapLen(m *sync.Map) int {\n\tlength := 0\n\n\tm.Range(func(_, _ interface{}) bool {\n\t\tlength++\n\t\treturn true\n\t})\n\treturn length\n}", "title": "" }, { "docid": "48d8454f8ed5a705df5cc5546c530ce9", "score": "0.67157763", "text": "func (pm *PeerMap) Len() int {\n\tpm.RLock()\n\tdefer pm.RUnlock()\n\treturn len(pm.internal)\n}", "title": "" }, { "docid": "af9f89d9eea54981d2e3ebafdfb67c56", "score": "0.6708946", "text": "func (h *SafeHashMap) Size() int {\n\treturn len(h.data)\n}", "title": "" }, { "docid": "11ef934d7e6508fead8cd71d2d0c41d1", "score": "0.67074734", "text": "func (m *bai_zhan_obj_map) Count() int {\n\tresult := 0\n\n\tfor _, shard := range m {\n\t\tshard.RLock()\n\t\tresult += len(shard.items)\n\t\tshard.RUnlock()\n\t}\n\treturn result\n}", "title": "" }, { "docid": "5bb1bf97966c8a42a71d7ed90c992658", "score": "0.6705688", "text": "func (m *StrStrMap) Size() int {\n\tm.mu.RLock()\n\tlength := len(m.data)\n\tm.mu.RUnlock()\n\treturn length\n}", "title": "" }, { "docid": "da224710792c102e5c0f057c1bc97f93", "score": "0.6673926", "text": "func (m *MultiMap) Size() int {\n\treturn m.tree.Size()\n}", "title": "" }, { "docid": "699f0cafc99af76d2876642fd91f497c", "score": "0.6660644", "text": "func (s *mapKeySet) Length() int {\n\tif s == nil {\n\t\treturn 0\n\t}\n\treturn len(s.set)\n}", "title": "" }, { "docid": "ea172a9f7ced52427d61f225a690ef38", "score": "0.6640103", "text": "func (s dictionaryItemsByKey) Len() int { return len(s) }", "title": "" }, { "docid": "31cf15e2176c598ab372a4d242781fc7", "score": "0.66274786", "text": "func Len(d *Dict) int {\n\treturn d.n\n}", "title": "" }, { "docid": "c7f993fe8d0283f230182ff9743be5cd", "score": "0.6624559", "text": "func (s Sets) Size() int {\n\tif s.PsMap == nil {\n\t\treturn 0\n\t}\n\treturn s.PsMap.Size()\n}", "title": "" }, { "docid": "e4083066a9d910c302698c162831a8f4", "score": "0.66188145", "text": "func (s *shardMap) count() (count int) {\n\ts.lock.RLock()\n\tcount = len(s.m)\n\ts.lock.RUnlock()\n\treturn\n}", "title": "" }, { "docid": "26d92b3e3895de7f130d6a05f2a99f98", "score": "0.66185683", "text": "func (b *PageMapBuilder) Len() int {\n\tassert(b.m != nil) // \"immutable.PageMapBuilder: builder invalid after Map() invocation\")\n\treturn b.m.Len()\n}", "title": "" }, { "docid": "4e0d2520d1fa22ed3b6c41ea4795ac51", "score": "0.66179585", "text": "func (e edgeMap) Len(typ Type) int {\n\tif rels, ok := e[typ.Type()]; ok {\n\t\treturn len(rels)\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "96c001fcfc153d57c8ed2e900ca2931e", "score": "0.6573801", "text": "func (unified *UnifiedMapIndex) Len() int {\n\treturn unified.UserIndex.Len() + unified.ItemIndex.Len() +\n\t\tunified.UserLabelIndex.Len() + unified.ItemLabelIndex.Len() +\n\t\tunified.CtxLabelIndex.Len()\n}", "title": "" }, { "docid": "d60c6e5ad4b0593a8e546c5e73aa34d7", "score": "0.65451735", "text": "func (m *TransactionMap) Size() int {\n\tm.mutex.RLock()\n\tdefer m.mutex.RUnlock()\n\n\treturn len(m.trMap)\n}", "title": "" }, { "docid": "8c9063e9bed7529b5d17874e1dabfceb", "score": "0.65404415", "text": "func (mm *StringUintMap) Size() int {\n\tif mm == nil {\n\t\treturn 0\n\t}\n\n\treturn len(mm.m)\n}", "title": "" }, { "docid": "eca043b0e02f65f2d9039f2c7c15d23b", "score": "0.6519784", "text": "func (g *Getter) len() int {\n\tg.mu.RLock()\n\tdefer g.mu.RUnlock()\n\n\treturn len(g.m)\n}", "title": "" }, { "docid": "78cff22c17d812a7d8342a79230ddcad", "score": "0.6506189", "text": "func (bm *BitMap64) Count() uint {\n\treturn popCount3(bm.Bits)\n}", "title": "" }, { "docid": "03f9e96662137facdc58185e17050f3b", "score": "0.64961517", "text": "func (unified *UnifiedMapIndex) CountItems() int {\n\treturn unified.ItemIndex.Len()\n}", "title": "" }, { "docid": "88c96cdfafac6c864c768c139152fa09", "score": "0.64917564", "text": "func (b buffers) Len() (l map[int]int) {\n\tl = make(map[int]int)\n\tfor where, b := range b {\n\t\tl[where] = b.count\n\t}\n\treturn\n}", "title": "" }, { "docid": "5b5c623a299c5a7b0edc7d8645bd5ddc", "score": "0.6480981", "text": "func (t enumType) NumberOfElements() uint16 {\n\treturn uint16(len(t.indexToVal))\n}", "title": "" }, { "docid": "cb9fb2652933097736f814bb6892bf0f", "score": "0.6480374", "text": "func getNumKeys(list map[int]Class) int {\n\tnum := 0\n\n\tfor _ = range list {\n\t\tnum += 1\n\t}\n\n\treturn num\n}", "title": "" }, { "docid": "9f4ba54559dd6596434811fe4bc6dc15", "score": "0.64798325", "text": "func GetPodLabelMapSize(podLabelMap PodLabelMap) int {\n\tvar res int\n\tfor key, val := range podLabelMap {\n\t\tres += len([]byte(key))\n\t\tres += len([]byte(val))\n\t}\n\treturn res\n}", "title": "" }, { "docid": "9ba88d66b97533facd77a64fa07025f2", "score": "0.64379513", "text": "func (l *leafNode) size() (int, error) {\n\tsize := 1 // Node type\n\n\tsize += 2 // kv count\n\n\tfor _, kv := range l.values {\n\t\tsize += 2 // Key length\n\t\tsize += len(kv.key) // Key\n\t\tsize += 2 // Value length\n\t\tsize += len(kv.value) // Value\n\t\tsize += 8 // Ts\n\t\tsize += 8 // hOff\n\t\tsize += 8 // hCount\n\t}\n\n\treturn size, nil\n}", "title": "" }, { "docid": "29945165ee5c54aaad6139f7a7567bab", "score": "0.6434526", "text": "func (tm *TokenMap) Len() int {\n\treturn len(tm.Tokens)\n}", "title": "" }, { "docid": "a1da3579fb0fb96ba4cc8279a098fd77", "score": "0.64270496", "text": "func (list Entries) Len() int {\n return len(list)\n}", "title": "" }, { "docid": "4a62ed8cef934affcf2d18662dcb2d8e", "score": "0.6419549", "text": "func (f *Field) GetArraySize(value data.Map) int {\n\tif !f.HasArrayComponent {\n\t\treturn 0\n\t}\n\tfield := f\n\tfor {\n\t\tsubValue := value.Get(field.Field)\n\t\tif subValue == nil {\n\t\t\treturn 0\n\t\t}\n\t\tif field.IsArray {\n\t\t\treturn len(toolbox.AsSlice(subValue))\n\t\t}\n\t\tif !field.HasSubPath {\n\t\t\tbreak\n\t\t}\n\n\t\tvalue = data.Map(toolbox.AsMap(subValue))\n\t\tfield = field.Child\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "a565ef661b1e852ecb35b1c71107a591", "score": "0.64041495", "text": "func (h *hostsMap) Len() int {\n\tl := 0\n\tfor _, v4 := range h.byNameV4 {\n\t\tl += len(v4)\n\t}\n\tfor _, v6 := range h.byNameV6 {\n\t\tl += len(v6)\n\t}\n\tfor _, a := range h.byAddr {\n\t\tl += len(a)\n\t}\n\treturn l\n}", "title": "" }, { "docid": "08bd721506961be1c5356f8ae576dfc7", "score": "0.6385789", "text": "func (m *ConcurrentMap) Count() (count int) {\n\tfor i := 0; i < m.numOfShard; i++ {\n\t\tshardMap := m.shard[i]\n\t\tcount += shardMap.count()\n\t}\n\treturn\n}", "title": "" }, { "docid": "63f8b6ab266ce2d017500176ef84a6a6", "score": "0.6381566", "text": "func (m StringLatestMap) Size() int {\n\treturn len(m)\n}", "title": "" }, { "docid": "cbe9f5ceb660878148b21cba30526796", "score": "0.63802886", "text": "func (l *linkedHashMap) Length() int {\n\treturn l.currentLength\n}", "title": "" }, { "docid": "b0e2483a17974a24081236388baa6171", "score": "0.63790774", "text": "func SyncMapLength(x *sync.Map) (length int) {\n\tx.Range(func(key interface{}, value interface{}) bool {\n\t\tlength = length + 1\n\t\treturn true\n\t})\n\treturn\n}", "title": "" }, { "docid": "643abe4d8ac0176ce8f33cf66bf68bd4", "score": "0.63731295", "text": "func (c *container) count() (n int) {\n\treturn c.countRange(0, (bitmapN*64)+1)\n}", "title": "" }, { "docid": "4200c5bf19b44f0d253f1e562be52778", "score": "0.6357904", "text": "func (db *database_mapimpl) NEntries() (int, error) {\n\treturn len(db.db), nil\n}", "title": "" }, { "docid": "dbc690d428c786fcf795873ff1a8e763", "score": "0.6357729", "text": "func (c *Cache) Len() int {\n\tl := 0\n\tfor _, s := range c.shards {\n\t\tl += s.Len()\n\t}\n\treturn l\n}", "title": "" }, { "docid": "584731e84cb2d1b986c833555a0f85df", "score": "0.63461393", "text": "func (n *innerNode) size() (int, error) {\n\tsize := 1 // Node type\n\n\tsize += 2 // Child count\n\n\tfor _, c := range n.nodes {\n\t\tsize += 2 // minKey length\n\t\tsize += len(c.minKey()) // minKey\n\t\tsize += 8 // ts\n\t\tsize += 8 // offset\n\t\tsize += 8 // min offset\n\t}\n\n\treturn size, nil\n}", "title": "" }, { "docid": "6e8b5f300f795835a9f72db2cdd30409", "score": "0.63406587", "text": "func (a MeasurementsTagKeys) Size() int {\n\tn := 0\n\tfor _, m := range a {\n\t\tn += len(m.Measurement)\n\t\tfor _, k := range m.TagKeys {\n\t\t\tn += len(k)\n\t\t}\n\t}\n\treturn n\n}", "title": "" }, { "docid": "b726c85cb549669e0dbbb39197b27876", "score": "0.6335105", "text": "func (a ByKey) Len() int { return len(a) }", "title": "" }, { "docid": "b726c85cb549669e0dbbb39197b27876", "score": "0.6335105", "text": "func (a ByKey) Len() int { return len(a) }", "title": "" }, { "docid": "b726c85cb549669e0dbbb39197b27876", "score": "0.6335105", "text": "func (a ByKey) Len() int { return len(a) }", "title": "" }, { "docid": "b726c85cb549669e0dbbb39197b27876", "score": "0.6335105", "text": "func (a ByKey) Len() int { return len(a) }", "title": "" }, { "docid": "b726c85cb549669e0dbbb39197b27876", "score": "0.6335105", "text": "func (a ByKey) Len() int { return len(a) }", "title": "" }, { "docid": "b726c85cb549669e0dbbb39197b27876", "score": "0.6335105", "text": "func (a ByKey) Len() int { return len(a) }", "title": "" }, { "docid": "b726c85cb549669e0dbbb39197b27876", "score": "0.6335105", "text": "func (a ByKey) Len() int { return len(a) }", "title": "" }, { "docid": "b726c85cb549669e0dbbb39197b27876", "score": "0.6335105", "text": "func (a ByKey) Len() int { return len(a) }", "title": "" }, { "docid": "b726c85cb549669e0dbbb39197b27876", "score": "0.6335105", "text": "func (a ByKey) Len() int { return len(a) }", "title": "" }, { "docid": "b726c85cb549669e0dbbb39197b27876", "score": "0.6335105", "text": "func (a ByKey) Len() int { return len(a) }", "title": "" }, { "docid": "b726c85cb549669e0dbbb39197b27876", "score": "0.6335105", "text": "func (a ByKey) Len() int { return len(a) }", "title": "" }, { "docid": "b726c85cb549669e0dbbb39197b27876", "score": "0.6335105", "text": "func (a ByKey) Len() int { return len(a) }", "title": "" }, { "docid": "b726c85cb549669e0dbbb39197b27876", "score": "0.6335105", "text": "func (a ByKey) Len() int { return len(a) }", "title": "" } ]
1cec8b1cc7c725bf8eadfec33da02a79
WriteToRequest writes these params to a swagger request
[ { "docid": "f7797ee256ab0122e67fc50618fff921", "score": "0.0", "text": "func (o *CreateSenderParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Sender != nil {\n\t\tif err := r.SetBodyParam(o.Sender); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" } ]
[ { "docid": "bc757c2e0f9ad8aa5a73cbd1184bdc06", "score": "0.7469954", "text": "func (o *AddParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// query param api-version\n\tqrAPIVersion := o.APIVersion\n\tqAPIVersion := qrAPIVersion\n\tif qAPIVersion != \"\" {\n\t\tif err := r.SetQueryParam(\"api-version\", qAPIVersion); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param containerDescriptor\n\tif err := r.SetPathParam(\"containerDescriptor\", o.ContainerDescriptor); err != nil {\n\t\treturn err\n\t}\n\n\t// path param organization\n\tif err := r.SetPathParam(\"organization\", o.Organization); err != nil {\n\t\treturn err\n\t}\n\n\t// path param subjectDescriptor\n\tif err := r.SetPathParam(\"subjectDescriptor\", o.SubjectDescriptor); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "979e917ac27456c54553009826b153ff", "score": "0.7329633", "text": "func (o *WeaviateThingsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param thingId\n\tif err := r.SetPathParam(\"thingId\", o.ThingID.String()); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a3bffede9447fa9af6d4bac5d0d1153c", "score": "0.72438365", "text": "func (o *UpdateDeviceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Body != nil {\n\t\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif o.End != nil {\n\n\t\t// query param end\n\t\tvar qrEnd int64\n\t\tif o.End != nil {\n\t\t\tqrEnd = *o.End\n\t\t}\n\t\tqEnd := swag.FormatInt64(qrEnd)\n\t\tif qEnd != \"\" {\n\t\t\tif err := r.SetQueryParam(\"end\", qEnd); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// path param id\n\tif err := r.SetPathParam(\"id\", swag.FormatInt32(o.ID)); err != nil {\n\t\treturn err\n\t}\n\n\tif o.NetflowFilter != nil {\n\n\t\t// query param netflowFilter\n\t\tvar qrNetflowFilter string\n\t\tif o.NetflowFilter != nil {\n\t\t\tqrNetflowFilter = *o.NetflowFilter\n\t\t}\n\t\tqNetflowFilter := qrNetflowFilter\n\t\tif qNetflowFilter != \"\" {\n\t\t\tif err := r.SetQueryParam(\"netflowFilter\", qNetflowFilter); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.OpType != nil {\n\n\t\t// query param opType\n\t\tvar qrOpType string\n\t\tif o.OpType != nil {\n\t\t\tqrOpType = *o.OpType\n\t\t}\n\t\tqOpType := qrOpType\n\t\tif qOpType != \"\" {\n\t\t\tif err := r.SetQueryParam(\"opType\", qOpType); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Start != nil {\n\n\t\t// query param start\n\t\tvar qrStart int64\n\t\tif o.Start != nil {\n\t\t\tqrStart = *o.Start\n\t\t}\n\t\tqStart := swag.FormatInt64(qrStart)\n\t\tif qStart != \"\" {\n\t\t\tif err := r.SetQueryParam(\"start\", qStart); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "91cdafde29b5414b6d330acab5fb6ee0", "score": "0.7236036", "text": "func (o *SchemaGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Model != nil {\n\n\t\t// query param model\n\t\tvar qrModel string\n\t\tif o.Model != nil {\n\t\t\tqrModel = *o.Model\n\t\t}\n\t\tqModel := qrModel\n\t\tif qModel != \"\" {\n\t\t\tif err := r.SetQueryParam(\"model\", qModel); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d67a9be6500fd72f60dc3c2fe8ec6d10", "score": "0.72251445", "text": "func (o *UpdateAPIParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.APIBody != nil {\n\t\tif err := r.SetBodyParam(o.APIBody); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param api\n\tif err := r.SetPathParam(\"api\", o.APIID); err != nil {\n\t\treturn err\n\t}\n\n\t// path param tid\n\tif err := r.SetPathParam(\"tid\", o.Tid); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "86c96026372c72f0e11231dd14605329", "score": "0.71882373", "text": "func (o *GetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// query param api-version\n\tqrAPIVersion := o.APIVersion\n\tqAPIVersion := qrAPIVersion\n\tif qAPIVersion != \"\" {\n\t\tif err := r.SetQueryParam(\"api-version\", qAPIVersion); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif o.IncludeActionResults != nil {\n\n\t\t// query param includeActionResults\n\t\tvar qrIncludeActionResults bool\n\t\tif o.IncludeActionResults != nil {\n\t\t\tqrIncludeActionResults = *o.IncludeActionResults\n\t\t}\n\t\tqIncludeActionResults := swag.FormatBool(qrIncludeActionResults)\n\t\tif qIncludeActionResults != \"\" {\n\t\t\tif err := r.SetQueryParam(\"includeActionResults\", qIncludeActionResults); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// path param iterationId\n\tif err := r.SetPathParam(\"iterationId\", swag.FormatInt32(o.IterationID)); err != nil {\n\t\treturn err\n\t}\n\n\t// path param organization\n\tif err := r.SetPathParam(\"organization\", o.Organization); err != nil {\n\t\treturn err\n\t}\n\n\t// path param project\n\tif err := r.SetPathParam(\"project\", o.Project); err != nil {\n\t\treturn err\n\t}\n\n\t// path param runId\n\tif err := r.SetPathParam(\"runId\", swag.FormatInt32(o.RunID)); err != nil {\n\t\treturn err\n\t}\n\n\t// path param testCaseResultId\n\tif err := r.SetPathParam(\"testCaseResultId\", swag.FormatInt32(o.TestCaseResultID)); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "195939a35575300dcf2f9e0a9ac9b6f0", "score": "0.7173018", "text": "func (o *InspectParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tr.SetTimeout(o.timeout)\n\tvar res []error\n\n\tif o.OpID != nil {\n\n\t\t// header param Op-ID\n\t\tif err := r.SetHeaderParam(\"Op-ID\", *o.OpID); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t}\n\n\tif o.Config == nil {\n\t\to.Config = new(models.TaskInspectConfig)\n\t}\n\n\tif err := r.SetBodyParam(o.Config); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "49fede1d339812a525ea55184235339d", "score": "0.7166819", "text": "func (o *GetServerForDeveloperParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param aid\n\tif err := r.SetPathParam(\"aid\", o.Aid); err != nil {\n\t\treturn err\n\t}\n\n\t// path param rid\n\tif err := r.SetPathParam(\"rid\", o.Rid); err != nil {\n\t\treturn err\n\t}\n\n\t// path param tid\n\tif err := r.SetPathParam(\"tid\", o.Tid); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a87d346055d9642b2ded03ccfed33de8", "score": "0.71342725", "text": "func (o *GetServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param id\n\tif err := r.SetPathParam(\"id\", o.ID); err != nil {\n\t\treturn err\n\t}\n\n\tvaluesInclude := o.Include\n\n\tjoinedInclude := swag.JoinByFormat(valuesInclude, \"multi\")\n\t// query array param include[]\n\tif err := r.SetQueryParam(\"include[]\", joinedInclude...); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "316541c5640552b80bb8047fb27d81e8", "score": "0.7113042", "text": "func (o *PostIntrospectionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// header param Authorization\n\tif err := r.SetHeaderParam(\"Authorization\", o.Authorization); err != nil {\n\t\treturn err\n\t}\n\n\t// form param token\n\tfrToken := o.Token\n\tfToken := frToken\n\tif fToken != \"\" {\n\t\tif err := r.SetFormParam(\"token\", fToken); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c1507ed98351d5a6fe1b89be7d4d3109", "score": "0.7103632", "text": "func (o *GetPracticesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param version\n\tif err := r.SetPathParam(\"version\", o.Version); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "efc6d405daf71fe313ca5d1497edd003", "score": "0.708244", "text": "func (o *GetLatestParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Base != nil {\n\n\t\t// query param base\n\t\tvar qrBase string\n\t\tif o.Base != nil {\n\t\t\tqrBase = *o.Base\n\t\t}\n\t\tqBase := qrBase\n\t\tif qBase != \"\" {\n\t\t\tif err := r.SetQueryParam(\"base\", qBase); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tvaluesSymbols := o.Symbols\n\n\tjoinedSymbols := swag.JoinByFormat(valuesSymbols, \"\")\n\t// query array param symbols\n\tif err := r.SetQueryParam(\"symbols\", joinedSymbols...); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8d015453e48ca988e5ca369ed85d8d23", "score": "0.7078329", "text": "func (o *FindParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// header param X-Rate-Limit\n\tif err := r.SetHeaderParam(\"X-Rate-Limit\", swag.FormatInt32(o.XRateLimit)); err != nil {\n\t\treturn err\n\t}\n\n\t// form param limit\n\tfrLimit := o.Limit\n\tfLimit := swag.FormatInt32(frLimit)\n\tif err := r.SetFormParam(\"limit\", fLimit); err != nil {\n\t\treturn err\n\t}\n\n\tvar valuesTags []string\n\tfor _, v := range o.Tags {\n\t\tvaluesTags = append(valuesTags, swag.FormatInt32(v))\n\t}\n\n\tjoinedTags := swag.JoinByFormat(valuesTags, \"multi\")\n\t// form array param tags\n\tif err := r.SetFormParam(\"tags\", joinedTags...); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8e5ea81a252c4912c727f8515f801c6c", "score": "0.70770013", "text": "func (o *ConfigInspectParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param id\n\tif err := r.SetPathParam(\"id\", o.ID); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "902abf6e3ab5235c299bc61c9f714947", "score": "0.7072267", "text": "func (o *GenerateAPIKeyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.APIKeyRequest != nil {\n\t\tif err := r.SetBodyParam(o.APIKeyRequest); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "85ac73bc7ef135314a106dc5a67cc26d", "score": "0.7071831", "text": "func (o *IndexAPIKeysParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Skip != nil {\n\n\t\t// query param skip\n\t\tvar qrSkip int32\n\t\tif o.Skip != nil {\n\t\t\tqrSkip = *o.Skip\n\t\t}\n\t\tqSkip := swag.FormatInt32(qrSkip)\n\t\tif qSkip != \"\" {\n\t\t\tif err := r.SetQueryParam(\"skip\", qSkip); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Take != nil {\n\n\t\t// query param take\n\t\tvar qrTake int32\n\t\tif o.Take != nil {\n\t\t\tqrTake = *o.Take\n\t\t}\n\t\tqTake := swag.FormatInt32(qrTake)\n\t\tif qTake != \"\" {\n\t\t\tif err := r.SetQueryParam(\"take\", qTake); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// path param userId\n\tif err := r.SetPathParam(\"userId\", o.UserID); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "28c445eaa6be947253ae5cbb6da2b54b", "score": "0.7064659", "text": "func (o *StartBlockGeneratorParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\tif o.DynamicResults != nil {\n\t\tif err := r.SetBodyParam(o.DynamicResults); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param id\n\tif err := r.SetPathParam(\"id\", o.ID); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "784ba0e46839a241570bc1791673ae37", "score": "0.7032438", "text": "func (o *UpdateServiceCustomServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Body != nil {\n\t\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param id\n\tif err := r.SetPathParam(\"id\", o.ID.String()); err != nil {\n\t\treturn err\n\t}\n\n\t// path param technology\n\tif err := r.SetPathParam(\"technology\", o.Technology); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "552887ea3306b86cd5e894342a32054f", "score": "0.7031141", "text": "func (o *CreateDocumentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// form file param content\n\tif err := r.SetFileParam(\"content\", o.Content); err != nil {\n\t\treturn err\n\t}\n\n\t// path param id4n\n\tif err := r.SetPathParam(\"id4n\", o.ID4N); err != nil {\n\t\treturn err\n\t}\n\n\t// path param organizationId\n\tif err := r.SetPathParam(\"organizationId\", o.OrganizationID); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5f964889830d8bcef0cb3ba7c1c7eb91", "score": "0.70240724", "text": "func (o *AnalyseParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param fileId\n\tif err := r.SetPathParam(\"fileId\", swag.FormatInt32(o.FileID)); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "bc8146ea191c53481f92e765cb8a2f8e", "score": "0.7006709", "text": "func (o *SetFieldParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\treturn err\n\t}\n\n\t// path param field\n\tif err := r.SetPathParam(\"field\", o.Field); err != nil {\n\t\treturn err\n\t}\n\n\t// path param vcsRootLocator\n\tif err := r.SetPathParam(\"vcsRootLocator\", o.VcsRootLocator); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fe2cca55ef9e1da6f5a18cbb74501362", "score": "0.6977689", "text": "func (o *SearchByTagParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Cursor != nil {\n\n\t\t// query param cursor\n\t\tvar qrCursor string\n\t\tif o.Cursor != nil {\n\t\t\tqrCursor = *o.Cursor\n\t\t}\n\t\tqCursor := qrCursor\n\t\tif qCursor != \"\" {\n\t\t\tif err := r.SetQueryParam(\"cursor\", qCursor); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.PageSize != nil {\n\n\t\t// query param page_size\n\t\tvar qrPageSize int64\n\t\tif o.PageSize != nil {\n\t\t\tqrPageSize = *o.PageSize\n\t\t}\n\t\tqPageSize := swag.FormatInt64(qrPageSize)\n\t\tif qPageSize != \"\" {\n\t\t\tif err := r.SetQueryParam(\"page_size\", qPageSize); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// query param query\n\tqrQuery := o.Query\n\tqQuery := qrQuery\n\tif qQuery != \"\" {\n\t\tif err := r.SetQueryParam(\"query\", qQuery); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "58e27f774a087309d6f85c0207712723", "score": "0.69688535", "text": "func (o *StartCPUGeneratorParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\tif o.DynamicResults != nil {\n\t\tif err := r.SetBodyParam(o.DynamicResults); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param id\n\tif err := r.SetPathParam(\"id\", o.ID); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "85a5a13883ba12d5f2b6ddb8f2da1a94", "score": "0.6967086", "text": "func (o *UpdateRequiredParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Channel != nil {\n\n\t\t// query param Channel\n\t\tvar qrChannel string\n\t\tif o.Channel != nil {\n\t\t\tqrChannel = *o.Channel\n\t\t}\n\t\tqChannel := qrChannel\n\t\tif qChannel != \"\" {\n\t\t\tif err := r.SetQueryParam(\"Channel\", qChannel); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.CurrentVersion != nil {\n\n\t\t// query param CurrentVersion\n\t\tvar qrCurrentVersion string\n\t\tif o.CurrentVersion != nil {\n\t\t\tqrCurrentVersion = *o.CurrentVersion\n\t\t}\n\t\tqCurrentVersion := qrCurrentVersion\n\t\tif qCurrentVersion != \"\" {\n\t\t\tif err := r.SetQueryParam(\"CurrentVersion\", qCurrentVersion); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.GOARCH != nil {\n\n\t\t// query param GOARCH\n\t\tvar qrGOARCH string\n\t\tif o.GOARCH != nil {\n\t\t\tqrGOARCH = *o.GOARCH\n\t\t}\n\t\tqGOARCH := qrGOARCH\n\t\tif qGOARCH != \"\" {\n\t\t\tif err := r.SetQueryParam(\"GOARCH\", qGOARCH); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.GOOS != nil {\n\n\t\t// query param GOOS\n\t\tvar qrGOOS string\n\t\tif o.GOOS != nil {\n\t\t\tqrGOOS = *o.GOOS\n\t\t}\n\t\tqGOOS := qrGOOS\n\t\tif qGOOS != \"\" {\n\t\t\tif err := r.SetQueryParam(\"GOOS\", qGOOS); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.PackageName != nil {\n\n\t\t// query param PackageName\n\t\tvar qrPackageName string\n\t\tif o.PackageName != nil {\n\t\t\tqrPackageName = *o.PackageName\n\t\t}\n\t\tqPackageName := qrPackageName\n\t\tif qPackageName != \"\" {\n\t\t\tif err := r.SetQueryParam(\"PackageName\", qPackageName); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.ServiceName != nil {\n\n\t\t// query param ServiceName\n\t\tvar qrServiceName string\n\t\tif o.ServiceName != nil {\n\t\t\tqrServiceName = *o.ServiceName\n\t\t}\n\t\tqServiceName := qrServiceName\n\t\tif qServiceName != \"\" {\n\t\t\tif err := r.SetQueryParam(\"ServiceName\", qServiceName); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7b7cfbe49ebe334d9c535f20d26381fa", "score": "0.6947525", "text": "func (o *PluginInspectParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param name\n\tif err := r.SetPathParam(\"name\", o.Name); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "95031e33916c606c8b3428662be71b73", "score": "0.69473004", "text": "func (o *EchoParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Body != nil {\n\t\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "72bdf7d637ba5eaaba8ff362cc81ae78", "score": "0.6940592", "text": "func (o *CreateSearchParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\tif o.Body != nil {\n\t\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param owner\n\tif err := r.SetPathParam(\"owner\", o.Owner); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5835d54b5ae0aab72069412173814b07", "score": "0.6935624", "text": "func (o *GetAppDetailsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tr.SetTimeout(o.timeout)\n\tvar res []error\n\n\t// path param app_id\n\tif err := r.SetPathParam(\"app_id\", swag.FormatInt64(o.AppID)); err != nil {\n\t\treturn err\n\t}\n\n\t// path param team_id\n\tif err := r.SetPathParam(\"team_id\", swag.FormatInt64(o.TeamID)); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7df8e10d0a2f3c8080bd07cc35399b53", "score": "0.693545", "text": "func (o *UpdateSchemaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Body != nil {\n\t\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif o.Reload != nil {\n\n\t\t// query param reload\n\t\tvar qrReload bool\n\t\tif o.Reload != nil {\n\t\t\tqrReload = *o.Reload\n\t\t}\n\t\tqReload := swag.FormatBool(qrReload)\n\t\tif qReload != \"\" {\n\t\t\tif err := r.SetQueryParam(\"reload\", qReload); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// path param schemaName\n\tif err := r.SetPathParam(\"schemaName\", o.SchemaName); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9409fdf266bf3a4bbbdcc79c1ae708c9", "score": "0.6907263", "text": "func (o *GetAppTagsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// header param Authorization\n\tif err := r.SetHeaderParam(\"Authorization\", o.Authorization); err != nil {\n\t\treturn err\n\t}\n\n\t// path param appNameOrId\n\tif err := r.SetPathParam(\"appNameOrId\", o.AppNameOrID); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fd2c9c40b8dad9054d0e3ffdf9de44dd", "score": "0.6899664", "text": "func (o *GetClusterDefinitionCustomParametersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param name\n\tif err := r.SetPathParam(\"name\", o.Name); err != nil {\n\t\treturn err\n\t}\n\n\t// path param workspaceId\n\tif err := r.SetPathParam(\"workspaceId\", swag.FormatInt64(o.WorkspaceID)); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2208391a76b876bbe6bb9bbe928895a6", "score": "0.6899654", "text": "func (o *GenerateInvoiceSummaryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param namespace\n\tif err := r.SetPathParam(\"namespace\", o.Namespace); err != nil {\n\t\treturn err\n\t}\n\n\tif o.Feature != nil {\n\n\t\t// query param feature\n\t\tvar qrFeature string\n\t\tif o.Feature != nil {\n\t\t\tqrFeature = *o.Feature\n\t\t}\n\t\tqFeature := qrFeature\n\t\tif qFeature != \"\" {\n\t\t\tif err := r.SetQueryParam(\"feature\", qFeature); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.ItemID != nil {\n\n\t\t// query param itemId\n\t\tvar qrItemID string\n\t\tif o.ItemID != nil {\n\t\t\tqrItemID = *o.ItemID\n\t\t}\n\t\tqItemID := qrItemID\n\t\tif qItemID != \"\" {\n\t\t\tif err := r.SetQueryParam(\"itemId\", qItemID); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.ItemType != nil {\n\n\t\t// query param itemType\n\t\tvar qrItemType string\n\t\tif o.ItemType != nil {\n\t\t\tqrItemType = *o.ItemType\n\t\t}\n\t\tqItemType := qrItemType\n\t\tif qItemType != \"\" {\n\t\t\tif err := r.SetQueryParam(\"itemType\", qItemType); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// query param endTime\n\tqrEndTime := o.EndTime\n\tqEndTime := qrEndTime\n\tif qEndTime != \"\" {\n\t\tif err := r.SetQueryParam(\"endTime\", qEndTime); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// query param startTime\n\tqrStartTime := o.StartTime\n\tqStartTime := qrStartTime\n\tif qStartTime != \"\" {\n\t\tif err := r.SetQueryParam(\"startTime\", qStartTime); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// setting the default header value\n\tif err := r.SetHeaderParam(\"User-Agent\", utils.UserAgentGen()); err != nil {\n\t\treturn err\n\t}\n\n\tif err := r.SetHeaderParam(\"X-Amzn-Trace-Id\", utils.AmazonTraceIDGen()); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "3e48b174d67d89af76ab070b4f54e7b9", "score": "0.68978226", "text": "func (o *UnignoreParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param thingUID\n\tif err := r.SetPathParam(\"thingUID\", o.ThingUID); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ba468abd7a0f67f1643b81cd15eccbfc", "score": "0.6896794", "text": "func (o *GetIcecreamParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Name != nil {\n\n\t\t// query param name\n\t\tvar qrName string\n\t\tif o.Name != nil {\n\t\t\tqrName = *o.Name\n\t\t}\n\t\tqName := qrName\n\t\tif qName != \"\" {\n\t\t\tif err := r.SetQueryParam(\"name\", qName); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cccca927067b6568dba8c008e179776b", "score": "0.6893822", "text": "func (o *GetDevicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// header param Authorization\n\tif err := r.SetHeaderParam(\"Authorization\", o.Authorization); err != nil {\n\t\treturn err\n\t}\n\n\tif o.AccessLevel != nil {\n\n\t\t// query param accessLevel\n\t\tvar qrAccessLevel int64\n\t\tif o.AccessLevel != nil {\n\t\t\tqrAccessLevel = *o.AccessLevel\n\t\t}\n\t\tqAccessLevel := swag.FormatInt64(qrAccessLevel)\n\t\tif qAccessLevel != \"\" {\n\t\t\tif err := r.SetQueryParam(\"accessLevel\", qAccessLevel); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.CapabilitiesMode != nil {\n\n\t\t// query param capabilitiesMode\n\t\tvar qrCapabilitiesMode string\n\t\tif o.CapabilitiesMode != nil {\n\t\t\tqrCapabilitiesMode = *o.CapabilitiesMode\n\t\t}\n\t\tqCapabilitiesMode := qrCapabilitiesMode\n\t\tif qCapabilitiesMode != \"\" {\n\t\t\tif err := r.SetQueryParam(\"capabilitiesMode\", qCapabilitiesMode); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tvaluesCapability := o.Capability\n\n\tjoinedCapability := swag.JoinByFormat(valuesCapability, \"multi\")\n\t// query array param capability\n\tif err := r.SetQueryParam(\"capability\", joinedCapability...); err != nil {\n\t\treturn err\n\t}\n\n\tvaluesDeviceID := o.DeviceID\n\n\tjoinedDeviceID := swag.JoinByFormat(valuesDeviceID, \"multi\")\n\t// query array param deviceId\n\tif err := r.SetQueryParam(\"deviceId\", joinedDeviceID...); err != nil {\n\t\treturn err\n\t}\n\n\tif o.IncludeRestricted != nil {\n\n\t\t// query param includeRestricted\n\t\tvar qrIncludeRestricted bool\n\t\tif o.IncludeRestricted != nil {\n\t\t\tqrIncludeRestricted = *o.IncludeRestricted\n\t\t}\n\t\tqIncludeRestricted := swag.FormatBool(qrIncludeRestricted)\n\t\tif qIncludeRestricted != \"\" {\n\t\t\tif err := r.SetQueryParam(\"includeRestricted\", qIncludeRestricted); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tvaluesLocationID := o.LocationID\n\n\tjoinedLocationID := swag.JoinByFormat(valuesLocationID, \"multi\")\n\t// query array param locationId\n\tif err := r.SetQueryParam(\"locationId\", joinedLocationID...); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "07d05934e1ee9721b4eff7efaac06cbf", "score": "0.68699676", "text": "func (o *CreateCustomTagParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Data != nil {\n\t\tif err := r.SetBodyParam(o.Data); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f68c68a7fd1022f038d83194abe29218", "score": "0.6861378", "text": "func (o *CustomerGatewayGetApplicationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param app_id\n\tif err := r.SetPathParam(\"app_id\", o.AppID); err != nil {\n\t\treturn err\n\t}\n\n\t// path param app_type\n\tif err := r.SetPathParam(\"app_type\", o.AppType); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fb2ae04d0892a7b9bb5b11cdc46eb890", "score": "0.6860831", "text": "func (o *TenantsCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\tif o.Body != nil {\n\t\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param className\n\tif err := r.SetPathParam(\"className\", o.ClassName); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "09c8e4cb8d063cde5836da8f2b43c238", "score": "0.6859097", "text": "func (o *GetTxsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Limit != nil {\n\n\t\t// query param limit\n\t\tvar qrLimit int64\n\t\tif o.Limit != nil {\n\t\t\tqrLimit = *o.Limit\n\t\t}\n\t\tqLimit := swag.FormatInt64(qrLimit)\n\t\tif qLimit != \"\" {\n\t\t\tif err := r.SetQueryParam(\"limit\", qLimit); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.MessageAction != nil {\n\n\t\t// query param message.action\n\t\tvar qrMessageAction string\n\t\tif o.MessageAction != nil {\n\t\t\tqrMessageAction = *o.MessageAction\n\t\t}\n\t\tqMessageAction := qrMessageAction\n\t\tif qMessageAction != \"\" {\n\t\t\tif err := r.SetQueryParam(\"message.action\", qMessageAction); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.MessageSender != nil {\n\n\t\t// query param message.sender\n\t\tvar qrMessageSender string\n\t\tif o.MessageSender != nil {\n\t\t\tqrMessageSender = *o.MessageSender\n\t\t}\n\t\tqMessageSender := qrMessageSender\n\t\tif qMessageSender != \"\" {\n\t\t\tif err := r.SetQueryParam(\"message.sender\", qMessageSender); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Page != nil {\n\n\t\t// query param page\n\t\tvar qrPage int64\n\t\tif o.Page != nil {\n\t\t\tqrPage = *o.Page\n\t\t}\n\t\tqPage := swag.FormatInt64(qrPage)\n\t\tif qPage != \"\" {\n\t\t\tif err := r.SetQueryParam(\"page\", qPage); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// query param tx.height\n\tqrTxHeight := o.TxHeight\n\tqTxHeight := swag.FormatInt64(qrTxHeight)\n\tif qTxHeight != \"\" {\n\t\tif err := r.SetQueryParam(\"tx.height\", qTxHeight); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ca7037544a70e0e428ae3eef6e5564e2", "score": "0.68581337", "text": "func (o *GetV1ServicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tr.SetTimeout(o.timeout)\n\tvar res []error\n\n\tif o.Project != nil {\n\n\t\t// query param project\n\t\tvar qrProject int64\n\t\tif o.Project != nil {\n\t\t\tqrProject = *o.Project\n\t\t}\n\t\tqProject := swag.FormatInt64(qrProject)\n\t\tif qProject != \"\" {\n\t\t\tif err := r.SetQueryParam(\"project\", qProject); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Sort != nil {\n\n\t\t// query param sort\n\t\tvar qrSort string\n\t\tif o.Sort != nil {\n\t\t\tqrSort = *o.Sort\n\t\t}\n\t\tqSort := qrSort\n\t\tif qSort != \"\" {\n\t\t\tif err := r.SetQueryParam(\"sort\", qSort); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Type != nil {\n\n\t\t// query param type\n\t\tvar qrType string\n\t\tif o.Type != nil {\n\t\t\tqrType = *o.Type\n\t\t}\n\t\tqType := qrType\n\t\tif qType != \"\" {\n\t\t\tif err := r.SetQueryParam(\"type\", qType); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5d7fa70362140cd3975b500dfbc3967c", "score": "0.68567425", "text": "func (o *VolumeInspectParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param name\n\tif err := r.SetPathParam(\"name\", o.Name); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "942ccaab2c54a6f9756ca5f5056fc8e2", "score": "0.6853312", "text": "func (o *GetAllParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Count != nil {\n\n\t\t// query param Count\n\t\tvar qrCount int32\n\t\tif o.Count != nil {\n\t\t\tqrCount = *o.Count\n\t\t}\n\t\tqCount := swag.FormatInt32(qrCount)\n\t\tif qCount != \"\" {\n\t\t\tif err := r.SetQueryParam(\"Count\", qCount); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Page != nil {\n\n\t\t// query param Page\n\t\tvar qrPage int32\n\t\tif o.Page != nil {\n\t\t\tqrPage = *o.Page\n\t\t}\n\t\tqPage := swag.FormatInt32(qrPage)\n\t\tif qPage != \"\" {\n\t\t\tif err := r.SetQueryParam(\"Page\", qPage); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Search != nil {\n\n\t\t// query param Search\n\t\tvar qrSearch string\n\t\tif o.Search != nil {\n\t\t\tqrSearch = *o.Search\n\t\t}\n\t\tqSearch := qrSearch\n\t\tif qSearch != \"\" {\n\t\t\tif err := r.SetQueryParam(\"Search\", qSearch); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ec58d6673e094d4fefb5aafe5ffff134", "score": "0.68444836", "text": "func (o *DuplicateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif err := r.SetBodyParam(o.Parameters); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "356ca0a31e5765e318ce2704f336b4b5", "score": "0.6838167", "text": "func (o *GetFlowParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param id\n\tif err := r.SetPathParam(\"id\", o.ID); err != nil {\n\t\treturn err\n\t}\n\n\tif o.UIOnly != nil {\n\n\t\t// query param uiOnly\n\t\tvar qrUIOnly bool\n\n\t\tif o.UIOnly != nil {\n\t\t\tqrUIOnly = *o.UIOnly\n\t\t}\n\t\tqUIOnly := swag.FormatBool(qrUIOnly)\n\t\tif qUIOnly != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"uiOnly\", qUIOnly); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e942c161061890bcb76aec18365c19aa", "score": "0.68368655", "text": "func (o *GetServerLogsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param namespace\n\tif err := r.SetPathParam(\"namespace\", o.Namespace); err != nil {\n\t\treturn err\n\t}\n\n\t// path param podName\n\tif err := r.SetPathParam(\"podName\", o.PodName); err != nil {\n\t\treturn err\n\t}\n\n\tif o.LogType != nil {\n\n\t\t// query param logType\n\t\tvar qrLogType string\n\t\tif o.LogType != nil {\n\t\t\tqrLogType = *o.LogType\n\t\t}\n\t\tqLogType := qrLogType\n\t\tif qLogType != \"\" {\n\t\t\tif err := r.SetQueryParam(\"logType\", qLogType); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Offset != nil {\n\n\t\t// query param offset\n\t\tvar qrOffset int64\n\t\tif o.Offset != nil {\n\t\t\tqrOffset = *o.Offset\n\t\t}\n\t\tqOffset := swag.FormatInt64(qrOffset)\n\t\tif qOffset != \"\" {\n\t\t\tif err := r.SetQueryParam(\"offset\", qOffset); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Origin != nil {\n\n\t\t// query param origin\n\t\tvar qrOrigin string\n\t\tif o.Origin != nil {\n\t\t\tqrOrigin = *o.Origin\n\t\t}\n\t\tqOrigin := qrOrigin\n\t\tif qOrigin != \"\" {\n\t\t\tif err := r.SetQueryParam(\"origin\", qOrigin); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// setting the default header value\n\tif err := r.SetHeaderParam(\"User-Agent\", utils.UserAgentGen()); err != nil {\n\t\treturn err\n\t}\n\n\tif err := r.SetHeaderParam(\"X-Amzn-Trace-Id\", utils.AmazonTraceIDGen()); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "c10ee3ecfc72181fd3deb8a91e4fddd7", "score": "0.68359107", "text": "func (o *UserRequestFriendParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Body != nil {\n\t\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param namespace\n\tif err := r.SetPathParam(\"namespace\", o.Namespace); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "32cad877c483781412abc8b569afed67", "score": "0.6833736", "text": "func (o *GetDeviceConfigurationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// header param Authorization\n\tif err := r.SetHeaderParam(\"Authorization\", o.Authorization); err != nil {\n\t\treturn err\n\t}\n\n\tif o.ManufacturerName != nil {\n\n\t\t// query param manufacturerName\n\t\tvar qrManufacturerName string\n\t\tif o.ManufacturerName != nil {\n\t\t\tqrManufacturerName = *o.ManufacturerName\n\t\t}\n\t\tqManufacturerName := qrManufacturerName\n\t\tif qManufacturerName != \"\" {\n\t\t\tif err := r.SetQueryParam(\"manufacturerName\", qManufacturerName); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// query param presentationId\n\tqrPresentationID := o.PresentationID\n\tqPresentationID := qrPresentationID\n\tif qPresentationID != \"\" {\n\t\tif err := r.SetQueryParam(\"presentationId\", qPresentationID); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e39b565ae1cf63e632fabc18a8c932e5", "score": "0.68310416", "text": "func (o *EditTagParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param organizationName\n\tif err := r.SetPathParam(\"organizationName\", o.OrganizationName); err != nil {\n\t\treturn err\n\t}\n\n\t// path param projectName\n\tif err := r.SetPathParam(\"projectName\", o.ProjectName); err != nil {\n\t\treturn err\n\t}\n\tif o.Tag != nil {\n\t\tif err := r.SetBodyParam(o.Tag); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param tagLabel\n\tif err := r.SetPathParam(\"tagLabel\", o.TagLabel); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "aef9e2ba109fa84957a87bde6eed731b", "score": "0.68305045", "text": "func (o *GetDeltaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tvaluesAttributes := o.Attributes\n\n\tjoinedAttributes := swag.JoinByFormat(valuesAttributes, \"\")\n\t// query array param attributes\n\tif err := r.SetQueryParam(\"attributes\", joinedAttributes...); err != nil {\n\t\treturn err\n\t}\n\n\tif o.Cursor != nil {\n\n\t\t// query param cursor\n\t\tvar qrCursor string\n\t\tif o.Cursor != nil {\n\t\t\tqrCursor = *o.Cursor\n\t\t}\n\t\tqCursor := qrCursor\n\t\tif qCursor != \"\" {\n\t\t\tif err := r.SetQueryParam(\"cursor\", qCursor); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Limit != nil {\n\n\t\t// query param limit\n\t\tvar qrLimit int64\n\t\tif o.Limit != nil {\n\t\t\tqrLimit = *o.Limit\n\t\t}\n\t\tqLimit := swag.FormatInt64(qrLimit)\n\t\tif qLimit != \"\" {\n\t\t\tif err := r.SetQueryParam(\"limit\", qLimit); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "261c52f7de6dc2152dcdc0269e4dc489", "score": "0.68272734", "text": "func (o *SchemaObjectsUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param className\n\tif err := r.SetPathParam(\"className\", o.ClassName); err != nil {\n\t\treturn err\n\t}\n\tif o.ObjectClass != nil {\n\t\tif err := r.SetBodyParam(o.ObjectClass); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "dbe1109ad5af6a86266b6b7dd1fce5ad", "score": "0.682723", "text": "func (o *RTRCreatePutFilesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.CommentsForAuditLog != nil {\n\n\t\t// form param comments_for_audit_log\n\t\tvar frCommentsForAuditLog string\n\t\tif o.CommentsForAuditLog != nil {\n\t\t\tfrCommentsForAuditLog = *o.CommentsForAuditLog\n\t\t}\n\t\tfCommentsForAuditLog := frCommentsForAuditLog\n\t\tif fCommentsForAuditLog != \"\" {\n\t\t\tif err := r.SetFormParam(\"comments_for_audit_log\", fCommentsForAuditLog); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\t// form param description\n\tfrDescription := o.Description\n\tfDescription := frDescription\n\tif fDescription != \"\" {\n\t\tif err := r.SetFormParam(\"description\", fDescription); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\t// form file param file\n\tif err := r.SetFileParam(\"file\", o.File); err != nil {\n\t\treturn err\n\t}\n\n\tif o.Name != nil {\n\n\t\t// form param name\n\t\tvar frName string\n\t\tif o.Name != nil {\n\t\t\tfrName = *o.Name\n\t\t}\n\t\tfName := frName\n\t\tif fName != \"\" {\n\t\t\tif err := r.SetFormParam(\"name\", fName); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a6784da059bac47fd7c0d40c8955305b", "score": "0.68268687", "text": "func (o *GetServiceConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Body != nil {\n\t\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f7f475c9485f0914fe59cd1be0f57514", "score": "0.6825356", "text": "func (o *SearchParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.APIVersion != nil {\n\n\t\t// query param apiVersion\n\t\tvar qrAPIVersion string\n\n\t\tif o.APIVersion != nil {\n\t\t\tqrAPIVersion = *o.APIVersion\n\t\t}\n\t\tqAPIVersion := qrAPIVersion\n\t\tif qAPIVersion != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"apiVersion\", qAPIVersion); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.Search != nil {\n\n\t\t// query param search\n\t\tvar qrSearch string\n\n\t\tif o.Search != nil {\n\t\t\tqrSearch = *o.Search\n\t\t}\n\t\tqSearch := qrSearch\n\t\tif qSearch != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"search\", qSearch); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\t// path param sourceId\n\tif err := r.SetPathParam(\"sourceId\", o.SourceID.String()); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "085d85a100c503f7b6d1f5741d2842bf", "score": "0.6820018", "text": "func (o *QueryUnbondingParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// query param account\n\tqrAccount := o.Account\n\tqAccount := qrAccount\n\tif qAccount != \"\" {\n\t\tif err := r.SetQueryParam(\"account\", qAccount); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// query param count\n\tqrCount := o.Count\n\tqCount := swag.FormatInt32(qrCount)\n\tif qCount != \"\" {\n\t\tif err := r.SetQueryParam(\"count\", qCount); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// query param sid\n\tqrSid := o.Sid\n\tqSid := swag.FormatInt64(qrSid)\n\tif qSid != \"\" {\n\t\tif err := r.SetQueryParam(\"sid\", qSid); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// query param time\n\tqrTime := o.Time\n\tqTime := swag.FormatInt64(qrTime)\n\tif qTime != \"\" {\n\t\tif err := r.SetQueryParam(\"time\", qTime); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fcf5187ffabaa9a4d35a0af620bcd98a", "score": "0.6811307", "text": "func (o *GetValidationRequestParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param contextId\n\tif err := r.SetPathParam(\"contextId\", o.ContextID); err != nil {\n\t\treturn err\n\t}\n\n\t// path param id\n\tif err := r.SetPathParam(\"id\", o.ID); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1dfc99e3c55dea5c9ebc199698997adf", "score": "0.6806729", "text": "func (o *LogParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.ImpersonateGroup != nil {\n\n\t\t// binding items for Impersonate-Group\n\t\tjoinedImpersonateGroup := o.bindParamImpersonateGroup(reg)\n\n\t\t// header array param Impersonate-Group\n\t\tif len(joinedImpersonateGroup) > 0 {\n\t\t\tif err := r.SetHeaderParam(\"Impersonate-Group\", joinedImpersonateGroup[0]); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.ImpersonateUser != nil {\n\n\t\t// header param Impersonate-User\n\t\tif err := r.SetHeaderParam(\"Impersonate-User\", *o.ImpersonateUser); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param appName\n\tif err := r.SetPathParam(\"appName\", o.AppName); err != nil {\n\t\treturn err\n\t}\n\n\t// path param componentName\n\tif err := r.SetPathParam(\"componentName\", o.ComponentName); err != nil {\n\t\treturn err\n\t}\n\n\t// path param deploymentName\n\tif err := r.SetPathParam(\"deploymentName\", o.DeploymentName); err != nil {\n\t\treturn err\n\t}\n\n\tif o.File != nil {\n\n\t\t// query param file\n\t\tvar qrFile string\n\n\t\tif o.File != nil {\n\t\t\tqrFile = *o.File\n\t\t}\n\t\tqFile := qrFile\n\t\tif qFile != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"file\", qFile); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.Lines != nil {\n\n\t\t// query param lines\n\t\tvar qrLines string\n\n\t\tif o.Lines != nil {\n\t\t\tqrLines = *o.Lines\n\t\t}\n\t\tqLines := qrLines\n\t\tif qLines != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"lines\", qLines); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\t// path param podName\n\tif err := r.SetPathParam(\"podName\", o.PodName); err != nil {\n\t\treturn err\n\t}\n\n\tif o.Previous != nil {\n\n\t\t// query param previous\n\t\tvar qrPrevious string\n\n\t\tif o.Previous != nil {\n\t\t\tqrPrevious = *o.Previous\n\t\t}\n\t\tqPrevious := qrPrevious\n\t\tif qPrevious != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"previous\", qPrevious); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.SinceTime != nil {\n\n\t\t// query param sinceTime\n\t\tvar qrSinceTime strfmt.DateTime\n\n\t\tif o.SinceTime != nil {\n\t\t\tqrSinceTime = *o.SinceTime\n\t\t}\n\t\tqSinceTime := qrSinceTime.String()\n\t\tif qSinceTime != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"sinceTime\", qSinceTime); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7567e6bcd09b5d553a470c102c582cd5", "score": "0.6803849", "text": "func (o *UpdateClientParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Body != nil {\n\t\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param id\n\tif err := r.SetPathParam(\"id\", swag.FormatInt64(o.ID)); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1553b7812c3eb631843aacee76091079", "score": "0.68013525", "text": "func (o *AuthorizeForAutoscaleParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param crn\n\tif err := r.SetPathParam(\"crn\", o.Crn); err != nil {\n\t\treturn err\n\t}\n\n\t// path param permission\n\tif err := r.SetPathParam(\"permission\", o.Permission); err != nil {\n\t\treturn err\n\t}\n\n\t// path param tenant\n\tif err := r.SetPathParam(\"tenant\", o.Tenant); err != nil {\n\t\treturn err\n\t}\n\n\t// path param userId\n\tif err := r.SetPathParam(\"userId\", o.UserID); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "787db8a19f732efd6e2280cadd46865b", "score": "0.6797898", "text": "func (o *CountryGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Fields != nil {\n\n\t\t// query param fields\n\t\tvar qrFields string\n\t\tif o.Fields != nil {\n\t\t\tqrFields = *o.Fields\n\t\t}\n\t\tqFields := qrFields\n\t\tif qFields != \"\" {\n\t\t\tif err := r.SetQueryParam(\"fields\", qFields); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// path param id\n\tif err := r.SetPathParam(\"id\", swag.FormatInt32(o.ID)); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8e80486616e868dbce86405a3902b041", "score": "0.67951274", "text": "func (o *GetServiceAndDependenciesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Platform != nil {\n\n\t\t// query param platform\n\t\tvar qrPlatform string\n\t\tif o.Platform != nil {\n\t\t\tqrPlatform = *o.Platform\n\t\t}\n\t\tqPlatform := qrPlatform\n\t\tif qPlatform != \"\" {\n\t\t\tif err := r.SetQueryParam(\"platform\", qPlatform); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tvaluesServices := o.Services\n\n\tjoinedServices := swag.JoinByFormat(valuesServices, \"multi\")\n\t// query array param services\n\tif err := r.SetQueryParam(\"services\", joinedServices...); err != nil {\n\t\treturn err\n\t}\n\n\t// path param workspaceId\n\tif err := r.SetPathParam(\"workspaceId\", swag.FormatInt64(o.WorkspaceID)); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "08a59333595170d0cadde551c5e897f5", "score": "0.67944825", "text": "func (o *GetDevicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Authorized != nil {\n\n\t\t// query param authorized\n\t\tvar qrAuthorized bool\n\n\t\tif o.Authorized != nil {\n\t\t\tqrAuthorized = *o.Authorized\n\t\t}\n\t\tqAuthorized := swag.FormatBool(qrAuthorized)\n\t\tif qAuthorized != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"authorized\", qAuthorized); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.Role != nil {\n\n\t\t// binding items for role\n\t\tjoinedRole := o.bindParamRole(reg)\n\n\t\t// query array param role\n\t\tif err := r.SetQueryParam(\"role\", joinedRole...); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif o.SiteID != nil {\n\n\t\t// query param siteId\n\t\tvar qrSiteID string\n\n\t\tif o.SiteID != nil {\n\t\t\tqrSiteID = *o.SiteID\n\t\t}\n\t\tqSiteID := qrSiteID\n\t\tif qSiteID != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"siteId\", qSiteID); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.Type != nil {\n\n\t\t// binding items for type\n\t\tjoinedType := o.bindParamType(reg)\n\n\t\t// query array param type\n\t\tif err := r.SetQueryParam(\"type\", joinedType...); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif o.WithInterfaces != nil {\n\n\t\t// query param withInterfaces\n\t\tvar qrWithInterfaces bool\n\n\t\tif o.WithInterfaces != nil {\n\t\t\tqrWithInterfaces = *o.WithInterfaces\n\t\t}\n\t\tqWithInterfaces := swag.FormatBool(qrWithInterfaces)\n\t\tif qWithInterfaces != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"withInterfaces\", qWithInterfaces); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "efd976e388beb538ee58e1ecc766845f", "score": "0.67925125", "text": "func (o *HostRsrcPrParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// header param Authorization\n\tif err := r.SetHeaderParam(\"Authorization\", o.Authorization); err != nil {\n\t\treturn err\n\t}\n\n\tif o.Params != nil {\n\n\t\t// form param params\n\t\tvar frParams string\n\t\tif o.Params != nil {\n\t\t\tfrParams = *o.Params\n\t\t}\n\t\tfParams := frParams\n\t\tif fParams != \"\" {\n\t\t\tif err := r.SetFormParam(\"params\", fParams); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// form param resource_id\n\tfrResourceID := o.ResourceID\n\tfResourceID := frResourceID\n\tif fResourceID != \"\" {\n\t\tif err := r.SetFormParam(\"resource_id\", fResourceID); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tvaluesResourceScopes := o.ResourceScopes\n\n\tjoinedResourceScopes := swag.JoinByFormat(valuesResourceScopes, \"\")\n\t// form array param resource_scopes\n\tif err := r.SetFormParam(\"resource_scopes\", joinedResourceScopes...); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "86f14ad0fe4e84dde8a700fa035d7d28", "score": "0.6789323", "text": "func (o *AdminRetrieveEligibilitiesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param namespace\n\tif err := r.SetPathParam(\"namespace\", o.Namespace); err != nil {\n\t\treturn err\n\t}\n\n\t// path param userId\n\tif err := r.SetPathParam(\"userId\", o.UserID); err != nil {\n\t\treturn err\n\t}\n\n\tif o.PublisherUserID != nil {\n\n\t\t// query param publisherUserId\n\t\tvar qrPublisherUserID string\n\t\tif o.PublisherUserID != nil {\n\t\t\tqrPublisherUserID = *o.PublisherUserID\n\t\t}\n\t\tqPublisherUserID := qrPublisherUserID\n\t\tif qPublisherUserID != \"\" {\n\t\t\tif err := r.SetQueryParam(\"publisherUserId\", qPublisherUserID); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// query param clientId\n\tqrClientID := o.ClientID\n\tqClientID := qrClientID\n\tif qClientID != \"\" {\n\t\tif err := r.SetQueryParam(\"clientId\", qClientID); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// query param countryCode\n\tqrCountryCode := o.CountryCode\n\tqCountryCode := qrCountryCode\n\tif qCountryCode != \"\" {\n\t\tif err := r.SetQueryParam(\"countryCode\", qCountryCode); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// setting the default header value\n\tif err := r.SetHeaderParam(\"User-Agent\", utils.UserAgentGen()); err != nil {\n\t\treturn err\n\t}\n\n\tif err := r.SetHeaderParam(\"X-Amzn-Trace-Id\", utils.AmazonTraceIDGen()); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "be3ace0be26cd53f27b2ee1af4d0fb62", "score": "0.6779907", "text": "func (o *DurationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Branches != nil {\n\n\t\t// query param branches\n\t\tvar qrBranches string\n\t\tif o.Branches != nil {\n\t\t\tqrBranches = *o.Branches\n\t\t}\n\t\tqBranches := qrBranches\n\t\tif qBranches != \"\" {\n\t\t\tif err := r.SetQueryParam(\"branches\", qBranches); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// query param date\n\tqrDate := o.Date\n\tqDate := qrDate.String()\n\tif qDate != \"\" {\n\t\tif err := r.SetQueryParam(\"date\", qDate); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif o.Project != nil {\n\n\t\t// query param project\n\t\tvar qrProject string\n\t\tif o.Project != nil {\n\t\t\tqrProject = *o.Project\n\t\t}\n\t\tqProject := qrProject\n\t\tif qProject != \"\" {\n\t\t\tif err := r.SetQueryParam(\"project\", qProject); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// path param user\n\tif err := r.SetPathParam(\"user\", o.User); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2afe6a73fbf445765ca71dd06ff1242e", "score": "0.67783636", "text": "func (o *IssueGetIssueParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param index\n\tif err := r.SetPathParam(\"index\", swag.FormatInt64(o.Index)); err != nil {\n\t\treturn err\n\t}\n\n\t// path param owner\n\tif err := r.SetPathParam(\"owner\", o.Owner); err != nil {\n\t\treturn err\n\t}\n\n\t// path param repo\n\tif err := r.SetPathParam(\"repo\", o.Repo); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3ee3da0b13aa94578b3b9dbd6b261cec", "score": "0.6775518", "text": "func (o *ExecuteCommandParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param action\n\tif err := r.SetPathParam(\"action\", o.Action); err != nil {\n\t\treturn err\n\t}\n\n\t// path param source\n\tif err := r.SetPathParam(\"source\", o.Source); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f7ec57b18b49ee8e744bb32e6505705e", "score": "0.6773693", "text": "func (o *GetTestRunParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// query param api-version\n\tqrAPIVersion := o.APIVersion\n\tqAPIVersion := qrAPIVersion\n\tif qAPIVersion != \"\" {\n\t\tif err := r.SetQueryParam(\"api-version\", qAPIVersion); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param organization\n\tif err := r.SetPathParam(\"organization\", o.Organization); err != nil {\n\t\treturn err\n\t}\n\n\t// path param testRunId\n\tif err := r.SetPathParam(\"testRunId\", o.TestRunID); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "102de0ff9b66a38e9634d380b2105fec", "score": "0.67723656", "text": "func (o *UpdateDescriptionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.JSONBody != nil {\n\t\tif err := r.SetBodyParam(o.JSONBody); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param dashboardId\n\tif err := r.SetPathParam(\"dashboardId\", o.DashboardID); err != nil {\n\t\treturn err\n\t}\n\n\t// path param widgetId\n\tif err := r.SetPathParam(\"widgetId\", o.WidgetID); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4c2e95a9f2b8bee7a6a660c7e13c6191", "score": "0.6767438", "text": "func (o *InvokeActionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tr.SetTimeout(o.requestTimeout)\n\tvar res []error\n\n\t// path param actionName\n\tif err := r.SetPathParam(\"actionName\", o.ActionName); err != nil {\n\t\treturn err\n\t}\n\n\tif o.Blocking != nil {\n\n\t\t// query param blocking\n\t\tvar qrBlocking string\n\t\tif o.Blocking != nil {\n\t\t\tqrBlocking = *o.Blocking\n\t\t}\n\t\tqBlocking := qrBlocking\n\t\tif qBlocking != \"\" {\n\t\t\tif err := r.SetQueryParam(\"blocking\", qBlocking); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// path param namespace\n\tif err := r.SetPathParam(\"namespace\", o.Namespace); err != nil {\n\t\treturn err\n\t}\n\n\tif o.Payload == nil {\n\t\to.Payload = new(swagger_models.KeyValue)\n\t}\n\n\tif err := r.SetBodyParam(o.Payload); err != nil {\n\t\treturn err\n\t}\n\n\tif o.Result != nil {\n\n\t\t// query param result\n\t\tvar qrResult string\n\t\tif o.Result != nil {\n\t\t\tqrResult = *o.Result\n\t\t}\n\t\tqResult := qrResult\n\t\tif qResult != \"\" {\n\t\t\tif err := r.SetQueryParam(\"result\", qResult); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Timeout != nil {\n\n\t\t// query param timeout\n\t\tvar qrTimeout int64\n\t\tif o.Timeout != nil {\n\t\t\tqrTimeout = *o.Timeout\n\t\t}\n\t\tqTimeout := swag.FormatInt64(qrTimeout)\n\t\tif qTimeout != \"\" {\n\t\t\tif err := r.SetQueryParam(\"timeout\", qTimeout); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f20c99d08e64eda88bdf8b722df1c7c6", "score": "0.6764022", "text": "func (o *GetPageParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Count != nil {\n\n\t\t// query param count\n\t\tvar qrCount int32\n\t\tif o.Count != nil {\n\t\t\tqrCount = *o.Count\n\t\t}\n\t\tqCount := swag.FormatInt32(qrCount)\n\t\tif qCount != \"\" {\n\t\t\tif err := r.SetQueryParam(\"count\", qCount); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Page != nil {\n\n\t\t// query param page\n\t\tvar qrPage int32\n\t\tif o.Page != nil {\n\t\t\tqrPage = *o.Page\n\t\t}\n\t\tqPage := swag.FormatInt32(qrPage)\n\t\tif qPage != \"\" {\n\t\t\tif err := r.SetQueryParam(\"page\", qPage); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// path param userId\n\tif err := r.SetPathParam(\"userId\", o.UserID); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6b878843a7d737deea9cefa9722616e7", "score": "0.6761032", "text": "func (o *BulkCreatePacketGeneratorsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\tif err := r.SetBodyParam(o.Create); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6de3e77274f9a722bd3cf9023fd45dcb", "score": "0.6758589", "text": "func (o *QueryDealParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// query param count\n\tqrCount := o.Count\n\tqCount := swag.FormatInt32(qrCount)\n\tif qCount != \"\" {\n\t\tif err := r.SetQueryParam(\"count\", qCount); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// query param market\n\tqrMarket := o.Market\n\tqMarket := qrMarket\n\tif qMarket != \"\" {\n\t\tif err := r.SetQueryParam(\"market\", qMarket); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// query param sid\n\tqrSid := o.Sid\n\tqSid := swag.FormatInt64(qrSid)\n\tif qSid != \"\" {\n\t\tif err := r.SetQueryParam(\"sid\", qSid); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// query param time\n\tqrTime := o.Time\n\tqTime := swag.FormatInt64(qrTime)\n\tif qTime != \"\" {\n\t\tif err := r.SetQueryParam(\"time\", qTime); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c540af80f9ca6f6e6468e5fbb6c5f42d", "score": "0.675823", "text": "func (o *TravelExpenseSettingsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Fields != nil {\n\n\t\t// query param fields\n\t\tvar qrFields string\n\t\tif o.Fields != nil {\n\t\t\tqrFields = *o.Fields\n\t\t}\n\t\tqFields := qrFields\n\t\tif qFields != \"\" {\n\t\t\tif err := r.SetQueryParam(\"fields\", qFields); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1832e274572cef2feb89479648d65782", "score": "0.67543834", "text": "func (o *GetEventTypeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// query param api-version\n\tqrAPIVersion := o.APIVersion\n\tqAPIVersion := qrAPIVersion\n\tif qAPIVersion != \"\" {\n\t\tif err := r.SetQueryParam(\"api-version\", qAPIVersion); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param eventTypeId\n\tif err := r.SetPathParam(\"eventTypeId\", o.EventTypeID); err != nil {\n\t\treturn err\n\t}\n\n\t// path param organization\n\tif err := r.SetPathParam(\"organization\", o.Organization); err != nil {\n\t\treturn err\n\t}\n\n\t// path param publisherId\n\tif err := r.SetPathParam(\"publisherId\", o.PublisherID); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2642eabf6b15b3463c56405d108488bf", "score": "0.6752846", "text": "func (o *APIV1WebhooksPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Model != nil {\n\t\tif err := r.SetBodyParam(o.Model); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "aa2995cb779764dfcaa84f51cc049bb4", "score": "0.67519933", "text": "func (o *VscanModifyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\tif o.Info != nil {\n\t\tif err := r.SetBodyParam(o.Info); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param svm.uuid\n\tif err := r.SetPathParam(\"svm.uuid\", o.SvmUUID); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f8403714eeb20d1545e77e8de8d06dac", "score": "0.6746698", "text": "func (o *ReportUserParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Body != nil {\n\t\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param namespace\n\tif err := r.SetPathParam(\"namespace\", o.Namespace); err != nil {\n\t\treturn err\n\t}\n\n\t// setting the default header value\n\tif err := r.SetHeaderParam(\"User-Agent\", utils.UserAgentGen()); err != nil {\n\t\treturn err\n\t}\n\n\tif err := r.SetHeaderParam(\"X-Amzn-Trace-Id\", utils.AmazonTraceIDGen()); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "fc2e1366c914d7719d205e159fcef22f", "score": "0.6744226", "text": "func (o *FilteredListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.FromDate != nil {\n\n\t\t// query param fromDate\n\t\tvar qrFromDate strfmt.DateTime\n\t\tif o.FromDate != nil {\n\t\t\tqrFromDate = *o.FromDate\n\t\t}\n\t\tqFromDate := qrFromDate.String()\n\t\tif qFromDate != \"\" {\n\t\t\tif err := r.SetQueryParam(\"fromDate\", qFromDate); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// path param id4n\n\tif err := r.SetPathParam(\"id4n\", o.ID4N); err != nil {\n\t\treturn err\n\t}\n\n\tif o.IncludePrivate != nil {\n\n\t\t// query param includePrivate\n\t\tvar qrIncludePrivate bool\n\t\tif o.IncludePrivate != nil {\n\t\t\tqrIncludePrivate = *o.IncludePrivate\n\t\t}\n\t\tqIncludePrivate := swag.FormatBool(qrIncludePrivate)\n\t\tif qIncludePrivate != \"\" {\n\t\t\tif err := r.SetQueryParam(\"includePrivate\", qIncludePrivate); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Limit != nil {\n\n\t\t// query param limit\n\t\tvar qrLimit int32\n\t\tif o.Limit != nil {\n\t\t\tqrLimit = *o.Limit\n\t\t}\n\t\tqLimit := swag.FormatInt32(qrLimit)\n\t\tif qLimit != \"\" {\n\t\t\tif err := r.SetQueryParam(\"limit\", qLimit); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Offset != nil {\n\n\t\t// query param offset\n\t\tvar qrOffset int32\n\t\tif o.Offset != nil {\n\t\t\tqrOffset = *o.Offset\n\t\t}\n\t\tqOffset := swag.FormatInt32(qrOffset)\n\t\tif qOffset != \"\" {\n\t\t\tif err := r.SetQueryParam(\"offset\", qOffset); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Organization != nil {\n\n\t\t// query param organization\n\t\tvar qrOrganization string\n\t\tif o.Organization != nil {\n\t\t\tqrOrganization = *o.Organization\n\t\t}\n\t\tqOrganization := qrOrganization\n\t\tif qOrganization != \"\" {\n\t\t\tif err := r.SetQueryParam(\"organization\", qOrganization); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tvaluesQualifier := o.Qualifier\n\n\tjoinedQualifier := swag.JoinByFormat(valuesQualifier, \"multi\")\n\t// query array param qualifier\n\tif err := r.SetQueryParam(\"qualifier\", joinedQualifier...); err != nil {\n\t\treturn err\n\t}\n\n\tif o.ToDate != nil {\n\n\t\t// query param toDate\n\t\tvar qrToDate strfmt.DateTime\n\t\tif o.ToDate != nil {\n\t\t\tqrToDate = *o.ToDate\n\t\t}\n\t\tqToDate := qrToDate.String()\n\t\tif qToDate != \"\" {\n\t\t\tif err := r.SetQueryParam(\"toDate\", qToDate); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tvaluesType := o.Type\n\n\tjoinedType := swag.JoinByFormat(valuesType, \"multi\")\n\t// query array param type\n\tif err := r.SetQueryParam(\"type\", joinedType...); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "913701771b00dd7fe24e47ce747292bf", "score": "0.6742786", "text": "func (o *GetSepainstantParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tvar valuesFilterOrganisationID []string\n\tfor _, v := range o.FilterOrganisationID {\n\t\tvaluesFilterOrganisationID = append(valuesFilterOrganisationID, v.String())\n\t}\n\n\tjoinedFilterOrganisationID := swag.JoinByFormat(valuesFilterOrganisationID, \"\")\n\t// query array param filter[organisation_id]\n\tif err := r.SetQueryParam(\"filter[organisation_id]\", joinedFilterOrganisationID...); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fbe419cb1393b8e013272ca80abc0bfe", "score": "0.6740429", "text": "func (o *CheckWalletParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param currencyCode\n\tif err := r.SetPathParam(\"currencyCode\", o.CurrencyCode); err != nil {\n\t\treturn err\n\t}\n\n\t// path param namespace\n\tif err := r.SetPathParam(\"namespace\", o.Namespace); err != nil {\n\t\treturn err\n\t}\n\n\t// path param userId\n\tif err := r.SetPathParam(\"userId\", o.UserID); err != nil {\n\t\treturn err\n\t}\n\n\t// query param origin\n\tqrOrigin := o.Origin\n\tqOrigin := qrOrigin\n\tif qOrigin != \"\" {\n\t\tif err := r.SetQueryParam(\"origin\", qOrigin); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// setting the default header value\n\tif err := r.SetHeaderParam(\"User-Agent\", utils.UserAgentGen()); err != nil {\n\t\treturn err\n\t}\n\n\tif err := r.SetHeaderParam(\"X-Amzn-Trace-Id\", utils.AmazonTraceIDGen()); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "3e7f6f711a1ddbe66cd4667211a38a2c", "score": "0.6739896", "text": "func (o *GetMessageParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.AccountUID != nil {\n\n\t\t// query param account_uid\n\t\tvar qrAccountUID string\n\t\tif o.AccountUID != nil {\n\t\t\tqrAccountUID = *o.AccountUID\n\t\t}\n\t\tqAccountUID := qrAccountUID\n\t\tif qAccountUID != \"\" {\n\t\t\tif err := r.SetQueryParam(\"account_uid\", qAccountUID); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.APIVersion != nil {\n\n\t\t// header param api-version\n\t\tif err := r.SetHeaderParam(\"api-version\", *o.APIVersion); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t}\n\n\tif o.Direction != nil {\n\n\t\t// query param direction\n\t\tvar qrDirection string\n\t\tif o.Direction != nil {\n\t\t\tqrDirection = *o.Direction\n\t\t}\n\t\tqDirection := qrDirection\n\t\tif qDirection != \"\" {\n\t\t\tif err := r.SetQueryParam(\"direction\", qDirection); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Limit != nil {\n\n\t\t// query param limit\n\t\tvar qrLimit int64\n\t\tif o.Limit != nil {\n\t\t\tqrLimit = *o.Limit\n\t\t}\n\t\tqLimit := swag.FormatInt64(qrLimit)\n\t\tif qLimit != \"\" {\n\t\t\tif err := r.SetQueryParam(\"limit\", qLimit); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Offset != nil {\n\n\t\t// query param offset\n\t\tvar qrOffset int64\n\t\tif o.Offset != nil {\n\t\t\tqrOffset = *o.Offset\n\t\t}\n\t\tqOffset := swag.FormatInt64(qrOffset)\n\t\tif qOffset != \"\" {\n\t\t\tif err := r.SetQueryParam(\"offset\", qOffset); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.State != nil {\n\n\t\t// query param state\n\t\tvar qrState string\n\t\tif o.State != nil {\n\t\t\tqrState = *o.State\n\t\t}\n\t\tqState := qrState\n\t\tif qState != \"\" {\n\t\t\tif err := r.SetQueryParam(\"state\", qState); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cbcbeb97f9cb29b7a0d260026d831b67", "score": "0.67394465", "text": "func (o *GetNodesByTagParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param tagName\n\tif err := r.SetPathParam(\"tagName\", o.TagName); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "70cd13cba82cee4372bd446af42aa148", "score": "0.67379594", "text": "func (o *TestCustomRuleInputParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// query param scan_id\n\tqrScanID := o.ScanID\n\tqScanID := qrScanID\n\tif qScanID != \"\" {\n\t\tif err := r.SetQueryParam(\"scan_id\", qScanID); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif o.ViaDownload != nil {\n\n\t\t// query param via_download\n\t\tvar qrViaDownload bool\n\t\tif o.ViaDownload != nil {\n\t\t\tqrViaDownload = *o.ViaDownload\n\t\t}\n\t\tqViaDownload := swag.FormatBool(qrViaDownload)\n\t\tif qViaDownload != \"\" {\n\t\t\tif err := r.SetQueryParam(\"via_download\", qViaDownload); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "40527787853e05e3755b46b5e33109e5", "score": "0.6733208", "text": "func (o *GetPassByIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param id\n\tif err := r.SetPathParam(\"id\", swag.FormatUint64(o.ID)); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d503cabab21579c8a2d05cc073ae8a6d", "score": "0.6731302", "text": "func (o *WeaviateActionsPropertiesCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param actionId\n\tif err := r.SetPathParam(\"actionId\", o.ActionID.String()); err != nil {\n\t\treturn err\n\t}\n\n\tif o.Body != nil {\n\t\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param propertyName\n\tif err := r.SetPathParam(\"propertyName\", o.PropertyName); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "54aa9eb827b0646bb85a753d512cd0d6", "score": "0.6730317", "text": "func (o *UpdateServiceCustomServicesOrderParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Body != nil {\n\t\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param technology\n\tif err := r.SetPathParam(\"technology\", o.Technology); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d675d6a7baa0c066720cfc619fa6fc6e", "score": "0.672957", "text": "func (o *ApplicationCollectionGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Fields != nil {\n\n\t\t// binding items for fields\n\t\tjoinedFields := o.bindParamFields(reg)\n\n\t\t// query array param fields\n\t\tif err := r.SetQueryParam(\"fields\", joinedFields...); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif o.Generation != nil {\n\n\t\t// query param generation\n\t\tvar qrGeneration string\n\n\t\tif o.Generation != nil {\n\t\t\tqrGeneration = *o.Generation\n\t\t}\n\t\tqGeneration := qrGeneration\n\t\tif qGeneration != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"generation\", qGeneration); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.MaxRecords != nil {\n\n\t\t// query param max_records\n\t\tvar qrMaxRecords int64\n\n\t\tif o.MaxRecords != nil {\n\t\t\tqrMaxRecords = *o.MaxRecords\n\t\t}\n\t\tqMaxRecords := swag.FormatInt64(qrMaxRecords)\n\t\tif qMaxRecords != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"max_records\", qMaxRecords); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.Name != nil {\n\n\t\t// query param name\n\t\tvar qrName string\n\n\t\tif o.Name != nil {\n\t\t\tqrName = *o.Name\n\t\t}\n\t\tqName := qrName\n\t\tif qName != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"name\", qName); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.OrderBy != nil {\n\n\t\t// binding items for order_by\n\t\tjoinedOrderBy := o.bindParamOrderBy(reg)\n\n\t\t// query array param order_by\n\t\tif err := r.SetQueryParam(\"order_by\", joinedOrderBy...); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif o.ProtectionGranularity != nil {\n\n\t\t// query param protection_granularity\n\t\tvar qrProtectionGranularity string\n\n\t\tif o.ProtectionGranularity != nil {\n\t\t\tqrProtectionGranularity = *o.ProtectionGranularity\n\t\t}\n\t\tqProtectionGranularity := qrProtectionGranularity\n\t\tif qProtectionGranularity != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"protection_granularity\", qProtectionGranularity); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.ReturnRecords != nil {\n\n\t\t// query param return_records\n\t\tvar qrReturnRecords bool\n\n\t\tif o.ReturnRecords != nil {\n\t\t\tqrReturnRecords = *o.ReturnRecords\n\t\t}\n\t\tqReturnRecords := swag.FormatBool(qrReturnRecords)\n\t\tif qReturnRecords != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"return_records\", qReturnRecords); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.ReturnTimeout != nil {\n\n\t\t// query param return_timeout\n\t\tvar qrReturnTimeout int64\n\n\t\tif o.ReturnTimeout != nil {\n\t\t\tqrReturnTimeout = *o.ReturnTimeout\n\t\t}\n\t\tqReturnTimeout := swag.FormatInt64(qrReturnTimeout)\n\t\tif qReturnTimeout != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"return_timeout\", qReturnTimeout); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.RpoComponentsName != nil {\n\n\t\t// query param rpo.components.name\n\t\tvar qrRpoComponentsName string\n\n\t\tif o.RpoComponentsName != nil {\n\t\t\tqrRpoComponentsName = *o.RpoComponentsName\n\t\t}\n\t\tqRpoComponentsName := qrRpoComponentsName\n\t\tif qRpoComponentsName != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"rpo.components.name\", qRpoComponentsName); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.RpoComponentsRpoLocalDescription != nil {\n\n\t\t// query param rpo.components.rpo.local.description\n\t\tvar qrRpoComponentsRpoLocalDescription string\n\n\t\tif o.RpoComponentsRpoLocalDescription != nil {\n\t\t\tqrRpoComponentsRpoLocalDescription = *o.RpoComponentsRpoLocalDescription\n\t\t}\n\t\tqRpoComponentsRpoLocalDescription := qrRpoComponentsRpoLocalDescription\n\t\tif qRpoComponentsRpoLocalDescription != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"rpo.components.rpo.local.description\", qRpoComponentsRpoLocalDescription); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.RpoComponentsRpoLocalName != nil {\n\n\t\t// query param rpo.components.rpo.local.name\n\t\tvar qrRpoComponentsRpoLocalName string\n\n\t\tif o.RpoComponentsRpoLocalName != nil {\n\t\t\tqrRpoComponentsRpoLocalName = *o.RpoComponentsRpoLocalName\n\t\t}\n\t\tqRpoComponentsRpoLocalName := qrRpoComponentsRpoLocalName\n\t\tif qRpoComponentsRpoLocalName != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"rpo.components.rpo.local.name\", qRpoComponentsRpoLocalName); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.RpoComponentsRpoRemoteDescription != nil {\n\n\t\t// query param rpo.components.rpo.remote.description\n\t\tvar qrRpoComponentsRpoRemoteDescription string\n\n\t\tif o.RpoComponentsRpoRemoteDescription != nil {\n\t\t\tqrRpoComponentsRpoRemoteDescription = *o.RpoComponentsRpoRemoteDescription\n\t\t}\n\t\tqRpoComponentsRpoRemoteDescription := qrRpoComponentsRpoRemoteDescription\n\t\tif qRpoComponentsRpoRemoteDescription != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"rpo.components.rpo.remote.description\", qRpoComponentsRpoRemoteDescription); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.RpoComponentsRpoRemoteName != nil {\n\n\t\t// query param rpo.components.rpo.remote.name\n\t\tvar qrRpoComponentsRpoRemoteName string\n\n\t\tif o.RpoComponentsRpoRemoteName != nil {\n\t\t\tqrRpoComponentsRpoRemoteName = *o.RpoComponentsRpoRemoteName\n\t\t}\n\t\tqRpoComponentsRpoRemoteName := qrRpoComponentsRpoRemoteName\n\t\tif qRpoComponentsRpoRemoteName != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"rpo.components.rpo.remote.name\", qRpoComponentsRpoRemoteName); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.RpoComponentsUUID != nil {\n\n\t\t// query param rpo.components.uuid\n\t\tvar qrRpoComponentsUUID string\n\n\t\tif o.RpoComponentsUUID != nil {\n\t\t\tqrRpoComponentsUUID = *o.RpoComponentsUUID\n\t\t}\n\t\tqRpoComponentsUUID := qrRpoComponentsUUID\n\t\tif qRpoComponentsUUID != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"rpo.components.uuid\", qRpoComponentsUUID); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.RpoIsSupported != nil {\n\n\t\t// query param rpo.is_supported\n\t\tvar qrRpoIsSupported string\n\n\t\tif o.RpoIsSupported != nil {\n\t\t\tqrRpoIsSupported = *o.RpoIsSupported\n\t\t}\n\t\tqRpoIsSupported := qrRpoIsSupported\n\t\tif qRpoIsSupported != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"rpo.is_supported\", qRpoIsSupported); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.RpoLocalDescription != nil {\n\n\t\t// query param rpo.local.description\n\t\tvar qrRpoLocalDescription string\n\n\t\tif o.RpoLocalDescription != nil {\n\t\t\tqrRpoLocalDescription = *o.RpoLocalDescription\n\t\t}\n\t\tqRpoLocalDescription := qrRpoLocalDescription\n\t\tif qRpoLocalDescription != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"rpo.local.description\", qRpoLocalDescription); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.RpoLocalName != nil {\n\n\t\t// query param rpo.local.name\n\t\tvar qrRpoLocalName string\n\n\t\tif o.RpoLocalName != nil {\n\t\t\tqrRpoLocalName = *o.RpoLocalName\n\t\t}\n\t\tqRpoLocalName := qrRpoLocalName\n\t\tif qRpoLocalName != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"rpo.local.name\", qRpoLocalName); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.RpoRemoteDescription != nil {\n\n\t\t// query param rpo.remote.description\n\t\tvar qrRpoRemoteDescription string\n\n\t\tif o.RpoRemoteDescription != nil {\n\t\t\tqrRpoRemoteDescription = *o.RpoRemoteDescription\n\t\t}\n\t\tqRpoRemoteDescription := qrRpoRemoteDescription\n\t\tif qRpoRemoteDescription != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"rpo.remote.description\", qRpoRemoteDescription); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.RpoRemoteName != nil {\n\n\t\t// query param rpo.remote.name\n\t\tvar qrRpoRemoteName string\n\n\t\tif o.RpoRemoteName != nil {\n\t\t\tqrRpoRemoteName = *o.RpoRemoteName\n\t\t}\n\t\tqRpoRemoteName := qrRpoRemoteName\n\t\tif qRpoRemoteName != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"rpo.remote.name\", qRpoRemoteName); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.SmartContainer != nil {\n\n\t\t// query param smart_container\n\t\tvar qrSmartContainer string\n\n\t\tif o.SmartContainer != nil {\n\t\t\tqrSmartContainer = *o.SmartContainer\n\t\t}\n\t\tqSmartContainer := qrSmartContainer\n\t\tif qSmartContainer != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"smart_container\", qSmartContainer); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.State != nil {\n\n\t\t// query param state\n\t\tvar qrState string\n\n\t\tif o.State != nil {\n\t\t\tqrState = *o.State\n\t\t}\n\t\tqState := qrState\n\t\tif qState != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"state\", qState); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsComponentsIopsPerTb != nil {\n\n\t\t// query param statistics.components.iops.per_tb\n\t\tvar qrStatisticsComponentsIopsPerTb string\n\n\t\tif o.StatisticsComponentsIopsPerTb != nil {\n\t\t\tqrStatisticsComponentsIopsPerTb = *o.StatisticsComponentsIopsPerTb\n\t\t}\n\t\tqStatisticsComponentsIopsPerTb := qrStatisticsComponentsIopsPerTb\n\t\tif qStatisticsComponentsIopsPerTb != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.components.iops.per_tb\", qStatisticsComponentsIopsPerTb); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsComponentsIopsTotal != nil {\n\n\t\t// query param statistics.components.iops.total\n\t\tvar qrStatisticsComponentsIopsTotal string\n\n\t\tif o.StatisticsComponentsIopsTotal != nil {\n\t\t\tqrStatisticsComponentsIopsTotal = *o.StatisticsComponentsIopsTotal\n\t\t}\n\t\tqStatisticsComponentsIopsTotal := qrStatisticsComponentsIopsTotal\n\t\tif qStatisticsComponentsIopsTotal != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.components.iops.total\", qStatisticsComponentsIopsTotal); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsComponentsLatencyAverage != nil {\n\n\t\t// query param statistics.components.latency.average\n\t\tvar qrStatisticsComponentsLatencyAverage string\n\n\t\tif o.StatisticsComponentsLatencyAverage != nil {\n\t\t\tqrStatisticsComponentsLatencyAverage = *o.StatisticsComponentsLatencyAverage\n\t\t}\n\t\tqStatisticsComponentsLatencyAverage := qrStatisticsComponentsLatencyAverage\n\t\tif qStatisticsComponentsLatencyAverage != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.components.latency.average\", qStatisticsComponentsLatencyAverage); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsComponentsLatencyRaw != nil {\n\n\t\t// query param statistics.components.latency.raw\n\t\tvar qrStatisticsComponentsLatencyRaw string\n\n\t\tif o.StatisticsComponentsLatencyRaw != nil {\n\t\t\tqrStatisticsComponentsLatencyRaw = *o.StatisticsComponentsLatencyRaw\n\t\t}\n\t\tqStatisticsComponentsLatencyRaw := qrStatisticsComponentsLatencyRaw\n\t\tif qStatisticsComponentsLatencyRaw != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.components.latency.raw\", qStatisticsComponentsLatencyRaw); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsComponentsName != nil {\n\n\t\t// query param statistics.components.name\n\t\tvar qrStatisticsComponentsName string\n\n\t\tif o.StatisticsComponentsName != nil {\n\t\t\tqrStatisticsComponentsName = *o.StatisticsComponentsName\n\t\t}\n\t\tqStatisticsComponentsName := qrStatisticsComponentsName\n\t\tif qStatisticsComponentsName != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.components.name\", qStatisticsComponentsName); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsComponentsSharedStoragePool != nil {\n\n\t\t// query param statistics.components.shared_storage_pool\n\t\tvar qrStatisticsComponentsSharedStoragePool string\n\n\t\tif o.StatisticsComponentsSharedStoragePool != nil {\n\t\t\tqrStatisticsComponentsSharedStoragePool = *o.StatisticsComponentsSharedStoragePool\n\t\t}\n\t\tqStatisticsComponentsSharedStoragePool := qrStatisticsComponentsSharedStoragePool\n\t\tif qStatisticsComponentsSharedStoragePool != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.components.shared_storage_pool\", qStatisticsComponentsSharedStoragePool); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsComponentsSnapshotReserve != nil {\n\n\t\t// query param statistics.components.snapshot.reserve\n\t\tvar qrStatisticsComponentsSnapshotReserve string\n\n\t\tif o.StatisticsComponentsSnapshotReserve != nil {\n\t\t\tqrStatisticsComponentsSnapshotReserve = *o.StatisticsComponentsSnapshotReserve\n\t\t}\n\t\tqStatisticsComponentsSnapshotReserve := qrStatisticsComponentsSnapshotReserve\n\t\tif qStatisticsComponentsSnapshotReserve != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.components.snapshot.reserve\", qStatisticsComponentsSnapshotReserve); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsComponentsSnapshotUsed != nil {\n\n\t\t// query param statistics.components.snapshot.used\n\t\tvar qrStatisticsComponentsSnapshotUsed string\n\n\t\tif o.StatisticsComponentsSnapshotUsed != nil {\n\t\t\tqrStatisticsComponentsSnapshotUsed = *o.StatisticsComponentsSnapshotUsed\n\t\t}\n\t\tqStatisticsComponentsSnapshotUsed := qrStatisticsComponentsSnapshotUsed\n\t\tif qStatisticsComponentsSnapshotUsed != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.components.snapshot.used\", qStatisticsComponentsSnapshotUsed); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsComponentsSpaceAvailable != nil {\n\n\t\t// query param statistics.components.space.available\n\t\tvar qrStatisticsComponentsSpaceAvailable string\n\n\t\tif o.StatisticsComponentsSpaceAvailable != nil {\n\t\t\tqrStatisticsComponentsSpaceAvailable = *o.StatisticsComponentsSpaceAvailable\n\t\t}\n\t\tqStatisticsComponentsSpaceAvailable := qrStatisticsComponentsSpaceAvailable\n\t\tif qStatisticsComponentsSpaceAvailable != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.components.space.available\", qStatisticsComponentsSpaceAvailable); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsComponentsSpaceLogicalUsed != nil {\n\n\t\t// query param statistics.components.space.logical_used\n\t\tvar qrStatisticsComponentsSpaceLogicalUsed string\n\n\t\tif o.StatisticsComponentsSpaceLogicalUsed != nil {\n\t\t\tqrStatisticsComponentsSpaceLogicalUsed = *o.StatisticsComponentsSpaceLogicalUsed\n\t\t}\n\t\tqStatisticsComponentsSpaceLogicalUsed := qrStatisticsComponentsSpaceLogicalUsed\n\t\tif qStatisticsComponentsSpaceLogicalUsed != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.components.space.logical_used\", qStatisticsComponentsSpaceLogicalUsed); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsComponentsSpaceProvisioned != nil {\n\n\t\t// query param statistics.components.space.provisioned\n\t\tvar qrStatisticsComponentsSpaceProvisioned string\n\n\t\tif o.StatisticsComponentsSpaceProvisioned != nil {\n\t\t\tqrStatisticsComponentsSpaceProvisioned = *o.StatisticsComponentsSpaceProvisioned\n\t\t}\n\t\tqStatisticsComponentsSpaceProvisioned := qrStatisticsComponentsSpaceProvisioned\n\t\tif qStatisticsComponentsSpaceProvisioned != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.components.space.provisioned\", qStatisticsComponentsSpaceProvisioned); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsComponentsSpaceReservedUnused != nil {\n\n\t\t// query param statistics.components.space.reserved_unused\n\t\tvar qrStatisticsComponentsSpaceReservedUnused string\n\n\t\tif o.StatisticsComponentsSpaceReservedUnused != nil {\n\t\t\tqrStatisticsComponentsSpaceReservedUnused = *o.StatisticsComponentsSpaceReservedUnused\n\t\t}\n\t\tqStatisticsComponentsSpaceReservedUnused := qrStatisticsComponentsSpaceReservedUnused\n\t\tif qStatisticsComponentsSpaceReservedUnused != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.components.space.reserved_unused\", qStatisticsComponentsSpaceReservedUnused); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsComponentsSpaceSavings != nil {\n\n\t\t// query param statistics.components.space.savings\n\t\tvar qrStatisticsComponentsSpaceSavings string\n\n\t\tif o.StatisticsComponentsSpaceSavings != nil {\n\t\t\tqrStatisticsComponentsSpaceSavings = *o.StatisticsComponentsSpaceSavings\n\t\t}\n\t\tqStatisticsComponentsSpaceSavings := qrStatisticsComponentsSpaceSavings\n\t\tif qStatisticsComponentsSpaceSavings != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.components.space.savings\", qStatisticsComponentsSpaceSavings); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsComponentsSpaceUsed != nil {\n\n\t\t// query param statistics.components.space.used\n\t\tvar qrStatisticsComponentsSpaceUsed string\n\n\t\tif o.StatisticsComponentsSpaceUsed != nil {\n\t\t\tqrStatisticsComponentsSpaceUsed = *o.StatisticsComponentsSpaceUsed\n\t\t}\n\t\tqStatisticsComponentsSpaceUsed := qrStatisticsComponentsSpaceUsed\n\t\tif qStatisticsComponentsSpaceUsed != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.components.space.used\", qStatisticsComponentsSpaceUsed); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsComponentsSpaceUsedExcludingReserves != nil {\n\n\t\t// query param statistics.components.space.used_excluding_reserves\n\t\tvar qrStatisticsComponentsSpaceUsedExcludingReserves string\n\n\t\tif o.StatisticsComponentsSpaceUsedExcludingReserves != nil {\n\t\t\tqrStatisticsComponentsSpaceUsedExcludingReserves = *o.StatisticsComponentsSpaceUsedExcludingReserves\n\t\t}\n\t\tqStatisticsComponentsSpaceUsedExcludingReserves := qrStatisticsComponentsSpaceUsedExcludingReserves\n\t\tif qStatisticsComponentsSpaceUsedExcludingReserves != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.components.space.used_excluding_reserves\", qStatisticsComponentsSpaceUsedExcludingReserves); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsComponentsSpaceUsedPercent != nil {\n\n\t\t// query param statistics.components.space.used_percent\n\t\tvar qrStatisticsComponentsSpaceUsedPercent string\n\n\t\tif o.StatisticsComponentsSpaceUsedPercent != nil {\n\t\t\tqrStatisticsComponentsSpaceUsedPercent = *o.StatisticsComponentsSpaceUsedPercent\n\t\t}\n\t\tqStatisticsComponentsSpaceUsedPercent := qrStatisticsComponentsSpaceUsedPercent\n\t\tif qStatisticsComponentsSpaceUsedPercent != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.components.space.used_percent\", qStatisticsComponentsSpaceUsedPercent); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsComponentsStatisticsIncomplete != nil {\n\n\t\t// query param statistics.components.statistics_incomplete\n\t\tvar qrStatisticsComponentsStatisticsIncomplete string\n\n\t\tif o.StatisticsComponentsStatisticsIncomplete != nil {\n\t\t\tqrStatisticsComponentsStatisticsIncomplete = *o.StatisticsComponentsStatisticsIncomplete\n\t\t}\n\t\tqStatisticsComponentsStatisticsIncomplete := qrStatisticsComponentsStatisticsIncomplete\n\t\tif qStatisticsComponentsStatisticsIncomplete != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.components.statistics_incomplete\", qStatisticsComponentsStatisticsIncomplete); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsComponentsStorageServiceName != nil {\n\n\t\t// query param statistics.components.storage_service.name\n\t\tvar qrStatisticsComponentsStorageServiceName string\n\n\t\tif o.StatisticsComponentsStorageServiceName != nil {\n\t\t\tqrStatisticsComponentsStorageServiceName = *o.StatisticsComponentsStorageServiceName\n\t\t}\n\t\tqStatisticsComponentsStorageServiceName := qrStatisticsComponentsStorageServiceName\n\t\tif qStatisticsComponentsStorageServiceName != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.components.storage_service.name\", qStatisticsComponentsStorageServiceName); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsComponentsUUID != nil {\n\n\t\t// query param statistics.components.uuid\n\t\tvar qrStatisticsComponentsUUID string\n\n\t\tif o.StatisticsComponentsUUID != nil {\n\t\t\tqrStatisticsComponentsUUID = *o.StatisticsComponentsUUID\n\t\t}\n\t\tqStatisticsComponentsUUID := qrStatisticsComponentsUUID\n\t\tif qStatisticsComponentsUUID != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.components.uuid\", qStatisticsComponentsUUID); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsIopsPerTb != nil {\n\n\t\t// query param statistics.iops.per_tb\n\t\tvar qrStatisticsIopsPerTb string\n\n\t\tif o.StatisticsIopsPerTb != nil {\n\t\t\tqrStatisticsIopsPerTb = *o.StatisticsIopsPerTb\n\t\t}\n\t\tqStatisticsIopsPerTb := qrStatisticsIopsPerTb\n\t\tif qStatisticsIopsPerTb != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.iops.per_tb\", qStatisticsIopsPerTb); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsIopsTotal != nil {\n\n\t\t// query param statistics.iops.total\n\t\tvar qrStatisticsIopsTotal string\n\n\t\tif o.StatisticsIopsTotal != nil {\n\t\t\tqrStatisticsIopsTotal = *o.StatisticsIopsTotal\n\t\t}\n\t\tqStatisticsIopsTotal := qrStatisticsIopsTotal\n\t\tif qStatisticsIopsTotal != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.iops.total\", qStatisticsIopsTotal); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsLatencyAverage != nil {\n\n\t\t// query param statistics.latency.average\n\t\tvar qrStatisticsLatencyAverage string\n\n\t\tif o.StatisticsLatencyAverage != nil {\n\t\t\tqrStatisticsLatencyAverage = *o.StatisticsLatencyAverage\n\t\t}\n\t\tqStatisticsLatencyAverage := qrStatisticsLatencyAverage\n\t\tif qStatisticsLatencyAverage != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.latency.average\", qStatisticsLatencyAverage); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsLatencyRaw != nil {\n\n\t\t// query param statistics.latency.raw\n\t\tvar qrStatisticsLatencyRaw string\n\n\t\tif o.StatisticsLatencyRaw != nil {\n\t\t\tqrStatisticsLatencyRaw = *o.StatisticsLatencyRaw\n\t\t}\n\t\tqStatisticsLatencyRaw := qrStatisticsLatencyRaw\n\t\tif qStatisticsLatencyRaw != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.latency.raw\", qStatisticsLatencyRaw); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsSharedStoragePool != nil {\n\n\t\t// query param statistics.shared_storage_pool\n\t\tvar qrStatisticsSharedStoragePool string\n\n\t\tif o.StatisticsSharedStoragePool != nil {\n\t\t\tqrStatisticsSharedStoragePool = *o.StatisticsSharedStoragePool\n\t\t}\n\t\tqStatisticsSharedStoragePool := qrStatisticsSharedStoragePool\n\t\tif qStatisticsSharedStoragePool != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.shared_storage_pool\", qStatisticsSharedStoragePool); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsSnapshotReserve != nil {\n\n\t\t// query param statistics.snapshot.reserve\n\t\tvar qrStatisticsSnapshotReserve string\n\n\t\tif o.StatisticsSnapshotReserve != nil {\n\t\t\tqrStatisticsSnapshotReserve = *o.StatisticsSnapshotReserve\n\t\t}\n\t\tqStatisticsSnapshotReserve := qrStatisticsSnapshotReserve\n\t\tif qStatisticsSnapshotReserve != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.snapshot.reserve\", qStatisticsSnapshotReserve); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsSnapshotUsed != nil {\n\n\t\t// query param statistics.snapshot.used\n\t\tvar qrStatisticsSnapshotUsed string\n\n\t\tif o.StatisticsSnapshotUsed != nil {\n\t\t\tqrStatisticsSnapshotUsed = *o.StatisticsSnapshotUsed\n\t\t}\n\t\tqStatisticsSnapshotUsed := qrStatisticsSnapshotUsed\n\t\tif qStatisticsSnapshotUsed != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.snapshot.used\", qStatisticsSnapshotUsed); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsSpaceAvailable != nil {\n\n\t\t// query param statistics.space.available\n\t\tvar qrStatisticsSpaceAvailable string\n\n\t\tif o.StatisticsSpaceAvailable != nil {\n\t\t\tqrStatisticsSpaceAvailable = *o.StatisticsSpaceAvailable\n\t\t}\n\t\tqStatisticsSpaceAvailable := qrStatisticsSpaceAvailable\n\t\tif qStatisticsSpaceAvailable != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.space.available\", qStatisticsSpaceAvailable); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsSpaceLogicalUsed != nil {\n\n\t\t// query param statistics.space.logical_used\n\t\tvar qrStatisticsSpaceLogicalUsed string\n\n\t\tif o.StatisticsSpaceLogicalUsed != nil {\n\t\t\tqrStatisticsSpaceLogicalUsed = *o.StatisticsSpaceLogicalUsed\n\t\t}\n\t\tqStatisticsSpaceLogicalUsed := qrStatisticsSpaceLogicalUsed\n\t\tif qStatisticsSpaceLogicalUsed != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.space.logical_used\", qStatisticsSpaceLogicalUsed); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsSpaceProvisioned != nil {\n\n\t\t// query param statistics.space.provisioned\n\t\tvar qrStatisticsSpaceProvisioned string\n\n\t\tif o.StatisticsSpaceProvisioned != nil {\n\t\t\tqrStatisticsSpaceProvisioned = *o.StatisticsSpaceProvisioned\n\t\t}\n\t\tqStatisticsSpaceProvisioned := qrStatisticsSpaceProvisioned\n\t\tif qStatisticsSpaceProvisioned != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.space.provisioned\", qStatisticsSpaceProvisioned); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsSpaceReservedUnused != nil {\n\n\t\t// query param statistics.space.reserved_unused\n\t\tvar qrStatisticsSpaceReservedUnused string\n\n\t\tif o.StatisticsSpaceReservedUnused != nil {\n\t\t\tqrStatisticsSpaceReservedUnused = *o.StatisticsSpaceReservedUnused\n\t\t}\n\t\tqStatisticsSpaceReservedUnused := qrStatisticsSpaceReservedUnused\n\t\tif qStatisticsSpaceReservedUnused != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.space.reserved_unused\", qStatisticsSpaceReservedUnused); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsSpaceSavings != nil {\n\n\t\t// query param statistics.space.savings\n\t\tvar qrStatisticsSpaceSavings string\n\n\t\tif o.StatisticsSpaceSavings != nil {\n\t\t\tqrStatisticsSpaceSavings = *o.StatisticsSpaceSavings\n\t\t}\n\t\tqStatisticsSpaceSavings := qrStatisticsSpaceSavings\n\t\tif qStatisticsSpaceSavings != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.space.savings\", qStatisticsSpaceSavings); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsSpaceUsed != nil {\n\n\t\t// query param statistics.space.used\n\t\tvar qrStatisticsSpaceUsed string\n\n\t\tif o.StatisticsSpaceUsed != nil {\n\t\t\tqrStatisticsSpaceUsed = *o.StatisticsSpaceUsed\n\t\t}\n\t\tqStatisticsSpaceUsed := qrStatisticsSpaceUsed\n\t\tif qStatisticsSpaceUsed != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.space.used\", qStatisticsSpaceUsed); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsSpaceUsedExcludingReserves != nil {\n\n\t\t// query param statistics.space.used_excluding_reserves\n\t\tvar qrStatisticsSpaceUsedExcludingReserves string\n\n\t\tif o.StatisticsSpaceUsedExcludingReserves != nil {\n\t\t\tqrStatisticsSpaceUsedExcludingReserves = *o.StatisticsSpaceUsedExcludingReserves\n\t\t}\n\t\tqStatisticsSpaceUsedExcludingReserves := qrStatisticsSpaceUsedExcludingReserves\n\t\tif qStatisticsSpaceUsedExcludingReserves != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.space.used_excluding_reserves\", qStatisticsSpaceUsedExcludingReserves); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsSpaceUsedPercent != nil {\n\n\t\t// query param statistics.space.used_percent\n\t\tvar qrStatisticsSpaceUsedPercent string\n\n\t\tif o.StatisticsSpaceUsedPercent != nil {\n\t\t\tqrStatisticsSpaceUsedPercent = *o.StatisticsSpaceUsedPercent\n\t\t}\n\t\tqStatisticsSpaceUsedPercent := qrStatisticsSpaceUsedPercent\n\t\tif qStatisticsSpaceUsedPercent != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.space.used_percent\", qStatisticsSpaceUsedPercent); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.StatisticsStatisticsIncomplete != nil {\n\n\t\t// query param statistics.statistics_incomplete\n\t\tvar qrStatisticsStatisticsIncomplete string\n\n\t\tif o.StatisticsStatisticsIncomplete != nil {\n\t\t\tqrStatisticsStatisticsIncomplete = *o.StatisticsStatisticsIncomplete\n\t\t}\n\t\tqStatisticsStatisticsIncomplete := qrStatisticsStatisticsIncomplete\n\t\tif qStatisticsStatisticsIncomplete != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"statistics.statistics_incomplete\", qStatisticsStatisticsIncomplete); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.SvmName != nil {\n\n\t\t// query param svm.name\n\t\tvar qrSvmName string\n\n\t\tif o.SvmName != nil {\n\t\t\tqrSvmName = *o.SvmName\n\t\t}\n\t\tqSvmName := qrSvmName\n\t\tif qSvmName != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"svm.name\", qSvmName); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.SvmUUID != nil {\n\n\t\t// query param svm.uuid\n\t\tvar qrSvmUUID string\n\n\t\tif o.SvmUUID != nil {\n\t\t\tqrSvmUUID = *o.SvmUUID\n\t\t}\n\t\tqSvmUUID := qrSvmUUID\n\t\tif qSvmUUID != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"svm.uuid\", qSvmUUID); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.TemplateName != nil {\n\n\t\t// query param template.name\n\t\tvar qrTemplateName string\n\n\t\tif o.TemplateName != nil {\n\t\t\tqrTemplateName = *o.TemplateName\n\t\t}\n\t\tqTemplateName := qrTemplateName\n\t\tif qTemplateName != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"template.name\", qTemplateName); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.TemplateProtocol != nil {\n\n\t\t// query param template.protocol\n\t\tvar qrTemplateProtocol string\n\n\t\tif o.TemplateProtocol != nil {\n\t\t\tqrTemplateProtocol = *o.TemplateProtocol\n\t\t}\n\t\tqTemplateProtocol := qrTemplateProtocol\n\t\tif qTemplateProtocol != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"template.protocol\", qTemplateProtocol); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.TemplateVersion != nil {\n\n\t\t// query param template.version\n\t\tvar qrTemplateVersion string\n\n\t\tif o.TemplateVersion != nil {\n\t\t\tqrTemplateVersion = *o.TemplateVersion\n\t\t}\n\t\tqTemplateVersion := qrTemplateVersion\n\t\tif qTemplateVersion != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"template.version\", qTemplateVersion); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif o.UUID != nil {\n\n\t\t// query param uuid\n\t\tvar qrUUID string\n\n\t\tif o.UUID != nil {\n\t\t\tqrUUID = *o.UUID\n\t\t}\n\t\tqUUID := qrUUID\n\t\tif qUUID != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"uuid\", qUUID); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3ec67e8d26f8cabad51d2ed01ae89a80", "score": "0.6727598", "text": "func (o *TogglePacketGeneratorsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\tif err := r.SetBodyParam(o.Toggle); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9b90a024ad428b771c88c6908f203922", "score": "0.6725414", "text": "func (o *QueryActionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param Action\n\tif err := r.SetPathParam(\"Action\", o.Action); err != nil {\n\t\treturn err\n\t}\n\n\t// path param Resource\n\tif err := r.SetPathParam(\"Resource\", o.Resource); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "dc3d388b49de65ab1c3cbb6a8063ce4b", "score": "0.67246693", "text": "func (o *GetAppsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tr.SetTimeout(o.timeout)\n\tvar res []error\n\n\tif o.Limit != nil {\n\n\t\t// query param limit\n\t\tvar qrLimit int64\n\t\tif o.Limit != nil {\n\t\t\tqrLimit = *o.Limit\n\t\t}\n\t\tqLimit := swag.FormatInt64(qrLimit)\n\t\tif qLimit != \"\" {\n\t\t\tif err := r.SetQueryParam(\"limit\", qLimit); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Since != nil {\n\n\t\t// query param since\n\t\tvar qrSince int64\n\t\tif o.Since != nil {\n\t\t\tqrSince = *o.Since\n\t\t}\n\t\tqSince := swag.FormatInt64(qrSince)\n\t\tif qSince != \"\" {\n\t\t\tif err := r.SetQueryParam(\"since\", qSince); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// path param team_id\n\tif err := r.SetPathParam(\"team_id\", swag.FormatInt64(o.TeamID)); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e88737b8b1134f1c2971b610e03bed78", "score": "0.67238665", "text": "func (o *GetPublicTestParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.ExpectedResult != nil {\n\n\t\t// query param expected_result\n\t\tvar qrExpectedResult string\n\t\tif o.ExpectedResult != nil {\n\t\t\tqrExpectedResult = *o.ExpectedResult\n\t\t}\n\t\tqExpectedResult := qrExpectedResult\n\t\tif qExpectedResult != \"\" {\n\t\t\tif err := r.SetQueryParam(\"expected_result\", qExpectedResult); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "10b336a324895357bc32a3a86aa11c4b", "score": "0.6722997", "text": "func (o *ChangeTaglineParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Body != nil {\n\t\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param faxlineId\n\tif err := r.SetPathParam(\"faxlineId\", o.FaxlineID); err != nil {\n\t\treturn err\n\t}\n\n\t// path param userId\n\tif err := r.SetPathParam(\"userId\", o.UserID); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1610baf0bb202df7ee77b4badf426b56", "score": "0.6717835", "text": "func (o *GetEurekaInfoParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Options != nil {\n\n\t\t// query param options\n\t\tvar qrOptions string\n\t\tif o.Options != nil {\n\t\t\tqrOptions = *o.Options\n\t\t}\n\t\tqOptions := qrOptions\n\t\tif qOptions != \"\" {\n\t\t\tif err := r.SetQueryParam(\"options\", qOptions); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Params != nil {\n\n\t\t// query param params\n\t\tvar qrParams string\n\t\tif o.Params != nil {\n\t\t\tqrParams = *o.Params\n\t\t}\n\t\tqParams := qrParams\n\t\tif qParams != \"\" {\n\t\t\tif err := r.SetQueryParam(\"params\", qParams); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "82983d33fdc1390a458f26d92d85875c", "score": "0.67173916", "text": "func (o *Upload2Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.APIVersion != nil {\n\n\t\t// query param apiVersion\n\t\tvar qrAPIVersion string\n\n\t\tif o.APIVersion != nil {\n\t\t\tqrAPIVersion = *o.APIVersion\n\t\t}\n\t\tqAPIVersion := qrAPIVersion\n\t\tif qAPIVersion != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"apiVersion\", qAPIVersion); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\t// form file param file\n\tif err := r.SetFileParam(\"file\", o.File); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0a33471571a501e8f2fd443f6ca65d76", "score": "0.67153305", "text": "func (o *HostRecordGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Fields != nil {\n\n\t\t// binding items for fields\n\t\tjoinedFields := o.bindParamFields(reg)\n\n\t\t// query array param fields\n\t\tif err := r.SetQueryParam(\"fields\", joinedFields...); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param host\n\tif err := r.SetPathParam(\"host\", o.Host); err != nil {\n\t\treturn err\n\t}\n\n\t// path param svm.uuid\n\tif err := r.SetPathParam(\"svm.uuid\", o.SvmUUID); err != nil {\n\t\treturn err\n\t}\n\n\tif o.UseCache != nil {\n\n\t\t// query param use_cache\n\t\tvar qrUseCache bool\n\n\t\tif o.UseCache != nil {\n\t\t\tqrUseCache = *o.UseCache\n\t\t}\n\t\tqUseCache := swag.FormatBool(qrUseCache)\n\t\tif qUseCache != \"\" {\n\n\t\t\tif err := r.SetQueryParam(\"use_cache\", qUseCache); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ae3e93c9d892009a9f69c30df513ddd4", "score": "0.671383", "text": "func (o *CreateAnOrderParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// header param Accept\n\tif err := r.SetHeaderParam(\"Accept\", o.Accept); err != nil {\n\t\treturn err\n\t}\n\n\t// header param Content-Type\n\tif err := r.SetHeaderParam(\"Content-Type\", o.ContentType); err != nil {\n\t\treturn err\n\t}\n\n\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fbc322b2ceddf0a52281e82108e01648", "score": "0.67121786", "text": "func (o *ValidateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tr.SetTimeout(o.timeout)\n\tvar res []error\n\n\tif o.Body == nil {\n\t\to.Body = new(models.WorkflowSpec)\n\t}\n\n\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "aa0f0bb51ea934b2d2ef2218717086be", "score": "0.6706468", "text": "func (o *GetProductModelsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Attributes != nil {\n\n\t\t// query param attributes\n\t\tvar qrAttributes string\n\t\tif o.Attributes != nil {\n\t\t\tqrAttributes = *o.Attributes\n\t\t}\n\t\tqAttributes := qrAttributes\n\t\tif qAttributes != \"\" {\n\t\t\tif err := r.SetQueryParam(\"attributes\", qAttributes); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Limit != nil {\n\n\t\t// query param limit\n\t\tvar qrLimit int64\n\t\tif o.Limit != nil {\n\t\t\tqrLimit = *o.Limit\n\t\t}\n\t\tqLimit := swag.FormatInt64(qrLimit)\n\t\tif qLimit != \"\" {\n\t\t\tif err := r.SetQueryParam(\"limit\", qLimit); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Locales != nil {\n\n\t\t// query param locales\n\t\tvar qrLocales string\n\t\tif o.Locales != nil {\n\t\t\tqrLocales = *o.Locales\n\t\t}\n\t\tqLocales := qrLocales\n\t\tif qLocales != \"\" {\n\t\t\tif err := r.SetQueryParam(\"locales\", qLocales); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Page != nil {\n\n\t\t// query param page\n\t\tvar qrPage int64\n\t\tif o.Page != nil {\n\t\t\tqrPage = *o.Page\n\t\t}\n\t\tqPage := swag.FormatInt64(qrPage)\n\t\tif qPage != \"\" {\n\t\t\tif err := r.SetQueryParam(\"page\", qPage); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.PaginationType != nil {\n\n\t\t// query param pagination_type\n\t\tvar qrPaginationType string\n\t\tif o.PaginationType != nil {\n\t\t\tqrPaginationType = *o.PaginationType\n\t\t}\n\t\tqPaginationType := qrPaginationType\n\t\tif qPaginationType != \"\" {\n\t\t\tif err := r.SetQueryParam(\"pagination_type\", qPaginationType); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Scope != nil {\n\n\t\t// query param scope\n\t\tvar qrScope string\n\t\tif o.Scope != nil {\n\t\t\tqrScope = *o.Scope\n\t\t}\n\t\tqScope := qrScope\n\t\tif qScope != \"\" {\n\t\t\tif err := r.SetQueryParam(\"scope\", qScope); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Search != nil {\n\n\t\t// query param search\n\t\tvar qrSearch string\n\t\tif o.Search != nil {\n\t\t\tqrSearch = *o.Search\n\t\t}\n\t\tqSearch := qrSearch\n\t\tif qSearch != \"\" {\n\t\t\tif err := r.SetQueryParam(\"search\", qSearch); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.SearchAfter != nil {\n\n\t\t// query param search_after\n\t\tvar qrSearchAfter string\n\t\tif o.SearchAfter != nil {\n\t\t\tqrSearchAfter = *o.SearchAfter\n\t\t}\n\t\tqSearchAfter := qrSearchAfter\n\t\tif qSearchAfter != \"\" {\n\t\t\tif err := r.SetQueryParam(\"search_after\", qSearchAfter); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.WithCount != nil {\n\n\t\t// query param with_count\n\t\tvar qrWithCount bool\n\t\tif o.WithCount != nil {\n\t\t\tqrWithCount = *o.WithCount\n\t\t}\n\t\tqWithCount := swag.FormatBool(qrWithCount)\n\t\tif qWithCount != \"\" {\n\t\t\tif err := r.SetQueryParam(\"with_count\", qWithCount); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f3df4874ec0e3dcf3f6f721fdf574003", "score": "0.6702038", "text": "func (o *ImageGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param imageID\n\tif err := r.SetPathParam(\"imageID\", o.ImageID); err != nil {\n\t\treturn err\n\t}\n\n\t// path param namespace\n\tif err := r.SetPathParam(\"namespace\", o.Namespace); err != nil {\n\t\treturn err\n\t}\n\n\t// setting the default header value\n\tif err := r.SetHeaderParam(\"User-Agent\", utils.UserAgentGen()); err != nil {\n\t\treturn err\n\t}\n\n\tif err := r.SetHeaderParam(\"X-Amzn-Trace-Id\", utils.AmazonTraceIDGen()); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "9b79afc2ac99bb5999211a6e9e4187e4", "score": "0.6696347", "text": "func (o *ContainerGetStdoutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tr.SetTimeout(o.timeout)\n\tvar res []error\n\n\tif o.OpID != nil {\n\n\t\t// header param Op-ID\n\t\tif err := r.SetHeaderParam(\"Op-ID\", *o.OpID); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t}\n\n\tif o.Deadline != nil {\n\n\t\t// query param deadline\n\t\tvar qrDeadline strfmt.DateTime\n\t\tif o.Deadline != nil {\n\t\t\tqrDeadline = *o.Deadline\n\t\t}\n\t\tqDeadline := qrDeadline.String()\n\t\tif qDeadline != \"\" {\n\t\t\tif err := r.SetQueryParam(\"deadline\", qDeadline); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// path param id\n\tif err := r.SetPathParam(\"id\", o.ID); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "aca56b0c478aa069a07bec869739155d", "score": "0.66935974", "text": "func (o *QueryEventStreamHandlerParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Body != nil {\n\t\tif err := r.SetBodyParam(o.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// path param namespace\n\tif err := r.SetPathParam(\"namespace\", o.Namespace); err != nil {\n\t\treturn err\n\t}\n\n\tif o.EndDate != nil {\n\n\t\t// query param endDate\n\t\tvar qrEndDate string\n\t\tif o.EndDate != nil {\n\t\t\tqrEndDate = *o.EndDate\n\t\t}\n\t\tqEndDate := qrEndDate\n\t\tif qEndDate != \"\" {\n\t\t\tif err := r.SetQueryParam(\"endDate\", qEndDate); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Offset != nil {\n\n\t\t// query param offset\n\t\tvar qrOffset int64\n\t\tif o.Offset != nil {\n\t\t\tqrOffset = *o.Offset\n\t\t}\n\t\tqOffset := swag.FormatInt64(qrOffset)\n\t\tif qOffset != \"\" {\n\t\t\tif err := r.SetQueryParam(\"offset\", qOffset); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.PageSize != nil {\n\n\t\t// query param pageSize\n\t\tvar qrPageSize int64\n\t\tif o.PageSize != nil {\n\t\t\tqrPageSize = *o.PageSize\n\t\t}\n\t\tqPageSize := swag.FormatInt64(qrPageSize)\n\t\tif qPageSize != \"\" {\n\t\t\tif err := r.SetQueryParam(\"pageSize\", qPageSize); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.StartDate != nil {\n\n\t\t// query param startDate\n\t\tvar qrStartDate string\n\t\tif o.StartDate != nil {\n\t\t\tqrStartDate = *o.StartDate\n\t\t}\n\t\tqStartDate := qrStartDate\n\t\tif qStartDate != \"\" {\n\t\t\tif err := r.SetQueryParam(\"startDate\", qStartDate); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// setting the default header value\n\tif err := r.SetHeaderParam(\"User-Agent\", utils.UserAgentGen()); err != nil {\n\t\treturn err\n\t}\n\n\tif err := r.SetHeaderParam(\"X-Amzn-Trace-Id\", utils.AmazonTraceIDGen()); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\n\treturn nil\n}", "title": "" } ]
908a889ab3216169657a554f177e0c1f
NewServer returns Server object
[ { "docid": "97d306354a29eb4b8a59be5b397ba08f", "score": "0.0", "text": "func NewServer(portnumber string, handler http.Handler) *Server {\n\treturn &Server{srv: &http.Server{Addr: portnumber, Handler: handler}}\n}", "title": "" } ]
[ { "docid": "de27e7a182aee6f84794593fa9edc468", "score": "0.79243976", "text": "func NewServer() Server {\n\treturn Server{}\n}", "title": "" }, { "docid": "c8e075e9ef0a3e4105a9fd7f835cbc84", "score": "0.7883823", "text": "func NewServer() *server {\n\treturn &server{}\n}", "title": "" }, { "docid": "e1f80f6658d4032063974e030d954c31", "score": "0.7863715", "text": "func NewServer() (*server, error) {\n\treturn &server{}, nil\n}", "title": "" }, { "docid": "fff9e9d923df8806203970e975d551cb", "score": "0.78518337", "text": "func New() *Server {\n\treturn &Server{}\n}", "title": "" }, { "docid": "8737ad3ce49bff1c073d8577f92ad1cf", "score": "0.77730775", "text": "func newServer() *server {\n\treturn &server{\n\t\tdate: 1,\n\t\tpeers: &peerDatabase{\n\t\t\tusers: make(map[int64]*tg.User),\n\t\t\tchats: make(map[int64]*tg.Chat),\n\t\t\tchannels: make(map[int64]*tg.Channel),\n\t\t},\n\t\tmessages: &messageDatabase{\n\t\t\tchannels: make(map[int64][]tg.MessageClass),\n\t\t},\n\t}\n}", "title": "" }, { "docid": "a53c0be1a3c556e8de8e3507e10531cb", "score": "0.7745944", "text": "func NewServer(maildrop Maildrop) *Server {\n name, err := os.Hostname()\n if err != nil {\n name = \"localhost\"\n }\n return &Server{\n Name: name,\n ServerName: name,\n MaxSize: 131072,\n MaxCommands: 100,\n Maildrop: maildrop,\n // Extensions: make(map[string]Extension),\n Disabled: make(map[string]bool),\n }\n}", "title": "" }, { "docid": "cfcafba7d37a954cd530f0fcb47a554e", "score": "0.7676627", "text": "func NewServer(root, repo, name string) *Server {\n\treturn &Server{\n\t\troot: root,\n\t\trepo: repo,\n\t\tname: name,\n\t}\n}", "title": "" }, { "docid": "96944a9f8a84858c9c4aac34f0a09730", "score": "0.76501673", "text": "func NewServer() *Server {\n\treturn &Server{}\n}", "title": "" }, { "docid": "96944a9f8a84858c9c4aac34f0a09730", "score": "0.76501673", "text": "func NewServer() *Server {\n\treturn &Server{}\n}", "title": "" }, { "docid": "96944a9f8a84858c9c4aac34f0a09730", "score": "0.76501673", "text": "func NewServer() *Server {\n\treturn &Server{}\n}", "title": "" }, { "docid": "7bf00814c6a1b3d480f79e5aa03a887a", "score": "0.7646358", "text": "func NewServer(p, h string, port int) *Server {\n\tonce.Do(func() {\n\t\tvar s = Server{p, h, port}\n\t\t_s = &s\n\t})\n\n\treturn _s\n}", "title": "" }, { "docid": "9cc0d3853cd36527962a00db374c2540", "score": "0.7634859", "text": "func newServer(a *Air) *server {\n\treturn &server{\n\t\ta: a,\n\t\tserver: &http.Server{},\n\t}\n}", "title": "" }, { "docid": "16966021c17bae087911098e51d469ba", "score": "0.7607695", "text": "func NewServer() *Server {\n\treturn &Server{Common:Common{serviceMap: make(map[string]*service), pending:make(map[uint64]*Call)}}\n}", "title": "" }, { "docid": "a449db981dc13f7c08f753f8f764b54b", "score": "0.76058084", "text": "func NewServer() *Server {\n return &Server{\n Recoverable: true,\n LogOutput: ioutil.Discard,\n }\n}", "title": "" }, { "docid": "fbfd1680b113205279c140508a82bbff", "score": "0.75962573", "text": "func NewServer(i interface{}, addr string) *Server {\n\treturn &Server{caller: i, addr: addr}\n}", "title": "" }, { "docid": "cb99b9ccc7eb92f4514ef2a9e49ef706", "score": "0.75434715", "text": "func New() *Server {\n\treturn &Server{\n\t\tUpstream: &Host{\n\t\t\tIP: \"8.8.8.8\",\n\t\t\tPort: 853,\n\t\t\tProtocol: ProtoDoT,\n\t\t},\n\t\tListen: &Host{\n\t\t\tIP: \"127.0.0.1\",\n\t\t\tPort: 53,\n\t\t\tProtocol: ProtoTCP,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "f92f443bcf1da0216c48794e7448ffab", "score": "0.7535539", "text": "func NewServer(manager.BuildManager, string) *Server {\n\treturn &Server{}\n}", "title": "" }, { "docid": "00ae27fd73263bb4cd2cc3b2f78c3e83", "score": "0.75271314", "text": "func NewServer(config *Config, validator *govice.Validator) (*Server, error) {\n\ts := &Server{Config: config, validator: validator}\n\treturn s, nil\n}", "title": "" }, { "docid": "9756ff4021a274a325cf7c23f9510a4a", "score": "0.75230175", "text": "func NewServer() Server {\n\tgroup := srp.NewGroup()\n\treturn Server{Group: group}\n}", "title": "" }, { "docid": "fb32e787e9234b93bc75933f46b1ea22", "score": "0.7484252", "text": "func NewServer(db *data.DB) *Server {\n\ts := &Server{\n\t\trouter: httprouter.New(),\n\t\tsm: NewSessionManager(db),\n\t}\n\n\treturn s\n}", "title": "" }, { "docid": "344ff4a277d8a9220809a8f7b810a160", "score": "0.74827385", "text": "func NewServer(c *Config) Interface {\n\treturn &Server{\n\t\tconfig: c,\n\t}\n}", "title": "" }, { "docid": "75b2d5c364f1c25d3ec0238e40b9fb7c", "score": "0.7476962", "text": "func NewServer(addr string, pollch chan<- []byte, st store.Repo) *Server {\n\tsrv := &Server{\n\t\tServer: &http.Server{\n\t\t\tAddr: addr,\n\t\t},\n\n\t\tst: st,\n\t\tpollch: pollch,\n\t}\n\n\tr := mux.NewRouter()\n\tsrv.Handler = r\n\n\tr.Handle(\"/\", chain(getRoot, setRequestID, logRequest)).\n\t\tMethods(http.MethodGet)\n\n\tr.Handle(\"/repos/git\", chain(srv.postGitRepo, setRequestID, logRequest)).\n\t\tMethods(http.MethodPost)\n\n\tr.Handle(\"/repos/git\", chain(srv.getGitRepo, setRequestID, logRequest)).\n\t\tMethods(http.MethodGet)\n\n\t// TODO: delete git repos\n\n\treturn srv\n}", "title": "" }, { "docid": "f2b38ed28e4ee36ccfa586d9b4e9bc8d", "score": "0.74720806", "text": "func New(cfg *config.Server) *Server {\n\treturn &Server{\n\t\tConfig: cfg,\n\t}\n}", "title": "" }, { "docid": "86e9cadcdf858d72d05120b1825da0ce", "score": "0.7465145", "text": "func New(h *hub.Hub, srvConfig *config.ServerConfig, dstConfig *config.DstConfig) *Server {\n\treturn &Server{\n\t\th, srvConfig, dstConfig,\n\t}\n}", "title": "" }, { "docid": "bb6755bb988c152556c297e28973cda1", "score": "0.7463038", "text": "func newServer() *server {\n\ts := &server{\n\t\trouter: echo.New(),\n\t}\n\n\ts.initHTTPServer()\n\ts.routes()\n\n\treturn s\n}", "title": "" }, { "docid": "3c57680de11286189e346b958ff75aa9", "score": "0.7462282", "text": "func NewServer(plugin *plugin.Manager, cache *cache.Cache) (*Server, error) {\n logger := logging.MustGetLogger(\"rpc\")\n\n return &Server{\n logger: logger,\n plugin: plugin,\n cache: cache,\n }, nil\n}", "title": "" }, { "docid": "d2a83c2ad23730fd23bc2f92033bf958", "score": "0.7459461", "text": "func NewServer(addr string) *Server {\n\treturn &Server{\n\t\taddr: addr,\n\t\tmethods: make(map[string]HandlerFunc),\n\t}\n}", "title": "" }, { "docid": "83e69919a601836dc0ef791ad5bbeb07", "score": "0.7458909", "text": "func NewServer(params *ServerParameters) (s Server, err error) {\n\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\n\t\t\terr = errors.New(\"httpAPI NewService panic\")\n\t\t}\n\t}()\n\n\tif params.Port == \"\" {\n\t\treturn nil, errors.New(\"address error \")\n\t}\n\n\tsv := &server{\n\t\tapiMux: goHTTP.NewServeMux(),\n\t\tserver: &goHTTP.Server{\n\t\t\tAddr: params.Address + \":\" + params.Port,\n\t\t\tReadTimeout: params.ReadTimeout,\n\t\t\tWriteTimeout: params.WriteTimeout,\n\t\t\tIdleTimeout: params.IdleTimeout,\n\t\t\tMaxHeaderBytes: params.MaxHeaderBytes,\n\t\t\t//MaxHeaderBytes: 1 << 20,\n\t\t},\n\t}\n\n\tsv.server.Handler = sv.apiMux\n\n\treturn sv, err\n\n}", "title": "" }, { "docid": "710b4d61c170e778e58ee47932a0cbb7", "score": "0.74573505", "text": "func NewServer(res http.ResponseWriter, req *http.Request) *Server {\n\treturn &Server{\n\t\tRequest: req,\n\t\tWriter: res,\n\t}\n}", "title": "" }, { "docid": "dc90f9c94b9ae9e190f49d9a12a2cfdc", "score": "0.745517", "text": "func NewServer(config *Config) *Server {\n\treturn &Server{\n\t\tconfig: config,\n\t\tmgrStop: make(chan struct{}),\n\t\tsvcQueue: queue.NewQueue(),\n\t\tnodeQueue: queue.NewQueue(),\n\t}\n}", "title": "" }, { "docid": "8662b33c41e3b194d42be1a7cad0f21f", "score": "0.74248296", "text": "func NewServer(host, port string) *Server {\n\treturn &Server{host, port}\n}", "title": "" }, { "docid": "bb45b14901ceacd4f3ba871784a965e4", "score": "0.7403604", "text": "func NewServer(datab *sql.DB) *Server {\n\ts := &Server{}\n\n\trouter := mux.NewRouter()\n\trouter.HandleFunc(\"/api/books\", s.GetBooks).Methods(\"GET\")\n\trouter.HandleFunc(\"/api/books/{isbn}\", s.GetBook).Methods(\"GET\")\n\trouter.HandleFunc(\"/api/books/{isbn}\", s.CreateBook).Methods(\"POST\")\n\trouter.HandleFunc(\"/api/books/{isbn}\", s.UpdateBook).Methods(\"PUT\")\n\trouter.HandleFunc(\"/api/books/{isbn}\", s.DeleteBook).Methods(\"DELETE\")\n\n\ts.router = router\n\ts.db = datab\n\treturn s\n}", "title": "" }, { "docid": "fd5e486d0d781003ad9cd106758e00c9", "score": "0.7387245", "text": "func NewServer(conf *config.Config, stop chan os.Signal) *Server {\r\n\treturn &Server{\r\n\t\tconf: conf,\r\n\t\tstop: stop,\r\n\t}\r\n}", "title": "" }, { "docid": "835f440a28210fd107f64287d64c7258", "score": "0.7375885", "text": "func newServer(name string, port int) (*p2p.Server, error) {\n\tpkey, err := crypto.GenerateKey()\n\tif err != nil {\n\t\tlog.Printf(\"Generate private key failed with err: %v\", err)\n\t\treturn nil, err\n\t}\n\n\tcfg := p2p.Config{\n\t\tPrivateKey: pkey,\n\t\tName: name,\n\t\tMaxPeers: 1,\n\t\tProtocols: []p2p.Protocol{proto},\n\t\tEnableMsgEvents: true,\n\t}\n\n\tif port > 0 {\n\t\tcfg.ListenAddr = fmt.Sprintf(\":%d\", port)\n\t}\n\tsrv := &p2p.Server{\n\t\tConfig: cfg,\n\t}\n\n\terr = srv.Start()\n\tif err != nil {\n\t\tlog.Printf(\"Start server failed with err: %v\", err)\n\t\treturn nil, err\n\t}\n\n\treturn srv, nil\n}", "title": "" }, { "docid": "67123e74bd8fa95916f19901488449b6", "score": "0.7372849", "text": "func NewServer(cfg *Config) *Server {\n\treturn &Server{\n\t\tcfg: *cfg,\n\t\troutes: make(map[string]*Route),\n\t}\n}", "title": "" }, { "docid": "ad330215b28857e84716578d65980b4d", "score": "0.7369017", "text": "func New(name, addr string) *Server {\n\tif servers[addr] != nil {\n\t\tservers[addr].Name += \", \" + name\n\t\treturn servers[addr]\n\t}\n\n\tvar mux = mux.NewRouter()\n\tmux.SkipClean(true)\n\tvar s = &Server{\n\t\tName: name,\n\t\tMux: mux,\n\t\tServer: &http.Server{\n\t\t\tReadTimeout: 5 * time.Second,\n\t\t\tWriteTimeout: 30 * time.Second,\n\t\t\tAddr: addr,\n\t\t\tHandler: mux,\n\t\t},\n\t}\n\n\tservers[addr] = s\n\treturn s\n}", "title": "" }, { "docid": "2c7cc9a15ddcd7ee4155f037e4e46d5b", "score": "0.7367829", "text": "func NewServer(service service.Services) *Server {\n\treturn &Server{\n\t\tservice,\n\t}\n}", "title": "" }, { "docid": "0bac979d3fd719d1854d83a79533772d", "score": "0.7364892", "text": "func NewServer() *Server {\n\treturn &Server{Routes: GetRoutes()}\n}", "title": "" }, { "docid": "31dbe360627cbe886d5f68b6d73c4ff8", "score": "0.7358538", "text": "func NewServer(handler ServerHandlerInterface) *Server {\n\treturn &Server{\n\t\tconfig: DefaultConfig(),\n\t\tparams: *asdu.ParamsWide,\n\t\thandler: handler,\n\t\tsessions: make(map[*SrvSession]struct{}),\n\t\tClog: clog.NewLogger(\"cs104 server => \"),\n\t}\n}", "title": "" }, { "docid": "642ebdec987b53a43e8b11cb37364bc6", "score": "0.7357767", "text": "func New() pb.RemoteServer {\n\treturn srv{}\n}", "title": "" }, { "docid": "9584beb0140525bd2861270c0ff23275", "score": "0.73542255", "text": "func NewServer() *Server {\n\ts := &Server{\n\t\thandlers: make(map[string]map[string]*operationHander),\n\t\tMarshaller: newDefaultMarshaller(),\n\t}\n\treturn s\n}", "title": "" }, { "docid": "ee089f367ba0bc06b48f6d30691a22af", "score": "0.735095", "text": "func NewServer(host string, port int) *Server {\n\treturn &Server{\n\t\thost: host,\n\t\tport: port,\n\t\tstopChan: make(chan os.Signal),\n\t\tclients: make(map[string]*model.Client, 0),\n\t}\n}", "title": "" }, { "docid": "13bfd20d93d6424ec70ed85d8ef25b26", "score": "0.73486876", "text": "func newServer(addr string, handler http.Handler) *http.Server {\n\treturn &http.Server{\n\t\tReadTimeout: serverReadTimeout,\n\t\tWriteTimeout: serverWriteTimeout,\n\t\tHandler: handler,\n\t\tAddr: addr,\n\t}\n}", "title": "" }, { "docid": "5c79ec10dd0bcd39936751e8bc795c31", "score": "0.7346154", "text": "func New() *Server {\n\ts := new(Server)\n\n\t// initialize server\n\ts.SetConfig()\n\ts.SetHandler()\n\n\treturn s\n}", "title": "" }, { "docid": "5d1c9c8ff19c8025586cbdbb80f9a8a3", "score": "0.73454034", "text": "func NewServer(network string, address string, handlers HandlerMap) *Server {\n\treturn &Server{\n\t\tnetwork: network,\n\t\taddress: address,\n\t\thandlers: handlers,\n\t}\n}", "title": "" }, { "docid": "dc24bf55c8053e18a6aa24d7184aa1aa", "score": "0.7343726", "text": "func NewServer(host string, db storage.Interface, sugar *zap.SugaredLogger) (*Server, error) {\n\tr := gin.Default()\n\treturn &Server{\n\t\tr: r,\n\t\tdb: db,\n\t\thost: host,\n\t\tsugar: sugar,\n\t}, nil\n}", "title": "" }, { "docid": "9c06a4ca11801a3884bca8221cd3ad0d", "score": "0.7334578", "text": "func newServer(ctx common.Context, chs *replica, list net.Listener, workers int) (net.Server, error) {\n\tctx = ctx.Sub(\"Server\")\n\n\tserver := &rpcServer{\n\t\tctx: ctx,\n\t\tlogger: ctx.Logger(),\n\t\tchs: chs,\n\t\ttimeout: 30 * time.Second,\n\t}\n\n\treturn net.NewServer(ctx, list, serverInitHandler(server), workers)\n}", "title": "" }, { "docid": "e4922f161c13a3d4d7b6bd2cf77149a8", "score": "0.7332255", "text": "func NewServer(config *config.Config) (*Server, error) {\n\tvar err error\n\n\tregMgr, err := initRegManager(config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tsbFactory, err := initSBFactory(config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tpoolMgr, err := initPManager(config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\topts := handler.HandlerSetOpts{\n\t\tRegMgr: regMgr,\n\t\tSbFactory: sbFactory,\n\t\tPoolMgr: poolMgr,\n\t\tConfig: config,\n\t\tLru: handler.NewHandlerLRU(100), // TODO(tyler)\n\t}\n\tserver := &Server{\n\t\tconfig: config,\n\t\thandlers: handler.NewHandlerSet(opts),\n\t}\n\n\treturn server, nil\n}", "title": "" }, { "docid": "38be2c36e35ddab48ba058f84bdcea40", "score": "0.73299277", "text": "func NewServer(service *service.Service) *Server {\n\treturn &Server{service: service}\n}", "title": "" }, { "docid": "291b7cdaf4144e42008b4dada25b4f7b", "score": "0.73291844", "text": "func NewServer() (Server, error) {\n\ts := Server{}\n\terr := s.bootstrap()\n\treturn s, err\n}", "title": "" }, { "docid": "6eaffe142306f5e4d389a90ec81da179", "score": "0.7327654", "text": "func NewServer(h *Handler) *Server {\n\treturn &Server{\n\t\thandler: h,\n\t}\n}", "title": "" }, { "docid": "ca751898f686f03c28b1d46ec08be467", "score": "0.73255545", "text": "func New(client *nad.Client) *Server {\n\treturn &Server{client: client}\n}", "title": "" }, { "docid": "a95da67b7d65b020349f8c5ef48314d0", "score": "0.73226905", "text": "func NewServer(handler *EventsHandler) *Server {\n\treturn &Server{\n\t\tService: *NewService(\"Server\"),\n\t\tEventsHandler: handler,\n\t}\n}", "title": "" }, { "docid": "e0008d1a7e9c2aaf27f0b80dde9d2f72", "score": "0.7318006", "text": "func New(kub backend.Backend) *Server {\n\treturn &Server{kub: kub}\n}", "title": "" }, { "docid": "a144a2bf1d94c64a259796fa0b6f1bba", "score": "0.7315344", "text": "func NewServer(host string, port int) *Server {\n\treturn &Server{host: host, port: port}\n}", "title": "" }, { "docid": "c8557ddb0fc36654d0d7ea8eefb7e4ba", "score": "0.7314303", "text": "func NewServer(c Config) *Server {\n\n\t// os gives us a free Port when Port is \"\"\n\tln, err := net.Listen(\"tcp\", c.Port)\n\tif err != nil {\n\t\tlog.Info.Panic(err)\n\t}\n\n\t_, port, _ := net.SplitHostPort(ln.Addr().String())\n\n\ts := Server{\n\t\tcontext: c.Context,\n\t\tdatabase: c.Database,\n\t\tcontainer: c.Container,\n\t\tdevice: c.Device,\n\t\tMux: http.NewServeMux(),\n\t\tmutex: c.Mutex,\n\t\tlistener: ln.(*net.TCPListener),\n\t\tport: port,\n\t\temitter: c.Emitter,\n\t}\n\n\ts.setupEndpoints()\n\n\treturn &s\n}", "title": "" }, { "docid": "7f8c4683fa8a8dfb2487f08befbb6e90", "score": "0.7312032", "text": "func NewServer(cfg *Config) *Server {\n\treturn &Server{\n\t\tcfg: cfg,\n\t}\n}", "title": "" }, { "docid": "6ed028646ecf923c39a5c6503174fc94", "score": "0.73102796", "text": "func New(opaque *internal.Opaque) *Server {\n\treturn &Server{\n\t\tSignature: signature.New(signature.Ed25519),\n\t\tOpaque: opaque,\n\t}\n}", "title": "" }, { "docid": "ba97b49cd253bb7dd10167a773608dca", "score": "0.7304209", "text": "func NewServer(id,address string) *Server {\n\treturn &Server{\n\t\tid: id,\n\t\taddress: address,\n\t\tusers: make(map[string]net.Conn,100),\n\t}\n}", "title": "" }, { "docid": "e61be408eb9cd2d5c1252c1b38162aaa", "score": "0.7292376", "text": "func NewServer(c *config.Config, l *logrus.Entry) *Server {\n\treturn &Server{\n\t\tconfig: c,\n\t\tcontainer: restful.NewContainer(),\n\t\thttpd: &http.Server{\n\t\t\tAddr: fmt.Sprintf(\":%v\", c.ListenPort),\n\t\t\tWriteTimeout: WriteTimeout,\n\t\t\tReadTimeout: ReadTimeout,\n\t\t},\n\t\tlogger: l,\n\t\tstop: make(chan interface{}),\n\t\tdone: make(chan interface{}),\n\t}\n}", "title": "" }, { "docid": "628f6a5bbc632817d858e6293f385edb", "score": "0.7292187", "text": "func NewServer(p string, r *mux.Router, httpServer *http.Server, proxyServer *Proxy, secure bool, fs ImposterFs) Server {\n\treturn Server{\n\t\timpostersPath: p,\n\t\trouter: r,\n\t\thttpServer: httpServer,\n\t\tproxy: proxyServer,\n\t\tsecure: secure,\n\t\timposterFs: fs,\n\t}\n}", "title": "" }, { "docid": "e0054b2efc92b321769465110b67aadf", "score": "0.72914004", "text": "func New(name, localroot string) (*Server, error) {\n\tabs, err := filepath.Abs(localroot)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Server{\n\t\tname: name,\n\t\troot: abs,\n\t}, nil\n}", "title": "" }, { "docid": "f637a79f290dc066b5f5cac06e811e11", "score": "0.7289845", "text": "func NewServer(tree *bstree.Tree) *server {\n s := &server{\n tree: tree,\n router: mux.NewRouter(),\n }\n s.configureRouter()\n return s\n}", "title": "" }, { "docid": "611b5ec0db249bbe8cca516ac2471144", "score": "0.7289175", "text": "func NewServer(mgr Manager) *Server {\n\tresult := &Server{\n\t\tmgr: mgr,\n\t}\n\treturn result\n}", "title": "" }, { "docid": "174e1d3cdda0ade03bf580a0bb3d4d00", "score": "0.72887075", "text": "func NewServer(addr string,\n\tservedFiles []ServedFile,\n\tservedObjects []ServedObject) (*Server, error) {\n\tvar err error\n\n\tnewServer := Server{}\n\n\t// if user didn't pass an address, generate one\n\tif addr == \"\" {\n\t\taddr, err = generateAddress()\n\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"Failed to find free port\")\n\t\t}\n\t}\n\n\tnewServer.Addr = addr\n\n\t// create a new servemux\n\tnewServeMux := http.NewServeMux()\n\tnewServer.Handler = newServeMux\n\n\t// register files\n\tfor _, servedFile := range servedFiles {\n\t\tservedFileCopy := servedFile\n\n\t\tnewServeMux.HandleFunc(servedFileCopy.Pattern, func(w http.ResponseWriter, r *http.Request) {\n\t\t\thttp.ServeFile(w, r, servedFileCopy.LocalPath)\n\t\t})\n\n\t}\n\n\t// register objects\n\tfor _, servedObject := range servedObjects {\n\t\tservedObjectCopy := servedObject\n\n\t\tnewServeMux.HandleFunc(servedObjectCopy.Pattern, func(w http.ResponseWriter, r *http.Request) {\n\t\t\tw.Write([]byte(servedObjectCopy.Contents)) // nolint: errcheck\n\t\t})\n\t}\n\n\tgo newServer.ListenAndServe() // nolint: errcheck\n\n\treturn &newServer, nil\n}", "title": "" }, { "docid": "ef96a436bb42b75f061ae50c8121ad2d", "score": "0.7279823", "text": "func newServer() *httpServer {\n\tclient := redis.NewClient(&redis.Options{\n\t\tAddr: \"localhost:6379\",\n\t\tPassword: \"\", // no password set\n\t\tDB: 0, // use default DB\n\t})\n\n\t_, err := client.Ping().Result()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tsrv := &httpServer{}\n\tsrv.DB = &db.DB{Redis: client}\n\tsrv.Router = mux.NewRouter()\n\treturn srv\n}", "title": "" }, { "docid": "e8353fe9fcc150c7d685c32a2557de21", "score": "0.72798026", "text": "func NewServer(addr string) *Server {\n\tinstance := &Server{\n\t\tschema: schema.NewHttpSchema(addr),\n\t\trouter: gin.Default(),\n\t}\n\n\treturn instance\n}", "title": "" }, { "docid": "7823bb458f046ee07a52c675999d8aa9", "score": "0.72777885", "text": "func NewServer(network *Network) *Server {\n\tserver := &Server{\n\t\trouter: httprouter.New(),\n\t\tnetwork: network,\n\t}\n\n\tserver.OPTIONS(\"/\", server.Options)\n\tserver.GET(\"/\", server.GetNetwork)\n\tserver.POST(\"/Nodess\", server.CreateNodes)\n\tsserver.GET(\"/Nodess\", server.GetNodess)\n\tsserver.GET(\"/Nodes/:Nodesid\", server.GetNodes)\n\tsserver.POST(\"/start\", server.StartNetwork)\n\tserver.POST(\"/stop\", server.StopNetwork)\n\t\n\tserver.GET(\"/snapshot\", server.CreateSnapshot)\n\tsserver.POST(\"/snapshot\", server.LoadSnapshot)\n\t\n\tserver.POST(\"/Nodes/:Nodesid/start\", server.StartNodes)\n\tserver.POST(\"/Nodes/:Nodesid/stop\", server.StopNodes)\n\tserver.POST(\"/Nodes/:Nodesid/conn/:peerid\", server.ConnectNodes)\n\tserver.GET(\"/events\", sserver.StreamNetworkEvents)\n\t\n\tserver.GET(\"/Nodes/:Nodesid/rpc\", server.NodesRPC)\n\tserver.DELETE(\"/Nodes/:Nodesid/conn/:peerid\", server.DisconnectNodes)\n\n\treturn server\n}", "title": "" }, { "docid": "e4941d1a8f803afe9b9894e7e87bdfd6", "score": "0.72729504", "text": "func New(log logging.Logger) *Server {\n\treturn &Server{\n\t\tlog: log,\n\t\tsubscribedConnections: newConnections(),\n\t}\n}", "title": "" }, { "docid": "c42157c3698ffcbfd8e46cf385982a0c", "score": "0.7268344", "text": "func NewServer() *Server {\n server := &Server {\n services: make(serviceRegistry), // 实际上这个就是一个 string 的map, 储存RPC服务的名称的\n codecs: set.New(),\n run: 1,\n }\n\n rpcService := &RPCService(server)\n server.RegisterName(MetadataApi, rpcService)\n\n return server\n}", "title": "" }, { "docid": "a1e0c986a1471bd5111e632857b6f925", "score": "0.72647977", "text": "func New(opt ...requests.Option) *Server {\n\ts := &Server{\n\t\topts: opt,\n\t\thandler: new(internal.RequestHandler),\n\t}\n\ttestServer := httptest.NewServer(http.HandlerFunc(s.handle))\n\ts.server = testServer\n\tbaseURL, err := url.Parse(s.server.URL)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"error parsing server url: %v\", err))\n\t}\n\ts.client = s.opts\n\ts.client = append(s.client, octo.WithHTTPClient(s.server.Client()), octo.WithBaseURL(*baseURL))\n\ts.finish = func() {\n\t\ts.server.Close()\n\t}\n\treturn s\n}", "title": "" }, { "docid": "f2873d97938cd23af5a441c57ec4b26b", "score": "0.7262598", "text": "func NewServer() (*Server, error) {\n\tfmt.Println(\"Configuring server..\")\n\n\tapp, err := application.Get()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\trouter, err := NewRouter(*app)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tsrv := http.Server{\n\t\tAddr: fmt.Sprintf(\"%s:%d\", app.Config.Server.Host, app.Config.Server.Port),\n\t\tHandler: router,\n\t}\n\n\treturn &Server{&srv}, nil\n}", "title": "" }, { "docid": "4c9b2e2cb569d3d43a82012c20e66ddf", "score": "0.7261535", "text": "func New() *Server {\n\tport := randomPort()\n\thost := \"localhost:\" + strconv.Itoa(port)\n\n\t_, rpcServ, err := gethrpc.StartWSEndpoint(host, []gethrpc.API{}, []string{}, []string{\"*\"}, true)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\ts := Server{\n\t\tServer: rpcServ,\n\t\tHost: host,\n\t\tURL: \"ws://\" + host,\n\t}\n\treturn &s\n}", "title": "" }, { "docid": "3ca905f9e782f77f363cd6d1a0154114", "score": "0.72602695", "text": "func New() *Server {\n\ts := Server{}\n\ts.initialize()\n\ts.Configure(Config{})\n\treturn &s\n}", "title": "" }, { "docid": "4cf675042783bcc37a525a52e5b01cc1", "score": "0.7259681", "text": "func New(ctx context.Context, cfg Config) *Server {\n\treturn &Server{\n\t\tctx: ctx,\n\t\tcfg: cfg,\n\t}\n}", "title": "" }, { "docid": "292aea0e70e611b4565d36fcff8fff03", "score": "0.72567225", "text": "func newServer(p NewServerParams) *server {\n\treturn &server{\n\t\tassetsDir: p.Config.AssetsDir,\n\t}\n}", "title": "" }, { "docid": "7919648c1ba4f1ac96cb3f0bef68329b", "score": "0.72550476", "text": "func NewServer(db model.Model, tableID, protocolID int) *Server {\n\treturn &Server{\n\t\tdb: db,\n\t\ttableID: tableID,\n\t\tprotocolID: protocolID,\n\t}\n}", "title": "" }, { "docid": "5e977eae620a94f5dcbc8f3e0309df61", "score": "0.7251295", "text": "func New(path string) Server {\n\treturn Server{\n\t\tpathname: path,\n\t\tnext: nil,\n\t}\n}", "title": "" }, { "docid": "1c739c911e655b1a2a366a2a122bf78a", "score": "0.724875", "text": "func newServer(store store.Store, sessionStore sessions.Store) *server {\n\tserv := &server{\n\t\trouter: mux.NewRouter(),\n\t\tstore: store,\n\t\tsessionStore: sessionStore,\n\t}\n\n\tserv.configureRouter()\n\n\treturn serv\n}", "title": "" }, { "docid": "c33b991f71fd1d36a2e669ded414ec3d", "score": "0.7248517", "text": "func NewServer(kernel *kernel.Kernel) (server *Server) {\n\tserver = new(Server)\n\tserver.err = make(chan error)\n\tserver.builtinService = &BuiltinService{kernel: kernel}\n\tserver.router = gin.Default()\n\n\tv1 := server.router.Group(protocol.V1Path)\n\t{\n\t\tv1.HEAD(protocol.HealthPath, server.builtinService.health)\n\t\tv1.GET(protocol.HealthPath, server.builtinService.health)\n\t\tv1.POST(protocol.AddJobPath, server.builtinService.addJob)\n\t\tv1.POST(protocol.AddJobWithIDPath, server.builtinService.addJobWithID)\n\t\tv1.POST(protocol.RemoveJobPath, server.builtinService.removeJob)\n\t}\n\n\treturn server\n}", "title": "" }, { "docid": "82a9cfc108d55935c29d822c13cccaba", "score": "0.72484004", "text": "func NewServer(name string) ziface.IServer {\n\ts := &Server{\n\t\tName: utils.GlobalObject.Name,\n\t\tIPversion: \"tcp4\",\n\t\tIP: utils.GlobalObject.Host,\n\t\tPort: utils.GlobalObject.TcpPort,\n\t\t//Router: nil,\n\t\tMsgHandler: NewMsgHandle(),\n\t\tConnMr: NewConnManager(),\n\t}\n\n\treturn s\n}", "title": "" }, { "docid": "0a723bbe2040a9e610f244fbf29f410e", "score": "0.7248347", "text": "func NewServer(addr string, port int, db models.XODB) *Server {\n\tsrv := &Server{\n\t\tAddress: addr,\n\t\tPort: port,\n\t\tplayerDB: db,\n\t}\n\n\tgo srv.periodicUpdate()\n\n\treturn srv\n}", "title": "" }, { "docid": "fc4829681a5bd1327b8fdff1eee00288", "score": "0.72390944", "text": "func New() *Server {\n\treturn &Server{\n\t\ttemplates: make(map[string]interfaces.ITemplate),\n\t}\n}", "title": "" }, { "docid": "a5871023d670efe3b937432e70736781", "score": "0.7238007", "text": "func NewServer(settings *Settings) (server Server, err error) {\n\treturn server, err\n}", "title": "" }, { "docid": "837c78e7619c1356a6e588fb909dd551", "score": "0.7234335", "text": "func NewServer(db drivers.DB) Server {\n\treturn &server{\n\t\tModelCluster: NewModelCluster(db),\n\t\tModelNamespace: NewModelNamespace(db),\n\t\tModelWorkload: NewModelWorkload(db),\n\t\tModelProject: NewModelProject(db),\n\t\tModelPublic: NewModelPublic(db),\n\t}\n}", "title": "" }, { "docid": "c268fa4b824366a7bd00dd44921221ae", "score": "0.7229456", "text": "func NewServer(opt *Options) *Server {\n\tcxt, cancel := context.WithCancel(context.Background())\n\treturn &Server{\n\t\tcxt: cxt,\n\t\tcancel: cancel,\n\t\toption: opt,\n\t\tstops: make([]utils.StopFunc, 0),\n\t}\n}", "title": "" }, { "docid": "f5a99db7e90364ef046054d8943ff75c", "score": "0.72260606", "text": "func New(ctx context.Context, cl *client.Client, cfg *Config, log *zap.Logger) (*Server, error) {\n\treturn &Server{\n\t\tcfg: cfg,\n\t\tlog: log,\n\t\tcl: cl,\n\t\tis: new(infoServer),\n\t\ths: new(healthServer),\n\t\tes: &echoServer{cl: cl, log: log},\n\t}, nil\n}", "title": "" }, { "docid": "442b8c6d2be656ae33de682b956a7449", "score": "0.7225959", "text": "func NewServer(store *db.Store) *Server {\n\tserver := &Server{\n\t\tstore: store,\n\t}\n\trouter := gin.Default()\n\t//\tadd routes to router\n\trouter.POST(\"/accounts\", server.createAccount)\n\n\trouter.GET(\"/accounts/:id\", server.getAccount)\n\n\trouter.GET(\"/accounts\", server.listAccount)\n\tserver.router = router\n\treturn server\n}", "title": "" }, { "docid": "50b863be80e17c965e0771d4c944e509", "score": "0.72250825", "text": "func NewServer(config *config.Config) *Server {\n\treturn &Server{Config: config, errors: make(chan error, 1)}\n}", "title": "" }, { "docid": "358d642609abe42e8611bea55ccc5e6b", "score": "0.72247523", "text": "func NewServer(config *ServerConfig) *Server {\n\tif config == nil {\n\t\tpanic(\"nil config\")\n\t}\n\n\ts := &Server{}\n\ts.config = config\n\ts.initHTTP()\n\n\treturn s\n}", "title": "" }, { "docid": "30c61776d995e9973d24ddb1481908e2", "score": "0.7224628", "text": "func (n *Network) NewServer() *Server {\n\tn.lock.Lock()\n\tdefer n.lock.Unlock()\n\n\tname := generateName(\"server\", len(n.servers))\n\tserver := newServer(name, n.registerServer)\n\tn.servers[name] = server\n\n\treturn server\n}", "title": "" }, { "docid": "d719d95b37eea93339be0356abc30e9a", "score": "0.7224375", "text": "func NewServer(config *config.Config) *server.Server {\n\tserver := &server.Server{}\n\n\tserver.Config = config\n\n\t// Create database instance\n\tdb, err := newDB(config)\n\tif err != nil {\n\t\tlog.Fatalln(err)\n\t}\n\tserver.DB = db\n\n\tserver.RedisDB = newRedisDB(config)\n\n\tserver.HTTPServer = &http.Server{}\n\tserver.HTTPServer.Addr = config.AppHost + \":\" + config.AppPort\n\tserver.HTTPServer.Handler = GetHandler(NewRouter(server))\n\tserver.HTTPServer.WriteTimeout = time.Second * time.Duration(rand.Int63n(config.WriteTimeout))\n\tserver.HTTPServer.ReadTimeout = time.Second * time.Duration(rand.Int63n(config.ReadTimeout))\n\tserver.HTTPServer.IdleTimeout = time.Second * time.Duration(rand.Int63n(config.IdleTimeout))\n\n\treturn server\n}", "title": "" }, { "docid": "725148c6a46358675da97cd716006f47", "score": "0.7223721", "text": "func NewServer(backend Backend,idGenerator IdGenerator) *Server {\n\trv := Server{\n\t\tHandlers: make(map[string]Handler),\n\t\tBackend: backend,\n\t\tIdGenerator: idGenerator,\n\t}\n\trv.Handlers[\"\"] = handleDefault\n\trv.Handlers[\"quit\"] = handleQuit\n\trv.Handlers[\"group\"] = handleGroup\n\trv.Handlers[\"list\"] = handleList\n\trv.Handlers[\"head\"] = handleHead\n\trv.Handlers[\"body\"] = handleBody\n\trv.Handlers[\"article\"] = handleArticle\n\trv.Handlers[\"post\"] = handlePost\n\trv.Handlers[\"ihave\"] = handleIHave\n\trv.Handlers[\"check\"] = handleCheck\n\trv.Handlers[\"takethis\"] = handleTakethis\n\trv.Handlers[\"capabilities\"] = handleCap\n\trv.Handlers[\"mode\"] = handleMode\n\trv.Handlers[\"authinfo\"] = handleAuthInfo\n\trv.Handlers[\"newgroups\"] = handleNewGroups\n\trv.Handlers[\"over\"] = handleOver\n\trv.Handlers[\"xover\"] = handleOver\n\trv.Handlers[\"hdr\"] = handleHdr\n\trv.Handlers[\"xhdr\"] = handleHdr\n\trv.Handlers[\"listgroup\"] = handleListgroup\n\trv.Handlers[\"last\"] = handleLast\n\trv.Handlers[\"next\"] = handleNext\n\trv.Handlers[\"stat\"] = handleStat\n\trv.Handlers[\"help\"] = handleHelp\n\trv.Handlers[\"date\"] = handleDate\n\treturn &rv\n}", "title": "" }, { "docid": "7d4a6ef360c77b34de8ca3a8a4224d68", "score": "0.72226244", "text": "func NewServer(r http.Handler, addr string) *Server {\n\treturn &Server{\n\t\tr: r,\n\t\taddr: addr,\n\t}\n}", "title": "" }, { "docid": "8076c3b879f2fde87883a3dbc8f2652b", "score": "0.722137", "text": "func NewServer(port int, storage storage.StorageDescriber, version version.VersionManagerDescriptor) *Server {\n\n\trouter := mux.NewRouter()\n\tcorsObj := handlers.AllowedOrigins([]string{\"*\"})\n\treturn &Server{\n\t\trouter: router,\n\t\tstorage: storage,\n\t\tversion: version,\n\t\thttpserver: &http.Server{\n\t\t\tHandler: handlers.CORS(corsObj)(router),\n\t\t\tAddr: fmt.Sprintf(\"0.0.0.0:%d\", port),\n\t\t},\n\t}\n}", "title": "" }, { "docid": "5d716b31e28bceb98c63a1fa13411771", "score": "0.7220294", "text": "func NewServer(log *logrus.Logger, version string, filename string, port int, web int) (*Server, error) {\n\t// load the DB\n\tif !strings.HasSuffix(filename, \".db\") {\n\t\tfilename = filename + \".db\"\n\t}\n\tdb, err := db.OpenDB(log, filename)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tgameData := &rp.Game{}\n\terr = db.Load(\"game\", \"state\", gameData)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tgameData.InitGameState()\n\n\treturn &Server{\n\t\tlog: log,\n\t\tversion: version,\n\t\tfilename: filename,\n\t\tport: port,\n\t\tweb: web,\n\t\tgame: gameData,\n\t\tdb: db,\n\t\ttokenCache: NewTokenCache(gameData),\n\t}, nil\n}", "title": "" }, { "docid": "5d75635ee360c04aa7731fea16514273", "score": "0.7215884", "text": "func New(address string) *Server {\n\treturn &Server{\n\t\taddress: address,\n\t\tJoins: make(chan *Client),\n\t}\n}", "title": "" }, { "docid": "487e81838a7eb4e68418ec53cb322651", "score": "0.7214149", "text": "func New() (*server, error) {\n\tenv, err := env.New()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &server{\n\t\tenv: env,\n\t}, nil\n}", "title": "" }, { "docid": "7a911b10fdc3dc38c4e24bfa6c81c376", "score": "0.72111577", "text": "func New(addr string, protocol Protocol, logger *log.Logger) *Server {\n\treturn &Server{\n\t\taddress: addr,\n\t\tlogger: logger,\n\t\tprotocol: protocol,\n\t}\n}", "title": "" }, { "docid": "61c5083e3f001fd09972c9fe14803b99", "score": "0.7210066", "text": "func NewServer(log *xlog.Log) *Server {\n\t// audit := audit.NewAudit(log, conf.Audit)\n\t// router := router.NewRouter(log, conf.Proxy.MetaDir, conf.Router)\n\t// scatter := backend.NewScatter(log, conf.Proxy.MetaDir)\n\t// syncer := syncer.NewSyncer(log, conf.Proxy.MetaDir, conf.Proxy.PeerAddress, router, scatter)\n\t// plugins := plugins.NewPlugin(log, conf, router, scatter)\n\treturn &Server{\n\t\tlog: log,\n\t\t// conf: conf,\n\t\t// confPath: path,\n\t\t// audit: audit,\n\t\t// router: router,\n\t\t// scatter: scatter,\n\t\t// syncer: syncer,\n\t\t// plugins: plugins,\n\t\t// sessions: NewSessions(log),\n\t\t// iptable: NewIPTable(log, conf.Proxy),\n\t\t// throttle: xbase.NewThrottle(0),\n\t}\n}", "title": "" }, { "docid": "581b899de9d0ab9cb1a935ab790d82b3", "score": "0.7209329", "text": "func (_ *HTTP) NewServer(iter *protocol.MockIterator, l logger.Logger, config interface{}) (protocol.Server, error) { //nolint:revive\n\tif iter == nil {\n\t\treturn nil, errors.New(\"mock iterator is nil\")\n\t}\n\tcfg, ok := config.(*ServerConfig)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"invalid config %T\", config)\n\t}\n\tsrv := &server{\n\t\thandler: NewHandler(iter, l),\n\t}\n\tif cfg != nil {\n\t\tsrv.config = *cfg\n\t}\n\treturn srv, nil\n}", "title": "" } ]
0b78977f863c2f156de284b8ca730330
NewHandler returns an sdk.Handler for the asset module.
[ { "docid": "ec63d0f51e8c45d883a13c7d102d8327", "score": "0.7200588", "text": "func (am AppModule) NewHandler() sdk.Handler {\n\treturn msg.WarpHandler(am.assetKeeper, am.accountAuther, NewHandler(am.dexKeeper))\n}", "title": "" } ]
[ { "docid": "9634dca2ea6b0f8555a0cbb0246be0c5", "score": "0.7162864", "text": "func (am AppModule) NewHandler() sdk.Handler { return NewHandler(am.keeper) }", "title": "" }, { "docid": "0041aad8b6c86a187617f976f5ad4de5", "score": "0.69694215", "text": "func NewHandler(k Keeper) sdk.Handler {\n\treturn func(ctx sdk.Context, msg sdk.Msg) sdk.Result {\n\t\tswitch msg := msg.(type) {\n\t\tcase MsgFactoryIssueAssets:\n\t\t\treturn handleMsgFactoryIssueAsset(ctx, k, msg)\n\t\tcase MsgFactoryRedeemAssets:\n\t\t\treturn handleMsgFactoryRedeemAsset(ctx, k, msg)\n\t\tcase MsgFactorySendAssets:\n\t\t\treturn handleMsgFactorySendAssets(ctx, k, msg)\n\t\tcase MsgFactoryExecuteAssets:\n\t\t\treturn handleMsgFactoryExecuteAssets(ctx, k, msg)\n\t\tdefault:\n\t\t\terrMsg := \"Unrecognized assetFactory Msg type: \" + reflect.TypeOf(msg).Name()\n\t\t\treturn sdk.ErrUnknownRequest(errMsg).Result()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f6e0662ee54771169e9362e15e00ad73", "score": "0.6918296", "text": "func (am AppModule) NewHandler() sdk.Handler {\n\treturn NewHandler(am.keeper)\n}", "title": "" }, { "docid": "f6e0662ee54771169e9362e15e00ad73", "score": "0.6918296", "text": "func (am AppModule) NewHandler() sdk.Handler {\n\treturn NewHandler(am.keeper)\n}", "title": "" }, { "docid": "f6e0662ee54771169e9362e15e00ad73", "score": "0.6918296", "text": "func (am AppModule) NewHandler() sdk.Handler {\n\treturn NewHandler(am.keeper)\n}", "title": "" }, { "docid": "b35bc60756a3eea6a27bea409d041bf8", "score": "0.6779788", "text": "func NewAssetHandler(assetPath string) *GinAssets {\n\treturn (*GinAssets)(servefiles.NewAssetHandler(assetPath))\n}", "title": "" }, { "docid": "ee1ffd5f5bf44c2e5cd64a95b28808f8", "score": "0.6717565", "text": "func (am AppModule) NewHandler() sdk.Handler {\n\treturn NewOrderHandler(am.keeper)\n}", "title": "" }, { "docid": "2a39c3503a0b818fceed1f2cc1f8f170", "score": "0.66078734", "text": "func NewHandler(cfg *Config) Handler { return New(cfg) }", "title": "" }, { "docid": "b98a13ecdda051fb7715f5fa3348f1bc", "score": "0.65133834", "text": "func NewHandler() sdk.Handler {\n\treturn &Handler{}\n}", "title": "" }, { "docid": "ec3c4a7789c661a28794b5f9fe4238cc", "score": "0.64413166", "text": "func NewHandler(be Backend) http.Handler {\n\treturn &handler{be}\n}", "title": "" }, { "docid": "7442e32c39b37ec4e4e6c0931ec324a9", "score": "0.6402637", "text": "func (am AppModule) NewHandler() sdk.Handler {\n\treturn am.cosmosAppModule.NewHandler()\n}", "title": "" }, { "docid": "be9d2abcda9281e3f7c9dc20171c4a79", "score": "0.63944745", "text": "func NewAssetHandler(ibcm Mapper, ck bank.Keeper, ak assetFactory.Keeper) sdk.Handler {\n\treturn func(ctx sdk.Context, msg sdk.Msg) sdk.Result {\n\t\tswitch msg := msg.(type) {\n\t\tcase IBCTransferMsg:\n\t\t\treturn handleIBCTransferMsg(ctx, ibcm, ck, msg)\n\t\tcase IBCReceiveMsg:\n\t\t\treturn handleIBCReceiveMsg(ctx, ibcm, ck, msg)\n\t\tcase MsgRelayIssueAssets:\n\t\t\treturn handleIBCRelayIssueAssetMsg(ctx, ibcm, ak, msg)\n\t\tcase MsgRelayRedeemAssets:\n\t\t\treturn handleIBCRelayRedeemAssetMsg(ctx, ibcm, ak, msg)\n\t\tcase MsgRelaySendAssets:\n\t\t\treturn handleIBCRelaySendAssetMsg(ctx, ibcm, ak, msg)\n\t\tcase MsgRelaySellerExecuteOrders:\n\t\t\treturn handlerIBCRelaySellerExecuteOrdersMsg(ctx, ibcm, ak, msg)\n\t\tdefault:\n\t\t\terrMsg := \"Unrecognized IBC Msg type: \" + reflect.TypeOf(msg).Name()\n\t\t\treturn sdk.ErrUnknownRequest(errMsg).Result()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "8ac5208342c5404decc17de74af3d463", "score": "0.6345726", "text": "func NewHandler(k Keeper) sdk.Handler {\n\treturn func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) {\n\t\tctx = ctx.WithEventManager(sdk.NewEventManager())\n\t\tswitch msg := msg.(type) {\n\t\tcase MsgDistribution:\n\t\t\treturn handleMsgCreateDistribution(ctx, k, msg)\n\t\tcase MsgCreateClaim:\n\t\t\treturn handleMsgCreateClaim(ctx, k, msg)\n\t\tdefault:\n\t\t\terrMsg := fmt.Sprintf(\"unrecognized %s message type: %T\", ModuleName, msg)\n\t\t\treturn nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "bd4133ca60b852d7b7547fe7a8410de9", "score": "0.632083", "text": "func NewHandler(cloudProject string, prod bool) *Handler {\n\treturn &Handler{cloudProject: cloudProject, prod: prod}\n}", "title": "" }, { "docid": "858d8659500e0154e539d0f902dd571b", "score": "0.6313976", "text": "func NewHandler(scheme *runtime.Scheme) *Handler {\n\treturn &Handler{\n\t\t// Add the apiGroups being handled to the decoder\n\t\tdecoder: serializer.NewCodecFactory(scheme).UniversalDecoder(\n\t\t\tinfrav1.GroupVersion,\n\t\t\tcontrolplanev1.GroupVersion,\n\t\t\tbootstrapv1.GroupVersion,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "8476e6f614656d2b5ace8d4917a3a9a1", "score": "0.6307143", "text": "func NewHandler(crApi *api.API) *Handler {\n\treturn &Handler{\n\t\tcrApi: crApi,\n\t}\n}", "title": "" }, { "docid": "b1ae1724b4b79f09571b2a097a9987ef", "score": "0.63054556", "text": "func NewHandler(c *Manager) *Handler {\n\treturn &Handler{c}\n}", "title": "" }, { "docid": "45f3f971596594e4166c4486ac8334c5", "score": "0.6294054", "text": "func NewHandler(m *Manager) *Handler {\n\treturn &Handler{mng: m}\n}", "title": "" }, { "docid": "1f64cfd8886cda027a25ae60a7fe1d1a", "score": "0.6278933", "text": "func NewHandler(api api.Api, configPath string, corsEnable bool) *Handler {\n\th := &Handler{\n\t\tapi: api,\n\t\tconfigPath: configPath,\n\t}\n\n\th.engine = gin.New()\n\th.engine.Use(jsonLogMiddleware(), gin.Recovery())\n\n\tif corsEnable == true {\n\t\tconfig := cors.DefaultConfig()\n\t\tconfig.AllowAllOrigins = true\n\t\tconfig.AddAllowHeaders(\"authorization\")\n\t\th.engine.Use(cors.New(config))\n\t\tlogrus.Info(\"CORS are enabled\")\n\t}\n\n\th.engine.GET(\"/ready\", h.HealthCheck)\n\th.engine.GET(\"/alive\", h.HealthCheck)\n\th.engine.POST(\"/inventories\", h.Create)\n\th.engine.GET(\"/inventories/:namespace\", h.Get)\n\th.engine.GET(\"/inventories/:namespace/status\", h.GetStatus)\n\th.engine.POST(\"/inventories/:namespace/reset\", h.Reset)\n\th.engine.GET(\"/inventories/:namespace/services\", h.ListServices)\n\th.engine.GET(\"/inventories\", h.List)\n\t//h.engine.GET(\"/inventories/status\", h.GetStatuses)\n\th.engine.GET(\"/defaults\", h.GetDefaults)\n\th.engine.PUT(\"/inventories/:namespace\", h.Update)\n\th.engine.DELETE(\"/inventories/:namespace\", h.Delete)\n\th.engine.DELETE(\"/resources/:namespace/jobs/:resource\", h.DeleteResource)\n\th.engine.GET(\"/version\", h.Version)\n\n\treturn h\n}", "title": "" }, { "docid": "d6696259909818ec110001a3464a4946", "score": "0.6242464", "text": "func New(hg httpGetter, s3p s3Putter) *Handler {\n\treturn &Handler{hg, s3p}\n}", "title": "" }, { "docid": "c5a5a768113f88f375455adac0499805", "score": "0.6234078", "text": "func NewAssetsHandler() http.Handler {\n\tr := chi.NewRouter()\n\th := http.FileServer(Assets)\n\tr.Get(\"/*\", func(w http.ResponseWriter, r *http.Request) {\n\t\tp := path.Clean(r.URL.Path)\n\t\tif _, ok := Assets.Files[p]; !ok {\n\t\t\tr.URL.Path = \"/\"\n\t\t}\n\t\th.ServeHTTP(w, r)\n\t})\n\treturn r\n}", "title": "" }, { "docid": "3204e428b332c3ba9b290f3d127549f7", "score": "0.6220042", "text": "func NewHandler(pf product.Front) *Handler {\n\treturn &Handler{\n\t\tproductFront: pf,\n\t}\n}", "title": "" }, { "docid": "e908aaf1fd40a1dc3551eeea260fbd94", "score": "0.6163405", "text": "func New() *Handler {\n\treturn &Handler{}\n}", "title": "" }, { "docid": "3152b864cfa520ec9fbe1017ae8464bc", "score": "0.6158069", "text": "func NewHandler(logger logr.Logger) admission.Handler {\n\treturn &handler{\n\t\tlogger: logger,\n\t}\n}", "title": "" }, { "docid": "fe0edb67b532b5b4a99e76ab09f3c02f", "score": "0.61517864", "text": "func NewHandler(title, swaggerJSONPath string, basePath string) *Handler {\n\treturn NewHandlerWithConfig(swgui.Config{\n\t\tTitle: title,\n\t\tSwaggerJSON: swaggerJSONPath,\n\t\tBasePath: basePath,\n\t})\n}", "title": "" }, { "docid": "606edd38e4c4692e65ad0998c581ade4", "score": "0.61429256", "text": "func NewHandler(storage *Repository) *Handler {\n\treturn &Handler{storage: storage}\n}", "title": "" }, { "docid": "c4276ea86281cc1cd50a3d18ae1b18e7", "score": "0.6142309", "text": "func NewHandler() handler {\n\treturn handler{Upgrader: defaultUpgrader}\n}", "title": "" }, { "docid": "3ec87c6cc41ae07a98a1a763042f6038", "score": "0.61225617", "text": "func NewHandler(ctx context.Context, cfg Config) (*Handler, error) {\n\tif err := cfg.CheckAndSetDefaults(); err != nil {\n\t\treturn nil, trace.Wrap(err)\n\t}\n\n\tclient, err := s3metrics.NewAPIMetrics(s3.New(cfg.Session))\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err)\n\t}\n\n\tuploader, err := s3metrics.NewUploadAPIMetrics(s3manager.NewUploader(cfg.Session))\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err)\n\t}\n\n\tdownloader, err := s3metrics.NewDownloadAPIMetrics(s3manager.NewDownloader(cfg.Session))\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err)\n\t}\n\n\th := &Handler{\n\t\tEntry: log.WithFields(log.Fields{\n\t\t\ttrace.Component: teleport.Component(teleport.SchemeS3),\n\t\t}),\n\t\tConfig: cfg,\n\t\tuploader: uploader,\n\t\tdownloader: downloader,\n\t\tclient: client,\n\t}\n\tstart := time.Now()\n\th.Infof(\"Setting up bucket %q, sessions path %q in region %q.\", h.Bucket, h.Path, h.Region)\n\tif err := h.ensureBucket(ctx); err != nil {\n\t\treturn nil, trace.Wrap(err)\n\t}\n\th.WithFields(log.Fields{\"duration\": time.Since(start)}).Infof(\"Setup bucket %q completed.\", h.Bucket)\n\treturn h, nil\n}", "title": "" }, { "docid": "f66023f15aa24a394a5d38802b0cfa3f", "score": "0.6106084", "text": "func NewHandler(meta ObjectMeta) *Handler {\n\treturn &Handler{ObjectMeta: meta}\n}", "title": "" }, { "docid": "e2862714a7e587317e8378f1661397c8", "score": "0.6100834", "text": "func NewHandler(svc Interface, accountService accountGetter, provisioner nodeProvisioner, repo storage.Interface) *Handler {\n\treturn &Handler{\n\t\tsvc: svc,\n\t\taccountService: accountService,\n\t\tnodeProvisioner: provisioner,\n\t\tworkflowMap: map[clouds.Name]workflows.WorkflowSet{\n\t\t\tclouds.DigitalOcean: {\n\t\t\t\tDeleteCluster: workflows.DigitalOceanDeleteCluster,\n\t\t\t\tDeleteNode: workflows.DigitalOceanDeleteNode,\n\t\t\t},\n\t\t},\n\t\trepo: repo,\n\t\tgetWriter: util.GetWriter,\n\t}\n}", "title": "" }, { "docid": "ea882cecad1046f9ef53cddf4052e073", "score": "0.60815924", "text": "func New() *Handler {\n\treturn &Handler{\n\t\tIntentHandlers: make(map[string]IntentFunc),\n\t}\n}", "title": "" }, { "docid": "03fffdcba1088ab250f5d4409d720982", "score": "0.6081405", "text": "func NewHandler(keeper Keeper) sdk.Handler {\n\treturn func(ctx sdk.Context, msg sdk.Msg) sdk.Result {\n\t\tswitch msg := msg.(type) {\n\t\tcase MsgSetCiphertextShare:\n\t\t\treturn handleMsgSetCiphertextShare(ctx, &keeper, msg)\n\t\tcase MsgSetDecryptionShare:\n\t\t\treturn handleMsgSetDecryptionShare(ctx, &keeper, msg)\n\t\tdefault:\n\t\t\terrMsg := fmt.Sprintf(\"unrecognized herb Msg type: %v\", msg.Type())\n\t\t\treturn sdk.ErrUnknownRequest(errMsg).Result()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1fd3c2502fea3f19caf7ad98fd7f825d", "score": "0.60780936", "text": "func New(a service.Athenz) Handler {\n\treturn &handler{\n\t\tathenz: a,\n\t}\n}", "title": "" }, { "docid": "0ab5c4899a46f2f1b33bf55799860216", "score": "0.60542893", "text": "func NewHandler(requireAuthentication bool) *Handler {\n\tvar opts []configOption\n\tif requireAuthentication {\n\t\topts = append(opts, WithAuthentication())\n\t}\n\n\treturn NewHandlerWithConfig(NewHandlerConfig(opts...))\n}", "title": "" }, { "docid": "ad7bdb8bbaef6df27534157a0269568c", "score": "0.6029474", "text": "func NewHandler(logger *zap.SugaredLogger, client *scm.Client, repo string, pr int) *Handler {\n\treturn &Handler{\n\t\tlogger: logger,\n\t\tclient: client,\n\t\trepo: repo,\n\t\tprNum: pr,\n\t}\n}", "title": "" }, { "docid": "0fe6f0c4b7b159b2231aa6fba16a0b59", "score": "0.6026356", "text": "func NewHandler(k Keeper) sdk.Handler {\n\treturn func(ctx sdk.Context, msg sdk.Msg) sdk.Result {\n\t\tswitch msg := msg.(type) {\n\t\tcase MsgRequestRand:\n\t\t\treturn handleMsgRequestRand(ctx, k, msg)\n\t\tdefault:\n\t\t\treturn sdk.ErrTxDecode(\"invalid message parsed in rand module\").Result()\n\t\t}\n\n\t\treturn sdk.ErrTxDecode(\"invalid message parsed in rand module\").Result()\n\t}\n}", "title": "" }, { "docid": "5761df992ab914ab0fa39c96405cec0c", "score": "0.6025679", "text": "func New(cfg Config) *Handler {\n\th := &Handler{\n\t\tlogger: cfg.Logger,\n\t\trenderer: render.New(\n\t\t\trender.Options{StreamingJSON: true},\n\t\t),\n\t\tsigner: cfg.Signer,\n\t}\n\n\trouter := mux.NewRouter()\n\trouter.Path(\"/get\").\n\t\tMethods(http.MethodGet).\n\t\tQueries(\"key\", \"{key}\").\n\t\tHandler(ochttp.WithRouteTag(\n\t\t\thttp.HandlerFunc(h.get), \"get\"),\n\t\t)\n\trouter.Path(\"/put\").\n\t\tMethods(http.MethodGet).\n\t\tHandler(ochttp.WithRouteTag(\n\t\t\thttp.HandlerFunc(h.put), \"put\",\n\t\t))\n\trouter.Path(\"/delete\").\n\t\tQueries(\"key\", \"{key}\").\n\t\tMethods(http.MethodDelete).\n\t\tHandler(ochttp.WithRouteTag(\n\t\t\thttp.HandlerFunc(h.delete), \"delete\",\n\t\t))\n\trouter.Path(\"/download\").\n\t\tMethods(http.MethodGet).\n\t\tQueries(\"key\", \"{key}\", \"fileName\", \"{filename}\").\n\t\tHandler(ochttp.WithRouteTag(\n\t\t\thttp.HandlerFunc(h.download), \"download\",\n\t\t))\n\th.Handler = router\n\treturn h\n}", "title": "" }, { "docid": "564a4ce3175d8047c064e339aa0b2366", "score": "0.60089934", "text": "func NewHandler(manager Manager) *Handler {\n\treturn &Handler{manager}\n}", "title": "" }, { "docid": "7aee734b4f84771554a75d9576f5fd06", "score": "0.60073936", "text": "func NewHandler() *Handler {\n\treturn &Handler{}\n}", "title": "" }, { "docid": "7aee734b4f84771554a75d9576f5fd06", "score": "0.60073936", "text": "func NewHandler() *Handler {\n\treturn &Handler{}\n}", "title": "" }, { "docid": "7aee734b4f84771554a75d9576f5fd06", "score": "0.60073936", "text": "func NewHandler() *Handler {\n\treturn &Handler{}\n}", "title": "" }, { "docid": "7aee734b4f84771554a75d9576f5fd06", "score": "0.60073936", "text": "func NewHandler() *Handler {\n\treturn &Handler{}\n}", "title": "" }, { "docid": "618d8486e20afbee9b4fb6bea866ba3b", "score": "0.600094", "text": "func NewHandler(authService auth.Service, cfg *config.Config) Handler {\n\treturn &handler{\n\t\tauthService: authService,\n\t\tcfg: cfg,\n\t}\n}", "title": "" }, { "docid": "b59b5e0ff8fd0a837d384c0376c6dda9", "score": "0.5994386", "text": "func New(cfg config.Config) handlers.Handler {\n\treturn Handler{\n\t\tcs: controllers.New(cfg.Store()),\n\t\taa: activities.New(cfg.Store()),\n\t\tss: stats.New(cfg.Store()),\n\t\tcfg: cfg,\n\t}\n}", "title": "" }, { "docid": "d497d3f11e12fa0fab9060b7aa7d94c0", "score": "0.59908676", "text": "func NewHandler(sVice service.Service, config *Config, taskPersistence persistence.TaskManager, metadataMgr persistence.MetadataManager) *Handler {\n\thandler := &Handler{\n\t\tService: sVice,\n\t\ttaskPersistence: taskPersistence,\n\t\tmetadataMgr: metadataMgr,\n\t\tconfig: config,\n\t\trateLimiter: quotas.NewDynamicRateLimiter(func() float64 {\n\t\t\treturn float64(config.RPS())\n\t\t}),\n\t}\n\t// prevent us from trying to serve requests before matching engine is started and ready\n\thandler.startWG.Add(1)\n\treturn handler\n}", "title": "" }, { "docid": "1e19fcd82b2c1ee719556b5776688189", "score": "0.59908235", "text": "func NewHandler(app *Application) *Handler {\n\treturn &Handler{\n\t\tApp: app,\n\t}\n}", "title": "" }, { "docid": "b4d6c34b709256564e472c17113a4f80", "score": "0.5988062", "text": "func NewHandler() handler.Handler {\n\treturn &Handler{}\n}", "title": "" }, { "docid": "58daf60c615920aa7195e250e8b3be98", "score": "0.5983462", "text": "func Handler(indexPaths ...string) http.Handler {\n\tpaths := make(map[string]struct{})\n\tfor _, path := range indexPaths {\n\t\tpaths[path] = struct{}{}\n\t}\n\n\tvar fileServer http.Handler\n\tif dev {\n\t\tfileServer = http.FileServer(data.Files)\n\t} else {\n\t\tfileServer = httpgzip.FileServer(data.Files, httpgzip.FileServerOptions{\n\t\t\tIndexHTML: true,\n\t\t})\n\t}\n\n\treturn &assetHandler{\n\t\thandler: fileServer,\n\t\tindexPaths: paths,\n\t}\n}", "title": "" }, { "docid": "fdb0d9ea7b9cbc3f40705933aea5c44e", "score": "0.5981884", "text": "func NewHandler(k Keeper) sdk.Handler {\n\treturn func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) {\n\t\tctx = ctx.WithEventManager(sdk.NewEventManager())\n\t\tswitch msg := msg.(type) {\n\t\tcase MsgWithdraw:\n\t\t\treturn handleMsgWithdraw(ctx, k, msg)\n\t\tdefault:\n\t\t\terrMsg := fmt.Sprintf(\"unrecognized %s message type: %T\", types.ModuleName, msg)\n\t\t\treturn nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "cf68ceec13fccd7d616ac0224c77851f", "score": "0.5975881", "text": "func NewHandler(k Keeper) sdk.Handler {\n\treturn func(ctx sdk.Context, msg sdk.Msg) sdk.Result {\n\t\tswitch msg := msg.(type) {\n\t\tcase MsgSvcDef:\n\t\t\treturn handleMsgSvcDef(ctx, k, msg)\n\t\tdefault:\n\t\t\treturn sdk.ErrTxDecode(\"invalid message parse in staking module\").Result()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b1df82c0d612d892c273e3ba3af8947b", "score": "0.5968188", "text": "func NewHandler(\n\tcdb *datastore.CachedDB,\n\tedVerifier *signing.EdVerifier,\n\tp pubsub.Publisher,\n\tf system.Fetcher,\n\tbc system.BeaconCollector,\n\tm meshProvider,\n\tdecoder ballotDecoder,\n\tverifier vrfVerifier,\n\tclock layerClock,\n\topts ...Opt,\n) *Handler {\n\tb := &Handler{\n\t\tlogger: log.NewNop(),\n\t\tcfg: defaultConfig(),\n\t\tcdb: cdb,\n\t\tedVerifier: edVerifier,\n\t\tpublisher: p,\n\t\tfetcher: f,\n\t\tmesh: m,\n\t\tdecoder: decoder,\n\t\tclock: clock,\n\t}\n\tfor _, opt := range opts {\n\t\topt(b)\n\t}\n\tif b.validator == nil {\n\t\tb.validator = NewEligibilityValidator(b.cfg.LayerSize, b.cfg.LayersPerEpoch, b.cfg.MinimalActiveSetWeight, cdb, bc, m, b.logger, verifier)\n\t}\n\treturn b\n}", "title": "" }, { "docid": "adebc2565a110dfef40bcf880eea744d", "score": "0.5964589", "text": "func NewHandler(cfg *config.Config, studentService student.Service) Handler {\n\treturn &handler{\n\t\tcfg: cfg,\n\t\tstudentService: studentService,\n\t}\n}", "title": "" }, { "docid": "f1805bf6f99c31e8a95f1015c21edccc", "score": "0.59615916", "text": "func NewHandler(k keeper.Keeper) sdk.Handler {\n\treturn func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) {\n\t\tctx = ctx.WithEventManager(sdk.NewEventManager())\n\t\tswitch msg := msg.(type) {\n\t\tcase types.MsgSubmitApplication:\n\t\t\treturn handleMsgSubmitApplication(ctx, k, msg)\n\t\tcase types.MsgVote:\n\t\t\treturn handleMsgVote(ctx, k, msg)\n\t\tcase types.MsgProposeKick:\n\t\t\treturn handleMsgProposeKick(ctx, k, msg)\n\t\tcase types.MsgLeaveValidatorSet:\n\t\t\treturn handleMsgLeaveValidatorSet(ctx, k, msg)\n\t\tdefault:\n\t\t\terrMsg := fmt.Sprintf(\"unrecognized %s message type: %T\", types.ModuleName, msg)\n\t\t\treturn nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2728823227a013bb9a09369bffffeaeb", "score": "0.5955072", "text": "func NewHandler(c *redis.Client, entityName string, schema schema.Schema) *Handler {\n\tvar filterable, sortable, numeric []string\n\n\t// TODO - better?\n\tfor k, v := range schema.Fields {\n\t\t// ID is always filterable - needed for queries.\n\t\tif k == \"id\" {\n\t\t\tfilterable = append(filterable, k)\n\t\t} else if v.Filterable {\n\t\t\tfilterable = append(filterable, k)\n\t\t}\n\n\t\t// TODO - other specifics like ID?\n\t\tif v.Sortable {\n\t\t\tsortable = append(sortable, k)\n\t\t}\n\n\t\t// Detect possible numeric-value fields\n\t\t// TODO - don't use reflection? Use isNumeric?\n\t\tt := fmt.Sprintf(\"%T\", v.Validator)\n\t\tif t == \"Integer\" || t == \"Float\" || t == \"Time\" {\n\t\t\tnumeric = append(numeric, k)\n\t\t}\n\t}\n\n\treturn &Handler{\n\t\tclient: c,\n\t\tmanager: &ItemManager{\n\t\t\tEntityName: entityName,\n\t\t\tFieldNames: []string{ETagField, payloadField},\n\t\t\tFilterable: filterable,\n\t\t\tSortable: sortable,\n\t\t\tNumeric: numeric,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "0863a6796104df3cb02fbd4bd7029d1d", "score": "0.5953399", "text": "func NewHandler(conn *connection.Connection, backendID string, next http.Handler) *Handler {\n\treturn &Handler{conn, backendID, next}\n}", "title": "" }, { "docid": "cfdc0193467dec60954479220ccfaed3", "score": "0.59462416", "text": "func NewHandler(k Keeper) sdk.Handler {\n\treturn func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) {\n\t\tctx = ctx.WithEventManager(sdk.NewEventManager())\n\t\tswitch msg := msg.(type) {\n\t\tcase MsgCreatePermission:\n\t\t\treturn HandleMsgCreatePermission(ctx, k, msg)\n\t\tcase MsgUpdatePermission:\n\t\t\treturn HandleMsgUpdatePermission(ctx, k, msg)\n\t\tcase MsgDeletePermission:\n\t\t\treturn HandleMsgDeletePermission(ctx, k, msg)\n\t\tdefault:\n\t\t\terrMsg := fmt.Sprintf(\"unrecognized %s message type: %T\", ModuleName, msg)\n\t\t\treturn nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9e35951b826763c402697bda501316fd", "score": "0.5941867", "text": "func NewHandler(version CodeVersion, more func() interface{}) http.Handler {\n\tbi, ok := debug.ReadBuildInfo()\n\tif !ok {\n\t\tlog.Println(\"no buildinfo available for /info\")\n\t}\n\tgov := GoVersion{\n\t\tCompiler: runtime.Compiler,\n\t\tArch: runtime.GOARCH,\n\t\tOs: runtime.GOOS,\n\t\tVersion: runtime.Version(),\n\t}\n\treturn infoHandler{bi, gov, version, more}\n}", "title": "" }, { "docid": "a6fa69480295a1cbfe181659023d0317", "score": "0.5940494", "text": "func NewHandler() Handler {\r\n\t// In the absence of a properly-wired DI layer, just manually wire up the\r\n\t// dependencies here for this simple example.\r\n\t// TODO(mrsheepuk) Refactor this using Wire\r\n\tclientSrc := k8sClientSource{\r\n\t\tmode: InCluster,\r\n\t}\r\n\tclient, err := clientSrc.client()\r\n\tif err != nil {\r\n\t\tpanic(\"Could not create k8s client\")\r\n\t}\r\n\trg := roleGetter{\r\n\t\tclientset: client,\r\n\t}\r\n\tapi := roleAPI{\r\n\t\troleGetter: &rg,\r\n\t}\r\n\thandler := Handler{\r\n\t\tapi: &api,\r\n\t}\r\n\treturn handler\r\n}", "title": "" }, { "docid": "8dd72c03a497c5763d6258caab79ef51", "score": "0.5938425", "text": "func New(uc usecase.Usecase) Handler {\n\treturn &handler{uc: uc}\n}", "title": "" }, { "docid": "2f0232e295cfe8f04e3238199ec9eba2", "score": "0.59372294", "text": "func New(app *laze.App) Handler {\r\n\treturn Handler{app: app}\r\n}", "title": "" }, { "docid": "8393c032f36c70362a98d5b763385cb6", "score": "0.59341717", "text": "func newHandler(server *ServerContext, privs HandlerPrivs, response http.ResponseWriter, request *http.Request) *Handler {\n\treturn &Handler{\n\t\tserver: server,\n\t\tprivs: privs,\n\t\trq: request,\n\t\tresponse: response,\n\t\tstatus: http.StatusOK,\n\t\tstartTime: time.Now(),\n\t\tuid: atomic.AddUint64(&lastUid, 1),\n\t}\n}", "title": "" }, { "docid": "dc6d8e7bf054b408e8de981d327cdd55", "score": "0.59328", "text": "func NewHandler(service *Service) *Handler {\n\treturn &Handler{\n\t\tService: service,\n\t}\n}", "title": "" }, { "docid": "89faed0ce78c3fa24dd28dd91d3b33c1", "score": "0.5923521", "text": "func NewHandler(manager Manager, checkPresharedSecret bool, presharedSecret string) *Handler {\n\treturn &Handler{manager, checkPresharedSecret, presharedSecret}\n}", "title": "" }, { "docid": "d8d8bc5233eb6e6efee995204b77af26", "score": "0.5917088", "text": "func NewHandler(i resource.Index) (*Handler, error) {\n\tif c, ok := i.(schema.Compiler); ok {\n\t\tif err := c.Compile(); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\t// define schema, with our rootQuery and rootMutation\n\ts, err := graphql.NewSchema(graphql.SchemaConfig{\n\t\tQuery: newRootQuery(i),\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Handler{schema: s}, nil\n}", "title": "" }, { "docid": "4ecda987461bc9686f8ee09d483ddf29", "score": "0.5914312", "text": "func New() (Handler, error) {\n\treturn &handler{}, nil\n}", "title": "" }, { "docid": "0088f5582bd3469ad065aee4511b85b7", "score": "0.59139055", "text": "func NewHandler(repo db.Repository, dl dataloaders.Retriever) http.Handler {\n\treturn handler.NewDefaultServer(generated.NewExecutableSchema(generated.Config{\n\t\tResolvers: &Resolver{\n\t\t\tRepository: repo,\n\t\t\tDataLoaders: dl,\n\t\t},\n\t}))\n}", "title": "" }, { "docid": "77907d913db5ed476c2eeca5dc9c7c89", "score": "0.5910588", "text": "func NewHandler(gohan *gh.Gohan) *Handler {\n\treturn &Handler{\n\t\tgohan: gohan,\n\t}\n}", "title": "" }, { "docid": "3f22ce3fd7fa45f01d669e5b4046a3f9", "score": "0.59012604", "text": "func AssetHandler(assets http.FileSystem) http.Handler {\n\treturn httpgzip.FileServer(assets, httpgzip.FileServerOptions{ServeError: httpgzip.Detailed})\n}", "title": "" }, { "docid": "0fe460ba0b0c3f33e7f974d2e02e54c7", "score": "0.5898568", "text": "func NewHandler(keeper Keeper) sdk.Handler {\n\treturn func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) {\n\t\tctx = ctx.WithEventManager(sdk.NewEventManager())\n\t\t// types.Logger.Info(fmt.Sprintf(\"msg: %+v\", msg))\n\t\tswitch msg := msg.(type) {\n\t\tcase MsgSendWithUnlock:\n\t\t\treturn handleSendWithUnlock(ctx, msg, keeper)\n\t\tcase MsgPayout:\n\t\t\treturn handlePayout(ctx, msg, keeper)\n\t\tdefault:\n\t\t\treturn nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, \"unrecognized %s message type: %T\", ModuleName, msg)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "8a162544676ea8fc93c5c0791df54905", "score": "0.5896498", "text": "func NewHandler(keeper Keeper) sdk.Handler {\n\treturn func(ctx sdk.Context, msg sdk.Msg) sdk.Result {\n\t\tswitch msg := msg.(type) {\n\t\tcase MsgSubmitRecord:\n\t\t\treturn handleMsgSubmitFile(ctx, keeper, msg)\n\t\tdefault:\n\t\t\terrMsg := \"Unrecognized record msg type\"\n\t\t\treturn sdk.ErrUnknownRequest(errMsg).Result()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "3a49b094d91e9be62606b1ce44189a14", "score": "0.58919555", "text": "func NewHandler(cfg *config.Config, authService auth.Service) Handler {\n\treturn &handler{\n\t\tcfg: cfg,\n\t\tauthService: authService,\n\t}\n}", "title": "" }, { "docid": "9e0769340f9c9b154ddb3c5ac3cd0026", "score": "0.5891819", "text": "func AssetHandler(r *http.Request, h http.Header, b *bytes.Buffer) error {\n\terr := CheckQuery(r, []string{\"GET\"}, []string{}, []string{\"v\"})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif assetError != nil {\n\t\treturn assetError\n\t}\n\n\ta := assets[r.URL.Path]\n\tif a == nil {\n\t\treturn StatusError{Code: http.StatusNotFound}\n\t}\n\n\tb.Write(a.b)\n\n\th.Set(\"Surrogate-Control\", \"max-age=86400\")\n\th.Set(\"Cache-Control\", \"max-age=86400\")\n\th.Set(\"Content-Type\", a.mime)\n\n\treturn nil\n}", "title": "" }, { "docid": "09de954796c212e6448f2dc98e75ff00", "score": "0.5883823", "text": "func createAssetFileHandler(file *assets.File) gwruntime.HandlerFunc {\n\treturn func(w http.ResponseWriter, r *http.Request, pathParams map[string]string) {\n\t\thttp.ServeContent(w, r, file.Name(), file.ModTime(), file)\n\t}\n}", "title": "" }, { "docid": "61a6acc9a7ed4062478a4f6248e03352", "score": "0.5866767", "text": "func NewHandler(config *Config) (*Handler, error) {\n\thandler := Handler{\n\t\tconfig: config,\n\t}\n\n\terr := handler.initAws()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error initializing aws handler: %s\", err)\n\t}\n\n\treturn &handler, nil\n}", "title": "" }, { "docid": "3d34d557c7aedf706ff7aa57d002c791", "score": "0.5862051", "text": "func NewHandler(keepers Keepers) sdk.Handler {\n\treturn func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) {\n\t\tswitch msg := msg.(type) {\n\t\tcase types.MsgCreateBid:\n\t\t\treturn handleMsgCreateBid(ctx, keepers, msg)\n\t\tcase types.MsgCloseBid:\n\t\t\treturn handleMsgCloseBid(ctx, keepers, msg)\n\t\tcase types.MsgCloseOrder:\n\t\t\treturn handleMsgCloseOrder(ctx, keepers, msg)\n\t\tdefault:\n\t\t\treturn nil, sdkerrors.ErrUnknownRequest\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c372b72c1855de0608c08ec36b55935e", "score": "0.58587056", "text": "func NewHandler() Handler {\n\treturn &handler{\n\t\tRouter: mux.NewRouter(),\n\t\tInjector: inject.New(),\n\t\tmodules: make(map[string]Module)}\n}", "title": "" }, { "docid": "edc183a1d1c5ee7e9c9652b6e4d9f8e9", "score": "0.5857618", "text": "func NewHandler(scheduler scheduler.Scheduler, sc saga.SagaCoordinator, stat stats.StatsReceiver) scoot.CloudScoot {\n\thandler := &Handler{scheduler: scheduler, sagaCoord: sc, stat: stat}\n\treturn handler\n}", "title": "" }, { "docid": "130a0b37eda66b264d28a830ad0145e6", "score": "0.5846535", "text": "func New() *Handler {\n\th := Handler{}\n\th.init()\n\treturn &h\n}", "title": "" }, { "docid": "b43e6a5fc88e6dd98dac3320ffdecf82", "score": "0.5840543", "text": "func NewHandler(bouncer security.BouncerService) *Handler {\n\th := &Handler{\n\t\tRouter: mux.NewRouter(),\n\t\trequestBouncer: bouncer,\n\t}\n\n\th.Handle(\"/edge_templates\",\n\t\tbouncer.AdminAccess(httperror.LoggerHandler(h.edgeTemplateList))).Methods(http.MethodGet)\n\n\treturn h\n}", "title": "" }, { "docid": "2f8709502bad4346d48bdc5b079fb0bb", "score": "0.58387053", "text": "func NewHandler(versionPrefix string, config HandlerConfig) (http.Handler, error) {\n\tif err := config.assertValid(); err != nil {\n\t\treturn nil, err\n\t}\n\th := &handler{HandlerConfig: config, locker: newIDLock()}\n\tmux := httptreemux.New()\n\tmux.POST(versionPrefix+initPath+\"/:hashed\", func(w http.ResponseWriter, r *http.Request, params map[string]string) {\n\t\th.initIdentity(w, r, params[\"hashed\"])\n\t})\n\tmux.POST(versionPrefix+refreshPath+\"/:hashed\", func(w http.ResponseWriter, r *http.Request, params map[string]string) {\n\t\th.refreshIdentity(w, r, params[\"hashed\"])\n\t})\n\treturn mux, nil\n}", "title": "" }, { "docid": "3ef02004df87bf38c36defbd04a22405", "score": "0.58343494", "text": "func NewHandler(keepers Keepers) sdk.Handler {\n\treturn func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) {\n\t\tswitch msg := msg.(type) {\n\t\tcase *types.MsgCreateBid:\n\t\t\treturn handleMsgCreateBid(ctx, keepers, msg)\n\t\tcase *types.MsgCloseBid:\n\t\t\treturn handleMsgCloseBid(ctx, keepers, msg)\n\t\tcase *types.MsgCloseOrder:\n\t\t\treturn handleMsgCloseOrder(ctx, keepers, msg)\n\t\tdefault:\n\t\t\treturn nil, sdkerrors.ErrUnknownRequest\n\t\t}\n\t}\n}", "title": "" }, { "docid": "72c73fd0d6f2836120531239e0a55226", "score": "0.58112574", "text": "func NewHandler(rootPath, sitePrefix, apiPrefix string) Handler {\n\treturn &handler{\n\t\trootPath: rootPath,\n\t\tsitePrefix: sitePrefix,\n\t\tapiPrefix: apiPrefix,\n\t}\n}", "title": "" }, { "docid": "ee503b41f5d273833ab0e6a426004917", "score": "0.5809002", "text": "func NewHandler(e *echo.Echo, us *usecase.Usecase, authMiddleWare echo.MiddlewareFunc) {\n\te.GET(\"/swagger/*\", echoSwagger.WrapHandler)\n\tapi := e.Group(\"/v1\")\n\tNewHealthcheckHandler(api, us.HealthCheckUsecase)\n\tNewAuthHandler(api, us.AuthUsecase, authMiddleWare)\n\tNewUserHandler(api, us.UserUsecase, authMiddleWare)\n}", "title": "" }, { "docid": "e0f336153a3438fb981ca5b514486001", "score": "0.58000606", "text": "func NewHandler(e *echo.Echo, ratelimiter ratelimit.Limiter) *Handler {\n\th := &Handler{\n\t\te: e,\n\t\tratelimiter: ratelimiter,\n\t}\n\th.SetRoutes()\n\treturn h\n}", "title": "" }, { "docid": "0de6dd40e58a78f87cddf2a540173c86", "score": "0.5789639", "text": "func NewHandler(me mino.Address, service ordering.Service, p pool.Pool,\n\tsigner crypto.Signer, client *evotingController.Client) *Handler {\n\treturn &Handler{\n\t\tme: me,\n\t\tservice: service,\n\t\tp: p,\n\t\tsigner: signer,\n\t\tclient: client,\n\t}\n}", "title": "" }, { "docid": "c33b3de91277ff09962f6f24082ef801", "score": "0.5786293", "text": "func NewHandler(config *nconfig.ServiceDataConfig) *Handler {\n\treturn &Handler{\n\t\tConfig: config,\n\t}\n}", "title": "" }, { "docid": "c39692ba06c43560bc934f572c384e59", "score": "0.57778656", "text": "func NewHandler(name string, next Handler, handleID int) Handler {\n\treturn &handler{name, next, handleID}\n}", "title": "" }, { "docid": "c635cf44ba15605dff40d8fee4f4303b", "score": "0.5777462", "text": "func (s *service) NewHandler() http.Handler {\n\trouter := tp.NewHTTPRouter(context.Background())\n\trouter.Handle(\"POST\", \"/hooks/stripe\", []tp.DecodeFunc{s.httpLogger(), s.stripeHookDecoder()}, s.stripeHookHandler())\n\treturn router\n}", "title": "" }, { "docid": "335c04978337b8659fc9f0abea1bb930", "score": "0.5767532", "text": "func (ins *tenantInstrumentationMiddleware) NewHandler(handlerName string, next http.Handler) http.HandlerFunc {\n\ttenantWrapper := func(w http.ResponseWriter, r *http.Request) {\n\t\ttenant := r.Header.Get(ins.tenantHeaderName)\n\t\tbaseLabels := prometheus.Labels{\"handler\": handlerName, \"tenant\": tenant}\n\t\thandlerStack := httpInstrumentationHandler(baseLabels, ins.metrics, next)\n\t\thandlerStack.ServeHTTP(w, r)\n\t}\n\treturn tenantWrapper\n}", "title": "" }, { "docid": "5ec5d33bbb174d15f3e0ddf3debc0da9", "score": "0.57625705", "text": "func New(staticConfig static.Configuration, runtimeConfig *config.RuntimeConfiguration) *Handler {\n\trConfig := runtimeConfig\n\tif rConfig == nil {\n\t\trConfig = &config.RuntimeConfiguration{}\n\t}\n\n\treturn &Handler{\n\t\tdashboard: staticConfig.API.Dashboard,\n\t\tstatistics: staticConfig.API.Statistics,\n\t\tdashboardAssets: staticConfig.API.DashboardAssets,\n\t\truntimeConfiguration: rConfig,\n\t\tdebug: staticConfig.Global.Debug,\n\t}\n}", "title": "" }, { "docid": "924bb17f1f52d8ba68c326f72ead6462", "score": "0.5749933", "text": "func NewHandler(services *service.Services, tokenManager auth.TokenManager) *API {\n\tapi := API{\n\t\tmux.NewRouter(),\n\t}\n\tapi.PathPrefix(userPath).Handler(newUser(services, tokenManager))\n\tapi.PathPrefix(authorPath).Handler(newAuthor(services, tokenManager))\n\n\treturn &api\n}", "title": "" }, { "docid": "77f60654fc6fee513c8e997181672045", "score": "0.5736662", "text": "func New(config *config.Config, fetcher *fetcher.Fetcher) Handler {\n\treturn Handler{\n\t\tfetcher: fetcher,\n\t\tconfig: config,\n\t}\n}", "title": "" }, { "docid": "ab86663ff8ee527426b93111c596f032", "score": "0.57297945", "text": "func (t HandlerTemplate) CreateHandler() {\n\n}", "title": "" }, { "docid": "35943e4b0357ef4460f82fbe94b2135b", "score": "0.5727538", "text": "func NewHandler(keeper keeper.Keeper) sdk.Handler {\n\treturn func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) {\n\t\tswitch msg := msg.(type) {\n\t\tcase types.MsgCreate:\n\t\t\treturn handleMsgCreate(ctx, keeper, msg)\n\t\tcase types.MsgUpdate:\n\t\t\treturn handleMsgUpdate(ctx, keeper, msg)\n\t\tcase types.MsgDelete:\n\t\t\treturn handleMsgDelete(ctx, keeper, msg)\n\t\tdefault:\n\t\t\treturn nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, \"unrecognized bank message type: %T\", msg)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ccabbdfc94e9fff590167d2116bc1d42", "score": "0.5725799", "text": "func NewHandler(j *imj.ImJSON) *ServiceHandler {\n\treturn &ServiceHandler{j: j}\n}", "title": "" }, { "docid": "ae215d7725d0d1156933137f1a2afad3", "score": "0.5720711", "text": "func NewHandler(keeper Keeper) sdk.Handler {\n\treturn func(ctx sdk.Context, msg sdk.Msg) sdk.Result {\n\t\tswitch msg := msg.(type) {\n\t\tcase MsgPublishAgentPrice:\n\t\t\treturn handleMsgPublishAgentPrice(ctx, keeper, msg)\n\t\tcase MsgPublishData:\n\t\t\treturn handleMsgPublishData(ctx, keeper, msg)\n\t\tcase MsgRentAgent:\n\t\t\treturn handleMsgRentAgent(ctx, keeper, msg)\n\t\tdefault:\n\t\t\terrMsg := fmt.Sprintf(\"Unrecognized agent Msg type: %v\", msg.Type())\n\t\t\treturn sdk.ErrUnknownRequest(errMsg).Result()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "508a5480ae83f27283419452cb307fe0", "score": "0.57173944", "text": "func New(logger logger.Logger, config *config.Config) *Handler {\n\treturn &Handler{\n\t\tlogger: logger,\n\t\tconfig: config,\n\t\tstats: &stats{\n\t\t\trequests: new(Requests),\n\t\t\tstartTime: time.Now(),\n\t\t},\n\t}\n}", "title": "" }, { "docid": "1d860addd96f17682e5a5a91e8a522bb", "score": "0.5707437", "text": "func NewHandler(serviceSignature string, details bool) *Handler {\n\tmux := http.NewServeMux()\n\thostname, _ := os.Hostname()\n\th := &Handler{\n\t\tdetails: details,\n\t\tserviceSignature: serviceSignature,\n\t\tstartTime: time.Now(),\n\t\thostname: hostname,\n\t\trootComponent: newComponentGroup(Major, Unknown),\n\n\t\tmux: mux,\n\t}\n\n\tmux.HandleFunc(\"/\", h.reportHTML)\n\tmux.HandleFunc(\"/liveness\", h.reportLiveness)\n\tmux.HandleFunc(\"/readiness\", h.reportReadiness)\n\tmux.HandleFunc(\"/min.css\", h.reportMinCSS)\n\tmux.HandleFunc(\"/json\", h.reportJSON)\n\n\treturn h\n}", "title": "" }, { "docid": "6ecb5b705f25b95bbac447c6e053ed42", "score": "0.57066023", "text": "func NewHandler(r Routeable) *Handler {\n\treturn &Handler{router: r}\n}", "title": "" }, { "docid": "293d7a8a82d189f38b136bd759d5d962", "score": "0.5703153", "text": "func NewHandler(ossHandler *webapi.Handler, operator ops.Operator) *Handler {\n\th := &Handler{Handler: ossHandler, Operator: operator}\n\n\t// OAuth2 related API\n\th.GET(\"/oidc/callback\", telehttplib.MakeHandler(h.oidcCallback))\n\th.POST(\"/saml/callback\", telehttplib.MakeHandler(h.samlCallback))\n\th.POST(\"/oidc/login/console\", telehttplib.MakeHandler(h.loginConsole))\n\n\t// Remote access API\n\th.GET(\"/sites/:domain/access\", h.needsAuth(h.getRemoteAccess))\n\th.PUT(\"/sites/:domain/access\", h.needsAuth(h.updateRemoteAccess))\n\n\t// License API\n\th.PUT(\"/sites/:domain/license\", h.needsAuth(h.updateLicense))\n\th.POST(\"/license\", h.needsAuth(h.newLicense))\n\th.POST(\"/license/validate\", h.needsAuth(h.validateLicense))\n\n\th.SetPlugin(h)\n\treturn h\n}", "title": "" } ]
5e2d38617d9964f2257f50c89f55f173
GetObjectTypeOk returns a tuple with the ObjectType field value and a boolean to check if the value has been set.
[ { "docid": "620c2793dfb151901fa398d25e171a91", "score": "0.82072985", "text": "func (o *FabricMulticastPolicy) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" } ]
[ { "docid": "bd71fca4f1e9f659d65bcd23d411a723", "score": "0.84390974", "text": "func (o *PowerControlState) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "ac382c15b71a265969bbb497e69e0ea6", "score": "0.82899517", "text": "func (o *SoftwareHclMeta) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "ce85e7a31e010de7f5385f82eb69cff9", "score": "0.8262637", "text": "func (o *WorkflowPropertiesAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "97cde04fac00626fe138d155db0223b2", "score": "0.82420325", "text": "func (o *NetworkVrf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "342188416a213841b3c6596409a1ce86", "score": "0.82397395", "text": "func (o *VnicPlogiSettings) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "bc060d55386bbbc328a7fbae7c6a8c48", "score": "0.82066995", "text": "func (o *OsAnswers) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "17a939dc6c27cb70cb510a6b535c3d16", "score": "0.8185759", "text": "func (o *MonitoringCategoryStatus) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "2f8fd2da7cc7ad02d1a3d024ab8a024e", "score": "0.8182387", "text": "func (o *IamUser) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "21aed0e8735c098a35ce2162a431b2b9", "score": "0.8157512", "text": "func (o *ConnectorSshConfig) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "5287fb417350045af0f883a1ab4ff3c4", "score": "0.8157131", "text": "func (o *VnicRoceSettingsAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "8e27940c6627efd9082263b997819cb6", "score": "0.81351614", "text": "func (o *WorkflowTemplateFunctionMetaAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "4dabf4711749c53bb1c48de4c9bdc094", "score": "0.81225306", "text": "func (o *NiatelemetryEpg) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "5e0b173511bab4de439a51331c9254db", "score": "0.8119508", "text": "func (o *EtherPortChannel) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "f94aa1672ae56a72639c08b4925dd034", "score": "0.8111603", "text": "func (o *ApplianceMetaManifest) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "156bcc050b834570b8005bb8d39b0a13", "score": "0.81090075", "text": "func (o *NiatelemetryNiaLicenseState) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "76cf898e785469509d176cb15d688118", "score": "0.8108719", "text": "func (o *FabricFcZoneMemberAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "5d6cabb02463307cb9ec7798334d7ec2", "score": "0.80992085", "text": "func (o *OauthAuthorization) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "1727c3ed4751ce82970736d520ed8ade", "score": "0.8094876", "text": "func (o *WorkflowTaskDefinitionAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "b8086c45d052b375ee5c82c5753e44a4", "score": "0.80782396", "text": "func (o *WorkflowSolutionDefinitionAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "15da5c0331b7d4402785f011a7806789", "score": "0.80694497", "text": "func (o *VirtualizationVmwareTeamingAndFailoverAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "56ec7ff06cbf63258acb704dd1277c4c", "score": "0.80613405", "text": "func (o *StoragePureSnapshotSchedule) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "e89c5271af1acad218183df9146766fe", "score": "0.80328685", "text": "func (o *WorkflowTaskNotification) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "336f7038222c9d20e9b730e4eba0ae47", "score": "0.8027667", "text": "func (o *CondHclStatusDetailAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "301168ecee183aed1f5439fe4fc6de9b", "score": "0.80203676", "text": "func (o *HyperflexCiscoHypervisorManager) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "845dc784064eb67fc52049ad2426bfb5", "score": "0.80199337", "text": "func (o *StoragePureReplicationScheduleAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "72c0efbbe37f6ed0fef6a4039d6b560d", "score": "0.80034536", "text": "func (o *WorkflowServiceItemActionPropertiesAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "8e9dc5835bd958e9923d3f1c4ccc69cb", "score": "0.8003156", "text": "func (o *AssetOauthBearerTokenCredential) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "6937ef7b4c3b140a5191d6b710e65c74", "score": "0.79996234", "text": "func (o *PolicyScheduledActionAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "e133da7b152a7a61fe6c7efb992a8202", "score": "0.7996027", "text": "func (o *ProcessorUnitAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "b9bfb886b06e3964cb3cecc608c46803", "score": "0.7994376", "text": "func (o *CapabilitySwitchCapability) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "9f945714d34db339bb4abc769e815ccb", "score": "0.7990232", "text": "func (o *HyperflexDrive) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "fae76f37ac000ccd5463e6d5247a2368", "score": "0.7988492", "text": "func (o *AssetGoogleCloudPlatformServiceAccountKeyCredential) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "79b23c9cdaecb2ddabf42e903e4631be", "score": "0.7978981", "text": "func (o *VirtualizationIweCluster) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "c77b54229775d2c9e4c5642eae526d7e", "score": "0.7971309", "text": "func (o *IamResourcePermission) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "241071655b714ab232cf22de656418fa", "score": "0.79704463", "text": "func (o *SoftwarerepositoryLocalMachine) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "5b5804da9091f4518ee025d19e2c4bfe", "score": "0.79611605", "text": "func (o *WorkflowServiceItemActionDefinitionAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "f45242eb3be6e06d49201bdbd97811e3", "score": "0.7958544", "text": "func (o *HyperflexBackupPolicySettingsAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "cceeaa7a68afc9aaee0c79d23f4eadec", "score": "0.7958463", "text": "func (o *RecommendationSoftwareItemAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "cbd5eeb7d85b78d757d9a9081c1038dc", "score": "0.7955599", "text": "func (o *AssetDeviceConfigurationAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "cd2494b6d2caecb47513d6cfc5445f5a", "score": "0.7943245", "text": "func (o *CloudSkuVolumeType) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "76ea702fed126483a1e5da8a1f35d7f8", "score": "0.7941802", "text": "func (o *IwotenantTenantStatusAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "922b911b872fc11da6fed8429a7a9d2c", "score": "0.79326624", "text": "func (o *StorageNetAppFcPortEvent) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "fd198b922fa11e6520fdfcde7a191a93", "score": "0.79324067", "text": "func (o *SoftwarerepositoryFile) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "1f1952d217fe5d5a59cf905913ee04de", "score": "0.7930637", "text": "func (o *AssetConnectionControlMessageAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "8cb1af776d7ed798731d8daa5a7400ce", "score": "0.792392", "text": "func (o *NiatelemetryCommonPoliciesAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "0640d5db238d12b3e3c809319853e55b", "score": "0.7923651", "text": "func (o *FabricTransceiverRoleAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "23a411efabb564cab4f207185c494c60", "score": "0.7922674", "text": "func (o *WorkflowServiceItemInstanceAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "e7456e8c5d27984844a1490121b156ca", "score": "0.79127747", "text": "func (o *VirtualizationCloudInitConfig) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "8d7dc6e36b13624ebb27e1c687edbef6", "score": "0.79045665", "text": "func (o *HyperflexUcsmConfigPolicy) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "bf048fbdb630bc85f2776fce9e7fcd55", "score": "0.78993887", "text": "func (o *AssetDeploymentDeviceAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "009541da712145d1677b37dc05f21721", "score": "0.78931713", "text": "func (o *VirtualizationVmwareDistributedNetwork) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "aa606e8ff34d6a9fd70bf1a300d30116", "score": "0.7892823", "text": "func (o *FirmwareDistributableAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "fc7b7b2df81b1fae9a8da58365f6a319", "score": "0.78908116", "text": "func (o *StorageFlexFlashControllerProps) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "a880014b7b8e44a6329d2500fff17e53", "score": "0.78892684", "text": "func (o *StorageStoragePolicy) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "6e4a436b2b7c455df01b5d219ffbf87a", "score": "0.7889201", "text": "func (o *ApplianceCertRenewalPhase) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "532d0b140b3d7d85b9fb2eb22015fa07", "score": "0.7880963", "text": "func (o *InventoryGenericInventoryHolder) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "a13447cf23a8b450df48e51ee7bbbd93", "score": "0.7875818", "text": "func (o *NiatelemetryHcloudDetailsAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "7045890f1e7985615f32b8060286724f", "score": "0.7872087", "text": "func (o *MemoryPersistentMemoryUnit) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "adfee11df0661f57df80ac55f06a3d07", "score": "0.7871357", "text": "func (o *VirtualizationVirtualDiskAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "a58061776b573fed51644fe8c81d60da", "score": "0.78708184", "text": "func (o *OsTemplateFile) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "11c151996f48a39a4e7f4f96103f333d", "score": "0.78558517", "text": "func (o *HyperflexCapabilityAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "ab916b78647db61dcb1bf75d32077ea5", "score": "0.7855632", "text": "func (o *StorageHitachiVolumeAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "87388b456582364d878248e4e523a77f", "score": "0.7852676", "text": "func (o *FabricEthNetworkControlPolicyAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "b890f1b46bdf1395f719a28881d36491", "score": "0.78498304", "text": "func (o *VirtualizationVmwareVirtualMachineSnapshotAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "4feaad2b4abd6fcbf461344b2730defa", "score": "0.78450423", "text": "func (o *HyperflexStorageContainerAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "6c5624dea3fd8e9cf8806be0f4e2e9a2", "score": "0.78357095", "text": "func (o *StorageExternalLun) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "88b0a1b1333b23dcb31a44e8df8e99e7", "score": "0.7829109", "text": "func (o *NiatelemetryVpcDetailsAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "437f42f2906f0a6602918937551b3ec0", "score": "0.7828605", "text": "func (o *VirtualizationVmwareVirtualNetworkInterface) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "d0dd58aa406fac5b5cea5e659321aeac", "score": "0.7825767", "text": "func (o *EquipmentIoCardAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "abf8a0701bad66bcf1ee7f0222e9dc21", "score": "0.78250635", "text": "func (o *NiatelemetryNiaInventoryFabricAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "4fb2613f120a968eeb7290286dd41976", "score": "0.7823364", "text": "func (o *StorageBaseCapacityAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "be25ce9c5eb21a65aa6eadc5c1180368", "score": "0.7813875", "text": "func (o *NiatelemetryNiaInventoryDcnm) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "3030512b1ae92913f9e921dab7850a7d", "score": "0.7810534", "text": "func (o *SoftwarerepositoryCachedImage) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "2813f858952540f3987d9731d059ceff", "score": "0.7808315", "text": "func (o *AssetAddressInformationAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "090443a13a8e8a90a044321c6479430b", "score": "0.7796364", "text": "func (o *CapabilityPortGroupAggregationDefAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "7d19140691ffe943d8e32622f651a055", "score": "0.7794607", "text": "func (o *HyperflexClusterReplicationNetworkPolicyDeployment) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "97b5b628af1c03024b91cdc0bbb44e4c", "score": "0.77878314", "text": "func (o *FaultInstanceAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "ee106c49aa58b949d4dbd644a8e30d7d", "score": "0.7786482", "text": "func (o *VnicFcInterruptSettingsAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "b210e069f9cd49a746ab719bbd296833", "score": "0.7763514", "text": "func (o *SoftwarerepositoryCategoryMapperModelAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "8b81066bd5aa4d2e4929c78328374324", "score": "0.7761914", "text": "func (o *KubernetesNodeGroupProfileAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "3c7475a0ce7009f6fe60537e02f16543", "score": "0.77246875", "text": "func (o *StorageNetAppBaseSnapMirrorPolicyAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "a4b3d6e54422081f740c406b9bc5c2cb", "score": "0.77211887", "text": "func (o *StorageHitachiExternalPathGroupAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "5f8ea73c65dbe6ff19414e9141deeedd", "score": "0.7689904", "text": "func (o *VirtualizationIweVirtualMachineNetworkInterface) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "4531d6b7f90a666cecaa5bc09b88da67", "score": "0.76839036", "text": "func (o *VnicFcAdapterPolicyAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "50a02cca0d169f045389b47af35bf3bb", "score": "0.76761436", "text": "func (o *StorageNetAppNfsServiceAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "1b2d15eff72e0661392d72b383eb4d4c", "score": "0.76653606", "text": "func (o *KubernetesBaseProductAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "b1831c4d2a647af9a4fba9625f35a2be", "score": "0.76556003", "text": "func (o *ServiceitemSelectionCriteriaInput) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "a8b996f35cf10797a7ccb27258165427", "score": "0.76418877", "text": "func (o *FirmwareUnsupportedVersionUpgradeAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "14eb4ee4bdbb7ee3d2aaaed2f0c3428d", "score": "0.7634665", "text": "func (o *KubernetesVirtualMachineInfrastructureProviderAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "7caa26b59d5fca7b277cbd71b57917c9", "score": "0.76160234", "text": "func (o *IamIpAddressAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "a336736269e803b6abfd353ed5ed9ba2", "score": "0.7614565", "text": "func (o *CloudNetworkInterfaceAttachmentAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "85cf2066a33c42a02f8784929913d4c5", "score": "0.75798625", "text": "func (o *StorageNetAppBaseDiskAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "0d6b96fd95c9ca1248c33e9380a0d8ef", "score": "0.74985296", "text": "func (o *VirtualizationVmwareVmCpuSocketInfoAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "c98e2442fd24d758434cd00e099d753e", "score": "0.747932", "text": "func (o *CloudSkuRegionRateCardsAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "b620313f676e0a4131bef6c31adff4e8", "score": "0.73447543", "text": "func (o *VirtualizationVmwareResourceAllocationSystemTrafficTypesAllOf) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "title": "" }, { "docid": "9638c59d2f5d987611a21fd668975880", "score": "0.6881609", "text": "func (m *_BACnetConfirmedServiceRequestCreateObjectObjectSpecifier) GetIsObjectType() bool {\n\tctx := context.Background()\n\t_ = ctx\n\trawObjectType := m.RawObjectType\n\t_ = rawObjectType\n\tobjectIdentifier := m.ObjectIdentifier\n\t_ = objectIdentifier\n\treturn bool(bool((m.GetRawObjectType()) != (nil)))\n}", "title": "" }, { "docid": "99799246b9ecd3ac775eebbf5105f6cf", "score": "0.6240105", "text": "func (o *PowerControlState) GetObjectType() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.ObjectType\n}", "title": "" }, { "docid": "522768f9a8cd1e676f8c8232d23d2ab3", "score": "0.61787415", "text": "func (o *ConnectableDTO) GetTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Type, true\n}", "title": "" }, { "docid": "0906ce663094ab808a7219fcc8b86879", "score": "0.61745304", "text": "func (o *PostCheckPermissionBody) GetObjectOk() (*string, bool) {\n\tif o == nil || o.Object == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Object, true\n}", "title": "" }, { "docid": "0fd6a163d70de274a0a0e997b738b1d0", "score": "0.61030793", "text": "func (o *CondHclStatusDetailAllOf) GetObjectType() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.ObjectType\n}", "title": "" } ]
fcaf76c42bb09f99dd214a73a8a7de72
GetCurrentFees returns your current maker & taker fee rates, as well as your 30day trailing volume. Quoted rates are subject to change.
[ { "docid": "dd834a8079cc739eec1684316d58d14e", "score": "0.785179", "text": "func (c *Client) GetCurrentFees() (Fees, error) {\n\tmethod := http.MethodGet\n\tpath := \"/fees\"\n\n\tvar fees Fees\n\tif err := c.exec(unixTime(), method, path, noBody, nil, &fees); err != nil {\n\t\treturn Fees{}, err\n\t}\n\n\treturn fees, nil\n}", "title": "" } ]
[ { "docid": "6b015f4980ee956dbf5c99dd6f9c96d6", "score": "0.678562", "text": "func GetCurrentFee() (float64, error) {\n\treq := struct {\n\t\tID int `json:\"id\"`\n\t\tMethod string `json:\"method\"`\n\t\tParams []int `json:\"params\"`\n\t}{\n\t\tID: 1,\n\t\tMethod: \"blockchain.estimatefee\",\n\t\tParams: []int{2},\n\t}\n\n\tmsg := struct {\n\t\tJSONRPC string `json:\"jsonrpc,omitempty\"`\n\t\tID int `json:\"id\"`\n\t\tResult float64 `json:\"result\"`\n\t}{}\n\n\tvar fee float64\n\tvar MaxTries = 5\n\tfor try := 0; try < MaxTries; try++ {\n\t\tsendMsg(req, &msg)\n\n\t\tif msg.Result == -1.0 || msg.Result == 0 {\n\t\t\tlog.Printf(\"expected result > 0; received: %f\", msg.Result)\n\t\t\tcontinue\n\t\t}\n\n\t\tfee = msg.Result\n\t\t// sanity check\n\t\tif fee > 0.05 {\n\t\t\tfee = 0.1\n\t\t} else if fee < 0 {\n\t\t\tfee = 0\n\t\t}\n\n\t\tbreak\n\t}\n\n\tfmt.Printf(\"fee: %f\\n\", fee)\n\n\tif fee == 0 {\n\t\tlog.Print(\"could not get fees\")\n\t\treturn fee, errors.New(\"could not get fees\")\n\t}\n\n\treturn fee, nil\n}", "title": "" }, { "docid": "72f37514ac350f41a6a579dd855a5b0e", "score": "0.6442345", "text": "func (as *ApiService) ActualFee(symbols string) (*ApiResponse, error) {\n\tp := map[string]string{\n\t\t\"symbols\": symbols,\n\t}\n\treq := NewRequest(http.MethodGet, \"/api/v1/trade-fees\", p)\n\treturn as.Call(req)\n}", "title": "" }, { "docid": "b52e5a5535ce0e10fe1cb5045895b986", "score": "0.64105886", "text": "func (cl *Client) GetFees(\n\tctx context.Context,\n\tcommitment CommitmentType,\n) (out *GetFeesResult, err error) {\n\tparams := []interface{}{}\n\tif commitment != \"\" {\n\t\tparams = append(params, M{\"commitment\": commitment})\n\t}\n\terr = cl.rpcClient.CallFor(&out, \"getFees\", params)\n\treturn\n}", "title": "" }, { "docid": "40554f92b787237eb842b903a05f4c2d", "score": "0.63321114", "text": "func GetCurrentFeeRate() (*big.Int, error) {\n\tfee, err := GetCurrentFee()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// convert to satoshis to bytes\n\t// feeRate := big.NewInt(int64(msg.Result * 1.0E8))\n\t// convert to satoshis to kb\n\tfeeRate := big.NewInt(int64(fee * 1.0E5))\n\n\tfmt.Printf(\"fee rate: %s\\n\", feeRate)\n\n\treturn feeRate, nil\n}", "title": "" }, { "docid": "05c7017fdf72ba29dafd984df55473b8", "score": "0.6289423", "text": "func getFees(sku string, price float64, class string) float64 {\n\tfees := rules.Fees\n\tclassFee, ok := fees.FBAClass[class]\n\tif !ok {\n\t\tclassFee = fees.FBAClass[\"default\"]\n\t}\n\tmrktFee := price * fees.FeePercentage\n\treturn mrktFee + classFee\n}", "title": "" }, { "docid": "dbbb7ca3616bd9337d0473daf24a9e5c", "score": "0.60821104", "text": "func (c *Conn) CalculateFees() (*big.Int, *big.Int, error) {\n\t// Set max fee per gas.\n\tfeePerGas, err := c.CurrentBaseFee(context.Background())\n\tif err != nil {\n\t\treturn nil, nil, errors.Wrap(err, \"failed to obtain current base fee\")\n\t}\n\n\tif viper.GetString(\"max-fee-per-gas\") == \"\" {\n\t\tviper.Set(\"max-fee-per-gas\", \"200gwei\")\n\t}\n\tmaxFeePerGas, err := string2eth.StringToWei(viper.GetString(\"max-fee-per-gas\"))\n\tif err != nil {\n\t\treturn nil, nil, errors.Wrap(err, \"failed to obtain max fee per gas\")\n\t}\n\n\t// Set priority fee per gas.\n\tpriorityFeePerGas, err := string2eth.StringToWei(viper.GetString(\"priority-fee-per-gas\"))\n\tif err != nil {\n\t\treturn nil, nil, errors.Wrap(err, \"failed to obtain max priority fee per gas\")\n\t}\n\n\t// Ensure that the total fee per gas does not exceed the max allowed.\n\ttotalFeePerGas := new(big.Int).Add(feePerGas, priorityFeePerGas)\n\tif totalFeePerGas.Cmp(maxFeePerGas) > 0 {\n\t\treturn nil, nil, fmt.Errorf(\"base fee %s plus priority fee %s (total %s) is higher than specified maximum (%s); increase with --max-fee-per-gas if you are sure you want to do this\", string2eth.WeiToGWeiString(feePerGas), string2eth.WeiToGWeiString(priorityFeePerGas), string2eth.WeiToGWeiString(totalFeePerGas), string2eth.WeiToGWeiString(maxFeePerGas))\n\t}\n\n\t// Try to double the base fee, but not exceed the max allowed.\n\tfeePerGas = new(big.Int).Mul(feePerGas, big.NewInt(2))\n\ttotalFeePerGas = totalFeePerGas.Add(feePerGas, priorityFeePerGas)\n\tif totalFeePerGas.Cmp(maxFeePerGas) >= 0 {\n\t\tfeePerGas = feePerGas.Sub(maxFeePerGas, priorityFeePerGas)\n\t}\n\n\t// Priority fee per gas cannot be higher than fee per gas.\n\tif priorityFeePerGas.Cmp(feePerGas) > 0 {\n\t\t// In this situation add the priority fee to the base fee.\n\t\tfeePerGas = feePerGas.Add(feePerGas, priorityFeePerGas)\n\t}\n\n\treturn feePerGas, priorityFeePerGas, nil\n}", "title": "" }, { "docid": "fa6e427e420c042e1c53c603847b7e0e", "score": "0.5792514", "text": "func (p *cybexAPI) GetRequiredFees(ops types.Operations, feeAsset types.GrapheneObject) (types.AssetAmounts, error) {\n\tresp, err := p.wsClient.CallAPI(0, \"get_required_fees\", ops.Envelopes(), feeAsset.ID())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tlogging.DDumpJSON(\"get_required_fees <\", resp)\n\n\tret := types.AssetAmounts{}\n\tif err := ffjson.Unmarshal(util.ToBytes(resp), &ret); err != nil {\n\t\treturn nil, errors.Annotate(err, \"unmarshal AssetAmounts\")\n\t}\n\n\treturn ret, nil\n}", "title": "" }, { "docid": "0fd418b41dee5e1a315ecc96c47e3e3a", "score": "0.56980675", "text": "func (b *Bitfinex) CalculateTradingFee(accountInfos []AccountInfo, purchasePrice, amount float64, c currency.Code, isMaker bool) (fee float64, err error) {\n\tfor _, i := range accountInfos {\n\t\tfor _, j := range i.Fees {\n\t\t\tif c.String() == j.Pairs {\n\t\t\t\tif isMaker {\n\t\t\t\t\tfee = j.MakerFees\n\t\t\t\t} else {\n\t\t\t\t\tfee = j.TakerFees\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif fee > 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn (fee / 100) * purchasePrice * amount, err\n}", "title": "" }, { "docid": "3050ff98bd2f659c6f8de8a2616654e5", "score": "0.5665256", "text": "func (b *Bitfinex) GetAccountFees() (AccountFees, error) {\n\tresponse := AccountFees{}\n\treturn response, b.SendAuthenticatedHTTPRequest(http.MethodPost,\n\t\tbitfinexAccountFees, nil, &response)\n}", "title": "" }, { "docid": "9e17da154eff1f21da5d3a8ab85ee858", "score": "0.5657419", "text": "func (api AmazonMWSAPI) GetMyFeesEstimate(items []FeeEstimateRequest) (string, error) {\n\tparams := make(map[string]string)\n\n\tfor index, item := range items {\n\t\tqueryItems := item.toQuery(index, api.MarketplaceId)\n\n\t\tfor key, value := range queryItems {\n\t\t\tparams[key] = value\n\t\t}\n\t}\n\n\treturn api.genSignAndFetchViaPost(\"GetMyFeesEstimate\", \"/Products/2011-10-01\", params)\n}", "title": "" }, { "docid": "463a1e9281b56044303561159642193b", "score": "0.5576119", "text": "func (g *Gateio) GetFutureFundingRates(ctx context.Context, settle string, contract currency.Pair, limit uint64) ([]FuturesFundingRate, error) {\n\tsettle = strings.ToLower(settle)\n\tif settle == \"\" {\n\t\treturn nil, errEmptySettlementCurrency\n\t}\n\tif contract.IsInvalid() {\n\t\treturn nil, currency.ErrCurrencyPairEmpty\n\t}\n\tparams := url.Values{}\n\tparams.Set(\"contract\", contract.String())\n\tif limit > 0 {\n\t\tparams.Set(\"limit\", strconv.FormatUint(limit, 10))\n\t}\n\tvar rates []FuturesFundingRate\n\treturn rates, g.SendHTTPRequest(ctx, exchange.RestSpot, perpetualSwapDefaultEPL, common.EncodeURLValues(\"futures/\"+settle+\"/funding_rate\", params), &rates)\n}", "title": "" }, { "docid": "cf09d7187bafade019321998e47aaa3a", "score": "0.5565763", "text": "func (m DerivativeSecurityListRequest) GetUnderlyingFXRate() (v decimal.Decimal, err quickfix.MessageRejectError) {\n\tvar f field.UnderlyingFXRateField\n\tif err = m.Get(&f); err == nil {\n\t\tv = f.Value()\n\t}\n\treturn\n}", "title": "" }, { "docid": "15819bf92c9ad841c56dc13581dd0a14", "score": "0.5545647", "text": "func (m *MempoolEntry) FeeRate() int64 {\n\treturn int64(m.Fee*coin*1000) / int64(m.Size)\n}", "title": "" }, { "docid": "9befebe45c5a9ecdfaedd0ed5ac504b6", "score": "0.55424213", "text": "func GetBizPropVehicleFees(ctx context.Context, BID int64, bizPropName string, rStart, rStop time.Time) (fees []BizPropsFee, err error) {\n\tconst funcname = \"GetBizPropVehicleFees\"\n\tvar (\n\t\tbizPropJSON BizProps\n\t)\n\tfmt.Printf(\"Entered in %s\\n\", funcname)\n\n\t// initialize vehicle fees\n\tfees = []BizPropsFee{}\n\n\t// get business properties data\n\tbizPropJSON, err = GetDataFromBusinessPropertyName(ctx, bizPropName, BID)\n\tif err != nil {\n\t\treturn\n\t}\n\n\t// get pet Fees\n\tfor _, n := range bizPropJSON.VehicleFees {\n\t\tvar ar AR\n\t\tar, err = GetARByName(ctx, BID, n)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\n\t\t// migrate values from ar to vf\n\t\tvf := BizPropsFee{\n\t\t\tBID: ar.BID,\n\t\t\tARID: ar.ARID,\n\t\t\tARName: ar.Name,\n\t\t\tAmount: ar.DefaultAmount,\n\t\t\tARRentCycle: ar.DefaultRentCycle,\n\t\t\tARProrationCycle: ar.DefaultProrationCycle,\n\t\t}\n\n\t\toneTimeCharge := (ar.FLAGS & (1 << ARIsNonRecurCharge)) != 0\n\t\tif oneTimeCharge {\n\t\t\tvf.Start = JSONDate(rStart)\n\t\t\tvf.Stop = JSONDate(rStart)\n\t\t} else {\n\t\t\tvf.Start = JSONDate(rStart)\n\t\t\tvf.Stop = JSONDate(rStop)\n\t\t}\n\n\t\t// append in the list\n\t\tfees = append(fees, vf)\n\t}\n\n\t// return finally\n\treturn\n}", "title": "" }, { "docid": "2d6af950fc4342094c5ad352c9071a30", "score": "0.5540519", "text": "func (s *Service) GetTicketFeeRate() (ticketFeeRate *apiTypes.MempoolTicketFees, err error) {\n\treqConf := &ReqConfig{\n\t\tmethod: http.MethodGet,\n\t\turl: \"api/mempool/sstx/fees\",\n\t}\n\tticketFeeRate = &apiTypes.MempoolTicketFees{}\n\treturn ticketFeeRate, s.client.Do(DcrData, s.chainParams.Name, reqConf, ticketFeeRate)\n}", "title": "" }, { "docid": "6475bc9b99a9db65b1fcb9b19519943d", "score": "0.55367976", "text": "func estimateFee(context.Context, btc.RawRequester, uint64) (uint64, error) {\n\treturn dexzec.LegacyFeeRate, nil\n}", "title": "" }, { "docid": "89d3aa2dbea57809b0daddf2c84cd97b", "score": "0.54938585", "text": "func (_TetherToken *TetherTokenCallerSession) BasisPointsRate() (*big.Int, error) {\n\treturn _TetherToken.Contract.BasisPointsRate(&_TetherToken.CallOpts)\n}", "title": "" }, { "docid": "dfb4699ad7f9803c3a14805ef457f4d5", "score": "0.5464332", "text": "func QueryFeesResponseFromState(state map[string]engine.XState) (ResponseQueryFees, error) {\n\tbitcoinS, ok := state[string(multichain.Bitcoin.NativeAsset())]\n\tif !ok {\n\t\treturn ResponseQueryFees{},\n\t\t\tfmt.Errorf(\"Missing Bitcoin State\")\n\t}\n\tbitcoinCap := bitcoinS.GasCap\n\tbitcoinLimit := bitcoinS.GasLimit\n\tbitcoinUnderlying := U64{Int: big.NewInt(int64(bitcoinCap.Int().Uint64() * bitcoinLimit.Int().Uint64()))}\n\t// TODO: These should be enabled once fees begin accuring inside RenVM.\n\t// bitcoinMintFee := U64{Int: big.NewInt(int64(bitcoinS.MintFee))}\n\t// bitcoinBurnFee := U64{Int: big.NewInt(int64(bitcoinS.BurnFee))}\n\n\tzcashS, ok := state[string(multichain.Zcash.NativeAsset())]\n\tif !ok {\n\t\treturn ResponseQueryFees{},\n\t\t\tfmt.Errorf(\"Missing ZCash State\")\n\t}\n\n\tzcashCap := zcashS.GasCap\n\tzcashLimit := zcashS.GasLimit\n\tzcashUnderlying := U64{Int: big.NewInt(int64(zcashCap.Int().Uint64() * zcashLimit.Int().Uint64()))}\n\t// zcashMintFee := U64{Int: big.NewInt(int64(zcashS.MintFee))}\n\t// zcashBurnFee := U64{Int: big.NewInt(int64(zcashS.BurnFee))}\n\n\tbitcoinCashS, ok := state[string(multichain.BitcoinCash.NativeAsset())]\n\tif !ok {\n\t\treturn ResponseQueryFees{},\n\t\t\tfmt.Errorf(\"Missing BitcoinCash State\")\n\t}\n\tbitcoinCashCap := bitcoinCashS.GasCap\n\tbitcoinCashLimit := bitcoinCashS.GasLimit\n\tbitcoinCashUnderlying := U64{Int: big.NewInt(int64(bitcoinCashCap.Int().Uint64() * bitcoinCashLimit.Int().Uint64()))}\n\t// bitcoinCashMintFee := U64{Int: big.NewInt(int64(bitcoinCashS.MintFee))}\n\t// bitcoinCashBurnFee := U64{Int: big.NewInt(int64(bitcoinCashS.BurnFee))}\n\n\tmintFee := U64{Int: big.NewInt(25)}\n\tburnFee := U64{Int: big.NewInt(10)}\n\n\tresp := ResponseQueryFees{\n\t\tBtc: Fees{\n\t\t\tLock: bitcoinUnderlying,\n\t\t\tRelease: bitcoinUnderlying,\n\t\t\tEthereum: MintAndBurnFees{\n\t\t\t\tMint: mintFee,\n\t\t\t\tBurn: burnFee,\n\t\t\t},\n\t\t},\n\t\tZec: Fees{\n\t\t\tLock: zcashUnderlying,\n\t\t\tRelease: zcashUnderlying,\n\t\t\tEthereum: MintAndBurnFees{\n\t\t\t\tMint: mintFee,\n\t\t\t\tBurn: burnFee,\n\t\t\t},\n\t\t},\n\t\tBch: Fees{\n\t\t\tLock: bitcoinCashUnderlying,\n\t\t\tRelease: bitcoinCashUnderlying,\n\t\t\tEthereum: MintAndBurnFees{\n\t\t\t\tMint: mintFee,\n\t\t\t\tBurn: burnFee,\n\t\t\t},\n\t\t},\n\t}\n\treturn resp, nil\n}", "title": "" }, { "docid": "72c327868f22fd7b936f21b4a37c7264", "score": "0.54521376", "text": "func (c *Client) RecommendedFee() (fee types.Currency, err error) {\n\terr = c.get(\"/fee\", &fee)\n\treturn\n}", "title": "" }, { "docid": "090b9f87d9785eee6b31adc96ff6a156", "score": "0.54247344", "text": "func calculateTradingFee(purchasePrice, amount, multiplier float64) float64 {\n\treturn (multiplier / 100) * purchasePrice * amount\n}", "title": "" }, { "docid": "5a655c500321224d963df8da7d84bc26", "score": "0.5415466", "text": "func (w *zecWallet) FeeRate() uint64 {\n\treturn dexzec.LegacyFeeRate\n}", "title": "" }, { "docid": "482fffc1cff8acb793fabcdc3c97af0f", "score": "0.53917366", "text": "func (vdb *VspDatabase) GetPendingFees() ([]Ticket, error) {\n\tvdb.ticketsMtx.RLock()\n\tdefer vdb.ticketsMtx.RUnlock()\n\n\treturn vdb.filterTickets(func(t Ticket) bool {\n\t\treturn t.Confirmed && t.FeeTxStatus == FeeReceieved\n\t})\n}", "title": "" }, { "docid": "854cf989bdf0e1187f479e0f85a43de4", "score": "0.5387718", "text": "func CalculateFee(amount, fee float64) float64 {\n\treturn amount * (fee / 100)\n}", "title": "" }, { "docid": "4e85be3a1c4134f017af83a0675df88a", "score": "0.5372859", "text": "func (b *BTCMarkets) GetFee(feeBuilder *exchange.FeeBuilder) (float64, error) {\n\tvar fee float64\n\n\tswitch feeBuilder.FeeType {\n\tcase exchange.CryptocurrencyTradeFee:\n\t\ttradingFee, err := b.GetTradingFee(feeBuilder.Pair.Base,\n\t\t\tfeeBuilder.Pair.Quote)\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\n\t\tfee = calculateTradingFee(tradingFee,\n\t\t\tfeeBuilder.PurchasePrice,\n\t\t\tfeeBuilder.Amount)\n\n\tcase exchange.CryptocurrencyWithdrawalFee:\n\t\tfee = getCryptocurrencyWithdrawalFee(feeBuilder.Pair.Base)\n\tcase exchange.InternationalBankWithdrawalFee:\n\t\tfee = getInternationalBankWithdrawalFee(feeBuilder.FiatCurrency)\n\tcase exchange.OfflineTradeFee:\n\t\tfee = getOfflineTradeFee(feeBuilder.PurchasePrice, feeBuilder.Amount)\n\t}\n\tif fee < 0 {\n\t\tfee = 0\n\t}\n\treturn fee, nil\n}", "title": "" }, { "docid": "1d2c892906c7573c9c128f33b2ce6a6f", "score": "0.5355183", "text": "func (m DerivativeSecurityListRequest) GetUnderlyingFXRateCalc() (v enum.UnderlyingFXRateCalc, err quickfix.MessageRejectError) {\n\tvar f field.UnderlyingFXRateCalcField\n\tif err = m.Get(&f); err == nil {\n\t\tv = f.Value()\n\t}\n\treturn\n}", "title": "" }, { "docid": "8327fcc578c366cece429d4b02972826", "score": "0.5352185", "text": "func TestBlocksService_Fees(t *testing.T) {\n\tclient, mux, _, teardown := setupTest()\n\tdefer teardown()\n\n\tmux.HandleFunc(\"/blocks/getFees\", func(writer http.ResponseWriter, request *http.Request) {\n\t\ttestMethod(t, request, \"GET\")\n\t\tfmt.Fprint(writer,\n\t\t\t`{\n\t\t\t \"success\": true,\n\t\t\t \"fees\": {\n\t\t\t \"send\": 10000000,\n\t\t\t \"vote\": 100000000,\n\t\t\t \"secondsignature\": 500000000,\n\t\t\t \"delegate\": 2500000000,\n\t\t\t \"multisignature\": 500000000\n\t\t\t }\n\t\t\t}`)\n\t})\n\n\tresponseStruct, response, err := client.Blocks.Fees(context.Background())\n\ttestGeneralError(t, \"Blocks.Fees\", err)\n\ttestResponseUrl(t, \"Blocks.Fees\", response, \"/api/blocks/getFees\")\n\ttestResponseStruct(t, \"Blocks.Fees\", responseStruct, &BlocksFees{\n\t\tSuccess: true,\n\t\tFees: BlockFeeTypes{\n\t\t\tSend: 10000000,\n\t\t\tVote: 100000000,\n\t\t\tSecondsignature: 500000000,\n\t\t\tDelegate: 2500000000,\n\t\t\tMultisignature: 500000000,\n\t\t},\n\t})\n}", "title": "" }, { "docid": "fdc003e4e495b418198214bb4b2a6dec", "score": "0.5342614", "text": "func (chainManager *ChainManager) ChangeContractFees(authorizedSigScheme signaturescheme.SignatureScheme, chain *solo.Chain, contractName string,\n\tnewContractOwnerFee int64) {\n\n\toldFeeColor, _, oldValidatorFee := changeFee(chainManager, authorizedSigScheme, chain, contractName, root.ParamOwnerFee, newContractOwnerFee)\n\n\t// Expect new fee chain owner fee\n\tfeeColor, ownerFee, validatorFee := chain.GetFeeInfo(accounts.Name)\n\trequire.Equal(chainManager.env.T, oldFeeColor, feeColor)\n\trequire.Equal(chainManager.env.T, oldValidatorFee, validatorFee)\n\trequire.Equal(chainManager.env.T, newContractOwnerFee, ownerFee)\n}", "title": "" }, { "docid": "6dbe7639a41401d0257e92949b3d7247", "score": "0.5311961", "text": "func randomFees(r *rand.Rand, ctx sdk.Context, keeper keeper.Keeper, spendableCoins sdk.Coins) (sdk.Coins, error) {\n\tif spendableCoins.Empty() {\n\t\treturn nil, nil\n\t}\n\n\tperm := r.Perm(len(spendableCoins))\n\tvar randCoin sdk.Coin\n\tfor _, index := range perm {\n\t\tif keeper.IsPoolCoinDenom(ctx, spendableCoins[index].Denom) {\n\t\t\tcontinue\n\t\t}\n\t\trandCoin = spendableCoins[index]\n\t\tif !randCoin.Amount.IsZero() {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif randCoin.Amount.IsZero() {\n\t\treturn nil, fmt.Errorf(\"no coins found for random fees\")\n\t}\n\n\tamt, err := simtypes.RandPositiveInt(r, randCoin.Amount)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Create a random fee and verify the fees are within the account's spendable\n\t// balance.\n\tfees := sdk.NewCoins(sdk.NewCoin(randCoin.Denom, amt))\n\n\treturn fees, nil\n}", "title": "" }, { "docid": "4cc3bcf88c8797793637cd47baf7f7b7", "score": "0.5303022", "text": "func (api *API) feemanagerPendingFeesHandlerGET(w http.ResponseWriter, _ *http.Request, _ httprouter.Params) {\n\tpendingFees, err := api.feemanager.PendingFees()\n\tif err != nil {\n\t\tWriteError(w, Error{\"could not get the pending fees of the FeeManager: \" + err.Error()}, http.StatusInternalServerError)\n\t\treturn\n\t}\n\tWriteJSON(w, FeeManagerPendingFeesGET{\n\t\tPendingFees: pendingFees,\n\t})\n}", "title": "" }, { "docid": "0e21efd4620763e8c86200cd02ca388a", "score": "0.529899", "text": "func ForecastPrice(timeNow int64, currentPrice int) (forecastPrice int) {\n\n\t//timeNow += 3540//test code\n\tif timeNow < 3540 {\n\t\treturn currentPrice + 1500\n\t}\n\n\tfrequentLevel = CalculateFrequent() - standardLevel[timeNow]\n\t//fmt.Println(\"timeNow:\", timeNow, \"frequentLevel:\", frequentLevel, \"frequent dev:\", CalculateFrequent()-standardLevel[timeNow])\n\tif timeNow < 3580 {\n\t\treturn baseDeviation[timeNow] + currentPrice + frequentLevel*(3600-int(timeNow))/120/100*100\n\t} else {\n\t\treturn baseDeviation[timeNow] + currentPrice\n\t}\n}", "title": "" }, { "docid": "ad914a12b22c5ee8d62f7b2f345b0aa4", "score": "0.52862066", "text": "func (client *Client) Fee() float64 {\n\treturn client.fee\n}", "title": "" }, { "docid": "f49134fba517581b294bced029e21039", "score": "0.52734125", "text": "func (s *RPCServer) GetFundingRates(ctx context.Context, r *gctrpc.GetFundingRatesRequest) (*gctrpc.GetFundingRatesResponse, error) {\n\tif r == nil {\n\t\treturn nil, fmt.Errorf(\"%w GetFundingRateRequest\", common.ErrNilPointer)\n\t}\n\texch, err := s.GetExchangeByName(r.Exchange)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ta, err := asset.New(r.Asset)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !a.IsFutures() {\n\t\treturn nil, fmt.Errorf(\"%s %w\", a, order.ErrNotFuturesAsset)\n\t}\n\tstart := time.Now().AddDate(0, -1, 0)\n\tend := time.Now()\n\tif r.StartDate != \"\" {\n\t\tstart, err = time.Parse(common.SimpleTimeFormatWithTimezone, r.StartDate)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tif r.EndDate != \"\" {\n\t\tend, err = time.Parse(common.SimpleTimeFormatWithTimezone, r.EndDate)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\terr = common.StartEndTimeCheck(start, end)\n\tif err != nil && !errors.Is(err, common.ErrDateUnset) {\n\t\treturn nil, err\n\t}\n\n\tpairs, err := exch.GetEnabledPairs(a)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcp, err := pairs.DeriveFrom(r.Pair.Base + r.Pair.Quote)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfunding, err := exch.GetFundingRates(ctx, &fundingrate.RatesRequest{\n\t\tAsset: a,\n\t\tPair: cp,\n\t\tStartDate: start,\n\t\tEndDate: end,\n\t\tIncludePayments: r.IncludePayments,\n\t\tIncludePredictedRate: r.IncludePredicted,\n\t\tRespectHistoryLimits: r.RespectHistoryLimits,\n\t\tPaymentCurrency: currency.NewCode(r.PaymentCurrency),\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar hasPayment bool\n\tvar response gctrpc.GetFundingRatesResponse\n\tfundingData := &gctrpc.FundingData{\n\t\tExchange: r.Exchange,\n\t\tAsset: r.Asset,\n\t\tPair: &gctrpc.CurrencyPair{\n\t\t\tDelimiter: funding.Pair.Delimiter,\n\t\t\tBase: funding.Pair.Base.String(),\n\t\t\tQuote: funding.Pair.Quote.String(),\n\t\t},\n\t\tStartDate: start.Format(common.SimpleTimeFormatWithTimezone),\n\t\tEndDate: end.Format(common.SimpleTimeFormatWithTimezone),\n\t\tLatestRate: &gctrpc.FundingRate{\n\t\t\tDate: funding.LatestRate.Time.Format(common.SimpleTimeFormatWithTimezone),\n\t\t\tRate: funding.LatestRate.Rate.String(),\n\t\t},\n\t}\n\trates := make([]*gctrpc.FundingRate, len(funding.FundingRates))\n\tfor j := range funding.FundingRates {\n\t\trates[j] = &gctrpc.FundingRate{\n\t\t\tRate: funding.FundingRates[j].Rate.String(),\n\t\t\tDate: funding.FundingRates[j].Time.Format(common.SimpleTimeFormatWithTimezone),\n\t\t}\n\t\tif r.IncludePayments {\n\t\t\tif !funding.FundingRates[j].Payment.IsZero() {\n\t\t\t\thasPayment = true\n\t\t\t}\n\t\t\trates[j].Payment = funding.FundingRates[j].Payment.String()\n\t\t}\n\t}\n\tif r.IncludePayments {\n\t\tfundingData.PaymentSum = funding.PaymentSum.String()\n\t\tfundingData.PaymentCurrency = funding.PaymentCurrency.String()\n\t\tif !hasPayment {\n\t\t\tfundingData.PaymentMessage = \"no payments found for payment currency \" + funding.PaymentCurrency.String() +\n\t\t\t\t\" please ensure you have set the correct payment currency in the request\"\n\t\t}\n\t}\n\tif !funding.TimeOfNextRate.IsZero() {\n\t\tfundingData.TimeOfNextRate = funding.TimeOfNextRate.Format(common.SimpleTimeFormatWithTimezone)\n\t}\n\tfundingData.Rates = rates\n\tif r.IncludePredicted {\n\t\tfundingData.UpcomingRate = &gctrpc.FundingRate{\n\t\t\tDate: funding.PredictedUpcomingRate.Time.Format(common.SimpleTimeFormatWithTimezone),\n\t\t\tRate: funding.PredictedUpcomingRate.Rate.String(),\n\t\t}\n\t}\n\tresponse.Rates = fundingData\n\n\treturn &response, nil\n}", "title": "" }, { "docid": "735f36f359d1173bd3560a8c6de6c1a6", "score": "0.5232863", "text": "func (client *Client) AvailFunds() float64 {\n\treturn client.availFunds\n}", "title": "" }, { "docid": "e102c1dd808d50c2d9af246bb5069fae", "score": "0.52292585", "text": "func (_TetherToken *TetherTokenSession) BasisPointsRate() (*big.Int, error) {\n\treturn _TetherToken.Contract.BasisPointsRate(&_TetherToken.CallOpts)\n}", "title": "" }, { "docid": "d1fda3e89ff632eecbdbd8e8d33e868f", "score": "0.52275914", "text": "func (_L1BondingManager *L1BondingManagerCallerSession) PendingFees(_delegator common.Address, _endRound *big.Int) (*big.Int, error) {\n\treturn _L1BondingManager.Contract.PendingFees(&_L1BondingManager.CallOpts, _delegator, _endRound)\n}", "title": "" }, { "docid": "a8f137e411e5b50606dca302ffa4a0bc", "score": "0.52145064", "text": "func (s *WebServer) apiGetFee(w http.ResponseWriter, r *http.Request) {\n\tform := new(registration)\n\tif !readPost(w, r, form) {\n\t\treturn\n\t}\n\tfee, err := s.core.GetFee(form.Addr, form.Cert)\n\tif err != nil {\n\t\ts.writeAPIError(w, err.Error())\n\t\treturn\n\t}\n\tresp := struct {\n\t\tOK bool `json:\"ok\"`\n\t\tFee uint64 `json:\"fee,omitempty\"`\n\t}{\n\t\tOK: true,\n\t\tFee: fee,\n\t}\n\twriteJSON(w, resp, s.indent)\n}", "title": "" }, { "docid": "4a9805bb8bfc48a243eeb3b1ade9faa2", "score": "0.520704", "text": "func (vmctx *VMContext) mustHandleFees() bool {\n\ttotalFee := vmctx.ownerFee + vmctx.validatorFee\n\tif totalFee == 0 || vmctx.requesterIsLocal() {\n\t\t// no fees enabled or the caller is the chain owner\n\t\tvmctx.log.Debugf(\"mustHandleFees: no fees charged\")\n\t\treturn true\n\t}\n\n\t// process fees for owner and validator\n\tif vmctx.grabFee(vmctx.commonAccount(), vmctx.ownerFee) &&\n\t\tvmctx.grabFee(vmctx.validatorFeeTarget, vmctx.validatorFee) {\n\t\t// there were enough fees for both\n\t\treturn true\n\t}\n\n\t// not enough fees available\n\tvmctx.mustSendBack(vmctx.remainingAfterFees)\n\tvmctx.remainingAfterFees = nil\n\tvmctx.lastError = fmt.Errorf(\"mustHandleFees: not enough fees for request %s. Remaining tokens were sent back to %s\",\n\t\tvmctx.req.ID(), vmctx.req.SenderAddress().Base58())\n\treturn false\n}", "title": "" }, { "docid": "1df41aeaf726d6add43ce85e90abdef8", "score": "0.5184876", "text": "func (_RootChain *RootChainCallerSession) CurrentFeeExit() (*big.Int, error) {\n\treturn _RootChain.Contract.CurrentFeeExit(&_RootChain.CallOpts)\n}", "title": "" }, { "docid": "d7478af5a79229500ea180c209d57c0a", "score": "0.5177214", "text": "func (_RootChain *RootChainCaller) CurrentFeeExit(opts *bind.CallOpts) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _RootChain.contract.Call(opts, out, \"currentFeeExit\")\n\treturn *ret0, err\n}", "title": "" }, { "docid": "f183ee6982557e8502c28d858336f62a", "score": "0.5176028", "text": "func (_TetherToken *TetherTokenCaller) BasisPointsRate(opts *bind.CallOpts) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _TetherToken.contract.Call(opts, out, \"basisPointsRate\")\n\treturn *ret0, err\n}", "title": "" }, { "docid": "af0201b0f90cc142ebb46971771f022a", "score": "0.5175283", "text": "func (as *ApiService) BaseFee(currencyType string) (*ApiResponse, error) {\n\tp := map[string]string{\n\t\t\"currencyType\": currencyType,\n\t}\n\treq := NewRequest(http.MethodGet, \"/api/v1/base-fee\", p)\n\treturn as.Call(req)\n}", "title": "" }, { "docid": "4c86d8270c22778c4b79145e746da9a2", "score": "0.5146914", "text": "func (_RootChain *RootChainSession) CurrentFeeExit() (*big.Int, error) {\n\treturn _RootChain.Contract.CurrentFeeExit(&_RootChain.CallOpts)\n}", "title": "" }, { "docid": "8831921bd6129f9b2f5d71b03b08ede6", "score": "0.51448977", "text": "func (p *HitBTC) GetFee() float64 {\n\treturn p.Fee\n}", "title": "" }, { "docid": "10e053b7ca21a2e63b69f715e16cebce", "score": "0.5142669", "text": "func (s *RPCServer) GetForexRates(_ context.Context, _ *gctrpc.GetForexRatesRequest) (*gctrpc.GetForexRatesResponse, error) {\n\trates, err := currency.GetExchangeRates()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif len(rates) == 0 {\n\t\treturn nil, fmt.Errorf(\"forex rates is empty\")\n\t}\n\n\tforexRates := make([]*gctrpc.ForexRatesConversion, 0, len(rates))\n\tfor x := range rates {\n\t\trate, err := rates[x].GetRate()\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\n\t\t// TODO add inverse rate\n\t\t// inverseRate, err := rates[x].GetInversionRate()\n\t\t// if err != nil {\n\t\t//\t continue\n\t\t// }\n\n\t\tforexRates = append(forexRates, &gctrpc.ForexRatesConversion{\n\t\t\tFrom: rates[x].From.String(),\n\t\t\tTo: rates[x].To.String(),\n\t\t\tRate: rate,\n\t\t\tInverseRate: 0,\n\t\t})\n\t}\n\treturn &gctrpc.GetForexRatesResponse{ForexRates: forexRates}, nil\n}", "title": "" }, { "docid": "ccf95790137ee7553a3a0202549716b4", "score": "0.5137811", "text": "func (g *Gateio) GetFee(ctx context.Context, feeBuilder *exchange.FeeBuilder) (fee float64, err error) {\n\tswitch feeBuilder.FeeType {\n\tcase exchange.CryptocurrencyTradeFee:\n\t\tfeePairs, err := g.GetPersonalTradingFee(ctx, feeBuilder.Pair, \"\")\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\tif feeBuilder.IsMaker {\n\t\t\tfee = calculateTradingFee(feePairs.MakerFee,\n\t\t\t\tfeeBuilder.PurchasePrice,\n\t\t\t\tfeeBuilder.Amount)\n\t\t} else {\n\t\t\tfee = calculateTradingFee(feePairs.TakerFee,\n\t\t\t\tfeeBuilder.PurchasePrice,\n\t\t\t\tfeeBuilder.Amount)\n\t\t}\n\tcase exchange.CryptocurrencyWithdrawalFee:\n\t\tfee = getCryptocurrencyWithdrawalFee(feeBuilder.Pair.Base)\n\tcase exchange.OfflineTradeFee:\n\t\tfee = getOfflineTradeFee(feeBuilder.PurchasePrice, feeBuilder.Amount)\n\t}\n\tif fee < 0 {\n\t\tfee = 0\n\t}\n\treturn fee, nil\n}", "title": "" }, { "docid": "0cba67d2eb358ade24187eb24cf44aec", "score": "0.5133938", "text": "func (c *Client) FeeSchedule(ctx context.Context) (FeeSchedule, error) {\n\tresponse, err := post(c.httpClient, \"returnFeeInfo\", c.apiKey, c.apiSecret, url.Values{})\n\tif err != nil {\n\t\treturn FeeSchedule{}, err\n\t}\n\n\tvar apiError apiError\n\n\t_ = json.Unmarshal(response, &apiError)\n\tif apiError.Error != \"\" {\n\t\treturn FeeSchedule{}, errors.New(apiError.Error)\n\t}\n\n\tvar f feeInfo\n\n\terr = json.Unmarshal(response, &f)\n\tif err != nil {\n\t\treturn FeeSchedule{}, errors.Wrap(err, \"encountered an error attempting to parse the fee info\")\n\t}\n\n\tmakerFee, err := strconv.ParseFloat(f.MakerFee, 64)\n\tif err != nil {\n\t\treturn FeeSchedule{}, errors.Wrap(err, \"encountered an error attempting to parse the makerFee\")\n\t}\n\n\ttakerFee, err := strconv.ParseFloat(f.TakerFee, 64)\n\tif err != nil {\n\t\treturn FeeSchedule{}, errors.Wrap(err, \"encountered an error attempting to parse the takerFee\")\n\t}\n\n\tthirtyDayVol, err := strconv.ParseFloat(f.ThirtyDayVolume, 64)\n\tif err != nil {\n\t\treturn FeeSchedule{}, errors.Wrap(err, \"encountered an error attempting to parse the thirtyDayVol\")\n\t}\n\n\treturn FeeSchedule{\n\t\tMakerFee: makerFee,\n\t\tTakerFee: takerFee,\n\t\tThirtyDayVolume: thirtyDayVol,\n\t}, nil\n}", "title": "" }, { "docid": "603d10fc6012704ef92ae45b656b2bd3", "score": "0.5133199", "text": "func (self *Blockchain) TransactionFees(txns Transactions) (uint64, error) {\n total := uint64(0)\n for i, _ := range txns {\n fee, err := self.TransactionFee(&txns[i])\n if err != nil {\n return 0, err\n }\n total += fee\n }\n return total, nil\n}", "title": "" }, { "docid": "2498eff52dfb5c0bbb70e699558070c0", "score": "0.5132201", "text": "func (_DFedBank *DFedBankCallerSession) Fee() (*big.Int, error) {\n\treturn _DFedBank.Contract.Fee(&_DFedBank.CallOpts)\n}", "title": "" }, { "docid": "bad9354ae63454c7792d18182df7db99", "score": "0.51282376", "text": "func (c *Core) MaxFundingFees(fromAsset uint32, host string, numTrades uint32, options map[string]string) (uint64, error) {\n\twallet, found := c.wallet(fromAsset)\n\tif !found {\n\t\treturn 0, newError(missingWalletErr, \"no wallet found for %s\", unbip(fromAsset))\n\t}\n\n\texchange, err := c.Exchange(host)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tasset, found := exchange.Assets[fromAsset]\n\tif !found {\n\t\treturn 0, fmt.Errorf(\"asset %d not found for %s\", fromAsset, host)\n\t}\n\n\treturn wallet.MaxFundingFees(numTrades, asset.MaxFeeRate, options), nil\n}", "title": "" }, { "docid": "e2dea346fe2ddca75f930fc51b144284", "score": "0.5128163", "text": "func (k Keeper) CheckFees(ctx sdk.Context, fees sdk.Coins, msgs []sdk.Msg) error {\n\tfeesParams := k.GetParams(ctx)\n\n\t// calculate required fees for the given messages\n\trequiredFees := sdk.NewCoins()\n\tfor _, msg := range msgs {\n\t\tfor _, minFee := range feesParams.MinFees {\n\t\t\tif msg.Type() == minFee.MessageType {\n\t\t\t\trequiredFees = requiredFees.Add(minFee.Amount...)\n\t\t\t}\n\t\t}\n\t}\n\n\tif !requiredFees.IsZero() && (requiredFees.IsAnyGT(fees) || fees.IsZero()) {\n\t\treturn sdkerrors.Wrap(sdkerrors.ErrInsufficientFee,\n\t\t\tfmt.Sprintf(\"Expected at least %s, got %s\", requiredFees, fees))\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "906ea43c7baba5345c42a27ba1f709da", "score": "0.51254064", "text": "func (t *Retired) GetCurrentPrice() float32 {\n\treturn RegularPrice - ((RegularPrice * retiredDiscount) / 100)\n}", "title": "" }, { "docid": "c91083bf00ed2000b21fc21f6f2cee9c", "score": "0.51207465", "text": "func (m Message) GetUnderlyingFXRateCalc(f *field.UnderlyingFXRateCalcField) quickfix.MessageRejectError {\n\treturn m.Body.Get(f)\n}", "title": "" }, { "docid": "48865d36992b894b4ab3af2602f3d86d", "score": "0.51194686", "text": "func (keeper Keeper) GetCurrentPrices(ctx sdk.Context) types.Prices {\n\tstore := ctx.KVStore(keeper.StoreKey)\n\titerator := sdk.KVStorePrefixIterator(store, []byte(types.CurrentPricesPrefix))\n\n\tvar curPrices = types.Prices{}\n\tdefer iterator.Close()\n\tfor ; iterator.Valid(); iterator.Next() {\n\t\tvar currentPrice types.Price\n\t\tkeeper.cdc.MustUnmarshalBinaryBare(iterator.Value(), &currentPrice)\n\t\tcurPrices, _ = curPrices.AppendIfMissing(currentPrice)\n\t}\n\n\treturn curPrices\n}", "title": "" }, { "docid": "c5d4034e4c00c91a9d90fa1d28e918b0", "score": "0.5113731", "text": "func (_L1BondingManager *L1BondingManagerCaller) PendingFees(opts *bind.CallOpts, _delegator common.Address, _endRound *big.Int) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _L1BondingManager.contract.Call(opts, &out, \"pendingFees\", _delegator, _endRound)\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "f31d1cfafce114d815f098dddb9af778", "score": "0.51033914", "text": "func (_UpgradedStandardToken *UpgradedStandardTokenCallerSession) BasisPointsRate() (*big.Int, error) {\n\treturn _UpgradedStandardToken.Contract.BasisPointsRate(&_UpgradedStandardToken.CallOpts)\n}", "title": "" }, { "docid": "f5e46b9b009f578ccd7ffee543a2fd89", "score": "0.509174", "text": "func (b *Bitfinex) GetFee(feeBuilder *exchange.FeeBuilder) (float64, error) {\n\tvar fee float64\n\n\tswitch feeBuilder.FeeType {\n\tcase exchange.CryptocurrencyTradeFee:\n\t\taccountInfos, err := b.GetAccountInformation()\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\tfee, err = b.CalculateTradingFee(accountInfos,\n\t\t\tfeeBuilder.PurchasePrice,\n\t\t\tfeeBuilder.Amount,\n\t\t\tfeeBuilder.Pair.Base,\n\t\t\tfeeBuilder.IsMaker)\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\tcase exchange.CyptocurrencyDepositFee:\n\t\t//TODO: fee is charged when < $1000USD is transferred, need to infer value in some way\n\t\tfee = 0\n\tcase exchange.CryptocurrencyWithdrawalFee:\n\t\taccountFees, err := b.GetAccountFees()\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\tfee, err = b.GetCryptocurrencyWithdrawalFee(feeBuilder.Pair.Base,\n\t\t\taccountFees)\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\tcase exchange.InternationalBankDepositFee:\n\t\tfee = getInternationalBankDepositFee(feeBuilder.Amount)\n\tcase exchange.InternationalBankWithdrawalFee:\n\t\tfee = getInternationalBankWithdrawalFee(feeBuilder.Amount)\n\tcase exchange.OfflineTradeFee:\n\t\tfee = getOfflineTradeFee(feeBuilder.PurchasePrice, feeBuilder.Amount)\n\t}\n\tif fee < 0 {\n\t\tfee = 0\n\t}\n\treturn fee, nil\n}", "title": "" }, { "docid": "ce50435f36003ebcf324b3e065e973ce", "score": "0.5077941", "text": "func (p *HitBTC) GetFeeInfo(currencyPair string) (Fee, error) {\n\tresult := Fee{}\n\terr := p.SendAuthenticatedHTTPRequest(\"GET\", apiV2FeeInfo+\"/\"+currencyPair, url.Values{}, &result)\n\n\treturn result, err\n}", "title": "" }, { "docid": "f948bdde4e17c00241b06de96e885c30", "score": "0.5071892", "text": "func (bi *Binanceus) GetFee(ctx context.Context, feeBuilder *exchange.FeeBuilder) (float64, error) {\n\tvar fee float64\n\tswitch feeBuilder.FeeType {\n\tcase exchange.CryptocurrencyTradeFee:\n\t\tmultiplier, er := bi.getMultiplier(ctx, feeBuilder.IsMaker, feeBuilder)\n\t\tif er != nil {\n\t\t\treturn 0, er\n\t\t}\n\t\tfee = calculateTradingFee(feeBuilder.PurchasePrice, feeBuilder.Amount, multiplier)\n\tcase exchange.CryptocurrencyWithdrawalFee:\n\t\twallet, er := bi.GetAssetFeesAndWalletStatus(ctx)\n\t\tif er != nil {\n\t\t\treturn fee, er\n\t\t}\n\t\tfor x := range wallet {\n\t\t\tfor y := range wallet[x].NetworkList {\n\t\t\t\tif wallet[x].NetworkList[y].IsDefault {\n\t\t\t\t\treturn wallet[x].NetworkList[y].WithdrawFee, nil\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tcase exchange.OfflineTradeFee:\n\t\tfee = getOfflineTradeFee(feeBuilder.PurchasePrice, feeBuilder.Amount)\n\t}\n\tif fee < 0 {\n\t\tfee = 0\n\t}\n\treturn fee, nil\n}", "title": "" }, { "docid": "37aa3b7383a48b826329b06249f5ee3f", "score": "0.5070631", "text": "func (_L1BondingManager *L1BondingManagerSession) PendingFees(_delegator common.Address, _endRound *big.Int) (*big.Int, error) {\n\treturn _L1BondingManager.Contract.PendingFees(&_L1BondingManager.CallOpts, _delegator, _endRound)\n}", "title": "" }, { "docid": "af6398c7bf50f87a81b6ef6eb007b99c", "score": "0.5064922", "text": "func (c *Client) GetCurrentRate(currency string, customAmount float64) (rate *Rate, err error) {\n\n\t// Must have an currency\n\tif len(currency) == 0 {\n\t\terr = c.createError(fmt.Sprintf(\"missing required attribute: %s\", fieldCurrency), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\t// Fire the Request\n\tvar response string\n\tif response, err = c.Request(fmt.Sprintf(\"%s/%s?%s=%f\", modelRates, currency, fieldAmount, customAmount), http.MethodGet, nil); err != nil {\n\t\treturn\n\t}\n\n\t// Only a 200 is treated as a success\n\tif err = c.Error(http.StatusOK, response); err != nil {\n\t\treturn\n\t}\n\n\t// Convert model response\n\tif err = json.Unmarshal([]byte(response), &rate); err != nil {\n\t\terr = c.createError(fmt.Sprintf(\"failed unmarshaling data: %s\", \"rate\"), http.StatusExpectationFailed)\n\t}\n\treturn\n}", "title": "" }, { "docid": "6a4eceae52bbfd52b4b9c4713598402c", "score": "0.50645286", "text": "func (m Message) UnderlyingFXRateCalc() (*field.UnderlyingFXRateCalcField, quickfix.MessageRejectError) {\n\tf := &field.UnderlyingFXRateCalcField{}\n\terr := m.Body.Get(f)\n\treturn f, err\n}", "title": "" }, { "docid": "a14c2d7234eb429315dd2b8461ed7e70", "score": "0.5061906", "text": "func (api *API) feemanagerPaidFeesHandlerGET(w http.ResponseWriter, _ *http.Request, _ httprouter.Params) {\n\tpaidFees, err := api.feemanager.PaidFees()\n\tif err != nil {\n\t\tWriteError(w, Error{\"could not get the paid fees of the FeeManager: \" + err.Error()}, http.StatusInternalServerError)\n\t\treturn\n\t}\n\tWriteJSON(w, FeeManagerPaidFeesGET{\n\t\tPaidFees: paidFees,\n\t})\n}", "title": "" }, { "docid": "4a5742cc28d6d267ae395ae0b47405e5", "score": "0.50529474", "text": "func (_KyberStorage *KyberStorageCallerSession) KyberFeeHandlerHistory() (common.Address, error) {\n\treturn _KyberStorage.Contract.KyberFeeHandlerHistory(&_KyberStorage.CallOpts)\n}", "title": "" }, { "docid": "131b3ea7d35ccba14c8ec40e019fc949", "score": "0.5046857", "text": "func (m *Route) GetTotalFees() int64 {\n\tif m != nil {\n\t\treturn m.TotalFees\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "131b3ea7d35ccba14c8ec40e019fc949", "score": "0.5046857", "text": "func (m *Route) GetTotalFees() int64 {\n\tif m != nil {\n\t\treturn m.TotalFees\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "131b3ea7d35ccba14c8ec40e019fc949", "score": "0.5046857", "text": "func (m *Route) GetTotalFees() int64 {\n\tif m != nil {\n\t\treturn m.TotalFees\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "c9932da357920842b234c93a944e8b2c", "score": "0.50452405", "text": "func (m Message) GetUnderlyingFXRate(f *field.UnderlyingFXRateField) quickfix.MessageRejectError {\n\treturn m.Body.Get(f)\n}", "title": "" }, { "docid": "ddd276fddf2d73a518da5d6821040ac1", "score": "0.504268", "text": "func (_DFedBank *DFedBankCaller) Fee(opts *bind.CallOpts) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _DFedBank.contract.Call(opts, out, \"fee\")\n\treturn *ret0, err\n}", "title": "" }, { "docid": "3583a336cbd31cd5961c0cddcfddac4e", "score": "0.50424004", "text": "func (r *personalLoanReport) PersonalLoanFees() *[]OutputPrice {\n\tinstitutions, err := r.institutionService.List()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tvar entries []OutputPrice\n\n\tfor _, institution := range institutions {\n\t\tiEntries := getAllPersonalLoansFromInstitution(r.personalLoanService, &institution)\n\t\tentries = append(entries, iEntries...)\n\t}\n\treturn &entries\n}", "title": "" }, { "docid": "1c9cabea88fe86d0a4b9a2c5de427bda", "score": "0.50347024", "text": "func (by *Bybit) GetFeeRate(ctx context.Context, category, symbol, baseCoin string) (*AccountFee, error) {\n\tif category == \"\" {\n\t\treturn nil, errCategoryNotSet\n\t}\n\n\tif !common.StringDataContains(validCategory, category) {\n\t\t// NOTE: Opted to fail here because if the user passes in an invalid\n\t\t// category the error returned is this\n\t\t// `Bybit raw response: {\"retCode\":10005,\"retMsg\":\"Permission denied, please check your API key permissions.\",\"result\":{},\"retExtInfo\":{},\"time\":1683694010783}`\n\t\treturn nil, fmt.Errorf(\"%w, valid category values are %v\", errInvalidCategory, validCategory)\n\t}\n\n\tparams := url.Values{}\n\tparams.Set(\"category\", category)\n\tif symbol != \"\" {\n\t\tparams.Set(\"symbol\", symbol)\n\t}\n\tif baseCoin != \"\" {\n\t\tparams.Set(\"baseCoin\", baseCoin)\n\t}\n\n\tresult := struct {\n\t\tData *AccountFee `json:\"result\"`\n\t\tError\n\t}{}\n\n\terr := by.SendAuthHTTPRequestV5(ctx, exchange.RestSpot, http.MethodGet, bybitAccountFee, params, &result, privateFeeRate)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn result.Data, nil\n}", "title": "" }, { "docid": "a7a319bdda4ef63ebef525c81960258a", "score": "0.5022111", "text": "func (o *OfferNoShowFeeModel) GetFee() MonetaryValueModel {\n\tif o == nil {\n\t\tvar ret MonetaryValueModel\n\t\treturn ret\n\t}\n\n\treturn o.Fee\n}", "title": "" }, { "docid": "c6d8ef51e531e905321ee686e23892e5", "score": "0.50129807", "text": "func Cfunds() float64 {\n\tdatasource := fmt.Sprintf(\"host=%s port=%d user=%s password=%s dbname=%s sslmode=disable\",\n\t\thost, port, user, password, dbname)\n\tdb, err := sql.Open(\"postgres\", datasource)\n\tdefer db.Close()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tname := name.GetName()\n\tvar cfunds float64\n\trows, err := db.Query(\"SELECT name, cfunds FROM bankaccount where name = $1;\", name)\n\tif err != nil {\n\t\t// handle err\n\t\tlog.Fatal(err)\n\t}\n\tdefer rows.Close()\n\tfor rows.Next() {\n\t\terr := rows.Scan(&name, &cfunds)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\t//print to check if its working\n\t\t//fmt.Println(name, cfunds)\n\n\t}\n\treturn cfunds\n}", "title": "" }, { "docid": "2b3a719f535ca2d75fc33421228dfe39", "score": "0.5012473", "text": "func (_TetherToken *TetherTokenCallerSession) MaximumFee() (*big.Int, error) {\n\treturn _TetherToken.Contract.MaximumFee(&_TetherToken.CallOpts)\n}", "title": "" }, { "docid": "63f38e34ad85457dfe6d83891852d5f1", "score": "0.4996183", "text": "func (chainManager *ChainManager) ChangeValidatorFees(authorizedSigScheme signaturescheme.SignatureScheme, chain *solo.Chain, contractName string,\n\tnewValidatorFee int64) {\n\toldFeeColor, oldOwnerFee, _ := changeFee(chainManager, authorizedSigScheme, chain, contractName, root.ParamValidatorFee, newValidatorFee)\n\n\t// Expect new fee chain owner fee\n\tfeeColor, ownerFee, validatorFee := chain.GetFeeInfo(accounts.Name)\n\trequire.Equal(chainManager.env.T, oldFeeColor, feeColor)\n\trequire.Equal(chainManager.env.T, newValidatorFee, validatorFee)\n\trequire.Equal(chainManager.env.T, oldOwnerFee, ownerFee)\n}", "title": "" }, { "docid": "ee92275f3b973acb8cf368dd74a86b22", "score": "0.49880418", "text": "func (b *BTCMarkets) GetTradingFee(base, quote currency.Code) (TradingFee, error) {\n\tvar tradingFee TradingFee\n\tpath := fmt.Sprintf(btcMarketsTradingFee, base, quote)\n\treturn tradingFee, b.SendAuthenticatedRequest(http.MethodGet, path, nil, &tradingFee)\n}", "title": "" }, { "docid": "9f9a82144890b698413a14a72d419d83", "score": "0.49794343", "text": "func (o *PayStubEarningsTotal) GetCurrentAmount() float64 {\n\tif o == nil || o.CurrentAmount.Get() == nil {\n\t\tvar ret float64\n\t\treturn ret\n\t}\n\n\treturn *o.CurrentAmount.Get()\n}", "title": "" }, { "docid": "2d4d34b4a773706c107e2ed2279a149a", "score": "0.497372", "text": "func (this *Asset) cfNew(fee float64) {\n\t// Note: SHORT ==> positive proceeds; selling to open short position;\n\t// price received, fees subtracted\n\tthis.S.NetCF.I = +math.Abs(this.S.Qty.I) * (this.Pxs.Tx - fee)\n\t// Note: LONG ===> negative proceeds; buying to open long position;\n\t// price paid, fees added\n\tthis.L.NetCF.I = -math.Abs(this.L.Qty.I) * (this.Pxs.Tx + fee)\n}", "title": "" }, { "docid": "bcd984f2b56d3da1b6694495d21f96cd", "score": "0.4972285", "text": "func (s *SignaturesService) Fee(ctx context.Context) (*SignaturesFee, *http.Response, error) {\n\tvar responseStruct *SignaturesFee\n\tresp, err := s.client.SendRequest(ctx, \"GET\", \"signatures/fee\", nil, &responseStruct)\n\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn responseStruct, resp, err\n}", "title": "" }, { "docid": "db82c6e57c7034c9b92a999a9176cdff", "score": "0.49716982", "text": "func (_KyberStorage *KyberStorageSession) KyberFeeHandlerHistory() (common.Address, error) {\n\treturn _KyberStorage.Contract.KyberFeeHandlerHistory(&_KyberStorage.CallOpts)\n}", "title": "" }, { "docid": "8822181e4b7e1e20662f0322d6e17329", "score": "0.49582833", "text": "func (m Message) UnderlyingFXRate() (*field.UnderlyingFXRateField, quickfix.MessageRejectError) {\n\tf := &field.UnderlyingFXRateField{}\n\terr := m.Body.Get(f)\n\treturn f, err\n}", "title": "" }, { "docid": "2e1abf0a6ca4aa152c6325ee7e72a219", "score": "0.49582115", "text": "func (e *BlockPolicyEstimator) estimateSmartFee(confTarget uint, conservative bool) (float64, *FeeRate, *EstimationResult) {\n\n\tfeeCalc := &FeeCalculation{\n\t\tdesiredTarget: confTarget,\n\t\treturnedTarget: confTarget,\n\t}\n\n\tmedian := float64(-1)\n\n\t// Return failure if trying to analyze a target we're not tracking\n\tif confTarget <= 0 || confTarget > e.longStats.GetMaxConfirms() {\n\t\treturn 0, NewFeeRate(0, 0), nil\n\t}\n\n\t// It's not possible to get reasonable estimates for confTarget of 1\n\tif confTarget == 1 {\n\t\tconfTarget = 2\n\t}\n\n\tmaxUsableEstimate := e.MaxUsableEstimate()\n\tif confTarget > maxUsableEstimate {\n\t\tconfTarget = maxUsableEstimate\n\t}\n\tfeeCalc.returnedTarget = confTarget\n\n\tif confTarget <= 1 {\n\t\treturn 0, NewFeeRate(0, 0), nil //error condition\n\t}\n\n\t/** true is passed to estimateCombined fee for target/2 and target so\n\t * that we check the max confirms for shorter time horizons as well.\n\t * This is necessary to preserve monotonically increasing estimates.\n\t * For non-conservative estimates we do the same thing for 2*target, but\n\t * for conservative estimates we want to skip these shorter horizons\n\t * checks for 2*target because we are taking the max over all time\n\t * horizons so we already have monotonically increasing estimates and\n\t * the purpose of conservative estimates is not to let short term\n\t * fluctuations lower our estimates by too much.\n\t */\n\thalfEst, _, tempResult := e.estimateCombinedFee(confTarget/2, HalfSuccessPct, true)\n\tfeeCalc.est = tempResult\n\tfeeCalc.reason = HalfEstimate\n\tmedian = halfEst\n\n\tactualEst, _, tempResult := e.estimateCombinedFee(confTarget, SuccessPct, true)\n\tif actualEst > median {\n\t\tmedian = actualEst\n\t\tfeeCalc.est = tempResult\n\t\tfeeCalc.reason = FullEstimate\n\t}\n\n\tdoubleEst, _, tempResult := e.estimateCombinedFee(2*confTarget, DoubleSuccessPct, !conservative)\n\tif doubleEst > median {\n\t\tmedian = doubleEst\n\t\tfeeCalc.est = tempResult\n\t\tfeeCalc.reason = DoubleEstimate\n\t}\n\n\tif conservative || median == -1 {\n\t\tconsEst, _, tempResult := e.estimateConservativeFee(2 * confTarget)\n\t\tif consEst > median {\n\t\t\tmedian = consEst\n\t\t\tfeeCalc.est = tempResult\n\t\t\tfeeCalc.reason = Conservative\n\t\t}\n\t}\n\n\tif median < 0 {\n\t\treturn 0, NewFeeRate(0, 0), nil //error condition\n\t}\n\n\treturn median, NewFeeRate(median, 0), tempResult\n}", "title": "" }, { "docid": "43e181a52606112c30266c1d891b0ef4", "score": "0.494902", "text": "func estimateFee(node *btc.RPCClient) (uint64, error) {\n\tresp, err := node.RawRequest(\"estimatefee\", nil)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tvar feeRate float64\n\terr = json.Unmarshal(resp, &feeRate)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif feeRate <= 0 {\n\t\treturn 0, fmt.Errorf(\"fee could not be estimated\")\n\t}\n\treturn uint64(math.Round(feeRate * 1e5)), nil\n}", "title": "" }, { "docid": "c786036e616885849becea045fe605a0", "score": "0.49478477", "text": "func (b Block) CalculateTotalMinerFees() Currency {\n\tsum := NewCurrency64(0)\n\tfor _, txn := range b.Transactions {\n\t\tfor _, fee := range txn.MinerFees {\n\t\t\tsum = sum.Add(fee)\n\t\t}\n\t}\n\treturn sum\n}", "title": "" }, { "docid": "3799221d9ec88cf3b2ddc2aacf30fdac", "score": "0.49478", "text": "func GetFeeEstimatesHandler() (interface{}, error) {\n\treturn &apimodels.FeeEstimateResponse{\n\t\tHighPriority: 3,\n\t\tNormalPriority: 2,\n\t\tLowPriority: 1,\n\t}, nil\n}", "title": "" }, { "docid": "f42ed188a4eebf6c404c2605ae569e55", "score": "0.4934001", "text": "func (_DFedBank *DFedBankSession) Fee() (*big.Int, error) {\n\treturn _DFedBank.Contract.Fee(&_DFedBank.CallOpts)\n}", "title": "" }, { "docid": "53fad4061aca8925dfab3118f26f1107", "score": "0.49335837", "text": "func (c *Client) GetBlockSysFee(index uint32) (util.Fixed8, error) {\n\tvar (\n\t\tparams = request.NewRawParams(index)\n\t\tresp util.Fixed8\n\t)\n\tif err := c.performRequest(\"getblocksysfee\", params, &resp); err != nil {\n\t\treturn resp, err\n\t}\n\treturn resp, nil\n}", "title": "" }, { "docid": "bb2117cd4a96a07c0895bc30a335394e", "score": "0.49305436", "text": "func (self *Fetcher) GetRate(currentRate []common.Rate, customData *common.DataGetRate) (*[]common.Rate, error) {\n\tinfoData := self.GetInfoData()\n\tvar sourceArr, sourceSymbolArr, destArr, destSymbolArr []string\n\tvar amountArr []*big.Int\n\tif len(currentRate) == 0 && customData != nil {\n\t\tsourceArr = customData.SourceArr\n\t\tsourceSymbolArr = customData.SourceSymbolArr\n\t\tdestArr = customData.DstArr\n\t\tdestSymbolArr = customData.DstSymbolArr\n\t\tamountArr = customData.AmountArr\n\t} else {\n\t\tsourceArr, sourceSymbolArr, destArr, destSymbolArr, amountArr = MakeDataGetRate(infoData, currentRate)\n\t}\n\n\tdataAbi, err := self.contractHanler.EncodeRateData(sourceArr, destArr, amountArr)\n\tif err != nil {\n\t\tlog.Print(err)\n\t\treturn nil, err\n\t}\n\n\tfor _, fetIns := range self.fetcherIns {\n\t\tresult, err := fetIns.EthCall(self.infoData.Wrapper, ethereum.ToHex(dataAbi))\n\t\tif err != nil {\n\t\t\tlog.Print(err)\n\t\t\tcontinue\n\t\t}\n\t\trates, err := self.contractHanler.ExtractRateData(result, sourceSymbolArr, destSymbolArr)\n\t\tif err != nil {\n\t\t\tlog.Print(err)\n\t\t\tcontinue\n\t\t}\n\t\treturn rates, nil\n\t}\n\treturn nil, errors.New(\"Cannot get rate\")\n}", "title": "" }, { "docid": "ee45ea1985693f98f174da84e01dc7c7", "score": "0.49241307", "text": "func CalculateFee(a float64) float64 {\n\treturn percent.PercentFloat(Fee, a)\n}", "title": "" }, { "docid": "1c4fed47290fad774c4bbd0f4f93dcd9", "score": "0.49233362", "text": "func (_TBTCSystem *TBTCSystemCallerSession) GetNewDepositFeeEstimate() (*big.Int, error) {\n\treturn _TBTCSystem.Contract.GetNewDepositFeeEstimate(&_TBTCSystem.CallOpts)\n}", "title": "" }, { "docid": "d415991825be8d243ee82a3748a2b4d1", "score": "0.49156973", "text": "func (_TetherToken *TetherTokenCaller) MaximumFee(opts *bind.CallOpts) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _TetherToken.contract.Call(opts, out, \"maximumFee\")\n\treturn *ret0, err\n}", "title": "" }, { "docid": "9c17fdb052426aa901a5802447a5487a", "score": "0.49156955", "text": "func (d *PriceVoteData) fee() fee {\n\treturn feePriceVote\n}", "title": "" }, { "docid": "287cfee2d49996b3f43d7d78ce608370", "score": "0.49035072", "text": "func (z *ZB) GetFee(feeBuilder *exchange.FeeBuilder) (float64, error) {\n\tvar fee float64\n\tswitch feeBuilder.FeeType {\n\tcase exchange.CryptocurrencyTradeFee:\n\t\tfee = calculateTradingFee(feeBuilder.PurchasePrice, feeBuilder.Amount)\n\tcase exchange.CryptocurrencyWithdrawalFee:\n\t\tfee = getWithdrawalFee(feeBuilder.Pair.Base)\n\tcase exchange.OfflineTradeFee:\n\t\tfee = getOfflineTradeFee(feeBuilder.PurchasePrice, feeBuilder.Amount)\n\t}\n\tif fee < 0 {\n\t\tfee = 0\n\t}\n\n\treturn fee, nil\n}", "title": "" }, { "docid": "9230433bade92c43b688ec6db195e0ed", "score": "0.4899279", "text": "func payFee(c *gin.Context) {\n\n\t// Get values which have been added to context by middleware.\n\tticket := c.MustGet(\"Ticket\").(database.Ticket)\n\tknownTicket := c.MustGet(\"KnownTicket\").(bool)\n\tdcrdClient := c.MustGet(\"DcrdClient\").(*rpc.DcrdRPC)\n\n\tif cfg.VspClosed {\n\t\tsendError(errVspClosed, c)\n\t\treturn\n\t}\n\n\tif !knownTicket {\n\t\tlog.Warnf(\"Unknown ticket from %s\", c.ClientIP())\n\t\tsendError(errUnknownTicket, c)\n\t\treturn\n\t}\n\n\tvar payFeeRequest PayFeeRequest\n\tif err := c.ShouldBindJSON(&payFeeRequest); err != nil {\n\t\tlog.Warnf(\"Bad payfee request from %s: %v\", c.ClientIP(), err)\n\t\tsendErrorWithMsg(err.Error(), errBadRequest, c)\n\t\treturn\n\t}\n\n\t// Respond early if we already have the fee tx for this ticket.\n\tif ticket.FeeTxStatus == database.FeeReceieved ||\n\t\tticket.FeeTxStatus == database.FeeBroadcast ||\n\t\tticket.FeeTxStatus == database.FeeConfirmed {\n\t\tlog.Warnf(\"Fee tx already received from %s: ticketHash=%s\", c.ClientIP(), ticket.Hash)\n\t\tsendError(errFeeAlreadyReceived, c)\n\t\treturn\n\t}\n\n\t// Get ticket details.\n\trawTicket, err := dcrdClient.GetRawTransaction(ticket.Hash)\n\tif err != nil {\n\t\tlog.Errorf(\"Could not retrieve tx %s for %s: %v\", ticket.Hash, c.ClientIP(), err)\n\t\tsendError(errInternalError, c)\n\t\treturn\n\t}\n\n\t// Ensure this ticket is eligible to vote at some point in the future.\n\tcanVote, err := dcrdClient.CanTicketVote(rawTicket, ticket.Hash, cfg.NetParams)\n\tif err != nil {\n\t\tlog.Errorf(\"canTicketVote error: %v\", err)\n\t\tsendError(errInternalError, c)\n\t\treturn\n\t}\n\tif !canVote {\n\t\tlog.Warnf(\"Unvotable ticket %s from %s\", ticket.Hash, c.ClientIP())\n\t\tsendError(errTicketCannotVote, c)\n\t\treturn\n\t}\n\n\t// Respond early if the fee for this ticket is expired.\n\tif ticket.FeeExpired() {\n\t\tlog.Warnf(\"Expired payfee request from %s\", c.ClientIP())\n\t\tsendError(errFeeExpired, c)\n\t\treturn\n\t}\n\n\t// Validate VotingKey.\n\tvotingKey := payFeeRequest.VotingKey\n\tvotingWIF, err := dcrutil.DecodeWIF(votingKey, cfg.NetParams.PrivateKeyID)\n\tif err != nil {\n\t\tlog.Warnf(\"Failed to decode WIF: %v\", err)\n\t\tsendError(errInvalidPrivKey, c)\n\t\treturn\n\t}\n\n\t// Validate VoteChoices.\n\tvoteChoices := payFeeRequest.VoteChoices\n\terr = isValidVoteChoices(cfg.NetParams, currentVoteVersion(cfg.NetParams), voteChoices)\n\tif err != nil {\n\t\tlog.Warnf(\"Invalid votechoices from %s: %v\", c.ClientIP(), err)\n\t\tsendErrorWithMsg(err.Error(), errInvalidVoteChoices, c)\n\t\treturn\n\t}\n\n\t// Validate FeeTx.\n\tfeeTx, err := decodeTransaction(payFeeRequest.FeeTx)\n\tif err != nil {\n\t\tlog.Warnf(\"Failed to decode tx: %v\", err)\n\t\tsendError(errInvalidFeeTx, c)\n\t\treturn\n\t}\n\n\t// Loop through transaction outputs until we find one which pays to the\n\t// expected fee address. Record how much is being paid to the fee address.\n\tvar feePaid dcrutil.Amount\n\tconst scriptVersion = 0\n\nfindAddress:\n\tfor _, txOut := range feeTx.TxOut {\n\t\tif txOut.Version != scriptVersion {\n\t\t\tsendErrorWithMsg(\"invalid script version\", errInvalidFeeTx, c)\n\t\t\treturn\n\t\t}\n\t\t_, addresses, _, err := txscript.ExtractPkScriptAddrs(scriptVersion,\n\t\t\ttxOut.PkScript, cfg.NetParams)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"Extract PK error: %v\", err)\n\t\t\tsendError(errInternalError, c)\n\t\t\treturn\n\t\t}\n\t\tfor _, addr := range addresses {\n\t\t\tif addr.Address() == ticket.FeeAddress {\n\t\t\t\tfeePaid = dcrutil.Amount(txOut.Value)\n\t\t\t\tbreak findAddress\n\t\t\t}\n\t\t}\n\t}\n\n\tif feePaid == 0 {\n\t\tlog.Warnf(\"FeeTx for ticket %s did not include any payments for address %s\", ticket.Hash, ticket.FeeAddress)\n\t\tsendErrorWithMsg(\"feetx did not include any payments for fee address\", errInvalidFeeTx, c)\n\t\treturn\n\t}\n\n\twifAddr, err := dcrutil.NewAddressPubKeyHash(dcrutil.Hash160(votingWIF.PubKey()), cfg.NetParams,\n\t\tdcrec.STEcdsaSecp256k1)\n\tif err != nil {\n\t\tlog.Errorf(\"NewAddressPubKeyHash: %v\", err)\n\t\tsendError(errInvalidPrivKey, c)\n\t\treturn\n\t}\n\n\t// Decode ticket transaction to get its voting address.\n\tticketTx, err := decodeTransaction(rawTicket.Hex)\n\tif err != nil {\n\t\tlog.Warnf(\"Failed to decode tx: %v\", err)\n\t\tsendError(errInternalError, c)\n\t\treturn\n\t}\n\n\t// Get ticket voting address.\n\t_, votingAddr, _, err := txscript.ExtractPkScriptAddrs(scriptVersion, ticketTx.TxOut[0].PkScript, cfg.NetParams)\n\tif err != nil {\n\t\tlog.Errorf(\"ExtractPK error: %v\", err)\n\t\tsendError(errInternalError, c)\n\t\treturn\n\t}\n\tif len(votingAddr) == 0 {\n\t\tlog.Error(\"No voting address found for ticket %s\", ticket.Hash)\n\t\tsendError(errInternalError, c)\n\t\treturn\n\t}\n\n\t// Ensure provided private key will allow us to vote this ticket.\n\tif votingAddr[0].Address() != wifAddr.Address() {\n\t\tlog.Warnf(\"Voting address does not match provided private key: \"+\n\t\t\t\"votingAddr=%+v, wifAddr=%+v\", votingAddr[0], wifAddr)\n\t\tsendErrorWithMsg(\"voting address does not match provided private key\",\n\t\t\terrInvalidPrivKey, c)\n\t\treturn\n\t}\n\n\tminFee := dcrutil.Amount(ticket.FeeAmount)\n\tif feePaid < minFee {\n\t\tlog.Warnf(\"Fee too small from %s: was %v, expected %v\", c.ClientIP(),\n\t\t\tfeePaid, minFee)\n\t\tsendError(errFeeTooSmall, c)\n\t\treturn\n\t}\n\n\t// At this point we are satisfied that the request is valid and the FeeTx\n\t// pays sufficient fees to the expected address. Proceed to update the\n\t// database, and if the ticket is confirmed broadcast the transaction.\n\n\tticket.VotingWIF = votingWIF.String()\n\tticket.FeeTxHex = payFeeRequest.FeeTx\n\tticket.FeeTxHash = feeTx.TxHash().String()\n\tticket.VoteChoices = voteChoices\n\tticket.FeeTxStatus = database.FeeReceieved\n\n\terr = db.UpdateTicket(ticket)\n\tif err != nil {\n\t\tlog.Errorf(\"InsertTicket failed: %v\", err)\n\t\tsendError(errInternalError, c)\n\t\treturn\n\t}\n\n\tlog.Debugf(\"Fee tx received for ticket: minExpectedFee=%v, feePaid=%v, \"+\n\t\t\"ticketHash=%s\", minFee, feePaid, ticket.Hash)\n\n\tif ticket.Confirmed {\n\t\terr = dcrdClient.SendRawTransaction(payFeeRequest.FeeTx)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"SendRawTransaction failed: %v\", err)\n\n\t\t\tticket.FeeTxStatus = database.FeeError\n\n\t\t\terr = db.UpdateTicket(ticket)\n\t\t\tif err != nil {\n\t\t\t\tlog.Errorf(\"UpdateTicket error: %v\", err)\n\t\t\t}\n\n\t\t\tsendErrorWithMsg(\"could not broadcast fee transaction\", errInvalidFeeTx, c)\n\t\t\treturn\n\t\t}\n\n\t\tticket.FeeTxStatus = database.FeeBroadcast\n\n\t\terr = db.UpdateTicket(ticket)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"UpdateTicket failed: %v\", err)\n\t\t\tsendError(errInternalError, c)\n\t\t\treturn\n\t\t}\n\n\t\tlog.Debugf(\"Fee tx broadcast for ticket: ticketHash=%s, feeHash=%s\", ticket.Hash, ticket.FeeTxHash)\n\t}\n\n\tsendJSONResponse(payFeeResponse{\n\t\tTimestamp: time.Now().Unix(),\n\t\tRequest: payFeeRequest,\n\t}, c)\n}", "title": "" }, { "docid": "77f8c8e7b1f29b7b464b9913e3ece1a1", "score": "0.48969463", "text": "func (_TBTCSystem *TBTCSystemCaller) GetNewDepositFeeEstimate(opts *bind.CallOpts) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _TBTCSystem.contract.Call(opts, out, \"getNewDepositFeeEstimate\")\n\treturn *ret0, err\n}", "title": "" }, { "docid": "e03e74b12c0e6c25874969a58b636791", "score": "0.48899743", "text": "func (_L1BondingManager *L1BondingManagerSession) WithdrawFees() (*types.Transaction, error) {\n\treturn _L1BondingManager.Contract.WithdrawFees(&_L1BondingManager.TransactOpts)\n}", "title": "" }, { "docid": "6609e310b393cf49f95a27474c151828", "score": "0.48781922", "text": "func (m *TransactionFees) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateAmountFee(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateAmountPayout(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateAmountSettlement(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateAssetCodePayout(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateDetailsAssetSettlement(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateDetailsPayoutLocation(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateRequestID(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0fdd223e19ed81d5dc22c3f49dd84d98", "score": "0.4877693", "text": "func (_UpgradedStandardToken *UpgradedStandardTokenCallerSession) MaximumFee() (*big.Int, error) {\n\treturn _UpgradedStandardToken.Contract.MaximumFee(&_UpgradedStandardToken.CallOpts)\n}", "title": "" }, { "docid": "7f128d30c11e637436adfbe9233feb9a", "score": "0.4864162", "text": "func (transaction *TokenCreateTransaction) GetCustomFees() []Fee {\n\treturn transaction.customFees\n}", "title": "" }, { "docid": "2078fb56097264176f24a152257923f3", "score": "0.48623744", "text": "func (m *ItemItemsItemWorkbookFunctionsMirrPostRequestBody) GetFinanceRate()(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.Jsonable) {\n val, err := m.GetBackingStore().Get(\"financeRate\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.Jsonable)\n }\n return nil\n}", "title": "" }, { "docid": "265a7c646788b463414ab6e4077d896a", "score": "0.48613033", "text": "func (l *Loan) GetFee() (fee models.Fee, err error) {\n\terr = DB.Select().\n\t\tFrom(fee.TableName()).\n\t\tWhere(dbx.HashExp{\"active\": \"YES\"}).\n\t\tOne(&fee)\n\tif err != nil {\n\t\tif err == sql.ErrNoRows {\n\t\t\terr = ErrLoanFeeNotFound\n\t\t}\n\t\treturn\n\t}\n\n\treturn\n}", "title": "" } ]
fbe827b788bd6eb8969a857736a7c155
ReadFloat32 reads a 32bit float from the arg.
[ { "docid": "19abf5c811bff8079ef3f46bb3dd7d9f", "score": "0.7658693", "text": "func (s String) ReadFloat32() (float32, error) { return 0, ErrInvalidTypeTag }", "title": "" } ]
[ { "docid": "9e6577553270df717d53183ba4785212", "score": "0.85532045", "text": "func (f Float) ReadFloat32() (float32, error) { return float32(f), nil }", "title": "" }, { "docid": "ba8b11ab787e358f442a36dbeb4eec65", "score": "0.8507038", "text": "func ReadFloat32(reader io.Reader, value *float32) {\n\tbinary.Read(reader, binary.LittleEndian, value)\n}", "title": "" }, { "docid": "074e155241f0dda53e9f993c1d2ed82f", "score": "0.845074", "text": "func ReadFloat32(src []byte) float32 {\n\tu := ReadUInt32(src)\n\treturn math.Float32frombits(u)\n}", "title": "" }, { "docid": "17d76a6cc9cba0809ade34f71bce55f8", "score": "0.8031415", "text": "func (r *Reader) readFloat32() float32 {\n\treturn math.Float32frombits(r.readLeUint32())\n}", "title": "" }, { "docid": "2cc026a8a6cf4682ebca97ee0ce70ee9", "score": "0.8013133", "text": "func (r *Reader) ReadFloat32() float32 {\n\treturn math.Float32frombits(r.ReadUInt32())\n}", "title": "" }, { "docid": "f11c1a0ef76d3c1e8921b5d9576e1e63", "score": "0.79838884", "text": "func (dr *DataReader) ReadFloat32() (float32, error) {\n\tvar value float32\n\terr := binary.Read(dr.r, binary.BigEndian, &value)\n\treturn value, err\n}", "title": "" }, { "docid": "1e48ac160633a318fc705507e644c976", "score": "0.793152", "text": "func (r *Reader) ReadFloat32() float32 {\n\treturn math.Float32frombits(r.ReadUint32())\n}", "title": "" }, { "docid": "af1d521d8798b9de8825838f2311f82b", "score": "0.7910773", "text": "func (d *Decoder) ReadFloat32() float32 {\n\tf := ReadFloat32(d.buf)\n\td.buf = d.buf[4:]\n\treturn f\n}", "title": "" }, { "docid": "ef71ddfad75c1b053929e03e7aa48643", "score": "0.787748", "text": "func (r *Reader) ReadFloat32() (float32, error) {\n\tf, err := r.ReadFloat64()\n\tswitch {\n\tcase err != nil:\n\t\treturn 0, err\n\tcase f < -math.MaxFloat32 || f > math.MaxFloat32:\n\t\treturn 0, floatOverflowError{}\n\tdefault:\n\t\treturn float32(f), nil\n\t}\n}", "title": "" }, { "docid": "4a98d55f506355893433722a9276fe6b", "score": "0.78167605", "text": "func (i Int) ReadFloat32() (float32, error) { return 0, ErrInvalidTypeTag }", "title": "" }, { "docid": "20c3db26af57b88aa33220012233a794", "score": "0.7761546", "text": "func (r *BytesReader) ReadFloat32() float32 {\n\treturn math.Float32frombits(r.ReadUint32())\n}", "title": "" }, { "docid": "9ad19dcce754a643344dabc375d523c3", "score": "0.7745588", "text": "func (d *Decoder) Float32() float32 {\n\tif d.err != nil {\n\t\treturn 0\n\t}\n\tvar n int\n\tn, d.err = io.ReadFull(d.rd, d.b[:4])\n\td.cnt += n\n\tif d.err != nil {\n\t\treturn 0\n\t}\n\tbits := binary.LittleEndian.Uint32(d.b[:4])\n\treturn math.Float32frombits(bits)\n}", "title": "" }, { "docid": "081c0222aa9cdf3479841c385694fa21", "score": "0.7722901", "text": "func (r *Reader) Float32(v *float32) {\n\t*v = r.decFloat32s[0]\n\tr.decFloat32s = r.decFloat32s[1:]\n}", "title": "" }, { "docid": "6b5ec6701052d45123019a5e89b2e617", "score": "0.76428133", "text": "func (r *Decoder) ReadFloat32(order ByteOrder) float32 {\n\tbits := r.ReadUint32(order)\n\treturn math.Float32frombits(bits)\n}", "title": "" }, { "docid": "f4dfd096c2aba38ec663acb1d249cf96", "score": "0.7569511", "text": "func TestReadFloat32(t *testing.T) {\n\tvar v float32\n\terr := NewScanner(strings.NewReader(`1293.123`)).ReadFloat32(&v)\n\tassert.NoError(t, err)\n\tassert.Equal(t, v, float32(1293.123))\n}", "title": "" }, { "docid": "e7b97c0a96786134f227cbc2a4ea4c3d", "score": "0.7525889", "text": "func (b Bool) ReadFloat32() (float32, error) { return 0, ErrInvalidTypeTag }", "title": "" }, { "docid": "0c59bda41eaf6bc14a922de90c89d475", "score": "0.74814475", "text": "func (b Blob) ReadFloat32() (float32, error) { return 0, ErrInvalidTypeTag }", "title": "" }, { "docid": "81c2b5a502ffb4d31b7b7191aceaea9f", "score": "0.7446806", "text": "func (d *Decoder) Float32() (v float32, err error) {\n\tv, err = decodeFloat32(d.r)\n\treturn\n}", "title": "" }, { "docid": "1c126182363a1be2591e7169a1ec7a8d", "score": "0.744241", "text": "func (f Flags) GetFloat32(name string) (float32, error) {\n\treturn f.first(name).GetFloat32()\n}", "title": "" }, { "docid": "fda3717ff032052383605c05e36fd30d", "score": "0.74063", "text": "func (d *DataSlice) ReadFloat32(offset uint) float32 {\n\treturn d.dataView.Float32(offset, d.littleEndian)\n}", "title": "" }, { "docid": "17139bf3d8f7874f215e2005e745e5cc", "score": "0.7374274", "text": "func ParseFloat32(val interface{}) (float32, error) {\n\tnumber, err := ParseFloat64(val)\n\tif err != nil {\n\t\treturn float32(0), err\n\t}\n\treturn float32(number), nil\n}", "title": "" }, { "docid": "53e431bf338f5596bf136830ccf4795f", "score": "0.7343137", "text": "func (i *Inp) GetFloat32(out *float32) {\n\ti.readUnsafe(out)\n}", "title": "" }, { "docid": "6efed55a01baa1e1b840f26c0d99e188", "score": "0.73389286", "text": "func FP32ToFloat32(buf []byte) (v float32, e error) {\n\tif e = checkByteCount(buf, 4, \"FP32\"); e != nil {\n\t\treturn\n\t}\n\tvar i uint32\n\ti, e = UI32ToUint32(buf)\n\tv = math.Float32frombits(i)\n\treturn\n}", "title": "" }, { "docid": "0a86ca4587cfa08559aa1661af469bb4", "score": "0.7274446", "text": "func (_e *MockReadBuffer_Expecter) ReadFloat32(logicalName interface{}, bitLength interface{}, readerArgs ...interface{}) *MockReadBuffer_ReadFloat32_Call {\n\treturn &MockReadBuffer_ReadFloat32_Call{Call: _e.mock.On(\"ReadFloat32\",\n\t\tappend([]interface{}{logicalName, bitLength}, readerArgs...)...)}\n}", "title": "" }, { "docid": "8b11f0fc0fe63db33fe2ea52e6545dad", "score": "0.7268105", "text": "func (f Float) ReadInt32() (int32, error) { return 0, ErrInvalidTypeTag }", "title": "" }, { "docid": "4a751721b65545c5a96e107fad40c5e3", "score": "0.7258753", "text": "func (b *Buffer) GetFloat32(name string) (float32, bool) {\n\tif o := b.getFieldUOffsetT(name); o != 0 {\n\t\treturn b.tab.GetFloat32(o), true\n\t}\n\treturn 0, false\n}", "title": "" }, { "docid": "4dbbc995da385f6f886bbea5b9f6c82e", "score": "0.7220489", "text": "func Float32(b []byte) float32 {\n\t//See Hacker's Delight 2nd Edition, 17-3\n\tn := int32(Uint32(b))\n\tif n >= 0 {\n\t\tn = -n\n\t} else {\n\t\tn = n + math.MinInt32\n\t}\n\treturn math.Float32frombits(uint32(n))\n}", "title": "" }, { "docid": "9e4ca28c36d23afa400b1f56e10ddae9", "score": "0.7214873", "text": "func (r *Reader) readFloat32Bits(b int32, lP *float32, hP *float32) float32 {\n\tbits := int(b)\n\tlV, hV := float32(0.0), float32(0.0)\n\tif lP != nil {\n\t\tlV = *lP\n\t}\n\tif hP != nil {\n\t\thV = *hP\n\t}\n\n\tdividend := r.readBits(bits)\n\tdivisor := (1 << uint(bits)) - 1\n\tbase := float32(dividend) / float32(divisor)\n\tdiff := hV - lV\n\treturn (base * diff) - lV\n}", "title": "" }, { "docid": "7f53638c69fd11fd4d185c5bb80582f4", "score": "0.7212548", "text": "func (q *QRNG) Float32() (float32, error) {\n\tvar r uint32\n\terr := q.readInto(&r)\n\treturn float32(r) / (1 << 32), err\n}", "title": "" }, { "docid": "e3ce4413aa72056a056c44894b8e3d77", "score": "0.71530956", "text": "func (seg *Segment) Float32(offset int64) *float32 {\n\treturn (*float32)(unsafe.Pointer(seg.Pointer(offset, Float32Size)))\n}", "title": "" }, { "docid": "cb12010596934af1d2423291c35cf85c", "score": "0.7112536", "text": "func (im *InstanceMetadata) GetFloat32(key string) (f float32, err error) {\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\tf = 0.0\n\t\t\terr = fmt.Errorf(\"failed to cast interface to float32\")\n\t\t}\n\t}()\n\tv, err := im.GetFloat64(key)\n\treturn float32(v), err\n}", "title": "" }, { "docid": "3427adb6c968de5c1b59009f651287f6", "score": "0.71120316", "text": "func (f Flag) GetFloat32() (float32, error) {\n\tfl, err := f.getFloat(32)\n\n\tif err != nil {\n\t\treturn 0.0, err\n\t}\n\n\treturn float32(fl), nil\n}", "title": "" }, { "docid": "4fa5e5c8b4e4a7cd946e1873a9bc069a", "score": "0.7075552", "text": "func Float32(startNum float32, endNum float32) (float32, error) {\n\tconst fn = \"Float32\"\n\tif (startNum > endNum) || (startNum == endNum) {\n\t\treturn 0, &Error{fn, ErrEndNumSmaller}\n\t}\n\tnum, err := Float32N(startNum, endNum, 1)\n\treturn num[0], err\n}", "title": "" }, { "docid": "eff385af08eb9ca3f8584ed5bb67454f", "score": "0.7063425", "text": "func ParseFloat32(s string) (float32, error) {\n\tf, e := strconv.ParseFloat(s, 32)\n\treturn float32(f), e\n}", "title": "" }, { "docid": "88a38a1baf764646563c32765ea538f1", "score": "0.70556724", "text": "func (c *Configuration) GetFloat32(key string) float32 {\n\tc.ensureInitialized()\n\treturn float32(c.viper.GetFloat64(key))\n}", "title": "" }, { "docid": "02f1df24be174decabae85cec43180f5", "score": "0.70444554", "text": "func (c *DefaultConverter) Float32() float32 {\n\tv, err := c.TryFloat32()\n\tpanicIfError(err)\n\treturn v\n}", "title": "" }, { "docid": "971e9540c1cd1c709bbe1e88f82bd9e2", "score": "0.7024945", "text": "func (s *Serializer) Float32(f float32) {\n\ts.Uint32(float32ToUint32(f))\n}", "title": "" }, { "docid": "5406d65b905ef0192d4df21642e8ad0e", "score": "0.7022253", "text": "func Float32(i int) float32", "title": "" }, { "docid": "c62ae9d3ef177bcc5f06821d0ad6c1a8", "score": "0.7013512", "text": "func Float32(f *float32) float32 {\n\treturn Float32OrDefault(f, 0)\n}", "title": "" }, { "docid": "0c6ee1cea5c32928ebfdd587d37a94d7", "score": "0.6988138", "text": "func ToFloat32(f float32) *float32 { return &f }", "title": "" }, { "docid": "0c6ee1cea5c32928ebfdd587d37a94d7", "score": "0.6988138", "text": "func ToFloat32(f float32) *float32 { return &f }", "title": "" }, { "docid": "f0c5805e0d78f39059ad571363aaf32b", "score": "0.6970453", "text": "func (f Number) Float32() float32 {\n\tu32 := expandF16ToF32(f)\n\tptr := unsafe.Pointer(&u32)\n\tf32 := *(*float32)(ptr)\n\treturn f32\n}", "title": "" }, { "docid": "e63d8fae61e1cb6b138257e2cd40cb6f", "score": "0.6958764", "text": "func Float32FromBytes(buf []byte) float32 {\n\treturn math.Float32frombits(binary.LittleEndian.Uint32(buf))\n}", "title": "" }, { "docid": "06beb993f37e46f57837d5ef1e410ab5", "score": "0.6949373", "text": "func Float32(v float32) *float32 { return &v }", "title": "" }, { "docid": "8d28431483770b3acc743fa4f3803197", "score": "0.6917427", "text": "func FloatToFloat32(value float64) (float32, error) {\n\n\tvalueStr, _ := FloatToString(value)\n\tresult64, parseErr := strconv.ParseFloat(valueStr, 32)\n\tresult := float32(result64)\n\n\tif parseErr != nil {\n\t\treturn result, parseErr\n\t}\n\n\tresultStr := strconv.FormatFloat(float64(result), 'f', -1, 32)\n\n\tif resultStr != valueStr {\n\t\treturn result, errors.New(lossOfPrecisionErrorMsg)\n\t}\n\n\treturn result, nil\n}", "title": "" }, { "docid": "428e6fedb0dcfac3545b1bd41ec419c6", "score": "0.69067353", "text": "func (bd *BinaryDecoder) ReadFloat() (float32, error) {\n\tvar float float32\n\tif err := checkEOF(bd.buf, bd.pos, 4); err != nil {\n\t\treturn float, err\n\t}\n\tbits := binary.LittleEndian.Uint32(bd.buf[bd.pos : bd.pos+4])\n\tfloat = math.Float32frombits(bits)\n\tbd.pos += 4\n\treturn float, nil\n}", "title": "" }, { "docid": "51f54ceaeaeaac2c81f21b57cc284433", "score": "0.6902845", "text": "func (p *serializer) parseFloat32(f reflect.Value, d Packet) error {\n\tval, err := d.Float32()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to parse float: %v\", err)\n\t}\n\tf.SetFloat(float64(val))\n\treturn nil\n}", "title": "" }, { "docid": "3788f1aa7f8d2892b68b8251fabff920", "score": "0.6891798", "text": "func Float32(key string, val float32) Field {\n\treturn Field{Key: key, Type: zapcore.Float32Type, Integer: int64(math.Float32bits(val))}\n}", "title": "" }, { "docid": "d5c3a8df2f5d1a7ba517972393cbfb4a", "score": "0.6886551", "text": "func loadFloat(r io.Reader) (f Float, e error) {\n\tvar buf [4]byte\n\t_, err := io.ReadFull(r, buf[0:4])\n\tif err != nil {\n\t\treturn f, err\n\t}\n\treturn Float(math.Float32frombits(uint32(buf[0])<<24 | uint32(buf[1])<<16 | uint32(buf[2])<<8 | uint32(buf[3]))), nil\n}", "title": "" }, { "docid": "c556f92beb115efa4a56a585806db60e", "score": "0.68861973", "text": "func (r *RawPacket) ReadFloat() float32 {\n\tbuf := make([]byte, 4)\n\tr.Data.Read(buf)\n\treturn math.Float32frombits(ByteOrder.Uint32(buf))\n}", "title": "" }, { "docid": "87d1c4259a2a7f63135d63d3aaa5324f", "score": "0.6885192", "text": "func (c *Config) GetFloat32(section, option string) float32 {\n\treturn c.Section(section).GetFloat32(option)\n}", "title": "" }, { "docid": "e7caae6497c788ad1ad3ef3f64fdf0ab", "score": "0.6879155", "text": "func Float32(key string, val float32) Field {\n\treturn Field{Key: key, Type: Float32Type, Integer: int64(math.Float32bits(val))}\n}", "title": "" }, { "docid": "e7529ab006e089d26972eb50332c78d2", "score": "0.6878941", "text": "func (f Float) Float32() float32 {\n\tpanic(\"not yet implemented\")\n}", "title": "" }, { "docid": "7aef4bd6e7fc687756982a52fa787381", "score": "0.68493396", "text": "func (c *Config) Float32() (float32, error) {\n\ti, err := c.Interface()\n\tif err == nil {\n\t\tif f, ok := i.(float32); ok {\n\t\t\treturn f, nil\n\t\t}\n\t}\n\tif m, ok := (c.content).(float32); ok {\n\t\treturn m, nil\n\t}\n\treturn 0, errors.New(\"value is not float32 type\")\n}", "title": "" }, { "docid": "2918b0268930e691edac7dc1f46e4e26", "score": "0.6846407", "text": "func (o *Onion) GetFloat32(key string) float32 {\n\treturn o.GetFloat32Default(key, 0)\n}", "title": "" }, { "docid": "5247c315315a3359ec9e323b5885134c", "score": "0.6845163", "text": "func Float32(k string, v float32) Field {\n\treturn Field{Key: k, Type: FieldTypeFloat32, Int: int64(math.Float32bits(v))}\n}", "title": "" }, { "docid": "2eb20186537640b7032028a905298924", "score": "0.6837591", "text": "func AsFloat32(v interface{}) (float32, bool) {\n\tswitch d := indirect(v).(type) {\n\tcase bool:\n\t\tif d {\n\t\t\treturn 1, true\n\t\t}\n\t\treturn 0, true\n\tcase int:\n\t\treturn float32(d), true\n\tcase int64:\n\t\treturn float32(d), true\n\tcase int32:\n\t\treturn float32(d), true\n\tcase int16:\n\t\treturn float32(d), true\n\tcase int8:\n\t\treturn float32(d), true\n\tcase uint:\n\t\treturn float32(d), true\n\tcase uint64:\n\t\treturn float32(d), true\n\tcase uint32:\n\t\treturn float32(d), true\n\tcase uint16:\n\t\treturn float32(d), true\n\tcase uint8:\n\t\treturn float32(d), true\n\tcase float64:\n\t\treturn float32(d), true\n\tcase float32:\n\t\treturn d, true\n\tcase string:\n\t\tif n, err := strconv.ParseFloat(d, 32); err == nil {\n\t\t\treturn float32(n), true\n\t\t}\n\t\treturn 0, false\n\tdefault:\n\t\treturn 0, false\n\t}\n}", "title": "" }, { "docid": "43ef7d5349d774e1d81ef4c943b50e40", "score": "0.6829122", "text": "func Float32(v *float32) float32 {\n\tif v == nil {\n\t\treturn 0\n\t}\n\treturn *v\n}", "title": "" }, { "docid": "1361c3e46c614a9229db02d4d167c834", "score": "0.68247646", "text": "func (o *Config) GetFloat32(key string) float32 {\n\treturn o.GetFloat32Default(key, 0)\n}", "title": "" }, { "docid": "aa6b112577716c8b8559254eedcd0a77", "score": "0.6823429", "text": "func Float32(v float32) Value {\n\treturn Value{bits: bits(TypeFloat32) | bitsConst, vInt: int64(math.Float32bits(v))}\n}", "title": "" }, { "docid": "ef167fce0de6e6f4077f062a06daa3b4", "score": "0.681877", "text": "func Float32(f float32) *float32 {\n\treturn &f\n}", "title": "" }, { "docid": "cd037d081a19cd5314954e7eb3f3b7d0", "score": "0.6817075", "text": "func Float32() float32 {}", "title": "" }, { "docid": "38d4e1d546f8bb33265e9423541406dd", "score": "0.6814209", "text": "func (g *Generator) Float32(key string, spec Float32Spec) float32 {\n\treturn g.Generate(key, spec, func(r *rand.Rand) interface{} { return spec.Generate(r) }).(float32)\n}", "title": "" }, { "docid": "4aac0407fab164c5d6f2dee18b36032e", "score": "0.6808322", "text": "func (r *Root) Float32(field string) *Float32 {\r\n\treturn (*Float32)(r.Field(strings.Split(field, \".\")...))\r\n}", "title": "" }, { "docid": "625fcfa152b41dc91d88a4d112920a40", "score": "0.6783589", "text": "func (r *Rand) Float32() float32 {\n\t// Require the least significant 24-bits so shift the higher bits across\n\treturn float32(r.Uint32()>>8) * float32_multiplier\n}", "title": "" }, { "docid": "1c32c190bec1f1957586e9d209fdcd42", "score": "0.6780182", "text": "func Float32(key string, val float32) zapcore.Field {\n\treturn zapcore.Field{Key: key, Type: zapcore.Float32Type, Integer: int64(math.Float32bits(val))}\n}", "title": "" }, { "docid": "9329d3efda68b4f109e8246618a3a6b6", "score": "0.67797416", "text": "func Float32(value interface{}) (float32, error) {\n\tswitch v := value.(type) {\n\tcase bool:\n\t\tif v {\n\t\t\treturn float32(1), nil\n\t\t}\n\n\t\treturn float32(0), nil\n\tcase float32:\n\t\treturn float32(v), nil\n\tcase float64:\n\t\treturn float32(v), nil\n\tcase int:\n\t\treturn float32(v), nil\n\tcase int8:\n\t\treturn float32(v), nil\n\tcase int16:\n\t\treturn float32(v), nil\n\tcase int32:\n\t\treturn float32(v), nil\n\tcase int64:\n\t\treturn float32(v), nil\n\tcase uint:\n\t\treturn float32(v), nil\n\tcase uint8:\n\t\treturn float32(v), nil\n\tcase uint16:\n\t\treturn float32(v), nil\n\tcase uint32:\n\t\treturn float32(v), nil\n\tcase uint64:\n\t\treturn float32(v), nil\n\tcase string:\n\t\tf, err := strconv.ParseFloat(v, 64)\n\t\treturn float32(f), err\n\tcase []byte:\n\t\tf, err := strconv.ParseFloat(string(v), 32)\n\t\treturn float32(f), err\n\tcase nil:\n\t\treturn float32(0), nil\n\tdefault:\n\t\treturn float32(0), errors.New(\"Unknown type\")\n\t}\n}", "title": "" }, { "docid": "f5f6a1857ec526c5327e6dc794dfdbb7", "score": "0.6768275", "text": "func (f *Float32) Float32() float32 {\n\tif f != nil {\n\t\treturn float32(*f)\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "36a598e2bbbeb2300e5d715935e3d5ea", "score": "0.6763109", "text": "func (f Args) Float32(idx int) (val float32) {\n\tif idx < len(f) {\n\t\tif v, ok := f[idx].(float32); ok {\n\t\t\tval = v\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "e26018efd065aece02ff77d10f020c43", "score": "0.6763001", "text": "func (n *Number) AsFloat32(f float32) {\n\tn.typ = Float32Type\n\tn.bits = uint64(math.Float32bits(f))\n}", "title": "" }, { "docid": "d736c3c94aecbeea5f762dfe86ab4948", "score": "0.67419666", "text": "func (v Values) GetFloat32(key string) (float32, bool) {\n\tval, ok := v[key]\n\tif !ok {\n\t\treturn 0.0, false\n\t}\n\n\tswitch x := val.(type) {\n\tcase float32:\n\t\treturn x, ok\n\tcase float64:\n\t\treturn float32(x), ok\n\tdefault:\n\t\treturn 0.0, false\n\t}\n}", "title": "" }, { "docid": "03487639cbfc5d4209232acbb54c824a", "score": "0.673551", "text": "func NewFromFloat32(x float32) (f Float, exact bool) {\n\tpanic(\"not yet implemented\")\n}", "title": "" }, { "docid": "83ce1ea96f0b575d8e702b89f241af7f", "score": "0.6733829", "text": "func (n Number) Float32() float32 {\n\treturn float32(n.Float64())\n}", "title": "" }, { "docid": "458e13bfb04f965693053db58f6b97e0", "score": "0.6727884", "text": "func NewFloat32(f float32) *float32 { return &f }", "title": "" }, { "docid": "d71101dcb3a3901ca6e677c7ef1163c8", "score": "0.67232424", "text": "func (p Params) GetFloat32(key string) (float32, bool) {\n\tv, ok := p[key].(float32)\n\treturn v, ok\n}", "title": "" }, { "docid": "36c8c898f47506e95e4493ed5994dec3", "score": "0.67198503", "text": "func (v *VarImp) Float32() float32 {\n\treturn qn_conv.Float32(v.Val())\n}", "title": "" }, { "docid": "384c5625a5837b79d23d1ac80ba96853", "score": "0.6718462", "text": "func (c *Config) Float32(name string) float32 {\n\treturn c.Group(\"\").Float32(name)\n}", "title": "" }, { "docid": "01bf8c532ecf238ee9930d440ec1cd50", "score": "0.66985995", "text": "func Float32(v *float32) float32 {\n\tif v != nil {\n\t\treturn *v\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "c7f05c46bfb0737cb473656bc95584ec", "score": "0.6696474", "text": "func Float32FromBytes(bytes []byte) float32 {\n\tbits := binary.BigEndian.Uint32(bytes)\n\tfloat := math.Float32frombits(bits)\n\treturn float\n}", "title": "" }, { "docid": "1f416f45d6a94b00aaff51b5a6bbd258", "score": "0.6693052", "text": "func Float32(v float32) *float32 {\n\treturn &v\n}", "title": "" }, { "docid": "1f416f45d6a94b00aaff51b5a6bbd258", "score": "0.6693052", "text": "func Float32(v float32) *float32 {\n\treturn &v\n}", "title": "" }, { "docid": "50c2b448cbc0f3d69f4defb381b7a139", "score": "0.6690262", "text": "func Float32(val float32) *float32 {\n\treturn &val\n}", "title": "" }, { "docid": "eab7de82789ee9dc491a643fc09208ce", "score": "0.66813236", "text": "func ReadFloat(byteArray []byte) ([]byte, float32) {\n\tfloatBytes := byteArray[BeginningOfArray:SizeOfFloat]\n\tremainArray := byteArray[SizeOfFloat:]\n\tresultingFloat := math.Float32frombits(binary.LittleEndian.Uint32(floatBytes))\n\treturn remainArray, resultingFloat\n}", "title": "" }, { "docid": "cb2856b99cff295b19006c38e516bdc1", "score": "0.6679419", "text": "func NewFloat32(f float32) *Float32 {\n\tv := Float32(f)\n\treturn &v\n}", "title": "" }, { "docid": "00882c6cfebd9274bf3a5ed4bc64b925", "score": "0.666942", "text": "func (out *Output) Float32() (float32, bool, error) {\n\tv, known, err := out.Value()\n\tif err != nil || !known {\n\t\treturn 0, known, err\n\t}\n\treturn cast.ToFloat32(v), true, nil\n}", "title": "" }, { "docid": "f76a30142d8ea0f84b837b4d7a7e3e95", "score": "0.66616935", "text": "func Float32(vs url.Values, k string, is ...int) float32 {\n\tf, _ := strconv.ParseFloat(get(vs, k, is), 32)\n\treturn float32(f)\n}", "title": "" }, { "docid": "1da101091332f923e8ac1c7edeb25634", "score": "0.6635481", "text": "func (f StrTo) Float32() (float32, error) {\n\tv, err := strconv.ParseFloat(f.String(), 32)\n\treturn float32(v), err\n}", "title": "" }, { "docid": "43a1921f6f8046edc9098596227200f1", "score": "0.6635137", "text": "func ReadFloatFrom(data []byte) (Argument, int64, error) {\n\tvar f Float\n\tif err := binary.Read(bytes.NewReader(data), byteOrder, &f); err != nil {\n\t\treturn nil, 0, errors.Wrap(err, \"read float argument\")\n\t}\n\treturn f, 4, nil\n}", "title": "" }, { "docid": "8fe33c92fc2460577d98a95d8bc93e2b", "score": "0.66296685", "text": "func NewFloat32() *Float32 {\n\treturn &Float32{}\n}", "title": "" }, { "docid": "8875380bcd180fd565476b45153b530a", "score": "0.6613961", "text": "func Float32(macro Token, f float32) Value {\n\treturn Value{macro, \"\", math.Float64bits(float64(f)), typeFloat, nil}\n}", "title": "" }, { "docid": "48f9c86d2a2df596d708e3ba80254deb", "score": "0.6612523", "text": "func Float32(i1, i2 float32) float32 {\n\tif i1 == 0.0 {\n\t\treturn i2\n\t}\n\treturn i1\n}", "title": "" }, { "docid": "1b369a4c43218d2a700851d4358bbb9e", "score": "0.6605775", "text": "func NewFloat32(value ...float32) *Float32 {\n\tif len(value) > 0 {\n\t\treturn &Float32{\n\t\t\tvalue: math.Float32bits(value[0]),\n\t\t}\n\t}\n\treturn &Float32{}\n}", "title": "" }, { "docid": "84b03d4040e3ff34c20e60f427afa69e", "score": "0.66027033", "text": "func (r RNG) Float32() float32 {\n\treturn float32(r.Uint64()&(1<<24-1)) / (1 << 24)\n}", "title": "" }, { "docid": "8d4c6cba09d2721fe65cac2cc66ec4f5", "score": "0.65918356", "text": "func ConvertToFloat32(_ context.Context, data []string) (interface{}, error) {\n\torigin := data[0]\n\ttarget, err := strconv.ParseFloat(origin, 32)\n\tif err != nil {\n\t\treturn nil, xerrors.Wrapf(err, \"Cann't convert %s to type float32\", origin)\n\t}\n\treturn float32(target), nil\n}", "title": "" }, { "docid": "8f95834911925ef34d5048ab425fbd72", "score": "0.65833044", "text": "func (s *Session) Float32(key string) float32 {\n\ts.RLock()\n\tdefer s.RUnlock()\n\n\tv, ok := s.data[key]\n\tif !ok {\n\t\treturn 0\n\t}\n\n\tvalue, ok := v.(float32)\n\tif !ok {\n\t\treturn 0\n\t}\n\treturn value\n}", "title": "" }, { "docid": "4ff40692bcda1745f6f58e076ccad8c6", "score": "0.656989", "text": "func (d Dec32) Float32() float32 {\n\tcoeff, exp, ok := d.Decode()\n\tif !ok {\n\t\treturn float32(math.NaN())\n\t}\n\tvar expf float32\n\tif exp > 0 {\n\t\texpf = 10.0 * float32(exp)\n\t} else if exp < 0 {\n\t\texpf = 1.0 / (10.0 * float32(exp))\n\t} else {\n\t\treturn float32(coeff)\n\t}\n\treturn float32(coeff) * expf\n}", "title": "" }, { "docid": "118a87d2bba4f5bfdca3901728807a55", "score": "0.656486", "text": "func Float32(name string, value float32) Field {\n\treturn &field{\n\t\tvalueType: float32Field,\n\t\tname: name,\n\t\tvalue: value,\n\t}\n}", "title": "" }, { "docid": "32cb9c7fef8e68c05cc850ad3b11af0f", "score": "0.6555192", "text": "func (r *Reader) Float32s(vs *[]float32) {\n\tsize := r.Alloc()\n\tif size == 0 {\n\t\treturn\n\t}\n\ts := r.decFloat32s[:size]\n\t*vs = s\n\tr.decFloat32s = r.decFloat32s[size:]\n}", "title": "" }, { "docid": "23b36f1cc0f197ab48568c6af82b5c1d", "score": "0.65407705", "text": "func Float32(key string, val float32) zap.Field {\n\treturn zap.Float32(key, val)\n}", "title": "" }, { "docid": "ad73ab0a897a464c346d45481644a554", "score": "0.6525794", "text": "func NewFloat32(val float32) Float32 {\n\treturn Float32{\n\t\tvalue: &val,\n\t}\n}", "title": "" } ]
f10402b79166ad3dfbd10a713121e270
Read the DNA strand from file and store it into a slice.
[ { "docid": "fcd1154832e57bc99bcdeb5b88c4b758", "score": "0.5905833", "text": "func ReadFromFile(filename string) (patient []string, quality []string, seqName []string) {\n // Open the file.\n inFile, err := os.Open(filename)\n if err != nil {\n\t\tfmt.Println(\"Sorry: couldn't open the file!\")\n\t\tos.Exit(1)\n\t}\n\tdefer inFile.Close()\n // For every DNA stand line in the file,\n\tscanner := bufio.NewScanner(inFile)\n count := 0 // count the lines\n\tfor scanner.Scan() {\n\t\t// append it to the slice.\n count ++\n if count%4 == 2 { //sequence\n patient = append(patient, scanner.Text())\n }\n if count%4 == 0 { //quality\n quality = append(quality, scanner.Text())\n }\n if count%4 == 1 { //sequence name\n header := strings.Split(scanner.Text(), \" \")\n seqName = append(seqName, header[0])\n }\n\t}\n return patient, quality, seqName\n}", "title": "" } ]
[ { "docid": "1bc437b168add961980d12cdb40d9971", "score": "0.59664965", "text": "func ReadDNA(path string, format string, aligned bool) DNAPool {\n\tvar dna DNAPool\n\tswitch format {\n\tcase \"FASTA\":\n\t\tdna = Fasta(path)\n\t}\n\n\tif aligned {\n\t\tdna.Aligned = true\n\t}\n\n\treturn dna\n}", "title": "" }, { "docid": "038c3958f02f53b83781adf4a19ba446", "score": "0.54640824", "text": "func SpliceRna(filename string) (protein string) {\n\tdna, introns, err := readSplcInput(filename)\n\tif err != nil {\n\t\tpanic(\"failed to read input from \" + filename)\n\t}\n\tst := suffix_tree.ConstructSuffixTree(dna)\n\tintronOffsets := make(map[int]int)\n\tfor _, intron := range introns {\n\t\tfor pos := range suffix_tree.FindSubstrings(st, intron) {\n\t\t\tintronOffsets[pos] = len(intron)\n\t\t}\n\t}\n\texons := make([]rune, len(dna))\n\tintronEnd := 0\n\tinIntron := false\n\tl := 0\n\tfor i, r := range dna {\n\t\tif length, present := intronOffsets[i]; present && i+length >= intronEnd {\n\t\t\tintronEnd = length + i\n\t\t\tinIntron = true\n\t\t}\n\t\tif i >= intronEnd {\n\t\t\tinIntron = false\n\t\t}\n\t\tif !inIntron {\n\t\t\texons[l] = r\n\t\t\tl++\n\t\t}\n\t}\n\t//\tfmt.Printf(\"dna : %v\\n\", string(dna))\n\t//\tfmt.Printf(\"exons: %v\\n\", string(exons))\n\tretVal := EncodeProtein(TranscribeRna(string(exons)))\n\t//\tfmt.Printf(\"retVal: %v\\n\", string(retVal))\n\treturn retVal\n}", "title": "" }, { "docid": "303876a51caa8e116231c4dce51a3696", "score": "0.54515094", "text": "func ReadFileSlice(filename string, offset int, count int) (data []byte, cnt int) {\n file, _ := os.Open(filename)\n defer file.Close()\n _, err := file.Seek(int64(offset), 0) // from beginning of file\n if err != nil {\n log.Fatal(err)\n }\n data = make([]byte, count)\n cnt, err = file.Read(data)\n if err != nil {\n log.Fatal(err)\n }\n return\n}", "title": "" }, { "docid": "c08724ab31fa7ef1571c46067455457f", "score": "0.5380676", "text": "func section(filename string, offset uint64, len uint64) ([]byte, error) {\n fp, err := os.Open(filename)\n if err != nil {\n return nil, err\n }\n defer fp.Close()\n\n rv := make([]byte, len)\n n, err := fp.ReadAt(rv, int64(offset))\n if err != nil {\n return nil, err\n }\n if n != int(len) {\n return nil, fmt.Errorf(\"read too short? %d bytes instead of %d\", n, len)\n }\n\n return rv, nil\n}", "title": "" }, { "docid": "fc2c344cbb514e6c828442da7f4aee0d", "score": "0.5362539", "text": "func readDataFromFile(path string) (char_slice CharSlice, e error) {\n\tfile, err := os.Open(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer file.Close()\n\n\tchar_slice = make(CharSlice, 0)\n\tscanner := bufio.NewScanner(file)\n\tfor scanner.Scan() {\n\t\tchars := strings.Split(scanner.Text(), \" \")\n\t\tfor _, c := range chars {\n\t\t\tchar_slice = append(char_slice, c)\n\t\t}\n\t}\n\treturn char_slice, nil\n}", "title": "" }, { "docid": "9dac097693f3d83700112ded909aef11", "score": "0.52800024", "text": "func (p *parser) sliceFrom(start savepoint) []byte {\n\treturn p.data[start.position.offset:p.pt.position.offset]\n}", "title": "" }, { "docid": "9dac097693f3d83700112ded909aef11", "score": "0.52800024", "text": "func (p *parser) sliceFrom(start savepoint) []byte {\n\treturn p.data[start.position.offset:p.pt.position.offset]\n}", "title": "" }, { "docid": "9dac097693f3d83700112ded909aef11", "score": "0.52800024", "text": "func (p *parser) sliceFrom(start savepoint) []byte {\n\treturn p.data[start.position.offset:p.pt.position.offset]\n}", "title": "" }, { "docid": "9dac097693f3d83700112ded909aef11", "score": "0.52800024", "text": "func (p *parser) sliceFrom(start savepoint) []byte {\n\treturn p.data[start.position.offset:p.pt.position.offset]\n}", "title": "" }, { "docid": "9dac097693f3d83700112ded909aef11", "score": "0.52800024", "text": "func (p *parser) sliceFrom(start savepoint) []byte {\n\treturn p.data[start.position.offset:p.pt.position.offset]\n}", "title": "" }, { "docid": "9dac097693f3d83700112ded909aef11", "score": "0.52800024", "text": "func (p *parser) sliceFrom(start savepoint) []byte {\n\treturn p.data[start.position.offset:p.pt.position.offset]\n}", "title": "" }, { "docid": "9dac097693f3d83700112ded909aef11", "score": "0.52800024", "text": "func (p *parser) sliceFrom(start savepoint) []byte {\n\treturn p.data[start.position.offset:p.pt.position.offset]\n}", "title": "" }, { "docid": "9dac097693f3d83700112ded909aef11", "score": "0.52800024", "text": "func (p *parser) sliceFrom(start savepoint) []byte {\n\treturn p.data[start.position.offset:p.pt.position.offset]\n}", "title": "" }, { "docid": "8a32a739926b5e9b2a72a0c5e662cb5c", "score": "0.5278779", "text": "func readStrainBamFile(fileName string, gffMap map[string][]*gff.Record) (header *sam.Header, resultChan chan GeneSamRecords) {\n\theaderChan, samRecChan := readSamRecords(fileName)\n\theader = <-headerChan\n\tresultChan = make(chan GeneSamRecords)\n\tgo func() {\n\t\tdefer close(resultChan)\n\t\tvar currentRecord GeneSamRecords\n\t\tvar currentIdx int\n\t\tvar currentRef string\n\t\tfor read := range samRecChan {\n\t\t\t// skip if read quality is low.\n\t\t\tif !checkReadQuality(read) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// skip if read is not in the reference genomes.\n\t\t\tif _, found := gffMap[read.Ref.Name()]; !found {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// update current reference and current idx\n\t\t\tif currentRef != read.Ref.Name() {\n\t\t\t\tcurrentRef = read.Ref.Name()\n\t\t\t\tcurrentIdx = 0\n\t\t\t}\n\n\t\t\t// update current record.\n\t\t\tif currentRecord.End <= read.Pos {\n\t\t\t\tif currentRecord.Start < currentRecord.End && len(currentRecord.Records) > 0 {\n\t\t\t\t\tresultChan <- currentRecord\n\t\t\t\t}\n\t\t\t\trecords := gffMap[currentRef]\n\t\t\t\tfor currentIdx < len(records) && records[currentIdx].End <= read.Pos {\n\t\t\t\t\tcurrentIdx++\n\t\t\t\t}\n\t\t\t\tif currentIdx < len(records) {\n\t\t\t\t\trec := records[currentIdx]\n\t\t\t\t\tcurrentRecord = GeneSamRecords{Start: rec.Start - 1, End: rec.End, ID: rec.ID(), Strand: rec.Strand}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif read.Pos >= currentRecord.Start && read.Pos < currentRecord.End {\n\t\t\t\tcurrentRecord.Records = append(currentRecord.Records, read)\n\t\t\t}\n\t\t}\n\t\tif currentRecord.End > currentRecord.Start && len(currentRecord.Records) > 0 {\n\t\t\tresultChan <- currentRecord\n\t\t}\n\n\t}()\n\treturn\n}", "title": "" }, { "docid": "3b987ca5781e5672564212a8540cfc44", "score": "0.52450544", "text": "func readStrainBamFile(fileName string, gffMap map[string][]*gff.Record) (header *sam.Header, recordsChan chan GeneSamRecords) {\n\theaderChan, samRecChan := readSamRecords(fileName)\n\theader = <-headerChan\n\trecordsChan = make(chan GeneSamRecords)\n\tgo func() {\n\t\tdefer close(recordsChan)\n\n\t\tvar genes []GeneSamRecords\n\t\tcurrentReference := \"\"\n\t\tfor record := range samRecChan {\n\t\t\tif currentReference != record.Ref.Name() {\n\t\t\t\tgffRecords, found := gffMap[record.Ref.Name()]\n\t\t\t\tif !found {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tcurrentReference = record.Ref.Name()\n\t\t\t\tgenes = make([]GeneSamRecords, len(gffRecords))\n\t\t\t\tfor i := range gffRecords {\n\t\t\t\t\tgenes[i].Start = gffRecords[i].Start - 1\n\t\t\t\t\tgenes[i].End = gffRecords[i].End\n\t\t\t\t\tgenes[i].ID = gffRecords[i].ID()\n\t\t\t\t\tif gffRecords[i].Strand == gff.ReverseStrand {\n\t\t\t\t\t\tgenes[i].Strand = -1\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar maxIndex int\n\t\t\tfor i, gene := range genes {\n\t\t\t\tif isReadInGene(record, gene) {\n\t\t\t\t\tgenes[i].Records = append(genes[i].Records, record)\n\t\t\t\t} else {\n\t\t\t\t\tif record.Pos > gene.End {\n\t\t\t\t\t\tmaxIndex = i\n\t\t\t\t\t}\n\n\t\t\t\t\tif record.Pos+record.Len() < gene.Start {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor i := 0; i < maxIndex; i++ {\n\t\t\t\tif len(genes[i].Records) > 0 {\n\t\t\t\t\trecordsChan <- genes[i]\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tgenes = genes[maxIndex:]\n\t\t}\n\n\t\tfor i := 0; i < len(genes); i++ {\n\t\t\tif len(genes[i].Records) > 0 {\n\t\t\t\trecordsChan <- genes[i]\n\t\t\t}\n\t\t}\n\t}()\n\treturn\n}", "title": "" }, { "docid": "4f9f939ef5dea313728ec9c3c81bcd3c", "score": "0.51934195", "text": "func (b *Blocks) Slice(start_index int) *Blocks {\n sliced := FromBytes(b.ToBytes()[start_index:])\n sliced.SetBlockSize(b.BlockSize())\n return sliced\n}", "title": "" }, { "docid": "906b8fa82b7479211b72fd74483beb0c", "score": "0.51927173", "text": "func ReadShard(filename string) ([]SectorSlice, error) {\n\tf, err := os.Open(filename)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"could not open shard for reading\")\n\t}\n\tdefer f.Close()\n\tstat, err := f.Stat()\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"could not stat shard\")\n\t}\n\tslices := make([]SectorSlice, stat.Size()/SectorSliceSize)\n\tbf := bufio.NewReader(f)\n\tbuf := make([]byte, SectorSliceSize)\n\tfor i := range slices {\n\t\tif _, err := io.ReadFull(bf, buf); err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"could not read shard\")\n\t\t}\n\t\tcopy(slices[i].MerkleRoot[:], buf[:32])\n\t\tslices[i].SegmentIndex = binary.LittleEndian.Uint32(buf[32:36])\n\t\tslices[i].NumSegments = binary.LittleEndian.Uint32(buf[36:40])\n\t\tcopy(slices[i].Nonce[:], buf[40:64])\n\t}\n\treturn slices, nil\n}", "title": "" }, { "docid": "fdc9eecc8f04bf86000faab744a88b9a", "score": "0.5094595", "text": "func (f *File) ReadAt(b []byte, off int64) (n int, err error)", "title": "" }, { "docid": "66d5991883df6d6e960913cf1a026738", "score": "0.5006492", "text": "func Read(fname string, bytes []byte) (sw *LatLng, squareSize int, elevations []int16, err error) {\n\tif len(bytes) == 12967201*2 {\n\t\t// 1 arcsecond\n\t\tsquareSize = 3601\n\t} else if len(bytes) == 1442401*2 {\n\t\t// 3 arcseconds\n\t\tsquareSize = 1201\n\t} else {\n\t\treturn sw, squareSize, elevations, fmt.Errorf(\"hgt file cannot identified (only 1 arcsecond and 3 arcsecond supported, file size = %d)\", len(bytes))\n\t}\n\n\tsw, err = southWest(fname)\n\tif err != nil {\n\t\treturn sw, squareSize, elevations, errors.Wrap(err, \"could not get corner coordinates from file name\")\n\t}\n\n\televations = make([]int16, squareSize*squareSize)\n\n\t// Latitude\n\tfor row := 0; row < squareSize; row++ {\n\t\t// Longitude\n\t\tfor col := 0; col < squareSize; col++ {\n\t\t\tidx := row*squareSize + col\n\t\t\televations[idx] = int16(binary.BigEndian.Uint16(bytes[idx*2 : idx*2+2]))\n\t\t}\n\t}\n\n\treturn sw, squareSize, elevations, nil\n}", "title": "" }, { "docid": "e06cf273bdec47c20dcd9fb2379466b0", "score": "0.49569875", "text": "func (b *Buffer) readSlice(delim byte) (line []byte, err error) {\n\ti := bytes.IndexByte(b.buf[b.off:], delim)\n\tend := b.off + i + 1\n\tif i < 0 {\n\t\tend = len(b.buf)\n\t\terr = io.EOF\n\t}\n\tline = b.buf[b.off:end]\n\tb.off = end\n\treturn line, err\n}", "title": "" }, { "docid": "3e9be92aa5e9c3f959aa3b336f2e6f90", "score": "0.49174994", "text": "func (s *segment) ReadAt(p []byte, ofs int64) (n int, err error) {\n\tif s == nil {\n\t\treturn 0, io.EOF\n\t}\n\tlofs := ofs - s.off\n\tn = copy(p, s.data[int(lofs):])\n\treturn\n}", "title": "" }, { "docid": "7e21dff029f427ac833804332e548282", "score": "0.48707956", "text": "func readGenome(fileName string) *seq.Sequence {\n\tf, err := os.Open(fileName)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer f.Close()\n\n\treader := seq.NewFastaReader(f)\n\tsequences, err := reader.ReadAll()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn sequences[0]\n}", "title": "" }, { "docid": "6b5d40225fd9d80c35c08d9d3c96480b", "score": "0.48423392", "text": "func (this *ANSRangeDecoder) Read(block []byte) (int, error) {\n\tif block == nil {\n\t\treturn 0, errors.New(\"Invalid null block parameter\")\n\t}\n\n\tif len(block) == 0 {\n\t\treturn 0, nil\n\t}\n\n\tsizeChunk := this.chunkSize\n\tend := len(block)\n\tstartChunk := 0\n\n\tfor i := range this.symbols {\n\t\tthis.symbols[i] = decSymbol{}\n\t}\n\n\tpadding := sizeChunk >> 3\n\n\tif sizeChunk < 128 {\n\t\tpadding = 16\n\t}\n\n\t// Add some padding\n\tif len(this.buffer) < sizeChunk+padding {\n\t\tthis.buffer = make([]byte, sizeChunk+padding)\n\t}\n\n\tfor startChunk < end {\n\t\talphabetSize, err := this.decodeHeader(this.freqs)\n\n\t\tif err != nil || alphabetSize == 0 {\n\t\t\treturn startChunk, err\n\t\t}\n\n\t\tendChunk := startChunk + sizeChunk\n\n\t\tif endChunk >= end {\n\t\t\tendChunk = end\n\t\t\tsizeChunk = end - startChunk\n\t\t}\n\n\t\tthis.decodeChunk(block[startChunk:endChunk])\n\t\tstartChunk = endChunk\n\t}\n\n\treturn len(block), nil\n}", "title": "" }, { "docid": "81b65e1a44de40f3028e086fdb437dad", "score": "0.48005855", "text": "func (d *Deserializer) ReadSlice(n uint) ([]byte, error) {\n\tdecoded := make([]byte, n)\n\t_, err := d.buffer.Read(decoded)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn decoded, nil\n}", "title": "" }, { "docid": "dff7750f04350fbd0fcea1d635b7b465", "score": "0.47770414", "text": "func ReadSequenceND(path string) Sample {\n\tlines, err := ReadSequence1D(path)\n\tcheck(err)\n\n\tnRows := len(lines) // number of rows\n\n\t//Computing the number of columns\n\t//from the first, not empty row, later we will check\n\t//that all the rows have the same size.\n\tnCols := 0\n\tfor _, line := range lines {\n\t\tnFields := len(strings.Fields(line))\n\t\tif nFields != 0 {\n\t\t\tnCols = nFields\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif nCols == 0 {\n\t\tpanic(\"No data found\")\n\t}\n\n\tsequence := make([][]string, nRows)\n\n\tfor i, line := range lines {\n\t\tlineSlice := strings.Fields(line)\n\t\tif len(lineSlice) != nCols {\n\t\t\tpanic(\"The number or elemnts should be the same for each row\")\n\t\t}\n\n\t\trow := make([]string, nCols)\n\n\t\tfor j, value := range lineSlice {\n\t\t\trow[j] = value\n\t\t}\n\n\t\tsequence[i] = row\n\t}\n\n\treturn sequence\n}", "title": "" }, { "docid": "0334e09d811beae28cfae2cefb7b2273", "score": "0.4763774", "text": "func (b *buffer) ReadSlice() []byte {\n\treturn b.data[b.read:b.write]\n}", "title": "" }, { "docid": "68d548d43cd70322141700620e86045d", "score": "0.4728196", "text": "func (sh *shard) read(r read) error {\n\t_, err := sh.file.ReadAt(r.buf, sh.offset(r.slot))\n\treturn err\n}", "title": "" }, { "docid": "34eabe026ace7d0a4c8ebf855a764217", "score": "0.4716873", "text": "func ByteSlicesFromFile(fname string, decode func(line string) ([]byte, error)) (byteSlices [][]byte, err error) {\n\tabsPath, err := filepath.Abs(fname)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tfile, err := os.Open(absPath)\n\tdefer file.Close()\n\tif err != nil {\n\t\treturn\n\t}\n\n\tread := bufio.NewScanner(file)\n\n\tfor read.Scan() {\n\t\tlineBytes, err := decode(read.Text())\n\t\tif err != nil {\n\t\t\treturn byteSlices, err\n\t\t}\n\n\t\tbyteSlices = append(byteSlices, lineBytes)\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "3bfabad94c36e7b61f104fab71a911b5", "score": "0.47128934", "text": "func loadSNPs(path string) (snps SNPs, err error) {\n\tvar file *os.File\n\tif path == \"~/.dna/genome.txt\" {\n\t\tfile, err = os.Open(os.Getenv(\"HOME\") + \"/.dna/genome.txt\")\n\t} else {\n\t\tfile, err = os.Open(path)\n\t}\n\n\tcheck(err)\n\tdefer file.Close()\n\n\tsnps.snp = make(map[string]string)\n\n\t// TODO Check that the file matches 23andme format and raise error if needed\n\tscanner := bufio.NewScanner(file)\n\tfor scanner.Scan() {\n\t\tdata := strings.Split(scanner.Text(), \"\\t\")\n\t\t// comments in 23andme files begin with an #\n\t\t// so we'll skip those and just add lines with data to the map\n\t\tif !strings.HasPrefix(data[0], \"#\") {\n\t\t\tsnp := data[0]\n\t\t\tallele := data[3]\n\t\t\tsnps.snp[snp] = allele\n\t\t}\n\t}\n\tif err := scanner.Err(); err != nil {\n\t\treturn snps, err\n\t}\n\treturn snps, nil\n}", "title": "" }, { "docid": "29b27f101505dbea130d3fbffc9c9351", "score": "0.46850124", "text": "func readChromosome(file string) map[string]string {\n\tin, err := os.Open(file)\n\tif err != nil {\n\t\tfmt.Println(\"Error: couldn’t open the file\")\n\t\tos.Exit(3)\n\t}\n\tvar allChromosomes map[string]string\n\tallChromosomes = make(map[string]string)\n\tscanner := bufio.NewScanner(in)\n\tchromosome := \"\"\n\tkey := \"\"\n\tfor scanner.Scan() {\n\t\t// append it to the lines slice\n\t\tif strings.Contains(scanner.Text(), \">\") {\n\t\t\tallChromosomes[key] = chromosome\n\t\t\tkey = scanner.Text()[1:]\n\t\t\tchromosome = \"\"\n\t\t\tcontinue\n\t\t}\n\t\tchromosome += scanner.Text()\n\t}\n\tallChromosomes[key] = chromosome\n\tif scanner.Err() != nil {\n\t\tfmt.Println(\"Sorry: there was some kind of error during the file reading\")\n\t\tos.Exit(3)\n\t}\n\tin.Close()\n\tdelete(allChromosomes, \"\")\n\treturn allChromosomes\n}", "title": "" }, { "docid": "edd7f821b96e47bb138415636c55f8b7", "score": "0.4658372", "text": "func ReadSequence1D(path string) ([]string, error) {\n\tfile, err := os.Open(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer file.Close()\n\n\tvar sequence []string //sequence\n\tscanner := bufio.NewScanner(file)\n\tfor scanner.Scan() {\n\t\tsequence = append(sequence, scanner.Text())\n\t}\n\n\treturn sequence, scanner.Err()\n}", "title": "" }, { "docid": "419448caa6f629447b74445f80ed06ba", "score": "0.46504933", "text": "func (d *Disk) ReadAt(name string, p []byte, off int64) (int, error) {\n\tname = path.Join(d.Root, name)\n\n\t// nil or zero length payload\n\tif len(p) == 0 {\n\t\treturn 0, nil\n\t}\n\n\t// block size\n\tbsize := blockSize(name)\n\t// payload size\n\tpsize := bsize - crc32Len\n\n\tf, err := os.OpenFile(name, os.O_RDONLY, 0600)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tdefer f.Close()\n\n\tstIdx := off / psize\n\tstOff := off - stIdx*psize\n\t// how many bytes have been read\n\tread := 0\n\tfor {\n\t\tbuf := make([]byte, bsize-crc32Len)\n\t\tn, err := readBlock(f, buf, stIdx, bsize)\n\t\t// If the read starts with a non-aligend position,\n\t\t// only copy partial block\n\t\tcopied := copy(p, buf[stOff:n])\n\t\tstOff = 0\n\t\t// We just copied some data into p, shrink p\n\t\tp = p[copied:]\n\t\t// We want to exit the loop for 3 cases:\n\t\t// 1. There is an error reading block\n\t\t// 2. We read a partial block -- reach the end of the file\n\t\t// 3. We can't copy into p anymore -- p is filled up\n\t\tif err != nil || n < bsize-crc32Len || len(p) == 0 {\n\t\t\treturn read + copied, err\n\t\t}\n\t\tread += copied\n\t\tstIdx++\n\t}\n}", "title": "" }, { "docid": "1927286bdb7d03431e9ba77023371436", "score": "0.46444362", "text": "func (s *SRFileServer) Read(fileCode int64, start int64, size int64) (accessCode int32, err string) {\n\treturn s.fileMgr.GetReadCode(fileCode, start, size)\n}", "title": "" }, { "docid": "37ed7d9b3971567ca24b88b4563f8d03", "score": "0.46245146", "text": "func Read(in *bufio.Reader) (*World, error) {\n\tvar err error\n\tvar line string\n\tif line, err = readLine(in); err != nil {\n\t\treturn nil, err\n\t}\n\tvar width, height int\n\tif _, err = fmt.Sscanln(line, &width, &height); err != nil {\n\t\tfmt.Fprintln(os.Stderr, \"failed to scan\", line)\n\t\treturn nil, err\n\t}\n\n\tw := New(width, height)\n\n\tvar el, dp int\n\tvar ch rune\n\tvar repeat int\n\n\tfor i := range w.locs {\n\t\tif repeat > 0 {\n\t\t\tw.locs[i].Terrain = &Terrain[ch]\n\t\t\tw.locs[i].Elevation = el\n\t\t\tw.locs[i].Depth = dp\n\t\t\trepeat--\n\t\t\tcontinue\n\t\t}\n\n\t\tif line, err = readLine(in); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tr, _ := utf8.DecodeRuneInString(line)\n\t\tif unicode.IsDigit(r) {\n\t\t\trepeat, err = strconv.Atoi(line)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"Bad run-length encoding line=[%s]: %s\", line, err)\n\t\t\t}\n\t\t\tif line, err = readLine(in); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\trepeat-- // we are about to read and set the 1st occurrence\n\t\t}\n\n\t\tif _, err = fmt.Sscanf(line, \"%c %d %d\", &ch, &el, &dp); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Failed to scan line [%s]: %s\", line, err)\n\t\t}\n\t\tif el < 0 || el > MaxElevation {\n\t\t\treturn nil, fmt.Errorf(\"Location %d: elevation %d is out of bounds\", i, el)\n\t\t}\n\t\tif dp > el {\n\t\t\treturn nil, fmt.Errorf(\"Location %d: depth is greater than elevation\", i)\n\t\t}\n\t\tif int(ch) >= len(Terrain) || Terrain[ch].Char == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"Location %d: invalid terrain: %c\", i, ch)\n\t\t}\n\t\tw.locs[i].Terrain = &Terrain[ch]\n\t\tw.locs[i].Elevation = el\n\t\tw.locs[i].Depth = dp\n\t}\n\n\tif line, err = readLine(in); err != nil {\n\t\treturn nil, err\n\t}\n\t_, err = fmt.Sscanln(line, &w.X0, &w.Y0)\n\tif err != nil {\n\t\terr = fmt.Errorf(\"Failed to scan initial location [%s]: %s\", line, err)\n\t}\n\treturn w, err\n}", "title": "" }, { "docid": "e1cf19acc3884e443a459e1d54f96215", "score": "0.46207866", "text": "func ReadFile(file string) (sw *LatLng, squareSize int, elevations []int16, err error) {\n\tf, err := os.Open(file)\n\tif err != nil {\n\t\treturn sw, squareSize, elevations, err\n\t}\n\tdefer f.Close()\n\n\tif strings.HasSuffix(file, \".gz\") {\n\t\trdr, err := gzip.NewReader(f)\n\t\tif err != nil {\n\t\t\treturn sw, squareSize, elevations, err\n\t\t}\n\t\tdefer rdr.Close()\n\t\tbytes, err := ioutil.ReadAll(rdr)\n\t\tif err != nil {\n\t\t\treturn sw, squareSize, elevations, err\n\t\t}\n\t\treturn Read(file, bytes)\n\t}\n\tbytes, err := ioutil.ReadAll(f)\n\tif err != nil {\n\t\treturn sw, squareSize, elevations, err\n\t}\n\treturn Read(file, bytes)\n}", "title": "" }, { "docid": "48438fc3902cc81f724871dfe6cd2996", "score": "0.46193525", "text": "func (r *segmentReader) readSegment() error {\n\t// Read in the header and make sure it has the right prefix\n\tif _, err := io.ReadFull(r.r, r.header[:]); err != nil {\n\t\t// EOF reading a header is expected, return it as-is\n\t\tif err == io.EOF {\n\t\t\treturn io.EOF\n\t\t}\n\t\treturn fmt.Errorf(\"failed to read segment header: %v\", err)\n\t}\n\tif !bytes.Equal(r.header[0:4], segmentBytes) {\n\t\treturn errors.New(\"failed to match magic segment prefix\")\n\t}\n\toriginalSize := binary.LittleEndian.Uint32(r.header[4:8])\n\tcompressedSize := binary.LittleEndian.Uint32(r.header[8:12])\n\tr.buf = make([]byte, compressedSize)\n\tr.expected += uint64(originalSize)\n\tif _, err := io.ReadFull(r.r, r.buf); err != nil {\n\t\treturn fmt.Errorf(\"failed to read compressed segment: %v\", err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e04af0b419b9a6a3e5ff5dc17eda474a", "score": "0.46172145", "text": "func (f *bin) Read(r io.Reader, start, end int) (int, error) {\n\tdebug(\"Read: r %v, start %v end %v\", r, start, end)\n\td, err := ioutil.ReadAll(r)\n\tdebug(\"ReadAll returns %v, %v\", d, err)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\treturn f.Replace(d, start, end)\n}", "title": "" }, { "docid": "edda9866fa3972d35ce88004f41ae4fe", "score": "0.45826364", "text": "func newDeckFromFile(filename string) deck {\r\n\tbyteSlices, err := ioutil.ReadFile(filename)\r\n\tif err != nil {\r\n\t\tfmt.Println(\"Error:\", err)\r\n\t\tos.Exit(1)\r\n\t}\r\n\tstringSlices := strings.Split(string(byteSlices), \", \")\r\n\treturn deck(stringSlices)\r\n}", "title": "" }, { "docid": "dabd4ff8bc1e62145e7f8954e3e95a21", "score": "0.45803124", "text": "func ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}", "title": "" }, { "docid": "dabd4ff8bc1e62145e7f8954e3e95a21", "score": "0.45803124", "text": "func ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}", "title": "" }, { "docid": "f7a8fd971e8ea0e8a2a77a904eee58c2", "score": "0.45677906", "text": "func (a *arena) read(offset, length uint32) []byte {\n\th := reflect.SliceHeader{\n\t\tData: a.h.Data + uintptr(offset),\n\t\tLen: int(length),\n\t\tCap: int(length),\n\t}\n\treturn cbyte.Bytes(h)\n}", "title": "" }, { "docid": "5abc4235578c5e210de554bd4649ecf6", "score": "0.4551567", "text": "func (r *Reader) ReadSlice(delim byte) (data []byte, err error) {\n\tif r.err != nil {\n\t\treturn nil, r.err\n\t}\n\tidx := bytes.IndexByte(r.b.buf[r.b.r:r.b.w], delim)\n\tif idx == -1 {\n\t\tdata = nil\n\t\terr = ErrBufferFull\n\t\treturn\n\t}\n\tdata = r.b.buf[r.b.r : r.b.r+idx+1]\n\tr.b.r += idx + 1\n\treturn\n}", "title": "" }, { "docid": "317500ea95e10dc8ff73614f3a7353d1", "score": "0.4550451", "text": "func Slice(baseFilename string, xRes, yRes, zRes float32, slicer Slicer) error {\n\tfor materialNum := 1; materialNum <= slicer.NumMaterials(); materialNum++ {\n\t\tmaterialName := strings.ReplaceAll(slicer.MaterialName(materialNum), \" \", \"-\")\n\n\t\tdlpName := fmt.Sprintf(\"%v-mat%02d-%v.cbddlp\", baseFilename, materialNum, materialName)\n\n\t\tw, err := os.Create(dlpName)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Create: %v\", err)\n\t\t}\n\n\t\tmin, max := slicer.MBB()\n\t\tlog.Printf(\"MBB=(%v,%v,%v)-(%v,%v,%v)\", min[0], min[1], min[2], max[0], max[1], max[2])\n\n\t\tif err := slicer.PrepareRenderZ(); err != nil {\n\t\t\treturn fmt.Errorf(\"PrepareRenderZ: %v\", err)\n\t\t}\n\n\t\td := &dlp{w: w, numSlices: slicer.NumZSlices(), xRes: xRes, yRes: yRes, zRes: zRes}\n\t\tif err := slicer.RenderZSlices(materialNum, d, irmf.MinToMax); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Go back and write all the image offset data.\n\t\tif _, err := w.Seek(d.layerHeaderOffset0, io.SeekStart); err != nil {\n\t\t\treturn fmt.Errorf(\"seek: %v\", err)\n\t\t}\n\t\tif err := binary.Write(w, binary.LittleEndian, d.layerHeaders); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif err := w.Close(); err != nil {\n\t\t\treturn fmt.Errorf(\"Unable to close file: %v\", err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3cbdc899336c26551172235bc1bc1e64", "score": "0.45469704", "text": "func Read(fileName string, len int) {\n\n\tfile, err := os.Open(fileName)\n\tcheckError(err)\n\tdefer file.Close()\n\n\tbyteSlice := make([]byte, len)\n\tbytesRead, err := file.Read(byteSlice)\n\tcheckError(err)\n\n\tlog.Println(byteSlice[:len])\n\tlog.Println(bytesRead)\n}", "title": "" }, { "docid": "7a943e07b8a971393929484eaee47771", "score": "0.45438823", "text": "func readFile(name string) []city {\n\tvar dim, i int\n\tvar cities []city\n\ti, dim = 1, 0\n\tvar startFlag bool\n\tstartFlag = false\n\tif file, err := os.Open(name); err == nil {\n\t\t// make sure it gets closed\n\t\tdefer file.Close()\n\t\tscanner := bufio.NewScanner(file)\n\t\tfor scanner.Scan() {\n\t\t\tstr := scanner.Text()\n\t\t\tif strings.Contains(str, \"DIMENSION\") {\n\t\t\t\tdim = getDim(str)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tcities = make([]city, dim)\n\t\tfor scanner.Scan() {\n\t\t\tstr := scanner.Text()\n\t\t\tif strings.Contains(str, \"EOF\") {\n\t\t\t\tbreak\n\t\t\t} else if startFlag {\n\t\t\t\tx, y := tokenize(str)\n\t\t\t\tif i <= dim {\n\t\t\t\t\tcities[i-1] = city{x, y}\n\t\t\t\t\ti++\n\t\t\t\t} else {\n\t\t\t\t\tstartFlag = false\n\t\t\t\t}\n\t\t\t} else if strings.Contains(str, \"NODE_COORD_SECTION\") {\n\t\t\t\tstartFlag = true\n\t\t\t}\n\t\t}\n\t\t// check for errors\n\t\tif err = scanner.Err(); err != nil {\n\t\t\tprintError(err)\n\t\t}\n\t} else {\n\t\tprintError(err)\n\t}\n\treturn cities\n}", "title": "" }, { "docid": "4256f586233ef1b39f4a0d463dfd4187", "score": "0.45426524", "text": "func (s *sensorDirect) ReadAt(b []byte, offset int64) (int, error) {\n\tif len(b) == 0 {\n\t\treturn 0, nil\n\t}\n\td := s.String()\n\tif offset >= int64(len(d)) {\n\t\treturn 0, io.EOF\n\t}\n\tn := copy(b, d[offset:])\n\tif n <= len(b) {\n\t\treturn n, io.EOF\n\t}\n\treturn n, nil\n}", "title": "" }, { "docid": "5448f4c6259c942ff58105f787119247", "score": "0.4534241", "text": "func ReadGeneFromFile(filename string) string {\n\tfile, err := os.Open(filename)\n\tif err != nil {\n\t\tfmt.Println(\"Error: couldn't open the file\")\n\t\tos.Exit(1)\n\t}\n\tdefer file.Close()\n\n\tgene := \"\"\n\tscanner := bufio.NewScanner(file)\n\t//skip first line and move to the next token\n\tscanner.Scan()\n\t//read line by line\n\tfor scanner.Scan() {\n\t\tcurrentLine := scanner.Text()\n\t\tgene += currentLine\n\t}\n\treturn gene\n}", "title": "" }, { "docid": "2c0015716ec9c3893f7b9780d01ab7b2", "score": "0.45006302", "text": "func (o *shmi) readAt(p []byte, off int64) (n int, err error) {\n\tif off >= int64(o.size) {\n\t\treturn 0, io.EOF\n\t}\n\tif max := int64(o.size) - off; int64(len(p)) > max {\n\t\tp = p[:max]\n\t}\n\treturn copyPtr2Slice(o.v, p, off, o.size), nil\n}", "title": "" }, { "docid": "a9b6376d74209a5e08122190bf8dfaeb", "score": "0.44921973", "text": "func (ar *Archive) ReadAt(p []byte, off int64) (int, error) {\n\treturn ar.parts.ReadAtContext(context.TODO(), p, off)\n}", "title": "" }, { "docid": "63f8de9686902de52ca55af54922949b", "score": "0.44920814", "text": "func readStr(r io.Reader, off0 int) (s string, off int, err error) {\n\tvar sz uint64\n\tsz, off, err = readVal(r, off0)\n\tif err != nil || sz == 0 {\n\t\treturn \"\", off, err\n\t}\n\tif sz > 1e6 {\n\t\treturn \"\", off, fmt.Errorf(\"string at offset %d is too large (len=%d)\", off, sz)\n\t}\n\tbuf := make([]byte, sz)\n\tn, err := io.ReadFull(r, buf)\n\tif err != nil || sz != uint64(n) {\n\t\treturn \"\", off + n, fmt.Errorf(\"failed to read trace at offset %d: read %v, want %v, error %v\", off, n, sz, err)\n\t}\n\treturn string(buf), off + n, nil\n}", "title": "" }, { "docid": "85f053245d9695386b76e5963e6b3beb", "score": "0.44918197", "text": "func reader ( filename string ) []string {\n var i int = 0\n temp := make( []string, MAX_LINES )\n\n f, err := os.Open(filename)\n if err != nil { log.Fatal(err) }\n defer f.Close()\n s := bufio.NewScanner(f)\n for s.Scan() {\n temp[i] = s.Text()\n i++\n }\n if err := s.Err(); err != nil { log.Fatal(err) }\n\n // https://blog.golang.org/go-slices-usage-and-internals\n registry := make( []string, i ) // allocate final array now that Nrooms is known\n copy( registry, temp ) // GC should find temp soon enough\n return registry\n}", "title": "" }, { "docid": "6d4236ee52b7bc042dd4c4e77900eab1", "score": "0.44903144", "text": "func (f *FileBackend) Slice(line1, col, line2, col2 int) *core.Slice {\n\tf.lock.Lock()\n\tdefer f.lock.Unlock()\n\tslice := core.NewSlice(line1, col, line2, col2, [][]rune{})\n\ttext := slice.Text()\n\tif line1 < 0 || col < 0 {\n\t\treturn slice\n\t}\n\tl := slice.R1\n\tfor ; slice.R2 == -1 || l <= slice.R2; l++ {\n\t\terr := f.seek(l, slice.C1)\n\t\tif err != nil {\n\t\t\tif err != io.EOF {\n\t\t\t\tcore.Ed.SetStatusErr(err.Error())\n\t\t\t\treturn slice\n\t\t\t}\n\t\t}\n\t\tln := []rune{}\n\t\tfor slice.C2 == -1 || f.col <= slice.C2 {\n\t\t\trune, _, err := f.readRune()\n\t\t\tif err != nil {\n\t\t\t\tif err == io.EOF && len(ln) > 0 {\n\t\t\t\t\t*text = append(*text, ln)\n\t\t\t\t}\n\t\t\t\treturn slice\n\t\t\t}\n\t\t\tif rune == '\\n' {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tln = append(ln, rune)\n\t\t}\n\t\t*text = append(*text, ln)\n\t}\n\treturn slice\n}", "title": "" }, { "docid": "b2fa2c2eb348ce781b21e880df3df21a", "score": "0.44835618", "text": "func (bf *BillyFile) ReadAt(buf []byte, offset int64) (n int, err error) {\n\treturn bf.contents.ReadAt(buf, offset)\n}", "title": "" }, { "docid": "e01ff256c019850c68eb733657445577", "score": "0.44814754", "text": "func TestSegmentReader_Read(t *testing.T) {\n\n\tpath := t.TempDir()\n\tname := buildSegmentName(0, 0, 0)\n\tconfig := DefaultConfig\n\tbufferSize := 1 << 10\n\n\ttestSegment_Write(t, path, true, 8, 256, 1<<10)\n\n\tsr, err := newSegmentReader(path, name, config, bufferSize)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer sr.Close()\n\n\tvar r Record\n\n\terr = sr.Fill()\n\tif err != nil {\n\t\tt.Fatalf(\"fill failed with error = %s\", err)\n\t}\n\n\tn, err := sr.Read(&r)\n\n\tif err != nil {\n\t\tt.Fatalf(\"read failed with error = %s\", err)\n\t}\n\n\tif n != 264 {\n\t\tt.Fatalf(\"read should have read 264 bytes but got %d\", n)\n\t}\n}", "title": "" }, { "docid": "9190ac09da3ec4ea16f0640c4817db1e", "score": "0.4473043", "text": "func slice3() {\n b:= []byte{'g', 'o', 'l', 'a', 'n', 'g'}\n fmt.Println(b[1:4])\n fmt.Println(b[:2])\n fmt.Println(b[2:])\n fmt.Println(b[:])\n}", "title": "" }, { "docid": "5d33d15935fc579335d1110f5ecde9db", "score": "0.44725934", "text": "func (str *Reader) Read() {\n\tnumEntries := int(str.r.ReadULEB128())\n\tstr.strs = make([]string, 0, numEntries)\n\tfor idx := 0; idx < numEntries; idx++ {\n\t\tslen := str.r.ReadULEB128()\n\t\tstr.strs = append(str.strs, str.r.ReadString(int64(slen)))\n\t}\n}", "title": "" }, { "docid": "fb7a69cdd93685c83d84db89c14fb31e", "score": "0.44686717", "text": "func readMappingsFromFile(file string) (m []byte, err error) {\n\tbaseFileName := strings.Replace(strings.Replace(file, \".gz\", \"\", 1), \".json\", \"\", 1)\n\tf := baseFileName + \"-mapping.json\"\n\tif _, e := os.Stat(f); os.IsNotExist(e) {\n\t\treturn nil, fmt.Errorf(\"mappings file does not exist: %s\", f)\n\t}\n\tr, err := os.Open(f)\n\tif err == nil {\n\t\tm, err = ioutil.ReadAll(r)\n\t}\n\tdefer r.Close()\n\treturn\n}", "title": "" }, { "docid": "39c92be1e3b8db119ac2d6d4f8c4daa3", "score": "0.44618306", "text": "func (consumer *Consumer) ReadAt(b []byte,\n\toff int64,\n\tfilepath string,\n) (n int, e error) {\n\tlog.Debug(\"Read@\", off, \" \", len(b), \" bytes from: \", filepath)\n\n\tvar npkts = 0\n\n\tfor byteOffsetV := (off / namespace.MaxPayloadSize) * namespace.MaxPayloadSize;\n\t\tbyteOffsetV < off+int64(len(b)); byteOffsetV += namespace.MaxPayloadSize {\n\n\t\tname := ndn.ParseName(namespace.NamePrefixUriFileRead + filepath)\n\t\tname = append(\n\t\t\tname,\n\t\t\tndn.NameComponent{Element: tlv.MakeElementNNI(an.TtByteOffsetNameComponent, byteOffsetV)},\n\t\t)\n\n\t\tconsumer.pipeline.Send() <- ndn.MakeInterest(name, namespace.DefaultInterestLifetime)\n\t\tnpkts++\n\t}\n\n\tfor i := 0; i < npkts; i++ {\n\t\tselect {\n\t\tcase data := <-consumer.pipeline.Get():\n\t\t\tif len(data.Content) == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif data.ContentType == an.ContentNack {\n\t\t\t\treturn n, utils.ReadApplicationLevelNackContent(data)\n\t\t\t}\n\n\t\t\tbyteOffsetV, e := utils.ReadNNI(data.Name.Get(-1).Value)\n\t\t\tif e != nil {\n\t\t\t\treturn n, e\n\t\t\t}\n\n\t\t\tif int64(byteOffsetV) < off { // Trim first segment\n\t\t\t\tn += copy(b, data.Content[off-int64(byteOffsetV):])\n\t\t\t} else {\n\t\t\t\tn += copy(b[int64(byteOffsetV)-off:], data.Content)\n\t\t\t}\n\n\t\tcase e = <-consumer.pipeline.Error():\n\t\t\treturn n, e\n\t\t}\n\t}\n\n\treturn n, nil\n}", "title": "" }, { "docid": "abc70fce1ffd7a2268d1770e935b6cbd", "score": "0.44615716", "text": "func Read(filename string) (map[geom.Vec2]rune, error) {\n\tlines, err := util.ReadLines(filename)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn Parse(lines), nil\n}", "title": "" }, { "docid": "196e7b9e09e74f4cb8d24458b236d520", "score": "0.44598976", "text": "func readPanGenomeBamFile(fileName string) (header *sam.Header, recordsChan chan GeneSamRecords) {\n\theaderChan, samRecChan := readSamRecords(fileName)\n\theader = <-headerChan\n\trecordsChan = make(chan GeneSamRecords)\n\tgo func() {\n\t\tdefer close(recordsChan)\n\t\tcurrentRefID := \"\"\n\t\tvar records []*sam.Record\n\t\tfor rec := range samRecChan {\n\t\t\tif currentRefID == \"\" {\n\t\t\t\tcurrentRefID = rec.Ref.Name()\n\t\t\t}\n\t\t\tif rec.Ref.Name() != currentRefID {\n\t\t\t\tif len(records) > 0 {\n\t\t\t\t\trecordsChan <- GeneSamRecords{Start: 0, Records: records, End: records[0].Ref.Len(), ID: currentRefID}\n\t\t\t\t\trecords = []*sam.Record{}\n\t\t\t\t}\n\t\t\t\tcurrentRefID = rec.Ref.Name()\n\t\t\t}\n\t\t\trecords = append(records, rec)\n\t\t}\n\t\tif len(records) > 0 {\n\t\t\trecordsChan <- GeneSamRecords{Start: 0, Records: records, End: records[0].Ref.Len()}\n\t\t}\n\t}()\n\n\treturn\n}", "title": "" }, { "docid": "196e7b9e09e74f4cb8d24458b236d520", "score": "0.44598976", "text": "func readPanGenomeBamFile(fileName string) (header *sam.Header, recordsChan chan GeneSamRecords) {\n\theaderChan, samRecChan := readSamRecords(fileName)\n\theader = <-headerChan\n\trecordsChan = make(chan GeneSamRecords)\n\tgo func() {\n\t\tdefer close(recordsChan)\n\t\tcurrentRefID := \"\"\n\t\tvar records []*sam.Record\n\t\tfor rec := range samRecChan {\n\t\t\tif currentRefID == \"\" {\n\t\t\t\tcurrentRefID = rec.Ref.Name()\n\t\t\t}\n\t\t\tif rec.Ref.Name() != currentRefID {\n\t\t\t\tif len(records) > 0 {\n\t\t\t\t\trecordsChan <- GeneSamRecords{Start: 0, Records: records, End: records[0].Ref.Len(), ID: currentRefID}\n\t\t\t\t\trecords = []*sam.Record{}\n\t\t\t\t}\n\t\t\t\tcurrentRefID = rec.Ref.Name()\n\t\t\t}\n\t\t\trecords = append(records, rec)\n\t\t}\n\t\tif len(records) > 0 {\n\t\t\trecordsChan <- GeneSamRecords{Start: 0, Records: records, End: records[0].Ref.Len()}\n\t\t}\n\t}()\n\n\treturn\n}", "title": "" }, { "docid": "ddc8ea8231e6a23c15a748676269b7ed", "score": "0.44596958", "text": "func (file offsetFile) ReadAt(data []byte, at int64) (amount int, err error) {\n\treturn file.file.ReadAt(data, file.offset+at)\n}", "title": "" }, { "docid": "950f47c9cb75c200b1032f7c7f96aca8", "score": "0.44556448", "text": "func (s *sensorBinData) ReadAt(b []byte, offset int64) (int, error) {\n\tif len(b) == 0 {\n\t\treturn 0, nil\n\t}\n\td := s.String()\n\tif offset >= int64(len(d)) {\n\t\treturn 0, io.EOF\n\t}\n\tn := copy(b, d[offset:])\n\tif n <= len(b) {\n\t\treturn n, io.EOF\n\t}\n\treturn n, nil\n}", "title": "" }, { "docid": "10ef478c4c5a84c1f5d8bac30fa136b1", "score": "0.4451176", "text": "func readIndex(r rdi) (*Index, string, int) {\n\tb := r.bamPath\n\n\tif strings.HasSuffix(b, \".crai\") {\n\t\tf, err := os.Open(b)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tgz, err := gzip.NewReader(f)\n\t\tif err != nil {\n\t\t\tlog.Printf(\"error from index: %s\", b)\n\t\t\tpanic(err)\n\t\t}\n\t\tcr, err := crai.ReadIndex(gz)\n\t\tif err != nil {\n\t\t\tlog.Printf(\"error from index: %s\", b)\n\t\t\tpanic(err)\n\t\t}\n\t\tidx := &Index{crai: cr, path: b}\n\t\tidx.init()\n\t\tnm, err := GetShortName(b, true)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\treturn idx, nm, r.i\n\t}\n\n\tsuf := \".bai\"\n\tif strings.HasSuffix(b, \".bai\") {\n\t\tsuf = \"\"\n\t}\n if strings.HasSuffix(b, \".cram\") {\n log.Printf(\"WARNING: when using CRAM files, send the crai indexes to indexcov, not the alignment files\")\n }\n\trdr, err := os.Open(b + suf)\n\tif err != nil {\n\t\tvar terr error\n\t\trdr, terr = os.Open(b[:(len(b)-4)] + suf)\n\t\tif terr != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n\n\tdx, err := bam.ReadIndex(bufio.NewReader(rdr))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tidx := &Index{Index: dx, path: b}\n\tidx.init()\n\tnm, err := GetShortName(b, strings.HasSuffix(b, \".bai\"))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn idx, nm, r.i\n}", "title": "" }, { "docid": "cb828004b96dd4ba1daeb6f54ab42df1", "score": "0.44479987", "text": "func readOrbitMap(filePath string) map[string]string {\n\torbitMap := map[string]string{}\n\n\tfile, err := os.Open(filePath)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer file.Close()\n\n\tscanner := bufio.NewScanner(file)\n\tfor scanner.Scan() {\n\t\torbitPairText := scanner.Text()\n\t\torbitPair := strings.Split(orbitPairText, \")\")\n\t\torbitMap[orbitPair[1]] = orbitPair[0]\n\t}\n\n\tif err := scanner.Err(); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\treturn orbitMap\n}", "title": "" }, { "docid": "59c6256830da7d39c879f803574f8544", "score": "0.44444185", "text": "func (f *File) ReadString(delim byte) (line string, err error) {\n\tslice, err := f.readSlice(delim)\n\treturn string(slice), err\n}", "title": "" }, { "docid": "01f2d6b619a61e50693a9ddcaba26799", "score": "0.4443235", "text": "func (b *Reader) ReadSlice(delim byte) ([]byte, error) {\n\tif b.err != nil {\n\t\treturn nil, b.err\n\t}\n\tfor {\n\t\tvar index = bytes.IndexByte(b.buf[b.r:b.w], delim)\n\t\tif index >= 0 {\n\t\t\tlimit := b.r + index + 1\n\t\t\tslice := b.buf[b.r:limit]\n\t\t\tb.r = limit\n\t\t\treturn slice, nil\n\t\t}\n\t\tif b.buffered() == len(b.buf) {\n\t\t\tb.r = b.w\n\t\t\treturn b.buf, bufio.ErrBufferFull\n\t\t}\n\t\tif b.fill() != nil {\n\t\t\treturn nil, b.err\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6d0ea44f7a89ea4f1b2c74cdbc8f5666", "score": "0.4442165", "text": "func (i *InMemoryClient) Read(s string) ([]byte, error) {\n\tind, err := i.findInSlice(s)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn i.contents[ind].byteArray, nil\n}", "title": "" }, { "docid": "0d34fce4216eceba3c3061943e0d6d5a", "score": "0.44307503", "text": "func (f *Faidx) SubSeqNotCleaned(chr string, start int, end int) ([]byte, error) {\n\tindex, ok := f.Index[chr]\n\tif !ok {\n\t\treturn nil, ErrSeqNotExists\n\t}\n\n\tif index.Length == 0 {\n\t\treturn []byte{}, nil\n\t}\n\n\tstart, end, ok = SubLocation(index.Length, start, end)\n\tif !ok {\n\t\treturn []byte{}, nil\n\t}\n\n\tpstart := position(index, start-1)\n\tpend := position(index, end)\n\tif MapWholeFile {\n\t\tif pend > int64(len(f.mmap)) { // for truncated file\n\t\t\tpend = int64(len(f.mmap))\n\t\t}\n\t\treturn f.mmap[pstart:pend], nil\n\t}\n\n\tdata := make([]byte, pend-pstart)\n\tn, err := f.reader.ReadAt(data, pstart)\n\tif err != nil {\n\t\tif err == io.EOF { // for truncated file\n\t\t\treturn data[0:n], nil\n\t\t}\n\t\treturn nil, err\n\t}\n\treturn data, nil\n}", "title": "" }, { "docid": "e870e9bdc99d3d559d88d8a810f1fc04", "score": "0.44281518", "text": "func (ds *DockerSecrets) read(file string) error {\n\tbuf, err := ioutil.ReadFile(ds.GetDir() + \"/\" + file)\n\tif err != nil {\n\t\treturn err\n\t}\n\tds.secrets[file] = string(buf)\n\treturn nil\n}", "title": "" }, { "docid": "1c8c6948c214068f077b216892f3db21", "score": "0.4423429", "text": "func (f *FakeFile) ReadAt(p []byte, offset int64) (n int, err error) {\n\tif len(p) == 0 {\n\t\treturn 0, nil\n\t}\n\tif f.offset >= f.size {\n\t\treturn 0, io.EOF\n\t}\n\tbuf, err := f.read(int(offset), len(p))\n\tif err != nil {\n\t\treturn\n\t}\n\tn = copy(p, buf)\n\treturn\n}", "title": "" }, { "docid": "80ec3d29476dfdffe3c46f9b7d690caa", "score": "0.44223234", "text": "func (s *store) ReadAt(b []byte, pos int64) (int, error) {\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\tif err := s.buf.Flush(); err != nil {\n\t\treturn 0, err\n\t}\n\treturn s.File.ReadAt(b, pos)\n}", "title": "" }, { "docid": "ae7a5bd1cb4e0ed62b1bfbd15b7fea02", "score": "0.4421083", "text": "func ReadSmat(fn string) *Triplet {\n\tvar t Triplet\n\tio.ReadLines(fn,\n\t\tfunc(idx int, line string) (stop bool) {\n\t\t\tr := strings.Fields(line)\n\t\t\tif idx == 0 {\n\t\t\t\tm, n, nnz := io.Atoi(r[0]), io.Atoi(r[1]), io.Atoi(r[2])\n\t\t\t\tt.Init(m, n, nnz)\n\t\t\t} else {\n\t\t\t\tt.Put(io.Atoi(r[0]), io.Atoi(r[1]), io.Atof(r[2]))\n\t\t\t}\n\t\t\treturn\n\t\t})\n\treturn &t\n}", "title": "" }, { "docid": "74ca151caa130aa6cbf38746e8973ed6", "score": "0.44187742", "text": "func (s *Store) readAt(segment int, position int64) (*pb.Entry, error) {\n\t// make sure the segment is valid\n\tif segment > len(s.segments) {\n\t\treturn nil, fmt.Errorf(\"segment %v does not exist\", segment)\n\t}\n\n\t// lookup the entry by its physical offset in the correct segment.\n\treturn s.segments[segment].readAt(position)\n}", "title": "" }, { "docid": "7627a18d71104498069f54168cdc0d19", "score": "0.44176427", "text": "func (s *stream) Slice(start, count int) Stream {\n\treturn s.Skip(start).Limit(count)\n}", "title": "" }, { "docid": "07466464980c30bc0b04dc06be69d99d", "score": "0.44057518", "text": "func ReadBannerFromFile(fileName string, banners []structures.Banner) {\r\n\tfile, err := ioutil.ReadFile(fileName)\r\n\tchecks.CheckFile(err)\r\n\ttext := converters.TranslateToRuneSlice(file)\r\n\r\n\tvar charCounterInTheRow int = 1\r\n\tfor i := 0; i < len(text); i++ {\r\n\t\tif text[i] != 10 {\r\n\t\t\tcharCounterInTheRow++\r\n\t\t} else {\r\n\t\t\tbreak\r\n\t\t}\r\n\t}\r\n\r\n\tvar symbolFound bool = false\r\n\tvar resultString string\r\n\tvar saveIndex int = 0\r\n\tvar startIndex int = 0\r\n\r\n\tfor i := 0; i < len(banners); i++ {\r\n\t\tsymbolFound = false\r\n\t\tfor k := 0; k < len(banners[i].AsciiSymbol[0]); k++ {\r\n\t\t\tif text[k+startIndex] == banners[i].AsciiSymbol[0][k] && text[k+startIndex+charCounterInTheRow] == banners[i].AsciiSymbol[1][k] &&\r\n\t\t\t\ttext[k+startIndex+charCounterInTheRow*2] == banners[i].AsciiSymbol[2][k] && text[k+startIndex+charCounterInTheRow*3] == banners[i].AsciiSymbol[3][k] &&\r\n\t\t\t\ttext[k+startIndex+charCounterInTheRow*4] == banners[i].AsciiSymbol[4][k] && text[k+startIndex+charCounterInTheRow*5] == banners[i].AsciiSymbol[5][k] &&\r\n\t\t\t\ttext[k+startIndex+charCounterInTheRow*6] == banners[i].AsciiSymbol[6][k] && text[k+startIndex+charCounterInTheRow*7] == banners[i].AsciiSymbol[7][k] {\r\n\t\t\t\tsymbolFound = true\r\n\t\t\t\tsaveIndex = k + 1\r\n\t\t\t} else {\r\n\t\t\t\tsaveIndex = startIndex\r\n\t\t\t\tsymbolFound = false\r\n\t\t\t\tbreak\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif symbolFound {\r\n\t\t\tstartIndex = startIndex + saveIndex\r\n\t\t\tresultString = resultString + string(banners[i].Id)\r\n\t\t\ti = -1\r\n\t\t\tcontinue\r\n\t\t}\r\n\t}\r\n\r\n\tfmt.Println(resultString)\r\n}", "title": "" }, { "docid": "f83f34f75c6ee6fbc382ca34b95eaaa0", "score": "0.43996418", "text": "func (n *Needle) ReadFrom(rd io.Reader) (err error) {\n\tvar (\n\t\tdataOffset int32\n\t\tdata []byte\n\t)\n\tdataOffset = _headerSize + n.Size\n\tdata = n.buffer[_headerSize:dataOffset]\n\tif err = n.writeHeader(n.buffer[:_headerSize]); err == nil {\n\t\tif _, err = rd.Read(data); err == nil {\n\t\t\tn.Data = data\n\t\t\tn.Checksum = crc32.Update(0, _crc32Table, data)\n\t\t\terr = n.writeFooter(n.buffer[dataOffset:n.TotalSize])\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "cb80abe0dfe1377bbe2358554b1fca8d", "score": "0.43921426", "text": "func readLoadSegment(i int, p *elf.Prog) (seg segment, err error) {\n\tflags := module.Obj32Bit\n\tif p.Flags&elf.PF_X != 0 {\n\t\tflags |= module.ObjX\n\t}\n\tif p.Flags&elf.PF_W != 0 {\n\t\tflags |= module.ObjW\n\t}\n\tif p.Flags&elf.PF_R != 0 {\n\t\tflags |= module.ObjR\n\t} else {\n\t\treturn segment{}, errors.New(\"segment is loadable but not readable, which is unsupported\")\n\t}\n\tconst knownFlags = elf.PF_X | elf.PF_W | elf.PF_R\n\tif unknownFlags := p.Flags &^ knownFlags; unknownFlags != 0 {\n\t\treturn segment{}, fmt.Errorf(\"segment has unknown flags 0x%08x\", uint32(unknownFlags))\n\t}\n\taddr := uint32(p.Vaddr)\n\tsize := uint32(p.Memsz)\n\tvar data []byte\n\tif dsz := p.Filesz; dsz > 0 {\n\t\tdata = make([]byte, dsz)\n\t\tif _, err := p.ReadAt(data, 0); err != nil {\n\t\t\tif err == io.EOF {\n\t\t\t\terr = io.ErrUnexpectedEOF\n\t\t\t}\n\t\t\treturn segment{}, fmt.Errorf(\"could not read segment: %v\", err)\n\t\t}\n\t}\n\treturn segment{\n\t\taddrRange: addrRange{\n\t\t\taddr: addr,\n\t\t\tsize: size,\n\t\t},\n\t\tindex: i,\n\t\tprog: p,\n\t\tobject: &module.Object{\n\t\t\tObjectHeader: module.ObjectHeader{\n\t\t\t\tVirtualSize: size,\n\t\t\t\tBaseAddress: addr,\n\t\t\t\tFlags: flags,\n\t\t\t},\n\t\t\tData: data,\n\t\t},\n\t}, nil\n}", "title": "" }, { "docid": "ec6707c53c255b4ab8503e6e5742c242", "score": "0.43830314", "text": "func (f *File) ReadAt(p []byte, off int64) (n int, err error) {\n\t_, err = f.Seek(off, io.SeekStart)\n\tif err != nil {\n\t\treturn\n\t}\n\tn, err = f.Read(p)\n\treturn\n}", "title": "" }, { "docid": "7174f92af82762372833733a9dc32427", "score": "0.43802124", "text": "func (f *framer) readSplice() (*Pattern, error) {\n\tvar hdr struct {\n\t\tMAGIC [6]byte\n\t\tLength uint64\n\t\tVersion [32]byte\n\t}\n\n\terr := binary.Read(f.br, binary.BigEndian, &hdr)\n\n\t// Do we have something that looks like a valid SPLICE stream?\n\tif err != nil || !bytes.Equal(hdr.MAGIC[:], []byte(\"SPLICE\")) {\n\t\treturn nil, ErrNotSPLICE\n\t}\n\n\tp := &Pattern{length: int64(hdr.Length)}\n\n\t// Limit how many bytes we'll read from this stream\n\tr := io.LimitReader(f.br, p.length-32)\n\n\t// Read the tempo, which is a little-endian float32\n\tvar tempo struct {\n\t\tValue float32\n\t}\n\terr = binary.Read(r, binary.LittleEndian, &tempo)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tp.Version = strings.TrimRight(string(hdr.Version[:]), \"\\x00\")\n\tp.Tempo = tempo.Value\n\n\terr = f.readTracks(r, p)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn p, nil\n}", "title": "" }, { "docid": "de5eaa8941263c002e22a16e205f4084", "score": "0.43800658", "text": "func (r *Reader) ReadFile(path string) {\n\tdata, err := ioutil.ReadFile(path)\n\tif err != nil {\n\t\tfmt.Println(\"File reading error\", err)\n\t\treturn\n\t}\n\tstringData := string(data)\n\tr.RawData = stringData\n\n}", "title": "" }, { "docid": "071f9904f6ae0120a57eae151aefbbb5", "score": "0.43728632", "text": "func (myStringData *MyStringData) Read(p []byte) (n int, err error) {\n\n\t// convert `str` string to a slice of bytes\n\tstrBytes := []byte(myStringData.str)\n\n\t// if `readIndex` is GTE source length, return `EOF` error\n\tif myStringData.readIndex >= len(strBytes) {\n\t\treturn 0, io.EOF // `0` bytes read\n\t}\n\n\t// get next readable limit (exclusive)\n\tnextReadLimit := myStringData.readIndex + len(p)\n\n\t// if `nextReadLimit` is GTE source length\n\t// set `nextReadLimit` to source length and `err` to `EOF`\n\tif( nextReadLimit >= len(strBytes) ) {\n\t\tnextReadLimit = len(strBytes)\n\t\terr = io.EOF\n\t}\n\n\t// get next bytes to copy and set `n` to its length\n\tnextBytes := strBytes[ myStringData.readIndex : nextReadLimit ]\n\tn = len(nextBytes)\n\n\t// copy all bytes of `nextBytes` into `p` slice\n\tcopy(p, nextBytes)\n\n\t// increment `readIndex` to `nextReadLimit`\n\tmyStringData.readIndex = nextReadLimit\n\n\t// return values\n\treturn\n\n}", "title": "" }, { "docid": "5259af540ec2e67fe73ec161542c15c0", "score": "0.43699473", "text": "func FromFile(path string) (st *dataset.Structure, err error) {\n\tf, err := os.Open(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer f.Close()\n\n\tformat, comp, err := FormatFromFilename(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tst, _, err = FromReader(format, comp, f)\n\treturn st, err\n}", "title": "" }, { "docid": "785bed8db8d5f29339f47dd3f18bc8bd", "score": "0.43696806", "text": "func (r *NonValidatingReader) Read() (RawSeg, error) {\n\tresetRawSeg(&r.rawSeg)\n\tvar token []byte\n\tfor r.scanner.Scan() {\n\t\tb := r.scanner.Bytes()\n\t\t// In rare occasions inputs are not strict EDI per se - they sometimes have trailing empty lines\n\t\t// with only CR and/or LF. Let's be not so strict and ignore those lines.\n\t\tcount, onlyCRLF := runeCountAndHasOnlyCRLF(b)\n\t\tr.runeBegin = r.runeEnd\n\t\tr.runeEnd += count\n\t\tif onlyCRLF {\n\t\t\tcontinue\n\t\t}\n\t\ttoken = b\n\t\tbreak\n\t}\n\tr.segCount++\n\t// We are here because:\n\t// 1. we find next token (i.e. segment), great, let's process it, OR\n\t// 2. r.scanner.Scan() returns false, and it's EOF (note scanner never returns EOF, it just returns false\n\t// on Scan() and Err() returns nil). We need to return EOF, OR\n\t// 3. r.scanner.Scan() returns false Err() returns err, need to return the `err` wrapped.\n\terr := r.scanner.Err()\n\tif err != nil {\n\t\treturn RawSeg{}, ErrInvalidEDI(fmt.Sprintf(\"cannot read segment, err: %s\", err.Error()))\n\t}\n\tif token == nil {\n\t\treturn RawSeg{}, io.EOF\n\t}\n\t// From now on, the important thing is to operate on token (of []byte) without modification and without\n\t// allocation to keep performance.\n\tr.rawSeg.Raw = token\n\t// First we need to drop the trailing segment delimiter.\n\tnoSegDelim := token[:len(token)-len(r.segDelim.b)]\n\t// In rare occasions, input uses '\\n' as segment delimiter, but '\\r' somehow\n\t// gets included as well (more common in business platform running on Windows)\n\t// Drop that '\\r' as well.\n\tif *r.segDelim.strptr == \"\\n\" && bytes.HasSuffix(noSegDelim, crBytes) {\n\t\tnoSegDelim = noSegDelim[:len(noSegDelim)-utf8.RuneLen('\\r')]\n\t}\n\tfor i, elem := range strs.ByteSplitWithEsc(noSegDelim, r.elemDelim.b, r.releaseChar.b, defaultElemsPerSeg) {\n\t\tif len(r.compDelim.b) == 0 {\n\t\t\t// if we don't have comp delimiter, treat the entire element as one component.\n\t\t\tr.rawSeg.Elems = append(\n\t\t\t\tr.rawSeg.Elems,\n\t\t\t\tRawSegElem{\n\t\t\t\t\t// while (element) index in schema starts with 1, it actually refers to the first element\n\t\t\t\t\t// AFTER the seg name element, thus we can use i as ElemIndex directly.\n\t\t\t\t\tElemIndex: i,\n\t\t\t\t\t// comp_index always starts with 1\n\t\t\t\t\tCompIndex: 1,\n\t\t\t\t\tData: elem,\n\t\t\t\t})\n\t\t\tcontinue\n\t\t}\n\t\tfor j, comp := range strs.ByteSplitWithEsc(elem, r.compDelim.b, r.releaseChar.b, defaultCompsPerElem) {\n\t\t\tr.rawSeg.Elems = append(\n\t\t\t\tr.rawSeg.Elems,\n\t\t\t\tRawSegElem{\n\t\t\t\t\tElemIndex: i,\n\t\t\t\t\tCompIndex: j + 1,\n\t\t\t\t\tData: comp,\n\t\t\t\t})\n\t\t}\n\t}\n\tif len(r.rawSeg.Elems) == 0 || len(r.rawSeg.Elems[0].Data) == 0 {\n\t\treturn RawSeg{}, ErrInvalidEDI(\"missing segment name\")\n\t}\n\tr.rawSeg.Name = string(r.rawSeg.Elems[0].Data)\n\tr.rawSeg.valid = true\n\treturn r.rawSeg, nil\n}", "title": "" }, { "docid": "bea7da49630d36cfc76414b21db71cea", "score": "0.43694425", "text": "func (dl *Datalake) ReadToFile(name string, offset int64, count int64, fi *os.File) (err error) {\n\treturn dl.BlockBlob.ReadToFile(name, offset, count, fi)\n}", "title": "" }, { "docid": "ba274b66638a150f7247d2f0d15ae629", "score": "0.43686506", "text": "func (d *Dataset) Slice(start int, end int) *Dataset {\n\td.rows = d.rows[start:end]\n\treturn d\n}", "title": "" }, { "docid": "2d10e20cf36764c90f0d42f7e50b7607", "score": "0.4366582", "text": "func newDeckFromFile(filename string) deck {\n\n\tbs, err := ioutil.ReadFile(filename)\n\n\t// error handling\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\t//quite\n\t\tos.Exit(127)\n\t}\n\n\t// convert byte slice into string then to string slice to deck\n\n\ts := strings.Split(string(bs), \",\")\n\n\treturn deck(s)\n\n}", "title": "" }, { "docid": "d3577b3639d564bc81293f022dddbf4f", "score": "0.43647915", "text": "func (s *segment) truncateBegin(idx uint64, last bool) error {\n\ts.cfg.I.Printf(\"segment %v, truncateBegin at idx %d\", s, idx)\n\tif idx < s.startIdx {\n\t\treturn ErrOOB\n\t}\n\n\tif s.empty() {\n\t\terr := s.fillSegment()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\ts.cfg.I.Printf(\"after reading in entries => %v\", s)\n\t\tif s.empty() {\n\t\t\ts.startIdx = idx + 1\n\t\t\ts.endIdx = idx\n\t\t\treturn s.fixToLast()\n\t\t}\n\t}\n\ts.reseek = true\n\tif idx < s.endIdx {\n\t\ttmpfile, err := ioutil.TempFile(\"\", \"seg\")\n\t\tif err != nil {\n\t\t\ts.handleError(err, fmt.Sprintf(\"%s, ioutil.TempFile(\\\"\\\", \\\"seg\\\")\", *s))\n\t\t\treturn err\n\t\t}\n\n\t\t_, err = s.file.Seek(s.offs[idx-s.startIdx+1], os.SEEK_SET)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = io.Copy(tmpfile, s.file)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\ttmpfile.Close()\n\t\ts.file.Close()\n\t\tnewFilename := s.file.Name()\n\t\ts.file = nil\n\t\terr = os.Rename(tmpfile.Name(), newFilename)\n\t\tif err != nil {\n\t\t\ts.handleError(err, fmt.Sprintf(\"%s, os.Rename(%s, %s)\", *s, tmpfile.Name(), newFilename))\n\t\t\treturn err\n\t\t}\n\t\ts.file, err = os.OpenFile(newFilename, os.O_RDWR, 0660)\n\t\tif err != nil {\n\t\t\ts.handleError(err, fmt.Sprintf(\"%s, os.OpenFile(%s, os.O_RDWR, 0660)\", *s, newFilename))\n\t\t\treturn err\n\t\t}\n\t\tstartOffset := s.offs[idx-s.startIdx+1]\n\t\ts.offs = s.offs[idx-s.startIdx+1:]\n\t\tfor i := range s.offs {\n\t\t\ts.offs[i] -= startOffset\n\t\t}\n\t\ts.ents = s.ents[idx-s.startIdx+1:]\n\t\ts.startIdx = idx + 1\n\t\ts.cfg.I.Printf(\"after truncate at begining => segment %v\\n\", s)\n\t\treturn nil\n\t} else {\n\t\ts.cfg.I.Printf(\"idx %d, truncated out the whole segment[%d-%d]\", idx, s.startIdx, s.endIdx)\n\t\ts.startIdx = idx + 1\n\t\ts.endIdx = idx\n\t\ts.offs = nil\n\t\ts.ents = nil\n\t\terr := s.file.Truncate(0)\n\t\tif err != nil {\n\t\t\ts.handleError(err, fmt.Sprintf(\"%s, s.file.Truncate(0)\", s))\n\t\t\treturn err\n\t\t}\n\t\tif last {\n\t\t\treturn s.fixToLast()\n\t\t}\n\t\treturn s.destroy()\n\t}\n}", "title": "" }, { "docid": "ecf04d993c64df18b7c1afec462b3c5d", "score": "0.4364647", "text": "func ReadDomains(f string) ([]*dns8.Domain, error) {\n\tfin, e := os.Open(f)\n\tif e != nil {\n\t\treturn nil, e\n\t}\n\n\tdefer fin.Close()\n\n\ts := bufio.NewScanner(fin)\n\tvar ret []*dns8.Domain\n\n\tfor s.Scan() {\n\t\tline := s.Text()\n\t\tline = strings.TrimSpace(line)\n\t\tif line == \"\" {\n\t\t\tcontinue\n\t\t}\n\n\t\td, e := dns8.ParseDomain(line)\n\t\tif e != nil {\n\t\t\treturn nil, e\n\t\t}\n\t\tret = append(ret, d)\n\t}\n\n\te = s.Err()\n\tif e != nil {\n\t\treturn nil, e\n\t}\n\n\treturn ret, nil\n}", "title": "" }, { "docid": "b7cb5dedfbdd43502a6f95f5e15aa405", "score": "0.43611214", "text": "func (m *DASMaps) ReadMapFile(fname string) {\n\tif utils.VERBOSE > 0 {\n\t\tfmt.Println(\"Load dasmaps\", fname)\n\t}\n\tdata, err := os.ReadFile(fname)\n\tif err != nil {\n\t\tlog.Printf(\"ERROR: unable to read DAS maps, time %v, file %v, error %v\\n\", time.Now(), fname, err)\n\t\treturn\n\t}\n\trecords := string(data)\n\tfor _, rec := range strings.Split(records, \"\\n\") {\n\t\tif strings.Contains(rec, \"hash\") {\n\t\t\tvar dmap mongo.DASRecord\n\t\t\terr := json.Unmarshal([]byte(rec), &dmap)\n\t\t\tif err == nil {\n\t\t\t\tm.records = append(m.records, dmap)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5bee0ec4dee8acf0ad91eb3a4b72b433", "score": "0.43594527", "text": "func (f *File) ReadAt(p []byte, off int64) (n int, err error) {\n\t_, err = f.Seek(off, 0)\n\tif err != nil {\n\t\treturn\n\t}\n\tn, err = f.Read(p)\n\treturn\n}", "title": "" }, { "docid": "50aded07b98c27e1e4fa2355a6dafbff", "score": "0.43486372", "text": "func (f *File) ReadAt(b []byte, off int64) (n int, err error) {\n\tif err := f.checkValid(\"read\"); err != nil {\n\t\treturn 0, err\n\t}\n\n\tif off < 0 {\n\t\treturn 0, &PathError{Op: \"readat\", Path: f.name, Err: errors.New(\"negative offset\")}\n\t}\n\n\tfor len(b) > 0 {\n\t\tm, e := f.pread(b, off)\n\t\tif e != nil {\n\t\t\terr = f.wrapErr(\"read\", e)\n\t\t\tbreak\n\t\t}\n\t\tn += m\n\t\tb = b[m:]\n\t\toff += int64(m)\n\t}\n\treturn\n}", "title": "" }, { "docid": "9187b68dddf438620484cb4e095fe279", "score": "0.43382543", "text": "func main() {\n\tfile, err := os.Open(\"input.txt\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer file.Close()\n\n\t// get a FASTA struct representing the input file\n\tinput := utils.ReadFASTAFile(file)\n\n\t// read frames 1, 2, and 3 in direction 5'3'\n\tfor i := 0; i < 3; i++ {\n\t\tfmt.Println(input.ReadFrame(\"5'3'\", i))\n\t}\n\n\tinput.ReverseComplement()\n\n\t// read frames 1, 2, and 3 in direction 3'5'\n\tfor i := 0; i < 3; i++ {\n\t\tfmt.Println(input.ReadFrame(\"3'5'\", i))\n\t}\n}", "title": "" }, { "docid": "561a7cd4dc1960eede3f8a614e799c91", "score": "0.43373072", "text": "func (r *randomReaderAt) ReadAt(b []byte, offset int64) (n int, err error) {\n\treturn rand.Read(b)\n}", "title": "" }, { "docid": "07df9e6d2ec94cbc1acab06ca6f2c458", "score": "0.43369344", "text": "func ReadSliceFrom(r io.Reader, rm ReaderMaker, slice interface{}) (int64, error) {\n\tsliceValue := reflect.ValueOf(slice)\n\treturn ReadFunc(r, rm, func(reader io.ReaderFrom) {\n\t\telem := reflect.ValueOf(reader).Elem()\n\t\treflect.Append(sliceValue, elem)\n\t})\n}", "title": "" }, { "docid": "62b8dceb60993856859e4d698aa7bba5", "score": "0.43368", "text": "func DNA(d string) strand {\n\th := map[byte]int{\n\t\t'A': 0,\n\t\t'C': 0,\n\t\t'G': 0,\n\t\t'T': 0,\n\t}\n\tfor _, n := range d {\n\t\tbyteN := runeToByte(n)\n\t\th[byteN]++\n\t}\n\treturn strand{dnaString: d, histogram: h}\n}", "title": "" }, { "docid": "166f76ab6f8113a9a79f0d361c9a774d", "score": "0.43322334", "text": "func (s SamplesI8) Slice(start, end int) Samples {\n\treturn s[start:end]\n}", "title": "" }, { "docid": "1b9826e008fe0db2dc0b33b0843c14fb", "score": "0.43281886", "text": "func readFile(filename string, employeeSerial string) {\n\tdata, err := ioutil.ReadFile(filename)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\tstr := string(data)\n\n\t//\tSplits up input into slice of student record strings\n\tspltStr := strings.Split(str, \"&\")\n\n\t// Initialize map of student records\n\tmapOfRecords := make(map[string]Employee)\n\n\t//\tLoop through chunks and place them in struct for each employee\n\tfor i := 0; i < (len(spltStr)); i++ {\n\t\tspltSlice := strings.Split(spltStr[i], \",\")\n\t\temployeeStruct := Employee{\n\t\t\tName: spltSlice[0],\n\t\t\tSerial: spltSlice[1],\n\t\t\tAge: spltSlice[2],\n\t\t\tAddress: spltSlice[3],\n\t\t}\n\t\t//\tPlace each struct into map where key is serial and map is record\n\t\tmapOfRecords[spltSlice[1]] = employeeStruct\n\t}\n\t// Prints out record of serial passed as flag from command line\n\tfmt.Println(\"Name: \" + mapOfRecords[employeeSerial].Name)\n\tfmt.Println(\"Serial: \" + mapOfRecords[employeeSerial].Serial)\n\tfmt.Println(\"Age: \" + mapOfRecords[employeeSerial].Age)\n\tfmt.Println(\"Address: \" + mapOfRecords[employeeSerial].Address)\n}", "title": "" }, { "docid": "f38374310650b684903d5b25bf98f6a2", "score": "0.43229386", "text": "func read(file string) []byte {\n\n\tcontent, err := ioutil.ReadFile(file)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"error: %v\", err))\n\t}\n\n\treturn content\n}", "title": "" }, { "docid": "ea633e369715c2ed88557a5212992fa2", "score": "0.43190116", "text": "func (s *store) Read(pos uint64) ([]byte, error) {\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\tif err := s.buf.Flush(); err != nil {\n\t\treturn nil, err\n\t}\n\trecordSize := make([]byte, lenWidth)\n\tif _, err := s.File.ReadAt(recordSize, int64(pos)); err != nil {\n\t\treturn nil, err\n\t}\n\n\tb := make([]byte, enc.Uint64(recordSize))\n\tif _, err := s.File.ReadAt(b, int64(pos+lenWidth)); err != nil {\n\t\treturn nil, err\n\t}\n\treturn b, nil\n}", "title": "" } ]
9527b0b673e7e25c2fb9c67c268fa51f
GetString same as Get but returns the value as string
[ { "docid": "4ea21fe379c8c6f99d71587651b7e9ff", "score": "0.71744037", "text": "func (ctx *Context) GetString(key interface{}) (value string) {\n\tif v := ctx.Get(key); v != nil {\n\t\tvalue = v.(string)\n\t}\n\n\treturn\n}", "title": "" } ]
[ { "docid": "2341cd14a48fd60d9840405a50021bed", "score": "0.7348763", "text": "func GetString(v interface{}) string {\n\tif v != nil {\n\t\treturn v.(string)\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "91b40f96a225a17a61bc799a247206fc", "score": "0.7303053", "text": "func (s *Str) Get() string {\n\treturn s.currentVal.Load().(string)\n}", "title": "" }, { "docid": "019834264ee468321193623e894b0244", "score": "0.7299984", "text": "func (p *propBase) getString() string {\n\tv := p.getValue(p.prop)\n\treturn v.(string)\n}", "title": "" }, { "docid": "d6ef9b9f8784992870523054780009ca", "score": "0.7294917", "text": "func (o *O) GetString(path string) (result string, err error) {\n\tvar value V\n\tif value, err = o.Get(path); err != nil {\n\t\treturn\n\t}\n\treturn value.AsString()\n}", "title": "" }, { "docid": "98eb4349a134fb43ebee0ce088fcf6b5", "score": "0.7242669", "text": "func (t Base64String) Get() string {\n\treturn string(t)\n}", "title": "" }, { "docid": "582d6840c8e0549c0a592245e1e0ae88", "score": "0.72107303", "text": "func GetString(key string) string {\n\tstr := em.Get(key)\n\tif str == nil {\n\t\treturn \"\"\n\t}\n\treturn *str\n}", "title": "" }, { "docid": "98e4c6ae8c446510cbbaf93809d32e36", "score": "0.72051126", "text": "func GetString(v interface{}, path ...interface{}) (string, error) {\n\tv, err := Get(v, path...)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\ts, ok := v.(string)\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"expected string value, got: %T\", v)\n\t}\n\treturn s, nil\n}", "title": "" }, { "docid": "763f2d0a777835adc7940a08f22972c1", "score": "0.7174771", "text": "func GetString(c *gin.Context, key interface{}) (value string, err error) {\n\tvalueInterface, err := GetDefaultSessionValue(c, key)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tvalue, ok := valueInterface.(string)\n\tif !ok {\n\t\terr = errors.New(\"convert session value to string failed\")\n\t}\n\treturn value, err\n}", "title": "" }, { "docid": "6a953fe2261ed4928d8870e468e49c86", "score": "0.71587074", "text": "func (x *Exchange) GetString(key string) string {\n\ts := x.r.FormValue(key)\n\tlog.Printf(\"%s: %s -> string\", key, s)\n\treturn s\n}", "title": "" }, { "docid": "18f78f960aadd5e0bd8b36d7692b165d", "score": "0.71586925", "text": "func (c *context) GetString(key interface{}) (string, bool) {\n\treturn c.fields.GetString(key)\n}", "title": "" }, { "docid": "c509b127829d979f18d074c3f29091c6", "score": "0.71235675", "text": "func (r *Result) GetString() string {\n\treturn fmt.Sprintf(\"%v\", r.Data)\n}", "title": "" }, { "docid": "da442c15f81fa64b145365ae259f271f", "score": "0.7104873", "text": "func (r Results) GetString(key string) string {\n\treturn r[key].(string)\n}", "title": "" }, { "docid": "deb6c37632b4e8418dad737ccab5db25", "score": "0.7092247", "text": "func (s *State) getStringValue(name string) (string, error) {\n\tif !s.dv.Has(name) {\n\t\treturn \"\", nil\n\t}\n\n\tb, err := s.dv.Read(name)\n\tif err != nil {\n\t\treturn \"\", trace.Wrap(err)\n\t}\n\n\treturn string(b), err\n}", "title": "" }, { "docid": "24e78d6435bfb93c036149cc9431c636", "score": "0.7085094", "text": "func (this *Instance) GetString(key string) string {\n\treturn this.handler.GetString(key)\n}", "title": "" }, { "docid": "f6cfa357f8b6fef0d93d2dd9b14e4e0a", "score": "0.7084553", "text": "func (s *Session) GetString(key string) string {\n\tif value := s.Get(key); value != nil {\n\t\tif v, ok := value.(string); ok {\n\t\t\treturn v\n\t\t}\n\n\t\tif v, ok := value.(int); ok {\n\t\t\treturn strconv.Itoa(v)\n\t\t}\n\n\t\tif v, ok := value.(int64); ok {\n\t\t\treturn strconv.FormatInt(v, 10)\n\t\t}\n\t}\n\n\treturn \"\"\n}", "title": "" }, { "docid": "22d5bf47c6579def4f7bba0132941665", "score": "0.70776653", "text": "func GetString(req *http.Request, name string) (string, error) {\n\treturn cast.ToStringE(Get(req, name))\n}", "title": "" }, { "docid": "d04d126234771da3290e3e71d0c98a38", "score": "0.70713645", "text": "func (e *EtcdClient) GetString(t *testing.T, key string) (value string, revision int64) {\n\terr := e.Client.Sync(context.Background())\n\tassert.NoError(t, err)\n\n\tkvHandle := clientv3.NewKV(e.Client)\n\tresponse, err := kvHandle.Get(context.Background(), key)\n\trequire.NoError(t, err)\n\trequire.NotEmpty(t, response.Kvs)\n\n\treturn string(response.Kvs[0].Value), response.Header.Revision\n}", "title": "" }, { "docid": "d409b55b516e3ed7be3ce1f79d0cff7a", "score": "0.7060128", "text": "func (d *Datum) GetString() string {\n\treturn hack.String(d.b)\n}", "title": "" }, { "docid": "d409b55b516e3ed7be3ce1f79d0cff7a", "score": "0.7060128", "text": "func (d *Datum) GetString() string {\n\treturn hack.String(d.b)\n}", "title": "" }, { "docid": "a81bc61cd90984a32ff4f65a8072e192", "score": "0.70427346", "text": "func (s *String) Get() string {\n\ts.rw.RLock()\n\tdefer s.rw.RUnlock()\n\treturn s.value\n}", "title": "" }, { "docid": "5d94e9f64d800497a0d082c52d86b4b0", "score": "0.70377994", "text": "func (f *FieldString) Get() string {\n\treturn f.value\n}", "title": "" }, { "docid": "a27319cd84602ecca22c387b198d233b", "score": "0.7032005", "text": "func JsonGetString(v Value) (string, error) {\n\tif v.Type != kValueTypeString {\n\t\treturn \"\", fmt.Errorf(\"value is not type string but type %s\", v.Type.GetName())\n\t}\n\n\treturn v.String, nil\n}", "title": "" }, { "docid": "297e08dd07ee453d686a923b7549370a", "score": "0.70171326", "text": "func Get(s *string) string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn *s\n}", "title": "" }, { "docid": "15ccd1ec0807b5a2e8c08c51d2076c2b", "score": "0.70080864", "text": "func GetStr(i interface{}) string {\n\tswitch v := i.(type) {\n\tcase uint16:\n\t\treturn strconv.Itoa(int(v))\n\tcase uint32:\n\t\treturn strconv.Itoa(int(v))\n\tcase []byte:\n\t\treturn strconv.Itoa(GetInt(v))\n\tcase int:\n\t\treturn strconv.Itoa(v)\n\tdefault:\n\t\treturn \"\"\n\t}\n}", "title": "" }, { "docid": "35599dd5d3de75a8480c8aa14b8efb79", "score": "0.6983169", "text": "func (kv KV) GetString(key string) (string, error) {\n\treturn kv.ops.Get(key)\n}", "title": "" }, { "docid": "4d22da4005890803174a79d7e8d69f7c", "score": "0.69756347", "text": "func (s *SyncJSON) GetString(key string) string {\n\treturn s.Json.Get(key).String()\n}", "title": "" }, { "docid": "34d469e7f86711a00523d741ab36e8e8", "score": "0.6945692", "text": "func GetString(value interface{}, q string) (string, error) {\n\tv, err := Get(value, q)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tswitch val := v.(type) {\n\tcase string:\n\t\treturn val, nil\n\n\tcase nil:\n\t\treturn \"\", nil\n\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"jsonq: value of '%s' is not string: %T\", q, v)\n\t}\n}", "title": "" }, { "docid": "b8d9826d5123bd287c908fcc359e70fb", "score": "0.6937299", "text": "func (s *String) Get() string {\n\tif s.Property.Get() == nil {\n\t\treturn \"\"\n\t}\n\n\treturn s.Property.Get().(string)\n}", "title": "" }, { "docid": "fe725bdf42a333eafcb4270bd9775ece", "score": "0.69197273", "text": "func (jobj *JSON) GetString(k string) string {\n\tdata := jobj.Jmap[k]\n\tif str, ok := data.(string); ok {\n\t\treturn str\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "5d8c644f1c9cbf41920e1799003b223b", "score": "0.691836", "text": "func (f *OptionalString) Get() string {\n\treturn f.val\n}", "title": "" }, { "docid": "85b6d6b9fe6092290c8b5cebc5905c1a", "score": "0.6880345", "text": "func (g Get) String() string {\n\tout, err := json.Marshal(g)\n\tif err != nil {\n\t\treturn err.Error()\n\t}\n\treturn string(out)\n}", "title": "" }, { "docid": "3c81d3e7602a4d9e2938b23fe050bf74", "score": "0.6869678", "text": "func (item Item) GetString(name string) string {\n\treturn fmt.Sprintf(\"%v\", item[name])\n}", "title": "" }, { "docid": "66872d157514edfcabc4fbfa21b79300", "score": "0.68624115", "text": "func (s *String) GetValue() string {\n\treturn s.value\n}", "title": "" }, { "docid": "fc31d4c85f85879d57bb47925456c89e", "score": "0.685065", "text": "func (value Value) String() string {\n\treturn value.GetString(false, true)\n}", "title": "" }, { "docid": "b0f7300d84b49ad690edafe1bf022cb5", "score": "0.684947", "text": "func GetString(key string) string {\n\tvar res string\n\tcacheApp := GetCache()\n\tresFromCache, ok := cacheApp.Get(key)\n\tif ok {\n\t\tres = resFromCache.(string)\n\t} else {\n\t\tres = GetNoCachedString(key)\n\t\tcacheApp.Set(key, res, cache.NoExpiration)\n\t}\n\n\treturn res\n}", "title": "" }, { "docid": "0b077a85253f1c0a27f64fc46d975fa5", "score": "0.68424463", "text": "func (r *Register) GetString() string {\n\tif r.t != \"string\" {\n\t\tfmt.Printf(\"Error: Attempting to call GetString on a register holding a non-string value.\\n\")\n\t\tos.Exit(3)\n\t}\n\treturn r.s\n}", "title": "" }, { "docid": "cb52f45cdcc92e382ca45c534a6ed359", "score": "0.6840692", "text": "func (e *Entry) GetString(key Key) (string, bool, error) {\n\tvar value string\n\n\tok, err := e.Get(key, &value)\n\tif !ok || err != nil {\n\t\treturn \"\", ok, err\n\t}\n\n\treturn value, true, nil\n}", "title": "" }, { "docid": "b33f3e6f9619859d58e7fdabc2f443e7", "score": "0.6819974", "text": "func GetString(name string) string { return Conf.GetString(name) }", "title": "" }, { "docid": "09d3c3dc7a5df489577f2390ce68f1f5", "score": "0.67914844", "text": "func (c *CsvMetric) GetString(key string, nullable bool) interface{} {\n\t_ = nullable // nullable can not be supported with csv\n\tfor i, k := range c.titles {\n\t\tif k == key && i < len(c.values) {\n\t\t\treturn c.values[i]\n\t\t}\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "07a0829584f76b826e8c6d13b1851cdd", "score": "0.6789173", "text": "func GetString() string {\n\treturn Parsed().String()\n}", "title": "" }, { "docid": "12e8f1e130069995b5838dc9ad1f0e9a", "score": "0.67882353", "text": "func (attributes Attributes) GetString(key string, errorHolder *error) string {\n\treturn attributes.getPrimitive(\n\t\tkey,\n\t\t\"\",\n\t\t\"string\",\n\t\tfunc(attributes Attributes, key string, attributeType string) (interface{}, error) {\n\t\t\tvar convertedValue interface{}\n\t\t\tvar retryError error\n\t\t\tswitch attributeType {\n\t\t\tcase \"bool\":\n\t\t\t\tconvertedValue = strconv.FormatBool(attributes.GetBoolean(key, &retryError))\n\t\t\tcase \"number\":\n\t\t\t\tconvertedValue = strconv.FormatFloat(attributes.GetNumber(key, &retryError), 'g', -1, 64)\n\t\t\t}\n\t\t\treturn convertedValue, retryError\n\t\t},\n\t\terrorHolder).(string)\n}", "title": "" }, { "docid": "def2ab348c631f4326d55fb53a9c3ca5", "score": "0.67811614", "text": "func (o *Map) GetString(key string) (val string, typeOk bool) {\n\tif v := o.Get(key); v != nil {\n\t\tval, typeOk = v.(string)\n\t\treturn\n\t} else {\n\t\treturn \"\", true\n\t}\n}", "title": "" }, { "docid": "9d3fc234e6d5484430e7e8e367fa2565", "score": "0.67767346", "text": "func (obj OptString) Get() string {\n\treturn obj.string\n}", "title": "" }, { "docid": "d2abff01c47db1b5f598bef1732332c0", "score": "0.6771273", "text": "func (s *Session) GetString(key string, def string) string {\n\tv, ok := s.Values[key]\n\tif !ok {\n\t\treturn def\n\t}\n\n\treturn v.(string)\n}", "title": "" }, { "docid": "e734a903e988fb8ec93af98a7906bffc", "score": "0.6770193", "text": "func (c *Client) GetString(key string) string { return c.viper.GetString(key) }", "title": "" }, { "docid": "5c813066bbbe7b9be9166f1efc0d64a5", "score": "0.67465603", "text": "func GetString(name string, def ...string) string {\n\treturn GetProperty(name, def...)\n}", "title": "" }, { "docid": "4a7125a442ea7ebdd4bd570780d5017c", "score": "0.6745527", "text": "func (d *Document) GetString() (string, error) {\n\tvalue, err := d.Get()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn string(value), nil\n}", "title": "" }, { "docid": "d38454237ddb53507843ee6314138aae", "score": "0.6741733", "text": "func (ed EntryData) getStringValue() string {\n\n\tswitch val := ed.value.(type) {\n\tcase string:\n\t\treturn val\n\tcase int:\n\t\treturn fmt.Sprintf(\"%v\", val)\n\tcase float64:\n\t\treturn fmt.Sprintf(\"%v\", val)\n\tcase time.Time:\n\t\treturn fmt.Sprintf(\"%v\", val.Format(dateFormatString))\n\tdefault:\n\t\tlog.Println(\"Wrong data contained in EntryData can't convert properly -- skipping\")\n\t\treturn \"\"\n\t}\n}", "title": "" }, { "docid": "ee5507bea86bb1b2612ce9ec431adde0", "score": "0.6740867", "text": "func (p *Pair) GetString(key interface{}) (string, bool) {\n\tval, found := p.Get(key)\n\tif !found {\n\t\treturn \"\", false\n\t}\n\n\tvalue, ok := val.(string)\n\treturn value, ok\n}", "title": "" }, { "docid": "5628a7bf832c5d7ba7fcbfe41171a5cf", "score": "0.6729887", "text": "func GetString(input interface{}, propID PropID) (string, bool) {\n\tvar (\n\t\tnode map[string]interface{}\n\t\tpropI interface{}\n\t\tpropN map[string]interface{}\n\t\tok bool\n\t)\n\n\tnode, ok = input.(map[string]interface{})\n\tif !ok {\n\t\treturn \"\", false\n\t}\n\tpropI, ok = node[propID.URI()]\n\tif !ok {\n\t\treturn \"\", false\n\t}\n\tswitch propI.(type) {\n\tcase map[string]interface{}:\n\t\tpropN = propI.(map[string]interface{})\n\t\tpropI, ok = propN[\"@value\"]\n\t\tif !ok {\n\t\t\treturn \"\", false\n\t\t}\n\t\tswitch propI.(type) {\n\t\tcase string:\n\t\t\treturn propI.(string), true\n\t\tdefault:\n\t\t\treturn \"\", false\n\t\t}\n\tcase string:\n\t\treturn propI.(string), true\n\tdefault:\n\t\treturn \"\", false\n\t}\n}", "title": "" }, { "docid": "d8c0ea68f2f6685ab744ba6fcdaaf38f", "score": "0.6726162", "text": "func (g *GoogleContext) GetString(key interface{}) (string, bool) {\n\tval, found := g.Get(key)\n\tif !found {\n\t\treturn \"\", false\n\t}\n\n\tvalue, ok := val.(string)\n\treturn value, ok\n}", "title": "" }, { "docid": "84092eb63b527f7a7eb1fa6d0b49d3d1", "score": "0.67052007", "text": "func (doc *HclDocument) GetAsString(q string) (string, error) {\n\tresult, err := doc.Get(q)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tstr, ok := result.(string)\n\tif ok {\n\t\treturn str, nil\n\t}\n\tnum, ok := result.(int)\n\tif ok {\n\t\treturn strconv.Itoa(num), nil\n\t}\n\treturn fmt.Sprintf(\"%v\", result), nil\n}", "title": "" }, { "docid": "2756f8b112133df22e357eb28dbcceff", "score": "0.66989565", "text": "func (c *Config) GetString(key string) string {\n\treturn c.driver.GetString(key)\n}", "title": "" }, { "docid": "b817015bf80baf87153d9a53b9cc81e9", "score": "0.6696191", "text": "func (this *Section) GetString(\n\tkey string,\n\tresult *string,\n\tvalidators ...StringValidator,\n) (err error) {\n\n\tthis.track(key)\n\tvar val string\n\tvar found bool\n\tval, found, err = this.getString(key)\n\tif err != nil {\n\t\treturn\n\t}\n\tif !found && nil != result { // validate default value\n\t\tval = *result\n\t}\n\terr = this.validString(key, val, validators)\n\tif err != nil {\n\t\treturn\n\t}\n\tif found {\n\t\t*result = val\n\t}\n\treturn\n}", "title": "" }, { "docid": "738e17b5a6cc9bc00c1e7c69d3a4d8c9", "score": "0.66814226", "text": "func (d Document) GetString(key string) string {\n\treturn d[key].(string)\n}", "title": "" }, { "docid": "3d550b508dda8b06acd898710850c3ca", "score": "0.667407", "text": "func (c *cfgHandler) GetString(key string) string {\n\tret := c.ParseNode(key)\n\tshowRet, ok := ret.(string)\n\tif ok != true {\n\t\treturn \"\"\n\t}\n\treturn showRet\n}", "title": "" }, { "docid": "88c37b4edffb4db12c91ff699223834f", "score": "0.6671164", "text": "func Get(name string) (string, error) {\n\tref, err := setup()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer teardown(ref)\n\n\tnameStr := C.CString(name)\n\tdefer C.free(unsafe.Pointer(nameStr))\n\n\tvar value *C.char\n\tvar errStr *C.char\n\tlength := C.Get(nameStr, &value, &errStr, ref)\n\n\tif length == -1 {\n\t\terr := errors.New(C.GoString(errStr))\n\t\tC.free(unsafe.Pointer(errStr))\n\t\treturn \"\", err\n\t} else if length == -2 {\n\t\treturn \"\", nil\n\t}\n\n\tresult := C.GoStringN(value, length)\n\n\tC.free(unsafe.Pointer(value))\n\n\treturn result, nil\n}", "title": "" }, { "docid": "3cb821bfb585d1d4511b92c03978c979", "score": "0.6663969", "text": "func GetString(dict map[string]interface{}, key string) (string, error) {\n\treturn getString(dict, key)\n}", "title": "" }, { "docid": "c48baaf1cbd6b5cc0aeb7d0cb668412d", "score": "0.66578484", "text": "func (ca *RuntimeCache) GetString(key string) (string, error) {\n\tv, err := ca.Get(key)\n\tif err != nil || v == nil {\n\t\treturn \"\", err\n\t} else {\n\t\treturn fmt.Sprint(v), nil\n\t}\n}", "title": "" }, { "docid": "6e85a966dcd7d94c0580675fb913eba4", "score": "0.66498286", "text": "func (p *Parser) getString() string {\n\treturn value.ParseString(p.need(scan.String).Text)\n}", "title": "" }, { "docid": "ac38c7970fb027038363031ed9e38c45", "score": "0.6645545", "text": "func (c *Config) GetString(key string) (s string) {\n\ts, _ = c.GetStringWithError(key)\n\treturn\n}", "title": "" }, { "docid": "c107ee8c9e67472a1503015fa32ab94e", "score": "0.6638078", "text": "func (m OptionsMap) GetString(key string) (string, error) {\n\tvar err error\n\tvar val interface{}\n\tif val, err = m.GetObject(key); err == nil {\n\t\tstrVal, okStrVal := val.(string)\n\t\tif okStrVal {\n\t\t\treturn strVal, nil\n\t\t}\n\t\treturn \"\", config.ErrKeyInvalidType\n\t}\n\treturn \"\", err\n}", "title": "" }, { "docid": "86f52d50edc4a4fbabc481447c970028", "score": "0.6632416", "text": "func (r *JSONReader) GetString(key string) string {\n\tv, ok := r.getRawMessage(key)\n\tif !ok {\n\t\treturn \"\"\n\t}\n\n\tvar s string\n\terr := json.Unmarshal(v, &s)\n\tif err != nil {\n\t\treturn \"\"\n\t}\n\n\treturn s\n}", "title": "" }, { "docid": "84b0294398ae8383f0f34cc32ece50cb", "score": "0.6630978", "text": "func String(key string) string {\n\tv := Get(key)\n\n\tstr, ok := v.(string)\n\tif ok {\n\t\treturn str\n\t}\n\n\tlog.Printf(\"envar.String: no string value for key: %s\\n\", key)\n\treturn \"\"\n}", "title": "" }, { "docid": "e525c38235afa6fe198228a12ba38857", "score": "0.6616799", "text": "func getStringValue(m map[string]interface{}, key string) string {\n\tv, found := m[key]\n\tif !found {\n\t\treturn \"\"\n\t}\n\ts, ok := v.(string)\n\tif !ok {\n\t\treturn \"\"\n\t}\n\treturn s\n}", "title": "" }, { "docid": "1059761e179d4a49183088ec8081518b", "score": "0.66156596", "text": "func (d *DummyCookie) GetString(Name string) string {\n\tresult, _ := d.Values[Name].(string)\n\treturn result\n}", "title": "" }, { "docid": "1dc9ee19cfa6f2c456210460f3db69e7", "score": "0.6609179", "text": "func GetString(key string) (string, bool, error) {\n\tr, ok, err := get(key)\n\tif err != nil {\n\t\treturn \"\", ok, err\n\t}\n\treturn r.(string), ok, nil\n}", "title": "" }, { "docid": "9d184a73d7e93720a5f7bff1a3946e0f", "score": "0.66027355", "text": "func (p Field) GetString(key string) (string, bool) {\n\tval, found := p.Get(key)\n\tif !found {\n\t\treturn \"\", false\n\t}\n\n\tvalue, ok := val.(string)\n\treturn value, ok\n}", "title": "" }, { "docid": "8c3f4582d5429f0ddbf3f474175f8236", "score": "0.6601508", "text": "func (p *provider) GetString(key string) (string, error) {\n\tif key != \"\" && key[0] != '/' {\n\t\tkey = \"/\" + key\n\t}\n\n\tssmClient := p.getSSMClient()\n\n\tin := ssm.GetParameterInput{\n\t\tName: aws.String(key),\n\t\tWithDecryption: aws.Bool(true),\n\t}\n\tout, err := ssmClient.GetParameter(&in)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"get parameter: %v\", err)\n\t}\n\n\tif out.Parameter == nil {\n\t\treturn \"\", errors.New(\"datasource.ssm.Get() out.Parameter is nil\")\n\t}\n\n\tif out.Parameter.Value == nil {\n\t\treturn \"\", errors.New(\"datasource.ssm.Get() out.Parameter.Value is nil\")\n\t}\n\tp.debugf(\"SSM: successfully retrieved key=%s\", key)\n\n\treturn *out.Parameter.Value, nil\n}", "title": "" }, { "docid": "639359f5675a2b899e7f637695287f1d", "score": "0.6600951", "text": "func GetStringVal(obj PdfObject) (val string, found bool) {\n\tso, found := TraceToDirectObject(obj).(*PdfObjectString)\n\tif found {\n\t\treturn so.Str(), true\n\t}\n\treturn\n}", "title": "" }, { "docid": "60029f8e9ca586b3a7bb89bb1fecc3f3", "score": "0.659893", "text": "func (c *ForjCli) GetStringValue(object, key, param_name string) (string, bool, bool, error) {\n\tif v, found, err := c.getValue(object, key, param_name); found {\n\t\tif _, ok := v.(*string); ok {\n\t\t\treturn to_string(v), true, true, nil\n\t\t}\n\t\treturn to_string(v), true, false, nil\n\t} else {\n\t\treturn \"\", false, false, err\n\t}\n}", "title": "" }, { "docid": "74920deda030462b9fecf1e3b03d4500", "score": "0.6598743", "text": "func (v Value) Str() string { v.testType(Tstring); return v.AsString() }", "title": "" }, { "docid": "52a92a71c5712f1d4e67fd2ed001406c", "score": "0.65985966", "text": "func (i OptionalString) Get() string {\n\tif i.value == nil {\n\t\tpanic(ErrUnsetField)\n\t}\n\n\treturn *i.value\n}", "title": "" }, { "docid": "fa488df018f57361fa98a3cefa91ba9c", "score": "0.65871817", "text": "func GetString(key string) (string, error) {\n\tconn := pool.Get()\n\tdefer conn.Close()\n\n\treturn redis.String(conn.Do(\"GET\", key))\n}", "title": "" }, { "docid": "595557de8265dbd9182cb2fc01828dfd", "score": "0.6569975", "text": "func GetString(key string) string {\n\treturn viper.GetString(key)\n}", "title": "" }, { "docid": "75c4180db8fa89ab8c49c6e7d4b3cf84", "score": "0.65652657", "text": "func (db *MDB) GetStr(key int64) string {\n\treturn db.fetchStr(key, \"_KVSTR\")\n}", "title": "" }, { "docid": "a85c2d0d5c183ffde513194aa3772f3c", "score": "0.6562332", "text": "func GetString(src *viper.Viper, key string) (string, error) {\n\n\tif src.IsSet(key) {\n\t\treturn src.GetString(key), nil\n\t}\n\n\treturn \"\", newError(key)\n}", "title": "" }, { "docid": "b6bb943dd4245d202f48ffe20386e67b", "score": "0.6551577", "text": "func (a *App) GetString(group, name string) (o string, err error) {\n\tvar val interface{}\n\tval, err = a.GetConf(group, name)\n\tif !slog.Check(err) {\n\t\tif v, ok := val.(*string); !ok {\n\t\t\terr = errors.New(\"Value at \" + group + \"/\" + name + \"is not a string\")\n\t\t} else {\n\t\t\to = *v\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "4d2f6bd940e4d7a005255681173edd13", "score": "0.6537662", "text": "func Get(c *consul.Client, key string) string {\n\tdata, _ := GetRaw(c, key)\n\treturn string(data)\n}", "title": "" }, { "docid": "9ac1933db0f1b728918020c45d728492", "score": "0.6524431", "text": "func (c *Controller) GetString(queryParam string, def string) string {\n\tval := c.GetStringSlice(queryParam)\n\n\tif len(val) == 0 {\n\t\treturn def\n\t}\n\n\treturn val[0]\n}", "title": "" }, { "docid": "2b6a39ed984e58faa5050fe60338c274", "score": "0.6522984", "text": "func (h *Hash) GetString(key string) interface{} {\n\tif len(h.entries) == 0 {\n\t\t// be kind to the gc: avoid an extra byte slice if we're empty anyway\n\t\treturn nil\n\t}\n\n\treturn h.get([]byte(key))\n}", "title": "" }, { "docid": "cfa75691ab22ac021a5808784e9c9290", "score": "0.6518228", "text": "func (vr VoltRows) GetString(colIndex int16) (interface{}, error) {\n\tbs, err := vr.table().getBytes(vr.table().rowIndex, colIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// if there are only four bytes then there is just the\n\t// length, which must be -1, the null encoding.\n\tif len(bs) == 4 {\n\t\tl := bytesToInt(bs)\n\t\tif l == -1 { // else 0\n\t\t\treturn nil, nil\n\t\t}\n\t}\n\t// exclude the length from the string itself.\n\treturn string(bs[4:]), nil\n}", "title": "" }, { "docid": "7445ae2ca2d20ebe4ca38a3e6ad267fb", "score": "0.6513988", "text": "func (mvs MetaValues) GetString(name string) string {\n\tfor _, mv := range mvs.Values {\n\t\tif mv.Name == name {\n\t\t\treturn mv.StringValue()\n\t\t}\n\t}\n\n\treturn \"\"\n}", "title": "" }, { "docid": "c0cd8445fc9a19b9aa93ed876ba81656", "score": "0.6509941", "text": "func (this *jsonArgs) getString(f string, dflt string) (string, errors.Error) {\n\tvalue_field, in_request := this.getField(f)\n\tif !in_request {\n\t\treturn dflt, nil\n\t}\n\n\tvalue, type_ok := value_field.(string)\n\tif !type_ok {\n\t\treturn value, errors.NewServiceErrorTypeMismatch(f, \"string\")\n\t}\n\treturn value, nil\n}", "title": "" }, { "docid": "d9a85e06ba565706b6548e448358f61d", "score": "0.65033185", "text": "func GetString(key Key) string {\n\treturn viper.GetString(string(key))\n}", "title": "" }, { "docid": "af7006977b2b29712fc96f2a9a13989d", "score": "0.6496283", "text": "func (scope Scope) GetString(name string) (s string, g, ok bool) {\n\tvalue, g, ok := scope.Get(name)\n\tif ok {\n\t\treturn value.(string), g, ok\n\t}\n\treturn\n}", "title": "" }, { "docid": "c9a6d0a8eec05909394f0be3e12ded9e", "score": "0.6492178", "text": "func (w *env_wrapper) GetString(name string) string {\n\treturn w.GetStringDef(name, \"\")\n}", "title": "" }, { "docid": "5560747537b2a4f37afbed1abd1bcf54", "score": "0.6488721", "text": "func (slc *mapUintStringValue) Get() interface{} { return map[uint]string(*slc) }", "title": "" }, { "docid": "96f3ef559399004e925cec9df22d6188", "score": "0.6488048", "text": "func GetString(n ast.Node) (string, error) {\n\tif node, ok := n.(*ast.BasicLit); ok && node.Kind == token.STRING {\n\t\treturn strconv.Unquote(node.Value)\n\t}\n\treturn \"\", fmt.Errorf(\"Unexpected AST node type: %T\", n)\n}", "title": "" }, { "docid": "921b3a785624caef74729a485dfacfaf", "score": "0.64837086", "text": "func (w *Wrapper) String(key string) (string, error) {\n\treturn w.Client.Get(key).Result()\n}", "title": "" }, { "docid": "159a832634ccf1ee5757a62bce35f382", "score": "0.64779973", "text": "func (hdr *RpmHeader) GetString(tag int) (string, error) {\n\tvals, err := hdr.GetStrings(tag)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif len(vals) != 1 {\n\t\treturn \"\", fmt.Errorf(\"incorrect number of values\")\n\t}\n\treturn vals[0], nil\n}", "title": "" }, { "docid": "b53e5b10a74eebc5d13a8ec0927c1177", "score": "0.64735156", "text": "func (c *Config) GetString(key string, _default ...interface{}) string {\n\treturn c.Get(key, _default...)\n}", "title": "" }, { "docid": "53dc954e47cd8fc8f24fef9d03e8314e", "score": "0.64715487", "text": "func (r ResultTable) GetString(rowIndex int, columnIndex int) string {\n\treturn (r.Rows[rowIndex][columnIndex]).(string)\n}", "title": "" }, { "docid": "55c02efb528993c5d540b4eadf6e38c2", "score": "0.64707756", "text": "func (store Store) GetString(sym Symbol) string {\n\tif sym>>63 == 1 {\n\t\treturn store.longStrings[sym^1<<63]\n\t}\n\tpage := store.pages[sym>>32][:]\n\tindex := sym & (1<<pageSizeLog - 1)\n\tlength := (sym & (1<<32 - 1)) >> pageSizeLog\n\tb := page[index : index+length]\n\t//nolint:gosec // reuse exists memory to reduce allocations\n\treturn *(*string)(unsafe.Pointer(&b))\n}", "title": "" }, { "docid": "1fdc8e2c803318475aa6a4f89fce9ee1", "score": "0.6470728", "text": "func (c *Config) GetString(args ...interface{}) string {\n\tvalue := c.Get(args...)\n\n\t// We might still have an empty value here, so\n\t// return the default if set\n\tif value == nil {\n\t\tif len(args) > 1 {\n\t\t\treturn args[1].(string)\n\t\t} else {\n\t\t\treturn \"\"\n\t\t}\n\t}\n\n\treturn value.(string)\n}", "title": "" }, { "docid": "6c1c6b4611732636a812ee909019f761", "score": "0.64676225", "text": "func (a AttributeAssignment) GetString(ctx *Context) (string, error) {\n\tv, err := a.calculate(ctx)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\ts, err := v.str()\n\tif err != nil {\n\t\treturn \"\", a.bindError(err)\n\t}\n\n\treturn s, nil\n}", "title": "" }, { "docid": "f5a5192c883c936a49a43ef2bc099ae8", "score": "0.64612156", "text": "func (b MapBuilder) GetString(key string) (string, bool) {\n\tval, ok := b.body[key].(string)\n\treturn val, ok\n}", "title": "" }, { "docid": "6f9f9ec8ae258e0656a4e3179d8fd3cd", "score": "0.6434189", "text": "func (o *StreamPeer) GetString(bytes int64) string {\n\tlog.Println(\"Calling StreamPeer.GetString()\")\n\n\t// Build out the method's arguments\n\tgoArguments := make([]reflect.Value, 1, 1)\n\tgoArguments[0] = reflect.ValueOf(bytes)\n\n\t// Call the parent method.\n\n\tgoRet := o.callParentMethod(o.baseClass(), \"get_string\", goArguments, \"string\")\n\n\treturnValue := goRet.Interface().(string)\n\n\tlog.Println(\" Got return value: \", returnValue)\n\treturn returnValue\n\n}", "title": "" }, { "docid": "bf3c41f7ee17f5833a30e54a0da8597c", "score": "0.6433574", "text": "func (ks *Kingsnake) GetString(key string) string {\n\treturn ks.Get(key).(string)\n}", "title": "" }, { "docid": "eb31538ee0724d0cb4d83004e52fbb5c", "score": "0.64099604", "text": "func GetString(m map[string]interface{}, key string) (string, bool) {\n\ti, ok := m[key]\n\tif !ok {\n\t\treturn \"\", false\n\t}\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn \"\", false\n\t}\n\treturn s, true\n}", "title": "" } ]
8adddcb731129e048b8df569126bdbe0
IsYANGGoStruct ensures that NetworkInstance_Protocol_Static_NextHop_InterfaceRef implements the yang.GoStruct interface. This allows functions that need to handle this struct to identify it as being generated by ygen.
[ { "docid": "8e833c56816f7b8c28408e37cd361572", "score": "0.89773923", "text": "func (*NetworkInstance_Protocol_Static_NextHop_InterfaceRef) IsYANGGoStruct() {}", "title": "" } ]
[ { "docid": "1d726da34702c8f1edb60a153a67af4b", "score": "0.85833925", "text": "func (*LocalRoutes_Static_NextHop_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "1d726da34702c8f1edb60a153a67af4b", "score": "0.85833925", "text": "func (*LocalRoutes_Static_NextHop_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "1d726da34702c8f1edb60a153a67af4b", "score": "0.85833925", "text": "func (*LocalRoutes_Static_NextHop_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "0d14b3effc21905301572b479011a23a", "score": "0.8418739", "text": "func (*NetworkInstance_Protocol_Isis_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "0d14b3effc21905301572b479011a23a", "score": "0.84184307", "text": "func (*NetworkInstance_Protocol_Isis_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "0d14b3effc21905301572b479011a23a", "score": "0.84184307", "text": "func (*NetworkInstance_Protocol_Isis_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "a6210acf2d3ce5681fdc52858bd43c10", "score": "0.84095937", "text": "func (*NetworkInstance_Protocol_Igmp_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "a6210acf2d3ce5681fdc52858bd43c10", "score": "0.84095937", "text": "func (*NetworkInstance_Protocol_Igmp_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "d8baf253f43e41e421dda843c1e6f7f6", "score": "0.8406718", "text": "func (*NetworkInstance_Protocol_Pim_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "d8baf253f43e41e421dda843c1e6f7f6", "score": "0.8405868", "text": "func (*NetworkInstance_Protocol_Pim_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "972e4d80bb9baddc7826258e8af52f2d", "score": "0.8303043", "text": "func (*NetworkInstance_Afts_MacEntry_NextHop_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "972e4d80bb9baddc7826258e8af52f2d", "score": "0.8303043", "text": "func (*NetworkInstance_Afts_MacEntry_NextHop_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "972e4d80bb9baddc7826258e8af52f2d", "score": "0.8303043", "text": "func (*NetworkInstance_Afts_MacEntry_NextHop_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "f65def5e0c3dccc7621e8bdf027bea08", "score": "0.8288916", "text": "func (*NetworkInstance_Mpls_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "f65def5e0c3dccc7621e8bdf027bea08", "score": "0.8288916", "text": "func (*NetworkInstance_Mpls_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "f65def5e0c3dccc7621e8bdf027bea08", "score": "0.8288916", "text": "func (*NetworkInstance_Mpls_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "b7d4910afec62516d7a346a9ebbd138d", "score": "0.8281755", "text": "func (*NetworkInstance_Protocol_Static_NextHop) IsYANGGoStruct() {}", "title": "" }, { "docid": "b7d4910afec62516d7a346a9ebbd138d", "score": "0.8280866", "text": "func (*NetworkInstance_Protocol_Static_NextHop) IsYANGGoStruct() {}", "title": "" }, { "docid": "b7d4910afec62516d7a346a9ebbd138d", "score": "0.8280866", "text": "func (*NetworkInstance_Protocol_Static_NextHop) IsYANGGoStruct() {}", "title": "" }, { "docid": "eba2a73e16241139944c0339309e0c19", "score": "0.82240385", "text": "func (*Mpls_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "eba2a73e16241139944c0339309e0c19", "score": "0.82240385", "text": "func (*Mpls_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "eba2a73e16241139944c0339309e0c19", "score": "0.82235456", "text": "func (*Mpls_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "aa7c2186474c05965167f52ac95faadc", "score": "0.81932837", "text": "func (*NetworkInstance_Mpls_Global_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "aa7c2186474c05965167f52ac95faadc", "score": "0.81932837", "text": "func (*NetworkInstance_Mpls_Global_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "aa7c2186474c05965167f52ac95faadc", "score": "0.81932837", "text": "func (*NetworkInstance_Mpls_Global_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "8ba78ddd30400bad9a014273ffdf3b19", "score": "0.8189831", "text": "func (*Mpls_Global_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "8ba78ddd30400bad9a014273ffdf3b19", "score": "0.8189831", "text": "func (*Mpls_Global_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "8ba78ddd30400bad9a014273ffdf3b19", "score": "0.8189646", "text": "func (*Mpls_Global_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "71634b3bfd334465ebe86312c9445b4b", "score": "0.81718546", "text": "func (*NetworkInstance_PolicyForwarding_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "71634b3bfd334465ebe86312c9445b4b", "score": "0.81718546", "text": "func (*NetworkInstance_PolicyForwarding_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "71634b3bfd334465ebe86312c9445b4b", "score": "0.81718546", "text": "func (*NetworkInstance_PolicyForwarding_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "629f975e44875717c473d090da2946e1", "score": "0.81507474", "text": "func (*NetworkInstance_Afts_Ipv4Entry_NextHop_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "629f975e44875717c473d090da2946e1", "score": "0.81503713", "text": "func (*NetworkInstance_Afts_Ipv4Entry_NextHop_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "629f975e44875717c473d090da2946e1", "score": "0.81503713", "text": "func (*NetworkInstance_Afts_Ipv4Entry_NextHop_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "008031439b5116f184a2e8011910b3cf", "score": "0.81355834", "text": "func (*NetworkInstance_Protocol_Isis_Interface) IsYANGGoStruct() {}", "title": "" }, { "docid": "008031439b5116f184a2e8011910b3cf", "score": "0.81349957", "text": "func (*NetworkInstance_Protocol_Isis_Interface) IsYANGGoStruct() {}", "title": "" }, { "docid": "008031439b5116f184a2e8011910b3cf", "score": "0.8134972", "text": "func (*NetworkInstance_Protocol_Isis_Interface) IsYANGGoStruct() {}", "title": "" }, { "docid": "4dc4e2fe980f2e04a17396863feb5425", "score": "0.81237024", "text": "func (*NetworkInstance_Afts_PolicyForwardingEntry_NextHop_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "4dc4e2fe980f2e04a17396863feb5425", "score": "0.81237024", "text": "func (*NetworkInstance_Afts_PolicyForwardingEntry_NextHop_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "4dc4e2fe980f2e04a17396863feb5425", "score": "0.81237024", "text": "func (*NetworkInstance_Afts_PolicyForwardingEntry_NextHop_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "78a8cb70dc54637bb0bb1b7fb5e98156", "score": "0.8104431", "text": "func (*NetworkInstance_Afts_LabelEntry_NextHop_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "78a8cb70dc54637bb0bb1b7fb5e98156", "score": "0.8103807", "text": "func (*NetworkInstance_Afts_LabelEntry_NextHop_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "78a8cb70dc54637bb0bb1b7fb5e98156", "score": "0.8103807", "text": "func (*NetworkInstance_Afts_LabelEntry_NextHop_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "547b890dc251774b5aa71760cff57930", "score": "0.80197066", "text": "func (*NetworkInstance_Afts_Ipv6Entry_NextHop_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "547b890dc251774b5aa71760cff57930", "score": "0.80197066", "text": "func (*NetworkInstance_Afts_Ipv6Entry_NextHop_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "547b890dc251774b5aa71760cff57930", "score": "0.80197066", "text": "func (*NetworkInstance_Afts_Ipv6Entry_NextHop_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "8c4bcc58db054863bcdef3d073f32059", "score": "0.79562473", "text": "func (*NetworkInstance_Protocol_Pim_Interface) IsYANGGoStruct() {}", "title": "" }, { "docid": "8c4bcc58db054863bcdef3d073f32059", "score": "0.79562473", "text": "func (*NetworkInstance_Protocol_Pim_Interface) IsYANGGoStruct() {}", "title": "" }, { "docid": "3af0d88bc2c3ace72866baf85760b29f", "score": "0.79475725", "text": "func (*NetworkInstance_Protocol_Isis_Interface_Bfd) IsYANGGoStruct() {}", "title": "" }, { "docid": "3af0d88bc2c3ace72866baf85760b29f", "score": "0.79475725", "text": "func (*NetworkInstance_Protocol_Isis_Interface_Bfd) IsYANGGoStruct() {}", "title": "" }, { "docid": "3af0d88bc2c3ace72866baf85760b29f", "score": "0.7947525", "text": "func (*NetworkInstance_Protocol_Isis_Interface_Bfd) IsYANGGoStruct() {}", "title": "" }, { "docid": "22ff5eac2d829e286c7048ca1eccf7f2", "score": "0.7937667", "text": "func (*Mpls_SignalingProtocols_RsvpTe_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "22ff5eac2d829e286c7048ca1eccf7f2", "score": "0.7937667", "text": "func (*Mpls_SignalingProtocols_RsvpTe_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "22ff5eac2d829e286c7048ca1eccf7f2", "score": "0.7937667", "text": "func (*Mpls_SignalingProtocols_RsvpTe_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "384d3578bb1c856428d90557964f5812", "score": "0.7906284", "text": "func (*RelayAgent_Dhcp_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "22c796a3016f915ee859a13d3fb4b68e", "score": "0.78527135", "text": "func (*NetworkInstance_Protocol_Igmp_Interface) IsYANGGoStruct() {}", "title": "" }, { "docid": "22c796a3016f915ee859a13d3fb4b68e", "score": "0.78527135", "text": "func (*NetworkInstance_Protocol_Igmp_Interface) IsYANGGoStruct() {}", "title": "" }, { "docid": "61ac0ed49c011dcccacaeaf7bdb4d74b", "score": "0.78477216", "text": "func (*NetworkInstance_Mpls_SignalingProtocols_SegmentRouting_Interface_InterfaceRef) IsYANGGoStruct() {\n}", "title": "" }, { "docid": "61ac0ed49c011dcccacaeaf7bdb4d74b", "score": "0.78477216", "text": "func (*NetworkInstance_Mpls_SignalingProtocols_SegmentRouting_Interface_InterfaceRef) IsYANGGoStruct() {\n}", "title": "" }, { "docid": "61ac0ed49c011dcccacaeaf7bdb4d74b", "score": "0.78477216", "text": "func (*NetworkInstance_Mpls_SignalingProtocols_SegmentRouting_Interface_InterfaceRef) IsYANGGoStruct() {\n}", "title": "" }, { "docid": "8971dcd8be51296424de055e0771c0cd", "score": "0.7845069", "text": "func (*RelayAgent_Dhcpv6_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "1c04be2816eb84e6da2c318b3aecb57f", "score": "0.78375095", "text": "func (*LocalRoutes_Static_NextHop) IsYANGGoStruct() {}", "title": "" }, { "docid": "1c04be2816eb84e6da2c318b3aecb57f", "score": "0.78375095", "text": "func (*LocalRoutes_Static_NextHop) IsYANGGoStruct() {}", "title": "" }, { "docid": "1c04be2816eb84e6da2c318b3aecb57f", "score": "0.78375095", "text": "func (*LocalRoutes_Static_NextHop) IsYANGGoStruct() {}", "title": "" }, { "docid": "be878343d35a61f74bcdecb0c19231e3", "score": "0.7829406", "text": "func (*Lldp_Interface) IsYANGGoStruct() {}", "title": "" }, { "docid": "be878343d35a61f74bcdecb0c19231e3", "score": "0.78293526", "text": "func (*Lldp_Interface) IsYANGGoStruct() {}", "title": "" }, { "docid": "be878343d35a61f74bcdecb0c19231e3", "score": "0.78293526", "text": "func (*Lldp_Interface) IsYANGGoStruct() {}", "title": "" }, { "docid": "ac6f3c8180ddc1f794480cf3e059317f", "score": "0.78273016", "text": "func (*Interface) IsYANGGoStruct() {}", "title": "" }, { "docid": "ac6f3c8180ddc1f794480cf3e059317f", "score": "0.78261185", "text": "func (*Interface) IsYANGGoStruct() {}", "title": "" }, { "docid": "ac6f3c8180ddc1f794480cf3e059317f", "score": "0.78261185", "text": "func (*Interface) IsYANGGoStruct() {}", "title": "" }, { "docid": "ac6f3c8180ddc1f794480cf3e059317f", "score": "0.78261185", "text": "func (*Interface) IsYANGGoStruct() {}", "title": "" }, { "docid": "ac6f3c8180ddc1f794480cf3e059317f", "score": "0.78261185", "text": "func (*Interface) IsYANGGoStruct() {}", "title": "" }, { "docid": "88dcc2ca16453a5cde1b6767cf8da5ec", "score": "0.7813839", "text": "func (*NetworkInstance_Interface) IsYANGGoStruct() {}", "title": "" }, { "docid": "88dcc2ca16453a5cde1b6767cf8da5ec", "score": "0.7813839", "text": "func (*NetworkInstance_Interface) IsYANGGoStruct() {}", "title": "" }, { "docid": "88dcc2ca16453a5cde1b6767cf8da5ec", "score": "0.7813839", "text": "func (*NetworkInstance_Interface) IsYANGGoStruct() {}", "title": "" }, { "docid": "678edd94d975c25929026a13bcabcaff", "score": "0.77965665", "text": "func (*NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "678edd94d975c25929026a13bcabcaff", "score": "0.77965665", "text": "func (*NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "678edd94d975c25929026a13bcabcaff", "score": "0.779388", "text": "func (*NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "53bbd7e26e070c2265aceb5f24eb80f2", "score": "0.7723727", "text": "func (*NetworkInstance_Protocol_Isis_Interface_Af) IsYANGGoStruct() {}", "title": "" }, { "docid": "53bbd7e26e070c2265aceb5f24eb80f2", "score": "0.7722697", "text": "func (*NetworkInstance_Protocol_Isis_Interface_Af) IsYANGGoStruct() {}", "title": "" }, { "docid": "53bbd7e26e070c2265aceb5f24eb80f2", "score": "0.7722697", "text": "func (*NetworkInstance_Protocol_Isis_Interface_Af) IsYANGGoStruct() {}", "title": "" }, { "docid": "10346e1d4b25418c46d42971a01960cf", "score": "0.7714732", "text": "func (*Acl_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "10346e1d4b25418c46d42971a01960cf", "score": "0.7714732", "text": "func (*Acl_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "64966556a0511fc1ccc86bb437108b4a", "score": "0.77145076", "text": "func (*Mpls_SignalingProtocols_SegmentRouting_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "64966556a0511fc1ccc86bb437108b4a", "score": "0.77145076", "text": "func (*Mpls_SignalingProtocols_SegmentRouting_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "64966556a0511fc1ccc86bb437108b4a", "score": "0.77145076", "text": "func (*Mpls_SignalingProtocols_SegmentRouting_Interface_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "092bc17f282dc53cfe88f44306dca309", "score": "0.76859266", "text": "func (*Interface_Subinterface_Ipv6_Unnumbered_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "092bc17f282dc53cfe88f44306dca309", "score": "0.768556", "text": "func (*Interface_Subinterface_Ipv6_Unnumbered_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "092bc17f282dc53cfe88f44306dca309", "score": "0.7684737", "text": "func (*Interface_Subinterface_Ipv6_Unnumbered_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "1903c37ab3afabb86c477dceec5227cb", "score": "0.7678718", "text": "func (*Interface_RoutedVlan_Ipv6_Unnumbered_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "1903c37ab3afabb86c477dceec5227cb", "score": "0.7678651", "text": "func (*Interface_RoutedVlan_Ipv6_Unnumbered_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "b9bcec4f513927459192c323d4b27681", "score": "0.76785123", "text": "func (*NetworkInstance_Mpls_Interface) IsYANGGoStruct() {}", "title": "" }, { "docid": "b9bcec4f513927459192c323d4b27681", "score": "0.76785123", "text": "func (*NetworkInstance_Mpls_Interface) IsYANGGoStruct() {}", "title": "" }, { "docid": "b9bcec4f513927459192c323d4b27681", "score": "0.76785123", "text": "func (*NetworkInstance_Mpls_Interface) IsYANGGoStruct() {}", "title": "" }, { "docid": "1903c37ab3afabb86c477dceec5227cb", "score": "0.7678156", "text": "func (*Interface_RoutedVlan_Ipv6_Unnumbered_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "d4e76997683615d47d7fb8c956f37df4", "score": "0.7654874", "text": "func (*Interface_Subinterface_Ipv4_Unnumbered_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "d4e76997683615d47d7fb8c956f37df4", "score": "0.76518387", "text": "func (*Interface_Subinterface_Ipv4_Unnumbered_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "d4e76997683615d47d7fb8c956f37df4", "score": "0.76518387", "text": "func (*Interface_Subinterface_Ipv4_Unnumbered_InterfaceRef) IsYANGGoStruct() {}", "title": "" } ]
ee6f096a28ec506df31e2efa7e5b4312
GetIssuer gets Issuer, Tag 106
[ { "docid": "8bcb1e63a38f22385012c1561a81d713", "score": "0.67066455", "text": "func (m NoRelatedSym) GetIssuer() (v string, err quickfix.MessageRejectError) {\n\tvar f field.IssuerField\n\tif err = m.Get(&f); err == nil {\n\t\tv = f.Value()\n\t}\n\treturn\n}", "title": "" } ]
[ { "docid": "29be87c5ff6e9898a5d47250aa6dc31d", "score": "0.7146496", "text": "func GetIssuer(ctx context.Context, client client.Client, name types.NamespacedName) (api.GenericIssuer, error) {\n\tiss := new(api.AWSPCAIssuer)\n\terr := client.Get(ctx, name, iss)\n\tif err != nil {\n\t\tciss := new(api.AWSPCAClusterIssuer)\n\t\tcname := types.NamespacedName{\n\t\t\tName: name.Name,\n\t\t}\n\t\terr = client.Get(ctx, cname, ciss)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn ciss, nil\n\t}\n\treturn iss, nil\n}", "title": "" }, { "docid": "6a3939b4e94357ebe3eb97d1fccc6962", "score": "0.7015928", "text": "func (m Message) GetIssuer(f *field.IssuerField) quickfix.MessageRejectError {\n\treturn m.Body.Get(f)\n}", "title": "" }, { "docid": "6a3939b4e94357ebe3eb97d1fccc6962", "score": "0.7015928", "text": "func (m Message) GetIssuer(f *field.IssuerField) quickfix.MessageRejectError {\n\treturn m.Body.Get(f)\n}", "title": "" }, { "docid": "6a3939b4e94357ebe3eb97d1fccc6962", "score": "0.7015928", "text": "func (m Message) GetIssuer(f *field.IssuerField) quickfix.MessageRejectError {\n\treturn m.Body.Get(f)\n}", "title": "" }, { "docid": "6a3939b4e94357ebe3eb97d1fccc6962", "score": "0.7015928", "text": "func (m Message) GetIssuer(f *field.IssuerField) quickfix.MessageRejectError {\n\treturn m.Body.Get(f)\n}", "title": "" }, { "docid": "dab7933dc9d183b7a98e753fb206cb10", "score": "0.69507825", "text": "func (t *Token) GetIssuer() string {\n\treturn t.claim.Iss\n}", "title": "" }, { "docid": "3233746420d1d065273d441971bc9962", "score": "0.6846953", "text": "func (o ServerOutput) Issuer() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *Server) pulumi.StringOutput { return v.Issuer }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "62bad40795d0f93bad7ad6c82e85a0ad", "score": "0.68076175", "text": "func (o *IssuerObject) Issuer() *api.Issuer {\n\treturn o.Data().(*api.Issuer)\n}", "title": "" }, { "docid": "2fb17587c34b66a666d603437473a9b6", "score": "0.6729953", "text": "func (o *NFTDataResponse) GetIssuer() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Issuer\n}", "title": "" }, { "docid": "8f7ebe49f46418b019ad6bfb4cc32d84", "score": "0.6719839", "text": "func (o LookupOauthIdpConfigResultOutput) Issuer() pulumi.StringOutput {\n\treturn o.ApplyT(func(v LookupOauthIdpConfigResult) string { return v.Issuer }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "821b5e10523950d3825dc73c1c4344ce", "score": "0.6707901", "text": "func (o AuthServerDefaultOutput) Issuer() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *AuthServerDefault) pulumi.StringOutput { return v.Issuer }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "b9f8149fa0cba902955adb6d40ad65c6", "score": "0.66606015", "text": "func (m DontKnowTrade) GetIssuer() (v string, err quickfix.MessageRejectError) {\n\tvar f field.IssuerField\n\tif err = m.Get(&f); err == nil {\n\t\tv = f.Value()\n\t}\n\treturn\n}", "title": "" }, { "docid": "867bde84a7a2692008777ff392e3bd72", "score": "0.66289407", "text": "func (m Message) Issuer() (*field.IssuerField, quickfix.MessageRejectError) {\n\tf := &field.IssuerField{}\n\terr := m.Body.Get(f)\n\treturn f, err\n}", "title": "" }, { "docid": "867bde84a7a2692008777ff392e3bd72", "score": "0.66289407", "text": "func (m Message) Issuer() (*field.IssuerField, quickfix.MessageRejectError) {\n\tf := &field.IssuerField{}\n\terr := m.Body.Get(f)\n\treturn f, err\n}", "title": "" }, { "docid": "867bde84a7a2692008777ff392e3bd72", "score": "0.66289407", "text": "func (m Message) Issuer() (*field.IssuerField, quickfix.MessageRejectError) {\n\tf := &field.IssuerField{}\n\terr := m.Body.Get(f)\n\treturn f, err\n}", "title": "" }, { "docid": "867bde84a7a2692008777ff392e3bd72", "score": "0.66289407", "text": "func (m Message) Issuer() (*field.IssuerField, quickfix.MessageRejectError) {\n\tf := &field.IssuerField{}\n\terr := m.Body.Get(f)\n\treturn f, err\n}", "title": "" }, { "docid": "7e3d33002abce69b84421d9424db7044", "score": "0.6627614", "text": "func Issuer(o resources.Object) *IssuerObject {\n\n\tif o.IsA(issuerType) {\n\t\treturn &IssuerObject{o}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b90a8fdf7a727aef034338676abbce60", "score": "0.6606542", "text": "func (m NoQuoteEntries) GetIssuer() (v string, err quickfix.MessageRejectError) {\n\tvar f field.IssuerField\n\tif err = m.Get(&f); err == nil {\n\t\tv = f.Value()\n\t}\n\treturn\n}", "title": "" }, { "docid": "816d90e62d02a10073cf89667802c346", "score": "0.65983206", "text": "func (o VpnServerConfigurationAzureActiveDirectoryAuthenticationOutput) Issuer() pulumi.StringOutput {\n\treturn o.ApplyT(func(v VpnServerConfigurationAzureActiveDirectoryAuthentication) string { return v.Issuer }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "3aa7652929ba8f1da9e748ce9595f17e", "score": "0.658793", "text": "func FormatIssuer(cert *x509.Certificate) string {\n\treturn FormatPkixName(cert.RawIssuer, NameStyleLdap)\n}", "title": "" }, { "docid": "8795247c5796b1773eb73b62adc9f191", "score": "0.6579351", "text": "func (b *BearerToken) Issuer() *owner.ID {\n\tpubKey := crypto.UnmarshalPublicKey(b.token.GetSignature().GetKey())\n\n\twallet, err := owner.NEO3WalletFromPublicKey(pubKey)\n\tif err != nil {\n\t\treturn nil\n\t}\n\n\treturn owner.NewIDFromNeo3Wallet(wallet)\n}", "title": "" }, { "docid": "d5b38edb409a5c6579f7f6870df5a719", "score": "0.65507144", "text": "func (o AuthorizerJwtConfigurationOutput) Issuer() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v AuthorizerJwtConfiguration) *string { return v.Issuer }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "f5fb79ee474871d8767709651eb4bdfe", "score": "0.6548211", "text": "func (self *CX509certificateT) GetIssuer() (ret *CX509certPrincipalT) {\n\n\tcRet := C.cefingo_x509certificate_get_issuer((*C.cef_x509certificate_t)(self.pc_x509certificate))\n\n\tret = newCX509certPrincipalT(cRet, byApp) // return GoObj\n\treturn ret\n}", "title": "" }, { "docid": "185ac278bfbc76886f020419ff63fae3", "score": "0.6485846", "text": "func (_ERC20SimpleSwap *ERC20SimpleSwapCaller) Issuer(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _ERC20SimpleSwap.contract.Call(opts, out, \"issuer\")\n\treturn *ret0, err\n}", "title": "" }, { "docid": "b8cf5035e58324994e59247bd4cd3f24", "score": "0.6460152", "text": "func (o MfaTotpOutput) Issuer() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *MfaTotp) pulumi.StringOutput { return v.Issuer }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "b1d907ba1bae1373dbcdde09c7551d10", "score": "0.6446011", "text": "func (_ERC20SimpleSwap *ERC20SimpleSwapSession) Issuer() (common.Address, error) {\n\treturn _ERC20SimpleSwap.Contract.Issuer(&_ERC20SimpleSwap.CallOpts)\n}", "title": "" }, { "docid": "ced3a55d26fb489f06d6cf14e808dd69", "score": "0.64410204", "text": "func (r *IssuerService) Get(resourceId int64) *IssuerGetCall {\n\tc := &IssuerGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.resourceId = resourceId\n\treturn c\n}", "title": "" }, { "docid": "22574df6f2967c13d10e6574ba14ffce", "score": "0.64299273", "text": "func (m OrderCancelReplaceRequest) GetIssuer() (v string, err quickfix.MessageRejectError) {\n\tvar f field.IssuerField\n\tif err = m.Get(&f); err == nil {\n\t\tv = f.Value()\n\t}\n\treturn\n}", "title": "" }, { "docid": "35fdea7efb21ce7501b02f0ffae3841b", "score": "0.6415666", "text": "func (j *JWT) Issuer() string {\n\treturn j.claims.iss\n}", "title": "" }, { "docid": "924a487b67d934803c08a6a104ac9ff4", "score": "0.6405166", "text": "func (_ERC20SimpleSwap *ERC20SimpleSwapCallerSession) Issuer() (common.Address, error) {\n\treturn _ERC20SimpleSwap.Contract.Issuer(&_ERC20SimpleSwap.CallOpts)\n}", "title": "" }, { "docid": "bfad6e053f92e994236c693c6c05263d", "score": "0.63917243", "text": "func (o *IssuedCertificate) GetIssuer() string {\n\tif o == nil || o.Issuer == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Issuer\n}", "title": "" }, { "docid": "ccfe1cb9d6a4c879a924e08bb82b6192", "score": "0.6389219", "text": "func (o GetWindowsFunctionAppAuthSettingOutput) Issuer() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetWindowsFunctionAppAuthSetting) string { return v.Issuer }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "3fe73eb1cf22323a00212af930683143", "score": "0.63424367", "text": "func (o GetWindowsWebAppAuthSettingOutput) Issuer() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetWindowsWebAppAuthSetting) string { return v.Issuer }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "e76d3a89a2e95519efc5ebfe7a3b4549", "score": "0.6287223", "text": "func (m *OAuth) GetIssuerUrl() string {\n\tif m != nil {\n\t\treturn m.IssuerUrl\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "d59f432f1586abc6b49922dbc96cd0e4", "score": "0.6263444", "text": "func (o AuthorizerJwtConfigurationPtrOutput) Issuer() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *AuthorizerJwtConfiguration) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Issuer\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "4ea7a7219a2d0b8595add54fb940d525", "score": "0.62389034", "text": "func (m Message) GetEncodedIssuer(f *field.EncodedIssuerField) quickfix.MessageRejectError {\n\treturn m.Body.Get(f)\n}", "title": "" }, { "docid": "9c069adcec2448898bd752dc11b37d11", "score": "0.623074", "text": "func (m Mollie) Issuers() *IssuerAPI {\n\treturn m.issuers\n}", "title": "" }, { "docid": "fa09b8dbbb3766db05583c48eb24e215", "score": "0.6226746", "text": "func GetIssuer() *Issuer {\n\tif issuer != nil {\n\t\treturn issuer\n\t}\n\n\tlogger := common.GetLogger()\n\tlogger.Println(\"check the CA key and certificate...\")\n\n\t// CA store\n\tcaRootStoreName, carootOverriden := os.LookupEnv(\"CAROOT\")\n\tif !carootOverriden {\n\t\thomeDir, err := os.UserHomeDir()\n\t\tcommon.FatalIfErr(err, \"failed to get the user home directory\")\n\t\tcaRootStoreName = fmt.Sprintf(\"%s/.local/share/tinyca\", homeDir)\n\t\tif _, err = os.Stat(caRootStoreName); os.IsNotExist(err) {\n\t\t\terr = os.Mkdir(caRootStoreName, 0755)\n\t\t\tcommon.FatalIfErr(err, \"failed to create the CA root directory\")\n\t\t}\n\t}\n\tcaRootStoreStat, caRootStoreErr := os.Stat(caRootStoreName)\n\tif caRootStoreErr != nil {\n\t\tcommon.FatalIfErr(caRootStoreErr, \"failed to load the CA root store\")\n\t}\n\tif !caRootStoreStat.IsDir() {\n\t\tcommon.FatalIfErr(errors.New(\"the root store must be a directory\"), fmt.Sprintf(\"%s\", caRootStoreName))\n\t}\n\tlogger.Printf(\"CA store: %s\\n\", caRootStoreName)\n\n\t// CA key and crt creation\n\tcaKeyName, caKeyNameOverriden := os.LookupEnv(\"KEYNAME\")\n\tif !caKeyNameOverriden {\n\t\tcaKeyName = \"CAKey.pem\"\n\t}\n\tcaCrtName, caCrtNameOverriden := os.LookupEnv(\"CRTNAME\")\n\tif !caCrtNameOverriden {\n\t\tcaCrtName = \"CACrt.pem\"\n\t}\n\tcakeyPath := fmt.Sprintf(\"%s/%s\", caRootStoreName, caKeyName)\n\tcaCrtPath := fmt.Sprintf(\"%s/%s\", caRootStoreName, caCrtName)\n\t_, errKey := os.Stat(cakeyPath)\n\t_, errCA := os.Stat(caCrtPath)\n\tif os.IsNotExist(errKey) || os.IsNotExist(errCA) {\n\t\tlogger.Println(\"creating the CA key and the CA certificate...\")\n\t\tcaKey, err := generatePrivateKey(4096)\n\t\tcommon.FatalIfErr(err, \"failed to generate the CA private key\")\n\t\tcaCrt, err := createRootCertificate(caKey)\n\t\tcommon.FatalIfErr(err, \"failed to create the CA root\")\n\t\terr = writePrivateKeyToFilename(cakeyPath, &caKey)\n\t\tcommon.FatalIfErr(err, \"failed to write the CA private key\")\n\t\terr = writeCertificateToFilename(caCrtPath, caCrt)\n\t\tcommon.FatalIfErr(err, \"failed to write the CA root\")\n\t}\n\tif errKey != nil && !os.IsNotExist(errKey) {\n\t\tcommon.FatalIfErr(errKey, \"\")\n\t}\n\tif errCA != nil && !os.IsNotExist(errCA) {\n\t\tcommon.FatalIfErr(errCA, \"\")\n\t}\n\n\t// Load the CA key and certificate\n\tcaKey, err := readPrivateKeyFromFilename(cakeyPath)\n\tcommon.FatalIfErr(err, \"failed to read the CA private key\")\n\tcaCrt, err := readCertificateFromFilename(caCrtPath)\n\tcommon.FatalIfErr(err, \"failed to read the CA ROOT\")\n\tissuer = &Issuer{\n\t\tkey: caKey.(crypto.Signer),\n\t\tcrt: caCrt,\n\t}\n\n\tlogger.Println(\"the CA key and certificate are loaded properly!\")\n\tlogger.Printf(\"CA key: %s\\n\", cakeyPath)\n\tlogger.Printf(\"CA crt: %s\\n\", caCrtPath)\n\treturn issuer\n}", "title": "" }, { "docid": "e21a44140b115235c796a27498c97311", "score": "0.6164369", "text": "func (m DontKnowTrade) GetEncodedIssuer() (v string, err quickfix.MessageRejectError) {\n\tvar f field.EncodedIssuerField\n\tif err = m.Get(&f); err == nil {\n\t\tv = f.Value()\n\t}\n\treturn\n}", "title": "" }, { "docid": "58ebcee25536e405bbf0304111a355eb", "score": "0.6162544", "text": "func (o LookupSamlResultOutput) SpIssuer() pulumi.StringOutput {\n\treturn o.ApplyT(func(v LookupSamlResult) string { return v.SpIssuer }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "714c85cacb96ee1e587f36fde1caa258", "score": "0.6159611", "text": "func (m Message) EncodedIssuer() (*field.EncodedIssuerField, quickfix.MessageRejectError) {\n\tf := &field.EncodedIssuerField{}\n\terr := m.Body.Get(f)\n\treturn f, err\n}", "title": "" }, { "docid": "7996d76ffcc174c4413f997620d2ea63", "score": "0.6105787", "text": "func (d CertDetector) genIssuer(cert *x509.Certificate) map[string]interface{} {\n\tissuer := map[string]interface{}{\n\t\t\"commonName\": cert.Issuer.CommonName,\n\t\t\"organization\": cert.Issuer.Organization,\n\t\t\"organizationUnit\": cert.Issuer.OrganizationalUnit,\n\t\t\"country\": cert.Issuer.Country,\n\t\t\"province\": cert.Issuer.Province,\n\t\t\"locality\": cert.Issuer.Locality,\n\t\t\"streetAddress\": cert.Issuer.StreetAddress,\n\t}\n\t//flatten slice that with only one element\n\tfor k, v := range issuer {\n\t\ti := reflect.ValueOf(v)\n\t\tif i.Type().Kind() == reflect.Slice {\n\t\t\tif i.Len() == 1 {\n\t\t\t\tissuer[k] = i.Index(0).String()\n\t\t\t}\n\t\t}\n\t}\n\treturn issuer\n}", "title": "" }, { "docid": "0034ffe72dc1efc6b772974c478db05d", "score": "0.60916936", "text": "func (o *NormalizedProjectRevisionThirdPartyProvider) GetIssuerUrl() string {\n\tif o == nil || o.IssuerUrl == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.IssuerUrl\n}", "title": "" }, { "docid": "88fb4b330ed6750d50a03783c742d484", "score": "0.60844857", "text": "func (client BaseClient) GetCertificateIssuerSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}", "title": "" }, { "docid": "fc807dd24cdc15f6c02cf2c8cdcd152b", "score": "0.6075679", "text": "func (m *ManagedDeviceCertificateState) GetCertificateIssuer()(*string) {\n val, err := m.GetBackingStore().Get(\"certificateIssuer\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "title": "" }, { "docid": "70f9328b02eccdfc3e68789f490b4816", "score": "0.6070837", "text": "func (m OrderCancelReplaceRequest) GetEncodedIssuer() (v string, err quickfix.MessageRejectError) {\n\tvar f field.EncodedIssuerField\n\tif err = m.Get(&f); err == nil {\n\t\tv = f.Value()\n\t}\n\treturn\n}", "title": "" }, { "docid": "2dcd3b1d0cc1c4c6e9e94f4fb2e836ea", "score": "0.6066354", "text": "func (m *ExtAuthConfig_OAuthConfig) GetIssuerUrl() string {\n\tif m != nil {\n\t\treturn m.IssuerUrl\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "9ccc95cff7fcd15a133d979d30f34025", "score": "0.6059024", "text": "func (s credentialIssuerNamespaceLister) Get(name string) (*v1alpha1.CredentialIssuer, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"credentialissuer\"), name)\n\t}\n\treturn obj.(*v1alpha1.CredentialIssuer), nil\n}", "title": "" }, { "docid": "405fe6e858fcaca43e08d25679753dce", "score": "0.5991673", "text": "func (o *NFTDataResponse) GetIssuerOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Issuer, true\n}", "title": "" }, { "docid": "f78b1e970183124214d63f91fc3bb710", "score": "0.59836394", "text": "func (m NoQuoteEntries) GetEncodedIssuer() (v string, err quickfix.MessageRejectError) {\n\tvar f field.EncodedIssuerField\n\tif err = m.Get(&f); err == nil {\n\t\tv = f.Value()\n\t}\n\treturn\n}", "title": "" }, { "docid": "97bc1ded804620c24ed96e3e09820311", "score": "0.5945685", "text": "func (m DontKnowTrade) SetIssuer(v string) {\n\tm.Set(field.NewIssuer(v))\n}", "title": "" }, { "docid": "516076730c665c3bf4dd2f0cc7fd50ba", "score": "0.59430563", "text": "func (o *IssuedCertificate) GetIssuerOk() (*string, bool) {\n\tif o == nil || o.Issuer == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Issuer, true\n}", "title": "" }, { "docid": "4fc6e15d880c2b0b5a3605f4e3d4ca7d", "score": "0.59365207", "text": "func (c *Controller) issuerForIngress(ing *extv1beta1.Ingress) (name string, kind string) {\n\tname = c.defaults.issuerName\n\tkind = c.defaults.issuerKind\n\tannotations := ing.Annotations\n\tif annotations == nil {\n\t\tannotations = map[string]string{}\n\t}\n\tif issuerName, ok := annotations[issuerNameAnnotation]; ok {\n\t\tname = issuerName\n\t\tkind = v1alpha1.IssuerKind\n\t}\n\tif issuerName, ok := annotations[clusterIssuerNameAnnotation]; ok {\n\t\tname = issuerName\n\t\tkind = v1alpha1.ClusterIssuerKind\n\t}\n\treturn name, kind\n}", "title": "" }, { "docid": "87534138b605356df01058e38be4d273", "score": "0.59333205", "text": "func IssuerKind(ref cmmeta.ObjectReference) string {\n\tif ref.Kind == \"\" {\n\t\treturn cmapi.IssuerKind\n\t}\n\treturn ref.Kind\n}", "title": "" }, { "docid": "16b531bd010abb114c4e5b4ec4de64e1", "score": "0.59158087", "text": "func (o *NFTDataResponse) SetIssuer(v string) {\n\to.Issuer = v\n}", "title": "" }, { "docid": "426094133e7cce2270076dea833c161f", "score": "0.590945", "text": "func (ct *CredentialType) IssuerIdentifier() IssuerIdentifier {\n\treturn NewIssuerIdentifier(ct.SchemeManagerID + \".\" + ct.IssuerID)\n}", "title": "" }, { "docid": "37516139fdbd57df347e0166a5243889", "score": "0.5901846", "text": "func (client BaseClient) GetCertificateIssuerResponder(resp *http.Response) (result IssuerBundle, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK),\n\t\tautorest.ByUnmarshallingJSON(&result),\n\t\tautorest.ByClosing())\n\tresult.Response = autorest.Response{Response: resp}\n\treturn\n}", "title": "" }, { "docid": "81f97b9bffc3231805c4adfcd26d6c2d", "score": "0.59018207", "text": "func NewIssuer(c *config.Config) (*Issuer, error) {\n\tissuer, err := url.Parse(c.Auth.TokenIssuer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\texpiry, err := time.ParseDuration(c.Auth.TokenExpiry)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tbuf, err := ioutil.ReadFile(c.Auth.SigningKeyFile)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tblock, _ := pem.Decode(buf)\n\tkey, err := x509.ParsePKCS1PrivateKey(block.Bytes)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tsigningKey := jose.SigningKey{\n\t\tAlgorithm: jose.RS256,\n\t\tKey: key,\n\t}\n\n\tsigner, err := jose.NewSigner(signingKey, &jose.SignerOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tiss := &Issuer{\n\t\ttokenIssuer: issuer,\n\t\ttokenExpiry: expiry,\n\t\tsigner: signer,\n\t}\n\n\treturn iss, nil\n}", "title": "" }, { "docid": "46f605a988e1a858f12b9b788702c8eb", "score": "0.58710134", "text": "func TokenIssuer(rawtoken string) (string, error) {\n\tclaims, err := TokenClaims(rawtoken)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// Return issuer\n\tif len(claims.Issuer) != 0 {\n\t\treturn claims.Issuer, nil\n\t} else {\n\t\treturn \"\", fmt.Errorf(\"Issuer was not specified in the token\")\n\t}\n}", "title": "" }, { "docid": "3169c48f9e7b00235409edb77f165866", "score": "0.5833925", "text": "func (this *CertCache) findIssuer() *x509.Certificate {\n\tif !this.hasCert() {\n\t\treturn nil\n\t}\n\treturn this.findIssuerUsingCerts(this.certs)\n}", "title": "" }, { "docid": "131b4bc7223a1cd3f195f7f3fe4fdea6", "score": "0.5830591", "text": "func (m NoRelatedSym) SetIssuer(v string) {\n\tm.Set(field.NewIssuer(v))\n}", "title": "" }, { "docid": "d2fc10273643f0e034288e6fb95301dc", "score": "0.5828064", "text": "func NameForIssuer(i cmapi.GenericIssuer) (string, error) {\n\tswitch {\n\tcase i.GetSpec().ACME != nil:\n\t\treturn IssuerACME, nil\n\tcase i.GetSpec().CA != nil:\n\t\treturn IssuerCA, nil\n\tcase i.GetSpec().Vault != nil:\n\t\treturn IssuerVault, nil\n\tcase i.GetSpec().SelfSigned != nil:\n\t\treturn IssuerSelfSigned, nil\n\tcase i.GetSpec().Venafi != nil:\n\t\treturn IssuerVenafi, nil\n\t}\n\treturn \"\", fmt.Errorf(\"no issuer specified for Issuer '%s/%s'\", i.GetObjectMeta().Namespace, i.GetObjectMeta().Name)\n}", "title": "" }, { "docid": "4f3260c1dd4cbab5dddaf3da24eddd68", "score": "0.5788316", "text": "func (f *factory) IssuerFor(issuer v1alpha1.GenericIssuer) (Interface, error) {\n\tissuerType, err := nameForIssuer(issuer)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not get issuer type: %s\", err.Error())\n\t}\n\n\tconstructorsLock.RLock()\n\tdefer constructorsLock.RUnlock()\n\tif constructor, ok := constructors[issuerType]; ok {\n\t\treturn constructor(issuer, f.ctx)\n\t}\n\treturn nil, fmt.Errorf(\"issuer '%s' not registered\", issuerType)\n}", "title": "" }, { "docid": "687e49392249aeba9ee5502a0c4c7ec3", "score": "0.57648593", "text": "func Issuer() Option {\n\treturn func(iDToken *IDToken) error {\n\t\tiDToken.expectedIssuer = iDToken.oIDCConfig.Issuer\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "9c8b0e9d5a37cfa7ae3070f80dbe2b61", "score": "0.5757747", "text": "func (o SpringCloudApiPortalSsoOutput) IssuerUri() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v SpringCloudApiPortalSso) *string { return v.IssuerUri }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "88b28c430d74573031465eeec1e07030", "score": "0.57521796", "text": "func (o *IssuerObject) Spec() *api.IssuerSpec {\n\treturn &o.Issuer().Spec\n}", "title": "" }, { "docid": "f4d575de00e3ddecd56efe3f5880aeae", "score": "0.5747151", "text": "func (o AuthBackendOutput) BoundIssuer() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *AuthBackend) pulumi.StringPtrOutput { return v.BoundIssuer }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "0a97621052b5c2c98b9e9718d6dfb30c", "score": "0.57430214", "text": "func GetIssuerATV(pdu unsafe.Pointer) ([]pkix.AttributeTypeAndValue, error) {\n\tcert := (*C.struct_Certificate)(pdu)\n\treturn getNameATV(cert.tbsCertificate.issuer)\n}", "title": "" }, { "docid": "38f5d2fb7a6f16492fc2f2e396561750", "score": "0.57324964", "text": "func UpdateIssuer(credential *verifiable.Credential, profile *vcprofile.IssuerProfile) {\n\tif profile.OverwriteIssuer || credential.Issuer.ID == \"\" {\n\t\tcredential.Issuer = verifiable.Issuer{ID: profile.DID,\n\t\t\tCustomFields: verifiable.CustomFields{\"name\": profile.Name}}\n\t}\n}", "title": "" }, { "docid": "d94650513dfbdc31a78e66f4cdcd101e", "score": "0.5723953", "text": "func (m *MockWristbandIssuer) GetIssuer() string {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"GetIssuer\")\n\tret0, _ := ret[0].(string)\n\treturn ret0\n}", "title": "" }, { "docid": "999669cfcc078a51b1e7771ba774352d", "score": "0.57163763", "text": "func (m Message) GetUnderlyingIssuer(f *field.UnderlyingIssuerField) quickfix.MessageRejectError {\n\treturn m.Body.Get(f)\n}", "title": "" }, { "docid": "b61214bc1a329095eff5a8d208c29de3", "score": "0.5692643", "text": "func GetStellarIssuerAccounts() (models.AdminStellarAccountSlice, error) {\n\tissuers, err := models.AdminStellarAccounts(\n\t\tqm.Load(\"IssuerPublicKeyAdminStellarAssets\"),\n\t\tqm.Where(models.AdminStellarAccountColumns.Type+\"=?\", models.StellarAccountTypeIssuing)).AllG()\n\n\tif err == sql.ErrNoRows {\n\t\treturn nil, nil\n\t}\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn issuers, nil\n}", "title": "" }, { "docid": "4989284725cecd603adbbfc1d892a930", "score": "0.568763", "text": "func (m NoQuoteSets) GetUnderlyingIssuer() (v string, err quickfix.MessageRejectError) {\n\tvar f field.UnderlyingIssuerField\n\tif err = m.Get(&f); err == nil {\n\t\tv = f.Value()\n\t}\n\treturn\n}", "title": "" }, { "docid": "84a11760c55f17af4af39e861ffd13db", "score": "0.5659138", "text": "func (r *IssuerService) List() *IssuerListCall {\n\tc := &IssuerListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\treturn c\n}", "title": "" }, { "docid": "e807c63c96eb4c6fd4f1374ba11742ca", "score": "0.5651773", "text": "func (m DontKnowTrade) HasIssuer() bool {\n\treturn m.Has(tag.Issuer)\n}", "title": "" }, { "docid": "be10ddfdedf7b8362a91f02218039073", "score": "0.56372166", "text": "func (o SpringCloudGatewaySsoOutput) IssuerUri() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v SpringCloudGatewaySso) *string { return v.IssuerUri }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "e121f445979a23b64d04330413f47ac0", "score": "0.5637003", "text": "func Issuer(i string) Option {\n\treturn func(o *Options) {\n\t\to.Issuer = i\n\t}\n}", "title": "" }, { "docid": "21e014c43c3515afceffa8f810d90364", "score": "0.5627201", "text": "func (m Message) GetEncodedUnderlyingIssuer(f *field.EncodedUnderlyingIssuerField) quickfix.MessageRejectError {\n\treturn m.Body.Get(f)\n}", "title": "" }, { "docid": "1492e003f2b3b58ca453be2844fbd610", "score": "0.5614407", "text": "func GetIssuerWallet(sp view2.ServiceProvider, id string) *token.IssuerWallet {\n\tw := token.GetManagementService(sp).WalletManager().IssuerWallet(id)\n\tif w == nil {\n\t\treturn nil\n\t}\n\treturn w\n}", "title": "" }, { "docid": "a3477a4f9fa764ddc678071a6a24b157", "score": "0.56112677", "text": "func (m NoQuoteSets) GetEncodedUnderlyingIssuer() (v string, err quickfix.MessageRejectError) {\n\tvar f field.EncodedUnderlyingIssuerField\n\tif err = m.Get(&f); err == nil {\n\t\tv = f.Value()\n\t}\n\treturn\n}", "title": "" }, { "docid": "dc5e39777b6a1b1be3e651d7f1a6fc31", "score": "0.5594891", "text": "func getActiveServiceAccountIssuer(issuers []operatorv1.ServiceAccountIssuerStatus) string {\n\tfor i := range issuers {\n\t\tif issuers[i].ExpirationTime == nil {\n\t\t\treturn issuers[i].Name\n\t\t}\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "42d63e02edd5501f25113ec2cc786be2", "score": "0.55716443", "text": "func (o GetWindowsWebAppAuthSettingsV2CustomOidcV2Output) IssuerEndpoint() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetWindowsWebAppAuthSettingsV2CustomOidcV2) string { return v.IssuerEndpoint }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "1dbaaafc9c5ec7d6b159cb8fffd325bb", "score": "0.55664337", "text": "func (o AadAuthenticationParametersResponseOutput) AadIssuer() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v AadAuthenticationParametersResponse) *string { return v.AadIssuer }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "64a2dfa79ea94a0deb6c975271eb728b", "score": "0.556585", "text": "func (m *Manager) GetIssuersInfo() IssuerInfo {\n\tm.mu.Lock()\n\tdefer m.mu.Unlock()\n\treturn IssuerInfo{Signing: PrincipalInfo{\n\t\tTrustDomain: m.signingIssuer.TrustDomain,\n\t\tSpiffeEnabled: m.signingIssuer.SpiffeEnabled,\n\t}, Validating: PrincipalInfo{\n\t\tTrustDomain: m.validatingIssuer.TrustDomain,\n\t\tSpiffeEnabled: m.validatingIssuer.SpiffeEnabled},\n\t}\n}", "title": "" }, { "docid": "84f0dd5de9399b67b2296e6af86a404c", "score": "0.5564484", "text": "func (p google) Iss() []string {\n\treturn googleIss\n}", "title": "" }, { "docid": "69b1582ed1a8952f1ec7ea9db842e3e0", "score": "0.55472034", "text": "func (o GetWindowsFunctionAppAuthSettingsV2CustomOidcV2Output) IssuerEndpoint() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetWindowsFunctionAppAuthSettingsV2CustomOidcV2) string { return v.IssuerEndpoint }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "0e87e76ee33a334d552a9421dcf44a48", "score": "0.5531216", "text": "func (s *ExternalId) SetIssuer(v string) *ExternalId {\n\ts.Issuer = &v\n\treturn s\n}", "title": "" }, { "docid": "2b781e77f3b151d719b1ea6831a70b56", "score": "0.55212307", "text": "func (m OrderCancelReplaceRequest) SetIssuer(v string) {\n\tm.Set(field.NewIssuer(v))\n}", "title": "" }, { "docid": "385e183ccc0798550a0f1ddd67b2f324", "score": "0.5515504", "text": "func (m MapClaims) VerifyIssuer(cmp string, req bool) bool {\n\tiss, _ := m[\"iss\"].(string)\n\treturn verifyIss(iss, cmp, req)\n}", "title": "" }, { "docid": "385e183ccc0798550a0f1ddd67b2f324", "score": "0.5515504", "text": "func (m MapClaims) VerifyIssuer(cmp string, req bool) bool {\n\tiss, _ := m[\"iss\"].(string)\n\treturn verifyIss(iss, cmp, req)\n}", "title": "" }, { "docid": "89bc334f203ae3d014d9e0fc7bf8fb35", "score": "0.54853547", "text": "func (m NoRelatedSym) HasIssuer() bool {\n\treturn m.Has(tag.Issuer)\n}", "title": "" }, { "docid": "b2b60f8f8fc61fcf686d554ef1851f6c", "score": "0.5480012", "text": "func (m NoQuoteEntries) SetIssuer(v string) {\n\tm.Set(field.NewIssuer(v))\n}", "title": "" }, { "docid": "6e1900a1540a9ad46e64aef4c117a72b", "score": "0.5446778", "text": "func (s *CredentialSummary) SetIssuer(v string) *CredentialSummary {\n\ts.Issuer = &v\n\treturn s\n}", "title": "" }, { "docid": "b124f5453823fe17dfbf07586ee073cb", "score": "0.544281", "text": "func MyIssuerWallet(context view.Context) *token.IssuerWallet {\n\tw := token.GetManagementService(context).WalletManager().IssuerWallet(\"\")\n\tif w == nil {\n\t\treturn nil\n\t}\n\treturn w\n}", "title": "" }, { "docid": "f08043db666e37fd30f0d26dc10ef997", "score": "0.5442347", "text": "func (c *LoyaltyclassListCall) IssuerId(issuerId int64) *LoyaltyclassListCall {\n\tc.urlParams_.Set(\"issuerId\", fmt.Sprint(issuerId))\n\treturn c\n}", "title": "" }, { "docid": "efd1d10dcec5f8b8d4f843e67221f6a6", "score": "0.54371727", "text": "func issuerForVirtualServer(vs *vsapi.VirtualServer) (name, kind, group string, err error) {\n\tvar errs []string\n\tvsCmSpec := vs.Spec.TLS.CertManager\n\tvar issuerNameOK, clusterIssuerNameOK, groupNameOK, kindNameOK bool\n\n\tif vsCmSpec.Issuer != \"\" {\n\t\tname = vsCmSpec.Issuer\n\t\tkind, issuerNameOK = cmapi.IssuerKind, true\n\t}\n\n\tif vsCmSpec.ClusterIssuer != \"\" {\n\t\tname = vsCmSpec.ClusterIssuer\n\t\tkind, clusterIssuerNameOK = cmapi.ClusterIssuerKind, true\n\t}\n\n\tif vsCmSpec.IssuerKind != \"\" {\n\t\tkind, kindNameOK = vsCmSpec.IssuerKind, true\n\t}\n\n\tif vsCmSpec.IssuerGroup != \"\" {\n\t\tgroup, groupNameOK = vsCmSpec.IssuerGroup, true\n\t}\n\n\tif len(name) == 0 {\n\t\terrs = append(errs, \"failed to determine Issuer name to be used for VirtualServer resource\")\n\t}\n\n\tif issuerNameOK && clusterIssuerNameOK {\n\t\terrs = append(errs,\n\t\t\tfmt.Sprintf(\"both %q and %q may not be set\", issuerCmField, clusterIssuerCmField))\n\t}\n\n\tif clusterIssuerNameOK && groupNameOK {\n\t\terrs = append(errs,\n\t\t\tfmt.Sprintf(\"both %q and %q may not be set\", clusterIssuerCmField, issuerGroupCmField))\n\t}\n\n\tif clusterIssuerNameOK && kindNameOK {\n\t\terrs = append(errs,\n\t\t\tfmt.Sprintf(\"both %q and %q may not be set\", clusterIssuerCmField, issuerKindCmField))\n\t}\n\n\tif len(errs) > 0 {\n\t\treturn \"\", \"\", \"\", errors.New(strings.Join(errs, \", \"))\n\t}\n\n\treturn name, kind, group, nil\n}", "title": "" }, { "docid": "035564814788b1a1c84fa9b992ad8d3d", "score": "0.5432836", "text": "func (m OrderCancelReplaceRequest) HasIssuer() bool {\n\treturn m.Has(tag.Issuer)\n}", "title": "" }, { "docid": "941656a15260745c582e6793ef4790f8", "score": "0.54008925", "text": "func (o *NormalizedProjectRevisionThirdPartyProvider) GetIssuerUrlOk() (*string, bool) {\n\tif o == nil || o.IssuerUrl == nil {\n\t\treturn nil, false\n\t}\n\treturn o.IssuerUrl, true\n}", "title": "" }, { "docid": "829967ac9896a4ec899d7bc5964d385e", "score": "0.53901255", "text": "func (o VpnClientConfigurationResponseOutput) AadIssuer() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v VpnClientConfigurationResponse) *string { return v.AadIssuer }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "27e7171f83fec294e18c661cfe0cd6d4", "score": "0.53871304", "text": "func (o *IssuedCertificate) SetIssuer(v string) {\n\to.Issuer = &v\n}", "title": "" } ]
9e3f94aa29617edfdcce50d9754f2b01
HandleCmd Handles daemon get command.
[ { "docid": "085ffc6ac21a6e8c334a091811368a83", "score": "0.59331435", "text": "func HandleCmd(cmd *cobra.Command, args []string) (err error) {\n\ts := &http.Server{\n\t\tAddr: \"localhost:8888\",\n\t\tHandler: new(coreapi.Handler),\n\t\tReadTimeout: 10 * time.Second,\n\t\tWriteTimeout: 10 * time.Second,\n\t\tMaxHeaderBytes: 1 << 20,\n\t}\n\tlog.Fatal(s.ListenAndServe())\n\n\treturn\n}", "title": "" } ]
[ { "docid": "97485838ad9937c13791fec53df3dd82", "score": "0.64561343", "text": "func (app App) handleGet(w http.ResponseWriter, r *http.Request) {\n\tfmt.Fprintln(w, app.getCurlCommand(\"\"))\n}", "title": "" }, { "docid": "047c22e95a188e6353d6d2f62bd8b793", "score": "0.61463284", "text": "func GetCmdGetItem(queryRoute string, cdc *codec.Codec) *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse: \"id [key]\",\n\t\tShort: \"Query a item by key\",\n\t\tArgs: cobra.ExactArgs(1),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tcliCtx := context.NewCLIContext().WithCodec(cdc)\n\t\t\tkey := args[0]\n\n\t\t\tres, _, err := cliCtx.QueryWithData(fmt.Sprintf(\"custom/%s/%s/%s\", queryRoute, types.QueryGetItem, key), nil)\n\t\t\tif err != nil {\n\t\t\t\tfmt.Printf(\"could not resolve item %s \\n%s\\n\", key, err.Error())\n\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\tvar out types.Item\n\t\t\tcdc.MustUnmarshalJSON(res, &out)\n\t\t\treturn cliCtx.PrintOutput(out)\n\t\t},\n\t}\n}", "title": "" }, { "docid": "8d45cf0ed016c508d9c93693bdc576b7", "score": "0.614332", "text": "func (cui *PfUIS) HandleCmd(cmd string, args []string) (msg string, err error) {\n\t/* No error or message yet */\n\terr = nil\n\tmsg = \"\"\n\n\t/* Shadow args for debugging but hiding passwords */\n\tvargs := make([]string, len(args))\n\tcopy(vargs, args)\n\n\t/* Nothing to do when it is a GET */\n\tif cui.IsGET() {\n\t\t// cui.Dbg(\"GET is not a POST\")\n\t\treturn\n\t}\n\n\t/* Require POST */\n\tif !cui.IsPOST() {\n\t\t// cui.Dbg(\"Only POST\")\n\t\terr = errors.New(\"Only POST supported\")\n\t\treturn\n\t}\n\n\t/* Always check CSRF */\n\tok := cui.checkCSRF()\n\tif !ok {\n\t\terr = errors.New(\"Invalid HTML Form submitted\")\n\t\treturn\n\t}\n\n\tcui.Dbgf(\"HandleCmd(\\\"\"+cmd+\"\\\")[%s]\", args)\n\n\t/* Split up the command */\n\tcmds := strings.Split(cmd, \" \")\n\n\t/* Append arguments */\n\tcmds = append(cmds, args...)\n\n\t/* Walk the menu to find the command's menu */\n\tmenu, err := cui.WalkMenu(cmds)\n\n\tif err != nil {\n\t\tcui.Errf(\"WalkMenu(%v) failed: %s\", cmds, err.Error())\n\t\treturn\n\t}\n\n\t/* Command was not a menu, but already executed */\n\tif menu == nil {\n\t} else {\n\n\t\t/* Some commands don't take arguments */\n\t\tif menu.Args != nil {\n\t\t\tfor n := range menu.Args {\n\n\t\t\t\t/* Is there room for this? */\n\t\t\t\tif n >= len(args) {\n\t\t\t\t\t/* Is it required? */\n\t\t\t\t\tif n >= menu.Args_min {\n\t\t\t\t\t\t/* Optional */\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\n\t\t\t\t\terr = errors.New(\"Invalid argument\")\n\t\t\t\t\tcui.Err(\"HandleCmd(\" + cmd + \") missing variable room for argument (args:\" + strconv.Itoa(len(args)) + \")\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tif args[n] != \"\" {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\t/* Get the option along with optional arguments */\n\t\t\t\topt := strings.Split(menu.Args[n], \"#\")\n\n\t\t\t\tvar val string\n\n\t\t\t\t/* Any options? */\n\t\t\t\tnormval := true\n\t\t\t\tif len(opt) > 1 {\n\t\t\t\t\tswitch opt[1] {\n\t\t\t\t\tcase \"file\":\n\t\t\t\t\t\tnormval = false\n\t\t\t\t\t\tmaxsize := \"\"\n\t\t\t\t\t\tb64 := false\n\n\t\t\t\t\t\tif len(opt) > 2 {\n\t\t\t\t\t\t\tmaxsize = opt[2]\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif len(opt) > 3 {\n\t\t\t\t\t\t\tb64 = pf.IsTrue(opt[3])\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tval, err = cui.GetFormFile(opt[0], maxsize, b64)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif normval {\n\t\t\t\t\tval, err = cui.FormValue(opt[0])\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/* TODO: Verify value type, by filtering them */\n\t\t\t\t/* menu.args[n][1] */\n\n\t\t\t\t/* Mask arguments that should not be logged */\n\t\t\t\tswitch opt[0] {\n\t\t\t\tcase \"password\":\n\t\t\t\tcase \"twofactor\":\n\t\t\t\tcase \"keyring\":\n\t\t\t\t\tif val != \"\" {\n\t\t\t\t\t\tvargs[n] = \"*\" + opt[0] + \"*\"\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvargs[n] = \"(\" + opt[0] + \" not given)\"\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tdefault:\n\t\t\t\t\tvargs[n] = val\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\tcui.Dbg(\"Arg \" + opt[0] + \" = \" + vargs[n])\n\t\t\t\targs[n] = val\n\t\t\t}\n\t\t}\n\n\t\tcui.Dbg(\"Filling in menu - done\")\n\n\t\t/* Verify that we have the right amount of arguments */\n\t\tif len(args) < 0 {\n\t\t\terr = errors.New(\"Missing arguments\")\n\t\t\treturn\n\t\t}\n\n\t\t/* Execute the command */\n\t\tcmds = strings.Split(cmd, \" \")\n\t\tcmds = append(cmds, args...)\n\t\tcui.Dbgf(\"HandleCmd() - exec: %q\", cmds)\n\t\terr = cui.Cmd(cmds)\n\t}\n\n\tcui.Dbg(\"HandleCmd() - done\")\n\n\tmsg = cui.Buffered()\n\tcui.Dbgf(\"HandleCmd() - msg: %s\", msg)\n\tif err != nil {\n\t\tcui.Errf(\"HandleCmd() - err: %s\", err.Error())\n\t} else {\n\t\tcui.Dbg(\"HandleCmd() - no error\")\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "c213d2639e1c72e5ec1cae33f25157c4", "score": "0.5948601", "text": "func CommandGet(appName string, keys []string, global bool, quoted bool) error {\n\tappName, err := getAppNameOrGlobal(appName, global)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn SubGet(appName, keys, quoted)\n}", "title": "" }, { "docid": "f7e2df919bfab9698b70dc39b31e5c63", "score": "0.5947362", "text": "func NewGetCmd() (cmd *cobra.Command) {\n\topt := &downloadOption{}\n\tcmd = &cobra.Command{\n\t\tUse: \"get\",\n\t\tShort: \"download the file\",\n\t\tExample: \"hd get jenkins-zh/jenkins-cli/jcli --thread 6\",\n\t\tPreRunE: opt.preRunE,\n\t\tRunE: opt.runE,\n\t}\n\n\t// set flags\n\tflags := cmd.Flags()\n\tflags.StringVarP(&opt.Output, \"output\", \"o\", \"\", \"Write output to <file> instead of stdout.\")\n\tflags.BoolVarP(&opt.Fetch, \"fetch\", \"\", true,\n\t\t\"If fetch the latest config from https://github.com/LinuxSuRen/hd-home\")\n\tflags.IntVarP(&opt.Timeout, \"time\", \"\", 10,\n\t\t`The default timeout in seconds with the HTTP request`)\n\tflags.IntVarP(&opt.MaxAttempts, \"max-attempts\", \"\", 10,\n\t\t`Max times to attempt to download, zero means there's no retry action'`)\n\tflags.BoolVarP(&opt.ShowProgress, \"show-progress\", \"\", true, \"If show the progress of download\")\n\tflags.Int64VarP(&opt.ContinueAt, \"continue-at\", \"\", -1, \"ContinueAt\")\n\tflags.IntVarP(&opt.Thread, \"thread\", \"t\", 0,\n\t\t`Download file with multi-threads. It only works when its value is bigger than 1`)\n\tflags.BoolVarP(&opt.KeepPart, \"keep-part\", \"\", false,\n\t\t\"If you want to keep the part files instead of deleting them\")\n\tflags.StringVarP(&opt.Provider, \"provider\", \"\", ProviderGitHub, \"The file provider\")\n\tflags.StringVarP(&opt.OS, \"os\", \"\", runtime.GOOS, \"The OS of target binary file\")\n\tflags.StringVarP(&opt.Arch, \"arch\", \"\", runtime.GOARCH, \"The arch of target binary file\")\n\tflags.BoolVarP(&opt.PrintSchema, \"print-schema\", \"\", false,\n\t\t\"Print the schema of hdConfig if the flag is true without other function\")\n\treturn\n}", "title": "" }, { "docid": "93931b300250ebff0e2093f159b2df52", "score": "0.5940973", "text": "func (AppModuleBasic) GetQueryCmd(_ *codec.Codec) *cobra.Command { return nil }", "title": "" }, { "docid": "93931b300250ebff0e2093f159b2df52", "score": "0.5940973", "text": "func (AppModuleBasic) GetQueryCmd(_ *codec.Codec) *cobra.Command { return nil }", "title": "" }, { "docid": "d40b5bec18edcf83e4f2a8882e6f7253", "score": "0.5886795", "text": "func GetQueryCmd(cdc *codec.Codec) *cobra.Command {\n\treturn nil\n}", "title": "" }, { "docid": "2a388a72006190eb02500f86757c3419", "score": "0.5870144", "text": "func (cli *Get3WCli) CmdGet(args ...string) error {\n\tcmd := Cli.Subcmd(\"get\", []string{\"URL\", \"URL DIR\"}, Cli.Get3WCommands[\"get\"].Description, true)\n\tcmd.Require(flag.Min, 1)\n\tcmd.ParseFlags(args, true)\n\n\turl := cmd.Arg(0)\n\tdir := cmd.Arg(1)\n\n\treturn cli.get(url, dir)\n}", "title": "" }, { "docid": "86e27f1e21ef9930f2fc2caf5301d090", "score": "0.58345133", "text": "func NewGetCmd(a *app, recByDefault bool) *cobra.Command {\n\tvar recursive bool\n\n\tcmd := cobra.Command{\n\t\tUse: \"get PATH\",\n\t\tShort: \"Get a value from a key or list bucket content\",\n\t\tLong: `Get a value from a key or list bucket content.`,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tif len(args) != 1 {\n\t\t\t\treturn errors.New(\"Wrong number of arguments\")\n\t\t\t}\n\n\t\t\tout, err := a.Cli.Get(args[0], recursive)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t_, err = a.Out.Write(out)\n\t\t\treturn err\n\t\t},\n\t}\n\n\tcmd.Flags().BoolVarP(&recursive, \"recursive\", \"r\", recByDefault, \"display all the items recursively from the given bucket path.\")\n\n\treturn &cmd\n}", "title": "" }, { "docid": "f6e252e28ba112dc555ed79903e2c9a6", "score": "0.57518035", "text": "func (AppModuleBasic) GetQueryCmd() *cobra.Command { return nil }", "title": "" }, { "docid": "6038352d54679e32a665c997dc77617d", "score": "0.57251567", "text": "func GetCmdValue(queryRoute string, cdc *codec.Codec) *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse: \"values [name]\",\n\t\tShort: \"query name store value\",\n\t\tArgs: cobra.ExactArgs(1),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tcliCtx := context.NewCLIContext().WithCodec(cdc)\n\t\t\tname := args[0]\n\n\t\t\tres, _,err := cliCtx.QueryWithData(fmt.Sprintf(\"custom/%s/values/%s\", queryRoute, name), nil)\n\t\t\tif err != nil {\n\t\t\t\tfmt.Printf(\"could not resolve name - %s \\n\", string(name))\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\tvar out types.QueryResResolve\n\t\t\tcdc.MustUnmarshalJSON(res, &out)\n\t\t\treturn cliCtx.PrintOutput(out)\n\t\t},\n\t}\n}", "title": "" }, { "docid": "e52994ceb532cfe046a4fa00e8a7610c", "score": "0.57249177", "text": "func GetDexCmd(cdc *codec.Codec) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"get [creator]\",\n\t\tShort: \"Query dex for creator\",\n\t\tArgs: cobra.ExactArgs(1),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tcliCtx := context.NewCLIContext().WithCodec(cdc)\n\t\t\tgetter := types.NewDexRetriever(cliCtx)\n\n\t\t\tcreator, err := chainTypes.NewName(args[0])\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrap(err, \"creator\")\n\t\t\t}\n\n\t\t\tdex, _, err := getter.GetDexWithHeight(creator)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn cliCtx.PrintOutput(dex)\n\t\t},\n\t}\n\n\treturn flags.GetCommands(cmd)[0]\n}", "title": "" }, { "docid": "3ebb160dd00355d9d81d6dd937183760", "score": "0.5718161", "text": "func GetKVCmd(cdc *wire.Codec) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"kvget\",\n\t\tShort: \"Create and sign a send set kv tx\",\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tcliCtx := context.NewCLIContext().\n\t\t\t\tWithCodec(cdc).\n\t\t\t\tWithLogger(os.Stdout)\n\t\t\tkey := viper.GetString(flagKey)\n\t\t\tresult, err := cliCtx.QueryKV([]byte(key))\n\n\t\t\tfmt.Println(string(result))\n\t\t\treturn err\n\t\t},\n\t}\n\n\tcmd.Flags().String(flagKey, \"\", \"Key\")\n\tcmd.Flags().String(flagValue, \"\", \"Value\")\n\tcmd.Flags().String(flagPrivateKey, \"\", \"Private key\")\n\n\treturn cmd\n}", "title": "" }, { "docid": "d6e7489be1f086c9a98852e6d96da377", "score": "0.57107174", "text": "func (cw *CommandWrapper) GetCmd() []byte {\n\treturn cw.GetChild().GetValue()\n}", "title": "" }, { "docid": "65374d69dbad8a43ff1238020ff8c4fa", "score": "0.5687036", "text": "func runGetCmd() {\n\t// Get the job id\n\tvar job string\n\tif len(cli.SubCommandArgs) > 0 {\n\t\tjob = cli.SubCommandArgs[0]\n\t}\n\n\tif err := nomadClient.PrintJob(job, prettyPrintFlag); err != nil {\n\t\tcli.LogErr.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "5007043cc918972873d0ec36f488ffd0", "score": "0.56737953", "text": "func HandleCmd(repositoryURL, repositoryBranch, internalDepURL, cmd string) string {\n\tif repositoryURL != \"\" && repositoryBranch != \"\" && cmd != \"\" {\n\t\treplace1 := strings.Replace(cmd, \"%GIT_REPO%\", repositoryURL, -1)\n\t\treplace2 := strings.Replace(replace1, \"%GIT_BRANCH%\", repositoryBranch, -1)\n\t\treplace3 := strings.Replace(replace2, \"%INTERNAL_DEP_URL%\", internalDepURL, -1)\n\t\treturn replace3\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "52677c61f91c311f61e4fbdec18b3a85", "score": "0.5671186", "text": "func GetCmdGetItemByDenom(queryRoute string, cdc *codec.Codec) *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse: \"denom [denom]\",\n\t\tShort: \"Query items by denom\",\n\t\tArgs: cobra.ExactArgs(1),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tcliCtx := context.NewCLIContext().WithCodec(cdc)\n\t\t\tkey := args[0]\n\n\t\t\tres, _, err := cliCtx.QueryWithData(fmt.Sprintf(\"custom/%s/%s/%s\", queryRoute, types.QueryDenom, key), nil)\n\t\t\tif err != nil {\n\t\t\t\tfmt.Printf(\"could not resolve item %s \\n%s\\n\", key, err.Error())\n\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\tvar out types.Collection\n\t\t\tcdc.MustUnmarshalJSON(res, &out)\n\t\t\treturn cliCtx.PrintOutput(out)\n\t\t},\n\t}\n}", "title": "" }, { "docid": "24643d7f21dce51884730cdf4f2db00d", "score": "0.5633851", "text": "func (pb *PBServer) Get(args *GetArgs, reply *GetReply) error {\n\t// Your code here.\n\tpb.mu.Lock()\n\tdefer pb.mu.Unlock()\n\n\tif pb.view.Primary == pb.me { //primary server\n\t\tif pb.replicateGet(args, reply) {\n\t\t\tpb.getHelper(args, reply)\n\t\t} else {\n\t\t\treply.Value = \"\"\n\t\t\treply.Err = ErrWrongServer\n\t\t}\n\t} else if pb.view.Backup == pb.me { //backup server\n\t\tif args.Me == pb.view.Primary {\n\t\t\tpb.getHelper(args, reply)\n\t\t} else { //Call not from primary server\n\t\t\treply.Value = \"\"\n\t\t\treply.Err = ErrWrongServer\n\t\t}\n\t} else { //other server\n\t\treply.Value = \"\"\n\t\treply.Err = ErrWrongServer\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "d3e3bb84e2d07ff8ba4f622230ca6016", "score": "0.55876696", "text": "func GetQueryCmd(cdc *codec.Codec) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: types.ModuleName,\n\t\tShort: \"Querying commands for the dex module\",\n\t\tDisableFlagParsing: true,\n\t\tSuggestionsMinimumDistance: 2,\n\t\tRunE: client.ValidateCmd,\n\t}\n\n\tcmd.AddCommand(\n\t\tGetDexCmd(cdc),\n\t\tGetSymbol(cdc),\n\t\tGetSigInCmd(cdc),\n\t)\n\n\treturn cmd\n}", "title": "" }, { "docid": "625699c62e512225886974d534f8b8cb", "score": "0.5586776", "text": "func NewGetCmd(out io.Writer) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"get\",\n\t\tShort: \"Get functions\",\n\t\tLong: ``,\n\t}\n\n\tcmd.AddCommand(\n\t\torca.NewGetEnvCmd(out),\n\t\torca.NewGetResourceCmd(out),\n\t\torca.NewGetArtifactCmd(out),\n\t)\n\n\treturn cmd\n}", "title": "" }, { "docid": "eab6d36879702afb57d510b4e666d9a8", "score": "0.5540116", "text": "func (c Container) GetCmd() strslice.StrSlice {\n\treturn strslice.StrSlice(append([]string{c.EntryPoint}, c.Args...))\n}", "title": "" }, { "docid": "daf7d661dd2174812b9a66dd58e6f49d", "score": "0.55386466", "text": "func newGetCmd() *cobra.Command {\n\tgetCmd := &cobra.Command{\n\t\tUse: \"get\",\n\t\tShort: \"get resource info\",\n\t\tLong: \"get infos from bcs-user-manager\",\n\t}\n\tgetCmd.AddCommand(getAdminUserCmd())\n\tgetCmd.AddCommand(getSaasUserCmd())\n\tgetCmd.AddCommand(getPlainUserCmd())\n\tgetCmd.AddCommand(getRegisterTokenCmd())\n\tgetCmd.AddCommand(getCredentialsCmd())\n\tgetCmd.AddCommand(getPermissionCmd())\n\tgetCmd.AddCommand(getTokenCmd())\n\tgetCmd.AddCommand(getTokenByUserAndClusterIDCmd())\n\treturn getCmd\n}", "title": "" }, { "docid": "c1436ae457e64fe9749f51263b76b4b3", "score": "0.55343664", "text": "func RunCmdTagGet(c *CmdConfig) error {\n\terr := ensureOneArg(c)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tname := c.Args[0]\n\tts := c.Tags()\n\tt, err := ts.Get(name)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn c.Display(&displayers.Tag{Tags: do.Tags{*t}})\n}", "title": "" }, { "docid": "df277b905d4aebb751c9d538a4c5b150", "score": "0.5518449", "text": "func (r *Runtime) cmd(cmd string) (string, error) {\n\n\t// connect to haproxy\n\tconn, err_conn := net.Dial(\"unix\", r.SockFile)\n\tdefer conn.Close()\n\n\tif err_conn != nil {\n\t\treturn \"\", errors.New(\"Unable to connect to Haproxy socket\")\n\t} else {\n\n\t\tfmt.Fprint(conn, cmd)\n\n\t\tresponse := \"\"\n\n\t\tscanner := bufio.NewScanner(conn)\n\t\tfor scanner.Scan() {\n\t\t\tresponse += (scanner.Text() + \"\\n\")\n\t\t}\n\t\tif err := scanner.Err(); err != nil {\n\t\t\treturn \"\", err\n\t\t} else {\n\t\t\treturn response, nil\n\t\t}\n\n\t}\n}", "title": "" }, { "docid": "97ec43e068224745a72f5d18e41c5a2a", "score": "0.5510201", "text": "func (i *Inter) getCmd(name string) *Cmd {\n\tname = strings.ToLower(name)\n\tname = strings.Join(strings.Fields(name), \"-\")\n\tif name == \"\" {\n\t\treturn nil\n\t}\n\ti.mu.Lock()\n\tdefer i.mu.Unlock()\n\treturn i.cmds[name]\n}", "title": "" }, { "docid": "e56e7efabb959037a32690b9b2d9090b", "score": "0.54953116", "text": "func GetSigInCmd(cdc *codec.Codec) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"getSigIn [account] [dex]\",\n\t\tShort: \"Query sigIn status for account to dex\",\n\t\tArgs: cobra.ExactArgs(2),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tcliCtx := context.NewCLIContext().WithCodec(cdc)\n\t\t\tgetter := types.NewDexRetriever(cliCtx)\n\n\t\t\tacc, err := chainTypes.NewAccountIDFromStr(args[0])\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrap(err, \"acc\")\n\t\t\t}\n\n\t\t\tdex, err := chainTypes.NewAccountIDFromStr(args[1])\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrap(err, \"dex\")\n\t\t\t}\n\n\t\t\tc, _, err := getter.GetSigInWithHeight(acc, dex)\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrap(err, \"get\")\n\t\t\t}\n\n\t\t\treturn cliCtx.PrintOutput(c)\n\t\t},\n\t}\n\n\treturn flags.GetCommands(cmd)[0]\n}", "title": "" }, { "docid": "d836252073f6fc0444509d2c355b4e44", "score": "0.54913425", "text": "func GetQueryCmd(storeKey string, cdc *codec.Codec) *cobra.Command {\n\toracleCmd := &cobra.Command{\n\t\tUse: types.ModuleName,\n\t\tShort: \"Querying commands for the oracle module\",\n\t\tDisableFlagParsing: true,\n\t\tSuggestionsMinimumDistance: 2,\n\t\tRunE: client.ValidateCmd,\n\t}\n\toracleCmd.AddCommand(flags.GetCommands(\n\t\tGetQueryCmdParams(storeKey, cdc),\n\t\tGetQueryCmdCounts(storeKey, cdc),\n\t\tGetQueryCmdDataSource(storeKey, cdc),\n\t\tGetQueryCmdOracleScript(storeKey, cdc),\n\t\tGetQueryCmdRequest(storeKey, cdc),\n\t)...)\n\treturn oracleCmd\n}", "title": "" }, { "docid": "64732bdf685eab9d29ab82ef882cd793", "score": "0.5487516", "text": "func NewGetCmd() *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse: \"get [version to get]\",\n\t\tShort: \"Download the kubectl version specified\",\n\t\tArgs: cobra.ExactArgs(1),\n\t\tSilenceUsage: true,\n\t\tExample: `\n Download version 1.20.0. Note well: the patch version is automatically inferred:\n $ kuberlr get 1.20\n \n Versions can be specified with, or without the 'v' prefix:\n $ kuberlr get v1.19.1`,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tversion, err := semver.ParseTolerant(args[0])\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"Invalid version: %v\", err)\n\t\t\t}\n\n\t\t\tdestination := filepath.Join(\n\t\t\t\tcommon.LocalDownloadDir(),\n\t\t\t\tcommon.BuildKubectlNameForLocalBin(version))\n\n\t\t\td := downloader.Downloder{}\n\t\t\treturn d.GetKubectlBinary(version, destination)\n\t\t},\n\t}\n}", "title": "" }, { "docid": "e4c84a52b22660b7d0eae4694292e706", "score": "0.5487081", "text": "func NewGetCommand() cli.Command {\n\treturn cli.Command{\n\t\tName: \"get\",\n\t\tUsage: \"retrieve the value of a key\",\n\t\tAction: func(c *cli.Context) {\n\t\t\trawhandle(c, getCommandFunc)\n\t\t},\n\t}\n}", "title": "" }, { "docid": "32dc8b2fa0a588916dfcec5c7275d030", "score": "0.5476426", "text": "func (c *LoggedInContext) GetTVCommandHandler(rw web.ResponseWriter, req *web.Request) {\n\tcommand, ok := req.PathParams[\"command\"]\n\tif !ok {\n\t\thttp.Error(rw, \"400: Command not provided\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tvar cresp string\n\tvar err error\n\n\tswitch command {\n\tcase \"powerstatus\":\n\t\tcresp, err = TVGetStatus()\n\tcase \"poweron\":\n\t\tcresp, err = TVTurnOn()\n\tcase \"poweroff\":\n\t\tcresp, err = TVTurnOff()\n\tcase \"hdmi4\":\n\t\tcresp, err = TVSelectHDMI4()\n\tcase \"hdmi2\":\n\t\tcresp, err = TVSelectHDMI2()\n\tcase \"hdmi1\":\n\t\tcresp, err = TVSelectHDMI1()\n\tcase \"volumeup\":\n\t\tcresp, err = TVVolumeUp()\n\tcase \"volumedown\":\n\t\tcresp, err = TVVolumeDown()\n\tdefault:\n\t\t//unknown command\n\t\thttp.Error(rw, \"400: Bad tv command: \"+command, http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tc.SetNotificationMessage(rw, req, cresp)\n\tif err != nil {\n\t\tc.SetErrorMessage(rw, req, err.Error())\n\t}\n\n\thttp.Redirect(rw, req.Request, HomeURL.Make(), http.StatusFound)\n}", "title": "" }, { "docid": "29cc8193c72c74cbe4d8c1dc774b70f6", "score": "0.54741967", "text": "func GetCmdPost(queryRoute string, cdc *codec.Codec) *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse: \"post <owner> <uuid>\",\n\t\tShort: \"Query post\",\n\t\tArgs: cobra.ExactArgs(2),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tcliCtx := context.NewCLIContext().WithCodec(cdc)\n\n\t\t\tbz, _, err := cliCtx.QueryWithData(fmt.Sprintf(\"custom/%s/post/%s/%s\", queryRoute, args[0], args[1]), nil)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tvar out types.Post\n\t\t\tcdc.MustUnmarshalBinaryBare(bz, &out)\n\n\t\t\treturn cliCtx.PrintOutput(out)\n\t\t},\n\t}\n}", "title": "" }, { "docid": "f3190c2cfabb196cf5fb89767b6df7e7", "score": "0.54442525", "text": "func (a AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command {\n\treturn cli.GetQueryCmd(cdc)\n}", "title": "" }, { "docid": "d0c2a86ea0c27567d0cc4cf13ed54f3f", "score": "0.5442109", "text": "func GetQueryCmd(cdc *codec.Codec) *cobra.Command {\n\tmintingQueryCmd := &cobra.Command{\n\t\tUse: types.ModuleName,\n\t\tShort: \"Querying commands for the minting module\",\n\t\tDisableFlagParsing: true,\n\t\tSuggestionsMinimumDistance: 2,\n\t\tRunE: client.ValidateCmd,\n\t}\n\n\tmintingQueryCmd.AddCommand(\n\t\tflags.GetCommands(\n\t\t\tGetCmdQueryParams(cdc),\n\t\t\tGetCmdQueryInflation(cdc),\n\t\t\tGetCmdQueryAnnualProvisions(cdc),\n\t\t)...,\n\t)\n\n\treturn mintingQueryCmd\n}", "title": "" }, { "docid": "61721e8dd354a4a5b4b144bbce9a0346", "score": "0.54266953", "text": "func (r *runnable) GetD(update GetUpdatePolicy, packages ...string) error {\n\targs := []string{\"get\", \"-d\"}\n\tif r.r.insecure {\n\t\targs = append(args, \"-insecure\")\n\t}\n\tif update != NoUpdatePolicy {\n\t\targs = append(args, string(update))\n\t}\n\treturn r.r.execGo(r.ctx, r.dir, r.modFile, append(args, packages...)...)\n}", "title": "" }, { "docid": "0e43d0ef9416682fd52f8c6ebe19549d", "score": "0.5420916", "text": "func (c client) GetCommand(smallSpec *util.CommandSpec) (*util.CommandSpec, error) {\n\turi, err := url.Parse(c.baseURL)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Failed to parse URL on GET: %v\", err)\n\t}\n\turi.Path = path.Join(uri.Path, \"commands\", smallSpec.Namespace, smallSpec.Name, smallSpec.Version)\n\n\t// No payload\n\tpayload := new(bytes.Buffer)\n\n\tresponseSpec, err := c.httpRequest(\"GET\", uri.String(), defaultContentType, payload)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn responseSpec, nil\n}", "title": "" }, { "docid": "1e5bf68983b35b1dd6ee8d2f0c571454", "score": "0.5416208", "text": "func getCmd(dir string) *exec.Cmd {\n\t// default cmd and arg\n\tname := \"terraform\"\n\n\tvar args []string\n\n\t// check if Directory is provided\n\tif dir != \".\" {\n\t\targs = append(args, fmt.Sprintf(\"-chdir=%s\", dir))\n\t}\n\n\targs = append(args, \"get\")\n\n\treturn exec.Command(\n\t\tname,\n\t\targs...,\n\t)\n}", "title": "" }, { "docid": "4e88082838639e787543f4e66ed5a66b", "score": "0.54054177", "text": "func GetCommand() *cobra.Command {\n\tcommand := &cobra.Command{\n\t\tUse: \"dashboard\",\n\t\tShort: \"Launch web dashboard\",\n\t\tExample: \" goptuna dashboard --storage sqlite:///example.db --host 127.0.0.1 --port 8000\",\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tstorageURL, err := cmd.Flags().GetString(\"storage\")\n\t\t\tif err != nil {\n\t\t\t\tcmd.PrintErrln(err)\n\t\t\t\tos.Exit(1)\n\t\t\t}\n\t\t\tif storageURL == \"\" {\n\t\t\t\tcmd.PrintErrln(\"Storage URL is specified neither in config file nor --storage option.\")\n\t\t\t\tos.Exit(1)\n\t\t\t}\n\n\t\t\tdb, err := sqlalchemy.GetGormDBFromURL(storageURL, nil)\n\t\t\tif err != nil {\n\t\t\t\tcmd.PrintErrln(err)\n\t\t\t\tos.Exit(1)\n\t\t\t}\n\n\t\t\t// Enable cascade on delete\n\t\t\tif db.Dialector.Name() == \"sqlite\" {\n\t\t\t\terr = db.Exec(\"PRAGMA foreign_keys = ON\").Error\n\t\t\t\tif err != nil {\n\t\t\t\t\tcmd.PrintErrln(err)\n\t\t\t\t\tos.Exit(1)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstorage := rdb.NewStorage(db)\n\n\t\t\tserver, err := dashboard.NewServer(storage)\n\t\t\tif err != nil {\n\t\t\t\tcmd.PrintErrln(err)\n\t\t\t\tos.Exit(1)\n\t\t\t}\n\n\t\t\thostName, err := cmd.Flags().GetString(\"host\")\n\t\t\tif err != nil {\n\t\t\t\tcmd.PrintErrln(err)\n\t\t\t\tos.Exit(1)\n\t\t\t}\n\t\t\tport, err := cmd.Flags().GetString(\"port\")\n\t\t\tif err != nil {\n\t\t\t\tcmd.PrintErrln(err)\n\t\t\t\tos.Exit(1)\n\t\t\t}\n\t\t\taddr := fmt.Sprintf(\"%s:%s\", hostName, port)\n\n\t\t\tcmd.Printf(\"Started to serve at http://%s\\n\", addr)\n\t\t\tif err := http.ListenAndServe(addr, server); err != nil {\n\t\t\t\tcmd.PrintErrln(err)\n\t\t\t\tos.Exit(1)\n\t\t\t}\n\t\t},\n\t}\n\tcommand.Flags().StringP(\n\t\t\"storage\", \"\", \"\", \"DB URL specified in Engine Database URL format of SQLAlchemy (e.g. sqlite:///example.db). See https://docs.sqlalchemy.org/en/13/core/engines.html for more details.\")\n\tcommand.Flags().StringP(\"host\", \"\", \"127.0.0.1\", \"hostname\")\n\tcommand.Flags().StringP(\"port\", \"p\", \"8000\", \"port number\")\n\treturn command\n}", "title": "" }, { "docid": "540d5ba195f0e9194ec86939e2c6cfe7", "score": "0.53967863", "text": "func (kub *Kubectl) Get(namespace string, command string) *CmdRes {\n\treturn kub.ExecShort(fmt.Sprintf(\n\t\t\"%s -n %s get %s -o json\", KubectlCmd, namespace, command))\n}", "title": "" }, { "docid": "c05c08c0b64b4ae0da99b08b4b32c013", "score": "0.53819674", "text": "func newGetCommand(cli *client.Cli) *cobra.Command {\n\tvar cmd = &cobra.Command{\n\t\tUse: \"get [flags] \",\n\t\tShort: \"Get deployments\",\n\t\tLong: deploymentGetLong,\n\t\tExample: deploymentGetExample,\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\trunGet(cmd, cli, args)\n\t\t},\n\t}\n\n\tdeploymentState = &[]string{}\n\tcmd.Flags().StringSliceVarP(&commandOptionsGet.AppName, \"appName\", \"n\", []string{}, \"Application Name\")\n\tcmd.Flags().StringSliceVarP(&commandOptionsGet.AppServer, \"appServer\", \"a\", []string{}, \"Application Server Name\")\n\tcmd.Flags().StringSliceVarP(deploymentState, \"deploymentState\", \"d\", []string{}, \"deployment State\")\n\tcmd.Flags().StringSliceVarP(&commandOptionsGet.Environment, \"environment\", \"e\", []string{}, \"Environment Filter\")\n\tcmd.Flags().BoolVarP(&commandOptionsGet.OnlyLatest, \"onlyLatest\", \"l\", false, \"Only Latest Filter\")\n\tcmd.Flags().IntVarP(&commandOptionsGet.TrackingID, \"trackingId\", \"t\", -1, \"Tracking ID\")\n\tcmd.Flags().IntSliceVarP(&commandOptionsGet.ID, \"id\", \"i\", []int{}, \"Deployment ID\")\n\tcmd.Flags().StringVarP(&deploymentFilter, \"filter\", \"f\", \"\", \"Deployment filter in JSON\")\n\n\treturn cmd\n}", "title": "" }, { "docid": "3760274a19d368f2fff8282fc8376449", "score": "0.5377453", "text": "func ShowCmd(value string) (string, error) {\n\n\tvar (\n\t\thistoryData []byte // Data representing our history file\n\t\tcmd string // List of commands produced after unmarshalling historyData\n\t\terr error // Any errors we might encounter\n\t)\n\n\tencodedSecret := getBase64(GetSecret())\n\tencodedCommandHash := getBase64(value)\n\n\turl := \"http://localhost:8999/secret/\" + encodedSecret + \"/show/cmdHash/\" + encodedCommandHash\n\n\tresp, err := http.Get(url)\n\n\tif err != nil {\n\t\treturn cmd, err\n\t}\n\n\tdefer resp.Body.Close()\n\n\thistoryData, _ = ioutil.ReadAll(resp.Body)\n\n\tjson.Unmarshal(historyData, &cmd)\n\n\treturn cmd, err\n}", "title": "" }, { "docid": "0c543ebc993cdad46938ebcdef39d418", "score": "0.53698874", "text": "func GetQueryCmd(storeKey string, cdc *codec.Codec) *cobra.Command {\n\therbQueryCmd := &cobra.Command{\n\t\tUse: types.ModuleName,\n\t\tShort: \"Querying commands for the herb module\",\n\t\tDisableFlagParsing: true,\n\t\tSuggestionsMinimumDistance: 2,\n\t\tRunE: client.ValidateCmd,\n\t}\n\n\therbQueryCmd.AddCommand(client.GetCommands(\n\t\tGetCmdAggregatedCiphertext(storeKey, cdc),\n\t\tGetCmdAllCiphertexts(storeKey, cdc),\n\t\tGetCmdAllDecryptionShares(storeKey, cdc),\n\t\tGetCmdCurrentRound(storeKey, cdc),\n\t\tGetCmdRoundStage(storeKey, cdc),\n\t\tGetCmdRoundResult(storeKey, cdc),\n\t)...)\n\n\treturn herbQueryCmd\n}", "title": "" }, { "docid": "7fd13bbeb5d3532f19db7ca77e76129d", "score": "0.5363743", "text": "func CmdHandler(cmd string) (err error) {\n\tcmdSplit := util.ParseCmd(cmd)\n\tif len(cmdSplit) < 0 {\n\t\treturn\n\t}\n\n\tswitch {\n\tcase cmd == \"\":\n\t\treturn\n\tcase cmdSplit[0] == HELP:\n\t\tif len(cmdSplit) > 2 {\n\t\t\tCliPrintError(\"WTF?\")\n\t\t\treturn\n\t\t}\n\t\tif len(cmdSplit) == 1 {\n\t\t\tCmdHelp(\"\")\n\t\t\treturn\n\t\t}\n\t\tCmdHelp(cmdSplit[1])\n\n\tcase cmdSplit[0] == \"use\":\n\t\tif len(cmdSplit) != 2 {\n\t\t\tCliPrintError(\"use what? \" + strconv.Quote(cmd))\n\t\t\treturn\n\t\t}\n\t\tdefer SetDynamicPrompt()\n\t\tfor mod := range ModuleHelpers {\n\t\t\tif mod == cmdSplit[1] {\n\t\t\t\tCurrentMod = cmdSplit[1]\n\t\t\t\tfor k := range Options {\n\t\t\t\t\tdelete(Options, k)\n\t\t\t\t}\n\t\t\t\tUpdateOptions(CurrentMod)\n\t\t\t\tCliPrintInfo(\"Using module %s\", strconv.Quote(CurrentMod))\n\t\t\t\tModuleDetails(CurrentMod)\n\t\t\t\tdescription, exists := emp3r0r_data.ModuleComments[CurrentMod]\n\t\t\t\tif exists {\n\t\t\t\t\tCliPrint(\"%s\", description)\n\t\t\t\t}\n\t\t\t\tCliListOptions()\n\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tCliPrintError(\"No such module: %s\", strconv.Quote(cmdSplit[1]))\n\n\tdefault:\n\t\thelper := CmdFuncs[cmd]\n\t\tif helper != nil {\n\t\t\thelper()\n\t\t\treturn\n\t\t}\n\t\thelper_w_arg := CmdFuncsWithArgs[cmdSplit[0]]\n\t\tif helper_w_arg == nil && CurrentTarget != nil {\n\t\t\tCliPrintWarning(\"Exec: %s on %s\", strconv.Quote(cmd), strconv.Quote(CurrentTarget.Tag))\n\t\t\tSendCmdToCurrentTarget(cmd, \"\")\n\t\t\treturn\n\t\t}\n\t\tif CurrentTarget == nil && helper_w_arg == nil {\n\t\t\tCliPrintError(\"No agent selected, try `target <index>`\")\n\t\t\treturn\n\t\t}\n\t\thelper_w_arg(cmd)\n\t}\n\treturn\n}", "title": "" }, { "docid": "cdbe39b867254601930dadfa3b718942", "score": "0.5355513", "text": "func SelectCmd(value string) (Command, error) {\n\n\tvar (\n\t\thistoryData []byte // Data representing our history file\n\t\tcmd Command // List of commands produced after unmarshalling historyData\n\t\terr error // Any errors we might encounter\n\t)\n\n\tencodedSecret := getBase64(GetSecret())\n\tencodedCommandHash := getBase64(value)\n\n\turl := \"http://localhost:8999/secret/\" + encodedSecret + \"/select/cmdHash/\" + encodedCommandHash\n\n\tresp, err := http.Get(url)\n\n\tif err != nil {\n\t\treturn cmd, err\n\t}\n\n\tdefer resp.Body.Close()\n\n\thistoryData, _ = ioutil.ReadAll(resp.Body)\n\n\tjson.Unmarshal(historyData, &cmd)\n\n\treturn cmd, err\n}", "title": "" }, { "docid": "6f619dd3f1afaa0d11aee686f8341e56", "score": "0.5346927", "text": "func GetCmdGetItemByOwner(queryRoute string, cdc *codec.Codec) *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse: \"addr [address]\",\n\t\tShort: \"Query a item by owner\",\n\t\tArgs: cobra.ExactArgs(1),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tcliCtx := context.NewCLIContext().WithCodec(cdc)\n\t\t\tkey := args[0]\n\n\t\t\tres, _, err := cliCtx.QueryWithData(fmt.Sprintf(\"custom/%s/%s/%s\", queryRoute, types.QueryOwner, key), nil)\n\t\t\tif err != nil {\n\t\t\t\tfmt.Printf(\"could not resolve item %s \\n%s\\n\", key, err.Error())\n\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\tvar out types.Owner\n\t\t\tcdc.MustUnmarshalJSON(res, &out)\n\t\t\treturn cliCtx.PrintOutput(out)\n\t\t},\n\t}\n}", "title": "" }, { "docid": "69785887791f4ce3b70a46b8afab74f6", "score": "0.5345302", "text": "func GetCmdPostPrice(cdc *codec.Codec) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"postprice [assetCode] [askPrice] [bidPrice] [receivedAt]\",\n\t\tShort: \"Post the latest price for a particular asset\",\n\t\tExample: \"postprice eth_usdt 100 95 1594732456\",\n\t\tArgs: cobra.ExactArgs(4),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tcliCtx, txBuilder := helpers.GetTxCmdCtx(cdc, cmd.InOrStdin())\n\n\t\t\t// parse inputs\n\t\t\tfromAddr, err := helpers.ParseFromFlag(cliCtx)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tassetCode, err := helpers.ParseAssetCodeParam(\"assetCode\", args[0], helpers.ParamTypeCliArg)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\taskPrice, err := helpers.ParseSdkIntParam(\"askPrice\", args[1], helpers.ParamTypeCliArg)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tbidPrice, err := helpers.ParseSdkIntParam(\"bidPrice\", args[2], helpers.ParamTypeCliArg)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treceivedAt, err := helpers.ParseUnixTimestamp(\"receivedAt\", args[3], helpers.ParamTypeCliArg)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t// prepare and send message\n\t\t\tmsg := types.NewMsgPostPrice(fromAddr, assetCode, askPrice, bidPrice, receivedAt)\n\t\t\tif err := msg.ValidateBasic(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn utils.GenerateOrBroadcastMsgs(cliCtx, txBuilder, []sdk.Msg{msg})\n\t\t},\n\t}\n\thelpers.BuildCmdHelp(cmd, []string{\n\t\t\"asset code symbol\",\n\t\t\"askPrice [int]\",\n\t\t\"bidPrice [int]\",\n\t\t\"price received at UNIX timestamp in seconds [int]\",\n\t})\n\n\treturn cmd\n}", "title": "" }, { "docid": "1a95689a6bcc1d7adf9a56cfd1d966e5", "score": "0.5331721", "text": "func GetCmdReceive(cdc *codec.Codec) *cobra.Command {\n\treturn &cobra.Command{\n\t\tUse: \"receive [orderid]\",\n\t\tShort: \"receive product\",\n\t\tArgs: cobra.ExactArgs(1), // Does your request require arguments\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\n\t\t\tcliCtx := context.NewCLIContext().WithCodec(cdc)\n\t\t\tinBuf := bufio.NewReader(cmd.InOrStdin())\n\t\t\ttxBldr := auth.NewTxBuilderFromCLI(inBuf).WithTxEncoder(utils.GetTxEncoder(cdc))\n\n\t\t\torderid := args[0]\n\n\t\t\tmsg := types.NewMsgReceive(cliCtx.GetFromAddress(), orderid)\n\t\t\terr := msg.ValidateBasic()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn utils.GenerateOrBroadcastMsgs(cliCtx, txBldr, []sdk.Msg{msg})\n\t\t},\n\t}\n}", "title": "" }, { "docid": "91c8210e981cf78c00992b69321bf5a2", "score": "0.5319524", "text": "func GetQueryCmd(key string, cdc *codec.Codec) *cobra.Command {\n\n\tcmd := &cobra.Command{\n\t\tUse: types.ModuleName,\n\t\tShort: \"Deployment query commands\",\n\t\tDisableFlagParsing: true,\n\t\tSuggestionsMinimumDistance: 2,\n\t\tRunE: client.ValidateCmd,\n\t}\n\n\tcmd.AddCommand(flags.GetCommands(\n\t\tcmdDeployments(key, cdc),\n\t\tcmdDeployment(key, cdc),\n\t)...)\n\n\treturn cmd\n}", "title": "" }, { "docid": "74a801eefcd3ff58e52a2a187bfd9179", "score": "0.5318483", "text": "func GetCommand() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"pci {get} [args]\",\n\t\tShort: \"ONOS PCI subsystem commands\",\n\t}\n\n\tcli.AddConfigFlags(cmd, defaultAddress)\n\tcmd.AddCommand(getGetCommand())\n\treturn cmd\n}", "title": "" }, { "docid": "d7a1af3abfc38eb8ae36710847e5d706", "score": "0.53140986", "text": "func GetQueryCmd(queryRoute string, cdc *codec.Codec) *cobra.Command {\n\t// Group vpn queries under a subcommand\n\tvpnQueryCmd := &cobra.Command{\n\t\tUse: types.ModuleName,\n\t\tShort: fmt.Sprintf(\"Querying commands for the %s module\", types.ModuleName),\n\t\tDisableFlagParsing: true,\n\t\tSuggestionsMinimumDistance: 2,\n\t\tRunE: client.ValidateCmd,\n\t}\n\n\tvpnQueryCmd.AddCommand(\n\t\tflags.GetCommands(\n\t\t\tGetVPNStatusCmd(queryRoute, cdc),\n\t\t\tGetVPNLimitCmd(queryRoute, cdc),\n\t\t\tGetVPNCurrentCmd(queryRoute, cdc),\n\t\t\tutil.LineBreak(),\n\t\t\tgetCmdParams(queryRoute, cdc),\n\t\t)...,\n\t)\n\n\treturn vpnQueryCmd\n}", "title": "" }, { "docid": "3e4c98d77f6f623fc61904138a581203", "score": "0.5306602", "text": "func (*GetCommand) Name() string { return \"get\" }", "title": "" }, { "docid": "4745d3d826e2e6a169994062af46b664", "score": "0.529512", "text": "func (goH *Handler) goGet(pkg Package) error {\n\tc := []string{\"go\", \"get\", pkg.String()}\n\tif goH.Config.UpdateDependencies {\n\t\t// insert \"-u\"\n\t\tc = append(c[:2], append([]string{\"-u\"}, c[2:]...)...)\n\t}\n\n\tif goH.Config.PrintCommandOutput {\n\t\toutput.Info(\"%v\", c)\n\t}\n\n\tout, err := cmd.Execute(\n\t\tc,\n\t\tcmd.WorkingDir(goH.Config.WorkingDir),\n\t\tcmd.DirectPrint(bool(klog.V(5)) || goH.Config.PrintCommandOutput),\n\t)\n\n\t// don't print the output twice if we have verbosity\n\tif err != nil && !bool(klog.V(5)) || goH.Config.PrintCommandOutput {\n\t\toutput.Warn(out)\n\t}\n\treturn err\n}", "title": "" }, { "docid": "6731bf8d6c0df7908b58081d6b935ca1", "score": "0.52903205", "text": "func GetClientCmd() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"client\",\n\t\tShort: \"Start RPC client\",\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\t// Parse inputs\n\t\t\tserverUrl, err := cmd.Flags().GetString(FlagServerUrl)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"%s flag: %v\", FlagServerUrl, err)\n\t\t\t}\n\t\t\tclientId, err := cmd.Flags().GetUint(FlagClientId)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"%s flag: %v\", FlagClientId, err)\n\t\t\t}\n\t\t\topsSendMax, err := cmd.Flags().GetInt(FlagOpsSendMax)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"%s flag: %v\", FlagOpsSendMax, err)\n\t\t\t}\n\t\t\topsSendDur, err := cmd.Flags().GetDuration(FlagOpsSendPeriod)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"%s flag: %v\", FlagOpsSendPeriod, err)\n\t\t\t}\n\t\t\tpollDur, err := cmd.Flags().GetDuration(FlagPollPeriod)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"%s flag: %v\", FlagPollPeriod, err)\n\t\t\t}\n\n\t\t\tif clientId == 0 {\n\t\t\t\tclientId = uint(rand.Uint32())\n\t\t\t}\n\n\t\t\t// Init service\n\t\t\tsvc, err := client.NewClient(\n\t\t\t\tmodel.ClientId(clientId),\n\t\t\t\topsSendDur,\n\t\t\t\tpollDur,\n\t\t\t\topsSendMax,\n\t\t\t\tserverUrl,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"service init: %v\", err)\n\t\t\t}\n\n\t\t\tsvc.Start()\n\n\t\t\t// Wait for signal\n\t\t\tsignalCh := make(chan os.Signal, 1)\n\t\t\tsignal.Notify(signalCh, syscall.SIGINT, syscall.SIGTERM)\n\t\t\t<-signalCh\n\n\t\t\tsvc.Stop()\n\t\t},\n\t}\n\tcmd.Flags().Uint(FlagClientId, 1, \"unique clientID\")\n\tcmd.Flags().Int(FlagOpsSendMax, 5, \"max number of snapshot updates per period\")\n\tcmd.Flags().String(FlagServerUrl, \"127.0.0.1:2412\", \"(optional) server url\")\n\tcmd.Flags().Duration(FlagOpsSendPeriod, 1*time.Second, \"(optional) snapshot updates send period\")\n\tcmd.Flags().Duration(FlagPollPeriod, 2*time.Second, \"(optional) snapshot updates poll period\")\n\n\treturn cmd\n}", "title": "" }, { "docid": "8361cf9b5f49c495a0d027c92bda950a", "score": "0.52887523", "text": "func GetQueryCmd(key string, cdc *codec.Codec) *cobra.Command {\n\n\tcmd := &cobra.Command{\n\t\tUse: types.ModuleName,\n\t\tShort: \"Market query commands\",\n\t\tDisableFlagParsing: true,\n\t\tSuggestionsMinimumDistance: 2,\n\t\tRunE: client.ValidateCmd,\n\t}\n\n\tcmd.AddCommand(flags.GetCommands(\n\t\tgetOrderCmd(key, cdc),\n\t\tgetBidCmd(key, cdc),\n\t\tgetLeaseCmd(key, cdc),\n\t)...)\n\n\treturn cmd\n}", "title": "" }, { "docid": "672a0edc06bc7a618c4456308c5ba170", "score": "0.5282422", "text": "func GetQueryCmd(queryRoute string, cdc *codec.Codec) *cobra.Command {\n\t// Group storage queries under a subcommand\n\tstorageQueryCmd := &cobra.Command{\n\t\tUse: types.ModuleName,\n\t\tShort: fmt.Sprintf(\"Querying commands for the %s module\", types.ModuleName),\n\t\tDisableFlagParsing: true,\n\t\tSuggestionsMinimumDistance: 2,\n\t\tRunE: client.ValidateCmd,\n\t}\n\n\tstorageQueryCmd.AddCommand(\n\t\tflags.GetCommands(\n\t\t\tGetDataCmd(queryRoute, cdc),\n\t\t\tGetInfoCmd(queryRoute, cdc),\n\t\t)...,\n\t)\n\n\treturn storageQueryCmd\n}", "title": "" }, { "docid": "e74cdd014c0983a95a86b2aa376213ca", "score": "0.52814704", "text": "func GetQueryCmd(cdc *codec.Codec) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: types.ModuleName,\n\t\tShort: \"Querying commands for the document module\",\n\t\tDisableFlagParsing: true,\n\t\tSuggestionsMinimumDistance: 2,\n\t\tRunE: client.ValidateCmd,\n\t}\n\n\tcmd.AddCommand(\n\t\tGetDocByProofCmd(types.QuerierRoute, cdc),\n\t\tGetDocByHolderCmd(types.QuerierRoute, cdc),\n\t)\n\n\treturn cmd\n}", "title": "" }, { "docid": "062c8b380b92f8b17606f7898a8b7e9d", "score": "0.5281353", "text": "func Cmd() *cobra.Command {\n\tflags := queryCmd.Flags()\n\tflags.StringVar(&common.ChannelID, common.ChannelIDFlag, common.ChannelID, \"The channel ID\")\n\n\tqueryCmd.AddCommand(getQueryBlockCmd())\n\tqueryCmd.AddCommand(getQueryInfoCmd())\n\tqueryCmd.AddCommand(getQueryTXCmd())\n\tqueryCmd.AddCommand(getQueryChannelsCmd())\n\tqueryCmd.AddCommand(getQueryInstalledCmd())\n\n\treturn queryCmd\n}", "title": "" }, { "docid": "076cfb9ccc187c8d33df0df97b66db80", "score": "0.5277766", "text": "func GetQueryCmd(queryRoute string, cdc *codec.Codec) *cobra.Command {\n\tqueryCmd := &cobra.Command{\n\t\tUse: types.ModuleName,\n\t\tShort: \"Querying commands for the token module\",\n\t\tDisableFlagParsing: true,\n\t\tSuggestionsMinimumDistance: 2,\n\t\tRunE: client.ValidateCmd,\n\t}\n\n\tqueryCmd.AddCommand(client.GetCommands(\n\t\tgetCmdQueryParams(queryRoute, cdc),\n\t\tgetCmdTokenInfo(queryRoute, cdc),\n\t\t//getAccountCmd(queryRoute, cdc),\n\t)...)\n\n\treturn queryCmd\n}", "title": "" }, { "docid": "dc1471df85caddb599519ec9c6d45dba", "score": "0.5276009", "text": "func Get(module string) error {\n\treturn execGetCmd(false, module, \"\")\n}", "title": "" }, { "docid": "291e0807c93e335d746ee61aa207bb91", "score": "0.5260448", "text": "func NewGetCmd() *cobra.Command {\n\tc := &GetCmd{}\n\tcmd := &cobra.Command{\n\t\tUse: \"get\",\n\t\tShort: \"\",\n\t\tLong: \"\",\n\t\tExample: \"\",\n\t\tRun: func(cmd *cobra.Command, args []string) {\n\t\t\tc.Cmd = cmd\n\t\t\tc.Args = args\n\t\t\terr := c.Run()\n\t\t\tif err != nil {\n\t\t\t\tlog.Logger().WithError(err).Fatal(\"unable to run command\")\n\t\t\t}\n\t\t},\n\t}\n\n\tcmd.AddCommand(NewGetPrsCmd())\n\tcmd.AddCommand(NewGetReposCmd())\n\n\treturn cmd\n}", "title": "" }, { "docid": "49fe45cc5d121d2fbd44e1ed014fa5ff", "score": "0.52603126", "text": "func GetQueryCmd(queryRoute string, cdc *codec.Codec) *cobra.Command {\n\t// Group blog queries under a subcommand\n\tblogQueryCmd := &cobra.Command{\n\t\tUse: types.ModuleName,\n\t\tShort: fmt.Sprintf(\"Querying commands for the %s module\", types.ModuleName),\n\t\tDisableFlagParsing: true,\n\t\tSuggestionsMinimumDistance: 2,\n\t\tRunE: client.ValidateCmd,\n\t}\n\n\tblogQueryCmd.AddCommand(\n\t\tflags.GetCommands(\n\t\t\t// this line is used by starport scaffolding\n\t\t\tGetCmdListComment(queryRoute, cdc),\n\t\t\tGetCmdListPost(queryRoute, cdc),\n\t\t)...,\n\t)\n\n\treturn blogQueryCmd\n}", "title": "" }, { "docid": "75fb6bc313297ba7d398df78240ba62e", "score": "0.52527136", "text": "func GetQueryCmd() *cobra.Command {\n\t// Group kavadist queries under a subcommand\n\tcmd := &cobra.Command{\n\t\tUse: types.ModuleName,\n\t\tShort: fmt.Sprintf(\"Querying commands for the %s module\", types.ModuleName),\n\t\tDisableFlagParsing: true,\n\t\tSuggestionsMinimumDistance: 2,\n\t\tRunE: client.ValidateCmd,\n\t}\n\n\tcmd.AddCommand(\n\t\tqueryParamsCmd(),\n\t\tqueryBalanceCmd(),\n\t)\n\n\treturn cmd\n}", "title": "" }, { "docid": "2887676c06052ea5f873f162e1891891", "score": "0.5248581", "text": "func GetCommand() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"fabric-sim {create,delete,get,start,stop,enable,disable,emit} [args]\",\n\t\tShort: \"ONOS fabric simulator commands\",\n\t\tAliases: []string{\"fabricsim\", \"fabsim\", \"fsim\"},\n\t}\n\n\tcli.AddConfigFlags(cmd, defaultAddress)\n\tcmd.AddCommand(cli.GetConfigCommand())\n\n\tcmd.AddCommand(getCreateCommand())\n\tcmd.AddCommand(getDeleteCommand())\n\tcmd.AddCommand(getGetCommand())\n\n\tcmd.AddCommand(getStartCommand())\n\tcmd.AddCommand(getStopCommand())\n\n\tcmd.AddCommand(getEnableCommand())\n\tcmd.AddCommand(getDisableCommand())\n\tcmd.AddCommand(getEmitCommand())\n\n\tcmd.AddCommand(loglib.GetCommand())\n\treturn cmd\n}", "title": "" }, { "docid": "7d64104ebcaab082403ada5a5cedec2e", "score": "0.5243397", "text": "func (kv *KVServer) Get(args *GetRequest, reply *GetReply) {\n\t// Your code here.\n\tDPrintf(1, \"KV[%d] received Get: %+v\\n\", kv.me, args)\n\n\top := Op{Get, args.Key, \"\", args.ClientID, args.RequestID}\n\tindex, _, isLeader := kv.rf.Start(op)\n\tif isLeader == false {\n\t\treply.Err = ErrWrongLeader\n\t\treturn\n\t}\n\n\t// Revisit in case of failure\n\tif _, ok := kv.resultCh[index]; ok == false {\n\t\tkv.resultCh[index] = make(chan Result)\n\t}\n\n\ttimer := time.NewTimer(300 * time.Millisecond)\n\tselect {\n\tcase result := <-kv.resultCh[index]:\n\t\tif match(result.op, op) {\n\t\t\treply.Err = result.err\n\t\t\treply.Value = result.value\n\t\t} else {\n\t\t\treply.Err = ErrUnmatchedOp\n\t\t}\n\tcase <-timer.C:\n\t\tDPrintf(1, \"KV[%d]: Get timeout: %+v\\n\", kv.me, args)\n\t\tdelete(kv.resultCh, index)\n\t\treply.Err = ErrTimeOut\n\t}\n\treturn\n}", "title": "" }, { "docid": "41022b01017b1a86905ffa2e149ad171", "score": "0.52404183", "text": "func (s *Server) Get(path string, handle hr.Handle) {\n\ts.router.GET(path, s.addHandlerDaemon(path, handle))\n}", "title": "" }, { "docid": "bd43fbbeeb5f657f06ec41eba0048c7a", "score": "0.52333707", "text": "func GetQueryCmd(cdc *codec.Codec, queryRoute string) *cobra.Command {\n\tics20TransferQueryCmd := &cobra.Command{\n\t\tUse: \"transfer\",\n\t\tShort: \"IBC fungible token transfer query subcommands\",\n\t}\n\n\tics20TransferQueryCmd.AddCommand(flags.GetCommands(\n\t\tGetCmdQueryNextSequence(cdc, queryRoute),\n\t)...)\n\n\treturn ics20TransferQueryCmd\n}", "title": "" }, { "docid": "7dfbe1adac12a306732b82ab73872aa8", "score": "0.5229733", "text": "func (pb *PBServer) Get(args *GetArgs, reply *GetReply) error {\n\tpb.mu.Lock()\n\tdefer pb.mu.Unlock()\n\n\tif pb.myview.Primary == pb.me{\n\t\thandled := pb.SequenceHandled(args.ClientID, args.SeqNum)\n\t\tDPrintf(\"server %s received get request!\", pb.me)\n\t\treply.Value = pb.kv[args.Key]\n\t\treply.Err = OK\n\t\tpb.client_map[args.ClientID][args.SeqNum] = reply.Value\n\t\tif pb.myview.Backup != \"\" && ! handled{\n\t\t\tpb.GetUpdateRequest(args.Key, reply.Value, args.ClientID, args.SeqNum)\n\t\t}\n\t\tDPrintf(\"get request is %v -> %v\", args.Key, reply.Value)\n\t} else {\n\t\tDPrintf(\"I %s am not primary and cannot get this!\", pb.me)\n\t\treply.Err = OK\n\t\treply.Value = pb.kv[args.Key]\n\t} \n\treturn nil\n}", "title": "" }, { "docid": "ee251b6896c23fde5aafc8d418ba3260", "score": "0.5229383", "text": "func (AppModuleBasic) GetQueryCmd() *cobra.Command {\n\treturn cli.GetQueryCmd()\n}", "title": "" }, { "docid": "4f85e95ceeef5640970996f6087209a6", "score": "0.5214772", "text": "func (e *Etcd) DoGet(key string, opts ...etcdv3.OpOption) (*etcdv3.GetResponse, error) {\n\tctx, cancel := e.Context()\n\tdefer cancel()\n\tresult, err := e.Get(ctx, key, opts...)\n\tif err != nil {\n\t\te.ErrCh <- err\n\t}\n\treturn result, err\n}", "title": "" }, { "docid": "5ad98bc45411f27e558d6bc816654e88", "score": "0.5205161", "text": "func GetQueryCmd(queryRoute string) *cobra.Command {\n\t// Group vendorinfo queries under a subcommand\n\tcmd := &cobra.Command{\n\t\tUse: types.ModuleName,\n\t\tShort: fmt.Sprintf(\"Querying commands for the %s module\", types.ModuleName),\n\t\tDisableFlagParsing: true,\n\t\tSuggestionsMinimumDistance: 2,\n\t\tRunE: client.ValidateCmd,\n\t}\n\n\tcmd.AddCommand(CmdListVendorInfo())\n\tcmd.AddCommand(CmdShowVendorInfo())\n\t// this line is used by starport scaffolding # 1\n\n\treturn cmd\n}", "title": "" }, { "docid": "90e38fcadeb68e092c3d0978c7e69809", "score": "0.52024406", "text": "func NewCmdGet(f util.Factory, parentCommand string, streams genericclioptions.IOStreams) *cobra.Command {\n\to := NewCommandGetOptions(streams)\n\tcmd := &cobra.Command{\n\t\tUse: \"get [NAME | -l label | -n namespace]\",\n\t\tShort: \"Display one or many resources\",\n\t\tLong: getLong,\n\t\tSilenceUsage: true,\n\t\tDisableFlagsInUseLine: true,\n\t\tExample: fmt.Sprintf(getExample, parentCommand),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tif err := o.Complete(f); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := o.Validate(cmd); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := o.Run(f, cmd, args); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t\tAnnotations: map[string]string{\n\t\t\tutil.TagCommandGroup: util.GroupBasic,\n\t\t},\n\t}\n\n\to.PrintFlags.AddFlags(cmd)\n\tflags := cmd.Flags()\n\toptions.AddKubeConfigFlags(flags)\n\tflags.StringVarP(options.DefaultConfigFlags.Namespace, \"namespace\", \"n\", *options.DefaultConfigFlags.Namespace, \"If present, the namespace scope for this CLI request\")\n\tflags.StringVarP(&o.LabelSelector, \"labels\", \"l\", \"\", \"-l=label or -l label\")\n\tflags.StringSliceVarP(&o.Clusters, \"clusters\", \"C\", []string{}, \"-C=member1,member2\")\n\tflags.BoolVarP(&o.AllNamespaces, \"all-namespaces\", \"A\", o.AllNamespaces, \"If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.\")\n\tflags.BoolVar(&o.IgnoreNotFound, \"ignore-not-found\", o.IgnoreNotFound, \"If the requested object does not exist the command will return exit code 0.\")\n\tflags.BoolVarP(&o.Watch, \"watch\", \"w\", o.Watch, \"After listing/getting the requested object, watch for changes. Uninitialized objects are excluded if no object name is provided.\")\n\tflags.BoolVar(&o.WatchOnly, \"watch-only\", o.WatchOnly, \"Watch for changes to the requested object(s), without listing/getting first.\")\n\tflags.BoolVar(&o.OutputWatchEvents, \"output-watch-events\", o.OutputWatchEvents, \"Output watch event objects when --watch or --watch-only is used. Existing objects are output as initial ADDED events.\")\n\n\treturn cmd\n}", "title": "" }, { "docid": "3f7f99eb28de666d1bdfe5701e8ce6a9", "score": "0.52009326", "text": "func (e *ETCD) Get(ctx context.Context, key string, opts ...clientv3.OpOption) (*clientv3.GetResponse, error) {\n\treturn e.cliv3.Get(ctx, key, opts...)\n}", "title": "" }, { "docid": "3f7f99eb28de666d1bdfe5701e8ce6a9", "score": "0.52009326", "text": "func (e *ETCD) Get(ctx context.Context, key string, opts ...clientv3.OpOption) (*clientv3.GetResponse, error) {\n\treturn e.cliv3.Get(ctx, key, opts...)\n}", "title": "" }, { "docid": "9211b662803c004952f4c992fc7f44a8", "score": "0.5195147", "text": "func MGetCmd(s Session, args [][]byte) (redis.Resp, error) {\n\tif a, err := s.Store().MGet(s.DB(), args); err != nil {\n\t\treturn toRespError(err)\n\t} else {\n\t\tresp := redis.NewArray()\n\t\tfor _, v := range a {\n\t\t\tresp.AppendBulkBytes(v)\n\t\t}\n\t\treturn resp, nil\n\t}\n}", "title": "" }, { "docid": "3ca3f2fbf9631ef871783ef3c6ead5ed", "score": "0.51943165", "text": "func GetQueryCmd(cdc *amino.Codec) *cobra.Command {\n\tqueryCmd := &cobra.Command{\n\t\tUse: types2.ModuleName,\n\t\tShort: \"Querying commands for the PoA module\",\n\t}\n\n\tqueryCmd.AddCommand(sdkClient.GetCommands(\n\t\tcli.GetValidator(types2.ModuleName, cdc),\n\t\tcli.GetValidators(types2.ModuleName, cdc),\n\t\tcli.GetMinMax(types2.ModuleName, cdc),\n\t)...)\n\n\treturn queryCmd\n}", "title": "" }, { "docid": "bc87db5e94e263e89cbd7f01a5648b79", "score": "0.51910895", "text": "func (c *Client) Get(args ...interface{}) *Reply {\n\treturn c.call(cmdGet, args...)\n}", "title": "" }, { "docid": "9a5b3c16d2f3cca4c73ae433f32aa130", "score": "0.5190904", "text": "func (l Library) Get() string {\n\treturn Exec(l.Command[0], l.Command[1:len(l.Command)]...)\n}", "title": "" }, { "docid": "6268b5579d0f2ede6a453c335c61f173", "score": "0.5189866", "text": "func handleCommand(command string, args string, configs commandConfigs) (slack.Msg, error) {\n\tvar err error\n\tvar message slack.Msg\n\n\tif config, ok := configs[command]; ok {\n\t\tmessage, err = getItem(args, config.sourceFile, config.dataList)\n\t} else {\n\t\tmessage = slack.Msg{\n\t\t\tResponseType: \"ephemeral\",\n\t\t\tText: fmt.Sprintf(\"Unknown subcommand: %s\", command),\n\t\t}\n\t\terr = nil\n\t}\n\n\treturn message, err\n}", "title": "" }, { "docid": "f3d4d9040b186d49651e4968bd185939", "score": "0.5184658", "text": "func (cg *CmdGenerator) GetCmd() *exec.Cmd {\n\targs := util.MapToCmdArgs(cg.getCmdOpts(), \"-\")\n\treturn exec.Command(path.Join(cg.binDirecotry, cg.getBinName()), args...)\n}", "title": "" }, { "docid": "b6ce37b0e1db05582470a24cf353ff4e", "score": "0.51828474", "text": "func GetQueryCmd() *cobra.Command {\n\toracleQueryCmd := &cobra.Command{\n\t\tUse: types.ModuleName,\n\t\tShort: \"Querying commands for the oracle module\",\n\t\tDisableFlagParsing: true,\n\t\tSuggestionsMinimumDistance: 2,\n\t\tRunE: client.ValidateCmd,\n\t}\n\n\toracleQueryCmd.AddCommand(\n\t\tGetCmdQueryExchangeRates(),\n\t\tGetCmdQueryActives(),\n\t\tGetCmdQueryParams(),\n\t\tGetCmdQueryFeederDelegation(),\n\t\tGetCmdQueryMissCounter(),\n\t\tGetCmdQueryAggregatePrevote(),\n\t\tGetCmdQueryAggregateVote(),\n\t\tGetCmdQueryVoteTargets(),\n\t\tGetCmdQueryTobinTaxes(),\n\t)\n\n\treturn oracleQueryCmd\n\n}", "title": "" }, { "docid": "3ed916f3fda151a3e73d8a2c30035ccf", "score": "0.51716363", "text": "func (high *hostIDGetHandler) Run(ctx context.Context) gimlet.Responder {\n\tfoundHost, err := high.sc.FindHostById(high.hostID)\n\tif err != nil {\n\t\treturn gimlet.MakeJSONErrorResponder(errors.Wrapf(err, \"Database error for find() by distro id '%s'\", high.hostID))\n\t}\n\n\thostModel := &model.APIHost{}\n\tif err = hostModel.BuildFromService(*foundHost); err != nil {\n\t\treturn gimlet.MakeJSONInternalErrorResponder(errors.Wrap(err, \"API Error converting from host.Host to model.APIHost\"))\n\t}\n\n\tif foundHost.RunningTask != \"\" {\n\t\trunningTask, err := high.sc.FindTaskById(foundHost.RunningTask)\n\t\tif err != nil {\n\t\t\tif apiErr, ok := err.(gimlet.ErrorResponse); !ok || (ok && apiErr.StatusCode != http.StatusNotFound) {\n\t\t\t\treturn gimlet.MakeJSONInternalErrorResponder(errors.Wrap(err, \"Database error\"))\n\t\t\t}\n\t\t}\n\n\t\tif err = hostModel.BuildFromService(runningTask); err != nil {\n\t\t\treturn gimlet.MakeJSONErrorResponder(errors.Wrap(err, \"problem adding task data to host response\"))\n\t\t}\n\t}\n\n\treturn gimlet.NewJSONResponse(hostModel)\n}", "title": "" }, { "docid": "530a040706bab9bbd7a7e42b4f579d05", "score": "0.5168948", "text": "func (b *stdBackend) processCommand(cmd *command) {\n\tdefer cmd.close()\n\tswitch cmd.opCode {\n\tcase cmdReset:\n\t\t// Reset monitoring.\n\t\tb.init()\n\t\tcmd.ok()\n\tcase cmdMeasuringPointRead:\n\t\t// Read just one measuring point.\n\t\tid := cmd.args.(string)\n\t\tif mp, ok := b.etmData[id]; ok {\n\t\t\t// Measuring point found.\n\t\t\tclone := *mp\n\t\t\tcmd.respond(&clone)\n\t\t} else {\n\t\t\t// Measuring point does not exist.\n\t\t\tcmd.respond(errors.New(ErrMeasuringPointNotExists, errorMessages, id))\n\t\t}\n\tcase cmdMeasuringPointsReadAll:\n\t\t// Read all measuring points.\n\t\tresp := MeasuringPoints{}\n\t\tfor _, mp := range b.etmData {\n\t\t\tclone := *mp\n\t\t\tresp = append(resp, &clone)\n\t\t}\n\t\tsort.Sort(resp)\n\t\tcmd.respond(resp)\n\tcase cmdStaySetVariableRead:\n\t\t// Read just one stay-set variable.\n\t\tid := cmd.args.(string)\n\t\tif ssv, ok := b.ssvData[id]; ok {\n\t\t\t// Variable found.\n\t\t\tclone := *ssv\n\t\t\tcmd.respond(&clone)\n\t\t} else {\n\t\t\t// Variable does not exist.\n\t\t\tcmd.respond(errors.New(ErrStaySetVariableNotExists, errorMessages, id))\n\t\t}\n\tcase cmdStaySetVariablesReadAll:\n\t\t// Read all stay-set variables.\n\t\tresp := StaySetVariables{}\n\t\tfor _, mp := range b.ssvData {\n\t\t\tclone := *mp\n\t\t\tresp = append(resp, &clone)\n\t\t}\n\t\tsort.Sort(resp)\n\t\tcmd.respond(resp)\n\tcase cmdDynamicStatusRetrieverRead:\n\t\t// Read just one dynamic status value.\n\t\tid := cmd.args.(string)\n\t\tif dsr, ok := b.dsrData[id]; ok {\n\t\t\t// Dynamic status found.\n\t\t\tv, err := dsr()\n\t\t\tif err != nil {\n\t\t\t\tcmd.respond(err)\n\t\t\t} else {\n\t\t\t\tcmd.respond(v)\n\t\t\t}\n\t\t} else {\n\t\t\t// Dynamic status does not exist.\n\t\t\tcmd.respond(errors.New(ErrDynamicStatusNotExists, errorMessages, id))\n\t\t}\n\tcase cmdDynamicStatusRetrieversReadAll:\n\t\t// Read all dynamic status values.\n\t\tresp := DynamicStatusValues{}\n\t\tfor id, dsr := range b.dsrData {\n\t\t\tv, err := dsr()\n\t\t\tif err != nil {\n\t\t\t\tcmd.respond(err)\n\t\t\t}\n\t\t\tdsv := &stdDynamicStatusValue{id, v}\n\t\t\tresp = append(resp, dsv)\n\t\t}\n\t\tsort.Sort(resp)\n\t\tcmd.respond(resp)\n\t}\n}", "title": "" }, { "docid": "79c38b8ad241e1fc82bcbaf28997a12e", "score": "0.5163006", "text": "func (c *VapixClient) HandleReadCommand(req sdkModels.CommandRequest) (*sdkModels.CommandValue, error) {\n\treturn nil, fmt.Errorf(\"vapix: unrecognized read command\")\n}", "title": "" }, { "docid": "4c8465e8e7dbe6d7416a96eb697204df", "score": "0.5159858", "text": "func GetQueryCmd() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: types.ModuleName,\n\t\tShort: \"Querying commands for the evm module\",\n\t\tDisableFlagParsing: true,\n\t\tSuggestionsMinimumDistance: 2,\n\t\tRunE: client.ValidateCmd,\n\t}\n\n\tcmd.AddCommand(\n\t\tGetStorageCmd(),\n\t\tGetCodeCmd(),\n\t)\n\treturn cmd\n}", "title": "" }, { "docid": "b3631a44c3f1e5791c2fe4eff292e342", "score": "0.5158601", "text": "func GetQueryCmd() *cobra.Command {\n\tliquidityQueryCmd := &cobra.Command{\n\t\tUse: types.ModuleName,\n\t\tShort: \"Querying commands for the liquidity module\",\n\t\tDisableFlagParsing: true,\n\t\tSuggestionsMinimumDistance: 2,\n\t\tRunE: client.ValidateCmd,\n\t}\n\n\tliquidityQueryCmd.AddCommand(\n\t\tGetCmdQueryParams(),\n\t\tGetCmdQueryLiquidityPool(),\n\t\tGetCmdQueryLiquidityPools(),\n\t\tGetCmdQueryLiquidityPoolBatch(),\n\t\tGetCmdQueryPoolBatchDepositMsgs(),\n\t\tGetCmdQueryPoolBatchDepositMsg(),\n\t\tGetCmdQueryPoolBatchWithdrawMsgs(),\n\t\tGetCmdQueryPoolBatchWithdrawMsg(),\n\t\tGetCmdQueryPoolBatchSwapMsgs(),\n\t\tGetCmdQueryPoolBatchSwapMsg(),\n\t)\n\n\treturn liquidityQueryCmd\n}", "title": "" }, { "docid": "b558470e797b464ab6884eca3602b205", "score": "0.5153888", "text": "func GetQueryCmd(queryRoute string, cdc *codec.Codec) *cobra.Command {\n\t// Group reputation queries under a subcommand\n\treputationQueryCmd := &cobra.Command{\n\t\tUse: types.ModuleName,\n\t\tShort: fmt.Sprintf(\"Querying commands for the %s module\", types.ModuleName),\n\t\tDisableFlagParsing: true,\n\t\tSuggestionsMinimumDistance: 2,\n\t\tRunE: client.ValidateCmd,\n\t}\n\n\treputationQueryCmd.AddCommand(\n\t\tclient.GetCommands(\n\t\t\tGetCmdGetReputation(queryRoute, cdc),\n\t\t)...,\n\t)\n\n\treturn reputationQueryCmd\n}", "title": "" }, { "docid": "18843c649c36196d0007cab7b1815c0d", "score": "0.51489365", "text": "func GetCommand() *cobra.Command {\n\treturn rootCmd\n}", "title": "" }, { "docid": "4ebeb3acc3cc1a60951fbc4000d54797", "score": "0.5142981", "text": "func getCmdTokenInfo(queryRoute string, cdc *codec.Codec) *cobra.Command {\n\tvar owner string\n\tcmd := &cobra.Command{\n\t\tUse: \"info [<symbol>]\",\n\t\tShort: \"query token info by symbol\",\n\t\t//Args: cobra.ExactArgs(1),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tcliCtx := context.NewCLIContext().WithCodec(cdc)\n\n\t\t\tswitch {\n\t\t\tcase len(args) == 1:\n\t\t\t\tsymbol := args[0]\n\t\t\t\tres, _, err := cliCtx.QueryWithData(fmt.Sprintf(\"custom/%s/info/%s\", queryRoute, symbol), nil)\n\t\t\t\tif err != nil {\n\t\t\t\t\tfmt.Printf(\"token does not exist - %s %s\\n\", symbol, err.Error())\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\n\t\t\t\ttoken := types.Token{}\n\t\t\t\tcdc.MustUnmarshalJSON(res, &token)\n\t\t\t\treturn cliCtx.PrintOutput(token)\n\t\t\tcase owner != \"\":\n\t\t\t\tres, _, err := cliCtx.QueryWithData(fmt.Sprintf(\"custom/%s/tokens/%s\", queryRoute, owner), nil)\n\t\t\t\tif err != nil {\n\t\t\t\t\tfmt.Printf(\"Invalid owner address - %s %s\\n\", owner, err.Error())\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\n\t\t\t\ttokens := types.Tokens{}\n\t\t\t\tcdc.MustUnmarshalJSON(res, &tokens)\n\t\t\t\treturn cliCtx.PrintOutput(tokens)\n\t\t\tdefault:\n\t\t\t\tfmt.Println(\"At least a [<symbol>] arg or an --owner flag need to be set\")\n\t\t\t\terr := cmd.Help()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\treturn nil\n\t\t\t}\n\t\t},\n\t}\n\tcmd.Flags().StringVarP(&owner, \"owner\", \"\", \"\", \"Get all the tokens information belong to\")\n\n\treturn cmd\n}", "title": "" }, { "docid": "b7ae81109997d10f6fe3c024c6f2090a", "score": "0.51412606", "text": "func NewConfigGetCommand(io cmdutil.IOStreams) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"get\",\n\t\tAliases: []string{\"get\"},\n\t\tDisableFlagsInUseLine: true,\n\t\tShort: \"Get data for a config\",\n\t\tLong: \"Get data for a config\",\n\t\tExample: `vela config get <config-name>`,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn getConfig(args, io, cmd)\n\t\t},\n\t\tAnnotations: map[string]string{\n\t\t\ttypes.TagCommandType: types.TypeStart,\n\t\t},\n\t}\n\tcmd.SetOut(io.Out)\n\treturn cmd\n}", "title": "" }, { "docid": "ad96978f383675bc2efd25193dbe8e0e", "score": "0.5139433", "text": "func HandleCommands(w http.ResponseWriter, r *http.Request) interface{} {\n\tctx := r.Context()\n\tclient, activeGuild, templateData := web.GetBaseCPContextData(ctx)\n\tchannels := ctx.Value(common.ContextKeyGuildChannels).([]*discordgo.Channel)\n\ttemplateData[\"CommandConfig\"] = GetConfig(client, activeGuild.ID, channels)\n\treturn templateData\n}", "title": "" }, { "docid": "296ea11c1c2760e9b0d0499c19c754da", "score": "0.5131333", "text": "func HandleGET(c net.Conn, res *ResponseBody) {\n\t//ReadHeadLen(c)\n\t//response := ReadHead(c)\n\tresponse := res\n\tvar filePath string\n\tif response.Cmd == \"get\" && response.FileName != \"\" {\n\t\tif response.FilePath == \"/\" {\n\t\t\tfilePath = filepath.Join(servPath, response.FileName)\n\t\t\tresponse.FilePath = servPath\n\t\t} else {\n\t\t\tfilePath = filepath.Join(response.FilePath, response.FileName)\n\t\t}\n\t} else {\n\t\tfilePath = \"\"\n\t\tresponse.Status = 404\n\t\tWriteHead(c, *response)\n\t\tc.Close()\n\t\treturn\n\t}\n\tfileInfo, err := os.Stat(filePath)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfileLen := fileInfo.Size()\n\tresponse.FileSize = fileLen\n\tresponse.Status = 200\n\tWriteHead(c, *response)\n\tf, err := os.Open(filePath)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tvar buf = make([]byte, fileLen)\n\treader := bufio.NewReader(f)\n\treader.Read(buf)\n\tc.Write(buf)\n\tc.Close()\n}", "title": "" }, { "docid": "7ec23850b6ff140c7a6a47af150cd0de", "score": "0.5124011", "text": "func GetQueryCmd() *cobra.Command {\n\tpostQueryCmd := &cobra.Command{\n\t\tUse: types.ModuleName,\n\t\tShort: \"Querying commands for the posts module\",\n\t\tDisableFlagParsing: true,\n\t\tSuggestionsMinimumDistance: 2,\n\t\tRunE: client.ValidateCmd,\n\t}\n\tpostQueryCmd.AddCommand(\n\t\tGetCmdQueryPost(),\n\t\tGetCmdQueryPosts(),\n\t\tGetCmdQueryPollAnswers(),\n\t\tGetCmdQueryRegisteredReactions(),\n\t\tGetCmdQueryParams(),\n\t)\n\treturn postQueryCmd\n}", "title": "" }, { "docid": "f967f61c34ceec3f776a076bce1d641d", "score": "0.51214725", "text": "func RunDropletGet(c *CmdConfig) error {\n\terr := ensureOneArg(c)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tgetTemplate, err := c.Doit.GetString(c.NS, doctl.ArgTemplate)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tds := c.Droplets()\n\tfn := func(ids []int) error {\n\t\tfor _, id := range ids {\n\t\t\td, err := ds.Get(id)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\titem := &displayers.Droplet{Droplets: do.Droplets{*d}}\n\n\t\t\tif getTemplate != \"\" {\n\t\t\t\tt := template.New(\"Get template\")\n\t\t\t\tt, err = t.Parse(getTemplate)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\treturn t.Execute(c.Out, d)\n\t\t\t}\n\t\t\treturn c.Display(item)\n\t\t}\n\t\treturn nil\n\t}\n\treturn matchDroplets(c.Args, ds, fn)\n\n}", "title": "" }, { "docid": "4a4b2da7d33afaca8541a083c2b363c6", "score": "0.5114654", "text": "func FormatCmd(str string) string {\n\tstr = strings.TrimSpace(str)\n\tstr = strings.Join(strings.Fields(str), \" \")\n\tstrsl := strings.Split(str, \" \")\n\n\tswitch strsl[0] {\n\tcase \"GET\":\n\t\treturn formatNoTyp(strsl)\n\tcase \"SET\":\n\t\treturn formatWidTyp(strsl)\n\tcase \"DELETE\":\n\t\treturn formatNoTyp(strsl)\n\t}\n\n\treturn \"\"\n}", "title": "" }, { "docid": "2c83c8699cafb3061d9033f2cdc3f9ab", "score": "0.5113127", "text": "func GetQueryCmd() *cobra.Command {\n\t// Group pooltoy queries under a subcommand\n\tpooltoyQueryCmd := &cobra.Command{\n\t\tUse: types.ModuleName,\n\t\tShort: fmt.Sprintf(\"Querying commands for the %s module\", types.ModuleName),\n\t\tDisableFlagParsing: true,\n\t\tSuggestionsMinimumDistance: 2,\n\t\tRunE: client.ValidateCmd,\n\t}\n\n\tpooltoyQueryCmd.AddCommand(queryListUsers())\n\n\treturn pooltoyQueryCmd\n}", "title": "" }, { "docid": "4e943fb2a345e8b24ad022ec518e955c", "score": "0.5111452", "text": "func GetQueryCmd() *cobra.Command {\n\tauthorizationQueryCmd := &cobra.Command{\n\t\tUse: types.ModuleName,\n\t\tShort: \"Querying commands for the authz module\",\n\t\tLong: \"\",\n\t\tDisableFlagParsing: true,\n\t\tSuggestionsMinimumDistance: 2,\n\t\tRunE: client.ValidateCmd,\n\t}\n\n\tauthorizationQueryCmd.AddCommand(\n\t\tGetCmdQueryAuthorization(),\n\t\tGetCmdQueryAuthorizations(),\n\t)\n\n\treturn authorizationQueryCmd\n}", "title": "" }, { "docid": "c35ed140ccedfaf7f8eeec3f1a13cddc", "score": "0.5108756", "text": "func GetQueryCmd(queryRoute string, cdc *codec.Codec) *cobra.Command {\n\t// Group swap queries under a subcommand\n\tswapQueryCmd := &cobra.Command{\n\t\tUse: \"swap\",\n\t\tShort: fmt.Sprintf(\"Querying commands for the %s module\", types.ModuleName),\n\t\tDisableFlagParsing: true,\n\t\tSuggestionsMinimumDistance: 2,\n\t\tRunE: client.ValidateCmd,\n\t}\n\n\tswapQueryCmd.AddCommand(\n\t\tflags.GetCommands(\n\t\t\tGetCmdSwapTokenPair(queryRoute, cdc),\n\t\t)...,\n\t)\n\n\treturn swapQueryCmd\n}", "title": "" }, { "docid": "e3b14cf5b97d7a8090d5a24a0066da81", "score": "0.51043147", "text": "func (c *Container) GetCmd() []string {\n\treturn c.Command\n}", "title": "" }, { "docid": "fb351011618d4e43411c76074e78811c", "score": "0.51037884", "text": "func GetCommand() *cobra.Command {\n\treturn baseCmd\n}", "title": "" }, { "docid": "fb351011618d4e43411c76074e78811c", "score": "0.51037884", "text": "func GetCommand() *cobra.Command {\n\treturn baseCmd\n}", "title": "" } ]
18c1b1c75dbf5e7c40db81951ca52ed0
WithShowbanned adds the showbanned to the forum get post and parent awaiting approval params
[ { "docid": "473397c752cef5407f03c3d7d8465e69", "score": "0.7478609", "text": "func (o *ForumGetPostAndParentAwaitingApprovalParams) WithShowbanned(showbanned *string) *ForumGetPostAndParentAwaitingApprovalParams {\n\to.SetShowbanned(showbanned)\n\treturn o\n}", "title": "" } ]
[ { "docid": "7b3a3e25c551c02ece541febf9bca31f", "score": "0.67556316", "text": "func (o *ForumGetPostAndParentAwaitingApprovalParams) SetShowbanned(showbanned *string) {\n\to.Showbanned = showbanned\n}", "title": "" }, { "docid": "a017234f50b81aeba89e472f42b2a2f7", "score": "0.5089788", "text": "func (o *ForumGetPostAndParentAwaitingApprovalParams) WithHTTPClient(client *http.Client) *ForumGetPostAndParentAwaitingApprovalParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "8ea68a9fb3a29a926a5129f9860f9adc", "score": "0.508578", "text": "func NewForumGetPostAndParentAwaitingApprovalParamsWithHTTPClient(client *http.Client) *ForumGetPostAndParentAwaitingApprovalParams {\n\tvar ()\n\treturn &ForumGetPostAndParentAwaitingApprovalParams{\n\t\tHTTPClient: client,\n\t}\n}", "title": "" }, { "docid": "564354273e96bd8103e1dde2aee3b13f", "score": "0.47840244", "text": "func NewForumGetPostAndParentAwaitingApprovalParams() *ForumGetPostAndParentAwaitingApprovalParams {\n\tvar ()\n\treturn &ForumGetPostAndParentAwaitingApprovalParams{\n\n\t\ttimeout: cr.DefaultTimeout,\n\t}\n}", "title": "" }, { "docid": "bc30f7908bcc1766d832563bc8d13410", "score": "0.47290742", "text": "func (s *SubredditService) Banned(ctx context.Context, subreddit string, opts *ListOptions) (*Bans, *Response, error) {\n\tpath := fmt.Sprintf(\"r/%s/about/banned\", subreddit)\n\n\tpath, err := addOptions(path, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(http.MethodGet, path, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\troot := new(struct {\n\t\tData struct {\n\t\t\tBans []*Ban `json:\"children\"`\n\t\t\tAfter string `json:\"after\"`\n\t\t\tBefore string `json:\"before\"`\n\t\t} `json:\"data\"`\n\t})\n\tresp, err := s.client.Do(ctx, req, root)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\tbans := &Bans{\n\t\tBans: root.Data.Bans,\n\t\tAfter: root.Data.After,\n\t\tBefore: root.Data.Before,\n\t}\n\n\treturn bans, resp, nil\n}", "title": "" }, { "docid": "a7d21abb082ec9a9a7776032df6dd907", "score": "0.46812177", "text": "func (o *ForumGetPostAndParentAwaitingApprovalParams) WithTimeout(timeout time.Duration) *ForumGetPostAndParentAwaitingApprovalParams {\n\to.SetTimeout(timeout)\n\treturn o\n}", "title": "" }, { "docid": "9e3e71912b6314eb142d1307488b235f", "score": "0.4667997", "text": "func (o *ForumGetPostAndParentAwaitingApprovalParams) WithContext(ctx context.Context) *ForumGetPostAndParentAwaitingApprovalParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "befa5c39c1bd5e3df8c05acfee12dace", "score": "0.46524632", "text": "func (o *PostV1MembershipsParams) WithVisible(visible *bool) *PostV1MembershipsParams {\n\to.SetVisible(visible)\n\treturn o\n}", "title": "" }, { "docid": "5cf7599ac19a1d681146ad708a59472c", "score": "0.45810416", "text": "func (s *ModerationService) Ban(ctx context.Context, subreddit string, username string, config *BanConfig) (*Response, error) {\n\tpath := fmt.Sprintf(\"r/%s/api/friend\", subreddit)\n\n\tform, err := query.Values(config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tform.Set(\"api_type\", \"json\")\n\tform.Set(\"name\", username)\n\tform.Set(\"type\", \"banned\")\n\n\treq, err := s.client.NewRequestWithForm(http.MethodPost, path, form)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}", "title": "" }, { "docid": "5d144ba478d396847355db947029c09f", "score": "0.44346282", "text": "func (s *SubredditService) WikiBanned(ctx context.Context, subreddit string, opts *ListOptions) (*Bans, *Response, error) {\n\tpath := fmt.Sprintf(\"r/%s/about/wikibanned\", subreddit)\n\n\tpath, err := addOptions(path, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(http.MethodGet, path, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar root struct {\n\t\tData struct {\n\t\t\tBans []*Ban `json:\"children\"`\n\t\t\tAfter string `json:\"after\"`\n\t\t\tBefore string `json:\"before\"`\n\t\t} `json:\"data\"`\n\t}\n\tresp, err := s.client.Do(ctx, req, &root)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\tbans := &Bans{\n\t\tBans: root.Data.Bans,\n\t\tAfter: root.Data.After,\n\t\tBefore: root.Data.Before,\n\t}\n\n\treturn bans, resp, nil\n}", "title": "" }, { "docid": "75cc837321434c314e3a755d59735252", "score": "0.4406977", "text": "func NewForumGetPostAndParentAwaitingApprovalParamsWithTimeout(timeout time.Duration) *ForumGetPostAndParentAwaitingApprovalParams {\n\tvar ()\n\treturn &ForumGetPostAndParentAwaitingApprovalParams{\n\n\t\ttimeout: timeout,\n\t}\n}", "title": "" }, { "docid": "c2a82bc54f5be69c9f073432fe805a4e", "score": "0.43881294", "text": "func Banned(v bool) predicate.User {\n\treturn predicate.User(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldBanned), v))\n\t})\n}", "title": "" }, { "docid": "c964707bdce29bd2ed186f88307ee857", "score": "0.42469063", "text": "func NewShowAccountbbbContext(ctx context.Context, service *goa.Service) (*ShowAccountbbbContext, error) {\n\tvar err error\n\tresp := goa.ContextResponse(ctx)\n\tresp.Service = service\n\treq := goa.ContextRequest(ctx)\n\trctx := ShowAccountbbbContext{Context: ctx, ResponseData: resp, RequestData: req}\n\tparamAccountbbbID := req.Params[\"accountbbbID\"]\n\tif len(paramAccountbbbID) > 0 {\n\t\trawAccountbbbID := paramAccountbbbID[0]\n\t\tif accountbbbID, err2 := strconv.Atoi(rawAccountbbbID); err2 == nil {\n\t\t\trctx.AccountbbbID = accountbbbID\n\t\t} else {\n\t\t\terr = goa.MergeErrors(err, goa.InvalidParamTypeError(\"accountbbbID\", rawAccountbbbID, \"integer\"))\n\t\t}\n\t\tif rctx.AccountbbbID < 1 {\n\t\t\terr = goa.MergeErrors(err, goa.InvalidRangeError(`accountbbbID`, rctx.AccountbbbID, 1, true))\n\t\t}\n\t}\n\treturn &rctx, err\n}", "title": "" }, { "docid": "a55f060c02f6beaa81ca611af85ed326", "score": "0.42272416", "text": "func (o *ForumGetPostAndParentAwaitingApprovalParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\t// path param childPostId\n\tif err := r.SetPathParam(\"childPostId\", swag.FormatUint64(o.ChildPostID)); err != nil {\n\t\treturn err\n\t}\n\n\tif o.Showbanned != nil {\n\n\t\t// query param showbanned\n\t\tvar qrShowbanned string\n\t\tif o.Showbanned != nil {\n\t\t\tqrShowbanned = *o.Showbanned\n\t\t}\n\t\tqShowbanned := qrShowbanned\n\t\tif qShowbanned != \"\" {\n\t\t\tif err := r.SetQueryParam(\"showbanned\", qShowbanned); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f462f96aa324dd980d48bf022554aabb", "score": "0.41518262", "text": "func UserProfileBan(c *gin.Context) {\n\tcurrentUser := router.GetUser(c)\n\t\n\tif currentUser.IsJanitor() {\n\t\tid, _ := strconv.ParseUint(c.Param(\"id\"), 10, 32)\n\t\t\n\t\tuserProfile, _, errorUser := users.FindForAdmin(uint(id))\n\t\tif errorUser == nil && !userProfile.IsModerator() {\n\t\t\t\taction := \"user_unbanned_by\"\n\t\t\t\tmessage := \"?unbanned\"\n\t\t\t\tif userProfile.ToggleBan() {\n\t\t\t\t\taction = \"user_banned_by\"\n\t\t\t\t\tmessage = \"?banned\"\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tactivities.Log(&models.User{}, fmt.Sprintf(\"user_%d\", id), \"edit\", action, userProfile.Username, strconv.Itoa(int(id)), currentUser.Username)\n\t\t\t\tc.Redirect(http.StatusSeeOther, fmt.Sprintf(\"/user/%d/%s\", id, c.Param(\"username\") + message))\n\t\t} else {\n\t\t\tc.AbortWithStatus(http.StatusNotFound)\n\t\t}\n\t} else {\n\t\tc.AbortWithStatus(http.StatusNotFound)\n\t}\n}", "title": "" }, { "docid": "f615a2047acdaddd8cb4b57004338bff", "score": "0.41149998", "text": "func (f BannerFunc) Ban(ip IP, r *http.Request) Ban {\n\treturn f(ip, r)\n}", "title": "" }, { "docid": "61fb3a2fb125e15c4e20ad1e12b3c036", "score": "0.41096324", "text": "func NewGetBansTypeForbidden() *GetBansTypeForbidden {\n\treturn &GetBansTypeForbidden{}\n}", "title": "" }, { "docid": "9b47aa1e74206e6af587b707b8539cb9", "score": "0.41017517", "text": "func (client *DefaultClient) HasBan(claims *JWTClaims, banType string, opts ...Option) bool {\n\toptions := processOptions(opts)\n\tspan, _ := jaeger.StartSpanFromContext(options.jaegerCtx, \"client.HasBan\")\n\n\tdefer jaeger.Finish(span)\n\n\tfor _, ban := range claims.Bans {\n\t\tif ban.Ban == banType {\n\t\t\tlog(\"HasBan: user banned\")\n\t\t\treturn true\n\t\t}\n\t}\n\n\tlog(\"HasBan: user not banned\")\n\n\treturn false\n}", "title": "" }, { "docid": "f7ac7378445441cee8d4c1809a5f0d6a", "score": "0.40853652", "text": "func BanUser(userName, banReason string) (int, error) {\n\tfor _, excluded := range config.AppSecrets.UserWhitelist {\n\t\tif userName == excluded {\n\t\t\t//fmt.Printf(\"NOT banning user %q\\n\", excluded)\n\t\t\treturn 200, nil\n\t\t}\n\t}\n\n\tlog.Println(\"Banning user: \", userName)\n\tvar newBan = models.BanAPICall{AuthUser: config.AppSecrets.TDAPIUser, IsBanned: \"true\", TakedownCode: banReason}\n\n\tjsonStr, err := json.Marshal(newBan)\n\tif err != nil {\n\t\tlog.Println(\"Error marshalling banUser json: \", err)\n\t\treturn 0, err\n\t}\n\n\treq, err := http.NewRequest(\"PUT\", config.AppSecrets.TDAPIURL+userName+\"/ban\", bytes.NewBuffer(jsonStr))\n\tif err != nil {\n\t\tlog.Println(\"Error creating request to ban user: \", err)\n\t\treturn 0, err\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer \"+config.AppSecrets.TDAPIToken)\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\treq.Header.Set(\"Accept\", \"application/json\")\n\treq.Header.Set(\"authorization_username\", config.AppSecrets.TDAPIURL+userName)\n\n\t//fmt.Println(\"BanRequest\", req)\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tlog.Println(\"banUser: Error making API request: \")\n\t\treturn 0, err\n\t}\n\n\tdefer resp.Body.Close()\n\n\tlog.Println(\"Successfully called ban API: \", resp.Status)\n\treturn resp.StatusCode, nil\n}", "title": "" }, { "docid": "9e042dfc61fdbaec63986de88812d724", "score": "0.4069", "text": "func serveSettings(r *gin.Engine) {\n\tr.POST(\"/settings/allData\", func(c *gin.Context) {\n\t\tif isNotAdmin(c) {\n\t\t\treturn\n\t\t}\n\n\t\tdbBlockedClans, err := db.GetBlockedClans()\n\t\tif returnIfErr(c, err, \"can't get blocked clans from database\") {\n\t\t\treturn\n\t\t}\n\n\t\tdbExtraClans, err := db.GetExtraClans()\n\t\tif returnIfErr(c, err, \"can't get extra clans from database\") {\n\t\t\treturn\n\t\t}\n\n\t\tc.JSON(200, map[string]interface{}{\n\t\t\t\"status\": true,\n\t\t\t\"fields\": []interface{}{\n\t\t\t\ttypeArrayField{\n\t\t\t\t\tType: \"array\",\n\t\t\t\t\tScreenName: \"Blocked Clans\",\n\t\t\t\t\tDiscription: \"Clans that need to be removed from the list\",\n\t\t\t\t\tClans: dbBlockedClans,\n\t\t\t\t\tUpdateURL: \"/settings/update/blockedClans\",\n\t\t\t\t},\n\t\t\t\ttypeArrayField{\n\t\t\t\t\tType: \"array\",\n\t\t\t\t\tScreenName: \"Extra Clans\",\n\t\t\t\t\tDiscription: \"Add here extra clans to fetch\",\n\t\t\t\t\tClans: dbExtraClans,\n\t\t\t\t\tUpdateURL: \"/settings/update/extraClans\",\n\t\t\t\t},\n\t\t\t},\n\t\t})\n\t})\n\tr.POST(\"/settings/update/blockedClans\", func(c *gin.Context) {\n\t\tvar postData db.PostBlockedClans\n\n\t\tif isNotAdmin(c, func() (string, string) {\n\t\t\t_ = c.ShouldBindJSON(&postData)\n\t\t\treturn postData.UserID, postData.UserKey\n\t\t}) {\n\t\t\treturn\n\t\t}\n\n\t\tif returnIfErr(c, postData.Clans.UpdateInDB(), \"Can't insert clan ids\") {\n\t\t\treturn\n\t\t}\n\n\t\tSendAndUpdateList(c)\n\t})\n\tr.POST(\"/settings/update/extraClans\", func(c *gin.Context) {\n\t\tvar postData db.PostExtraClans\n\n\t\tif isNotAdmin(c, func() (string, string) {\n\t\t\t_ = c.ShouldBindJSON(&postData)\n\t\t\treturn postData.UserID, postData.UserKey\n\t\t}) {\n\t\t\treturn\n\t\t}\n\n\t\tif returnIfErr(c, postData.Clans.UpdateInDB(), \"Can't insert clan ids\") {\n\t\t\treturn\n\t\t}\n\n\t\tSendAndUpdateList(c)\n\t})\n}", "title": "" }, { "docid": "285f9938ffe1bd7433b726479f355db1", "score": "0.40345925", "text": "func (tester *ReputationTester) nonBpVote(t *testing.T, d *Dandelion) {\n\tNonBpVote(t, d, repCrtName, tester.acc4.Name, tester.bpList, []*DandelionAccount{tester.acc4})\n}", "title": "" }, { "docid": "03c464de25de74ea828bc4fe09b6ad44", "score": "0.40245172", "text": "func enableBlackOrWhiteList(bwcode int, w http.ResponseWriter, req *http.Request) {\n\tcode := req.FormValue(\"opcode\")\n\teve := eLiveListCtrl.EveEnableBlackList{}\n\n\tif code == \"1\" {\n\t\teve.Enable = true\n\t} else if code == \"0\" {\n\t\teve.Enable = false\n\t} else {\n\t\tsendBadResponse(w, \"opcode error\", WSSParamError)\n\t\treturn\n\t}\n\n\tvar err error\n\tif bwcode == 0 {\n\t\terr = wssapi.HandleTask(&eve)\n\t\twssapi.HandleTask(&eve)\n\t} else if bwcode == 1 {\n\t\ttask := &eLiveListCtrl.EveEnableWhiteList{}\n\t\ttask.Enable = eve.Enable\n\t\terr = wssapi.HandleTask(task)\n\t} else {\n\t\tsendBadResponse(w, \"bwcode error\", WSSSeverError)\n\t\treturn\n\t}\n\n\tif err != nil {\n\t\tsendBadResponse(w, \"error in service \", WSSParamError)\n\t\treturn\n\t}\n\tsendSuccessResponse(\"op success\", nil, w)\n}", "title": "" }, { "docid": "6351a872313b96e0729e24d01133051e", "score": "0.40162095", "text": "func Ban(b discord.Ban, userID discord.UserID) discord.Ban {\n\tb.User = User(b.User, userID)\n\n\treturn b\n}", "title": "" }, { "docid": "649400eace939b6d72126dee93495d7b", "score": "0.39566144", "text": "func (f *faceit) Ban(hubid, guid, reason string) error {\n\turl := fmt.Sprintf(\"https://api.faceit.com/hubs/v1/hub/%s/ban/%s\", hubid, guid)\n\n\tpayload := BanPayload{\n\t\tHubID: hubid,\n\t\tUserID: guid,\n\t\tReasion: reason,\n\t}\n\n\tbody, err := json.Marshal(payload)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treq, err := http.NewRequest(\"POST\", url, bytes.NewBuffer(body))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tresp, err := f.UC.Do(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode != 200 && resp.StatusCode != 201 {\n\t\treturn fmt.Errorf(\"Server returned: %d\", resp.StatusCode)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "e7fd5b8aa3413e5f98449f35ab942c3c", "score": "0.39562258", "text": "func (m *RecordResponsePostRequestBody) SetBargeInAllowed(value *bool)() {\n m.bargeInAllowed = value\n}", "title": "" }, { "docid": "c0d57439b59bd2a1871ed64dd21c1baa", "score": "0.3951677", "text": "func (o GetWafEntityUrlMethodOverrideOutput) Allow() pulumi.BoolOutput {\n\treturn o.ApplyT(func(v GetWafEntityUrlMethodOverride) bool { return v.Allow }).(pulumi.BoolOutput)\n}", "title": "" }, { "docid": "ce975034a09eef05b2c7fd6b90d83c8d", "score": "0.3939599", "text": "func (d *Database) ActivatePlanVoting(BattleID string, warriorID string, PlanID string) ([]*Plan, error) {\n\terr := d.ConfirmLeader(BattleID, warriorID)\n\tif err != nil {\n\t\treturn nil, errors.New(\"incorrect permissions\")\n\t}\n\n\tif _, err := d.db.Exec(\n\t\t`call activate_plan_voting($1, $2);`, BattleID, PlanID,\n\t); err != nil {\n\t\tlog.Println(err)\n\t}\n\n\tplans := d.GetPlans(BattleID)\n\n\treturn plans, nil\n}", "title": "" }, { "docid": "77ac2df0b47f93e3bb930e8f2c552ce1", "score": "0.39328566", "text": "func (a *App) allowChannelMentions(c request.CTX, post *model.Post, numProfiles int) bool {\n\tif !a.HasPermissionToChannel(c, post.UserId, post.ChannelId, model.PermissionUseChannelMentions) {\n\t\treturn false\n\t}\n\n\tif post.Type == model.PostTypeHeaderChange || post.Type == model.PostTypePurposeChange {\n\t\treturn false\n\t}\n\n\tif int64(numProfiles) >= *a.Config().TeamSettings.MaxNotificationsPerChannel {\n\t\treturn false\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "2483754304692f737a19f80f6feb1830", "score": "0.39309576", "text": "func (dc *TidbController) Limit() {\n\tuser := dc.GetString(\":user\")\n\tif len(user) < 1 {\n\t\tdc.CustomAbort(403, \"user id is nil\")\n\t}\n\tac := &operator.ApprovalConditions{}\n\tb := dc.Ctx.Input.RequestBody\n\tif len(b) < 1 {\n\t\tdc.CustomAbort(403, \"body is empty\")\n\t}\n\tif err := json.Unmarshal(b, ac); err != nil {\n\t\tdc.CustomAbort(400, fmt.Sprintf(\"Parse body error: %v\", err))\n\t}\n\tlimit := operator.NeedApproval(user, ac.KvReplicas, ac.DbReplicas)\n\tdc.Data[\"json\"] = limit\n\tdc.ServeJSON()\n}", "title": "" }, { "docid": "ff07b919797214dadc62017dd3afa0e2", "score": "0.39262635", "text": "func setBlackOrWhiteList(bwcode int, w http.ResponseWriter, req *http.Request) {\n\tstr := req.FormValue(\"list\")\n\topcode := req.FormValue(\"opcode\")\n\tif str == \"\" || opcode == \"\" {\n\t\tsendBadResponse(w, \"need list data,it is look like 'list=xxx|xxx|xxx|xxx'\", WSSParamError)\n\t\treturn\n\t}\n\n\teve := eLiveListCtrl.EveSetBlackList{}\n\n\tif opcode == \"0\" {\n\t\teve.Add = false\n\t} else if opcode == \"1\" {\n\t\teve.Add = true\n\t} else {\n\t\tsendBadResponse(w, \"opcode error , 0 for del 1 for add\", WSSParamError)\n\t\treturn\n\t}\n\n\tbanList := strings.Split(str, \"|\")\n\teve.Names = list.New()\n\tfor _, item := range banList {\n\t\teve.Names.PushBack(item)\n\t}\n\n\tvar err error\n\tif bwcode == 0 {\n\t\terr = wssapi.HandleTask(&eve)\n\t} else if bwcode == 1 {\n\t\ttask := &eLiveListCtrl.EveSetWhiteList{}\n\t\ttask.Add = eve.Add\n\t\ttask.Names = eve.Names\n\t\terr = wssapi.HandleTask(task)\n\t} else {\n\t\tsendBadResponse(w, \"bwcode error\", WSSSeverError)\n\t\treturn\n\t}\n\tif err != nil {\n\t\tsendBadResponse(w, \"error in service \", WSSParamError)\n\t\treturn\n\t}\n\n\tsendSuccessResponse(\"op success\", nil, w)\n}", "title": "" }, { "docid": "a44a393bbe00cfd40eb1bafca826bb42", "score": "0.3924544", "text": "func (c *Client) RenterPostPartialAllowance() *AllowanceRequestPost {\n\treturn &AllowanceRequestPost{c: c, values: make(url.Values)}\n}", "title": "" }, { "docid": "3c7d0e67d0ee0b58584ed75c20fd3514", "score": "0.39161846", "text": "func (s *ModerationService) BanWiki(ctx context.Context, subreddit string, username string, config *BanConfig) (*Response, error) {\n\tpath := fmt.Sprintf(\"r/%s/api/friend\", subreddit)\n\n\tform, err := query.Values(config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tform.Set(\"api_type\", \"json\")\n\tform.Set(\"name\", username)\n\tform.Set(\"type\", \"wikibanned\")\n\n\treq, err := s.client.NewRequestWithForm(http.MethodPost, path, form)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}", "title": "" }, { "docid": "f99caf7866ac07397087d19c82348b55", "score": "0.39075842", "text": "func withForum(node *Forum) forumOption {\n\treturn func(m *ForumMutation) {\n\t\tm.oldValue = func(context.Context) (*Forum, error) {\n\t\t\treturn node, nil\n\t\t}\n\t\tm.id = &node.ID\n\t}\n}", "title": "" }, { "docid": "f2ec02e2bb4972c16c338fa3e1cffe54", "score": "0.38886586", "text": "func BannedNEQ(v bool) predicate.User {\n\treturn predicate.User(func(s *sql.Selector) {\n\t\ts.Where(sql.NEQ(s.C(FieldBanned), v))\n\t})\n}", "title": "" }, { "docid": "20eab5f1cacd33125641b5653823b2d3", "score": "0.38867977", "text": "func (m *Mantle) replenishBalance(w *botWallet, minFunds, maxFunds uint64) {\n\t// Get the Balance from the user in case it changed while while this note\n\t// was in the notification pipeline.\n\tbal, err := m.AssetBalance(w.assetID)\n\tif err != nil {\n\t\tm.fatalError(\"error updating %s balance: %v\", w.symbol, err)\n\t\treturn\n\t}\n\n\tm.log.Debugf(\"Balance note received for %s (minFunds = %s, maxFunds = %s): %s\",\n\t\tw.symbol, valString(minFunds, w.symbol), valString(maxFunds, w.symbol), mustJSON(bal))\n\n\t// If over or under max, make the average of the two.\n\twantBal := (maxFunds + minFunds) / 2\n\n\tif bal.Available < minFunds {\n\t\tchunk := (wantBal - bal.Available) / uint64(w.numCoins)\n\t\tfor i := 0; i < w.numCoins; {\n\t\t\tm.log.Debugf(\"Requesting %s from %s alpha node\", valString(chunk, w.symbol), w.symbol)\n\t\t\tif err = send(w.symbol, alpha, w.address, chunk); err != nil {\n\t\t\t\tif ignoreErrors && ctx.Err() == nil {\n\t\t\t\t\tm.log.Errorf(\"Trouble sending %d %s to %s: %v\\n Sleeping and trying again.\",\n\t\t\t\t\t\tvalString(chunk, w.symbol), w.symbol, w.address, err)\n\t\t\t\t\t// It often happens that the wallet is not able to\n\t\t\t\t\t// create enough outputs. mine and try indefinitely\n\t\t\t\t\t// if we are ignoring errors.\n\t\t\t\t\t<-harnessCtl(ctx, w.symbol, fmt.Sprintf(\"./mine-%s\", alpha), \"1\")\n\t\t\t\t\ttime.Sleep(time.Second)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tm.fatalError(\"error refreshing balance for %s: %v\", w.symbol, err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\ti++\n\t\t}\n\t} else if bal.Available > maxFunds {\n\t\t// Send some back to the alpha address.\n\t\tamt := bal.Available - wantBal\n\t\tm.log.Debugf(\"Sending %s back to %s alpha node\", valString(amt, w.symbol), w.symbol)\n\t\t_, err := m.Send(pass, w.assetID, amt, returnAddress(w.symbol, alpha), false)\n\t\tif err != nil {\n\t\t\tm.fatalError(\"failed to send funds to alpha: %v\", err)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e61e9ab12d46898972d000cf2f35bc95", "score": "0.38686767", "text": "func (uuo *UserUpdateOne) AddUserApprovedIDs(ids ...int) *UserUpdateOne {\n\tuuo.mutation.AddUserApprovedIDs(ids...)\n\treturn uuo\n}", "title": "" }, { "docid": "49fb03bbbbb8c2eab48ae1c3681427fe", "score": "0.38652402", "text": "func ShowPost(c *gin.Context) {\n\n\tvar postIDFromURL = c.Param(\"post_id\")\n\tvar stateFromURL = c.Param(\"state\")\n\tvar userID, postID gocql.UUID\n\tvar category, title, description, city, state string\n\tvar price, deposit int\n\tvar available bool\n\tvar lastUpdateTime time.Time\n\tvar imageUrls []string\n\tvar latitude, longitude float64\n\n\t// connect to the cluster\n\tcluster := gocql.NewCluster(constants.IPAddress)\n\tcluster.Keyspace = constants.ClusterKeyspace\n\tcluster.ProtoVersion = 4\n\tsession, _ := cluster.CreateSession()\n\tdefer session.Close()\n\n\tif err := session.Query(`SELECT\n\t\tuser_id, post_id, category, title, description, price, deposit, available,\n \t last_update_time, image_urls, city, state, latitude, longitude\n FROM posts WHERE state = ? and post_id = ? LIMIT 1`,\n\t\tstateFromURL, postIDFromURL).Scan(&userID, &postID, &category, &title, &description,\n\t\t&price, &deposit, &available, &lastUpdateTime, &imageUrls, &city, &state, &latitude, &longitude); err != nil {\n\n\t\tc.JSON(http.StatusInternalServerError, gin.H{\"error\": err.Error()})\n\t\treturn\n\t}\n\n\tpost := models.Post{\n\t\tUserID: userID,\n\t\tPostID: postID,\n\t\tCategory: category,\n\t\tTitle: title,\n\t\tDescription: description,\n\t\tPrice: price,\n\t\tDeposit: deposit,\n\t\tAvailable: available,\n\t\tLastUpdateTime: lastUpdateTime,\n\t\tImageUrls: imageUrls,\n\t\tCity: city,\n\t\tState: state,\n\t\tLatitude: latitude,\n\t\tLongitude: longitude}\n\n\tc.JSON(http.StatusOK, post)\n}", "title": "" }, { "docid": "8faaa37f36ddd85e4397c4a33b31f567", "score": "0.38650173", "text": "func mgsApproveMemberFlag(grpSettings *gset.Groups, flagName string, flagVal string) error {\n\tlg.Debug(\"starting mgsApproveMemberFlag()\")\n\tdefer lg.Debug(\"finished mgsApproveMemberFlag()\")\n\n\tvalidTxt, err := grpset.ValidateGroupSettingValue(grpset.ApproveMemberMap, flagName, flagVal)\n\tif err != nil {\n\t\treturn err\n\t}\n\tgrpSettings.WhoCanApproveMembers = validTxt\n\treturn nil\n}", "title": "" }, { "docid": "9da75198c8461da6dc777b419ac79b2d", "score": "0.38582468", "text": "func (ar *AuthorizationRequest) Approve() {\n\tar.Approved = true\n}", "title": "" }, { "docid": "4e5f0daefde301e0bed926b6979d4161", "score": "0.38512403", "text": "func (v Stories) GetBanned(params StoriesGetBannedParams) (StoriesGetBannedResponse, error) {\n\tr, err := v.API.Request(\"stories.getBanned\", params)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar resp StoriesGetBannedResponse\n\tif params.Extended {\n\t\tvar tmp StoriesGetBannedResponseExtended\n\t\terr = json.Unmarshal(r, &tmp)\n\t\tresp = &tmp\n\t} else {\n\t\tvar tmp StoriesGetBannedResponseNormal\n\t\terr = json.Unmarshal(r, &tmp)\n\t\tresp = &tmp\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn resp, nil\n}", "title": "" }, { "docid": "5fc1c5520d41392912015c580bb0c5ea", "score": "0.38428596", "text": "func (_Ethdepositcontract *EthdepositcontractTransactorSession) BanNode(_node common.Address) (*types.Transaction, error) {\n\treturn _Ethdepositcontract.Contract.BanNode(&_Ethdepositcontract.TransactOpts, _node)\n}", "title": "" }, { "docid": "1fbb7aee4035aac92392cb77fcb38160", "score": "0.38413745", "text": "func (a *AllowanceRequestPost) WithRenewWindow(renewWindow types.BlockHeight) *AllowanceRequestPost {\n\ta.values.Set(\"renewwindow\", fmt.Sprint(renewWindow))\n\treturn a\n}", "title": "" }, { "docid": "6ee46d70498c07793b6dcf820f1ac276", "score": "0.38399923", "text": "func (b *Builder) WithAllowAnnotations(annotations map[string][]string) {\n\tb.internal.WithAllowAnnotations(annotations)\n}", "title": "" }, { "docid": "ffc7a083ca1a23247e08805230d4b0f6", "score": "0.3833468", "text": "func (uu *UserUpdate) AddUserApprovedIDs(ids ...int) *UserUpdate {\n\tuu.mutation.AddUserApprovedIDs(ids...)\n\treturn uu\n}", "title": "" }, { "docid": "8ad71693c0cddeeea23108360e130173", "score": "0.38250625", "text": "func (_Ethdepositcontract *EthdepositcontractTransactor) BanNode(opts *bind.TransactOpts, _node common.Address) (*types.Transaction, error) {\n\treturn _Ethdepositcontract.contract.Transact(opts, \"banNode\", _node)\n}", "title": "" }, { "docid": "2465fc0f64a894f9f1cf6ed1202d16dd", "score": "0.38139158", "text": "func unbanCommand(s *discordgo.Session, m *discordgo.Message) {\n\n\tvar banFlag = false\n\n\tmisc.MapMutex.Lock()\n\tguildPrefix := misc.GuildMap[m.GuildID].GuildConfig.Prefix\n\tguildBotLog := misc.GuildMap[m.GuildID].GuildConfig.BotLog.ID\n\tmisc.MapMutex.Unlock()\n\n\tmessageLowercase := strings.ToLower(m.Content)\n\tcommandStrings := strings.Split(messageLowercase, \" \")\n\n\tif len(commandStrings) < 2 {\n\t\t_, err := s.ChannelMessageSend(m.ChannelID, \"Usage: `\"+guildPrefix+\"unban [@user, userID, or username#discrim]` format.\\n\\n\"+\n\t\t\t\"Note: this command supports username#discrim where username contains spaces.\")\n\t\tif err != nil {\n\t\t\t_, err = s.ChannelMessageSend(guildBotLog, err.Error()+\"\\n\"+misc.ErrorLocation(err))\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\treturn\n\t}\n\n\tuserID, err := misc.GetUserID(m, commandStrings)\n\tif err != nil {\n\t\tmisc.CommandErrorHandler(s, m, err, guildBotLog)\n\t\treturn\n\t}\n\n\tuser, err := s.User(userID)\n\tif err != nil {\n\t\tmisc.CommandErrorHandler(s, m, err, guildBotLog)\n\t\treturn\n\t}\n\n\t// Goes through every banned user from BannedUsersSlice and if the user is in it, confirms that user is a temp ban\n\tmisc.MapMutex.Lock()\n\tif len(misc.GuildMap[m.GuildID].BannedUsers) == 0 {\n\t\t_, err = s.ChannelMessageSend(m.ChannelID, \"No bans found.\")\n\t\tif err != nil {\n\t\t\t_, err = s.ChannelMessageSend(guildBotLog, err.Error()+\"\\n\"+misc.ErrorLocation(err))\n\t\t\tif err != nil {\n\t\t\t\tmisc.MapMutex.Unlock()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tmisc.MapMutex.Unlock()\n\t\t\treturn\n\t\t}\n\t\tmisc.MapMutex.Unlock()\n\t\treturn\n\t}\n\n\tfor i := 0; i < len(misc.GuildMap[m.GuildID].BannedUsers); i++ {\n\t\tif misc.GuildMap[m.GuildID].BannedUsers[i].ID == userID {\n\t\t\tbanFlag = true\n\n\t\t\t// Removes the ban from BannedUsersSlice\n\t\t\tmisc.GuildMap[m.GuildID].BannedUsers = append(misc.GuildMap[m.GuildID].BannedUsers[:i], misc.GuildMap[m.GuildID].BannedUsers[i+1:]...)\n\t\t\tbreak\n\t\t}\n\t}\n\tmisc.MapMutex.Unlock()\n\n\tif !banFlag {\n\t\t_, err := s.ChannelMessageSend(m.ChannelID, fmt.Sprintf(\"__%v#%v__ is not banned.\", user.Username, user.Discriminator))\n\t\tif err != nil {\n\t\t\t_, err = s.ChannelMessageSend(guildBotLog, err.Error()+\"\\n\"+misc.ErrorLocation(err))\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\treturn\n\t}\n\n\t// Removes the ban\n\terr = s.GuildBanDelete(m.GuildID, userID)\n\tif err != nil {\n\t\tmisc.CommandErrorHandler(s, m, err, guildBotLog)\n\t\treturn\n\t}\n\n\t// Saves time of unban command usage\n\tt := time.Now()\n\n\t// Updates unban date in memberInfo.json entry if possible and writes to storage\n\tmisc.MapMutex.Lock()\n\tif _, ok := misc.GuildMap[m.GuildID].MemberInfoMap[userID]; ok {\n\t\tmisc.GuildMap[m.GuildID].MemberInfoMap[userID].UnbanDate = t.Format(\"2006-01-02 15:04:05\")\n\t\tmisc.WriteMemberInfo(misc.GuildMap[m.GuildID].MemberInfoMap, m.GuildID)\n\t}\n\tmisc.BannedUsersWrite(misc.GuildMap[m.GuildID].BannedUsers, m.GuildID)\n\tmisc.MapMutex.Unlock()\n\n\t_, err = s.ChannelMessageSend(m.ChannelID, fmt.Sprintf(\"__%v#%v__ has been unbanned.\", user.Username, user.Discriminator))\n\tif err != nil {\n\t\t_, err = s.ChannelMessageSend(guildBotLog, err.Error()+\"\\n\"+misc.ErrorLocation(err))\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\treturn\n\t}\n\n\t// Sends an embed message to bot-log if possible\n\tmisc.MapMutex.Lock()\n\tif _, ok := misc.GuildMap[m.GuildID].MemberInfoMap[userID]; ok {\n\t\terr = misc.UnbanEmbed(s, misc.GuildMap[m.GuildID].MemberInfoMap[userID], m.Author.Username, guildBotLog)\n\t}\n\tmisc.MapMutex.Unlock()\n}", "title": "" }, { "docid": "b0761408c207544aa5c86ac418e6cc70", "score": "0.38116273", "text": "func (_Vbnb *VbnbTransactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) {\n\treturn _Vbnb.contract.Transact(opts, \"approve\", spender, amount)\n}", "title": "" }, { "docid": "953995994d0b90246983e33b24721ec1", "score": "0.37963462", "text": "func (s *Store) rpl_banlist(m *irc.IrcMessage) {\n\tchannel := m.Args[1]\n\ts.GetChannel(channel).AddBan(m.Args[2])\n}", "title": "" }, { "docid": "71a5886c6bedee875fa333a453880353", "score": "0.3780992", "text": "func (s *Session) SendBan(nick string, reason string, duration time.Duration, banip bool) error {\n\tb := banOut{\n\t\tNick: nick,\n\t\tReason: reason,\n\t\tBanip: banip,\n\t}\n\tif duration > 0 {\n\t\tb.Duration = int64(duration)\n\t}\n\treturn s.send(b, \"BAN\")\n}", "title": "" }, { "docid": "c0ac55551d2008c988e84ce3c90077e5", "score": "0.37706304", "text": "func (ad *SysAccountRepo) allowListAccount(ctx context.Context) (*coresvc.QueryParams, error) {\n\t_, curAcc, err := ad.accountFromClaims(ctx)\n\tif err != nil {\n\t\treturn nil, status.Errorf(codes.Unauthenticated, sharedAuth.Error{Reason: sharedAuth.ErrRequestUnauthenticated, Err: err}.Error())\n\t}\n\t// allow all if it's superadmin\n\tif sharedAuth.IsSuperadmin(curAcc.GetRoles()) {\n\t\treturn &coresvc.QueryParams{Params: map[string]interface{}{}}, nil\n\t}\n\tisAdm, idx := sharedAuth.IsAdmin(curAcc.GetRoles())\n\tif isAdm {\n\t\tparams := map[string]interface{}{}\n\t\tif curAcc.Roles[*idx].OrgId != \"\" {\n\t\t\tparams[\"org_id\"] = curAcc.Roles[*idx].OrgId\n\t\t\t// only allow org admin to query its own org\n\t\t\treturn &coresvc.QueryParams{Params: params}, nil\n\t\t} else if curAcc.Roles[*idx].ProjectId != \"\" {\n\t\t\tparams[\"org_id\"] = curAcc.Roles[*idx].OrgId\n\t\t\tparams[\"project_id\"] = curAcc.Roles[*idx].ProjectId\n\t\t\t// only allow project admin to query its own project\n\t\t\treturn &coresvc.QueryParams{Params: params}, nil\n\t\t} else {\n\t\t\treturn nil, status.Errorf(codes.PermissionDenied, sharedAuth.Error{Reason: sharedAuth.ErrInvalidParameters, Err: err}.Error())\n\t\t}\n\t}\n\treturn &coresvc.QueryParams{Params: map[string]interface{}{\"id\": curAcc.Id}}, nil\n}", "title": "" }, { "docid": "141e8470d25cba894b2a90db4ff0bc33", "score": "0.377022", "text": "func configureFlags(api *operations.ForumAPI) {\n\t// api.CommandLineOptionsGroups = []swag.CommandLineOptionsGroup{ ... }\n}", "title": "" }, { "docid": "1096880ec09b2329a0523f41d1b6e95f", "score": "0.37668434", "text": "func (u *User) Approve(approved bool) *User {\n\tu.Approved = approved\n\treturn u\n}", "title": "" }, { "docid": "38e4e0a01eeff50a790e8fa197bb0d34", "score": "0.37513307", "text": "func (s *Service) BanUsers(c context.Context, mid, oid int64, dmids []int64) (err error) {\n\tvar (\n\t\tisAssist bool\n\t\tfltMap = make(map[string]string)\n\t)\n\tsub, err := s.subject(c, model.SubTypeVideo, oid)\n\tif err != nil {\n\t\treturn\n\t}\n\tif !s.isUpper(sub.Mid, mid) {\n\t\tif err = s.isAssist(c, sub.Mid, mid); err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\tidxMap, _, err := s.dao.IndexsByid(c, sub.Type, oid, dmids)\n\tif err != nil || len(idxMap) == 0 {\n\t\treturn\n\t}\n\tctsmap, err := s.dao.Contents(c, oid, dmids)\n\tif err != nil {\n\t\treturn\n\t}\n\tfor _, idx := range idxMap {\n\t\thashID := model.Hash(idx.Mid, 0)\n\t\tif _, ok := fltMap[hashID]; !ok {\n\t\t\tvar comment string\n\t\t\tif v, ok := ctsmap[idx.ID]; ok {\n\t\t\t\tcomment = v.Msg\n\t\t\t}\n\t\t\tfltMap[hashID] = comment\n\t\t}\n\t}\n\tif len(fltMap) == 0 {\n\t\treturn\n\t}\n\tif err = s.AddUpFilters(c, sub.Mid, model.FilterTypeID, fltMap); err != nil {\n\t\treturn\n\t}\n\tif isAssist {\n\t\tfor filter, comment := range fltMap {\n\t\t\tif len(comment) > 50 {\n\t\t\t\tcomment = fmt.Sprintf(\"%s...\", comment[:50])\n\t\t\t}\n\t\t\targ := &assmdl.ArgAssistLogAdd{\n\t\t\t\tMid: sub.Mid,\n\t\t\t\tAssistMid: mid,\n\t\t\t\tType: assmdl.TypeDm,\n\t\t\t\tAction: assmdl.ActDisUser,\n\t\t\t\tSubjectID: sub.Mid,\n\t\t\t\tObjectID: filter,\n\t\t\t\tDetail: comment,\n\t\t\t}\n\t\t\tselect {\n\t\t\tcase s.assistLogChan <- arg:\n\t\t\tdefault:\n\t\t\t\tlog.Error(\"assistLogChan is full\")\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "7cab719a2f1271a1a75b0807dacd26b8", "score": "0.37511742", "text": "func (c *Chain33) ShowBlacklist(in *types.ReqNil, result *interface{}) error {\n\treply, err := c.cli.ShowBlacklist(in)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t*result = reply.GetBlackinfo()\n\treturn nil\n}", "title": "" }, { "docid": "9362bbfc81b7450275eec1b80f21dd00", "score": "0.3750022", "text": "func ApproveRequest(APIstub shim.ChaincodeStubInterface, args []string, userID string) sc.Response {\n\n\torganizationID, status, expireTime := args[0], args[1], args[2]\n\tapprovedInfos, err := utils.SliceFromString(args[3])\n\n\tif status != \"Approved\" && status != \"Rejected\" {\n\t\treturn shim.Error(\"Incorrect Status supplied\")\n\t}\n\tbankApprovalID := fc.GetMD5Hash(userID + \"-BankApproval\")\n\tbankApproval := common.BankApproval{}\n\tbankApprovalAsBytes, err := APIstub.GetState(bankApprovalID)\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\tif bankApprovalAsBytes == nil {\n\t\treturn shim.Error(\"Requests Not Found for user\")\n\t}\n\terr = json.Unmarshal(bankApprovalAsBytes, &bankApproval)\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\tfor i := 0; i < len(bankApproval.Banks); i++ {\n\t\tbankRequest := bankApproval.Banks[i]\n\t\tif organizationID == bankRequest.BankID {\n\t\t\tif bankRequest.UserStatus == \"Approved\" {\n\t\t\t\treturn shim.Error(\"Already approved for given bankID\")\n\t\t\t}\n\t\t\tbankRequest.UserStatus = status\n\t\t\tbankRequest.ExpireTime = expireTime\n\t\t\tbankRequest.ApprovedInfos = approvedInfos\n\n\t\t\tbankApproval.Banks[i] = bankRequest\n\t\t\tbankApproval.UpdatedAt = utils.GetTimestampAsISO(APIstub)\n\t\t\tupdatedApprovalAsBytes, err := json.Marshal(bankApproval)\n\t\t\tif err != nil {\n\t\t\t\treturn shim.Error(err.Error())\n\t\t\t}\n\t\t\terr = APIstub.PutState(bankApproval.ID, updatedApprovalAsBytes)\n\t\t\tif err != nil {\n\t\t\t\treturn shim.Error(err.Error())\n\t\t\t}\n\t\t\treturn shim.Success(updatedApprovalAsBytes)\n\t\t}\n\t}\n\treturn shim.Error(\"No request found for given bankID\")\n}", "title": "" }, { "docid": "e9cc928b81c55477d239133d0c782df3", "score": "0.3746322", "text": "func allowModTeamDisplay(c *gin.Context) bool {\n\t// TODO(tboerger): Add real implementation\n\treturn false\n}", "title": "" }, { "docid": "fcc32e12e7cb0bfc78b5347c9270a3c6", "score": "0.3745055", "text": "func (a *author) show(abranch string) {\n\t(*a).branch = abranch\n}", "title": "" }, { "docid": "859d9f50d61631d35f623d225b979c1a", "score": "0.37448305", "text": "func (settings *Settings) SetUserBanned(id steamid.SteamId, value bool) {\n\tsettings.createUserEntry(id)\n\tstmt := `UPDATE Users SET banned=? WHERE id=?`\n\tif _, err := settings.db.Exec(stmt, value, id); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "ca71f6ef6e0f2cd65bded38ab48de6ec", "score": "0.37432134", "text": "func (client *Client) SetDBInstancePlanStatusWithChan(request *SetDBInstancePlanStatusRequest) (<-chan *SetDBInstancePlanStatusResponse, <-chan error) {\n\tresponseChan := make(chan *SetDBInstancePlanStatusResponse, 1)\n\terrChan := make(chan error, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tdefer close(responseChan)\n\t\tdefer close(errChan)\n\t\tresponse, err := client.SetDBInstancePlanStatus(request)\n\t\tif err != nil {\n\t\t\terrChan <- err\n\t\t} else {\n\t\t\tresponseChan <- response\n\t\t}\n\t})\n\tif err != nil {\n\t\terrChan <- err\n\t\tclose(responseChan)\n\t\tclose(errChan)\n\t}\n\treturn responseChan, errChan\n}", "title": "" }, { "docid": "04f3c93b9c77ef1a2d86cd91d321f612", "score": "0.37421575", "text": "func (m *OnlineMeeting) SetAllowTeamworkReactions(value *bool)() {\n m.allowTeamworkReactions = value\n}", "title": "" }, { "docid": "906cd949290d9d7b40123d2e2329ed24", "score": "0.37299484", "text": "func prepareSubmissionPost(assessmentpost string,user string,notanswered,correct,score,attempts int) SubmissionPost{\r\n\tvar submissionpost SubmissionPost\r\n\tanswered:=len(assessments)-notanswered\r\n\tsubmissionpost.Submittable=true\r\n\tsubmissionpost.Parent=assessmentpost//**\r\n\tsubmissionpost.Type=\"Assessment\"\r\n\tsubmissionpost.ResponseType=\"submission\"\r\n\tsubmissionpost.Author=user\r\n\tsubmissionpost.Assessment.Answered=answered\r\n\tsubmissionpost.Assessment.Correct=correct\r\n\tsubmissionpost.Assessment.Status=\"success\"\r\n\tsubmissionpost.Assessment.Timespent=30\r\n\tsubmissionpost.Assessment.Attempts=attempts+1\r\n\tsubmissionpost.Assessment.Score=score\r\n\tsubmissionpost.Task.Grade=score\r\n\tsubmissionpost.Task.Graded=true\r\n\tsubmissionpost.Stars=1\r\n\treturn submissionpost\r\n}", "title": "" }, { "docid": "6ca84455b8e5975c30e95ab421b72cb4", "score": "0.37253374", "text": "func (f branchFilter) allows(name string) bool {\n\tif len(f) == 0 {\n\t\treturn true\n\t}\n\t_, ok := f[name]\n\treturn ok\n}", "title": "" }, { "docid": "c146e33b7d7e3510efb145c16311c98c", "score": "0.3724311", "text": "func Ban(ctx Context) {\n\n\t// Fetch users from message content, returns list of members and the remaining string with the member removed\n\tmembers, reason := FetchMessageContentUsersString(ctx, strings.Join(ctx.Args, ctx.Command.ArgsDelim))\n\n\t// Returns if a user cannot be found in the message, deletes command message, then deletes delayed response\n\tif len(members) == 0 {\n\t\tmsg, err := ctx.Session.ChannelMessageSend(ctx.Channel.ID, \"❌ | I cannot find that user!\")\n\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\n\t\tDeleteMessageWithTime(ctx, ctx.Event.Message.ID, 0)\n\t\tDeleteMessageWithTime(ctx, msg.ID, 7500)\n\t\treturn\n\t}\n\n\t// Delete command message\n\tDeleteMessageWithTime(ctx, ctx.Event.Message.ID, 0)\n\n\t// If no reason is specified, set one for the database logger\n\tif len(reason) == 0 {\n\t\treason = \"N/A\"\n\t}\n\n\t// Fetch Guild information from redis database\n\tg, guildErr := UnpackGuildStruct(ctx.Guild.ID)\n\tif guildErr != nil {\n\t\tlog.Println(err)\n\t}\n\n\t// Bans all members found within the message, logs warning to redis database\n\tfor _, member := range members {\n\n\t\t// Prevent someone from banning the bot\n\t\tif member.ID == ctx.Session.State.User.ID {\n\t\t\tmsg, err := ctx.Session.ChannelMessageSend(ctx.Channel.ID, \"❌ | I will not ban myself!\")\n\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tDeleteMessageWithTime(ctx, msg.ID, 7500)\n\t\t\treturn\n\t\t}\n\n\t\t// Target username\n\t\ttarget := member.Username + \"#\" + member.Discriminator\n\n\t\t// Author username\n\t\tauthor := ctx.Event.Message.Author.Username + \"#\" + ctx.Event.Message.Author.Discriminator\n\n\t\t// Sends ban message to channel the command was instantiated in\n\t\tctx.Session.ChannelMessageSend(ctx.Channel.ID, fmt.Sprintf(\"`%s` has been banned by `%s`\", target, author))\n\n\t\t// Logs ban to redis database\n\t\tLogBan(ctx, member, reason)\n\n\t\t// Send logs to Guild Moderation Channel\n\t\tif guildErr != nil && g.ModerationLogsChannel != nil {\n\t\t\tctx.Session.ChannelMessageSendEmbed(g.ModerationLogsChannel.ID,\n\t\t\t\tNewEmbed().\n\t\t\t\t\tSetTitle(\"Member Banned\").\n\t\t\t\t\tSetColor(banColor).\n\t\t\t\t\tSetAuthor(fmt.Sprintf(\"%s#%s / %s\", member.Username, member.Discriminator, member.ID), member.AvatarURL(\"256\"), member.AvatarURL(\"2048\")).\n\t\t\t\t\tAddField(\"Author\", fmt.Sprintf(\"%s#%s / %s\", ctx.Event.Author.Username, ctx.Event.Author.Discriminator, ctx.Event.Author.ID)).\n\t\t\t\t\tAddField(\"Channel\", fmt.Sprintf(\"<#%s>\", ctx.Channel.ID)).\n\t\t\t\t\tAddField(\"Reason\", reason).\n\t\t\t\t\tSetTimestamp(time.Now().Format(time.RFC3339)).MessageEmbed)\n\t\t}\n\n\t\ttr := fmt.Sprintf(\"with reason `%s`\", reason)\n\t\tif reason == \"N/A\" {\n\t\t\ttr = \"without a reason\"\n\t\t}\n\n\t\t// Creates DM channel between bot and target\n\t\tchannel, err := ctx.Session.UserChannelCreate(member.ID)\n\n\t\t// Sends a DM to the user with the ban information if the user can accept DMs\n\t\tif err == nil {\n\t\t\tctx.Session.ChannelMessageSend(channel.ID, fmt.Sprintf(\"You have been banned by `%s` %s.\", author, tr))\n\t\t}\n\n\t\t// Bans the guild member with given reason, deletes 0 messages\n\t\terr = ctx.Session.GuildBanCreateWithReason(ctx.Guild.ID, member.ID, reason, 0)\n\n\t\tif err != nil {\n\t\t\tmsg, err := ctx.Session.ChannelMessageSend(ctx.Channel.ID, \"❌ | I cannot ban this user!\")\n\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tDeleteMessageWithTime(ctx, msg.ID, 7500)\n\t\t\tbreak\n\t\t}\n\t}\n}", "title": "" }, { "docid": "bf10f17cb277f10a3a647b495da2445b", "score": "0.37181777", "text": "func (_Ethdepositcontract *EthdepositcontractSession) BanNode(_node common.Address) (*types.Transaction, error) {\n\treturn _Ethdepositcontract.Contract.BanNode(&_Ethdepositcontract.TransactOpts, _node)\n}", "title": "" }, { "docid": "09dc4a5a101990307a8a3d0d7fae0231", "score": "0.37181497", "text": "func (tag *BidderMacro) MacroBlockedAdvertiser(key string) string {\n\treturn strings.Join(tag.Request.BAdv, comma)\n}", "title": "" }, { "docid": "78211e030ead900284f892d08324af2a", "score": "0.3717782", "text": "func (_options *CreateOfferingOptions) SetIBMPublishApproved(ibmPublishApproved bool) *CreateOfferingOptions {\n\t_options.IBMPublishApproved = core.BoolPtr(ibmPublishApproved)\n\treturn _options\n}", "title": "" }, { "docid": "4ec753c7052b9469c595352bf16ebdd0", "score": "0.3714348", "text": "func (_BalanceContract *BalanceContractTransactor) Approve(opts *bind.TransactOpts, delegate common.Address, numTokens *big.Int) (*types.Transaction, error) {\n\treturn _BalanceContract.contract.Transact(opts, \"approve\", delegate, numTokens)\n}", "title": "" }, { "docid": "e87dde8993f7e423b6f417d5897814ea", "score": "0.37022385", "text": "func (*ShowGrants) StatementTag() string { return \"SHOW GRANTS\" }", "title": "" }, { "docid": "8c877f5fc8bd5129415acef01641ce02", "score": "0.36919367", "text": "func (s *ModerationService) Unban(ctx context.Context, subreddit string, username string) (*Response, error) {\n\treturn s.deleteRelationship(ctx, subreddit, username, \"banned\")\n}", "title": "" }, { "docid": "34670a9538efcc34a77d7fe7fb9c0e0f", "score": "0.36912662", "text": "func (a *AllowanceRequestPost) WithPeriod(period types.BlockHeight) *AllowanceRequestPost {\n\ta.values.Set(\"period\", fmt.Sprint(period))\n\treturn a\n}", "title": "" }, { "docid": "1e52a1877e43e547c4604c1d17765dde", "score": "0.36899275", "text": "func (b *Builder) WithAllowLabels(l map[string][]string) error {\n\treturn b.internal.WithAllowLabels(l)\n}", "title": "" }, { "docid": "b2b23b39d0d31edf1f3bdcb45c11327f", "score": "0.36841357", "text": "func (config RestrictAllChatMembersConfig) method() string {\n\treturn \"set_group_whole_ban\"\n}", "title": "" }, { "docid": "56b54694715a365fbc7a49479e2eecd1", "score": "0.36793068", "text": "func handleBuilderPagePost(c *router.Context) error {\n\tif allow, err := auth.IsMember(c.Context, changeBuilderSettingsGroup); err != nil {\n\t\treturn err\n\t} else if !allow {\n\t\tlogging.Warningf(c.Context, \"%s cannot change builder settings\", auth.CurrentIdentity(c.Context))\n\t\thttp.Error(c.Writer, \"Access denied\", http.StatusForbidden)\n\t\treturn nil\n\t}\n\n\tid, err := parseBuilderIDFromRequest(&c.Params)\n\tif err != nil {\n\t\thttp.Error(c.Writer, err.Error(), http.StatusBadRequest)\n\t\treturn nil\n\t}\n\n\tbuilder := &storage.Builder{ID: id}\n\tswitch err := datastore.Get(c.Context, builder); {\n\tcase err == datastore.ErrNoSuchEntity:\n\t\thttp.NotFound(c.Writer, c.Request)\n\t\treturn nil\n\tcase err != nil:\n\t\treturn err\n\t}\n\n\tswitch c.Request.FormValue(\"action\") {\n\tcase \"update\":\n\t\treturn updateBuilder(c, builder)\n\tcase \"analyze\":\n\t\treturn analyzeBuilder(c, builder)\n\tdefault:\n\t\thttp.Error(c.Writer, \"invalid action\", http.StatusBadRequest)\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "24be9fe51acc55ab6174517407f6464e", "score": "0.36763424", "text": "func withBillingstatus(node *Billingstatus) billingstatusOption {\n\treturn func(m *BillingstatusMutation) {\n\t\tm.oldValue = func(context.Context) (*Billingstatus, error) {\n\t\t\treturn node, nil\n\t\t}\n\t\tm.id = &node.ID\n\t}\n}", "title": "" }, { "docid": "30ad95438b9199f2070248a4cfc68b62", "score": "0.36716917", "text": "func BannedEQ(v bool) predicate.User {\n\treturn predicate.User(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldBanned), v))\n\t})\n}", "title": "" }, { "docid": "5609b19552352e73b45bc7b3b584039c", "score": "0.3671333", "text": "func (s *ModerationService) Approve(ctx context.Context, id string) (*Response, error) {\n\tpath := \"api/approve\"\n\n\tform := url.Values{}\n\tform.Set(\"id\", id)\n\n\treq, err := s.client.NewRequestWithForm(http.MethodPost, path, form)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}", "title": "" }, { "docid": "91193ecdec96ea2356978e2a10f4427b", "score": "0.3670196", "text": "func (s *SubredditService) Approved(ctx context.Context, opts *ListSubredditOptions) (*Subreddits, *Response, error) {\n\treturn s.getSubreddits(ctx, \"subreddits/mine/contributor\", opts)\n}", "title": "" }, { "docid": "1cae4716aa2100cfeb215789436ecc3a", "score": "0.36700162", "text": "func (settings *Settings) IsUserBanned(id steamid.SteamId) bool {\n\tstmt := `SELECT banned FROM Users WHERE id=?`\n\tvar fakebool int\n\terr := settings.db.QueryRow(stmt, id).Scan(&fakebool)\n\tswitch {\n\tcase err == sql.ErrNoRows:\n\t\treturn false\n\tcase err != nil:\n\t\tlog.Fatal(err)\n\t}\n\treturn fakebool == 1\n}", "title": "" }, { "docid": "7b8be0609db1e9d5ca13fce0e10778f0", "score": "0.3664004", "text": "func (k Keeper) IsBanned(ctx sdk.Context, address sdk.AccAddress) bool {\n\tstore := prefix.NewStore(ctx.KVStore(k.storeKey), types.BanListPrefix)\n\n\treturn store.Has(address)\n}", "title": "" }, { "docid": "dd6ad7200c22c9181c6df10f805eede6", "score": "0.366357", "text": "func (_MyAdvancedToken *MyAdvancedTokenTransactor) Approve(opts *bind.TransactOpts, _spender common.Address, _value *big.Int) (*types.Transaction, error) {\n\treturn _MyAdvancedToken.contract.Transact(opts, \"approve\", _spender, _value)\n}", "title": "" }, { "docid": "0db43aa7e884f99c4c7c4ab098112b4b", "score": "0.36623222", "text": "func (_BalanceContract *BalanceContractTransactorSession) Approve(delegate common.Address, numTokens *big.Int) (*types.Transaction, error) {\n\treturn _BalanceContract.Contract.Approve(&_BalanceContract.TransactOpts, delegate, numTokens)\n}", "title": "" }, { "docid": "d3d2bb0a6c543cb9be4425dc65e3da9a", "score": "0.36547044", "text": "func (s *Scheduler) isEligible(block *Block) (eligible bool) {\n\treturn (block.IsScheduled() && !block.IsOrphaned()) || s.isBlockAcceptedFunc(block.ID())\n}", "title": "" }, { "docid": "4408d3447d5dedd31e56fe8a4d82752f", "score": "0.3654392", "text": "func allowUserTeamDisplay(c *gin.Context) bool {\n\t// TODO(tboerger): Add real implementation\n\treturn false\n}", "title": "" }, { "docid": "6106d49dfb23d555ab986f2f27097b53", "score": "0.36497873", "text": "func ForbidAccount(req *http.Request, r render.Render, d ForbidUserReq) {\n\tret_value := make(map[string]interface{})\n\n\t//model.InsertLogWithIP(common.ACTION_TYPE_LOG_CLOSE_CHAT, 0, common.GetDesc(common.ACTION_TYPE_LOG_CLOSE_CHAT), common.GetRemoteIp(req))\n\tret_value[\"ErrCode\"] = model.ForbidUserPower(d.Oid, d.Forbid, d.Forbidtime)\n\tr.JSON(http.StatusOK, ret_value)\n}", "title": "" }, { "docid": "6c2d4eb78536a3787bc7cbff8832d6ae", "score": "0.36450514", "text": "func (a App) ShowPost(res http.ResponseWriter, req *http.Request) {\n\n\ttmpl := template.Must(template.ParseFiles(\n\t\tprojectView(\"layout\"),\n\t\tprojectView(\"nav\"),\n\t\tprojectView(\"show_post\"),\n\t))\n\n\terr := tmpl.ExecuteTemplate(res, \"layout\", posts[1])\n\tif err != nil {\n\t\thttp.Error(res, err.Error(), http.StatusInternalServerError)\n\t}\n}", "title": "" }, { "docid": "8a63448333985a967750aa8cf1823ce9", "score": "0.36445743", "text": "func SettingsProtectedBranch(c *context.Context) {\n\truleName := c.FormString(\"rule_name\")\n\tvar rule *git_model.ProtectedBranch\n\tif ruleName != \"\" {\n\t\tvar err error\n\t\trule, err = git_model.GetProtectedBranchRuleByName(c, c.Repo.Repository.ID, ruleName)\n\t\tif err != nil {\n\t\t\tc.ServerError(\"GetProtectBranchOfRepoByName\", err)\n\t\t\treturn\n\t\t}\n\t}\n\n\tif rule == nil {\n\t\t// No options found, create defaults.\n\t\trule = &git_model.ProtectedBranch{}\n\t}\n\n\tc.Data[\"PageIsSettingsBranches\"] = true\n\tc.Data[\"Title\"] = c.Tr(\"repo.settings.protected_branch\") + \" - \" + rule.RuleName\n\n\tusers, err := access_model.GetRepoReaders(c.Repo.Repository)\n\tif err != nil {\n\t\tc.ServerError(\"Repo.Repository.GetReaders\", err)\n\t\treturn\n\t}\n\tc.Data[\"Users\"] = users\n\tc.Data[\"whitelist_users\"] = strings.Join(base.Int64sToStrings(rule.WhitelistUserIDs), \",\")\n\tc.Data[\"merge_whitelist_users\"] = strings.Join(base.Int64sToStrings(rule.MergeWhitelistUserIDs), \",\")\n\tc.Data[\"approvals_whitelist_users\"] = strings.Join(base.Int64sToStrings(rule.ApprovalsWhitelistUserIDs), \",\")\n\tc.Data[\"status_check_contexts\"] = strings.Join(rule.StatusCheckContexts, \"\\n\")\n\tcontexts, _ := git_model.FindRepoRecentCommitStatusContexts(c, c.Repo.Repository.ID, 7*24*time.Hour) // Find last week status check contexts\n\tc.Data[\"recent_status_checks\"] = contexts\n\n\tif c.Repo.Owner.IsOrganization() {\n\t\tteams, err := organization.OrgFromUser(c.Repo.Owner).TeamsWithAccessToRepo(c.Repo.Repository.ID, perm.AccessModeRead)\n\t\tif err != nil {\n\t\t\tc.ServerError(\"Repo.Owner.TeamsWithAccessToRepo\", err)\n\t\t\treturn\n\t\t}\n\t\tc.Data[\"Teams\"] = teams\n\t\tc.Data[\"whitelist_teams\"] = strings.Join(base.Int64sToStrings(rule.WhitelistTeamIDs), \",\")\n\t\tc.Data[\"merge_whitelist_teams\"] = strings.Join(base.Int64sToStrings(rule.MergeWhitelistTeamIDs), \",\")\n\t\tc.Data[\"approvals_whitelist_teams\"] = strings.Join(base.Int64sToStrings(rule.ApprovalsWhitelistTeamIDs), \",\")\n\t}\n\n\tc.Data[\"Rule\"] = rule\n\tc.HTML(http.StatusOK, tplProtectedBranch)\n}", "title": "" }, { "docid": "482c323637dfbfe979d9f22acbc0e844", "score": "0.36407304", "text": "func (d *Dao) DoAvBreach(c context.Context, mid int64, aid int64, ctype int, reason string) (err error) {\n\tparams := url.Values{}\n\tparams.Set(\"type\", strconv.Itoa(ctype))\n\tparams.Set(\"mid\", strconv.FormatInt(mid, 10))\n\tparams.Set(\"aids\", strconv.FormatInt(aid, 10))\n\tparams.Set(\"reason\", reason)\n\n\tvar res struct {\n\t\tCode int `json:\"code\"`\n\t\tMessage string `json:\"message\"`\n\t}\n\n\turl := d.breachURL\n\tif err = d.client.Post(c, url, \"\", params, &res); err != nil {\n\t\tlog.Error(\"d.client.Post url(%s) error(%v)\", url+\"?\"+params.Encode(), err)\n\t\treturn\n\t}\n\tif res.Code != 0 {\n\t\tlog.Error(\"DoAvBreach code != 0. res.Code(%d) | url(%s) error(%v)\", res.Code, url+\"?\"+params.Encode(), res.Message)\n\t\terr = fmt.Errorf(\"DoAvBreach error(%s)\", res.Message)\n\t}\n\treturn\n}", "title": "" }, { "docid": "08ede675da1899afeca5815f95d32c2b", "score": "0.3639525", "text": "func (_DSTokenContract *DSTokenContractTransactor) Approve(opts *bind.TransactOpts, guy common.Address, wad *big.Int) (*types.Transaction, error) {\n\treturn _DSTokenContract.contract.Transact(opts, \"approve\", guy, wad)\n}", "title": "" }, { "docid": "42be6c2cfa0d09fdd57a30b74472e13b", "score": "0.36259305", "text": "func (a *App) allowGroupMentions(c request.CTX, post *model.Post) bool {\n\tif license := a.Srv().License(); license == nil || (license.SkuShortName != model.LicenseShortSkuProfessional && license.SkuShortName != model.LicenseShortSkuEnterprise) {\n\t\treturn false\n\t}\n\n\tif !a.HasPermissionToChannel(c, post.UserId, post.ChannelId, model.PermissionUseGroupMentions) {\n\t\treturn false\n\t}\n\n\tif post.Type == model.PostTypeHeaderChange || post.Type == model.PostTypePurposeChange {\n\t\treturn false\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "0cbd6f7e0f45bf5c564621dfec7fb057", "score": "0.36242384", "text": "func (o *GetPrivateBuyParams) WithMaxShow(maxShow *float64) *GetPrivateBuyParams {\n\to.SetMaxShow(maxShow)\n\treturn o\n}", "title": "" }, { "docid": "77fb11e9c6bdd45a83fc2b8b13bf65f9", "score": "0.36201805", "text": "func (_BalanceContract *BalanceContractSession) Approve(delegate common.Address, numTokens *big.Int) (*types.Transaction, error) {\n\treturn _BalanceContract.Contract.Approve(&_BalanceContract.TransactOpts, delegate, numTokens)\n}", "title": "" }, { "docid": "63290ac7ddda1bc3de7a13a363fa114f", "score": "0.36145312", "text": "func BanUser(w http.ResponseWriter, r *http.Request) {\n\tparams := mux.Vars(r)\n\tuserID, err := strconv.Atoi(params[\"id\"])\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tsqlStatement := \"UPDATE users SET banned='t' WHERE user_id=$1\"\n\t_, err = db.DBconn.Exec(sqlStatement, userID)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tresMap := make(map[string]string)\n\tresMap[\"message\"] = \"Successfully banned\"\n\tres, err := json.Marshal(resMap)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tw.WriteHeader(http.StatusOK)\n\tw.Write(res)\n}", "title": "" }, { "docid": "f175e431a799f26c0acc9f3cf225be7e", "score": "0.36089334", "text": "func (uu *UserUpdate) AddUserApproved(r ...*Recommendations) *UserUpdate {\n\tids := make([]int, len(r))\n\tfor i := range r {\n\t\tids[i] = r[i].ID\n\t}\n\treturn uu.AddUserApprovedIDs(ids...)\n}", "title": "" }, { "docid": "07c0e52a739b05b9ce6f8fc3900d9db2", "score": "0.36067313", "text": "func (uuo *UserUpdateOne) AddUserApproved(r ...*Recommendations) *UserUpdateOne {\n\tids := make([]int, len(r))\n\tfor i := range r {\n\t\tids[i] = r[i].ID\n\t}\n\treturn uuo.AddUserApprovedIDs(ids...)\n}", "title": "" }, { "docid": "3234b6d8d923bb35c70f7f827bbe13d5", "score": "0.35973543", "text": "func NewPostTransactionFundingrequestsForbidden() *PostTransactionFundingrequestsForbidden {\n\treturn &PostTransactionFundingrequestsForbidden{}\n}", "title": "" }, { "docid": "2c474617e5c9e796b684259efb80483a", "score": "0.35953888", "text": "func (o *IpamVrfsListParams) WithTenantGroupn(tenantGroupn *string) *IpamVrfsListParams {\n\to.SetTenantGroupn(tenantGroupn)\n\treturn o\n}", "title": "" }, { "docid": "b177747478c64d0bf1e0098c89a7efdf", "score": "0.3594803", "text": "func SetCommentsViaCommentApproved(iCommentApproved string, comments *Comments) (int64, error) {\n\tcomments.CommentApproved = iCommentApproved\n\treturn Engine.Insert(comments)\n}", "title": "" }, { "docid": "727dc63dd5efebc2236243527bb17bad", "score": "0.35844925", "text": "func (_options *ReplaceOfferingOptions) SetIBMPublishApproved(ibmPublishApproved bool) *ReplaceOfferingOptions {\n\t_options.IBMPublishApproved = core.BoolPtr(ibmPublishApproved)\n\treturn _options\n}", "title": "" }, { "docid": "93778e951288e724e05e1a971ad1ec47", "score": "0.35817012", "text": "func (client *Client) CreatePickUpWaybillPreQueryWithChan(request *CreatePickUpWaybillPreQueryRequest) (<-chan *CreatePickUpWaybillPreQueryResponse, <-chan error) {\n\tresponseChan := make(chan *CreatePickUpWaybillPreQueryResponse, 1)\n\terrChan := make(chan error, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tdefer close(responseChan)\n\t\tdefer close(errChan)\n\t\tresponse, err := client.CreatePickUpWaybillPreQuery(request)\n\t\tif err != nil {\n\t\t\terrChan <- err\n\t\t} else {\n\t\t\tresponseChan <- response\n\t\t}\n\t})\n\tif err != nil {\n\t\terrChan <- err\n\t\tclose(responseChan)\n\t\tclose(errChan)\n\t}\n\treturn responseChan, errChan\n}", "title": "" }, { "docid": "9ab9b01fc6d16eaa19c9dd46ef15d486", "score": "0.3574943", "text": "func (doPage Page) SetAdBlockingEnabled(enabled bool) (err error) {\n\tb := page.SetAdBlockingEnabled(enabled)\n\treturn b.Do(doPage.ctxWithExecutor)\n}", "title": "" } ]
08180c1a8c2202b6f905573b4a70d1dc
Counters returns from Stp_Rstp_InterfacePath the path struct for its child "counters".
[ { "docid": "328d72b4a40445d641d473ce0c7358bb", "score": "0.7676748", "text": "func (n *Stp_Rstp_InterfacePath) Counters() *Stp_Rstp_Interface_CountersPath {\n\treturn &Stp_Rstp_Interface_CountersPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" } ]
[ { "docid": "56ef1cddb88d86c0b3b3e6c730166a3a", "score": "0.78691375", "text": "func (n *NetworkInstance_Mpls_SignalingProtocols_RsvpTe_InterfacePath) Counters() *NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Interface_CountersPath {\n\treturn &NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Interface_CountersPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "98690a184a6d1a98693ad4fa75cd2759", "score": "0.7829416", "text": "func (n *NetworkInstance_Mpls_SignalingProtocols_Ldp_InterfaceAttributes_InterfacePath) Counters() *NetworkInstance_Mpls_SignalingProtocols_Ldp_InterfaceAttributes_Interface_CountersPath {\n\treturn &NetworkInstance_Mpls_SignalingProtocols_Ldp_InterfaceAttributes_Interface_CountersPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "beb16a5a2d47d220ace9bc2902fa87f2", "score": "0.77051413", "text": "func (n *Interface_SubinterfacePath) Counters() *Interface_Subinterface_CountersPath {\n\treturn &Interface_Subinterface_CountersPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "74d88c5c4dc88fa8648eccd645eecf5b", "score": "0.7517807", "text": "func (n *Interface_Subinterface_Ipv4Path) Counters() *Interface_Subinterface_Ipv4_CountersPath {\n\treturn &Interface_Subinterface_Ipv4_CountersPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "0d90aec41abd573220d414ca55c007a9", "score": "0.74615794", "text": "func (n *NetworkInstance_Protocol_Pim_InterfacePath) Counters() *NetworkInstance_Protocol_Pim_Interface_CountersPath {\n\treturn &NetworkInstance_Protocol_Pim_Interface_CountersPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "8375a13a0130ebff62db0213e86ca6b5", "score": "0.74603623", "text": "func (n *Stp_Mstp_MstInstance_InterfacePath) Counters() *Stp_Mstp_MstInstance_Interface_CountersPath {\n\treturn &Stp_Mstp_MstInstance_Interface_CountersPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "28ba4afe72607b5dc5fa8ef9c8b074b9", "score": "0.74479616", "text": "func (n *Stp_Vlan_InterfacePath) Counters() *Stp_Vlan_Interface_CountersPath {\n\treturn &Stp_Vlan_Interface_CountersPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "c89fefd7317c9837891e88210cc3c5ab", "score": "0.7407266", "text": "func (n *Lldp_InterfacePath) Counters() *Lldp_Interface_CountersPath {\n\treturn &Lldp_Interface_CountersPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "25fde1f4b5d25dc77a692ac2786a18b4", "score": "0.7351561", "text": "func (n *Interface_RoutedVlan_Ipv4Path) Counters() *Interface_RoutedVlan_Ipv4_CountersPath {\n\treturn &Interface_RoutedVlan_Ipv4_CountersPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "b47d0a7b728b047c333d522ad66aab01", "score": "0.73466283", "text": "func (n *InterfacePath) Counters() *Interface_CountersPath {\n\treturn &Interface_CountersPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "95d272989c7f939c916a9d0d2e4709e9", "score": "0.73366886", "text": "func (n *NetworkInstance_Protocol_Igmp_InterfacePath) Counters() *NetworkInstance_Protocol_Igmp_Interface_CountersPath {\n\treturn &NetworkInstance_Protocol_Igmp_Interface_CountersPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "25ef27b172ffd455de371fe102bc6920", "score": "0.7335635", "text": "func (n *Interface_Subinterface_Ipv6Path) Counters() *Interface_Subinterface_Ipv6_CountersPath {\n\treturn &Interface_Subinterface_Ipv6_CountersPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "49be9ed177d99ea16448ff1408bf2cfe", "score": "0.73239535", "text": "func (n *Interface_SubinterfacePathAny) Counters() *Interface_Subinterface_CountersPathAny {\n\treturn &Interface_Subinterface_CountersPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "12296951c2874d91746a504bc19d738a", "score": "0.7293291", "text": "func (n *Interface_RoutedVlan_Ipv6Path) Counters() *Interface_RoutedVlan_Ipv6_CountersPath {\n\treturn &Interface_RoutedVlan_Ipv6_CountersPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "562b766cdcd511028ece3f5f577f23ac", "score": "0.7276759", "text": "func (n *RelayAgent_Dhcpv6_InterfacePath) Counters() *RelayAgent_Dhcpv6_Interface_CountersPath {\n\treturn &RelayAgent_Dhcpv6_Interface_CountersPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "c26e38acd90f00b9950f979db39d27f1", "score": "0.7267263", "text": "func (n *NetworkInstance_Protocol_Isis_Interface_LevelPath) PacketCounters() *NetworkInstance_Protocol_Isis_Interface_Level_PacketCountersPath {\n\treturn &NetworkInstance_Protocol_Isis_Interface_Level_PacketCountersPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"packet-counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "b2f147a52011bfab8cfd5661039538dc", "score": "0.72279006", "text": "func (n *RelayAgent_Dhcp_InterfacePath) Counters() *RelayAgent_Dhcp_Interface_CountersPath {\n\treturn &RelayAgent_Dhcp_Interface_CountersPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "880a480b751bd7b85ec3986b667e2dda", "score": "0.72082746", "text": "func (n *NetworkInstance_Mpls_SignalingProtocols_RsvpTe_InterfacePathAny) Counters() *NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Interface_CountersPathAny {\n\treturn &NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Interface_CountersPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "2365279ee2ad179527e8f9713e147fdf", "score": "0.7157312", "text": "func (n *Stp_Rstp_InterfacePathAny) Counters() *Stp_Rstp_Interface_CountersPathAny {\n\treturn &Stp_Rstp_Interface_CountersPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "87365fbc99dd9f05632e8612a57aebc1", "score": "0.71370465", "text": "func (n *NetworkInstance_Mpls_SignalingProtocols_Ldp_InterfaceAttributes_InterfacePathAny) Counters() *NetworkInstance_Mpls_SignalingProtocols_Ldp_InterfaceAttributes_Interface_CountersPathAny {\n\treturn &NetworkInstance_Mpls_SignalingProtocols_Ldp_InterfaceAttributes_Interface_CountersPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "cfe30b88f1016f47cba3b683415c8fdf", "score": "0.7123627", "text": "func (n *Interface_Subinterface_Ipv4PathAny) Counters() *Interface_Subinterface_Ipv4_CountersPathAny {\n\treturn &Interface_Subinterface_Ipv4_CountersPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "5aa1e4af4508a29e07bba17796974b9b", "score": "0.7116402", "text": "func (n *Lacp_Interface_MemberPath) Counters() *Lacp_Interface_Member_CountersPath {\n\treturn &Lacp_Interface_Member_CountersPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "f2feeb79930c6549017aba419f640deb", "score": "0.711537", "text": "func (n *NetworkInstance_Mpls_Lsps_ConstrainedPath_TunnelPath) Counters() *NetworkInstance_Mpls_Lsps_ConstrainedPath_Tunnel_CountersPath {\n\treturn &NetworkInstance_Mpls_Lsps_ConstrainedPath_Tunnel_CountersPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "8ed7032142bb1ad583f20b20a5de83a3", "score": "0.7086221", "text": "func (n *Interface_EthernetPath) Counters() *Interface_Ethernet_CountersPath {\n\treturn &Interface_Ethernet_CountersPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "f779946f003c95121079f5583c456b5b", "score": "0.7077636", "text": "func (n *TerminalDevice_Channel_Ethernet_LldpPath) Counters() *TerminalDevice_Channel_Ethernet_Lldp_CountersPath {\n\treturn &TerminalDevice_Channel_Ethernet_Lldp_CountersPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "6d8bee9131d5d13c68bf2ecd6b32a482", "score": "0.70110595", "text": "func (n *NetworkInstance_Protocol_Pim_InterfacePathAny) Counters() *NetworkInstance_Protocol_Pim_Interface_CountersPathAny {\n\treturn &NetworkInstance_Protocol_Pim_Interface_CountersPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "dd7f46372cd16d9351c87d7455bcf415", "score": "0.7007048", "text": "func (n *Stp_Mstp_MstInstance_InterfacePathAny) Counters() *Stp_Mstp_MstInstance_Interface_CountersPathAny {\n\treturn &Stp_Mstp_MstInstance_Interface_CountersPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "172a3d90b6eb200a8d0bc615dbf41c11", "score": "0.69723743", "text": "func (n *Stp_Vlan_InterfacePathAny) Counters() *Stp_Vlan_Interface_CountersPathAny {\n\treturn &Stp_Vlan_Interface_CountersPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "a5b9ac57fa82c74c58e2726d45f7abbf", "score": "0.69719416", "text": "func (n *InterfacePathAny) Counters() *Interface_CountersPathAny {\n\treturn &Interface_CountersPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "63bf0fbebb9d3c8d230ac9a4d207f27b", "score": "0.6964234", "text": "func (n *Lldp_InterfacePathAny) Counters() *Lldp_Interface_CountersPathAny {\n\treturn &Lldp_Interface_CountersPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "94de9b5adae09a012c56149b5b398c93", "score": "0.6962223", "text": "func (n *Interface_Subinterface_Ipv6PathAny) Counters() *Interface_Subinterface_Ipv6_CountersPathAny {\n\treturn &Interface_Subinterface_Ipv6_CountersPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "95f897433a9495cf01c9253c41a2f6ea", "score": "0.6934064", "text": "func (n *System_Aaa_ServerGroup_Server_RadiusPath) Counters() *System_Aaa_ServerGroup_Server_Radius_CountersPath {\n\treturn &System_Aaa_ServerGroup_Server_Radius_CountersPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "2e082c68f15b58c9ed5b79f763453c56", "score": "0.69112927", "text": "func (n *NetworkInstance_Protocol_Pim_GlobalPath) Counters() *NetworkInstance_Protocol_Pim_Global_CountersPath {\n\treturn &NetworkInstance_Protocol_Pim_Global_CountersPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "9f2625436330174fb0d809d8b02a6e0e", "score": "0.69058", "text": "func (n *NetworkInstance_SegmentRouting_TePolicyPath) Counters() *NetworkInstance_SegmentRouting_TePolicy_CountersPath {\n\treturn &NetworkInstance_SegmentRouting_TePolicy_CountersPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "ef546b9c98e59d176eb56a9f196abb2e", "score": "0.6894088", "text": "func (n *NetworkInstance_Mpls_SignalingProtocols_RsvpTe_GlobalPath) Counters() *NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Global_CountersPath {\n\treturn &NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Global_CountersPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "026ca099fd4999e14ccd6175ce660019", "score": "0.6889069", "text": "func (n *Interface_RoutedVlan_Ipv4PathAny) Counters() *Interface_RoutedVlan_Ipv4_CountersPathAny {\n\treturn &Interface_RoutedVlan_Ipv4_CountersPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "90615363baa3882217132e8003533123", "score": "0.68801224", "text": "func (n *NetworkInstance_SegmentRouting_TePolicy_CandidatePath_SegmentList_NextHopPath) Counters() *NetworkInstance_SegmentRouting_TePolicy_CandidatePath_SegmentList_NextHop_CountersPath {\n\treturn &NetworkInstance_SegmentRouting_TePolicy_CandidatePath_SegmentList_NextHop_CountersPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "d12d2a6de0e8a39ec29e72306d78bdee", "score": "0.6874769", "text": "func (n *RelayAgent_Dhcpv6_InterfacePathAny) Counters() *RelayAgent_Dhcpv6_Interface_CountersPathAny {\n\treturn &RelayAgent_Dhcpv6_Interface_CountersPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "3513dd095007b40f9a969654bf30907c", "score": "0.68625915", "text": "func (n *NetworkInstance_Protocol_Igmp_InterfacePathAny) Counters() *NetworkInstance_Protocol_Igmp_Interface_CountersPathAny {\n\treturn &NetworkInstance_Protocol_Igmp_Interface_CountersPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "ec00a990bb4723cc0b65bcd3ab50513c", "score": "0.6854171", "text": "func (n *NetworkInstance_SegmentRouting_TePolicy_CandidatePath_SegmentListPath) Counters() *NetworkInstance_SegmentRouting_TePolicy_CandidatePath_SegmentList_CountersPath {\n\treturn &NetworkInstance_SegmentRouting_TePolicy_CandidatePath_SegmentList_CountersPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "a23fbff75ffe570cc05cd64e6b412265", "score": "0.6846407", "text": "func (n *RelayAgent_Dhcp_InterfacePathAny) Counters() *RelayAgent_Dhcp_Interface_CountersPathAny {\n\treturn &RelayAgent_Dhcp_Interface_CountersPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "202991a66d06976eea12d0db566f6284", "score": "0.6817546", "text": "func (n *Interface_RoutedVlan_Ipv6PathAny) Counters() *Interface_RoutedVlan_Ipv6_CountersPathAny {\n\treturn &Interface_RoutedVlan_Ipv6_CountersPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "fc43f410ef693c4f0bff4e1ae4d50ebe", "score": "0.67868775", "text": "func (n *LldpPath) Counters() *Lldp_CountersPath {\n\treturn &Lldp_CountersPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "9d6d56bd28db8c065709da3cb9433f36", "score": "0.6744071", "text": "func (n *NetworkInstance_Mpls_Lsps_ConstrainedPath_TunnelPathAny) Counters() *NetworkInstance_Mpls_Lsps_ConstrainedPath_Tunnel_CountersPathAny {\n\treturn &NetworkInstance_Mpls_Lsps_ConstrainedPath_Tunnel_CountersPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "0d519b24d37020800803fccc6eddae86", "score": "0.67216355", "text": "func (n *TerminalDevice_Channel_Ethernet_LldpPathAny) Counters() *TerminalDevice_Channel_Ethernet_Lldp_CountersPathAny {\n\treturn &TerminalDevice_Channel_Ethernet_Lldp_CountersPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "b2a96043dcff0400450457d01421aa73", "score": "0.67183286", "text": "func (n *Lacp_Interface_MemberPathAny) Counters() *Lacp_Interface_Member_CountersPathAny {\n\treturn &Lacp_Interface_Member_CountersPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "6ce7d610ac7f17f2e6d07d880a3e16a9", "score": "0.6717101", "text": "func (n *NetworkInstance_Protocol_Isis_Interface_LevelPathAny) PacketCounters() *NetworkInstance_Protocol_Isis_Interface_Level_PacketCountersPathAny {\n\treturn &NetworkInstance_Protocol_Isis_Interface_Level_PacketCountersPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"packet-counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "099acb4ac1342eb67497f9a341fe7f9e", "score": "0.6695139", "text": "func (n *Interface_EthernetPathAny) Counters() *Interface_Ethernet_CountersPathAny {\n\treturn &Interface_Ethernet_CountersPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "0c4fc1c253697cc607d090383ae47044", "score": "0.6563366", "text": "func (s *Mpls_Lsps_ConstrainedPath_Tunnel) GetCounters() *Mpls_Lsps_ConstrainedPath_Tunnel_Counters {\n\tif s != nil && s.Counters != nil {\n\t\treturn s.Counters\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0e95ba584d0b29edd40b448a9b3d1c8a", "score": "0.654734", "text": "func (n *System_Aaa_ServerGroup_Server_RadiusPathAny) Counters() *System_Aaa_ServerGroup_Server_Radius_CountersPathAny {\n\treturn &System_Aaa_ServerGroup_Server_Radius_CountersPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "0c7027178fd947de6d3f76d682458d82", "score": "0.65354395", "text": "func (n *NetworkInstance_Protocol_Pim_GlobalPathAny) Counters() *NetworkInstance_Protocol_Pim_Global_CountersPathAny {\n\treturn &NetworkInstance_Protocol_Pim_Global_CountersPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "57bed64ffd289a622a9fbfb7fd8feec7", "score": "0.6531154", "text": "func (s *NetworkInstance_Mpls_Lsps_ConstrainedPath_Tunnel) GetCounters() *NetworkInstance_Mpls_Lsps_ConstrainedPath_Tunnel_Counters {\n\tif s != nil && s.Counters != nil {\n\t\treturn s.Counters\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0f9a21bc93acf0c849ceab5228525505", "score": "0.6497178", "text": "func (n *NetworkInstance_SegmentRouting_TePolicy_CandidatePath_SegmentListPathAny) Counters() *NetworkInstance_SegmentRouting_TePolicy_CandidatePath_SegmentList_CountersPathAny {\n\treturn &NetworkInstance_SegmentRouting_TePolicy_CandidatePath_SegmentList_CountersPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "eeb0bb792bbf8c80da971802654fba59", "score": "0.6491059", "text": "func (n *LldpPathAny) Counters() *Lldp_CountersPathAny {\n\treturn &Lldp_CountersPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "03ce81aa60c2d322339e2e18adc3c27c", "score": "0.6472828", "text": "func (n *NetworkInstance_SegmentRouting_TePolicyPathAny) Counters() *NetworkInstance_SegmentRouting_TePolicy_CountersPathAny {\n\treturn &NetworkInstance_SegmentRouting_TePolicy_CountersPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "c3f819f0c75cc4508db3c9befd1dcc12", "score": "0.63797003", "text": "func (s *Stp_Rstp_Interface) GetCounters() *Stp_Rstp_Interface_Counters {\n\tif s != nil && s.Counters != nil {\n\t\treturn s.Counters\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4c6d2a44cd4bde4010086580a01cac05", "score": "0.63741255", "text": "func (n *NetworkInstance_Mpls_SignalingProtocols_RsvpTe_GlobalPathAny) Counters() *NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Global_CountersPathAny {\n\treturn &NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Global_CountersPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "1579e9fc5e0d660e5c22ae5306fcc423", "score": "0.629441", "text": "func (s *Interface_Subinterface) GetCounters() *Interface_Subinterface_Counters {\n\tif s != nil && s.Counters != nil {\n\t\treturn s.Counters\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5014f41938c89785c0c7b8fe4797c478", "score": "0.62869346", "text": "func (n *NetworkInstance_Protocol_Isis_InterfacePath) CircuitCounters() *NetworkInstance_Protocol_Isis_Interface_CircuitCountersPath {\n\treturn &NetworkInstance_Protocol_Isis_Interface_CircuitCountersPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"circuit-counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "90c569ff61be1959f56f606c218c14b2", "score": "0.6277577", "text": "func (n *NetworkInstance_SegmentRouting_TePolicy_CandidatePath_SegmentList_NextHopPathAny) Counters() *NetworkInstance_SegmentRouting_TePolicy_CandidatePath_SegmentList_NextHop_CountersPathAny {\n\treturn &NetworkInstance_SegmentRouting_TePolicy_CandidatePath_SegmentList_NextHop_CountersPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "0688e6c3809495f3229f6f67f9f4875d", "score": "0.6215908", "text": "func (s *Lldp_Interface) GetCounters() *Lldp_Interface_Counters {\n\tif s != nil && s.Counters != nil {\n\t\treturn s.Counters\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d145e371ad491d7883d51550fa0a9947", "score": "0.61518806", "text": "func (n *NetworkInstance_Protocol_Isis_LevelPath) SystemLevelCounters() *NetworkInstance_Protocol_Isis_Level_SystemLevelCountersPath {\n\treturn &NetworkInstance_Protocol_Isis_Level_SystemLevelCountersPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"system-level-counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "29760d322b749131f5ff65faaa656ef6", "score": "0.6143627", "text": "func (s *Mpls_SignalingProtocols_RsvpTe_Interface) GetCounters() *Mpls_SignalingProtocols_RsvpTe_Interface_Counters {\n\tif s != nil && s.Counters != nil {\n\t\treturn s.Counters\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fdcabd4161a160d8b9960709496c44e3", "score": "0.60998434", "text": "func (s *NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Interface) GetCounters() *NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Interface_Counters {\n\tif s != nil && s.Counters != nil {\n\t\treturn s.Counters\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2cc015bb985db4767faf8d6b25aaf9e8", "score": "0.6038441", "text": "func (s *Interface_RoutedVlan_Ipv4) GetCounters() *Interface_RoutedVlan_Ipv4_Counters {\n\tif s != nil && s.Counters != nil {\n\t\treturn s.Counters\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c4c0f1f8bef82461c46bc7160bc86944", "score": "0.60132396", "text": "func (c *Client) getCounters(op, path, file, fnName string) (metrics2.Counter, metrics2.Counter) {\n\tpath = strings.TrimPrefix(path, c.ParentDoc.Path)\n\tpath = strings.TrimPrefix(path, \"/\")\n\tpath = strings.Split(path, \"/\")[0]\n\tc.countersMtx.Lock()\n\tdefer c.countersMtx.Unlock()\n\treturn c.getCounterHelper(op, opCountQueries, path, file, fnName), c.getCounterHelper(op, opCountRows, path, file, fnName)\n}", "title": "" }, { "docid": "880a6ce71b4295fe0c171e728c0a491c", "score": "0.6009343", "text": "func (s *Interface_Subinterface_Ipv4) GetCounters() *Interface_Subinterface_Ipv4_Counters {\n\tif s != nil && s.Counters != nil {\n\t\treturn s.Counters\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "bc79468bad0f1c531002681458cb7da6", "score": "0.5990172", "text": "func (s *Interface) GetCounters() *Interface_Counters {\n\tif s != nil && s.Counters != nil {\n\t\treturn s.Counters\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5d5f74c7ed579055d3536ea4a086be90", "score": "0.5981776", "text": "func (n *NetworkInstance_Protocol_Isis_LevelPathAny) SystemLevelCounters() *NetworkInstance_Protocol_Isis_Level_SystemLevelCountersPathAny {\n\treturn &NetworkInstance_Protocol_Isis_Level_SystemLevelCountersPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"system-level-counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "b07bb66d1fb6307cc552bebafe4f7b7b", "score": "0.59153646", "text": "func (n *NetworkInstance_Protocol_Isis_InterfacePathAny) CircuitCounters() *NetworkInstance_Protocol_Isis_Interface_CircuitCountersPathAny {\n\treturn &NetworkInstance_Protocol_Isis_Interface_CircuitCountersPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"circuit-counters\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "f753d29227e15a9791cdaff6a72d60d1", "score": "0.5894312", "text": "func (s *Interface_RoutedVlan_Ipv6) GetCounters() *Interface_RoutedVlan_Ipv6_Counters {\n\tif s != nil && s.Counters != nil {\n\t\treturn s.Counters\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "de748715255712c3e9f088f3661552b6", "score": "0.58934677", "text": "func (s *Lldp) GetCounters() *Lldp_Counters {\n\tif s != nil && s.Counters != nil {\n\t\treturn s.Counters\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "157f148a3d30bf59b697841617f9e34b", "score": "0.5865749", "text": "func (s *Stp_Vlan_Interface) GetCounters() *Stp_Vlan_Interface_Counters {\n\tif s != nil && s.Counters != nil {\n\t\treturn s.Counters\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4683b63c6e0f3a8eea62162afe55d8f1", "score": "0.5861883", "text": "func (s *NetworkInstance_Protocol_Pim_Interface) GetCounters() *NetworkInstance_Protocol_Pim_Interface_Counters {\n\tif s != nil && s.Counters != nil {\n\t\treturn s.Counters\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e0603441ea1488ae814d2ed2eafa32f3", "score": "0.5787715", "text": "func (s *RelayAgent_Dhcpv6_Interface) GetCounters() *RelayAgent_Dhcpv6_Interface_Counters {\n\tif s != nil && s.Counters != nil {\n\t\treturn s.Counters\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "16cbb2ddebd33df36582c1d6e0f087d2", "score": "0.57649344", "text": "func (s *RelayAgent_Dhcp_Interface) GetCounters() *RelayAgent_Dhcp_Interface_Counters {\n\tif s != nil && s.Counters != nil {\n\t\treturn s.Counters\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1289a6a0a31573727e82d0396a1c5328", "score": "0.5753814", "text": "func (s *Stp_Mstp_MstInstance_Interface) GetCounters() *Stp_Mstp_MstInstance_Interface_Counters {\n\tif s != nil && s.Counters != nil {\n\t\treturn s.Counters\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "34dc36ff27a7d61c9fb8c5db15dd4d5a", "score": "0.574955", "text": "func (s *System_Aaa_ServerGroup_Server_Radius) GetCounters() *System_Aaa_ServerGroup_Server_Radius_Counters {\n\tif s != nil && s.Counters != nil {\n\t\treturn s.Counters\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4dd04166df89fdf7c9ac480f44797b1d", "score": "0.5702348", "text": "func (s *NetworkInstance_Protocol_Igmp_Interface) GetCounters() *NetworkInstance_Protocol_Igmp_Interface_Counters {\n\tif s != nil && s.Counters != nil {\n\t\treturn s.Counters\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8a4717de276f549b2b082c736a29de32", "score": "0.570031", "text": "func (fh *FibHandler) GetCounters() (r map[string]int64, err error) {\n\tfmt.Printf(\"GetCounters was called\\n\")\n\n\tvar counters = make(map[string]int64)\n\tcounters[\"BGP\"] = 10\n\treturn counters, nil\n}", "title": "" }, { "docid": "a3f5146af12baaae3db768b7e162b71f", "score": "0.5697943", "text": "func (n *AclPath) CounterCapability() *Acl_CounterCapabilityPath {\n\treturn &Acl_CounterCapabilityPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counter-capability\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "52b3db1f0bc0c204e168fd2a00e0ab15", "score": "0.56745696", "text": "func (s *Interface_Subinterface_Ipv6) GetCounters() *Interface_Subinterface_Ipv6_Counters {\n\tif s != nil && s.Counters != nil {\n\t\treturn s.Counters\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "833043c5eaf51c923f8f2c32ad1a3c5e", "score": "0.567258", "text": "func (c *CloudWatch) GetCounter(path string) StatCounter {\n\tname, labels, values := c.toCMName(path)\n\tif name == \"\" {\n\t\treturn DudStat{}\n\t}\n\tif len(labels) == 0 {\n\t\treturn &cloudWatchStat{\n\t\t\troot: c,\n\t\t\tid: name,\n\t\t\tname: name,\n\t\t\tunit: cloudwatch.StandardUnitCount,\n\t\t}\n\t}\n\treturn (&cloudWatchCounterVec{\n\t\tcloudWatchStatVec: cloudWatchStatVec{\n\t\t\troot: c,\n\t\t\tname: name,\n\t\t\tunit: cloudwatch.StandardUnitCount,\n\t\t\tlabelNames: labels,\n\t\t},\n\t}).With(values...)\n}", "title": "" }, { "docid": "de53580165be964e97da60f476976529", "score": "0.5632416", "text": "func (n *NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Interface_CountersPath) OutPathMessages() *NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Interface_Counters_OutPathMessagesPath {\n\treturn &NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Interface_Counters_OutPathMessagesPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"out-path-messages\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "07a00f70d3b201a4225c22f8ebc7c53c", "score": "0.5571797", "text": "func (n *NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Global_CountersPath) PathTimeouts() *NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Global_Counters_PathTimeoutsPath {\n\treturn &NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Global_Counters_PathTimeoutsPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"path-timeouts\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "60c237d5b5e3d2a8594edfacb5a7ff20", "score": "0.55713725", "text": "func (s *Mpls_SignalingProtocols_RsvpTe_Global) GetCounters() *Mpls_SignalingProtocols_RsvpTe_Global_Counters {\n\tif s != nil && s.Counters != nil {\n\t\treturn s.Counters\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "230bc29fd66425ab4ac485d2b120b94c", "score": "0.5524981", "text": "func (s *NetworkInstance_Protocol_Pim_Global) GetCounters() *NetworkInstance_Protocol_Pim_Global_Counters {\n\tif s != nil && s.Counters != nil {\n\t\treturn s.Counters\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "512fa1756fe5d89bd5b2249a2efca1e3", "score": "0.55210257", "text": "func (n *NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Interface_CountersPath) InPathMessages() *NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Interface_Counters_InPathMessagesPath {\n\treturn &NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Interface_Counters_InPathMessagesPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"in-path-messages\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "f160f9a3eb4daff950085709bfa439b1", "score": "0.5493209", "text": "func (s *Interface_Ethernet) GetCounters() *Interface_Ethernet_Counters {\n\tif s != nil && s.Counters != nil {\n\t\treturn s.Counters\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "abc29a50eb99b42c23b9fae30b59568b", "score": "0.54129547", "text": "func (n *NetworkInstance_Mpls_Lsps_ConstrainedPath_Tunnel_CountersPath) Bytes() *NetworkInstance_Mpls_Lsps_ConstrainedPath_Tunnel_Counters_BytesPath {\n\treturn &NetworkInstance_Mpls_Lsps_ConstrainedPath_Tunnel_Counters_BytesPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"bytes\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "b6c3a76b4aae1f8a6e00d4d8730bc927", "score": "0.53959066", "text": "func (n *NetworkInstance_Protocol_Igmp_Interface_CountersPath) Reports() *NetworkInstance_Protocol_Igmp_Interface_Counters_ReportsPath {\n\treturn &NetworkInstance_Protocol_Igmp_Interface_Counters_ReportsPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"reports\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "72ea6b63ff02fa305044cc50cf4f3d53", "score": "0.5387677", "text": "func (me *ZapiPerf) getParentOpsCounters(data *matrix.Matrix, KeyAttr string) (time.Duration, time.Duration, error) {\n\n\tvar (\n\t\tops matrix.Metric\n\t\tobject string\n\t\tinstanceKeys []string\n\t\tapiT, parseT time.Duration\n\t\terr error\n\t)\n\n\tif me.Query == objWorkloadDetail {\n\t\tobject = objWorkload\n\t} else {\n\t\tobject = objWorkloadVolume\n\t}\n\n\tme.Logger.Debug().Msgf(\"(%s) starting redundancy poll for ops from parent object (%s)\", me.Query, object)\n\n\tapiT = 0 * time.Second\n\tparseT = 0 * time.Second\n\n\tif ops = data.GetMetric(\"ops\"); ops == nil {\n\t\tme.Logger.Error().Stack().Err(nil).Msgf(\"ops counter not found in cache\")\n\t\treturn apiT, parseT, errors.New(errors.MISSING_PARAM, \"counter ops\")\n\t}\n\n\tinstanceKeys = data.GetInstanceKeys()\n\n\t// build ZAPI request\n\trequest := node.NewXmlS(\"perf-object-get-instances\")\n\trequest.NewChildS(\"objectname\", object)\n\n\trequestCounters := request.NewChildS(\"counters\", \"\")\n\trequestCounters.NewChildS(\"counter\", \"ops\")\n\n\t// batch indices\n\tstartIndex := 0\n\tendIndex := 0\n\n\tcount := 0\n\n\tfor endIndex < len(instanceKeys) {\n\n\t\t// update batch indices\n\t\tendIndex += me.batchSize\n\t\tif endIndex > len(instanceKeys) {\n\t\t\tendIndex = len(instanceKeys)\n\t\t}\n\n\t\tme.Logger.Debug().Msgf(\"starting batch poll for instances [%d:%d]\", startIndex, endIndex)\n\n\t\trequest.PopChildS(KeyAttr + \"s\")\n\t\trequestInstances := request.NewChildS(KeyAttr+\"s\", \"\")\n\t\tfor _, key := range instanceKeys[startIndex:endIndex] {\n\t\t\trequestInstances.NewChildS(KeyAttr, key)\n\t\t}\n\n\t\tstartIndex = endIndex\n\n\t\tif err = me.Client.BuildRequest(request); err != nil {\n\t\t\treturn apiT, parseT, err\n\t\t}\n\n\t\tresponse, rt, pt, err := me.Client.InvokeWithTimers()\n\t\tif err != nil {\n\t\t\treturn apiT, parseT, err\n\t\t}\n\n\t\tapiT += rt\n\t\tparseT += pt\n\n\t\t// fetch instances\n\t\tinstances := response.GetChildS(\"instances\")\n\t\tif instances == nil || len(instances.GetChildren()) == 0 {\n\t\t\treturn apiT, parseT, err\n\t\t}\n\n\t\tfor _, i := range instances.GetChildren() {\n\n\t\t\tkey := i.GetChildContentS(me.instanceKey)\n\n\t\t\tif key == \"\" {\n\t\t\t\tme.Logger.Debug().Msgf(\"skip instance, no key [%s] (name=%s, uuid=%s)\", me.instanceKey, i.GetChildContentS(\"name\"), i.GetChildContentS(\"uuid\"))\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tinstance := data.GetInstance(key)\n\t\t\tif instance == nil {\n\t\t\t\tme.Logger.Warn().Msgf(\"skip instance [%s], not found in cache\", key)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tcounters := i.GetChildS(\"counters\")\n\t\t\tif counters == nil {\n\t\t\t\tme.Logger.Debug().Msgf(\"skip instance [%s], no data counters\", key)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tfor _, cnt := range counters.GetChildren() {\n\n\t\t\t\tname := cnt.GetChildContentS(\"name\")\n\t\t\t\tvalue := cnt.GetChildContentS(\"value\")\n\n\t\t\t\tme.Logger.Trace().Msgf(\"(%s%s%s%s) parsing counter = %v\", color.Grey, key, color.End, name, value)\n\n\t\t\t\tif name == \"ops\" {\n\t\t\t\t\tif err = ops.SetValueString(instance, value); err != nil {\n\t\t\t\t\t\tme.Logger.Error().Stack().Err(err).Msgf(\"set metric (%s) value [%s]\", name, value)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tme.Logger.Trace().Msgf(\"+ metric (%s) = [%s%s%s]\", name, color.Cyan, value, color.End)\n\t\t\t\t\t\tcount++\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tme.Logger.Error().Stack().Err(nil).Msgf(\"unrequested metric (%s)\", name)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tme.Logger.Debug().Msgf(\"(%s) completed redundant ops poll (%s): collected %d\", me.Query, object, count)\n\treturn apiT, parseT, nil\n}", "title": "" }, { "docid": "0a56c30a5f970d76732609c09b313c9b", "score": "0.5369242", "text": "func (n *AclPathAny) CounterCapability() *Acl_CounterCapabilityPathAny {\n\treturn &Acl_CounterCapabilityPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"counter-capability\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "426c4b981eca02183390bac192075570", "score": "0.5337563", "text": "func (s *NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Global) GetCounters() *NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Global_Counters {\n\tif s != nil && s.Counters != nil {\n\t\treturn s.Counters\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7c9d3ec01cea54b8940b1a4c036b11d9", "score": "0.53301305", "text": "func (n *NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Interface_CountersPath) InSrefreshMessages() *NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Interface_Counters_InSrefreshMessagesPath {\n\treturn &NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Interface_Counters_InSrefreshMessagesPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"in-srefresh-messages\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "bfd5a15b3009bcbbcdc340b74b5a6480", "score": "0.5300667", "text": "func (s *Lacp_Interface_Member) GetCounters() *Lacp_Interface_Member_Counters {\n\tif s != nil && s.Counters != nil {\n\t\treturn s.Counters\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "17a765ddd8e3af2937d607df838a2fd5", "score": "0.5279033", "text": "func (n *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_ExtendedIsReachability_Neighbor_Instance_Subtlv_UnconstrainedLspPath) Count() *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_ExtendedIsReachability_Neighbor_Instance_Subtlv_UnconstrainedLsp_CountPath {\n\treturn &NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_ExtendedIsReachability_Neighbor_Instance_Subtlv_UnconstrainedLsp_CountPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"count\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "0110a3be20f65efb061d0d14e07875ae", "score": "0.52290744", "text": "func (n *NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Interface_CountersPath) RateLimitedMessages() *NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Interface_Counters_RateLimitedMessagesPath {\n\treturn &NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Interface_Counters_RateLimitedMessagesPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"rate-limited-messages\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "68e2ae620bb38b6bb91638ac585329f5", "score": "0.5203554", "text": "func (s *NetworkInstance_Protocol_Isis_Interface_Level) GetPacketCounters() *NetworkInstance_Protocol_Isis_Interface_Level_PacketCounters {\n\tif s != nil && s.PacketCounters != nil {\n\t\treturn s.PacketCounters\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6fbc97ca76cb76f9c68d87c24ad92612", "score": "0.5199857", "text": "func (n *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_MtIsn_Neighbor_Instance_Subtlv_UnconstrainedLspPath) Count() *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_MtIsn_Neighbor_Instance_Subtlv_UnconstrainedLsp_CountPath {\n\treturn &NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_MtIsn_Neighbor_Instance_Subtlv_UnconstrainedLsp_CountPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"count\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" } ]
1bb99d112bf475f592520e9338dccc9c
GetSigningIdentity is a utility method that returns the client's signing identity
[ { "docid": "a7aeb1bf22d90458ff4c4484af2c5d68", "score": "0.81739455", "text": "func GetSigningIdentity(client fabricClient.Client) ([]byte, error) {\n\tuser, err := client.LoadUserFromStateStore(\"\")\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"LoadUserFromStateStore returned error: %s\", err)\n\t}\n\tserializedIdentity := &msp.SerializedIdentity{Mspid: config.GetFabricCAID(),\n\t\tIdBytes: user.GetEnrollmentCertificate()}\n\tcreatorID, err := proto.Marshal(serializedIdentity)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Could not Marshal serializedIdentity, err %s\", err)\n\t}\n\treturn creatorID, nil\n}", "title": "" } ]
[ { "docid": "3aced189c248fcb0aa097dd88b8dbbcd", "score": "0.81190735", "text": "func (c *ChaincodeClient) GetSigningIdentity() msp.SigningIdentity {\n\treturn c.userClient.signingIdentity\n}", "title": "" }, { "docid": "043327791a971ae895753eccd1626f62", "score": "0.75770074", "text": "func (mgr *MockIdentityManager) GetSigningIdentity(userName string) (*api.SigningIdentity, error) {\n\n\tsi := api.SigningIdentity{\n\t\tMspID: \"Org1MSP\",\n\t}\n\treturn &si, nil\n}", "title": "" }, { "docid": "97269b3550601c169917c66c85b24d49", "score": "0.6747653", "text": "func (o Ocs) GetSigningKey(w http.ResponseWriter, r *http.Request) {\n\tu, ok := revactx.ContextGetUser(r.Context())\n\tif !ok {\n\t\t//o.logger.Error().Msg(\"missing user in context\")\n\t\to.mustRender(w, r, response.ErrRender(data.MetaBadRequest.StatusCode, \"missing user in context\"))\n\t\treturn\n\t}\n\n\t// use the user's UUID\n\tuserID := u.Id.OpaqueId\n\n\tc := storesvc.NewStoreService(\"com.owncloud.api.store\", grpc.NewClient())\n\tres, err := c.Read(r.Context(), &storesvc.ReadRequest{\n\t\tOptions: &storemsg.ReadOptions{\n\t\t\tDatabase: \"proxy\",\n\t\t\tTable: \"signing-keys\",\n\t\t},\n\t\tKey: userID,\n\t})\n\tif err == nil && len(res.Records) > 0 {\n\t\to.mustRender(w, r, response.DataRender(&data.SigningKey{\n\t\t\tUser: userID,\n\t\t\tSigningKey: string(res.Records[0].Value),\n\t\t}))\n\t\treturn\n\t}\n\tif err != nil {\n\t\te := merrors.Parse(err.Error())\n\t\tif e.Code == http.StatusNotFound {\n\t\t\t// not found is ok, so we can continue and generate the key on the fly\n\t\t} else {\n\t\t\to.mustRender(w, r, response.ErrRender(data.MetaServerError.StatusCode, \"error reading from store\"))\n\t\t\treturn\n\t\t}\n\t}\n\n\t// try creating it\n\tkey := make([]byte, 64)\n\t_, err = rand.Read(key[:])\n\tif err != nil {\n\t\to.mustRender(w, r, response.ErrRender(data.MetaServerError.StatusCode, \"could not generate signing key\"))\n\t\treturn\n\t}\n\tsigningKey := hex.EncodeToString(key)\n\n\t_, err = c.Write(r.Context(), &storesvc.WriteRequest{\n\t\tOptions: &storemsg.WriteOptions{\n\t\t\tDatabase: \"proxy\",\n\t\t\tTable: \"signing-keys\",\n\t\t},\n\t\tRecord: &storemsg.Record{\n\t\t\tKey: userID,\n\t\t\tValue: []byte(signingKey),\n\t\t\t// TODO Expiry?\n\t\t},\n\t})\n\n\tif err != nil {\n\t\t//o.logger.Error().Err(err).Msg(\"error writing key\")\n\t\to.mustRender(w, r, response.ErrRender(data.MetaServerError.StatusCode, \"could not persist signing key\"))\n\t\treturn\n\t}\n\n\to.mustRender(w, r, response.DataRender(&data.SigningKey{\n\t\tUser: userID,\n\t\tSigningKey: signingKey,\n\t}))\n}", "title": "" }, { "docid": "fb0ce9198184da1f982d73c5860fea29", "score": "0.67377675", "text": "func (o Ocs) GetSigningKey(w http.ResponseWriter, r *http.Request) {\n\tu, ok := revactx.ContextGetUser(r.Context())\n\tif !ok {\n\t\t//o.logger.Error().Msg(\"missing user in context\")\n\t\to.mustRender(w, r, response.ErrRender(data.MetaBadRequest.StatusCode, \"missing user in context\"))\n\t\treturn\n\t}\n\n\t// use the user's UUID\n\tuserID := u.Id.OpaqueId\n\n\tc := storesvc.NewStoreService(\"com.owncloud.api.store\", o.config.GrpcClient)\n\tres, err := c.Read(r.Context(), &storesvc.ReadRequest{\n\t\tOptions: &storemsg.ReadOptions{\n\t\t\tDatabase: \"proxy\",\n\t\t\tTable: \"signing-keys\",\n\t\t},\n\t\tKey: userID,\n\t})\n\tif err == nil && len(res.Records) > 0 {\n\t\to.mustRender(w, r, response.DataRender(&data.SigningKey{\n\t\t\tUser: userID,\n\t\t\tSigningKey: string(res.Records[0].Value),\n\t\t}))\n\t\treturn\n\t}\n\tif err != nil {\n\t\te := merrors.Parse(err.Error())\n\t\tif e.Code == http.StatusNotFound {\n\t\t\t// not found is ok, so we can continue and generate the key on the fly\n\t\t} else {\n\t\t\to.logger.Error().Err(err).Msg(\"error reading from server\")\n\t\t\to.mustRender(w, r, response.ErrRender(data.MetaServerError.StatusCode, \"error reading from store\"))\n\t\t\treturn\n\t\t}\n\t}\n\n\t// try creating it\n\tkey := make([]byte, 64)\n\t_, err = rand.Read(key[:])\n\tif err != nil {\n\t\to.mustRender(w, r, response.ErrRender(data.MetaServerError.StatusCode, \"could not generate signing key\"))\n\t\treturn\n\t}\n\tsigningKey := hex.EncodeToString(key)\n\n\t_, err = c.Write(r.Context(), &storesvc.WriteRequest{\n\t\tOptions: &storemsg.WriteOptions{\n\t\t\tDatabase: \"proxy\",\n\t\t\tTable: \"signing-keys\",\n\t\t},\n\t\tRecord: &storemsg.Record{\n\t\t\tKey: userID,\n\t\t\tValue: []byte(signingKey),\n\t\t\t// TODO Expiry?\n\t\t},\n\t})\n\n\tif err != nil {\n\t\t//o.logger.Error().Err(err).Msg(\"error writing key\")\n\t\to.mustRender(w, r, response.ErrRender(data.MetaServerError.StatusCode, \"could not persist signing key\"))\n\t\treturn\n\t}\n\n\to.mustRender(w, r, response.DataRender(&data.SigningKey{\n\t\tUser: userID,\n\t\tSigningKey: signingKey,\n\t}))\n}", "title": "" }, { "docid": "934ab5681c7e8b64b466aabbe006a7e5", "score": "0.63863635", "text": "func GetIdentity() (client Identity, err error) {\r\n\tconn, err := util.GetCSIClientConn()\r\n\tif err != nil {\r\n\t\tlog.Fatalf(\"did not connect: %v\", err)\r\n\t}\r\n\tc := csi.NewIdentityClient(conn)\r\n\r\n\treturn Identity{client: c}, nil\r\n}", "title": "" }, { "docid": "e5a57969551090f363762764b1c7a534", "score": "0.63108754", "text": "func (repo *GitRepo) GetUserSigningKey() (string, error) {\n\treturn repo.runGitCommand(\"config\", \"user.signingKey\")\n}", "title": "" }, { "docid": "8c742eec770caeab33c33dddc094186b", "score": "0.6285094", "text": "func GetIdentityClient(serverAddress *string, authorizer auth.Authorizer) (security_pb.IdentityAgentClient, error) {\n\tconn, err := getClientConnection(serverAddress, authorizer)\n\tif err != nil {\n\t\tlog.Fatalf(\"Unable to get IdentityClient. Failed to dial: %v\", err)\n\t}\n\n\treturn security_pb.NewIdentityAgentClient(conn), nil\n}", "title": "" }, { "docid": "cb128e864eb094114cc1ed8d6e19a609", "score": "0.60748386", "text": "func GetIdentity() (clientIdentity, serverIdentity []byte) {\n\t// for now it is hardcode idA and idB\n\tclientIdentity = []byte(\"authcoreuser\")\n\tserverIdentity = []byte(\"authcore\")\n\treturn\n}", "title": "" }, { "docid": "2c9b974ea568119a3808d4c24e1a30b9", "score": "0.60038716", "text": "func (f FakeClient) GetServiceIdentity() (string, error) {\n\tif len(f.IdentityErr) > 0 {\n\t\treturn \"\", fmt.Errorf(f.IdentityErr)\n\t}\n\treturn f.Identity, nil\n}", "title": "" }, { "docid": "37568aea7890c0798f2c8ee8ac84852c", "score": "0.5972354", "text": "func (ci *GcpClientImpl) GetServiceIdentity() (string, error) {\n\tserviceAccount, err := ci.fetcher.FetchServiceAccount()\n\tif err != nil {\n\t\tlog.Errorf(\"Failed to get service account with error: %v\", err)\n\t\treturn \"\", err\n\t}\n\treturn util.GenSanURI(\"default\", serviceAccount)\n}", "title": "" }, { "docid": "4a4894ddcdaaff726cf3e8f8f1b3a3bc", "score": "0.5942699", "text": "func (o *SignatureResult) GetSignedIdentity() string {\n\tif o == nil || o.SignedIdentity == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.SignedIdentity\n}", "title": "" }, { "docid": "f0b8516edb6988a0c88ebb24d1128aeb", "score": "0.5869755", "text": "func (mgr *MockCAClient) GetIdentity(id, caname string) (*api.IdentityResponse, error) {\n\treturn nil, errors.New(\"not implemented\")\n}", "title": "" }, { "docid": "b4fd8cd17fa47e8491b11cb2124d4126", "score": "0.58328074", "text": "func (c *RpcClient) GetIdentity(ctx context.Context) (GetIdentityResponse, error) {\n\treturn c.processGetIdentity(c.Call(ctx, \"getIdentity\"))\n}", "title": "" }, { "docid": "279c0cd4d9a6b532b865f10ca3dc2c0d", "score": "0.58288264", "text": "func (ctx *TransactionContext) GetClientIdentity() cid.ClientIdentity {\n\treturn ctx.clientIdentity\n}", "title": "" }, { "docid": "3c6f4ee1d693c7ea1f7b443c2fdf027c", "score": "0.5825843", "text": "func (d defaultDeployServiceClient) GetCallerIdentity(ctx context.Context, params *sts.GetCallerIdentityInput, optFns ...func(*sts.Options)) (*sts.GetCallerIdentityOutput, error) {\n\treturn d.stsClient.GetCallerIdentity(ctx, params, optFns...)\n}", "title": "" }, { "docid": "7c19499d6e0672de2c8505a0cce47bf4", "score": "0.5817122", "text": "func (s *signer) Identity() Identity {\n\treturn s.identity\n}", "title": "" }, { "docid": "69212f40b5a8f24620fc498eba8f7334", "score": "0.5816147", "text": "func (context *AptlyContext) GetSigner() pgp.Signer {\n\tcontext.Lock()\n\tdefer context.Unlock()\n\n\tprovider := context.pgpProvider()\n\tif provider == \"internal\" { // nolint: goconst\n\t\treturn &pgp.GoSigner{}\n\t}\n\n\treturn pgp.NewGpgSigner(context.getGPGFinder(provider))\n}", "title": "" }, { "docid": "fca4d53f0289d955656bd0dff03bd8e2", "score": "0.5732241", "text": "func (msp *bccspmsp) GetDefaultSigningIdentity() (SigningIdentity, error) {\n\tmspLogger.Debugf(\"Obtaining default signing identity\")\n\n\tif msp.signer == nil {\n\t\treturn nil, errors.New(\"this MSP does not possess a valid default signing identity\")\n\t}\n\n\treturn msp.signer, nil\n}", "title": "" }, { "docid": "3f89a12b1d4d029655e335cccf05dd6c", "score": "0.56638247", "text": "func (device *Device) GetIdentity() string {\n\treturn device.Identity\n}", "title": "" }, { "docid": "2ff253f60903462fd9a710850bba7e10", "score": "0.56559336", "text": "func (p *AwsIdentityProvider) GetIdentity() (*Identity, error) {\n\to, err := p.stsClient.GetCallerIdentity(new(sts.GetCallerIdentityInput))\n\tif err != nil {\n\t\tp.debug(\"error calling GetCallerIdentity: %v\", err)\n\t\treturn nil, err\n\t}\n\n\ta, err := arn.Parse(*o.Arn)\n\tif err != nil {\n\t\tp.debug(\"error parsing identity ARN: %v\", err)\n\t\treturn nil, err\n\t}\n\n\tid := &Identity{Provider: ProviderAws}\n\n\tr := strings.Split(a.Resource, \"/\")\n\tid.IdentityType = r[0]\n\tid.Username = r[len(r)-1]\n\n\treturn id, nil\n}", "title": "" }, { "docid": "7dc67df2f10846eed96a415d68ec4002", "score": "0.5655457", "text": "func (c *client) GetIdentityClientID(resourceGroup, identityName string) string {\n\tif clientID, ok := c.identityClientIDMap[identityName]; ok {\n\t\treturn clientID\n\t}\n\n\tresult, err := c.msiClient.Get(context.TODO(), resourceGroup, identityName)\n\tif err != nil {\n\t\t// Dummy client ID\n\t\treturn \"00000000-0000-0000-0000-000000000000\"\n\t}\n\n\tclientID := result.UserAssignedIdentityProperties.ClientID.String()\n\tc.identityClientIDMap[identityName] = clientID\n\n\treturn clientID\n}", "title": "" }, { "docid": "95cb7e24f58e92777d04712846a63886", "score": "0.5642768", "text": "func GetIdentity() IdentityResponse {\n\tr := req.New()\n\theader := req.Header{\n\t\t\"Accept\": \"appilcation/json\",\n\t\t\"Content-Type\": \"x-www-form-urlencoded\",\n\t}\n\n\tc := config.GetConfig()\n\tdata := url.Values{}\n\tdata.Set(\"client_id\", c.HCSSClientID)\n\tdata.Set(\"client_secret\", c.HCSSClientSecret)\n\tdata.Set(\"scope\", c.HCSSScope)\n\tdata.Set(\"grant_type\", c.HCSSGrantType)\n\tbody := strings.NewReader(data.Encode())\n\n\tres, err := r.Post(c.HCSSIdentityURL, body, header)\n\tif err != nil {\n\t\tlog.Fatal(err.Error())\n\t}\n\n\tvar response IdentityResponse\n\tif err = res.ToJSON(&response); err != nil {\n\t\tlog.Fatal(err.Error())\n\t}\n\treturn response\n}", "title": "" }, { "docid": "8a8c5a501c33504119467f037bd4b2ce", "score": "0.5636361", "text": "func GetIdentity(externalID string, externalIDType string, accessToken string) (client.Identity, error) {\n\tif provider != nil {\n\t\treturn provider.GetIdentity(externalID, externalIDType, accessToken)\n\t}\n\treturn client.Identity{}, fmt.Errorf(\"No auth provider configured\")\n}", "title": "" }, { "docid": "3a2fe8e3768473cc06af01c58b5d734a", "score": "0.563201", "text": "func GetIPsecKeyIdentity() uint8 {\n\treturn getLocalNode().EncryptionKey\n}", "title": "" }, { "docid": "f892d2fa4018f23f64ecad3bdd47412f", "score": "0.558416", "text": "func (l *LocalKeyManager) GetSigningKey() (jose.JSONWebKey, error) {\n\tvar jwk jose.JSONWebKey\n\tvar dbwks []dbRSAKey\n\terr := l.DB.Model(&dbwks).Select()\n\tif err != nil {\n\t\treturn jwk, err\n\t}\n\n\thighestID := int64(0)\n\thighestJWK := dbRSAKey{}\n\tfor _, k := range dbwks {\n\t\tif highestID == int64(0) {\n\t\t\ti, err := strconv.ParseInt(k.KeyID, 10, 64)\n\t\t\tif err != nil {\n\t\t\t\treturn jwk, err\n\t\t\t}\n\t\t\thighestID = i\n\t\t\thighestJWK = k\n\t\t\tcontinue\n\t\t}\n\t\ti, err := strconv.ParseInt(k.KeyID, 10, 64)\n\t\tif err != nil {\n\t\t\treturn jwk, err\n\t\t}\n\t\tif i > highestID {\n\t\t\thighestID = i\n\t\t\thighestJWK = k\n\t\t}\n\t}\n\twk, err := highestJWK.ToWebKey()\n\tif err != nil {\n\t\treturn jwk, err\n\t}\n\treturn *wk, nil\n}", "title": "" }, { "docid": "94ccb99536f7255937dc3aeb3d421ef5", "score": "0.5574225", "text": "func GetIdentity(ctx context.Context) *pb.IdentityInfo {\n\treturn &pb.IdentityInfo{\n\t\tUserID: GetUserID(ctx),\n\t\tOrgID: GetOrgID(ctx),\n\t}\n}", "title": "" }, { "docid": "6d07d9f3e05ece3f7807de616787504e", "score": "0.55681264", "text": "func getSignerFromFile(t *testing.T, ctx context.Context, k8sclient kubernetes.Interface) (signature.Signer, string) {\n\tt.Helper()\n\n\ttmpDir := t.TempDir()\n\tprivateKeyPath, _, err := GenerateKeyFile(tmpDir, pass(password))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tsigner, err := cosignsignature.SignerFromKeyRef(ctx, privateKeyPath, pass(password))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\treturn signer, filepath.Join(tmpDir, \"cosign.pub\")\n}", "title": "" }, { "docid": "029af94552e9da0ab7c2bcb1964123e1", "score": "0.5553127", "text": "func (pod *Pod) GetIdentity() watcher.Identity {\n\treturn watcher.Identity{\n\t\tAccountID: pod.AccountID,\n\t\tApplicationID: pod.ApplicationID,\n\t\tServiceID: pod.ServiceID,\n\t}\n}", "title": "" }, { "docid": "8facb5b639da0e6fdc04a841873c496f", "score": "0.5511599", "text": "func (p *ProofRequestHolder) GetVerifierIdentity() string {\n\ts := p.SignedProofRequest.ProofRequest.Verifier\n\treturn base64.StdEncoding.EncodeToString([]byte(s))\n}", "title": "" }, { "docid": "75608469a62f5c3fef875ee9c7566055", "score": "0.55085516", "text": "func (o *SandboxPublicTokenCreateRequest) GetClientId() string {\n\tif o == nil || o.ClientId == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.ClientId\n}", "title": "" }, { "docid": "cbd333cb8e1eae069f474f8cb5039a98", "score": "0.55004543", "text": "func GetSigningProfile(ctx *pulumi.Context,\n\tname string, id pulumi.IDInput, state *SigningProfileState, opts ...pulumi.ResourceOption) (*SigningProfile, error) {\n\tvar resource SigningProfile\n\terr := ctx.ReadResource(\"aws-native:signer:SigningProfile\", name, id, state, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "0a41f1acd936b4c901fc27d0d9550617", "score": "0.5499889", "text": "func getIdentity() string {\n\tloader := config.NewLoader()\n\tproviderConfig, err := loader.Load()\n\tif err != nil {\n\t\treturn \"\"\n\t}\n\n\tproviderName := config.DevSpaceCloudProviderName\n\n\t// Choose cloud provider\n\tif providerConfig.Default != \"\" {\n\t\tproviderName = providerConfig.Default\n\t}\n\n\tprovider := config.GetProvider(providerConfig, providerName)\n\tif provider == nil || provider.Host == \"\" || provider.Token == \"\" {\n\t\treturn \"\"\n\t}\n\n\tparsedURL, err := url.Parse(provider.Host)\n\tif err != nil {\n\t\treturn \"\"\n\t}\n\n\tidentifier, err := token.GetAccountID(provider.Token)\n\tif err != nil {\n\t\treturn \"\"\n\t}\n\n\tstringIdentifier := strconv.Itoa(identifier)\n\n\t// Ignore if identify fails\n\treturn parsedURL.Host + \"/\" + stringIdentifier\n}", "title": "" }, { "docid": "24d97388e7fceb1df527bc0da4a8bb58", "score": "0.54714173", "text": "func (m *ConfigurationManagerClientInformation) GetClientIdentifier()(*string) {\n val, err := m.GetBackingStore().Get(\"clientIdentifier\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "title": "" }, { "docid": "9e4ba6af171f4eb5c9c33f7a15cf1468", "score": "0.5465487", "text": "func (o *ProjectServices) GetIdentity() ProjectServiceIdentity {\n\tif o == nil || o.Identity == nil {\n\t\tvar ret ProjectServiceIdentity\n\t\treturn ret\n\t}\n\treturn *o.Identity\n}", "title": "" }, { "docid": "2503e2480d86be1056eef6b2feaed58f", "score": "0.5450844", "text": "func (n *Node) getSigner() *signer {\n\treturn newSigner(n.skPriv)\n}", "title": "" }, { "docid": "c9b838ab4fbf823b496ee3fca36e22ac", "score": "0.54427755", "text": "func (s *EmptyServer) GetIdentity(ctx context.Context, in *drand.IdentityRequest) (*drand.IdentityResponse, error) {\n\treturn nil, nil\n}", "title": "" }, { "docid": "30350a287a41b2335f6c626a6c083ebf", "score": "0.5416207", "text": "func (infos *Infos) GetIdentity(index int) (Identity, error) {\n\n\tvar writerID Identity\n\n\tidentityStr, err := infos.getJSONMember(index, \"sample_identity\")\n\tif err != nil {\n\t\treturn writerID, err\n\t}\n\n\tjsonByte := []byte(identityStr)\n\terr = json.Unmarshal(jsonByte, &writerID)\n\tif err != nil {\n\t\treturn writerID, errors.New(\"JSON Unmarshal failed: \" + err.Error())\n\t}\n\n\treturn writerID, nil\n}", "title": "" }, { "docid": "7f86501860d9c2895713a8ae84167de4", "score": "0.54141897", "text": "func (s *softwareKeyStore) getSigner(ctx context.Context, rawKey []byte) (crypto.Signer, error) {\n\tsigner, err := utils.ParsePrivateKeyPEM(rawKey)\n\treturn signer, trace.Wrap(err)\n}", "title": "" }, { "docid": "ebc3f8ab43c3c7946e3eec21a3dec5eb", "score": "0.5402866", "text": "func NewSigningService() signing.Service {\n\treturn &Client{}\n}", "title": "" }, { "docid": "01252dc484af987f66f8aa61a2c6ef7f", "score": "0.5395209", "text": "func jwtSigning(u *userDetail) string {\n\n\tmySigningKey := []byte(\"Erick signed it\")\n\n\t// Create the Claims\n\tclaims := MyCustomClaims{\n\t\tEmail: u.Email,\n\t\tPassword: u.Password,\n\t\tFirstName: u.FirstName,\n\t\tLastName: u.LastName,\n\t}\n\n\t//I decided to use the SHA256 hashing method as it is relatively secure\n\ttoken := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)\n\tss, err := token.SignedString(mySigningKey)\n\tif err != nil {\n\t\treturn \"\"\n\t}\n\treturn ss\n}", "title": "" }, { "docid": "1f24b512e97e45c19a757e7d781592c0", "score": "0.5373801", "text": "func (c *Client) GetIdent() string {\n\tc.panicIfNotTracking()\n\tvar ident string\n\n\tc.state.mu.RLock()\n\tif c.state.ident == \"\" {\n\t\tident = c.Config.Name\n\t} else {\n\t\tident = c.state.ident\n\t}\n\tc.state.mu.RUnlock()\n\n\treturn ident\n}", "title": "" }, { "docid": "58fa6eddbb885447d0365bd183cf8ccf", "score": "0.5366675", "text": "func (t *info) GetClientID() string {\n\treturn t.GetClientId()\n}", "title": "" }, { "docid": "c1bf1017cb536eb6ae99f7f911117834", "score": "0.5331389", "text": "func RegisterSigningHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SigningClient) error {\n\n\tmux.Handle(\"GET\", pattern_Signing_GetX509CertificateAvailableSigningKeys_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateContext(ctx, mux, req, \"/v3.Signing/GetX509CertificateAvailableSigningKeys\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := request_Signing_GetX509CertificateAvailableSigningKeys_0(rctx, inboundMarshaler, client, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Signing_GetX509CertificateAvailableSigningKeys_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Signing_GetX509CACertificate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateContext(ctx, mux, req, \"/v3.Signing/GetX509CACertificate\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := request_Signing_GetX509CACertificate_0(rctx, inboundMarshaler, client, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Signing_GetX509CACertificate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Signing_PostX509Certificate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateContext(ctx, mux, req, \"/v3.Signing/PostX509Certificate\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := request_Signing_PostX509Certificate_0(rctx, inboundMarshaler, client, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Signing_PostX509Certificate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Signing_GetUserSSHCertificateAvailableSigningKeys_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateContext(ctx, mux, req, \"/v3.Signing/GetUserSSHCertificateAvailableSigningKeys\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := request_Signing_GetUserSSHCertificateAvailableSigningKeys_0(rctx, inboundMarshaler, client, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Signing_GetUserSSHCertificateAvailableSigningKeys_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Signing_GetUserSSHCertificateSigningKey_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateContext(ctx, mux, req, \"/v3.Signing/GetUserSSHCertificateSigningKey\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := request_Signing_GetUserSSHCertificateSigningKey_0(rctx, inboundMarshaler, client, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Signing_GetUserSSHCertificateSigningKey_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Signing_PostUserSSHCertificate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateContext(ctx, mux, req, \"/v3.Signing/PostUserSSHCertificate\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := request_Signing_PostUserSSHCertificate_0(rctx, inboundMarshaler, client, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Signing_PostUserSSHCertificate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Signing_GetHostSSHCertificateAvailableSigningKeys_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateContext(ctx, mux, req, \"/v3.Signing/GetHostSSHCertificateAvailableSigningKeys\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := request_Signing_GetHostSSHCertificateAvailableSigningKeys_0(rctx, inboundMarshaler, client, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Signing_GetHostSSHCertificateAvailableSigningKeys_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Signing_GetHostSSHCertificateSigningKey_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateContext(ctx, mux, req, \"/v3.Signing/GetHostSSHCertificateSigningKey\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := request_Signing_GetHostSSHCertificateSigningKey_0(rctx, inboundMarshaler, client, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Signing_GetHostSSHCertificateSigningKey_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Signing_PostHostSSHCertificate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateContext(ctx, mux, req, \"/v3.Signing/PostHostSSHCertificate\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := request_Signing_PostHostSSHCertificate_0(rctx, inboundMarshaler, client, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Signing_PostHostSSHCertificate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Signing_GetBlobAvailableSigningKeys_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateContext(ctx, mux, req, \"/v3.Signing/GetBlobAvailableSigningKeys\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := request_Signing_GetBlobAvailableSigningKeys_0(rctx, inboundMarshaler, client, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Signing_GetBlobAvailableSigningKeys_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Signing_GetBlobSigningKey_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateContext(ctx, mux, req, \"/v3.Signing/GetBlobSigningKey\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := request_Signing_GetBlobSigningKey_0(rctx, inboundMarshaler, client, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Signing_GetBlobSigningKey_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Signing_PostSignBlob_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateContext(ctx, mux, req, \"/v3.Signing/PostSignBlob\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := request_Signing_PostSignBlob_0(rctx, inboundMarshaler, client, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Signing_PostSignBlob_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "e1b1ecf0b2c5d73bafa0aa9d7144df40", "score": "0.53284293", "text": "func (m *AppCredentialSignInActivity) GetKeyId()(*string) {\n val, err := m.GetBackingStore().Get(\"keyId\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "title": "" }, { "docid": "c54b2809acac42d561ece0c2c10e60a8", "score": "0.532633", "text": "func getSignPubkey(sk []byte) string {\n return hexify(nacl.GetSignPubkey(sk))\n}", "title": "" }, { "docid": "c222bd7b761f33d0aefbfa1b93f60f9e", "score": "0.53109753", "text": "func (m *BootstrapRequest) GetSign() []byte {\n\treturn m.sign\n}", "title": "" }, { "docid": "e85d655b8984d24bfc48d9f17addf859", "score": "0.530357", "text": "func GetSharedKey(request *http.Request) (string, error) {\n\tsignature := request.Header.Get(HeaderAuthorization)\n\n\tcomps := strings.Split(signature, \";\")\n\tif len(comps) < 4 {\n\t\treturn \"\", ErrInvalidSignature\n\t}\n\tcredential := strings.TrimPrefix(comps[1], \"Credential:\")\n\treturn credential, nil\n}", "title": "" }, { "docid": "8fd6bf9d2ae8b7b28c816b0cd05d5b5d", "score": "0.5291664", "text": "func GetSigner() crypto.PubKey {\n\tname := viper.GetString(NameFlag)\n\tmanager := keycmd.GetKeyManager()\n\tinfo, _ := manager.Get(name) // error -> empty pubkey\n\treturn info.PubKey\n}", "title": "" }, { "docid": "4ca820b2e10da6292f8ff769f371d2aa", "score": "0.52582", "text": "func (o *FcpoolReservation) GetIdentity() string {\n\tif o == nil || o.Identity == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Identity\n}", "title": "" }, { "docid": "f07435325d9cbc4369d13a1e23efc10a", "score": "0.52513224", "text": "func (o *DeviceClientRsaKey) GetClientId() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.ClientId\n}", "title": "" }, { "docid": "fbb627e842d990f9878a6b9d29075ccc", "score": "0.52486444", "text": "func (cred ClientCredential) GetAssertion() *ClientAssertion {\n\treturn cred.clientAssertion\n}", "title": "" }, { "docid": "f329968e131a2c5dc61ca4b783b8157c", "score": "0.52328753", "text": "func (o *VirtualizationBaseCluster) GetIdentity() string {\n\tif o == nil || o.Identity == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Identity\n}", "title": "" }, { "docid": "697c98f15e60c5f3d5a3a0798da2468e", "score": "0.5218955", "text": "func GetSignIn() string {\n\tparams := map[string]string{\n\t\t\"client_id\": cID,\n\t\t\"redirect_uri\": cRedirect,\n\t\t\"scope\": \"https://www.googleapis.com/auth/youtube\",\n\t\t\"response_type\": \"code\",\n\t\t\"access_type\": \"offline\",\n\t}\n\treturn oauth.GetSignIn(\"https://accounts.google.com/o/oauth2/auth\", params)\n}", "title": "" }, { "docid": "4d6c09bc47e2a060ab36f81e64a050ce", "score": "0.5214664", "text": "func GetIdentity(ctx context.Context, api *slack.Client,\n\tsources map[string]*msg.Source) (*msg.Source, error) {\n\n\t// Check sources cache\n\tif s, ok := sources[msg.SourcesBotSelfKey]; ok {\n\t\treturn s, nil\n\t}\n\n\t// Get bot identity from api\n\tident, err := api.GetBotInfoContext(ctx, \"\")\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error retrieving bot identity: %s\",\n\t\t\terr.Error())\n\t}\n\n\ts := msg.NewSource(ident.ID, ident.Name, msg.User)\n\n\t// Cache identity\n\tsources[msg.SourcesBotSelfKey] = s\n\n\treturn s, nil\n}", "title": "" }, { "docid": "9c49fa49ab7ec5d7f291ca978768004d", "score": "0.5205504", "text": "func (client BaseClient) GetKeySender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}", "title": "" }, { "docid": "1dd644ade1aa617acaab41c6c4d6847a", "score": "0.5201855", "text": "func (spec *ReplicaSpec) GetIdentity() watcher.Identity {\n\treturn watcher.Identity{\n\t\tAccountID: spec.AccountID,\n\t\tApplicationID: spec.ApplicationID,\n\t\tServiceID: spec.ServiceID,\n\t}\n}", "title": "" }, { "docid": "4f75c41f57314b9b9f06ded0df978b89", "score": "0.5185543", "text": "func GetSign(isGet bool, body map[string]string, session string) string {\n\tvar list []string\n\n\t//Generate list\n\tfor k, v := range body {\n\t\tlist = append(list, k+\"=\"+v)\n\t}\n\n\t//Sort\n\tsort.Strings(list)\n\n\t//Join\n\ts := strings.Join(list, \"&\") + \"&key=\" + session\n\n\treturn md5LowerString(s)\n}", "title": "" }, { "docid": "a5e1843393a56d5a200ea51ce376102a", "score": "0.5174452", "text": "func (this *Challenge) GetSignature() string {\n\treturn this.authParams.GetValue(ParameterNames_SIGNATURE).(string)\n}", "title": "" }, { "docid": "dc653885ddcc413c6ea06618bb6d1ab4", "score": "0.51596665", "text": "func GetKeyClient(serverAddress *string, authorizer auth.Authorizer) (security_pb.KeyAgentClient, error) {\n\tconn, err := getClientConnection(serverAddress, authorizer)\n\tif err != nil {\n\t\tlog.Fatalf(\"Unable to get KeyClient. Failed to dial: %v\", err)\n\t}\n\n\treturn security_pb.NewKeyAgentClient(conn), nil\n}", "title": "" }, { "docid": "f2e4448a2c47d0af7773deeb65b64dc2", "score": "0.51179814", "text": "func getSignPubkey(sk []byte) string {\n\tpk, _ := naclSeedToKeyPair(sk)\n\treturn hexify(pk)\n}", "title": "" }, { "docid": "0fb91c3c13d44f729850e684d11a7d6c", "score": "0.51177406", "text": "func (o SingleSignOn) GetSignInLink() string {\n\treturn o.identityProvider.GetAuthorizationURL()\n}", "title": "" }, { "docid": "752d9881be6d9c7674f4f322d3a8ff02", "score": "0.50990385", "text": "func (this *Challenge) GetSignedBy() string {\n\treturn this.authParams.GetValue(ParameterNames_SIGNED_BY).(string)\n}", "title": "" }, { "docid": "58cbed1a5d99e0f3cfae53327bc6ae2d", "score": "0.50871414", "text": "func (c *SecurityContext) Identity() string {\n\treturn c.identity\n}", "title": "" }, { "docid": "d061e2e44c18f2db6f6fed2841ce4d3e", "score": "0.50741273", "text": "func (msg *AuthenticateRequestMessage) GetClientId() string {\n\treturn msg.clientId\n}", "title": "" }, { "docid": "88fb4b330ed6750d50a03783c742d484", "score": "0.5070052", "text": "func (client BaseClient) GetCertificateIssuerSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}", "title": "" }, { "docid": "e395b3ada3b419f2338474904551d284", "score": "0.5055897", "text": "func (m *AospDeviceOwnerEnterpriseWiFiConfiguration) GetIdentityCertificateForClientAuthentication()(AospDeviceOwnerCertificateProfileBaseable) {\n val, err := m.GetBackingStore().Get(\"identityCertificateForClientAuthentication\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(AospDeviceOwnerCertificateProfileBaseable)\n }\n return nil\n}", "title": "" }, { "docid": "a956478198a02406820bf3b98235d864", "score": "0.5054633", "text": "func RegisterSigningHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {\n\treturn RegisterSigningHandlerClient(ctx, mux, NewSigningClient(conn))\n}", "title": "" }, { "docid": "460359db05d2c0c1ffdd88e4173e2d72", "score": "0.5047783", "text": "func GetDefaultSigner() (msp.SigningIdentity, error) {\n\tsigner, err := mspmgmt.GetLocalMSP(factory.GetDefault()).GetDefaultSigningIdentity()\n\tif err != nil {\n\t\treturn nil, errors.WithMessage(err, \"error obtaining the default signing identity\")\n\t}\n\n\treturn signer, err\n}", "title": "" }, { "docid": "86f9ca8cf08b8f3923993d4e99e32218", "score": "0.50402486", "text": "func SignIn(clientID string, userID string, password string) (string, *exception.Exception) {\n\texists, ex := redisservice.Exits(signLogTag + userID)\n\tif exists {\n\t\tat, ex := redisservice.Get(signLogTag + userID)\n\t\tif ex != nil {\n\t\t\t_, ex := sessionservice.VerifyGlobal(at)\n\t\t\tif ex == nil {\n\t\t\t\treturn at, nil\n\t\t\t}\n\t\t}\n\t}\n\n\t_, ex = verifyUser(clientID, userID, password)\n\tif ex != nil {\n\t\treturn \"\", ex\n\t}\n\n\troles, ex := findRoles(userID)\n\tif ex != nil {\n\t\treturn \"\", ex.ResetCode(1005)\n\t}\n\n\taccessToken, ex := tokenservice.SignAccessToken(clientID)\n\tif ex != nil {\n\t\treturn \"\", ex.ResetCode(1006)\n\t}\n\n\t_, ex = sessionservice.NewGlobal(userID, accessToken, roles)\n\tif ex != nil {\n\t\treturn \"\", ex.ResetCode(1007)\n\t}\n\t_, ex = redisservice.Set(signLogTag+userID, accessToken, -1)\n\n\treturn accessToken, nil\n}", "title": "" }, { "docid": "7ba697e3c869fe168f78da62a8e7954c", "score": "0.5039336", "text": "func (c *Client) GetID() string {\n\treturn c.providerIdent\n}", "title": "" }, { "docid": "210a990dca942e31390d461361c1a178", "score": "0.5031561", "text": "func (svc *IAM) GetClient() *SDK.IAM {\n\treturn svc.client\n}", "title": "" }, { "docid": "30c7ca1b8cf2b573b810b797d8e3559f", "score": "0.5018987", "text": "func (m *AppCredentialSignInActivity) GetServicePrincipalObjectId()(*string) {\n val, err := m.GetBackingStore().Get(\"servicePrincipalObjectId\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "title": "" }, { "docid": "751710d25afe093a112a87b0c36a70b0", "score": "0.50110036", "text": "func GetClientID(ctx context.Context) (clientID string, ok bool) {\n\tv, ok := ctx.Value(clientIDKey).(string)\n\treturn v, ok\n}", "title": "" }, { "docid": "c8e570958fecd5c3262263c1050fc776", "score": "0.5007094", "text": "func (config *Config) GetUseClientIDFromCertificate() bool {\n\treturn config.useClientIDFromCertificate\n}", "title": "" }, { "docid": "08bcaae8c28d76e1cda796b7342c1084", "score": "0.5002919", "text": "func (t *Token) signingString() (string, error) {\n\tvar err error\n\tparts := make([]string, 2)\n\tbits, err := json.Marshal(t.Header)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tparts[0] = EncodeSegment(bits)\n\tbits2, err2 := json.Marshal(t.Claims)\n\tif err2 != nil {\n\t\treturn \"\", err2\n\t}\n\tparts[1] = EncodeSegment(bits2)\n\treturn strings.Join(parts, \".\"), nil\n}", "title": "" }, { "docid": "91a851ccdd8daad1b545ac0a2c992604", "score": "0.5001234", "text": "func (o *SandboxBankIncomeFireWebhookRequest) GetClientId() string {\n\tif o == nil || o.ClientId == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.ClientId\n}", "title": "" }, { "docid": "469c1f973fbb43c628d4a2345d0b4387", "score": "0.49951333", "text": "func (client SecretsClient) GetSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, azure.DoRetryWithRegistration(client.Client))\n}", "title": "" }, { "docid": "10b6bc0b5c6588818ac643bc5c4f791e", "score": "0.49896142", "text": "func (o *DepositSwitchAltCreateRequest) GetClientId() string {\n\tif o == nil || o.ClientId == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.ClientId\n}", "title": "" }, { "docid": "a7baa3d3d7e7b927f361d9c15e67e01c", "score": "0.49736437", "text": "func (s *UsersService) GetSSHSigningKey(ctx context.Context, id int64) (*SSHSigningKey, *Response, error) {\n\tu := fmt.Sprintf(\"user/ssh_signing_keys/%v\", id)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tkey := new(SSHSigningKey)\n\tresp, err := s.client.Do(ctx, req, key)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn key, resp, nil\n}", "title": "" }, { "docid": "6c424ab82f2f7f3815f0d1df469536c0", "score": "0.4964915", "text": "func Backend() string {\n\treturn viper.GetString(CfgSigner)\n}", "title": "" }, { "docid": "17db8e55ec4f0542310adfc762505deb", "score": "0.49647748", "text": "func GetClient() ([]byte, string) {\n\tglobalMu.RLock()\n\tdefer globalMu.RUnlock()\n\treturn clientJSON, hash\n}", "title": "" }, { "docid": "a61f37e9b38013737e5efc9001fb6ae9", "score": "0.4964454", "text": "func (client BaseClient) GetCertificateSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}", "title": "" }, { "docid": "d174d3d6fc5c090a108d102bb24d13d5", "score": "0.49631953", "text": "func getClientOrgID(ctx contractapi.TransactionContextInterface, verifyOrg bool) (string, error) {\n\tclientOrgID, err := ctx.GetClientIdentity().GetMSPID()\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed getting client's orgID: %v\", err)\n\t}\n\n\tif verifyOrg {\n\t\terr = verifyClientOrgMatchesPeerOrg(clientOrgID)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t}\n\n\treturn clientOrgID, nil\n}", "title": "" }, { "docid": "868979feb78347d87a935f6720410e4b", "score": "0.49605787", "text": "func GetPublicIdentity(b64Identity string) (*string, error) {\n\ttype anyPublicIdentity struct {\n\t\tpublicIdentity\n\n\t\tPublicSignatureKey []byte `json:\"public_signature_key,omitempty\"`\n\t\tPublicEncryptionKey []byte `json:\"public_encryption_key,omitempty\"`\n\t}\n\n\tpublicIdentity := new(anyPublicIdentity)\n\tif err := Decode(b64Identity, publicIdentity); err != nil {\n\t\treturn nil, err\n\t}\n\n\thashTarget := true\n\tswitch publicIdentity.Target {\n\tcase \"user\":\n\t\thashTarget = false\n\tcase \"email\":\n\t\tpublicIdentity.Value = hashProvisionalIdentityEmail(publicIdentity.Value)\n\tcase \"phone_number\":\n\t\tprivateIdentity := struct {\n\t\t\tPrivateSignatureKey *string `json:\"private_signature_key\"`\n\t\t}{}\n\t\t// in practice this case should never happen since we are decoding into a\n\t\t// more permissive type, and we already decoded above so there should be\n\t\t// no problem with b64Identity itself\n\t\tif err := Decode(b64Identity, &privateIdentity); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tprivateSignatureKey := privateIdentity.PrivateSignatureKey\n\t\tif privateSignatureKey == nil {\n\t\t\treturn nil, errors.New(\"invalid tanker identity\")\n\t\t}\n\t\tpublicIdentity.Value = hashProvisionalIdentityValue(publicIdentity.Value, *privateSignatureKey)\n\tdefault:\n\t\treturn nil, errors.New(\"unsupported identity target\")\n\t}\n\n\tif hashTarget {\n\t\tpublicIdentity.Target = \"hashed_\" + publicIdentity.Target\n\t}\n\n\treturn Encode(publicIdentity)\n}", "title": "" }, { "docid": "432d2fa9deb7157ef495369a3737ab5b", "score": "0.49569482", "text": "func (k *Key) GetSigner() (crypto.Signer, error) {\n\tif k.hasAttribute(tpm2.FlagRestricted) {\n\t\treturn nil, fmt.Errorf(\"restricted keys are not supported\")\n\t}\n\tif !k.hasAttribute(tpm2.FlagSign) {\n\t\treturn nil, fmt.Errorf(\"non-signing key used with GetSigner()\")\n\t}\n\n\tvar sigScheme *tpm2.SigScheme\n\n\tswitch k.pubArea.Type {\n\tcase tpm2.AlgRSA:\n\t\tsigScheme = k.pubArea.RSAParameters.Sign\n\t\tif sigScheme.Alg != tpm2.AlgRSAPSS && sigScheme.Alg != tpm2.AlgRSASSA {\n\t\t\treturn nil, fmt.Errorf(\"unsupported signing algorithm: %v\", sigScheme.Alg)\n\t\t}\n\tcase tpm2.AlgECC:\n\t\tsigScheme = k.pubArea.ECCParameters.Sign\n\t\tif sigScheme.Alg != tpm2.AlgECDSA {\n\t\t\treturn nil, fmt.Errorf(\"unsupported signing algorithm: %v\", sigScheme.Alg)\n\t\t}\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unsupported key type: %v\", k.pubArea.Type)\n\t}\n\thash, err := sigScheme.Hash.Hash()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &tpmSigner{k, hash}, nil\n}", "title": "" }, { "docid": "574fe59479c484db63c0d54acdbd53dd", "score": "0.49526027", "text": "func (c *SubCIDOffer) GetSignature() string {\n\treturn c.signature\n}", "title": "" }, { "docid": "60bb47b05463fddaf25796be83dde660", "score": "0.49519497", "text": "func (trs *SignedTransactions) GetSignature() stored_users.Signature {\n\treturn trs.Sig\n}", "title": "" }, { "docid": "b3327015b27974e03b09cc86f4822003", "score": "0.49483034", "text": "func (c *forgerockClient) Identity() (*identity.Identity, error) {\n\treturn c.identity(forgerockIdentityProvider), nil\n}", "title": "" }, { "docid": "bf66d282bd61b2386d1998e55dfaf60b", "score": "0.49411082", "text": "func (infos *Infos) GetIdentityJSON(index int) (string, error) {\n\tidentityStr, err := infos.getJSONMember(index, \"sample_identity\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn identityStr, nil\n}", "title": "" }, { "docid": "7248fd6cddc6eb5eb32e8f742a65e588", "score": "0.49395347", "text": "func (o *SignalEvaluateRequest) GetClientId() string {\n\tif o == nil || o.ClientId == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.ClientId\n}", "title": "" }, { "docid": "86cd245d02fe0ce2ee77f87552f6a060", "score": "0.49370515", "text": "func (config *Config) GetStaticClientID() []byte {\n\treturn config.clientID\n}", "title": "" }, { "docid": "772c0b468378b05a6b554a52c942f282", "score": "0.49241972", "text": "func (c *Client) IdentityGet(id string) (*models.Identity, error) {\n\tparams := policy.NewGetIdentityIDParams().WithID(id).WithTimeout(api.ClientTimeout)\n\n\tresp, err := c.Policy.GetIdentityID(params)\n\tif err != nil {\n\t\treturn nil, Hint(err)\n\t}\n\treturn resp.Payload, nil\n}", "title": "" }, { "docid": "c5dfebbc18c3f223ee04ff5e4e4701fe", "score": "0.49213663", "text": "func (v *HostInfo) GetIdentity() (o string) {\n\tif v != nil {\n\t\treturn v.Identity\n\t}\n\treturn\n}", "title": "" }, { "docid": "08d0eefa7892b447f85e1190abc56e4f", "score": "0.49181306", "text": "func (m *AuthenticationMethodsRegistrationCampaignIncludeTarget) GetId()(*string) {\n val, err := m.GetBackingStore().Get(\"id\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "title": "" }, { "docid": "4265b734b06264195f39e89845bd1382", "score": "0.49177647", "text": "func (store *KeyStore) GetClientIDEncryptionPublicKey(clientID []byte) (*keys.PublicKey, error) {\n\tfname := store.GetPublicKeyFilePath(\n\t\t// use correct suffix for public keys\n\t\tgetPublicKeyFilename(\n\t\t\t// use correct suffix as type of key\n\t\t\t[]byte(GetServerDecryptionKeyFilename(clientID))))\n\treturn store.getPublicKeyByFilename(fname)\n}", "title": "" }, { "docid": "ac32bec1899eb06346e41824e36d6e37", "score": "0.49123392", "text": "func (b *Bucket) GetIdentityToken(dur time.Duration) (did.Token, error) {\n\tctx, err := b.authCtx(context.TODO(), dur)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\ttoken, _ := did.TokenFromContext(ctx)\n\treturn token, nil\n}", "title": "" }, { "docid": "265448ee8cee7f4ff0e5dc2fd66b7a4c", "score": "0.49043998", "text": "func getGpgKeyId(t *testing.T) string {\n\tresp, body, _, err := httpClient.SendGet(GetRtDetails().GetUrl()+\"api/security/keys/trusted\", true, distHttpDetails, \"\")\n\tassert.NoError(t, err)\n\tif resp.StatusCode != http.StatusOK {\n\t\tt.Error(resp.Status)\n\t\tt.Error(string(body))\n\t\treturn \"\"\n\t}\n\tresponses := &gpgKeysResponse{}\n\terr = json.Unmarshal(body, &responses)\n\tassert.NoError(t, err)\n\tfor _, gpgKeyResponse := range responses.Keys {\n\t\tif gpgKeyResponse.Alias == gpgKeyAlias {\n\t\t\treturn gpgKeyResponse.Kid\n\t\t}\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "517efc0ab54155f960f8dfe4e140e720", "score": "0.49036437", "text": "func (c *Client) Sign(payload string) (string, error) {\n\tmac := hmac.New(sha256.New, []byte(c.config.Auth.Secret))\n\t_, err := mac.Write([]byte(payload))\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"error calculating hmac for signature\")\n\t}\n\treturn hex.EncodeToString(mac.Sum(nil)), nil\n}", "title": "" }, { "docid": "8de7d232339d784e6f11abe020ac1368", "score": "0.4896295", "text": "func (certification Certification) GetKey() string {\n\treturn certification.Key\n}", "title": "" }, { "docid": "439a895d71f31016dcc1623c5a1940a5", "score": "0.48872834", "text": "func GetSignIn(uri string, params map[string]string) string {\n\tv := url.Values{}\n\n\tfor key, val := range params {\n\t\tv.Set(key, val)\n\t}\n\n\treturn uri + \"?\" + v.Encode()\n}", "title": "" } ]
bd62b2f5943e13e0ae3a49c931a6b61e
UnMute unmutes the audio playback.
[ { "docid": "c9f25b2079fd46662d836555316f80df", "score": "0.7723857", "text": "func (c *Camera) UnMute() (response *EventStreamResponse, err error) {\n\tpayload := EventStreamPayload{\n\t\tAction: \"set\",\n\t\tResource: fmt.Sprintf(\"cameras/%s\", c.DeviceId),\n\t\tPublishResponse: true,\n\t\tProperties: SpeakerProperties{\n\t\t\tSpeaker: VolumeProperties{\n\t\t\t\tMute: false,\n\t\t\t},\n\t\t},\n\t\tFrom: fmt.Sprintf(\"%s_%s\", c.UserId, TransIdPrefix),\n\t\tTo: c.ParentId,\n\t}\n\n\tmsg := \"failed to un-mute audio\"\n\n\tb := c.arlo.Basestations.Find(c.ParentId)\n\tif b == nil {\n\t\terr := fmt.Errorf(\"basestation (%s) not found for camera (%s)\", c.ParentId, c.DeviceId)\n\t\treturn nil, errors.WithMessage(err, msg)\n\t}\n\treturn b.makeEventStreamRequest(payload, msg)\n}", "title": "" } ]
[ { "docid": "5ba0ae25ef69d9ac6bdbe039f679bd51", "score": "0.82707953", "text": "func UnMute() {\n\tlock.Lock()\n\tif muted {\n\t\tsetVolume(current)\n\t\tmuted = false\n\t}\n\tlock.Unlock()\n}", "title": "" }, { "docid": "e485e47fe558a772c40cdc9b4f7711f7", "score": "0.76980525", "text": "func (s *Sender) Unmute() {\n\ts.r.SetVolume(&ReceiverVolume{Muted: false})\n}", "title": "" }, { "docid": "6816c89d93faf6a79a08fc63d0599d4d", "score": "0.7372478", "text": "func (l *Logger) Unmute() {\n\tif l == nil {\n\t\t// Logs are not activated.\n\t\treturn\n\t}\n\n\tatomic.StoreInt32(&l.muted, 0)\n}", "title": "" }, { "docid": "b0d877f3c192ca8b7a52b94485acc2df", "score": "0.7032645", "text": "func (a *App) UnMute() {\n\ta.logLevel.SetLevel(zapcore.DebugLevel)\n}", "title": "" }, { "docid": "ef79f03a13138c938b18f4c99ffc78d3", "score": "0.6920668", "text": "func (a *LogAggregator) Unmute() {\n\tif a == nil {\n\t\t// Logs are not activated.\n\t\treturn\n\t}\n\tatomic.StoreInt32(&a.muted, 0)\n}", "title": "" }, { "docid": "5ca6e2685e988d0b741c3e9cf0aafea5", "score": "0.6900826", "text": "func (user *User) Unmute(opt muteOption) error {\n\tif opt == MuteAll {\n\t\terr := user.muteOrUnmute(MuteStory, urlUserUnmute)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\ttime.Sleep(100 * time.Millisecond)\n\t\treturn user.muteOrUnmute(MutePosts, urlUserUnmute)\n\t}\n\treturn user.muteOrUnmute(opt, urlUserUnmute)\n}", "title": "" }, { "docid": "61c71f9069eb7d6e131385cef3b58e63", "score": "0.6657328", "text": "func (h *VolumeEventHandler) unmuted(redis RedisSetter, msg pubsub.Message) error {\n\tif err := redis.Set(\"fm:player:mute\", false, 0).Err(); err != nil {\n\t\treturn err\n\t}\n\tlgcy, err := json.Marshal(&LegacyMuteEventBody{\n\t\tEvent: LegacyMuteChangedEvent,\n\t\tMute: false,\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\toutC <- pubsub.Message{\n\t\tTopic: LegacyEvents,\n\t\tPayload: lgcy,\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8dd969531b2b938d312952a002974a73", "score": "0.6536992", "text": "func (s *ModerationService) Unmute(ctx context.Context, subreddit string, username string) (*Response, error) {\n\treturn s.deleteRelationship(ctx, subreddit, username, \"muted\")\n}", "title": "" }, { "docid": "4647f525aa8537ca374e90d6afd91f35", "score": "0.6359673", "text": "func SidetoneUnmute(inputdevice, cardnumber string) error {\n\targs := []string{\"amixer\", \"-c\", cardnumber, \"set\", inputdevice, \"unmute\"}\n\t_, err := execCmd(args)\n\treturn err\n}", "title": "" }, { "docid": "c6e6a6258d5f1dae687140fbd3354854", "score": "0.6305001", "text": "func Unmute(outputdevice string) error {\n\t_, err := execCmd(unmuteCmd(outputdevice))\n\treturn err\n}", "title": "" }, { "docid": "16c2a4ade6fd66e6016abade4fa7de7f", "score": "0.62296456", "text": "func (a *Amp60) SetMute(ctx context.Context, block string, muted bool) error {\n\t// open a connection with the dsp, set the muted status on block...\n\tmutedString := \"0\"\n\tif muted {\n\t\tmutedString = \"1\"\n\t}\n\t_, err := a.sendReq(ctx, fmt.Sprintf(\"deviceaudio_set&609=%v\", mutedString))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to set muted: %w\", err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "63e0c0df46f6ae4a67d2bb766f98fd0b", "score": "0.607466", "text": "func PulseUnmute(sinkId string) error {\n\targs := []string{\"pacmd\", \"set-sink-input-mute\", sinkId, \"false\"}\n\t_, err := execCmd(args)\n\treturn err\n}", "title": "" }, { "docid": "966bdece9ee1ff10b38eb2123ab9bb35", "score": "0.5998591", "text": "func (dra *DRA) SetMute(value bool) error {\n\tif value {\n\t\treturn dra.Send(\"MU\", \"ON\")\n\t}\n\treturn dra.Send(\"MU\", \"OFF\")\n}", "title": "" }, { "docid": "26cddfa46461bc51ae903f235c67d7dd", "score": "0.5998125", "text": "func Unmute(ctx Context) {\n\n\t// Delete command message\n\tDeleteMessageWithTime(ctx, ctx.Event.Message.ID, 0)\n\n\t// Fetch guild information\n\tg, err := UnpackGuildStruct(ctx.Guild.ID)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\n\t// Check if the guild role is set\n\tif g.MutedRole == nil {\n\t\tctx.Session.ChannelMessageSend(ctx.Channel.ID, fmt.Sprintf(\"❌ | You do not have a muted role set up! Please configure one using `%sset muted role%s<@Role|Name|ID>`\", g.GuildPrefix, commands[\"set\"].ArgsDelim))\n\t\treturn\n\t}\n\n\t// Check to see if the set guild role exists / still exists within the context of the guild (in case of deletion, etc.)\n\trole, err := ctx.Session.State.Role(ctx.Guild.ID, g.MutedRole.ID)\n\n\tif err != nil {\n\t\tlog.Println(err)\n\t\tctx.Session.ChannelMessageSend(ctx.Channel.ID, \"❌ | There was an error with the set Muted Role. Perhaps it has been changed since the last time it was configured.\")\n\t\treturn\n\t}\n\n\t// Fetch users from message content, returns list of members and the remaining string with the member removed\n\tmembers, reason := FetchMessageContentUsersString(ctx, strings.Join(ctx.Args, ctx.Command.ArgsDelim))\n\n\t// Retuns if a user cannot be found in the message, deletes delayed response\n\tif len(members) == 0 {\n\t\tmsg, err := ctx.Session.ChannelMessageSend(ctx.Channel.ID, \"❌ | I cannot find that user!\")\n\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\n\t\tDeleteMessageWithTime(ctx, msg.ID, 7500)\n\t\treturn\n\t}\n\n\t// If no reason is specified, set one for the database logger\n\tif len(reason) == 0 {\n\t\treason = \"N/A\"\n\t}\n\n\t// Bans all members found within the message, logs warning to redis database\n\tfor _, member := range members {\n\n\t\t// Target username\n\t\ttarget := member.Username + \"#\" + member.Discriminator\n\n\t\t// Author username\n\t\tauthor := ctx.Event.Message.Author.Username + \"#\" + ctx.Event.Message.Author.Discriminator\n\n\t\t// Creates DM channel between bot and target\n\t\tchannel, err := ctx.Session.UserChannelCreate(member.ID)\n\n\t\tif err != nil {\n\t\t\tlog.Println(err)\n\t\t}\n\n\t\t// Sends mute message to channel the command was instantiated in\n\t\tif err == nil {\n\t\t\tctx.Session.ChannelMessageSend(ctx.Channel.ID, fmt.Sprintf(\"`%s` has been unmuted by `%s`\", target, author))\n\t\t}\n\n\t\terr = ctx.Session.GuildMemberRoleAdd(ctx.Guild.ID, member.ID, role.ID)\n\n\t\tif err != nil {\n\t\t\tlog.Println(err)\n\t\t\tctx.Session.ChannelMessageSend(ctx.Channel.ID, \"❌ | An error has occured!\")\n\t\t\tbreak\n\t\t}\n\n\t\tif g.ModerationLogsChannel != nil {\n\t\t\tctx.Session.ChannelMessageSendEmbed(g.ModerationLogsChannel.ID,\n\t\t\t\tNewEmbed().\n\t\t\t\t\tSetTitle(\"Member Unmute\").\n\t\t\t\t\tSetColor(unmuteColor).\n\t\t\t\t\tSetAuthor(fmt.Sprintf(\"%s#%s / %s\", member.Username, member.Discriminator, member.ID), member.AvatarURL(\"256\"), member.AvatarURL(\"2048\")).\n\t\t\t\t\tAddField(\"Author\", fmt.Sprintf(\"%s#%s / %s\", ctx.Event.Author.Username, ctx.Event.Author.Discriminator, ctx.Event.Author.ID)).\n\t\t\t\t\tAddField(\"Channel\", fmt.Sprintf(\"<#%s>\", ctx.Channel.ID)).\n\t\t\t\t\tAddField(\"Reason\", reason).\n\t\t\t\t\tSetTimestamp(time.Now().Format(time.RFC3339)).MessageEmbed)\n\t\t}\n\n\t\ttr := fmt.Sprintf(\"with reason `%s`\", reason)\n\t\tif reason == \"N/A\" {\n\t\t\ttr = \"without a reason\"\n\t\t}\n\n\t\t// Sends a DM to the user with the unmute information if the user can accept DMs\n\t\tctx.Session.ChannelMessageSend(channel.ID, fmt.Sprintf(\"You have been unmuted by `%s` %s.\", author, tr))\n\t}\n\n}", "title": "" }, { "docid": "a478e2d5f7ae2b6f6e239bc3907a5e6e", "score": "0.5896633", "text": "func Mute() {\n\tlock.Lock()\n\tif !muted {\n\t\tsetVolume(0) // OS specific function call\n\t\tmuted = true\n\t}\n\tlock.Unlock()\n}", "title": "" }, { "docid": "f712289c8087e9383251984a510b56ca", "score": "0.5847612", "text": "func (m *Module) SetMuted(muted bool) {\n\tvol, _ := m.currentVolume.Get()\n\tif vol == nil {\n\t\treturn\n\t}\n\n\tv := vol.(Volume)\n\tif v.Mute == muted {\n\t\treturn\n\t}\n\n\tif err := m.impl.setMuted(muted); err != nil {\n\t\tl.Log(\"Error updating mute state: %v\", err)\n\t} else {\n\t\tv.Mute = muted\n\t\tm.currentVolume.Set(v)\n\t}\n}", "title": "" }, { "docid": "d606dfa1e2b614d2cd02e29ca1db4419", "score": "0.5810292", "text": "func (m *MuteManager) PermaUnmuteChannel(channelID string) {\n\tm.Lock()\n\tdefer m.Unlock()\n\tdelete(m.channelMute, channelID)\n}", "title": "" }, { "docid": "94b884455f12940ea6ad60d36fcb0bf4", "score": "0.5760018", "text": "func SidetoneMute(inputdevice, cardnumber string) error {\n\targs := []string{\"amixer\", \"-c\", cardnumber, \"set\", inputdevice, \"mute\"}\n\t_, err := execCmd(args)\n\treturn err\n}", "title": "" }, { "docid": "0ef25394a76aaba63f1cac6bad3c25f6", "score": "0.57423794", "text": "func (i *ITunes) Mute(val bool) error {\n\tif _, err := i.obj.PutProperty(\"Mute\", val); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fc4a11be1121c11de15a2ab979dd917b", "score": "0.56832874", "text": "func (h *VolumeEventHandler) muted(redis RedisSetter, msg pubsub.Message) error {\n\tif err := redis.Set(\"fm:player:mute\", true, 0).Err(); err != nil {\n\t\treturn err\n\t}\n\tlgcy, err := json.Marshal(&LegacyMuteEventBody{\n\t\tEvent: LegacyMuteChangedEvent,\n\t\tMute: true,\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\toutC <- pubsub.Message{\n\t\tTopic: LegacyEvents,\n\t\tPayload: lgcy,\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8783e3e9d18c599ea03332c079646a4a", "score": "0.56215787", "text": "func (music *MusicSystem) SetMute(mute bool) error {\n\tvar ferr C.FMOD_RESULT\n\tbase.Thread(func() {\n\t\tferr = C.FMOD_MusicSystem_SetMute(music.system, makeFmodBool(mute))\n\t})\n\treturn base.ResultToError(ferr)\n}", "title": "" }, { "docid": "f440a5cade14b86bb54ce35c9f6d8359", "score": "0.56180227", "text": "func (dsp *KramerAFM20DSP) SetMute(ctx context.Context, block string, mute bool) error {\n\tdsp.Log.Infof(\"sending set muteStatus command\", zap.String(\"block\", block), zap.Bool(\"status\", mute))\n\n\tvar cmd []byte\n\tif mute {\n\t\tcmd = []byte(fmt.Sprintf(\"#X-MUTE OUT.ANALOG_AUDIO.%s.AUDIO.1, ON\\r\", block))\n\t} else {\n\t\tcmd = []byte(fmt.Sprintf(\"#X-MUTE OUT.ANALOG_AUDIO.%s.AUDIO.1, OFF\\r\", block))\n\t}\n\tresp, err := dsp.SendCommand(ctx, cmd)\n\tif err != nil {\n\t\tdsp.Log.Errorf(\"error sending command: %s\", err.Error())\n\t\treturn fmt.Errorf(\"error sending command: %w\", err)\n\t}\n\n\tresps := string(resp)\n\tif strings.Contains(resps, \"ERR\") {\n\t\treturn fmt.Errorf(\"an error occured: (command: %s) response: %s)\", cmd, resps)\n\t}\n\n\tdsp.Log.Infof(\"successfully set mute status\", zap.String(\"block\", block), zap.Bool(\"status\", mute))\n\n\treturn nil\n}", "title": "" }, { "docid": "8661e8b727409225cd664e7dd76d2e4d", "score": "0.56087554", "text": "func (c *Client) SetMute(value interface{}) error {\n\treturn c.SetProperty(\"mute\", value)\n}", "title": "" }, { "docid": "0f7950a8479edfd0736aab2a782a3152", "score": "0.5595285", "text": "func (s *Session) SendUnmute(nick string) error {\n\tm := messageOut{Data: nick}\n\treturn s.send(m, \"UNMUTE\")\n}", "title": "" }, { "docid": "94e6b624a06a2a4a1dfb9b1d43922b1d", "score": "0.55278295", "text": "func PulseMute(sinkId string) error {\n\targs := []string{\"pacmd\", \"set-sink-input-mute\", sinkId, \"true\"}\n\t_, err := execCmd(args)\n\treturn err\n}", "title": "" }, { "docid": "7bd1b31ab140b615e688f6ab63ca7f60", "score": "0.55215234", "text": "func (m *MuteManager) UnmuteChannel(channelID string) {\n\tm.Lock()\n\tdefer m.Unlock()\n\tdelete(m.stopMute, channelID)\n}", "title": "" }, { "docid": "8a821eddf9d577380cd548062276d323", "score": "0.5492509", "text": "func (s *Sender) Mute() {\n\ts.r.SetVolume(&ReceiverVolume{Muted: true})\n}", "title": "" }, { "docid": "3276440ca96544ea6f9488db3623d169", "score": "0.5451685", "text": "func (d *Device) SetMute(mute bool) (err error) {\n\tparams := map[string]interface{}{\"enable\": mute}\n\tresp, err := d.requestWithParams(\"GET\", \"main/setMute\", params)\n\tif err == nil {\n\t\t_, err = decodeResponse(resp)\n\t}\n\n\treturn err\n}", "title": "" }, { "docid": "4618ec5b00f6ded61952726a2983f170", "score": "0.5402108", "text": "func UnmuteChannel(signal int) error {\n\tif signal != SignalWakeGC {\n\t\treturn fmt.Errorf(\"Signal number not supported: %d\", signal)\n\t}\n\t// See comment in MuteChannel().\n\tif events != nil {\n\t\tevents.Resume()\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b8689332519e0403ef5ece885cd67a12", "score": "0.537319", "text": "func (g *GroupCall) SetUnmutedVideoCount(value int) {\n\tg.Flags.Set(10)\n\tg.UnmutedVideoCount = value\n}", "title": "" }, { "docid": "613bbc71b094cd35d554be3a4b683de6", "score": "0.5311728", "text": "func (o *SetOptionsActionAllOf) UnsetSilent() {\n\to.Silent.Unset()\n}", "title": "" }, { "docid": "6baa07f953d6c93cba5797715d06c48e", "score": "0.5280397", "text": "func (vsdsp *KramerVP558) SetMute(ctx context.Context, block string, muted bool) error {\n\tvsdsp.Log.Infof(\"sending set muteStatus command\", zap.String(\"block\", block), zap.Bool(\"status\", muted))\n\n\t//cheack to see if the mute status is going to be changing\n\tcurrentStatus, err := vsdsp.Mutes(ctx, []string{block})\n\tif err != nil {\n\t\tvsdsp.Log.Errorf(\"error sending command: %s\", err.Error())\n\t\treturn fmt.Errorf(\"error sending command: %w\", err)\n\t}\n\t//if there is a change, two responses will be sent and both need to be read\n\treadAgain := false\n\tif currentStatus[block] != muted {\n\t\treadAgain = true\n\t}\n\n\tvar cmd []byte\n\tif muted {\n\t\tcmd = []byte(fmt.Sprintf(\"#MUTE %s,1\\r\", block))\n\t} else {\n\t\tcmd = []byte(fmt.Sprintf(\"#MUTE %s,0\\r\", block))\n\t}\n\tresp, err := vsdsp.SendCommand(ctx, cmd, readAgain)\n\tif err != nil {\n\t\tvsdsp.Log.Errorf(\"error sending command: %s\", err.Error())\n\t\treturn fmt.Errorf(\"error sending command: %w\", err)\n\t}\n\n\tresps := string(resp)\n\tif strings.Contains(resps, \"ERR\") {\n\t\treturn fmt.Errorf(\"an error occured: (command: %s) response: %s)\", cmd, resps)\n\t}\n\n\tvsdsp.Log.Infof(\"successfully set mute status\", zap.String(\"block\", block), zap.Bool(\"status\", muted))\n\n\treturn nil\n}", "title": "" }, { "docid": "55c053d6b521606af0ce85cb68ada5f3", "score": "0.5259054", "text": "func (client *Client) UnmuteAlerts() error {\n\treturn client.doJsonRequest(\"POST\", \"/v1/unmute_alerts\", nil, nil)\n}", "title": "" }, { "docid": "929115517b6793873624d4afe82c7683", "score": "0.5227876", "text": "func Muted(v interface{}) gr.Modifier {\n\treturn gr.Prop(\"muted\", v)\n}", "title": "" }, { "docid": "180a4e61e53a667c29ff54e923f509e0", "score": "0.5172146", "text": "func (h *LegacyEventHandler) setMute(payload []byte) error {\n\tevent := &LegacyMuteEventBody{}\n\tif err := json.Unmarshal(payload, event); err != nil {\n\t\treturn err\n\t}\n\ttopic := VolumeMuteEvent\n\tif !event.Mute {\n\t\ttopic = VolumeUnMuteEvent\n\t}\n\tpayload, err := json.Marshal(&Event{\n\t\tTopic: topic,\n\t\tCreated: time.Now().UTC(),\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\toutC <- pubsub.Message{\n\t\tTopic: topic,\n\t\tPayload: payload,\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "edc40e786d2bf2f5691860d50d47aa93", "score": "0.5143299", "text": "func Stop() { // {{{\n\taudiohandler.playing = false\n}", "title": "" }, { "docid": "dbf6d019d1b1336e9ef34c6487ff0877", "score": "0.51375085", "text": "func (_SaleClockAuction *SaleClockAuctionTransactor) Unpause(opts *bind.TransactOpts) (*types.Transaction, error) {\n\treturn _SaleClockAuction.contract.Transact(opts, \"unpause\")\n}", "title": "" }, { "docid": "d89f937f9c44058bc2d3f393eac8b53a", "score": "0.5062091", "text": "func (_SaleClockAuction *SaleClockAuctionTransactorSession) Unpause() (*types.Transaction, error) {\n\treturn _SaleClockAuction.Contract.Unpause(&_SaleClockAuction.TransactOpts)\n}", "title": "" }, { "docid": "864184d144dad9efb9065fcb42ed1ca1", "score": "0.505556", "text": "func (m *AndroidDeviceOwnerGeneralDeviceConfiguration) SetMicrophoneForceMute(value *bool)() {\n err := m.GetBackingStore().Set(\"microphoneForceMute\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "7326d7fed9588565e856cd70006a40c6", "score": "0.5000914", "text": "func (_SaleClockAuction *SaleClockAuctionSession) Unpause() (*types.Transaction, error) {\n\treturn _SaleClockAuction.Contract.Unpause(&_SaleClockAuction.TransactOpts)\n}", "title": "" }, { "docid": "647cac4871f7bf33e1fc8208f4c7bb70", "score": "0.49844664", "text": "func (_SiringClockAuction *SiringClockAuctionTransactor) Unpause(opts *bind.TransactOpts) (*types.Transaction, error) {\n\treturn _SiringClockAuction.contract.Transact(opts, \"unpause\")\n}", "title": "" }, { "docid": "2682b99ec0840be131647c672f2e1703", "score": "0.49578834", "text": "func (am *Alertmanager) DelSilence(at float64, sil *TestSilence) {\n\tam.t.Do(at, func() {\n\t\treq, err := http.NewRequest(\"DELETE\", am.getURL(fmt.Sprintf(\"/api/v1/silence/%s\", sil.ID())), nil)\n\t\tif err != nil {\n\t\t\tam.t.Errorf(\"Error deleting silence %v: %s\", sil, err)\n\t\t\treturn\n\t\t}\n\n\t\tresp, err := http.DefaultClient.Do(req)\n\t\tif err != nil || resp.StatusCode/100 != 2 {\n\t\t\tam.t.Errorf(\"Error deleting silence %v: %s\", sil, err)\n\t\t\treturn\n\t\t}\n\t})\n}", "title": "" }, { "docid": "064cc336b6b33aa96e2406eed0020a2b", "score": "0.4941626", "text": "func (l *Logger) Mute() {\n\tif l == nil {\n\t\t// Logs are not activated.\n\t\treturn\n\t}\n\n\tatomic.StoreInt32(&l.muted, 1)\n}", "title": "" }, { "docid": "85782fb1c84ecfec15fc19353829dd87", "score": "0.4925681", "text": "func (b *Engine) Unpause(req bool, res *bool) (err error) {\n\t<-lock\n\treturn nil\n}", "title": "" }, { "docid": "b7c27d1875fd17470978c48299adc50d", "score": "0.49155748", "text": "func (user *User) Mute(opt muteOption) error {\n\tif opt == MuteAll {\n\t\terr := user.muteOrUnmute(MuteStory, urlUserMute)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\ttime.Sleep(100 * time.Millisecond)\n\t\treturn user.muteOrUnmute(MutePosts, urlUserMute)\n\t}\n\treturn user.muteOrUnmute(opt, urlUserMute)\n}", "title": "" }, { "docid": "a1fe9f4c7fdf5ba3a4cef2084acb2ba4", "score": "0.4899957", "text": "func (_SiringClockAuction *SiringClockAuctionTransactorSession) Unpause() (*types.Transaction, error) {\n\treturn _SiringClockAuction.Contract.Unpause(&_SiringClockAuction.TransactOpts)\n}", "title": "" }, { "docid": "4ad691ac4f6f0df8d680a9dfa78ec526", "score": "0.48917884", "text": "func SetMutePref(chatID string, pref bool) {\n\tw := &Welcome{ChatId: chatID}\n\ttx := SESSION.Begin()\n\ttx.FirstOrCreate(w)\n\tw.ShouldMute = pref\n\ttx.Save(w)\n\ttx.Commit()\n}", "title": "" }, { "docid": "c00897726b2863d65c0575d6476021cb", "score": "0.48628935", "text": "func (_SiringClockAuction *SiringClockAuctionSession) Unpause() (*types.Transaction, error) {\n\treturn _SiringClockAuction.Contract.Unpause(&_SiringClockAuction.TransactOpts)\n}", "title": "" }, { "docid": "5e973278a36d2549ab43dd3e5d709b74", "score": "0.4835688", "text": "func (c *Camera) Mute() (response *EventStreamResponse, err error) {\n\tpayload := EventStreamPayload{\n\t\tAction: \"set\",\n\t\tResource: fmt.Sprintf(\"cameras/%s\", c.DeviceId),\n\t\tPublishResponse: true,\n\t\tProperties: SpeakerProperties{\n\t\t\tSpeaker: VolumeProperties{\n\t\t\t\tMute: true,\n\t\t\t},\n\t\t},\n\t\tFrom: fmt.Sprintf(\"%s_%s\", c.UserId, TransIdPrefix),\n\t\tTo: c.ParentId,\n\t}\n\n\tmsg := \"failed to mute audio\"\n\n\tb := c.arlo.Basestations.Find(c.ParentId)\n\tif b == nil {\n\t\terr := fmt.Errorf(\"basestation (%s) not found for camera (%s)\", c.ParentId, c.DeviceId)\n\t\treturn nil, errors.WithMessage(err, msg)\n\t}\n\treturn b.makeEventStreamRequest(payload, msg)\n}", "title": "" }, { "docid": "2a481cebb361393e36d113b964f51e40", "score": "0.4823326", "text": "func (p *Player) Voldown() {\n\tspeaker.Lock()\n\tp.volume.Volume -= 0.1\n\tspeaker.Unlock()\n}", "title": "" }, { "docid": "97e9e044c598ff3b5128054068b60e4d", "score": "0.4822542", "text": "func (_Gods *GodsTransactor) Unpause(opts *bind.TransactOpts) (*types.Transaction, error) {\n\treturn _Gods.contract.Transact(opts, \"unpause\")\n}", "title": "" }, { "docid": "c8c071e6750eba521d46a35e0fff333e", "score": "0.4821112", "text": "func (m *MuteManager) PermaMuteChannel(channelID string) {\n\tm.Lock()\n\tdefer m.Unlock()\n\tm.channelMute[channelID] = true\n}", "title": "" }, { "docid": "8cdfdfa8baf00e606d7f8e02644d8cea", "score": "0.4812515", "text": "func (_Pausable *PausableTransactorSession) Unpause() (*types.Transaction, error) {\n\treturn _Pausable.Contract.Unpause(&_Pausable.TransactOpts)\n}", "title": "" }, { "docid": "8cdfdfa8baf00e606d7f8e02644d8cea", "score": "0.48118454", "text": "func (_Pausable *PausableTransactorSession) Unpause() (*types.Transaction, error) {\n\treturn _Pausable.Contract.Unpause(&_Pausable.TransactOpts)\n}", "title": "" }, { "docid": "b59f98a5127856329e2acf2247533d95", "score": "0.48089522", "text": "func NewMuteManager() *MuteManager {\n\treturn &MuteManager{\n\t\tstopMute: make(map[string]time.Time),\n\t\tchannelMute: make(map[string]bool),\n\t}\n}", "title": "" }, { "docid": "fe02564ffff97f1db14fbedfce878eaf", "score": "0.47878888", "text": "func (v *Voice) Detach() {\n\tC.al_detach_voice((*C.ALLEGRO_VOICE)(v))\n}", "title": "" }, { "docid": "d54985041b138df1d68af79ede5880f0", "score": "0.4746837", "text": "func (_Gods *GodsTransactorSession) Unpause() (*types.Transaction, error) {\n\treturn _Gods.Contract.Unpause(&_Gods.TransactOpts)\n}", "title": "" }, { "docid": "3b74c3816d9d0a749d7a000c21cbfd2a", "score": "0.47457117", "text": "func (ab *AtomicBool) UnSet() {\n\tatomic.StoreInt32((*int32)(ab), 0)\n}", "title": "" }, { "docid": "1172a87d926030cdadeb9fc30014b8e2", "score": "0.47408608", "text": "func (_Token *TokenTransactor) Unpause(opts *bind.TransactOpts) (*types.Transaction, error) {\n\treturn _Token.contract.Transact(opts, \"unpause\")\n}", "title": "" }, { "docid": "cb71d931f8ed1757b835522c11fed740", "score": "0.47297558", "text": "func Unblock() {\n\tvch <- vunblock{}\n}", "title": "" }, { "docid": "ef0f74f918e8b6342de721f42eedee4f", "score": "0.47251302", "text": "func (s *Bits) Unset(index uint) {\n\t*s &= ^(1 << index)\n}", "title": "" }, { "docid": "f11d9c081da5934165cb8589037acdf7", "score": "0.47237092", "text": "func (g *GroupCall) SetJoinMuted(value bool) {\n\tif value {\n\t\tg.Flags.Set(1)\n\t\tg.JoinMuted = true\n\t} else {\n\t\tg.Flags.Unset(1)\n\t\tg.JoinMuted = false\n\t}\n}", "title": "" }, { "docid": "843a76aac63524c863ca6f24e1b7cccb", "score": "0.4720881", "text": "func (_Pausable *PausableSession) Unpause() (*types.Transaction, error) {\n\treturn _Pausable.Contract.Unpause(&_Pausable.TransactOpts)\n}", "title": "" }, { "docid": "8e50d370167c44f388ea2317cdf16928", "score": "0.4719993", "text": "func (*ChannelAdminLogEventActionParticipantMute) TypeName() string {\n\treturn \"channelAdminLogEventActionParticipantMute\"\n}", "title": "" }, { "docid": "843a76aac63524c863ca6f24e1b7cccb", "score": "0.47191754", "text": "func (_Pausable *PausableSession) Unpause() (*types.Transaction, error) {\n\treturn _Pausable.Contract.Unpause(&_Pausable.TransactOpts)\n}", "title": "" }, { "docid": "acc37427365b2908e55d3beb52c22565", "score": "0.47169083", "text": "func (_Pausable *PausableTransactor) Unpause(opts *bind.TransactOpts) (*types.Transaction, error) {\n\treturn _Pausable.contract.Transact(opts, \"unpause\")\n}", "title": "" }, { "docid": "acc37427365b2908e55d3beb52c22565", "score": "0.47164804", "text": "func (_Pausable *PausableTransactor) Unpause(opts *bind.TransactOpts) (*types.Transaction, error) {\n\treturn _Pausable.contract.Transact(opts, \"unpause\")\n}", "title": "" }, { "docid": "a36ffe6a704ec3ec4e6af96c2f51771f", "score": "0.47154012", "text": "func (_RepublicToken *RepublicTokenTransactor) Unpause(opts *bind.TransactOpts) (*types.Transaction, error) {\n\treturn _RepublicToken.contract.Transact(opts, \"unpause\")\n}", "title": "" }, { "docid": "8d0f8741b5594ed0bbb18843f3d5c74d", "score": "0.47148627", "text": "func (c *Client) Mute() (prop interface{}, err error) {\n\treturn c.GetProperty(\"mute\")\n}", "title": "" }, { "docid": "ff7627d317c92c31fd4df1cd1d65e3b9", "score": "0.4684853", "text": "func (*ChannelAdminLogEventActionParticipantUnmute) TypeName() string {\n\treturn \"channelAdminLogEventActionParticipantUnmute\"\n}", "title": "" }, { "docid": "a5b61ebf4dbe018b08e9190b0fd7ec18", "score": "0.46782514", "text": "func (i *XdgToplevel) UnsetFullscreen() error {\n\terr := i.Context().SendRequest(i, 12)\n\treturn err\n}", "title": "" }, { "docid": "d91e75de83f4dddc4fcde10b417fe916", "score": "0.466852", "text": "func (s *Service) VolumeDecreaseSoundbox(increaseBy uint64) {\n\tsendMessageDefault(*s.url, s.password, soundBarDecreaseSoundCode, soundBarType, tvPowerCodeLength, &increaseBy)\n}", "title": "" }, { "docid": "d6af7736c8459c9e16f9a3b495547f4b", "score": "0.4664008", "text": "func (_RepublicToken *RepublicTokenTransactorSession) Unpause() (*types.Transaction, error) {\n\treturn _RepublicToken.Contract.Unpause(&_RepublicToken.TransactOpts)\n}", "title": "" }, { "docid": "4a367e84a3d4ad164cad978f09f4fd71", "score": "0.4640397", "text": "func (_Token *TokenTransactorSession) Unpause() (*types.Transaction, error) {\n\treturn _Token.Contract.Unpause(&_Token.TransactOpts)\n}", "title": "" }, { "docid": "d796efd227405ff9dfaa34ccc20a105b", "score": "0.4638802", "text": "func (c *Command) DisablePowerManagement() {\n\tcmd := exec.Command(\"iw\", \"uap0\", \"set\", \"power_save\", \"off\")\n\tcmd.Start()\n\tcmd.Wait()\n}", "title": "" }, { "docid": "1c9777815991d03a62512a8591dde807", "score": "0.46218428", "text": "func (_Gods *GodsSession) Unpause() (*types.Transaction, error) {\n\treturn _Gods.Contract.Unpause(&_Gods.TransactOpts)\n}", "title": "" }, { "docid": "33fd02279851190265abe0fdeb3152e6", "score": "0.46203113", "text": "func (_PausableToken *PausableTokenTransactorSession) Unpause() (*types.Transaction, error) {\n\treturn _PausableToken.Contract.Unpause(&_PausableToken.TransactOpts)\n}", "title": "" }, { "docid": "33fd02279851190265abe0fdeb3152e6", "score": "0.46171486", "text": "func (_PausableToken *PausableTokenTransactorSession) Unpause() (*types.Transaction, error) {\n\treturn _PausableToken.Contract.Unpause(&_PausableToken.TransactOpts)\n}", "title": "" }, { "docid": "ec1bc23df1105b340b244a571de58179", "score": "0.46143794", "text": "func (p *Player) Stop() {\n\tp.playing = false\n}", "title": "" }, { "docid": "3751bc6ce1a4cf13eaa9141918937dbe", "score": "0.45945552", "text": "func (index SoundIndex) Stop() {\n\tif disableAudio {\n\t\treturn\n\t}\n\tif index == sndUndefined {\n\t\tpanic(\"Cannot stop sound if not set\")\n\t}\n\tsound := &soundManager.assetList[index]\n\tif sound.audioPlayer == nil {\n\t\tpanic(\"Sound isn't loaded\")\n\t}\n\tsound.audioPlayer.Pause()\n}", "title": "" }, { "docid": "52e30010d9463f926f91340641ca1c41", "score": "0.45854363", "text": "func (p *PlaybackStream) Stop() {\n\tif p.state == running || p.state == paused {\n\t\tp.state = idle\n\t}\n}", "title": "" }, { "docid": "619633fb80dc392577de0c5dcb719748", "score": "0.45798227", "text": "func (s *Session) SendMute(nick string, duration time.Duration) error {\n\tm := muteOut{Data: nick}\n\tif duration > 0 {\n\t\tm.Duration = int64(duration)\n\t}\n\treturn s.send(m, \"MUTE\")\n}", "title": "" }, { "docid": "cdbab3baf2d5376c9d726622aed86b6e", "score": "0.45664638", "text": "func (_RepublicToken *RepublicTokenSession) Unpause() (*types.Transaction, error) {\n\treturn _RepublicToken.Contract.Unpause(&_RepublicToken.TransactOpts)\n}", "title": "" }, { "docid": "89d28e757072a41326c0c3c55e05d230", "score": "0.45655543", "text": "func (d *Device) PowerOff() (err error) {\n\tresp, err := d.requestWithParams(\"GET\", \"main/setPower\", map[string]interface{}{\n\t\t\"power\": \"standby\",\n\t})\n\tif err == nil {\n\t\t_, err = decodeResponse(resp)\n\t}\n\n\treturn err\n}", "title": "" }, { "docid": "dde34cd91615fff5ecd9507f6b9b9df4", "score": "0.45620286", "text": "func (s *Session) Mute(opts *MuteOptions) (*Project, error) {\n\treturn s.MuteContext(context.Background(), opts)\n}", "title": "" }, { "docid": "370718cd1116c52ae38d76c15e8e609c", "score": "0.45510587", "text": "func (_PrivatePlacement *PrivatePlacementTransactorSession) Unpause() (*types.Transaction, error) {\n\treturn _PrivatePlacement.Contract.Unpause(&_PrivatePlacement.TransactOpts)\n}", "title": "" }, { "docid": "834b3987310cac1fe59124352a8b5d2e", "score": "0.45478278", "text": "func (b *Tribool) Unset() {\n\t*b = Indeterminate\n}", "title": "" }, { "docid": "25a2004260925f17f53357cde8596643", "score": "0.45473376", "text": "func (_PrivatePlacement *PrivatePlacementTransactor) Unpause(opts *bind.TransactOpts) (*types.Transaction, error) {\n\treturn _PrivatePlacement.contract.Transact(opts, \"unpause\")\n}", "title": "" }, { "docid": "1c720533e5ff8b22e7919db4d4ef66f3", "score": "0.45413342", "text": "func (s *Switch) TurnOff() error {\n\treturn s.setState(off)\n}", "title": "" }, { "docid": "f82ae3c2b56669821f0ada9ba4c1f6c1", "score": "0.45407134", "text": "func (_Token *TokenSession) Unpause() (*types.Transaction, error) {\n\treturn _Token.Contract.Unpause(&_Token.TransactOpts)\n}", "title": "" }, { "docid": "a714ec9c7e3719363bfc7e27c2f96e65", "score": "0.45387334", "text": "func (_PausableToken *PausableTokenSession) Unpause() (*types.Transaction, error) {\n\treturn _PausableToken.Contract.Unpause(&_PausableToken.TransactOpts)\n}", "title": "" }, { "docid": "6bafc3395fa418e0ae3bbac4d9fa8312", "score": "0.4536933", "text": "func (_PausableToken *PausableTokenTransactor) Unpause(opts *bind.TransactOpts) (*types.Transaction, error) {\n\treturn _PausableToken.contract.Transact(opts, \"unpause\")\n}", "title": "" }, { "docid": "a714ec9c7e3719363bfc7e27c2f96e65", "score": "0.45365903", "text": "func (_PausableToken *PausableTokenSession) Unpause() (*types.Transaction, error) {\n\treturn _PausableToken.Contract.Unpause(&_PausableToken.TransactOpts)\n}", "title": "" }, { "docid": "6bafc3395fa418e0ae3bbac4d9fa8312", "score": "0.45348412", "text": "func (_PausableToken *PausableTokenTransactor) Unpause(opts *bind.TransactOpts) (*types.Transaction, error) {\n\treturn _PausableToken.contract.Transact(opts, \"unpause\")\n}", "title": "" }, { "docid": "e74c50a2f7034d62942644da6445d7aa", "score": "0.45198926", "text": "func (s *Session) TurnOff(port uint8) error {\n\treturn s.DigitalWrite(port, 0)\n}", "title": "" }, { "docid": "af62c9577a3052cc9fae708371003920", "score": "0.45127726", "text": "func (s *StoreInfo) Unblock() {\n\ts.blocked = false\n}", "title": "" }, { "docid": "210fa8fced676eaae19f432c30979bff", "score": "0.44954354", "text": "func (o *UserTeamAttributes) UnsetRole() {\n\to.Role.Unset()\n}", "title": "" }, { "docid": "2d63fb99be084d5ae6827362f6874003", "score": "0.4485372", "text": "func (o *CIAppPipelineEventPipeline) UnsetIsResumed() {\n\to.IsResumed.Unset()\n}", "title": "" }, { "docid": "a36f24e123a4ff7af2a9b57b00452f12", "score": "0.4475097", "text": "func (_PrivatePlacement *PrivatePlacementSession) Unpause() (*types.Transaction, error) {\n\treturn _PrivatePlacement.Contract.Unpause(&_PrivatePlacement.TransactOpts)\n}", "title": "" }, { "docid": "87281c50af8d6d545ec85cbd9b380eba", "score": "0.44628376", "text": "func un(m *sync.Mutex) {\n\tm.Unlock()\n}", "title": "" } ]
8da689b3899ab185880c126213577c55
GetParams from a map & evaluate Gval expressions in it
[ { "docid": "c898ca5681db50922dbae22a89f9ced0", "score": "0.0", "text": "func GetParams(ctx *ctx.Ctx, config interface{}, params interface{}) bool {\n\tlog.Trace().Interface(\"in\", config).Msg(\"Params conversion\")\n\tc := mapstructure.DecoderConfig{\n\t\tDecodeHook: hookGval(ctx),\n\t\tZeroFields: false, // needed for 'default' field\n\t\tResult: params,\n\t}\n\tif decode, err := mapstructure.NewDecoder(&c); err != nil {\n\t\tlog.Error().Err(err).Msg(\"Decoder error\")\n\t\treturn false\n\t} else if err := decode.Decode(config); err != nil {\n\t\tlog.Error().Err(err).Msg(\"Incorrect fields\")\n\t\treturn false\n\t}\n\tlog.Trace().Interface(\"out\", params).Msg(\"Params conversion\")\n\treturn true\n}", "title": "" } ]
[ { "docid": "dd775a0b080c58763f1a51972028a710", "score": "0.6109922", "text": "func evalMap(mapRule map[string]interface{}, msg map[string]interface{}) (map[string]interface{}, error) {\n\tnt := make(map[string]interface{})\n\tfor k, _ := range mapRule {\n\t\tswitch c := mapRule[k].(type) {\n\t\tcase *jee.TokenTree:\n\t\t\te, err := jee.Eval(c, msg)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tSet(nt, k, e)\n\t\tcase map[string]interface{}:\n\t\t\te, err := evalMap(c, msg)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tmsg[k] = Set(nt, k, e)\n\t\t}\n\t}\n\treturn nt, nil\n}", "title": "" }, { "docid": "c221f3d43d3d6b293388e5cb823d71c9", "score": "0.5501326", "text": "func substituteParams(toReplace, words string, dicts map[string]interface{}) string {\n\t// non empty scalar node remain unchanged\n\t// except it has double chevron bracket\n\tif toReplace != \"\" && (strings.Index(toReplace, \"<<\") < 0 && strings.Index(toReplace, \">>\") < 0) {\n\t\treturn toReplace\n\t}\n\tif words == \"\" {\n\t\treturn toReplace\n\t}\n\n\tremoveParamBracket := func(param string) string {\n\t\tparam = strings.TrimSpace(param)\n\t\treturn param[2 : len(param)-2]\n\t}\n\n\t// search params\n\tparams := dcRe.FindAllString(words, -1)\n\n\t// substitute the params\n\tfor _, p := range params {\n\t\tpVal, ok := getParamValue(removeParamBracket(p), dicts)\n\t\tif !ok {\n\t\t\t// only replace if param is found\n\t\t\tcontinue\n\t\t}\n\t\twords = strings.Replace(words, p, pVal, -1)\n\t}\n\treturn words\n}", "title": "" }, { "docid": "98c3ee130edbeb53b429b29fcb6d6158", "score": "0.54579794", "text": "func getParams(regEx, url string) (paramsMap map[string]string) {\n\n\tvar compRegEx = regexp.MustCompile(regEx)\n\tmatch := compRegEx.FindStringSubmatch(url)\n\n\tparamsMap = make(map[string]string)\n\tfor i, name := range compRegEx.SubexpNames() {\n\t\tif i > 0 && i <= len(match) {\n\t\t\tparamsMap[name] = match[i]\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "2f06059ebfe94a1132901ee8c248eb3d", "score": "0.53796756", "text": "func substituteParameters(values map[string]string, entryPoint string) string {\n\tfor key, value := range values {\n\t\tentryPoint = strings.ReplaceAll(entryPoint, key, value)\n\t}\n\treturn entryPoint\n}", "title": "" }, { "docid": "c6846fbb86ad57f10ff6cd33b0bd462c", "score": "0.53663856", "text": "func getEvaluableParameters(asset interface{}) (map[string]interface{}, error) {\n\tif asset == nil || reflect.ValueOf(asset).Kind() != reflect.Ptr || reflect.ValueOf(asset).Elem().Kind() != reflect.Struct {\n\t\terr := errors.New(\"wrong parameter type: the 'asset' param has to be a struct instance pointer\")\n\t\tlogger.Error(err)\n\t\treturn nil, err\n\t}\n\n\tval := reflect.ValueOf(asset).Elem()\n\tlogger.Infof(\"getEvaluableParameters or struct %s\", val.Type())\n\n\tparameters := make(map[string]interface{}, 8)\n\tfor i := 0; i < val.NumField(); i++ {\n\t\tvalueField := val.Field(i)\n\t\ttypeField := val.Type().Field(i)\n\t\tparameters[typeField.Name] = valueField.Interface()\n\t}\n\n\treturn parameters, nil\n}", "title": "" }, { "docid": "4c27e93d9a9f5e2e4661a288e17fc5eb", "score": "0.5326614", "text": "func getPathParamMap(c *gin.Context) map[string]string {\n\tpm := make(map[string]string)\n\tfor _, p := range c.Params {\n\t\tpm[p.Key] = p.Value\n\t}\n\treturn pm\n}", "title": "" }, { "docid": "34cf125ff87d682e5d8e056a3c712253", "score": "0.53174144", "text": "func Params(ctx context.Context, ctxKey interface{}) map[string]string {\n\tif p, ok := ctx.Value(ctxKey).(map[string]string); ok {\n\t\treturn p\n\t}\n\treturn map[string]string{}\n}", "title": "" }, { "docid": "4ebd1c2db7781f1b88c0eb39e8d9b5af", "score": "0.52602446", "text": "func (e Entries) Params() *Map {\n\tp := NewMap()\n\tfor _, v := range e {\n\t\tvar (\n\t\t\tvalues = make(ValuesPromoted, 0)\n\t\t\turl = v.URL\n\t\t)\n\t\tfor k, v := range url.Query() {\n\t\t\tbytes, _ := json.Marshal(v)\n\t\t\tvalues[k] = ValuePromoted{\n\t\t\t\tValue: string(bytes),\n\t\t\t\tPromoted: isURLKey(url.Path, k, v),\n\t\t\t}\n\t\t}\n\t\tp.Add(values)\n\t}\n\treturn p\n}", "title": "" }, { "docid": "76888e8d1236b1b66ef0797a9f45fed2", "score": "0.52473915", "text": "func getValues(sigDef map[string]*tfpb.TensorInfo) map[string]models.OperationParam {\n\n\tparams := make(map[string]models.OperationParam)\n\tvar i = 0\n\tfor key, ins := range sigDef {\n\t\tvar p models.OperationParam\n\t\tp.Name = strings.Split(ins.GetName(), \":\")[0]\n\t\tp.Type = ins.GetDtype().String()\n\n\t\t// grab the shape\n\t\tfor _, dim := range ins.GetTensorShape().GetDim() {\n\t\t\tp.Shape = append(p.Shape, dim.GetSize())\n\t\t}\n\n\t\tparams[key] = p\n\t\ti++\n\t}\n\n\treturn params\n}", "title": "" }, { "docid": "76888e8d1236b1b66ef0797a9f45fed2", "score": "0.52473915", "text": "func getValues(sigDef map[string]*tfpb.TensorInfo) map[string]models.OperationParam {\n\n\tparams := make(map[string]models.OperationParam)\n\tvar i = 0\n\tfor key, ins := range sigDef {\n\t\tvar p models.OperationParam\n\t\tp.Name = strings.Split(ins.GetName(), \":\")[0]\n\t\tp.Type = ins.GetDtype().String()\n\n\t\t// grab the shape\n\t\tfor _, dim := range ins.GetTensorShape().GetDim() {\n\t\t\tp.Shape = append(p.Shape, dim.GetSize())\n\t\t}\n\n\t\tparams[key] = p\n\t\ti++\n\t}\n\n\treturn params\n}", "title": "" }, { "docid": "77944324c3e5e2602a3bd5cf7b203d5f", "score": "0.5231639", "text": "func (n Map) Expr() {}", "title": "" }, { "docid": "5a68c260fa48ab974b5c9edfc6da94fa", "score": "0.5226664", "text": "func interpolationFuncValues(vs map[string]ast.Variable) ast.Function {\n\treturn ast.Function{\n\t\tArgTypes: []ast.Type{ast.TypeMap},\n\t\tReturnType: ast.TypeList,\n\t\tCallback: func(args []interface{}) (interface{}, error) {\n\t\t\tmapVar := args[0].(map[string]ast.Variable)\n\t\t\tkeys := make([]string, 0)\n\n\t\t\tfor k, _ := range mapVar {\n\t\t\t\tkeys = append(keys, k)\n\t\t\t}\n\n\t\t\tsort.Strings(keys)\n\n\t\t\tvalues := make([]string, len(keys))\n\t\t\tfor index, key := range keys {\n\t\t\t\tif value, ok := mapVar[key].Value.(string); ok {\n\t\t\t\t\tvalues[index] = value\n\t\t\t\t} else {\n\t\t\t\t\treturn \"\", fmt.Errorf(\"values(): %q has element with bad type %s\",\n\t\t\t\t\t\tkey, mapVar[key].Type)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvariable, err := hil.InterfaceToVariable(values)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\treturn variable.Value, nil\n\t\t},\n\t}\n}", "title": "" }, { "docid": "87f0690e19873d2ee648c633faad3913", "score": "0.52116513", "text": "func Test0(par0 map[string]rune) {\n}", "title": "" }, { "docid": "216ec7bdf0d9101f0e9fec1c8903ff6c", "score": "0.52114743", "text": "func Params(gen *generator.Generator) map[string]string {\n\tparams := make(map[string]string)\n\n\tfor _, parameter := range strings.Split(gen.Request.GetParameter(), \",\") {\n\t\tkvp := strings.SplitN(parameter, \"=\", 2)\n\t\tif len(kvp) != 2 {\n\t\t\tcontinue\n\t\t}\n\n\t\tparams[kvp[0]] = kvp[1]\n\t}\n\n\treturn params\n}", "title": "" }, { "docid": "760e026acca2383dbcfe5ec3abeee886", "score": "0.5204531", "text": "func mapDataToParameters(tokens []string, data string) (map[string]string, error) {\n\tvalues := make(map[string]string)\n\tdata = strings.ReplaceAll(data, \"\\\\(\", \"(\")\n\tdata = strings.ReplaceAll(data, \"\\\\)\", \")\")\n\tif err := matchData(tokens, &data, &values); err != nil {\n\t\treturn nil, err\n\t}\n\treturn values, nil\n}", "title": "" }, { "docid": "dd4ef8db4e85eab1892ac716307ab2f5", "score": "0.51919454", "text": "func (e *Environment) EvaluateWithParams(tpl string, data interface{}) (string, error) {\n\tt := template.New(\"test template\")\n\n\tt2, err := t.Parse(tpl)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tvar b bytes.Buffer\n\tif err = t2.Execute(&b, data); err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn b.String(), nil\n}", "title": "" }, { "docid": "4fde70e1ab5d4fa43540d21428f112dc", "score": "0.5179866", "text": "func (e *Expr) evalMapKeys(sess *Session, env *values.Env, ident string, left, right []values.T, t *types.T, index map[int]int) (values.T, error) {\n\th := make(map[digest.Digest]int)\n\tn := len(left)\n\tk := make([]interface{}, n)\n\tfor i := 0; i < n; i++ {\n\t\tk[i] = tval{t, left[i]}\n\t}\n\treturn e.k(sess, env, ident, func(vs []values.T) (values.T, error) {\n\t\tfor i, v := range vs {\n\t\t\th[values.Digest(v, t)] = i\n\t\t}\n\t\treturn e.evalMapKeysCompare(sess, env, ident, right, t, h, index, n)\n\t}, k...)\n}", "title": "" }, { "docid": "f5eb5db300145fd7fb5af237f6011342", "score": "0.51430494", "text": "func (variables *Variable) Evaluate(values map[string]interface{}) map[string]interface{} {\n\tresult := make(map[string]interface{}, variables.Len())\n\tvariables.ForEach(func(key string, value interface{}) {\n\t\tvalueString := types.ToString(value)\n\t\tcombined := generators.MergeMaps(values, result)\n\t\tif value, ok := combined[key]; ok {\n\t\t\tvalueString = types.ToString(value)\n\t\t}\n\t\tresult[key] = evaluateVariableValue(valueString, combined, result)\n\t})\n\treturn result\n}", "title": "" }, { "docid": "33ef328897053599676e58f73062a06f", "score": "0.5133692", "text": "func evaluate(selector string, parameters map[string]interface{}) (interface{}, error) {\n\tlogger.Infof(\"evaluate selector: %s\", selector)\n\texpression, err := govaluate.NewEvaluableExpression(selector)\n\n\tif err != nil {\n\t\tlogger.Error(err)\n\t\treturn nil, err\n\t}\n\n\tresult, err := expression.Evaluate(parameters)\n\tif err != nil {\n\t\tlogger.Error(err)\n\t}\n\n\treturn result, err\n}", "title": "" }, { "docid": "061085a87f151b8187b9a69c96fc0145", "score": "0.5112591", "text": "func getAnchorsFromMap(anchorsMap map[string]interface{}) map[string]interface{} {\n\tresult := make(map[string]interface{})\n\n\tfor key, value := range anchorsMap {\n\t\tif anchor.IsConditionAnchor(key) {\n\t\t\tresult[key] = value\n\t\t}\n\t}\n\n\treturn result\n}", "title": "" }, { "docid": "f666a3234a1cb5fd3f35876384061a33", "score": "0.51025784", "text": "func interpolationFuncMap() ast.Function {\n\treturn ast.Function{\n\t\tArgTypes: []ast.Type{},\n\t\tReturnType: ast.TypeMap,\n\t\tVariadic: true,\n\t\tVariadicType: ast.TypeAny,\n\t\tCallback: func(args []interface{}) (interface{}, error) {\n\t\t\toutputMap := make(map[string]ast.Variable)\n\n\t\t\tif len(args)%2 != 0 {\n\t\t\t\treturn nil, fmt.Errorf(\"requires an even number of arguments, got %d\", len(args))\n\t\t\t}\n\n\t\t\tvar firstType *ast.Type\n\t\t\tfor i := 0; i < len(args); i += 2 {\n\t\t\t\tkey, ok := args[i].(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn nil, fmt.Errorf(\"argument %d represents a key, so it must be a string\", i+1)\n\t\t\t\t}\n\t\t\t\tval := args[i+1]\n\t\t\t\tvariable, err := hil.InterfaceToVariable(val)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\t// Enforce map type homogeneity\n\t\t\t\tif firstType == nil {\n\t\t\t\t\tfirstType = &variable.Type\n\t\t\t\t} else if variable.Type != *firstType {\n\t\t\t\t\treturn nil, fmt.Errorf(\"all map values must have the same type, got %s then %s\", firstType.Printable(), variable.Type.Printable())\n\t\t\t\t}\n\t\t\t\t// Check for duplicate keys\n\t\t\t\tif _, ok := outputMap[key]; ok {\n\t\t\t\t\treturn nil, fmt.Errorf(\"argument %d is a duplicate key: %q\", i+1, key)\n\t\t\t\t}\n\t\t\t\toutputMap[key] = variable\n\t\t\t}\n\n\t\t\treturn outputMap, nil\n\t\t},\n\t}\n}", "title": "" }, { "docid": "128eb420c282397ec336e8c558e9f2cc", "score": "0.5070423", "text": "func getParamValue(param string, dicts map[string]interface{}) (string, bool) {\n\t// split between inflectors and real param\n\t// real param and each inflector is seperated by `|`\n\tcleanParam, inflectors := func() (string, string) {\n\t\tarr := strings.SplitN(param, \"|\", 2)\n\t\tif len(arr) != 2 {\n\t\t\treturn param, \"\"\n\t\t}\n\t\treturn strings.TrimSpace(arr[0]), strings.TrimSpace(arr[1])\n\t}()\n\n\t// get the value\n\tval, ok := func() (string, bool) {\n\t\t// get from type parameters\n\t\tval, ok := dicts[cleanParam]\n\t\tif !ok {\n\t\t\treturn \"\", false\n\t\t}\n\t\treturn fmt.Sprintf(\"%v\", val), true\n\t}()\n\tif !ok {\n\t\treturn \"\", false\n\t}\n\n\t// inflect the value if needed\n\tif inflectors != \"\" {\n\t\tfor _, inflector := range strings.Split(inflectors, \"|\") {\n\t\t\tinflector = strings.TrimSpace(inflector)\n\t\t\tvar ok bool\n\t\t\tval, ok = doInflect(val, inflector)\n\t\t\tif !ok {\n\t\t\t\tlog.Fatalf(\"invalid inflector \" + inflector)\n\t\t\t}\n\t\t}\n\t}\n\treturn val, true\n}", "title": "" }, { "docid": "532e0e488dcdc34c72eae8d8e97bef4c", "score": "0.5061886", "text": "func expandGrpcRouteRulesMatchesMethodMap(c *Client, f map[string]GrpcRouteRulesMatchesMethod, res *GrpcRoute) (map[string]interface{}, error) {\n\tif f == nil {\n\t\treturn nil, nil\n\t}\n\n\titems := make(map[string]interface{})\n\tfor k, item := range f {\n\t\ti, err := expandGrpcRouteRulesMatchesMethod(c, &item, res)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif i != nil {\n\t\t\titems[k] = i\n\t\t}\n\t}\n\n\treturn items, nil\n}", "title": "" }, { "docid": "1e9566f133a63e5f0bfa7aa94cedffe2", "score": "0.50599146", "text": "func ExtractParams(regEx *regexp.Regexp, msg string) (paramsMap map[string]string) {\n\n\tmatchedSubString := regEx.FindStringSubmatch(msg)\n\tparamsMap = make(map[string]string)\n\n\tfor idx, name := range regEx.SubexpNames() {\n\t\tif idx > 0 && idx <= len(matchedSubString) {\n\t\t\tparamsMap[name] = matchedSubString[idx]\n\t\t}\n\t}\n\treturn paramsMap\n}", "title": "" }, { "docid": "91326ad07dfdeeef0c9bdaa7b2613a38", "score": "0.5059449", "text": "func Call(m map[string]interface{}, name string, params ...interface{}) (result []reflect.Value, err error) {\n\tf := reflect.ValueOf(m[name])\n\tif len(params) != f.Type().NumIn() {\n\t\terr = errors.New(\"the number of params is not adapted\")\n\t\treturn\n\t}\n\tin := make([]reflect.Value, len(params))\n\tfor k, param := range params {\n\t\tin[k] = reflect.ValueOf(param)\n\t}\n\tresult = f.Call(in)\n\treturn\n}", "title": "" }, { "docid": "56d3043952f9df76f14f7859db12a709", "score": "0.5053367", "text": "func (cfunc *compiledFunction) CallValueMapBool(input map[string]aql.QueryResult) bool {\n\tc := map[string]interface{}{}\n\tfor k, v := range input {\n\t\tl := map[string]interface{}{}\n\t\tif x, ok := v.GetResult().(*aql.QueryResult_Edge); ok {\n\t\t\tl[\"gid\"] = x.Edge.Gid\n\t\t\tl[\"from\"] = x.Edge.From\n\t\t\tl[\"to\"] = x.Edge.To\n\t\t\tl[\"label\"] = x.Edge.Label\n\t\t\tl[\"data\"] = protoutil.AsMap(x.Edge.Data)\n\t\t} else if x, ok := v.GetResult().(*aql.QueryResult_Vertex); ok {\n\t\t\tl[\"gid\"] = x.Vertex.Gid\n\t\t\tl[\"label\"] = x.Vertex.Label\n\t\t\tl[\"data\"] = protoutil.AsMap(x.Vertex.Data)\n\t\t}\n\t\tc[k] = l\n\t}\n\t//log.Printf(\"Eval: %s\", c)\n\tvalue, err := cfunc.Function.Call(otto.Value{}, c)\n\tif err != nil {\n\t\tlog.Printf(\"Exec Error: %s\", err)\n\t}\n\tottoVal, _ := value.ToBoolean()\n\treturn ottoVal\n}", "title": "" }, { "docid": "cd1f85b991c36bdbb7d8207c1e0fe57a", "score": "0.5012547", "text": "func buildBindingMap(s *scope.Scope, params tree.SyntaxTree, expression tree.SyntaxTree) types.Value {\n if !params.IsList() {\n panic(\"expected param list to lambda\")\n }\n if expression.IsAtom() {\n bindings := buildBindingMapKernel(s, params, expression)\n return types.Cons(bindings[0], types.Nil())\n } else {\n bindings := buildBindingMapKernel(s, params, expression)\n return list(bindings)\n }\n}", "title": "" }, { "docid": "ecf40a547fa9d40141ef4e747c77fb4d", "score": "0.499214", "text": "func Eval(expr Expr, m map[string]interface{}) interface{} {\n\tif expr == nil {\n\t\treturn nil\n\t}\n\n\tswitch expr := expr.(type) {\n\tcase *BinaryExpr:\n\t\treturn evalBinaryExpr(expr, m)\n\tcase *BooleanLiteral:\n\t\treturn expr.Val\n\tcase *NumberLiteral:\n\t\treturn expr.Val\n\tcase *ParenExpr:\n\t\treturn Eval(expr.Expr, m)\n\tcase *StringLiteral:\n\t\treturn expr.Val\n\tcase *VarRef:\n\t\treturn m[expr.Val]\n\tdefault:\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "8ce63565bc9c2fef5896b9be07862d3e", "score": "0.49811423", "text": "func evaluateGval(s string, c *ctx.Ctx) (interface{}, error) {\n\tif s != \"\" && s[0] == '=' {\n\t\treturn gval.Evaluate(s[1:], c,\n\t\t\tjsonpath.Language(), jsonpathFunction(),\n\t\t\tpipeOperator(), fuzzyFunction(), formatFunction(),\n\t\t\tlenFunction(), upperFunction(), hmacSha256Function(),\n\t\t\thmacSha1Function(), dirFunction(), baseFunction(),\n\t\t\turlFunction())\n\t}\n\treturn s, nil\n}", "title": "" }, { "docid": "c012f438606c70c060404499343de0c7", "score": "0.4969173", "text": "func interpolationFuncKeys(vs map[string]ast.Variable) ast.Function {\n\treturn ast.Function{\n\t\tArgTypes: []ast.Type{ast.TypeMap},\n\t\tReturnType: ast.TypeList,\n\t\tCallback: func(args []interface{}) (interface{}, error) {\n\t\t\tmapVar := args[0].(map[string]ast.Variable)\n\t\t\tkeys := make([]string, 0)\n\n\t\t\tfor k, _ := range mapVar {\n\t\t\t\tkeys = append(keys, k)\n\t\t\t}\n\n\t\t\tsort.Strings(keys)\n\n\t\t\t// Keys are guaranteed to be strings\n\t\t\treturn stringSliceToVariableValue(keys), nil\n\t\t},\n\t}\n}", "title": "" }, { "docid": "82095c2a6a005689c98d674cef4d47bd", "score": "0.4942141", "text": "func fillParams(p *entrez.Parameters, v url.Values) {\n\tif p == nil {\n\t\treturn\n\t}\n\tpv := reflect.ValueOf(p).Elem()\n\tn := pv.NumField()\n\tt := pv.Type()\n\tfor i := 0; i < n; i++ {\n\t\ttf := t.Field(i)\n\t\tif tf.PkgPath != \"\" && !tf.Anonymous {\n\t\t\tcontinue\n\t\t}\n\t\ttag := tf.Tag.Get(\"param\")\n\t\tif tag != \"\" {\n\t\t\tin := pv.Field(i).Interface()\n\t\t\tswitch cv := in.(type) {\n\t\t\tcase int:\n\t\t\t\tif cv != 0 {\n\t\t\t\t\tv[tag] = []string{fmt.Sprint(cv)}\n\t\t\t\t}\n\t\t\tcase string:\n\t\t\t\tif cv != \"\" {\n\t\t\t\t\tv[tag] = []string{cv}\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\tpanic(\"cannot reach\")\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "20f457db9b7175de4a8bfdfc5e1c1e45", "score": "0.49065226", "text": "func parseParam(param string) map[string]string {\n\tresult := map[string]string{}\n\tparts := strings.Split(param, \"&\")\n\ti := 0\n\tfor _, part := range parts {\n\t\tequalsIndex := strings.Index(part, \"=\")\n\t\tif equalsIndex > 0 {\n\t\t\tresult[part[:equalsIndex]] = replaceSpecial(part[equalsIndex+1:])\n\t\t} else {\n\t\t\tresult[strconv.Itoa(i)] = replaceSpecial(part)\n\t\t\ti++\n\t\t}\n\t}\n\treturn result\n}", "title": "" }, { "docid": "1bb5a0c936ac6be14972ec4a08981087", "score": "0.48991325", "text": "func getExpressions(goals []blueprint.DataUtility) map[string]constraintExpression {\n\tresult := make(map[string]constraintExpression)\n\tfor _, goal := range goals {\n\t\tif goal.ID != nil {\n\t\t\tresult[*goal.ID] = readProperties(goal.Properties)\n\t\t} else {\n\t\t\tlog.Errorf(\"Can't parse goal since it doesn't have a valid ID\")\n\t\t}\n\t}\n\treturn result\n}", "title": "" }, { "docid": "8fe1407349c8c1fdc7419b4feb6870ba", "score": "0.48979226", "text": "func (GithubValidator) Params(h Hook, b *bolt.Bucket) map[string]string {\n\tm := make(map[string]string)\n\tfor _, k := range []string{\"secret\"} {\n\t\tm[k] = string(b.Get([]byte(fmt.Sprintf(\"%s-%s\", h.ID, k))))\n\t}\n\treturn m\n}", "title": "" }, { "docid": "bf1770d8f8e75812f668685c667417cf", "score": "0.48949033", "text": "func applyParams(yamlStr string, subsExps []string, params map[string]string) string {\n\tfor _, exp := range subsExps {\n\t\tif strings.HasPrefix(exp, paramsPrefix) {\n\t\t\texp = strings.TrimPrefix(exp, paramsPrefix)\n\t\t\tif val, ok := params[exp]; ok {\n\t\t\t\tyamlStr = replace(yamlStr, paramsPrefix, exp, val)\n\t\t\t} else {\n\t\t\t\tlog.Fatalf(\"Param %q not configured in the params map %v\", exp, params)\n\t\t\t}\n\t\t}\n\t}\n\treturn yamlStr\n}", "title": "" }, { "docid": "e1fabfaedf2a06982bc4aeb2c6544c99", "score": "0.48830193", "text": "func expandPolicySpecRulesValuesMap(c *Client, f map[string]PolicySpecRulesValues, res *Policy) (map[string]interface{}, error) {\n\tif f == nil {\n\t\treturn nil, nil\n\t}\n\n\titems := make(map[string]interface{})\n\tfor k, item := range f {\n\t\ti, err := expandPolicySpecRulesValues(c, &item, res)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif i != nil {\n\t\t\titems[k] = i\n\t\t}\n\t}\n\n\treturn items, nil\n}", "title": "" }, { "docid": "1348f88024fe37f74247470130aa6076", "score": "0.4877246", "text": "func (variables *Variable) EvaluateWithInteractsh(values map[string]interface{}, interact *interactsh.Client) (map[string]interface{}, []string) {\n\tresult := make(map[string]interface{}, variables.Len())\n\n\tvar interactURLs []string\n\tvariables.ForEach(func(key string, value interface{}) {\n\t\tvalueString := types.ToString(value)\n\t\tif strings.Contains(valueString, \"interactsh-url\") {\n\t\t\tvalueString, interactURLs = interact.Replace(valueString, interactURLs)\n\t\t}\n\t\tcombined := generators.MergeMaps(values, result)\n\t\tif value, ok := combined[key]; ok {\n\t\t\tvalueString = types.ToString(value)\n\t\t}\n\t\tresult[key] = evaluateVariableValue(valueString, combined, result)\n\t})\n\treturn result, interactURLs\n}", "title": "" }, { "docid": "62ad15ded5d54f904c969ced57c9cbef", "score": "0.48477823", "text": "func expandPolicySpecRulesConditionMap(c *Client, f map[string]PolicySpecRulesCondition, res *Policy) (map[string]interface{}, error) {\n\tif f == nil {\n\t\treturn nil, nil\n\t}\n\n\titems := make(map[string]interface{})\n\tfor k, item := range f {\n\t\ti, err := expandPolicySpecRulesCondition(c, &item, res)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif i != nil {\n\t\t\titems[k] = i\n\t\t}\n\t}\n\n\treturn items, nil\n}", "title": "" }, { "docid": "c3b62d95cec309a2561de5f0a52c22ec", "score": "0.4841915", "text": "func BuildParams(arguments []Argument, requireds ...string) (map[string]interface{}, error) {\n\tparams := make(map[string]interface{})\n\tfor _, argFunc := range arguments {\n\t\targFunc(params)\n\t}\n\tmissing := []string{}\n\tfor _, required := range requireds {\n\t\tif _, ok := params[required]; !ok {\n\t\t\tmissing = append(missing, required)\n\t\t}\n\t}\n\tif len(missing) > 0 {\n\t\treturn nil, fmt.Errorf(\"CryptomarketSDKError: missing arguments: %v\", missing)\n\t}\n\treturn params, nil\n}", "title": "" }, { "docid": "580d455c6d6dbe3ac294e77e3002a338", "score": "0.48361275", "text": "func (d Destination) Params(source string) (map[string]interface{}, error) {\n\tvar result = make(map[string]interface{})\n\tif d.Pattern == \"\" || len(d.Parameters) == 0 {\n\t\treturn result, nil\n\t}\n\tvar err error\n\tif d.compiled == nil {\n\t\td.compiled, err = regexp.Compile(d.Pattern)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tudfs := data.NewMap()\n\tudf.Register(udfs)\n\tfor _, param := range d.Parameters {\n\t\tparamValue := expandWithPattern(d.compiled, source, param.Expression)\n\t\tresult[param.Name] = udfs.ExpandAsText(paramValue)\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "025c75e9a5fb4087ef759ec602036ccb", "score": "0.4835365", "text": "func expandGrpcRouteRulesMatchesMap(c *Client, f map[string]GrpcRouteRulesMatches, res *GrpcRoute) (map[string]interface{}, error) {\n\tif f == nil {\n\t\treturn nil, nil\n\t}\n\n\titems := make(map[string]interface{})\n\tfor k, item := range f {\n\t\ti, err := expandGrpcRouteRulesMatches(c, &item, res)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif i != nil {\n\t\t\titems[k] = i\n\t\t}\n\t}\n\n\treturn items, nil\n}", "title": "" }, { "docid": "6036e04ac8825d6bfc705b0b51c4ddd6", "score": "0.48242274", "text": "func ReplacerFromMap(args map[string]string) *strings.Replacer {\n\t// Convert into array of 0 => key, 1 => val, 2 => key, etc...\n\targlist := make([]string, len(args)*2)\n\tc := 0\n\tfor k, v := range args {\n\t\targlist[(c * 2)] = k\n\t\targlist[(c*2)+1] = v\n\t\tc++\n\t}\n\treturn strings.NewReplacer(arglist...)\n}", "title": "" }, { "docid": "d90a1ddb3fe0c1ccb76a4c4a624a4832", "score": "0.48205945", "text": "func bindMap(p *Properties, v reflect.Value, t reflect.Type, param BindParam, filter Filter) (err error) {\n\n\tif param.Tag.HasDef && param.Tag.Def != \"\" {\n\t\terr := errors.New(\"map can't have a non empty default value\")\n\t\treturn util.Wrapf(err, code.FileLine(), \"bind %s error\", param.Path)\n\t}\n\n\tet := t.Elem()\n\tret := reflect.MakeMap(t)\n\tdefer func() { v.Set(ret) }()\n\n\tkeys, err := p.storage.SubKeys(param.Key)\n\tif err != nil {\n\t\treturn util.Wrapf(err, code.FileLine(), \"bind %s error\", param.Path)\n\t}\n\n\tfor _, key := range keys {\n\t\te := reflect.New(et).Elem()\n\t\tsubKey := key\n\t\tif param.Key != \"\" {\n\t\t\tsubKey = param.Key + \".\" + key\n\t\t}\n\t\tsubParam := BindParam{\n\t\t\tKey: subKey,\n\t\t\tPath: param.Path,\n\t\t}\n\t\terr = BindValue(p, e, et, subParam, filter)\n\t\tif err != nil {\n\t\t\treturn util.Wrapf(err, code.FileLine(), \"bind %s error\", param.Path)\n\t\t}\n\t\tret.SetMapIndex(reflect.ValueOf(key), e)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5dd2c79f0b61fcb3ff7c880555e09d40", "score": "0.48167992", "text": "func (svc *awsSSM) getParams(ctx context.Context, encrpyted bool, root string, paramsToGet []string) (map[string]string, error) {\n\tparams := make(map[string]string, len(paramsToGet))\n\tvar paramsToGetPaths []*string\n\n\t// Concat parameter names to SSM path e.g. value to /path/value\n\tfor _, paramToGet := range paramsToGet {\n\t\tparamPath := root + paramToGet\n\t\tparamsToGetPaths = append(paramsToGetPaths, &paramPath)\n\t}\n\n\t// Get all parameters with single call\n\toutput, err := svc.GetParametersWithContext(ctx,\n\t\t&ssm.GetParametersInput{\n\t\t\tNames: paramsToGetPaths,\n\t\t\tWithDecryption: aws.Bool(encrpyted),\n\t\t})\n\n\t// Trim parameter paths back to names for map keys e.g. /path/value to value\n\tfor _, param := range output.Parameters {\n\t\tkey := strings.TrimPrefix(*param.Name, root)\n\t\tval := *param.Value\n\t\tparams[key] = val\n\t}\n\n\treturn params, err\n}", "title": "" }, { "docid": "0c54d16ce8f5c143a46eb86cd79bdc2e", "score": "0.4810777", "text": "func paramsFromHTTPRouter(hrps httprouter.Params) Params {\n\tvar ps = Params{}\n\n\tfor _, p := range hrps {\n\t\tps[p.Key] = p.Value\n\t}\n\n\treturn ps\n}", "title": "" }, { "docid": "1fb9e008b2200776b4bc1115415d92c7", "score": "0.4801576", "text": "func getParamMap(prefix string) map[string]string {\n\tenvs := map[string]string{}\n\n\tfor _, item := range os.Environ() {\n\t\tenv := strings.SplitN(item, \"=\", 2)\n\t\tif len(env) != 2 {\n\t\t\tcontinue\n\t\t}\n\n\t\tkey := env[0]\n\t\tval := env[1]\n\t\tif strings.HasPrefix(key, prefix) {\n\t\t\tenvs[strings.TrimPrefix(key, prefix)] = val\n\t\t}\n\t}\n\treturn envs\n}", "title": "" }, { "docid": "0eaf1c27b2da97bc96769f46f76ea4d0", "score": "0.47949928", "text": "func FromFuncMap(input map[string]*Function) Context {\n\tret := make(Context)\n\tfor k, v := range input {\n\t\tret[k] = FromFunc(v)\n\t}\n\treturn ret\n}", "title": "" }, { "docid": "fa6780301abe26b813af63a975edb74a", "score": "0.4789733", "text": "func parseKeys(mapRule map[string]interface{}) (interface{}, error) {\n\tt := make(map[string]interface{})\n\n\tfor k, e := range mapRule {\n\t\tswitch r := e.(type) {\n\t\tcase map[string]interface{}:\n\t\t\tj, err := parseKeys(r)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tSet(t, k, j)\n\t\tcase string:\n\t\t\tlexed, err := jee.Lexer(r)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ttree, err := jee.Parser(lexed)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tSet(t, k, tree)\n\t\t}\n\t}\n\n\treturn t, nil\n}", "title": "" }, { "docid": "b9b5cada133352b6e71c8bee3b3f2208", "score": "0.4783419", "text": "func mapParams(params interface{}, fn func(param string, index int, field reflect.StructField)) {\r\n\trParams := reflect.TypeOf(params)\r\n\tfor i := 0; i < rParams.NumField(); i++ {\r\n\t\tfield := rParams.Field(i)\r\n\t\tparam := field.Tag.Get(\"json\")\r\n\t\tfn(param, i, field)\r\n\t}\r\n}", "title": "" }, { "docid": "674586d9e14865b29a039b468cb6eb42", "score": "0.47689146", "text": "func PrintRegexMap(m map[string]*regexp.Regexp) {\r\n\tfor key, value := range m {\r\n\t\tfmt.Println(\"Token:\\t\\t\", key, \"\\nProduction:\\t\", value)\r\n\t}\r\n}", "title": "" }, { "docid": "1629b3f683c143bc9a454787afcc933e", "score": "0.475529", "text": "func (n *node) getParams(method string) []string {\n\tmethod = n.fmtMethod(method)\n\th, ok := n.params[method]\n\tif !ok {\n\t\th = n.params[\"*\"]\n\t}\n\treturn h\n}", "title": "" }, { "docid": "8414f9210d61e6f31a204b59d4787284", "score": "0.47145492", "text": "func expandGrpcRouteRulesMap(c *Client, f map[string]GrpcRouteRules, res *GrpcRoute) (map[string]interface{}, error) {\n\tif f == nil {\n\t\treturn nil, nil\n\t}\n\n\titems := make(map[string]interface{})\n\tfor k, item := range f {\n\t\ti, err := expandGrpcRouteRules(c, &item, res)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif i != nil {\n\t\t\titems[k] = i\n\t\t}\n\t}\n\n\treturn items, nil\n}", "title": "" }, { "docid": "afda34d381d5e085385900c4c20c934e", "score": "0.47057176", "text": "func expandGrpcRouteRulesActionMap(c *Client, f map[string]GrpcRouteRulesAction, res *GrpcRoute) (map[string]interface{}, error) {\n\tif f == nil {\n\t\treturn nil, nil\n\t}\n\n\titems := make(map[string]interface{})\n\tfor k, item := range f {\n\t\ti, err := expandGrpcRouteRulesAction(c, &item, res)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif i != nil {\n\t\t\titems[k] = i\n\t\t}\n\t}\n\n\treturn items, nil\n}", "title": "" }, { "docid": "c1097efd3aa27b335337b2ba7ce76edf", "score": "0.46860278", "text": "func expandPolicySpecRulesMap(c *Client, f map[string]PolicySpecRules, res *Policy) (map[string]interface{}, error) {\n\tif f == nil {\n\t\treturn nil, nil\n\t}\n\n\titems := make(map[string]interface{})\n\tfor k, item := range f {\n\t\ti, err := expandPolicySpecRules(c, &item, res)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif i != nil {\n\t\t\titems[k] = i\n\t\t}\n\t}\n\n\treturn items, nil\n}", "title": "" }, { "docid": "c0e043f4a6ba5e453cfe0851a7de124f", "score": "0.46623012", "text": "func getAnchorAndElementsFromMap(anchorsMap map[string]interface{}) (map[string]interface{}, map[string]interface{}) {\n\tanchors := make(map[string]interface{})\n\telementsWithoutanchor := make(map[string]interface{})\n\tfor key, value := range anchorsMap {\n\t\tif anchor.IsConditionAnchor(key) {\n\t\t\tanchors[key] = value\n\t\t} else if !anchor.IsAddingAnchor(key) {\n\t\t\telementsWithoutanchor[key] = value\n\t\t}\n\t}\n\n\treturn anchors, elementsWithoutanchor\n}", "title": "" }, { "docid": "49e20bce451592cdff048592d340ca64", "score": "0.4650644", "text": "func expandPolicySpecMap(c *Client, f map[string]PolicySpec, res *Policy) (map[string]interface{}, error) {\n\tif f == nil {\n\t\treturn nil, nil\n\t}\n\n\titems := make(map[string]interface{})\n\tfor k, item := range f {\n\t\ti, err := expandPolicySpec(c, &item, res)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif i != nil {\n\t\t\titems[k] = i\n\t\t}\n\t}\n\n\treturn items, nil\n}", "title": "" }, { "docid": "341a46b523af031c8f423283c9ec5ab4", "score": "0.46320358", "text": "func getParameters(r *http.Request) map[string]interface{} {\n\tm := map[string]interface{}{}\n\tfor k, v := range r.URL.Query() {\n\t\tm[k] = v[0]\n\t}\n\n\treturn m\n}", "title": "" }, { "docid": "5414deb6c5c487808f1dd8a9e6b5c482", "score": "0.46239945", "text": "func g0[S ~[]E, M ~map[string]S, E any](m M) {}", "title": "" }, { "docid": "5654dbc3ded20a2825779506ed1977d5", "score": "0.4621274", "text": "func (ctx *Ctx) Params(key string) (value string) {\n\tif ctx.route.Params == nil {\n\t\treturn\n\t}\n\tfor i := 0; i < len(ctx.route.Params); i++ {\n\t\tif (ctx.route.Params)[i] == key {\n\t\t\treturn ctx.values[i]\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "4f69d1bfb4bc88c8d3ac76f46acf07fc", "score": "0.46076238", "text": "func (buffer Map) ComputeParameters() {\n\tfor _, alt := range buffer.Data {\n\t\tif alt > buffer.Max {\n\t\t\tbuffer.Max = alt\n\t\t}\n\t\tif alt < buffer.Min {\n\t\t\tbuffer.Min = alt\n\t\t}\n\t}\n\tbuffer.Diff = buffer.Max - buffer.Min\n}", "title": "" }, { "docid": "def08c82a8ca6a0364ef0d88ca1ef0c2", "score": "0.46060103", "text": "func IntParams(params map[string]string, intParamNames []string) (map[string]int, error) {\n\tintParams := map[string]int{}\n\tfor _, intParam := range intParamNames {\n\t\tvalStr, ok := params[intParam]\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\tvalInt, err := strconv.Atoi(valStr)\n\t\tif err != nil {\n\t\t\treturn nil, errors.New(\"parameter '\" + intParam + \"'\" + \" not an integer\")\n\t\t}\n\t\tintParams[intParam] = valInt\n\t}\n\treturn intParams, nil\n}", "title": "" }, { "docid": "3967bd2b5d71e27bbbc02b33d48f0a3b", "score": "0.46054763", "text": "func (c *shellExec) ParseParams(params map[string]interface{}) error {\n\terr := mapstructure.Decode(params, c)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"error decoding %v params\", c.Name())\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3a73378517f8f7cc6872b099c92e6b97", "score": "0.45909923", "text": "func TestEval(t *testing.T) {\n\tfor i, tt := range []struct {\n\t\tin string\n\t\tout interface{}\n\t\tdata map[string]interface{}\n\t}{\n\t\t// Number literals.\n\t\t{in: `1 + 2`, out: int64(3)},\n\t\t{in: `(foo*2) + ( (4/2) + (3 * 5) - 0.5 )`, out: float64(26.5), data: map[string]interface{}{\"foo\": float64(5)}},\n\t\t{in: `foo / 2`, out: float64(2), data: map[string]interface{}{\"foo\": float64(4)}},\n\t\t{in: `4 = 4`, out: true},\n\t\t{in: `4 <> 4`, out: false},\n\t\t{in: `6 > 4`, out: true},\n\t\t{in: `4 >= 4`, out: true},\n\t\t{in: `4 < 6`, out: true},\n\t\t{in: `4 <= 4`, out: true},\n\t\t{in: `4 AND 5`, out: nil},\n\t\t{in: `0 = 'test'`, out: false},\n\t\t{in: `1.0 = 1`, out: true},\n\t\t{in: `1.2 = 1`, out: false},\n\t\t{in: `-1 = 9223372036854775808`, out: false},\n\t\t{in: `-1 != 9223372036854775808`, out: true},\n\t\t{in: `-1 < 9223372036854775808`, out: true},\n\t\t{in: `-1 <= 9223372036854775808`, out: true},\n\t\t{in: `-1 > 9223372036854775808`, out: false},\n\t\t{in: `-1 >= 9223372036854775808`, out: false},\n\t\t{in: `9223372036854775808 = -1`, out: false},\n\t\t{in: `9223372036854775808 != -1`, out: true},\n\t\t{in: `9223372036854775808 < -1`, out: false},\n\t\t{in: `9223372036854775808 <= -1`, out: false},\n\t\t{in: `9223372036854775808 > -1`, out: true},\n\t\t{in: `9223372036854775808 >= -1`, out: true},\n\t\t{in: `9223372036854775808 = 9223372036854775808`, out: true},\n\t\t{in: `9223372036854775808 != 9223372036854775808`, out: false},\n\t\t{in: `9223372036854775808 < 9223372036854775808`, out: false},\n\t\t{in: `9223372036854775808 <= 9223372036854775808`, out: true},\n\t\t{in: `9223372036854775808 > 9223372036854775808`, out: false},\n\t\t{in: `9223372036854775808 >= 9223372036854775808`, out: true},\n\t\t{in: `9223372036854775809 = 9223372036854775808`, out: false},\n\t\t{in: `9223372036854775809 != 9223372036854775808`, out: true},\n\t\t{in: `9223372036854775809 < 9223372036854775808`, out: false},\n\t\t{in: `9223372036854775809 <= 9223372036854775808`, out: false},\n\t\t{in: `9223372036854775809 > 9223372036854775808`, out: true},\n\t\t{in: `9223372036854775809 >= 9223372036854775808`, out: true},\n\t\t{in: `9223372036854775808 / 0`, out: uint64(0)},\n\t\t{in: `9223372036854775808 + 1`, out: uint64(9223372036854775809)},\n\t\t{in: `9223372036854775808 - 1`, out: uint64(9223372036854775807)},\n\t\t{in: `9223372036854775809 - 9223372036854775808`, out: uint64(1)},\n\n\t\t// Boolean literals.\n\t\t{in: `true AND false`, out: false},\n\t\t{in: `true OR false`, out: true},\n\t\t{in: `false = 4`, out: false},\n\n\t\t// String literals.\n\t\t{in: `'foo' = 'bar'`, out: false},\n\t\t{in: `'foo' = 'foo'`, out: true},\n\t\t{in: `'' = 4`, out: false},\n\n\t\t// Regex literals.\n\t\t{in: `'foo' =~ /f.*/`, out: true},\n\t\t{in: `'foo' =~ /b.*/`, out: false},\n\t\t{in: `'foo' !~ /f.*/`, out: false},\n\t\t{in: `'foo' !~ /b.*/`, out: true},\n\n\t\t// Variable references.\n\t\t{in: `foo`, out: \"bar\", data: map[string]interface{}{\"foo\": \"bar\"}},\n\t\t{in: `foo = 'bar'`, out: true, data: map[string]interface{}{\"foo\": \"bar\"}},\n\t\t{in: `foo = 'bar'`, out: false, data: map[string]interface{}{\"foo\": nil}},\n\t\t{in: `'bar' = foo`, out: false, data: map[string]interface{}{\"foo\": nil}},\n\t\t{in: `foo <> 'bar'`, out: true, data: map[string]interface{}{\"foo\": \"xxx\"}},\n\t\t{in: `foo =~ /b.*/`, out: true, data: map[string]interface{}{\"foo\": \"bar\"}},\n\t\t{in: `foo !~ /b.*/`, out: false, data: map[string]interface{}{\"foo\": \"bar\"}},\n\t\t{in: `foo > 2 OR bar > 3`, out: true, data: map[string]interface{}{\"foo\": float64(4)}},\n\t\t{in: `foo > 2 OR bar > 3`, out: true, data: map[string]interface{}{\"bar\": float64(4)}},\n\t} {\n\t\t// Evaluate expression.\n\t\tout := influxql.Eval(MustParseExpr(tt.in), tt.data)\n\n\t\t// Compare with expected output.\n\t\tif !reflect.DeepEqual(tt.out, out) {\n\t\t\tt.Errorf(\"%d. %s: unexpected output:\\n\\nexp=%#v\\n\\ngot=%#v\\n\\n\", i, tt.in, tt.out, out)\n\t\t\tcontinue\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1cd58478c072f163c418a9b7b3adaa4f", "score": "0.45810652", "text": "func validOpValuePair(name string, op string, opType rune, val interface{}, valType rune, lexMap map[string]rune) error {\n\tvar err error\n\n\tif lexMap[\"OpEq\"] == opType {\n\t\tif lexMap[\"VersRange\"] == valType {\n\t\t\treturn fmt.Errorf(\"Version range can only use operator 'in'.\")\n\t\t}\n\t\tif lexMap[\"ListStr\"] == valType {\n\t\t\treturn fmt.Errorf(\"Property type list of strings can only use operator 'in'.\")\n\t\t}\n\t}\n\tif lexMap[\"OpComp\"] == opType {\n\t\tif _, err := strconv.ParseFloat(val.(string), 64); err != nil {\n\t\t\treturn fmt.Errorf(\"Cannot use numerical comparison operator %s with value %v.\", op, val)\n\t\t}\n\t}\n\tif lexMap[\"OpIn\"] == opType {\n\t\tif lexMap[\"ListStr\"] != valType && lexMap[\"QuoteStr\"] != valType && lexMap[\"VersRange\"] != valType && lexMap[\"Vers\"] != valType {\n\t\t\treturn fmt.Errorf(\"The 'in' operator can only be used for types version and list of strings\")\n\t\t}\n\t\tif lexMap[\"VersRange\"] == valType {\n\t\t\t// Using the factory function to validate version ranges\n\t\t\t_, err = semanticversion.Version_Expression_Factory(val.(string))\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "2058ee337d38c2b83dcf82035c24f51f", "score": "0.45750144", "text": "func (h *Handler) Params(segments []string) map[string]string {\n\tparams := make(map[string]string, len(h.params))\n\tfor name, index := range h.params {\n\t\tparams[name] = segments[index]\n\t}\n\treturn params\n}", "title": "" }, { "docid": "db08ac84e8f9d94b3270ca83fc48f11b", "score": "0.45709756", "text": "func (f *Form) IsValidMap(values map[string]interface{}) bool {\n\tdata := url.Values{}\n\n\tfor k, v := range values {\n\t\tif isSlice(v) {\n\t\t\ts := reflect.ValueOf(v)\n\t\t\tfor i := 0; i < s.Len(); i++ {\n\t\t\t\tdata.Add(k, s.Index(i).String())\n\t\t\t}\n\t\t} else {\n\t\t\tstr, _ := v.(string)\n\t\t\tdata.Set(k, str)\n\t\t}\n\t}\n\n\treturn f.IsValid(data)\n}", "title": "" }, { "docid": "445399dbaa725a7bfa7f18afca9dcdc4", "score": "0.45687455", "text": "func parseParams(mem map[identifier]signal, params []identifier) ([]signal, error) {\n\tanswer := make([]signal, len(params))\n\tfor ind, param := range params {\n\t\tval, isInt := param.toSignal()\n\t\tif isInt {\n\t\t\tanswer[ind] = signal(val)\n\t\t} else {\n\t\t\tval, found := mem[param]\n\t\t\tif !found {\n\t\t\t\treturn nil, fmt.Errorf(\"%v not found in memory\", param)\n\t\t\t}\n\t\t\tanswer[ind] = val\n\t\t}\n\t}\n\treturn answer, nil\n}", "title": "" }, { "docid": "a5b8604f008eb20dd922dc4a38b036ee", "score": "0.4567034", "text": "func filter(keyEncKVMap map[string]map[string][]byte, encQKey string, evalFunc func(string, map[string][]byte) (bool, Error)) (iStateErr Error) {\n\tfor key, encKV := range keyEncKVMap {\n\t\tvar ok bool\n\t\tok, iStateErr = evalFunc(encQKey, encKV)\n\t\tif iStateErr != nil {\n\t\t\treturn\n\t\t}\n\t\tif !ok {\n\t\t\tdelete(keyEncKVMap, key)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "8d03b4747a83ce05ee368f617adc98eb", "score": "0.4564209", "text": "func KeyValsMap(err error) map[string]interface{} {\n\tkeyvals := KeyVals(err)\n\treturn paramsFromKeyvals(keyvals)\n}", "title": "" }, { "docid": "b8832eaa05bc31d87448c1f91d1332ee", "score": "0.45557255", "text": "func (stmt *InsertStmt) ValueMap(vals map[string]interface{}) *InsertStmt {\n\tfor _, col := range sortKeys(vals) {\n\t\tstmt.InsCols = append(stmt.InsCols, col)\n\t\tstmt.InsVals = append(stmt.InsVals, vals[col])\n\t}\n\n\treturn stmt\n}", "title": "" }, { "docid": "180915ac3880425d6066ba7b279238a9", "score": "0.45546874", "text": "func getDataFromMap(data map[string]interface{}, key string) (result interface{}, exist bool) {\n\tif data == nil {\n\t\treturn nil, false\n\t}\n\n\tif d, exist := data[key]; exist {\n\t\treturn d, true\n\t}\n\n\tresult = data\n\tparts := strings.Split(key, \".\")\n\tfor _, part := range parts {\n\t\tswitch resultMap := result.(type) {\n\t\tcase map[string]interface{}:\n\t\t\tif d, exist := resultMap[part]; exist {\n\t\t\t\tresult = d\n\t\t\t} else {\n\t\t\t\treturn nil, false\n\t\t\t}\n\t\tcase url.Values: // Get parameters from an url\n\t\t\tresult = resultMap.Get(part)\n\t\tdefault:\n\t\t\treturn nil, false\n\t\t}\n\t}\n\treturn result, true\n}", "title": "" }, { "docid": "53ccab1e3358b3798cb6357cfc3efaa0", "score": "0.45427132", "text": "func (e *Event) Map(param string) (v map[string]interface{}, ok bool) {\n\tif x := e.Params[param]; x != nil {\n\t\tv, ok = x.(map[string]interface{})\n\t}\n\treturn\n}", "title": "" }, { "docid": "91937f3cc2d0915e9549177f571e74d3", "score": "0.45352", "text": "func parsePlan(planMap map[string]interface{}) Plan {\n\tplan := Plan{}\n\n\tfor key, value := range planMap {\n\t\tswitch key {\n\t\tcase \"Name\":\n\t\t\tplan.Name = value.(string)\n\t\tcase \"Variables\":\n\t\t\tplan.Variables = parseValues(value.(map[string]interface{}))\n\t\tcase \"Tasks\":\n\t\t\tplan.Tasks = parseTasks(value.([]interface{}), plan.Variables)\n\t\t}\n\t}\n\treturn plan\n}", "title": "" }, { "docid": "9f8eabffe0d588fde1b17712d9b1257d", "score": "0.4532587", "text": "func getPathParamToIndexMap(pathTemplate string) map[string]int {\n\tindexMap := make(map[string]int)\n\tr := regexp.MustCompile(`{([^{}]+)}`) // define a capture group to catch the path param\n\tmatches := r.FindAllStringSubmatch(pathTemplate, -1)\n\tfor i, paramMatches := range matches {\n\t\t// paramMatches is slice always with length two (since one capture group is defined in the regex)\n\t\t// hence we do not want to explicitly validate the slice length\n\t\tindexMap[paramMatches[1]] = i + 1\n\t}\n\treturn indexMap\n}", "title": "" }, { "docid": "cae2a19eff243d9587f9660aaa596bca", "score": "0.45316374", "text": "func expandGrpcRouteRulesActionFaultInjectionPolicyDelayMap(c *Client, f map[string]GrpcRouteRulesActionFaultInjectionPolicyDelay, res *GrpcRoute) (map[string]interface{}, error) {\n\tif f == nil {\n\t\treturn nil, nil\n\t}\n\n\titems := make(map[string]interface{})\n\tfor k, item := range f {\n\t\ti, err := expandGrpcRouteRulesActionFaultInjectionPolicyDelay(c, &item, res)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif i != nil {\n\t\t\titems[k] = i\n\t\t}\n\t}\n\n\treturn items, nil\n}", "title": "" }, { "docid": "d1fba22f1b8235eda62bd58396437fc6", "score": "0.4516903", "text": "func getParametersFromRequestBody(body string) map[string]string {\n\tparsedQuery, _ := url.ParseQuery(body)\n\t// parsedQuery is map[string][]string, but I want a map[string]string\n\turlParameters := make(map[string]string)\n\tfor key, _ := range parsedQuery {\n\t\turlParameters[key] = parsedQuery.Get(key)\n\t}\n\treturn urlParameters\n}", "title": "" }, { "docid": "acab14d4a4132ab18feb212bd5a18e5f", "score": "0.45158234", "text": "func interpolationFuncMatchKeys() ast.Function {\n\treturn ast.Function{\n\t\tArgTypes: []ast.Type{ast.TypeList, ast.TypeList, ast.TypeList},\n\t\tReturnType: ast.TypeList,\n\t\tCallback: func(args []interface{}) (interface{}, error) {\n\t\t\toutput := make([]ast.Variable, 0)\n\n\t\t\tvalues, _ := args[0].([]ast.Variable)\n\t\t\tkeys, _ := args[1].([]ast.Variable)\n\t\t\tsearchset, _ := args[2].([]ast.Variable)\n\n\t\t\tif len(keys) != len(values) {\n\t\t\t\treturn nil, fmt.Errorf(\"length of keys and values should be equal\")\n\t\t\t}\n\n\t\t\tfor i, key := range keys {\n\t\t\t\tfor _, search := range searchset {\n\t\t\t\t\tif res, err := compareSimpleVariables(key, search); err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t} else if res == true {\n\t\t\t\t\t\toutput = append(output, values[i])\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// if searchset is empty, then output is an empty list as well.\n\t\t\t// if we haven't matched any key, then output is an empty list.\n\t\t\treturn output, nil\n\t\t},\n\t}\n}", "title": "" }, { "docid": "442b35d040ebdd928c456c73061e2f66", "score": "0.4515029", "text": "func expandGrpcRouteRulesActionRetryPolicyMap(c *Client, f map[string]GrpcRouteRulesActionRetryPolicy, res *GrpcRoute) (map[string]interface{}, error) {\n\tif f == nil {\n\t\treturn nil, nil\n\t}\n\n\titems := make(map[string]interface{})\n\tfor k, item := range f {\n\t\ti, err := expandGrpcRouteRulesActionRetryPolicy(c, &item, res)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif i != nil {\n\t\t\titems[k] = i\n\t\t}\n\t}\n\n\treturn items, nil\n}", "title": "" }, { "docid": "08bfb835d8ec81d5e1d4a98f3a553562", "score": "0.450816", "text": "func (m *ProducerMock) MapParams(params TemplateParams, lang language.Tag) TemplateParams {\n\targs := m.Called(params)\n\treturn args.Get(0).(TemplateParams)\n}", "title": "" }, { "docid": "0b97f1cf220bc1e2b19176c711032c00", "score": "0.4506867", "text": "func elideKeyValues(content string, keys map[string]bool) string {\n\tvar end string\n\tif i := strings.IndexFunc(content, unicode.IsSpace); i >= 0 {\n\t\tcontent, end = content[:i], content[i:]\n\t}\n\t// Check for gomaxprocs value\n\tif i := strings.LastIndex(content, \"-\"); i >= 0 {\n\t\t_, err := strconv.Atoi(content[i+1:])\n\t\tif err == nil {\n\t\t\tif keys[\"gomaxprocs\"] {\n\t\t\t\tcontent, end = content[:i], \"-*\"+end\n\t\t\t} else {\n\t\t\t\tcontent, end = content[:i], content[i:]+end\n\t\t\t}\n\t\t}\n\t}\n\tparts := strings.Split(content, \"/\")\n\tfor i, part := range parts {\n\t\tif equals := strings.Index(part, \"=\"); equals >= 0 {\n\t\t\tif keys[part[:equals]] {\n\t\t\t\tparts[i] = part[:equals] + \"=*\"\n\t\t\t}\n\t\t} else if i == 0 {\n\t\t\tif keys[\"name\"] {\n\t\t\t\tparts[i] = \"Benchmark*\"\n\t\t\t}\n\t\t} else if keys[fmt.Sprintf(\"sub%d\", i)] {\n\t\t\tparts[i] = \"*\"\n\t\t}\n\t}\n\treturn strings.Join(parts, \"/\") + end\n}", "title": "" }, { "docid": "ac6bfb23f68ed1e73bec38e139dd0606", "score": "0.45067427", "text": "func GorillaParams(next http.Handler) http.Handler {\n\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tvars := mux.Vars(r)\n\t\t// convert gorilla Params to internal representation\n\t\tps := make(Params, len(vars))\n\t\tfor key, value := range vars {\n\t\t\tps[key] = value\n\t\t}\n\t\tr = r.WithContext(context.WithValue(r.Context(), paramsKey{}, ps))\n\t\t// call the next handler\n\t\tnext.ServeHTTP(w, r)\n\t})\n}", "title": "" }, { "docid": "4c9feb930a940ea031655c8e57e5ceb9", "score": "0.45059806", "text": "func extractValues(nodes []ast.Node, allowedValues map[string]bool, pkgName string) map[string]token.Pos {\n\tm := make(map[string]token.Pos)\n\n\t// Find all Values in the Search Flags.\n\tfv := funcVisitor(func(node ast.Node) {\n\t\tvalue, pos := extractValue(node, allowedValues, pkgName)\n\t\tif pos == token.NoPos {\n\t\t\treturn\n\t\t}\n\n\t\tm[value] = pos\n\t})\n\n\tfor _, node := range nodes {\n\t\tast.Walk(fv, node)\n\t}\n\n\treturn m\n}", "title": "" }, { "docid": "60f4f7e336eb15ca0ba3364ae342e6b3", "score": "0.4501156", "text": "func loadMapIndexExpr(_map Expr, index Expr) {\n\t// e.g. x[key]\n\n\n\t// rax: found value (zero if not found)\n\t// rcx: ok (found: address of the index, not found:0)\n\temit(\"# emit mapData head address\")\n\t_map.emit()\n\temit(\"PUSH_8 # map head\")\n\temitOffsetLoad(_map, IntSize, IntSize)\n\temit(\"PUSH_8 # len\")\n\tindex.emit()\n\temit(\"PUSH_8 # index value\")\n\n\temit(\"pop %%rcx # index value\")\n\temit(\"pop %%rbx # len\")\n\temit(\"pop %%rax # heap\")\n\temitMapGet(_map.getGtype(), true)\n}", "title": "" }, { "docid": "f051b9aef90533c487ef921d47f9c16a", "score": "0.44996023", "text": "func ParseIt(storymap map[string]StoryChapterStruct) {\n\n}", "title": "" }, { "docid": "ddbb654b72c68e543dbbb3a9908ade54", "score": "0.4496818", "text": "func updateExpansions(expansions *util.Expansions, projectId string, params []patch.Parameter) error {\n\tprojVars, err := model.FindMergedProjectVars(projectId)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"finding project variables\")\n\t}\n\tif projVars == nil {\n\t\treturn errors.New(\"project variables not found\")\n\t}\n\n\texpansions.Update(projVars.Vars)\n\n\tfor _, param := range params {\n\t\texpansions.Put(param.Key, param.Value)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "61a12edd4e7ae45e8a69b59219514297", "score": "0.44948786", "text": "func (usr_vars UserVariables) ForEachStrParam(f func(string, StrParam)) {\n\tfor key, vars := range usr_vars.StrMap {\n\t\tindexer, _ := usr_vars.nameIndexer(key)\n\t\tf(key, NewStrParam(vars.Values, indexer))\n\t}\n}", "title": "" }, { "docid": "debfbf422648a128566963589cfe5490", "score": "0.44938338", "text": "func Evaluate(condtion string, event sigma.Event, values utils.ValueMap) (bool, error) {\n\tif condtion == \"\" {\n\t\treturn true, nil\n\t}\n\n\tfunctions := map[string]govaluate.ExpressionFunction{\n\t\t\"jsonpath\": func(args ...interface{}) (interface{}, error) {\n\t\t\tif len(args) != 2 {\n\t\t\t\treturn nil, errors.New(\"usage: jsonpath(blob, path)\")\n\t\t\t}\n\n\t\t\tblob, ok := args[0].(string)\n\t\t\tif !ok {\n\t\t\t\treturn nil, errors.New(\"`blob` mustbe string\")\n\t\t\t}\n\n\t\t\tpath, ok := args[1].(string)\n\t\t\tif !ok {\n\t\t\t\treturn nil, errors.New(\"`path` must be string\")\n\t\t\t}\n\n\t\t\tvar res interface{}\n\t\t\tif err := json.Unmarshal([]byte(blob), &res); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\treturn jsonpath.Read(res, path)\n\t\t},\n\t\t\"contains\": func(args ...interface{}) (interface{}, error) {\n\t\t\tif len(args) != 2 {\n\t\t\t\treturn nil, errors.New(\"usage: contains(string, substring)\")\n\t\t\t}\n\n\t\t\ts1, ok1 := args[0].(string)\n\t\t\ts2, ok2 := args[1].(string)\n\n\t\t\tif !ok1 || !ok2 {\n\t\t\t\treturn nil, errors.New(\"string and substring must be strings\")\n\t\t\t}\n\n\t\t\treturn strings.Contains(s1, s2), nil\n\t\t},\n\t\t\"second\": buildTimeFunc(\"second\"),\n\t\t\"minute\": buildTimeFunc(\"minute\"),\n\t\t\"hour\": buildTimeFunc(\"hour\"),\n\t\t\"day\": buildTimeFunc(\"day\"),\n\t\t\"weekday\": buildTimeFunc(\"weekday\"),\n\t}\n\n\texpr, err := govaluate.NewEvaluableExpressionWithFunctions(condtion, functions)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tparameters := map[string]interface{}{\n\t\t\"type\": event.Type(),\n\t\t\"payload\": string(event.Payload()),\n\t}\n\n\tfor k, v := range values {\n\t\tparameters[k] = v\n\t}\n\n\tres, err := expr.Evaluate(parameters)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tb, ok := res.(bool)\n\tif ok {\n\t\treturn b, nil\n\t}\n\n\treturn false, fmt.Errorf(\"unsupported return value: %#v (%s)\", res, reflect.TypeOf(res))\n}", "title": "" }, { "docid": "ae77262d0cead1bcc899d575d56de30b", "score": "0.44896284", "text": "func getProperty[TEnv any](mapVal, keyVal any) (any, error) {\n\tkeyExpr, err := coerce[TEnv, string](keyVal)\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err, \"parsing key of index expression\")\n\t}\n\n\tif mapExpr, ok := mapVal.(Expression[TEnv, map[string]string]); ok {\n\t\treturn propertyExpr[TEnv, string]{mapExpr, keyExpr}, nil\n\t}\n\tif mapExpr, ok := mapVal.(Expression[TEnv, map[string][]string]); ok {\n\t\treturn propertyExpr[TEnv, []string]{mapExpr, keyExpr}, nil\n\t}\n\tif dynamicMap, ok := mapVal.(indexExpressionBuilder[TEnv]); ok {\n\t\treturn dynamicMap.buildIndexExpression(keyExpr), nil\n\t}\n\treturn nil, trace.Wrap(unexpectedTypeError[map[string]string](mapVal), \"cannot take index of unexpected type\")\n}", "title": "" }, { "docid": "b2f329713ff2c4b05f5a6a52124bf596", "score": "0.4485885", "text": "func dict0(values ...interface{}) (map[string]interface{}, error) {\n\t// The idea and this nice implementation are from\n\t// https://stackoverflow.com/questions/18276173/calling-a-template-with-several-pipeline-parameters\n\tif len(values)%2 != 0 {\n\t\treturn nil, errors.New(\"invalid dict call\")\n\t}\n\tdict := make(map[string]interface{}, len(values)/2)\n\tfor i := 0; i < len(values); i += 2 {\n\t\tkey, ok := values[i].(string)\n\t\tif !ok {\n\t\t\treturn nil, errors.New(\"dict keys must be strings\")\n\t\t}\n\t\tdict[key] = values[i+1]\n\t}\n\treturn dict, nil\n}", "title": "" }, { "docid": "79485d9853a04102ba4cc9b06fcf74b4", "score": "0.4473918", "text": "func getRequestParams(path string) (*BuiltRoute, map[int]string) {\n\trouter := getRouter()\n\n\tvar builtRouteList *BuiltRoute\n\tparams := make(map[int]string)\n\n\tfor _, route := range router.built {\n\t\trgx := regexp.MustCompile(route.KeyRoute)\n\t\tif rgx.FindString(path) != \"\" {\n\t\t\tif (len(strings.Split(\n\t\t\t\trgx.Split(path, -1)[1], \"/\")) - 1) == len(route.Var) {\n\t\t\t\tbuiltRouteList = route\n\t\t\t\tfor idx, val := range strings.Split(rgx.Split(path, -1)[1],\n\t\t\t\t\t\"/\") {\n\t\t\t\t\tif idx != 0 {\n\t\t\t\t\t\tparams[idx-1] = val\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn builtRouteList, params\n}", "title": "" }, { "docid": "db56cd114643ba9d203f75d4a0a80b92", "score": "0.44680956", "text": "func expandTargetExecutionConfigsMap(c *Client, f map[string]TargetExecutionConfigs, res *Target) (map[string]interface{}, error) {\n\tif f == nil {\n\t\treturn nil, nil\n\t}\n\n\titems := make(map[string]interface{})\n\tfor k, item := range f {\n\t\ti, err := expandTargetExecutionConfigs(c, &item, res)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif i != nil {\n\t\t\titems[k] = i\n\t\t}\n\t}\n\n\treturn items, nil\n}", "title": "" }, { "docid": "a0cbcec8affa2d966faf1fd3dcf7e594", "score": "0.4465929", "text": "func ParseKeyMaps(params []string) (map[string]string, error) {\n\tkeymap := map[string]string{}\n\n\tfor _, p := range params {\n\t\tparts := keymapRegex.FindStringSubmatch(p)\n\t\tif len(parts) < 3 {\n\t\t\treturn nil, fmt.Errorf(\"invalid parameter (%s), must be in MAP[KEY] format\", p)\n\t\t}\n\n\t\tmapName := strings.TrimSpace(parts[1])\n\t\tif mapName == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"invalid parameter (%s), map is requried\", p)\n\t\t}\n\n\t\tkey := strings.TrimSpace(parts[2])\n\t\tif key == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"invalid parameter (%s), key is required\", p)\n\t\t}\n\n\t\tkeymap[mapName] = key\n\t}\n\n\treturn keymap, nil\n}", "title": "" }, { "docid": "cc3ee0ee4a0e6c0918f0d43ed05b7039", "score": "0.4448333", "text": "func (a Assign) Evaluate(environment map[string]expr.Expression) map[string]expr.Expression {\n\n\tnewEnvironment := make(map[string]expr.Expression)\n\t// copy key-values from original environment\n\tfor name, expr := range environment {\n\t\tnewEnvironment[name] = expr.Evaluate(environment)\n\t}\n\n\tnewEnvironment[a.Name] = a.Expression.Evaluate(environment)\n\n\treturn newEnvironment\n}", "title": "" }, { "docid": "89eebf523931898a752c390b9b9c5605", "score": "0.44441798", "text": "func expandGrpcRouteRulesActionFaultInjectionPolicyMap(c *Client, f map[string]GrpcRouteRulesActionFaultInjectionPolicy, res *GrpcRoute) (map[string]interface{}, error) {\n\tif f == nil {\n\t\treturn nil, nil\n\t}\n\n\titems := make(map[string]interface{})\n\tfor k, item := range f {\n\t\ti, err := expandGrpcRouteRulesActionFaultInjectionPolicy(c, &item, res)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif i != nil {\n\t\t\titems[k] = i\n\t\t}\n\t}\n\n\treturn items, nil\n}", "title": "" }, { "docid": "371d0f9a13da7182998bd98b70db0f3f", "score": "0.44432408", "text": "func expandTargetRunMap(c *Client, f map[string]TargetRun, res *Target) (map[string]interface{}, error) {\n\tif f == nil {\n\t\treturn nil, nil\n\t}\n\n\titems := make(map[string]interface{})\n\tfor k, item := range f {\n\t\ti, err := expandTargetRun(c, &item, res)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif i != nil {\n\t\t\titems[k] = i\n\t\t}\n\t}\n\n\treturn items, nil\n}", "title": "" }, { "docid": "a887ff3c485702a542c27d82805922c0", "score": "0.44406313", "text": "func (hm *HashMap) Do(procedures ...func(v interface{})) {\n\tfor _, n := range hm.buckets {\n\t\tfor ; n != nil; n = n.next {\n\t\t\tfor _, procedure := range procedures {\n\t\t\t\tprocedure(n.value)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4695da02a8fec0492631356bc12c8e65", "score": "0.44366062", "text": "func getMethodsMap(methodsStr string) map[string]bool {\n\tresult := map[string]bool{}\n\tif methodsStr == \"\" {\n\t\tgenerators.Each(func(gen Generator) {\n\t\t\tresult[gen.name] = true\n\t\t})\n\t\treturn result\n\t}\n\n\tvalidMethods := map[string]bool{}\n\tgenerators.Each(func(gen Generator) {\n\t\tvalidMethods[gen.name] = true\n\t})\n\n\tfor _, method := range strings.Split(methodsStr, \",\") {\n\t\tif _, ok := validMethods[method]; ok {\n\t\t\tresult[method] = true\n\t\t} else {\n\t\t\tlog.Fatalf(\"Error: -method parameter '%s' is not valid\", method)\n\t\t}\n\t}\n\n\treturn result\n}", "title": "" }, { "docid": "4503085a02f30a761ece5d24c4a43586", "score": "0.4419705", "text": "func (me ExprFunction) evaluate(context map[string]IData) IData {\n\tif me.left == nil || context == nil {\n\t\treturn boolDataFalse\n\t}\n\t// return true for \"<left> like <right>\" if\n\tvar params []IData\n\tif me.list != nil {\n\t\tfor _, xp := range me.list.exprs {\n\t\t\tif xp.isResolvable() {\n\t\t\t\tparams = append(params, xp.evaluate(context))\n\t\t\t}\n\t\t}\n\t}\n\tleftData := me.left.evaluate(context)\n\tfuncName := leftData.toString()\n\tif f, ok := getFunctions()[funcName]; ok {\n\t\treturn f.derive(params)\n\t}\n\treturn boolDataFalse\n}", "title": "" }, { "docid": "352b50c37c44c6cba2217c62537a89f1", "score": "0.44135427", "text": "func GetFragmentParameterAll(u *url.URL, key string) []string {\r\n\tvalues, err := url.ParseQuery(u.Fragment)\r\n\tif err != nil {\r\n\t\tlog.Println(\"Error: Could not parse Fragment params\")\r\n\t\tlog.Println(err)\r\n\t\treturn values[key]\r\n\t}\r\n\treturn values[key]\r\n}", "title": "" }, { "docid": "5ef4eda5f58f7008cc823f240fb49ff0", "score": "0.4404654", "text": "func expandGrpcRouteRulesMatchesHeadersMap(c *Client, f map[string]GrpcRouteRulesMatchesHeaders, res *GrpcRoute) (map[string]interface{}, error) {\n\tif f == nil {\n\t\treturn nil, nil\n\t}\n\n\titems := make(map[string]interface{})\n\tfor k, item := range f {\n\t\ti, err := expandGrpcRouteRulesMatchesHeaders(c, &item, res)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif i != nil {\n\t\t\titems[k] = i\n\t\t}\n\t}\n\n\treturn items, nil\n}", "title": "" }, { "docid": "c5d62530139d29ffc5d07c8bb232dbb7", "score": "0.44021598", "text": "func (f stringLikeFunc) evaluate(values map[string][]string) bool {\n\trequestValue, ok := values[http.CanonicalHeaderKey(f.k.Name())]\n\tif !ok {\n\t\trequestValue = values[f.k.Name()]\n\t}\n\n\tfvalues := f.values.ApplyFunc(substFuncFromValues(values))\n\n\tfor _, v := range requestValue {\n\t\tif !fvalues.FuncMatch(wildcard.Match, v).IsEmpty() {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}", "title": "" } ]
a3fd9873d372f2c9ecc3442d1d1ae853
ActiveCount is the count of the workers who are active and doing work
[ { "docid": "4481687b946fee9c1c982a688b869a5b", "score": "0.6891768", "text": "func (pool *Pool) ActiveCount() int {\n\treturn pool.itemsMarker.Count()\n}", "title": "" } ]
[ { "docid": "81fec91cf663575ed724b9b60a65fa8c", "score": "0.7430736", "text": "func (ftp *FixedTaskPool) ActiveWorkersCount() int {\n\n\tftp.workersLock.Lock()\n\tdefer ftp.workersLock.Unlock()\n\n\tactiveCount := 0\n\tfor _, curWorker := range ftp.workers {\n\n\t\tif !curWorker.isIdle() {\n\n\t\t\tactiveCount++\n\t\t}\n\t}\n\n\treturn activeCount\n\n}", "title": "" }, { "docid": "1603da0de69d9c8bb650b611bba0e8ab", "score": "0.71234447", "text": "func (this *BeanstalkdPool) ActiveCount() int {\n\tthis.mu.Lock()\n\tactive := this.active\n\tthis.mu.Unlock()\n\treturn active\n}", "title": "" }, { "docid": "9eeab47aeb085a661005fd6190fe0fa6", "score": "0.702541", "text": "func (m *workersManager) activeWorkers() int {\n\treturn m.activeCnt\n}", "title": "" }, { "docid": "72cf0bd1b15a15f9cefdcc083faa3733", "score": "0.69320744", "text": "func (p *Pool) ActiveCount() int {\n\tp.mu.Lock()\n\tactive := p.active\n\tp.mu.Unlock()\n\treturn active\n}", "title": "" }, { "docid": "cb12cd7f0748b92ef21e78debf2457fa", "score": "0.6906734", "text": "func (p *pool) getActiveWorkers() int { return p.activeWorkers }", "title": "" }, { "docid": "c4ea6214914c5f599e9bbd3dd7f414b8", "score": "0.67238134", "text": "func (np *Pool) GetActiveCount() (count int) {\n\tnp.mmx.RLock()\n\tdefer np.mmx.RUnlock()\n\n\tfor _, node := range np.Nodes {\n\t\tif node.IsActive() {\n\t\t\tcount++\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "7c2ce59186a4932f49758578e4873a75", "score": "0.6628213", "text": "func (t *ThreadTracker) NumActiveThreads() uint64 {\n\tt.mutexCount.Lock()\n\tdefer t.mutexCount.Unlock()\n\n\treturn t.count\n}", "title": "" }, { "docid": "4e430ac78e84247bf63af206dffb1682", "score": "0.6581476", "text": "func (p Performance) ActiveJobCount() int {\n\treturn p.Dispatched.LoadProcesss + p.Dispatched.CopyJobs +\n\t\tp.Pending.LoadProcesss + p.Pending.CopyJobs +\n\t\tp.Running.LoadProcesss + p.Running.CopyJobs\n}", "title": "" }, { "docid": "fdbe870d65a7d2ca664d05e6d1bcc8a5", "score": "0.6536204", "text": "func (p Performance) ActiveQueryCount() int {\n\treturn p.Dispatched.QueryJobs + p.Dispatched.QueryJobs +\n\t\tp.Pending.QueryJobs + p.Pending.QueryJobs +\n\t\tp.Running.QueryJobs + p.Running.QueryJobs\n}", "title": "" }, { "docid": "c7eb9b8866fff0d3fe035b57b534b59d", "score": "0.65232474", "text": "func (p *Pool) ActiveWorkers() int64 {\n\treturn p.currentGoroutines.Load()\n}", "title": "" }, { "docid": "a8570f785808c04938be76eca473c5b8", "score": "0.64488417", "text": "func (p *Pool) WorkerCount() int {\n\treturn p.wCount\n}", "title": "" }, { "docid": "2ec0e484b87cb048bf00435e0a7e3ec9", "score": "0.6368203", "text": "func (s *Scheduler) activeHostCount() int {\n\tcount := 0\n\tfor _, host := range s.hosts {\n\t\tif !host.Shutdown {\n\t\t\tcount++\n\t\t}\n\t}\n\treturn count\n}", "title": "" }, { "docid": "a27a2d38c9f4544d25527cd2b02e686a", "score": "0.6360236", "text": "func (_UniqueAppendOnlyAddressList *UniqueAppendOnlyAddressListCallerSession) NumOfActive() (*big.Int, error) {\n\treturn _UniqueAppendOnlyAddressList.Contract.NumOfActive(&_UniqueAppendOnlyAddressList.CallOpts)\n}", "title": "" }, { "docid": "10516922bcfff42f2dcffe098bd9f025", "score": "0.62885875", "text": "func (pool *Pool) Count() int {\n\treturn pool.Pending() + pool.ActiveCount()\n}", "title": "" }, { "docid": "028f1856b1305dece8995d59712c6ccb", "score": "0.6272801", "text": "func (p *workerPool) incNumberOfWorkers() {\n\tp.numberOfWorkers++\n}", "title": "" }, { "docid": "c1fa8a7d75d95684845da8e6ba478560", "score": "0.61849064", "text": "func (rq *runQueue) WorkerCount() int {\n\trq.workersMutex.RLock()\n\tdefer rq.workersMutex.RUnlock()\n\n\treturn len(rq.workers)\n}", "title": "" }, { "docid": "faa2e65e5ffd53fb0d298ca91741c454", "score": "0.61585397", "text": "func (_UniqueAppendOnlyAddressList *UniqueAppendOnlyAddressListSession) NumOfActive() (*big.Int, error) {\n\treturn _UniqueAppendOnlyAddressList.Contract.NumOfActive(&_UniqueAppendOnlyAddressList.CallOpts)\n}", "title": "" }, { "docid": "48bb6bccd6533c414b418cc501021008", "score": "0.6138957", "text": "func (i *manager) GetWorkersWorking() int {\n\ti.mutex.Lock()\n\tdefer i.mutex.Unlock()\n\treturn i.workerCount - i.jobsAccepted\n}", "title": "" }, { "docid": "a1d1f859f454892af4475f6950f5f0a4", "score": "0.61301893", "text": "func (this *ObjectPool) GetNumActive() int {\n\treturn this.allObjects.Size() - this.idleObjects.Size()\n}", "title": "" }, { "docid": "e364a9ad8032b40ba68616859798e1aa", "score": "0.6063693", "text": "func (_TokenList *TokenListCallerSession) NumOfActive() (*big.Int, error) {\n\treturn _TokenList.Contract.NumOfActive(&_TokenList.CallOpts)\n}", "title": "" }, { "docid": "a37f4f5c4ee604581cf42542d4605e1e", "score": "0.60590565", "text": "func (p *Machine) Active() int {\n\treturn int(atomic.LoadInt64(&p.started) - atomic.LoadInt64(&p.finished))\n}", "title": "" }, { "docid": "94195f8e36f7225c30139f23a1b1cfe2", "score": "0.60530686", "text": "func (p *Pool) startCount() {\n\tp.countWG.Add(1) //one job added for counter to complete\n\tgo func() {\n\t\tdefer p.countWG.Done()\n\t\tfor val := range p.counterPool {\n\t\t\tswitch val {\n\t\t\tcase 0:\n\t\t\t\tp.errCount++\n\t\t\tcase 1:\n\t\t\t\tp.successCount++\n\t\t\tcase 2:\n\t\t\t\tp.retryCount++\n\t\t\tcase 3:\n\t\t\t\tp.totalCount++\n\t\t\t}\n\t\t\tp.logProfile(p.totalCount, p.successCount, p.errCount, p.retryCount)\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "47ac3622bb68102c32fc7cd7d938af65", "score": "0.5968752", "text": "func (s *Scheduler) activeFormationCount(appID string) int {\n\tactiveReleases := make(map[string]struct{})\n\tfor _, job := range s.jobs {\n\t\tif job.IsRunning() && job.IsInApp(appID) {\n\t\t\tactiveReleases[job.Formation.Release.ID] = struct{}{}\n\t\t}\n\t}\n\treturn len(activeReleases)\n}", "title": "" }, { "docid": "9dfa8b397df115615016527f816a8e55", "score": "0.5966502", "text": "func (p *Pool) ActiveTasks() int64 {\n\treturn p.currentLoad.Load()\n}", "title": "" }, { "docid": "78d82dc6afc8233c620d548973b7955c", "score": "0.5964262", "text": "func Running() int {\r\n\treturn _pool.Running()\r\n}", "title": "" }, { "docid": "f515cef7c0a0c39901cda379f95c4c78", "score": "0.59074396", "text": "func (_UniqueAppendOnlyAddressList *UniqueAppendOnlyAddressListCaller) NumOfActive(opts *bind.CallOpts) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _UniqueAppendOnlyAddressList.contract.Call(opts, &out, \"numOfActive\")\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "791980332f110e3e8720ad6d0574e1bc", "score": "0.59039366", "text": "func (g *group) incrActive() Counts {\n\tg.cmu.Lock()\n\tdefer g.cmu.Unlock()\n\tg.counts.Active++\n\tg.notify()\n\treturn g.counts\n}", "title": "" }, { "docid": "8e77debb9bc6099f97c5a8046fd1470d", "score": "0.5891767", "text": "func WorkerCount(customObject providerv1alpha1.AzureConfig) int {\n\treturn len(customObject.Spec.Azure.Workers)\n}", "title": "" }, { "docid": "8426a0617103b80aec48c795d4f87e9b", "score": "0.588436", "text": "func (p *Pool) Active() int {\n\treturn int(atomic.LoadInt32(&p.active))\n}", "title": "" }, { "docid": "f9b264918dcab677ebd8b6d291832bce", "score": "0.5865054", "text": "func (cube conwayCube) countActive() int {\n\tresult := 0\n\tfor xx := 0; xx < cube.width(); xx++ {\n\t\tfor yy := 0; yy < cube.height(); yy++ {\n\t\t\tfor zz := 0; zz < cube.depth(); zz++ {\n\t\t\t\tif cube.at(xx, yy, zz) {\n\t\t\t\t\tresult++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn result\n}", "title": "" }, { "docid": "cd463dd2a61c43e23ee935758dfb9506", "score": "0.5854087", "text": "func (m *AgentPool) Count() int {\n\tvar out int\n\tm.withLock(func() {\n\t\tfor _, agents := range m.agents {\n\t\t\tfor _, agent := range agents {\n\t\t\t\tif agent.getState() == agentStateConnected {\n\t\t\t\t\tout++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t})\n\n\treturn out\n}", "title": "" }, { "docid": "3959209d6ed44418eb20b4db9bf4a3ab", "score": "0.58447397", "text": "func (ftp *FixedTaskPool) IdleWorkersCount() int {\n\n\tftp.workersLock.Lock()\n\tdefer ftp.workersLock.Unlock()\n\n\tidleCount := 0\n\tfor _, curWorker := range ftp.workers {\n\n\t\tif curWorker.isIdle() {\n\n\t\t\tidleCount++\n\t\t}\n\t}\n\n\treturn idleCount\n}", "title": "" }, { "docid": "4471ee4c0fe3af6ade19ad11a1456918", "score": "0.58412087", "text": "func (c *Controller) RunningWorkers() int {\n\treturn c.numberOfRunningWorkers\n}", "title": "" }, { "docid": "a75e80a2ebacf341aecd5615c17f009e", "score": "0.5834564", "text": "func (s *Stats) CurrentWorkers() int {\n\tn, _ := strconv.ParseUint(s.m[\"current-workers\"], 10, 64)\n\treturn int(n)\n}", "title": "" }, { "docid": "02bb7f0447eea1d7746a269cbc88bb4a", "score": "0.58308226", "text": "func (w WorkerPool) Running() int {\n\treturn cap(w) - len(w)\n}", "title": "" }, { "docid": "3238044b53bf74dd5e17e0d9ce9cf937", "score": "0.58224946", "text": "func NumActiveStatements() int64 {\n\treturn atomic.LoadInt64(&activeStatements)\n}", "title": "" }, { "docid": "3238044b53bf74dd5e17e0d9ce9cf937", "score": "0.58224946", "text": "func NumActiveStatements() int64 {\n\treturn atomic.LoadInt64(&activeStatements)\n}", "title": "" }, { "docid": "c66025c955fb0e4e9f82b341f38d9cc7", "score": "0.5822435", "text": "func (_TokenList *TokenListSession) NumOfActive() (*big.Int, error) {\n\treturn _TokenList.Contract.NumOfActive(&_TokenList.CallOpts)\n}", "title": "" }, { "docid": "f889ea06294c19ce67153567f240f2cf", "score": "0.58173233", "text": "func (_TokenList *TokenListCaller) NumOfActive(opts *bind.CallOpts) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _TokenList.contract.Call(opts, &out, \"numOfActive\")\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "d53908e5fe0c4b189d44efb0f9a7740b", "score": "0.5810433", "text": "func (o ConnectorCapacityProvisionedCapacityOutput) WorkerCount() pulumi.IntOutput {\n\treturn o.ApplyT(func(v ConnectorCapacityProvisionedCapacity) int { return v.WorkerCount }).(pulumi.IntOutput)\n}", "title": "" }, { "docid": "b8ff9266dcae2ae0b6c21fe825ea1a41", "score": "0.5809208", "text": "func getNumberOfWorkers() int {\n\tif runtime.NumCPU() < 4 {\n\t\treturn 25\n\t}\n\treturn 50\n}", "title": "" }, { "docid": "0eeb42a9a44c2b445c03ceb5790e267b", "score": "0.5767961", "text": "func (jm *jobMgr) ActiveConnections() int64 {\n\treturn atomic.LoadInt64(&jm.atomicCurrentConcurrentConnections)\n}", "title": "" }, { "docid": "3ca0197ab1e2a03dc2bd1a0fe5f07f2d", "score": "0.5752048", "text": "func (a *Actors) Count() int {\n\treturn len(a.accounts) + len(a.miners)\n}", "title": "" }, { "docid": "fe9c2e3e7478294795b6358891e8ea2e", "score": "0.5745306", "text": "func (m *SchedulerMetrics) IncActiveNodes() {\n\tm.activeNodes.Inc()\n}", "title": "" }, { "docid": "d193fbf3c684752ceaef791c467f5f53", "score": "0.5718735", "text": "func (p *Pool) workerStatus() {\n\tp.mtx.RLock()\n\tdefer p.mtx.RUnlock()\n\n\td := color.New(color.FgBlack, color.Bold)\n\tmsg := fmt.Sprintf(\"---%v WORKER STATUS---\\n\", p.getTag())\n\tif p.consoleLog {\n\t\td.Print(msg)\n\t} else {\n\t\tlogrus.Print(msg)\n\t}\n\n\tfor _, w := range p.workerPool {\n\t\tif w.working {\n\t\t\tmsg = fmt.Sprintf(\"Value %v Error %v\\n\",\n\t\t\t\tw.job.GetValue(), w.job.GetError())\n\t\t\tif p.consoleLog {\n\t\t\t\td = color.New(color.FgBlack)\n\t\t\t\td.Print(msg)\n\t\t\t} else {\n\t\t\t\tlogrus.Print(msg)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ea8a0882abc660d3b3d99d2e68948619", "score": "0.57039213", "text": "func (p *Pool) incActive() {\n\tatomic.AddInt32(&p.active, 1)\n}", "title": "" }, { "docid": "6833738aa5c646a214e4a8896807b9aa", "score": "0.56730354", "text": "func (c *Client) Count(name string, count int) {\n\tc.muster.Work <- countStat{Name: name, Count: count}\n}", "title": "" }, { "docid": "5d35beac104f417079641605d5c7fe36", "score": "0.56685865", "text": "func (cnh *ConcreteNodeExecutor) Count() int {\n\treturn 1\n}", "title": "" }, { "docid": "29ed0a44a41a8fc9914f6b20bbb6f1c7", "score": "0.5658588", "text": "func (w Worker) GetTotalActiveTimeNs() int64 {\n\treturn w.totalProcessingTimeNs\n}", "title": "" }, { "docid": "35840573fde67c09935c9d4fcc3f73cc", "score": "0.5655736", "text": "func (r *Radish) NumWorkers() int {\n\tr.RLock()\n\tdefer r.RUnlock()\n\n\t// Refresh the workers gauge\n\tpmWorkers.Set(float64(len(r.workers)))\n\n\treturn len(r.workers)\n}", "title": "" }, { "docid": "e7784b27e31476d713016d1559cedccb", "score": "0.5620178", "text": "func (q *ManagedQueue) NumberOfWorkers() int {\n\tif q.Pool != nil {\n\t\treturn q.Pool.NumberOfWorkers()\n\t}\n\treturn -1\n}", "title": "" }, { "docid": "4668d58e317c460e20c7932c801ac848", "score": "0.5617027", "text": "func NumProcs() int32 {\n\treturn atomic.LoadInt32(&numThreads)\n}", "title": "" }, { "docid": "db1a34b722d12d92dba797022e733da4", "score": "0.56111497", "text": "func (s *Scheduler) Count()(int) {\n\treturn len(s.cancellations)\n}", "title": "" }, { "docid": "af0704c61b71b85a7ce8fcd1ff44e3a9", "score": "0.56090564", "text": "func (w *WebSockets) IncrementActiveClients() { w.clientsCounter.Inc() }", "title": "" }, { "docid": "dd6f88eb754b988567bc07f34c120ffb", "score": "0.5597244", "text": "func GetUserCountActive(dbMap *gorp.DbMap) int64 {\n\tuserCountActive, err := dbMap.SelectInt(\"SELECT COUNT(*) FROM Users \" +\n\t\t\"WHERE MultiSigAddress <> ''\")\n\tif err != nil {\n\t\treturn int64(0)\n\t}\n\n\treturn userCountActive\n}", "title": "" }, { "docid": "971aff4f5c943b989a19f6fbb2913f07", "score": "0.5593365", "text": "func (o *Bins) Nactive() (nactive int) {\n\tfor _, bin := range o.All {\n\t\tif bin != nil {\n\t\t\tnactive++\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "e3ea53e797ea078078e2e5fbf927c830", "score": "0.5592196", "text": "func (m *inMemory) Count() int {\n\treturn len(m.tasks)\n}", "title": "" }, { "docid": "48495c4a75fe53f4c77db64c54e9e89e", "score": "0.5581934", "text": "func (sparkWorkerDeployment SparkWorkerDeployment) getWorkerNumFromMaster() (int,error) {\n\tclusterInfo,err:=sparkWorkerDeployment.getClusterInfo()\n\tif err!=nil{\n\t\treturn -1,err\n\t}\n\tworkerCount:=0\n\tfor i:=0;i<len(strings.Split(jsoniter.Get(clusterInfo, \"workers\").ToString(),\"},\"));i++{\n\t\tworkerInfo:=jsoniter.Get(clusterInfo, \"workers\",i).ToString()\n\t\tif jsoniter.Get([]byte(workerInfo), \"state\",).ToString()==\"ALIVE\" {\n\t\t\tworkerCount+=1\n\t\t}\n\t}\n\treturn workerCount,nil\n}", "title": "" }, { "docid": "fc07f18f324324ff946450530477250c", "score": "0.55784196", "text": "func (g *GameDelegate) NumActivePlayers(state boardgame.ImmutableState) int {\n\tcount := 0\n\tfor _, p := range state.ImmutablePlayerStates() {\n\t\tif behaviors.PlayerIsInactive(p) {\n\t\t\tcontinue\n\t\t}\n\t\tcount++\n\t}\n\treturn count\n}", "title": "" }, { "docid": "3c3f7d77e78962d68382022863a53fcc", "score": "0.55320424", "text": "func reqAliveCount(c controllerChannels, client *rpc.Client, close chan bool, ticker *time.Ticker) {\n\treq1 := \"req\"\n\tvar cells int\n\tvar turn int\n\tres2 := AliveCellsReport{cells, turn}\n\tfor {\n\t\tselect {\n\t\t//if we get a signal through the close channel, we will stop the function\n\t\tcase <-close:\n\t\t\treturn\n\t\tdefault:\n\t\t\tselect {\n\t\t\tcase <-ticker.C:\n\t\t\t\terr := client.Call(AliveCells, req1, &res2)\n\t\t\t\tif err != nil {\n\t\t\t\t\tpanic(err)\n\t\t\t\t}\n\t\t\t\tc.events <- AliveCellsCount{res2.Turns, res2.Alive}\n\t\t\tdefault:\n\t\t\t\ttime.Sleep(100 * time.Millisecond)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a8f46379cd4a063123c5f635b3fa9c30", "score": "0.5523732", "text": "func (p *Prober) activeProbes() int {\n\tp.mu.Lock()\n\tdefer p.mu.Unlock()\n\treturn len(p.probes)\n}", "title": "" }, { "docid": "a8f46379cd4a063123c5f635b3fa9c30", "score": "0.5523732", "text": "func (p *Prober) activeProbes() int {\n\tp.mu.Lock()\n\tdefer p.mu.Unlock()\n\treturn len(p.probes)\n}", "title": "" }, { "docid": "07f385ead895e6957fd7274d865904df", "score": "0.55077374", "text": "func (instance *StatsdMetrics) Work() {\n\tif instance == nil {\n\t\treturn\n\t}\n\n\tpromisedTransactions := instance.promisedTransactions\n\tpromisedTransfers := instance.promisedTransfers\n\tcommittedTransactions := instance.committedTransactions\n\tcommittedTransfers := instance.committedTransfers\n\trollbackedTransactions := instance.rollbackedTransactions\n\trollbackedTransfers := instance.rollbackedTransfers\n\n\tatomic.AddInt64(&(instance.promisedTransactions), -promisedTransactions)\n\tatomic.AddInt64(&(instance.promisedTransfers), -promisedTransfers)\n\tatomic.AddInt64(&(instance.committedTransactions), -committedTransactions)\n\tatomic.AddInt64(&(instance.committedTransfers), -committedTransfers)\n\tatomic.AddInt64(&(instance.rollbackedTransactions), -rollbackedTransactions)\n\tatomic.AddInt64(&(instance.rollbackedTransfers), -rollbackedTransfers)\n\n\ttags := []string{\"tenant:\" + instance.tenant}\n\n\tinstance.client.Count(\"openbank.ledger.transaction.promised\", promisedTransactions, tags, 1)\n\tinstance.client.Count(\"openbank.ledger.transfer.promised\", promisedTransfers, tags, 1)\n\tinstance.client.Count(\"openbank.ledger.transaction.committed\", committedTransactions, tags, 1)\n\tinstance.client.Count(\"openbank.ledger.transfer.committed\", committedTransfers, tags, 1)\n\tinstance.client.Count(\"openbank.ledger.transaction.rollbacked\", rollbackedTransactions, tags, 1)\n\tinstance.client.Count(\"openbank.ledger.transfer.rollbacked\", rollbackedTransfers, tags, 1)\n}", "title": "" }, { "docid": "bdd49af4520a39c63d6ebe3d1d8ba428", "score": "0.55038357", "text": "func (q *QueuedPool) Count() uint64 {\n\n\trespChan := make(chan uint64)\n\n\tq.CountTxsChan <- CountRequest{ResponseChan: respChan}\n\n\treturn <-respChan\n\n}", "title": "" }, { "docid": "e07421a2a98f7d29a9ea4eb1fc5c3a84", "score": "0.54662585", "text": "func (c *CertSrv) GetActiveConnCount() uint64 {\n\t// Currently there is no function in sync/atomic to subtract two atomic variables.\n\t// In theory connEnd could be incremented after connBegin has been loaded, resulting\n\t// in a negative value. It should not happen, but it's better to handle it just in case.\n\tconnBegin := atomic.LoadUint64(&c.connBegin)\n\tconnEnd := atomic.LoadUint64(&c.connEnd)\n\tif connEnd > connBegin {\n\t\treturn connEnd - connBegin\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "3788f555b0157332acc95caaeaa8c8da", "score": "0.5464388", "text": "func (pool *pool) updateActiveTaskSize(increment int) int {\n\tpool.numLock.Lock()\n\tdefer pool.numLock.Unlock()\n\tpool.activeTaskSize += increment\n\treturn pool.activeTaskSize\n}", "title": "" }, { "docid": "830167f5a2691cbc8dc088e377c18a1a", "score": "0.54629606", "text": "func (js *JobStatus) TasksCount() int {\n\treturn geparser.GetTaskCount(&js.js)\n}", "title": "" }, { "docid": "c26d7ec78deee705bcb7ecaa05abf955", "score": "0.5456523", "text": "func (p *LookupPartition) BusyCount() int {\n\tp.mu.RLock()\n\tdefer p.mu.RUnlock()\n\treturn int(p.busy)\n}", "title": "" }, { "docid": "53269b3160d6fef18c8b0289ef2bbcdb", "score": "0.5454749", "text": "func (s *ObservableSplitStorageImpl) Count() int {\n\treturn s.active.count()\n}", "title": "" }, { "docid": "b38957e0b43136b8cbff3ec5dc7fb098", "score": "0.5453947", "text": "func (instance *StatsdMetrics) Work() {\n\tif instance == nil {\n\t\treturn\n\t}\n\n\taccountCreated := instance.createdAccounts\n\taccountUpdated := instance.updatedSnapshots\n\tpromisesAccepted := instance.promisesAccepted\n\tcommitsAccepted := instance.commitsAccepted\n\trollbacksAccepted := instance.rollbacksAccepted\n\n\tatomic.AddInt64(&(instance.createdAccounts), -accountCreated)\n\tatomic.AddInt64(&(instance.updatedSnapshots), -accountUpdated)\n\tatomic.AddInt64(&(instance.promisesAccepted), -promisesAccepted)\n\tatomic.AddInt64(&(instance.commitsAccepted), -commitsAccepted)\n\tatomic.AddInt64(&(instance.rollbacksAccepted), -rollbacksAccepted)\n\n\ttags := []string{\"tenant:\" + instance.tenant}\n\n\tinstance.client.Count(\"openbank.vault.account.created\", accountCreated, tags, 1)\n\tinstance.client.Count(\"openbank.vault.account.updated\", accountUpdated, tags, 1)\n\tinstance.client.Count(\"openbank.vault.promise.accepted\", promisesAccepted, tags, 1)\n\tinstance.client.Count(\"openbank.vault.promise.committed\", commitsAccepted, tags, 1)\n\tinstance.client.Count(\"openbank.vault.promise.rollbacked\", rollbacksAccepted, tags, 1)\n}", "title": "" }, { "docid": "b4be31e4aef74e2ce93f2dede7afe739", "score": "0.5437543", "text": "func (o *NodeDTO) GetActiveThreadCount() int32 {\n\tif o == nil || o.ActiveThreadCount == nil {\n\t\tvar ret int32\n\t\treturn ret\n\t}\n\treturn *o.ActiveThreadCount\n}", "title": "" }, { "docid": "33b3a9f59a1eaaeddfc2f65e59e22729", "score": "0.54365116", "text": "func CountWeight() int {\n\tvar weight = 6\n\tif os.Getenv(\"PRIMARY\") != \"\" {\n\t\tweight = 12\n\t}\n\tif os.Getenv(\"SECONDARY\") != \"\" {\n\t\tweight = 4\n\t}\n\treturn weight\n}", "title": "" }, { "docid": "a048fdf99dfa1e9f5b942c7bad43c90c", "score": "0.5425874", "text": "func (s *LookupPartitionStrategy) BusyCount() int {\n\ts.mu.RLock()\n\tdefer s.mu.RUnlock()\n\treturn int(s.busy)\n}", "title": "" }, { "docid": "5dd9f9e6b1ccb8d5947833e2ff52293f", "score": "0.5413672", "text": "func (this *Pool) QueryCount() (int32, int32) {\n\treturn this.syncTaskCount, this.asyncTaskCount\n}", "title": "" }, { "docid": "f554437f3df20753402ac1e39ffbed3c", "score": "0.541306", "text": "func WorkerCount(n int) Option {\n\treturn func(o *options) {\n\t\to.workerCount = n\n\t}\n}", "title": "" }, { "docid": "d0d5a7eb248186417bf162c2f0f21423", "score": "0.5412666", "text": "func (s State) outstandingWork() map[string]uint64 {\n\toutstanding := make(map[string]uint64)\n\tfor _, work := range s.work {\n\t\tif !work.complete {\n\t\t\toutstanding[work.title]++\n\t\t}\n\t}\n\treturn outstanding\n}", "title": "" }, { "docid": "8f12e1c57bb65aacfeaf863837d947b6", "score": "0.54063493", "text": "func (instance *StatsdMetrics) Work() {\n\tif instance == nil {\n\t\treturn\n\t}\n\n\tcreatedTokens := instance.createdTokens\n\tdeletedTokens := instance.deletedTokens\n\timportedTransactions := instance.importedTransactions\n\timportedTransfers := instance.importedTransfers\n\tdownloadedStatements := instance.downloadedStatements\n\n\tatomic.AddInt64(&(instance.createdTokens), -createdTokens)\n\tatomic.AddInt64(&(instance.deletedTokens), -deletedTokens)\n\tatomic.AddInt64(&(instance.importedTransactions), -importedTransactions)\n\tatomic.AddInt64(&(instance.importedTransfers), -importedTransfers)\n\tatomic.AddInt64(&(instance.downloadedStatements), -downloadedStatements)\n\n\ttags := []string{\"tenant:\" + instance.tenant}\n\n\tinstance.client.Count(\"openbank.bco.bondster.token.created\", createdTokens, tags, 1)\n\tinstance.client.Count(\"openbank.bco.bondster.token.deleted\", deletedTokens, tags, 1)\n\tinstance.client.Count(\"openbank.bco.bondster.transaction.imported\", importedTransactions, tags, 1)\n\tinstance.client.Count(\"openbank.bco.bondster.transfer.imported\", importedTransfers, tags, 1)\n\tinstance.client.Count(\"openbank.bco.bondster.statement.downloaded\", downloadedStatements, tags, 1)\n}", "title": "" }, { "docid": "11a11ca00a5c2b10b449bfa61ea06b90", "score": "0.54035264", "text": "func TaskWorkerCount(count int) Option {\n\treturn libipfs.TaskWorkerCount(count)\n}", "title": "" }, { "docid": "d42a72df1adf52359973c5aef7e27153", "score": "0.53951263", "text": "func CountOccupied(cb Chessboard) int {\n\tpanic(\"Please implement CountOccupied()\")\n}", "title": "" }, { "docid": "30c425cab480ffcf071c7165d4d5ef3d", "score": "0.5392408", "text": "func (c *ClientsPool) Num() int {\n\treturn c.clients.Len()\n}", "title": "" }, { "docid": "3873a5ed292612bfecb165b52e837c4d", "score": "0.5391927", "text": "func (c *poolConn) incActive() {\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\tc.active++\n}", "title": "" }, { "docid": "68569ade9bbf4c0468c6847b4d2aa9b0", "score": "0.5390247", "text": "func (s State) startedWork() map[string]uint64 {\n\tstarted := make(map[string]uint64)\n\tfor _, work := range s.work {\n\t\tstarted[work.title]++\n\t}\n\treturn started\n}", "title": "" }, { "docid": "0d7137b7c0318f8d5c717aa51dbc8474", "score": "0.5382102", "text": "func (a *appSupervisor) ServiceCount() int {\n a.Lock()\n defer a.Unlock()\n\n return len(a.services)\n}", "title": "" }, { "docid": "8644cf2011619ff9fb7b9efff31331e5", "score": "0.536988", "text": "func (om OperationsManager) Count(val s.Value) {\n\tn := om.tm.Count(val)\n\tfmt.Println(n)\n}", "title": "" }, { "docid": "46eda28d99c11848cc24a669c8467f55", "score": "0.53556347", "text": "func Count() uint78", "title": "" }, { "docid": "af7d7d6a2737bf21d2e7819e747fa0c4", "score": "0.535431", "text": "func (p *Pool) Running() int {\n\treturn p.antsPool.Running()\n}", "title": "" }, { "docid": "fb71da15cfb2bd51cd717bab1088c5b3", "score": "0.53529274", "text": "func numJobs(d int) (n int) {\n\tn = runtime.NumCPU()\n\tif n > d {\n\t\tn = d\n\t}\n\treturn\n}", "title": "" }, { "docid": "ef4a744d95e7f6454892aff3b7c131cc", "score": "0.53448683", "text": "func (ts *RPCTCPServer) Count() int32 {\n\treturn atomic.LoadInt32(&ts.count)\n}", "title": "" }, { "docid": "aeb89d9ebc738bbf337e21d2207f1a2b", "score": "0.5343268", "text": "func (q *MongoQueue) CountFree() (c int, err error) {\n\tnow := time.Now().Unix()\n\tc, err = q.C.Find(bson.M{\n\t\t\"inprogress\": false,\n\t\t\"failed\": false,\n\t\t\"runat\": bson.M{\"$lte\": now},\n\t\t\"retries\": bson.M{\"$lte\": q.Settings.RetryLimit}}).Count()\n\n\treturn\n}", "title": "" }, { "docid": "0183504d428383568741a35ca1737cfc", "score": "0.53332263", "text": "func (runs *ActiveRuns) Inc() {\n\truns.lock.Lock()\n\truns.count++\n\truns.lock.Unlock()\n}", "title": "" }, { "docid": "05c70f3b1bcc5736cc99959ab23a4953", "score": "0.5332314", "text": "func (p *processor) MaxConcurent() int { return 0 }", "title": "" }, { "docid": "390d38000b7151bdb8d78694507765ec", "score": "0.5326642", "text": "func (cjh *ConcreteJointExecutor) Count() int {\n\treturn 1\n}", "title": "" }, { "docid": "610aedc6a295ead5bf9faf0472841db0", "score": "0.5325192", "text": "func (self *TaskManager) countTasks(jobId string, status string, kind string) int {\n\treturn len(self.listTasks(jobId, status, kind))\n}", "title": "" }, { "docid": "f43bb54eff7c6438b9baf8eb2d71f596", "score": "0.53245175", "text": "func (instance *Cluster) CountNodes(ctx context.Context) (count uint, xerr fail.Error) {\n\tdefer fail.OnPanic(&xerr)\n\n\tif instance == nil || instance.IsNull() {\n\t\treturn 0, fail.InvalidInstanceError()\n\t}\n\tif ctx == nil {\n\t\treturn 0, fail.InvalidParameterCannotBeNilError(\"ctx\")\n\t}\n\n\ttask, xerr := concurrency.TaskFromContext(ctx)\n\txerr = debug.InjectPlannedFail(xerr)\n\tif xerr != nil {\n\t\tswitch xerr.(type) {\n\t\tcase *fail.ErrNotAvailable:\n\t\t\ttask, xerr = concurrency.VoidTask()\n\t\t\tif xerr != nil {\n\t\t\t\treturn 0, xerr\n\t\t\t}\n\t\tdefault:\n\t\t\treturn 0, xerr\n\t\t}\n\t}\n\n\tif task.Aborted() {\n\t\treturn 0, fail.AbortedError(nil, \"aborted\")\n\t}\n\n\t// make sure no other parallel actions interferes\n\tinstance.lock.Lock()\n\tdefer instance.lock.Unlock()\n\n\txerr = instance.beingRemoved()\n\txerr = debug.InjectPlannedFail(xerr)\n\tif xerr != nil {\n\t\treturn 0, xerr\n\t}\n\n\txerr = instance.Inspect(func(_ data.Clonable, props *serialize.JSONProperties) fail.Error {\n\t\treturn props.Inspect(clusterproperty.NodesV3, func(clonable data.Clonable) fail.Error {\n\t\t\tnodesV3, ok := clonable.(*propertiesv3.ClusterNodes)\n\t\t\tif !ok {\n\t\t\t\treturn fail.InconsistentError(\"'*propertiesv3.ClusterNodes' expected, '%s' provided\", reflect.TypeOf(clonable).String())\n\t\t\t}\n\n\t\t\tcount = uint(len(nodesV3.PrivateNodes))\n\t\t\treturn nil\n\t\t})\n\t})\n\txerr = debug.InjectPlannedFail(xerr)\n\tif xerr != nil {\n\t\treturn 0, xerr\n\t}\n\n\treturn count, nil\n}", "title": "" }, { "docid": "1bd9c2dfa3fbadf43d45590e5d770417", "score": "0.53230053", "text": "func (i *manager) GetAvailableWorkers() int {\n\ti.mutex.Lock()\n\tdefer i.mutex.Unlock()\n\treturn i.workerCount\n}", "title": "" }, { "docid": "57543d4636b71f706ee8ee0d2d4a8a77", "score": "0.53215265", "text": "func (o *NodeDTO) SetActiveThreadCount(v int32) {\n\to.ActiveThreadCount = &v\n}", "title": "" }, { "docid": "2c2378ee133c1e4b2225318e8b36d5d6", "score": "0.532061", "text": "func (s SyncWorkersPool) Stats() runnerpool.Stats { return runnerpool.Stats{} }", "title": "" }, { "docid": "9ca4d5a477de0fbfb49e6b2fbe23fa60", "score": "0.5311526", "text": "func (jb *Job) Count(status string) (int, error) {\n\tvar count int\n\tquery := \"SELECT COUNT(*) as count FROM jobs\"\n\tswitch status {\n\tcase model.StatusActive:\n\t\tquery = fmt.Sprintf(\"%s WHERE status=\\\"%s\\\"\", query, model.StatusActive)\n\tcase model.StatusDraft:\n\t\tquery = fmt.Sprintf(\"%s WHERE status=\\\"%s\\\"\", query, model.StatusDraft)\n\t}\n\trows, err := jb.db.Query(query)\n\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\trows.Next()\n\terr = rows.Scan(&count)\n\treturn count, err\n}", "title": "" }, { "docid": "8088ef15020028ce30ef7469d157a8ab", "score": "0.5310933", "text": "func (pm *pathManager) GetNumActivePaths() int {\n\treturn len(pm.sess.Paths()) - len(pm.reusablePaths)\n}", "title": "" }, { "docid": "b0cf3c992635ee2f62e32d68dbe112b5", "score": "0.5306441", "text": "func Count(data []float64) int {\n\tch := make(chan int, numConcurrency)\n\n\tn := len(data)\n\td := divUp(n, numConcurrency)\n\n\tfor i := 0; i < numConcurrency; i++ {\n\t\tfrom := d * i\n\t\tto := min(d*(i+1), n)\n\n\t\tgo count(data, from, to, ch)\n\t}\n\n\tcnt := 0\n\n\tfor i := 0; i < numConcurrency; i++ {\n\t\tcnt += <-ch\n\t}\n\n\treturn cnt\n}", "title": "" } ]
039556127df6bcd42f4728ea8f27f71d
ValidateKeywords checks if the given denom begin with `TokenKeywords`
[ { "docid": "9ad8587df386c31029df6fb94081bc39", "score": "0.8417976", "text": "func ValidateKeywords(denom string) error {\n\tif regexpKeyword(denom) {\n\t\treturn sdkerrors.Wrapf(ErrInvalidSymbol, \"invalid token: %s, can not begin with keyword: (%s)\", denom, keywords)\n\t}\n\treturn nil\n}", "title": "" } ]
[ { "docid": "c038f3e29090dc419b369ad1cd68a08c", "score": "0.6499968", "text": "func (i Input) HasKeywords(ks ...string) []string {\n\tif len(ks) == 0 || len(i.Request.Nlu.Tokens) == 0 {\n\t\treturn nil\n\t}\n\n\tp, s := i.Request.Nlu.Tokens, ks\n\tif len(ks) > len(i.Request.Nlu.Tokens) {\n\t\tp, s = ks, i.Request.Nlu.Tokens\n\t}\n\n\tm := make(map[string]struct{})\n\tfor _, i := range p {\n\t\tm[i] = struct{}{}\n\t}\n\n\tres := make([]string, 0, len(m))\n\tfor _, v := range s {\n\t\tif _, exists := m[v]; exists {\n\t\t\tres = append(res, v)\n\t\t}\n\t}\n\n\treturn res\n}", "title": "" }, { "docid": "cc0ff25c4ad2d04b0c04da3974fe3494", "score": "0.63388306", "text": "func IsKeyword(token string) bool {\n\tfor _, keyword := range KEYWORDS {\n\t\tif keyword == token {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "a8b60f84fe04df6d573d212554a0d502", "score": "0.61149746", "text": "func isKeyword(token string) bool {\n\tkeywords := []string{\n\t\t\"class\",\n\t\t\"method\",\n\t\t\"function\",\n\t\t\"constructor\",\n\t\t\"int\",\n\t\t\"boolean\",\n\t\t\"char\",\n\t\t\"void\",\n\t\t\"var\",\n\t\t\"static\",\n\t\t\"field\",\n\t\t\"let\",\n\t\t\"do\",\n\t\t\"if\",\n\t\t\"else\",\n\t\t\"while\",\n\t\t\"return\",\n\t\t\"true\",\n\t\t\"false\",\n\t\t\"null\",\n\t\t\"this\",\n\t}\n\n\tfor _, keyword := range keywords {\n\t\tif token == keyword {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "c99b2628f666727a87fa15be4a5a7701", "score": "0.6034092", "text": "func (tok Token) IsKeyword() bool { return keyword_beg < tok && tok < keyword_end }", "title": "" }, { "docid": "c99b2628f666727a87fa15be4a5a7701", "score": "0.6034092", "text": "func (tok Token) IsKeyword() bool { return keyword_beg < tok && tok < keyword_end }", "title": "" }, { "docid": "9fdd43984b286e006f56a3c696599e87", "score": "0.5841669", "text": "func (c Const) ValidateKeyword(ctx context.Context, currentState *ValidationState, data interface{}) {\n\tschemaDebug(\"[Const] Validating\")\n\tvar con interface{}\n\tif err := json.Unmarshal(c, &con); err != nil {\n\t\tcurrentState.AddError(data, err.Error())\n\t\treturn\n\t}\n\n\tif !reflect.DeepEqual(con, data) {\n\t\tcurrentState.AddError(data, fmt.Sprintf(`must equal %s`, InvalidValueString(con)))\n\t}\n}", "title": "" }, { "docid": "4b53973bc8d624669ca698ce8a746588", "score": "0.5838253", "text": "func IsKeyword(tok Token) bool {\n\t_, ok := keywords[strings[tok]]\n\treturn ok\n}", "title": "" }, { "docid": "6e6945bc3068780afcd9bb342b559ac8", "score": "0.5809012", "text": "func isKeyword(t Token) bool {\n\treturn t == TODAY ||\n\t\tt == YESTERDAY ||\n\t\tt == MEETINGS ||\n\t\tt == BLOCKERS ||\n\t\tt == LP ||\n\t\tt == JIRA\n}", "title": "" }, { "docid": "d212b2029bc003f953193cd476d5a143", "score": "0.5785566", "text": "func isKeyword(ln, kw string) bool {\n\treturn regexp.MustCompile(\"^\" + kw + `(\\s+|$|[[:punct:]])`).MatchString(ln)\n}", "title": "" }, { "docid": "b7d71bf880faeab2d16ec8d5b934bde7", "score": "0.5765987", "text": "func (i Input) HasKeyword(k string) bool {\n\tfor _, t := range i.Request.Nlu.Tokens {\n\t\tif k == t {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "2fc4fd09a34f8154e17939d515b6bb70", "score": "0.57219774", "text": "func IsKeyword(tok lexer.Token) bool {\n\treturn tok > startKeywords && tok < endKeywords\n}", "title": "" }, { "docid": "6c88bb77daeb062256cbea4fb0dd4555", "score": "0.5695751", "text": "func IsKeyword(i token.Token, tokenString string) bool {\n\t_, ok := keywordMap[i]\n\treturn ok && !isNonAlphaOperator(tokenString)\n}", "title": "" }, { "docid": "13b555ca1f424f9c5d5844383ca39747", "score": "0.56877303", "text": "func (e Enum) ValidateKeyword(ctx context.Context, currentState *ValidationState, data interface{}) {\n\tschemaDebug(\"[Enum] Validating\")\n\tsubState := currentState.NewSubState()\n\tsubState.ClearState()\n\tfor _, v := range e {\n\t\tsubState.Errs = &[]KeyError{}\n\t\tv.ValidateKeyword(ctx, subState, data)\n\t\tif subState.IsValid() {\n\t\t\treturn\n\t\t}\n\t}\n\n\tcurrentState.AddError(data, fmt.Sprintf(\"should be one of %s\", e.String()))\n}", "title": "" }, { "docid": "2d7c4cda83c6192c41c20829b61cce8e", "score": "0.55836934", "text": "func (tok Token) IsKeyword() bool {\n\treturn keyword_begin < tok && tok < keyword_end\n}", "title": "" }, { "docid": "21a514eee10fe5f322fca180584006d7", "score": "0.55523163", "text": "func (t Type) ValidateKeyword(ctx context.Context, currentState *ValidationState, data interface{}) {\n\tschemaDebug(\"[Type] Validating\")\n\tjt := DataType(data)\n\tfor _, typestr := range t.vals {\n\t\tif jt == typestr || jt == \"integer\" && typestr == \"number\" {\n\t\t\treturn\n\t\t}\n\t\tif jt == \"string\" && (typestr == \"boolean\" || typestr == \"number\" || typestr == \"integer\") {\n\t\t\tif DataTypeWithHint(data, typestr) == typestr {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif jt == \"null\" && (typestr == \"string\") {\n\t\t\tif DataTypeWithHint(data, typestr) == typestr {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tif len(t.vals) == 1 {\n\t\tcurrentState.AddError(data, fmt.Sprintf(`type should be %s, got %s`, t.vals[0], jt))\n\t\treturn\n\t}\n\n\tstr := \"\"\n\tfor _, ts := range t.vals {\n\t\tstr += ts + \",\"\n\t}\n\n\tcurrentState.AddError(data, fmt.Sprintf(`type should be one of: %s, got %s`, str[:len(str)-1], jt))\n}", "title": "" }, { "docid": "f2e52fb32c581a30f4ac6d6ef3b0cf63", "score": "0.54813963", "text": "func IsKeyword(t TokenType) bool {\n\tif _, ok := keywords[t]; ok {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "2a1614cd1cd63d1e276b0cdc3eec839e", "score": "0.5464113", "text": "func (m *TokenFilterKeywordMarker) Keywords(keywords ...string) *TokenFilterKeywordMarker {\n\tm.keywords = append(m.keywords, keywords...)\n\treturn m\n}", "title": "" }, { "docid": "9ba13087c369a8db5ad046e49d066a29", "score": "0.53896505", "text": "func hasKeywordsPrefix(a, b []string) bool {\n for _, k := range a {\n for _, t := range b {\n if strings.HasPrefix(t, k) {\n return true\n }\n }\n }\n return false\n}", "title": "" }, { "docid": "d951bfb02c938c82275645e03d29addb", "score": "0.5388222", "text": "func isKeyword(s string) bool {\n\t_, ok := _keywords[s]\n\treturn ok\n}", "title": "" }, { "docid": "0a1a908ddc87e8c4a82d326afd3fd668", "score": "0.5289819", "text": "func IsKeyword(name string) bool {\n\t_, ok := keywords[strings.ToUpper(name)]\n\treturn ok\n}", "title": "" }, { "docid": "1e05bdbe1eec7fd9247a874a75e1681b", "score": "0.5278391", "text": "func containsKeyword(title string, description string, keyword string) bool {\n\ttitle = strings.ToLower(title)\n\tdescription = strings.ToLower(description)\n\tkeyword = strings.ToLower(keyword)\n\n\tregex := \"([^\\\\s]+)\"\n\tre := regexp.MustCompile(regex)\n\n\tparsedTitle := re.FindAllString(title, -1)\n\tfor i := 0; i < len(parsedTitle); i++ {\n\t\tif parsedTitle[i] == keyword {\n\t\t\treturn true\n\t\t}\n\t}\n\tparsedDesc := re.FindAllString(description, -1)\n\tfor i := 0; i < len(parsedDesc); i++ {\n\t\tif parsedDesc[i] == keyword {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "97fae663b68fc948815ec66f49a27cbe", "score": "0.5265876", "text": "func keywordsInDescription(pkgdesc string, keywords []string) bool {\n\tfor _, keyword := range keywords {\n\t\tif has(pkgdesc, keyword) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "a1a88e80c8661fb3371a3045808dd258", "score": "0.5261044", "text": "func (t *Schema) stringKeywords(tags []string) {\n\tfor _, tag := range tags {\n\t\tnameValue := strings.Split(tag, \"=\")\n\t\tif len(nameValue) == 2 {\n\t\t\tname, val := nameValue[0], nameValue[1]\n\t\t\tswitch name {\n\t\t\tcase \"minLength\":\n\t\t\t\ti, _ := strconv.Atoi(val)\n\t\t\t\tt.MinLength = i\n\t\t\tcase \"maxLength\":\n\t\t\t\ti, _ := strconv.Atoi(val)\n\t\t\t\tt.MaxLength = i\n\t\t\tcase \"pattern\":\n\t\t\t\tt.Pattern = val\n\t\t\tcase \"format\":\n\t\t\t\tswitch val {\n\t\t\t\tcase \"date-time\", \"email\", \"hostname\", \"ipv4\", \"ipv6\", \"uri\", \"uuid\":\n\t\t\t\t\tt.Format = val\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\tcase \"readOnly\":\n\t\t\t\ti, _ := strconv.ParseBool(val)\n\t\t\t\tt.ReadOnly = i\n\t\t\tcase \"writeOnly\":\n\t\t\t\ti, _ := strconv.ParseBool(val)\n\t\t\t\tt.WriteOnly = i\n\t\t\tcase \"default\":\n\t\t\t\tt.Default = val\n\t\t\tcase \"example\":\n\t\t\t\tt.Examples = append(t.Examples, val)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "84d31ed438103c81079eda947fb93923", "score": "0.51703054", "text": "func IsKeyword(name string) bool {\n\t// TODO: opt: use a perfect hash function instead of a global map.\n\t_, ok := keywords[name]\n\treturn ok\n}", "title": "" }, { "docid": "467d3503b30ef64a8e6d6759dd4eed54", "score": "0.5166275", "text": "func IsValidToken(language, token string) bool {\n\tfor _, entry := range Configuration.Languages {\n\t\tif entry.Language == language {\n\t\t\tfor _, languageToken := range entry.Tokens {\n\t\t\t\tif token == languageToken {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "43608756ac2ee31ec66958a0b60d0313", "score": "0.5159138", "text": "func (wt WordTokenizer) CheckToken(token string) bool {\n\treturn wt.wordRE.MatchString(token)\n}", "title": "" }, { "docid": "d99df312c3d4be4c39027128f4e3a1d4", "score": "0.515573", "text": "func (f *TopicFilter) MatchesTokenized(tokens []string) bool {\n\tif len(f.tokens) > len(tokens) {\n\t\treturn false\n\t}\n\tfor i := 0; i < len(f.tokens); i++ {\n\t\tif f.tokens[i] != \"+\" && f.tokens[i] != tokens[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\tif len(f.tokens) < len(tokens) && !f.multiLevels {\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "7dbbb102221c45dbf77b5556653a749d", "score": "0.5133161", "text": "func isKeywordMultibyte(keywords map[string][]string, word string) ([]string, bool) {\n\tids := []string{}\n\tmatch := false\n\tvar multibyteKeywords []string\n\tfor keyword := range keywords {\n\t\tif len(keyword) != utf8.RuneCountInString(keyword) {\n\t\t\tmultibyteKeywords = append(multibyteKeywords, keyword)\n\t\t}\n\t}\n\n\tif len(word) != utf8.RuneCountInString(word) {\n\t\tfor _, key := range multibyteKeywords {\n\t\t\tif strings.Contains(word, key) {\n\t\t\t\tids, match = keywords[key]\n\t\t\t}\n\t\t}\n\t}\n\treturn ids, match\n}", "title": "" }, { "docid": "8f61fc591fef54b1f458e66aa10146eb", "score": "0.5049615", "text": "func (dc DynamoChecker) ValidateWords(language string, words []string) ([]string, error) {\r\n\ttable := fmt.Sprintf(\"wordlines_%s\", strings.ToLower(language))\r\n\to, err := tools.BatchGetItem(&table, \"Word\", words)\r\n\tnotFound := []string{}\r\n\tfor _, w := range words {\r\n\t\tfound := false\r\n\t\tfor _, tables := range o.Responses {\r\n\t\t\tfor _, kv := range tables {\r\n\t\t\t\tif w == *kv[\"Word\"].S {\r\n\t\t\t\t\tfound = true\r\n\t\t\t\t\tbreak\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif !found {\r\n\t\t\tnotFound = append(notFound, w)\r\n\t\t}\r\n\t}\r\n\r\n\tsaveMissing(notFound)\r\n\r\n\treturn notFound, err\r\n}", "title": "" }, { "docid": "3ce886175dd9ed43e8fca92555a6c348", "score": "0.502829", "text": "func (m *SearchUsersByKeyword) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateUsers(formats); err != nil {\n\t\t// prop\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9589fac43c21d3f57b777514c52ce108", "score": "0.49702317", "text": "func (t *Schema) numbericKeywords(tags []string) {\n\tfor _, tag := range tags {\n\t\tnameValue := strings.Split(tag, \"=\")\n\t\tif len(nameValue) == 2 {\n\t\t\tname, val := nameValue[0], nameValue[1]\n\t\t\tswitch name {\n\t\t\tcase \"multipleOf\":\n\t\t\t\ti, _ := strconv.Atoi(val)\n\t\t\t\tt.MultipleOf = i\n\t\t\tcase \"minimum\":\n\t\t\t\ti, _ := strconv.Atoi(val)\n\t\t\t\tt.Minimum = i\n\t\t\tcase \"maximum\":\n\t\t\t\ti, _ := strconv.Atoi(val)\n\t\t\t\tt.Maximum = i\n\t\t\tcase \"exclusiveMaximum\":\n\t\t\t\tb, _ := strconv.ParseBool(val)\n\t\t\t\tt.ExclusiveMaximum = b\n\t\t\tcase \"exclusiveMinimum\":\n\t\t\t\tb, _ := strconv.ParseBool(val)\n\t\t\t\tt.ExclusiveMinimum = b\n\t\t\tcase \"default\":\n\t\t\t\ti, _ := strconv.Atoi(val)\n\t\t\t\tt.Default = i\n\t\t\tcase \"example\":\n\t\t\t\tif i, err := strconv.Atoi(val); err == nil {\n\t\t\t\t\tt.Examples = append(t.Examples, i)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0f6d7eb68363f9515fb7a1b0a97c5541", "score": "0.49240676", "text": "func (s *BaseSOQLListener) EnterKeywords_name_allowed(ctx *Keywords_name_allowedContext) {}", "title": "" }, { "docid": "ed1cdfa216f3a3f41fa49631bc87b53d", "score": "0.48947206", "text": "func keywordToken(b []byte) ([]byte, int) {\n\tif len(b) > 0 {\n\t\tr := b[0]\n\t\tswitch r {\n\t\tcase '(', ')',\n\t\t\t'*',\n\t\t\t',', '.',\n\t\t\t':', ';',\n\t\t\t'<', '=', '>',\n\t\t\t'[', ']',\n\t\t\t'{', '}':\n\t\t\t// Puctuation marks\n\t\t\treturn b[:1:1], int(r)\n\t\tcase '\"':\n\t\t\t// No token other than a literal string starts with \"\n\t\t\treturn tokStringRule(b)\n\t\tcase '#':\n\t\t\t// Comment token\n\t\t\treturn tokCommentRule(b)\n\t\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\t\treturn leadingSpace(b)\n\t\tcase '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-':\n\t\t\t// Numeric tokens\n\t\t\tif v, id := tokFloatRule(b); len(v) > 0 {\n\t\t\t\treturn v, id\n\t\t\t}\n\t\t\treturn tokIntRule(b)\n\t\tcase '_':\n\t\t\treturn tokIdRule(b)\n\n\t\t// keywords\n\t\tcase '@':\n\t\t\t// No token other than @include starts with @\n\t\t\treturn bytesPrefixString(b, `@include`), INCLUDE_DIRECTIVE\n\t\t// keywords where no other keyword shares the same first character:\n\t\tcase 'a':\n\t\t\treturn bytesPrefixString(b, `as`), AS\n\t\tcase 'b':\n\t\t\treturn bytesPrefixString(b, KindBool), BOOL\n\t\tcase 'c':\n\t\t\tif v := bytesPrefixString(b, `call`); len(v) > 0 {\n\t\t\t\treturn v, CALL\n\t\t\t}\n\t\t\treturn bytesPrefixString(b, abr_compiled), COMPILED\n\t\tcase 'd':\n\t\t\tif v := bytesPrefixString(b, defaultOutName); len(v) > 0 {\n\t\t\t\treturn v, DEFAULT\n\t\t\t}\n\t\t\treturn bytesPrefixString(b, disabled), DISABLED\n\t\tcase 'e':\n\t\t\treturn bytesPrefixString(b, abr_exec), EXEC\n\t\tcase 'f':\n\t\t\tif v := bytesPrefixString(b, `false`); len(v) > 0 {\n\t\t\t\treturn v, FALSE\n\t\t\t}\n\t\t\tif v := bytesPrefixString(b, `filetype`); len(v) > 0 {\n\t\t\t\treturn v, FILETYPE\n\t\t\t}\n\t\t\tif v := bytesPrefixString(b, KindFloat); len(v) > 0 {\n\t\t\t\treturn v, FLOAT\n\t\t\t}\n\t\tcase 'i':\n\t\t\tif v := bytesPrefixString(b, `in`); len(v) > 0 {\n\t\t\t\treturn v, IN\n\t\t\t}\n\t\t\tif v := bytesPrefixString(b, KindInt); len(v) > 0 {\n\t\t\t\treturn v, INT\n\t\t\t}\n\t\tcase 'l':\n\t\t\treturn bytesPrefixString(b, local), LOCAL\n\t\tcase 'm':\n\t\t\tif v := bytesPrefixString(b, KindMap); len(v) > 0 {\n\t\t\t\treturn v, MAP\n\t\t\t}\n\t\t\tif v := bytesPrefixString(b, \"mem_gb\"); len(v) > 0 {\n\t\t\t\treturn v, MEM_GB\n\t\t\t}\n\t\t\treturn bytesPrefixString(b, \"memgb\"), MEM_GB\n\t\tcase 'n':\n\t\t\treturn bytesPrefixString(b, KindNull), NULL\n\t\tcase 'o':\n\t\t\treturn bytesPrefixString(b, `out`), OUT\n\t\tcase 'p':\n\t\t\tif v := bytesPrefixString(b, KindPath); len(v) > 0 {\n\t\t\t\treturn v, PATH\n\t\t\t}\n\t\t\tif v := bytesPrefixString(b, `pipeline`); len(v) > 0 {\n\t\t\t\treturn v, PIPELINE\n\t\t\t}\n\t\t\tif v := bytesPrefixString(b, preflight); len(v) > 0 {\n\t\t\t\treturn v, PREFLIGHT\n\t\t\t}\n\t\t\treturn bytesPrefixString(b, abr_python), PY\n\t\tcase 'r':\n\t\t\tif v := bytesPrefixString(b, `retain`); len(v) > 0 {\n\t\t\t\treturn v, RETAIN\n\t\t\t}\n\t\t\treturn bytesPrefixString(b, `return`), RETURN\n\t\tcase 's':\n\t\t\tif v := bytesPrefixString(b, KindSelf); len(v) > 0 {\n\t\t\t\treturn v, SELF\n\t\t\t}\n\t\t\tif v := bytesPrefixString(b, `special`); len(v) > 0 {\n\t\t\t\treturn v, SPECIAL\n\t\t\t}\n\t\t\tif v := bytesPrefixString(b, KindSplit); len(v) > 0 {\n\t\t\t\treturn v, SPLIT\n\t\t\t}\n\t\t\tif v := bytesPrefixString(b, `src`); len(v) > 0 {\n\t\t\t\treturn v, SRC\n\t\t\t}\n\t\t\tif v := bytesPrefixString(b, `stage`); len(v) > 0 {\n\t\t\t\treturn v, STAGE\n\t\t\t}\n\t\t\tif v := bytesPrefixString(b, strict); len(v) > 0 {\n\t\t\t\treturn v, STRICT\n\t\t\t}\n\t\t\tif v := bytesPrefixString(b, KindString); len(v) > 0 {\n\t\t\t\treturn v, STRING\n\t\t\t}\n\t\t\treturn bytesPrefixString(b, KindStruct), STRUCT\n\t\tcase 't':\n\t\t\tif v := bytesPrefixString(b, `threads`); len(v) > 0 {\n\t\t\t\treturn v, THREADS\n\t\t\t}\n\t\t\treturn bytesPrefixString(b, `true`), TRUE\n\t\tcase 'u':\n\t\t\treturn bytesPrefixString(b, `using`), USING\n\t\tcase 'v':\n\t\t\tif v := bytesPrefixString(b, volatile); len(v) > 0 {\n\t\t\t\treturn v, VOLATILE\n\t\t\t}\n\t\t\tif v := bytesPrefixString(b, \"vmem_gb\"); len(v) > 0 {\n\t\t\t\treturn v, VMEM_GB\n\t\t\t}\n\t\t\treturn bytesPrefixString(b, \"vmemgb\"), VMEM_GB\n\t\t}\n\t\tif r > utf8.RuneSelf {\n\t\t\t// Non-ASCII space\n\t\t\treturn leadingSpace(b)\n\t\t}\n\t}\n\treturn nil, 0\n}", "title": "" }, { "docid": "6a6ced26832c70936a646744383dd93f", "score": "0.48491365", "text": "func (m *TokenFilterKeywordMarker) KeywordsPattern(keywordsPattern string) *TokenFilterKeywordMarker {\n\tm.keywordsPattern = keywordsPattern\n\treturn m\n}", "title": "" }, { "docid": "3feeefa3cf8a85c7bc81607a0a109938", "score": "0.47860208", "text": "func ValidateSymbol(symbol string) error {\n\tif !regexpSymbol(symbol) {\n\t\treturn sdkerrors.Wrapf(ErrInvalidSymbol, \"invalid symbol: %s, only accepts english lowercase letters and numbers, length [%d, %d], and begin with an english letter, regexp: %s\", symbol, MinimumSymbolLen, MaximumSymbolLen, regexpSymbolFmt)\n\t}\n\treturn ValidateKeywords(symbol)\n}", "title": "" }, { "docid": "44f0481b7a4e76ce7e27180f100dac68", "score": "0.47706598", "text": "func validStructuredKey(name string) bool {\n\tif len(name) > 32 {\n\t\treturn false\n\t}\n\tfor _, r := range []rune(name) {\n\t\tswitch {\n\t\tcase r <= 32:\n\t\t\treturn false\n\t\tcase r >= 127:\n\t\t\treturn false\n\t\tcase r == '=', r == ']', r == '\"':\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "3012882cbb32fe5b501c09dc1fc6af9b", "score": "0.47603917", "text": "func (s *BaseSOQLListener) ExitKeywords_name_allowed(ctx *Keywords_name_allowedContext) {}", "title": "" }, { "docid": "44675eabe2848e13a0791ec433a31772", "score": "0.47582453", "text": "func LoadTokenMap(keywordTokens map[Token]string) {\n\n\t// Combine built-in tokens and keywords\n\tfor k, v := range keywordTokens {\n\t\ttokens[k] = v\n\t}\n\n\t// Load Keywords\n\tfor k, v := range keywordTokens {\n\t\tkeywords[strings.ToLower(v)] = k\n\t}\n}", "title": "" }, { "docid": "1186e201acac36dd5f211485653f963e", "score": "0.47272605", "text": "func (m *ProviderTerms) Validate() (err error) {\n\tswitch { // is invalid\n\tcase m.AccessPointID == \"\":\n\t\terr = errors.New(errCodeBadRequest, \"invalid access point id\")\n\n\tcase m.QoS == nil:\n\t\terr = errors.New(errCodeBadRequest, \"invalid terms qos\")\n\n\tcase m.QoS.UploadMbps <= 0:\n\t\terr = errors.New(errCodeBadRequest, \"invalid terms qos upload mbps\")\n\n\tcase m.QoS.DownloadMbps <= 0:\n\t\terr = errors.New(errCodeBadRequest, \"invalid terms qos download mbps\")\n\n\tcase m.Expired():\n\t\tnow := time.NowTime().Add(TermsExpiredDuration).Format(time.RFC3339)\n\t\terr = errors.New(errCodeBadRequest, \"expired at must be after \"+now)\n\n\tdefault:\n\t\treturn nil // is valid\n\t}\n\n\treturn errInvalidProviderTerms.Wrap(err)\n}", "title": "" }, { "docid": "0945776f4e9909f93d298dd6478eb0c2", "score": "0.4721249", "text": "func (p *parser) expect(keyword keyword) bool {\n\tif !p.match(keyword) {\n\t\treturn false\n\t}\n\tp.pos += len(string(keyword))\n\treturn true\n}", "title": "" }, { "docid": "3a6db77c605587f43ee69cfefb02d651", "score": "0.47188255", "text": "func containsValidTags(tags map[string]string, group map[string][]string) bool {\n for _, list := range group {\n if matchTagsAgainstCompulsoryTagList( tags, list ){\n return true\n }\n }\n return false\n}", "title": "" }, { "docid": "70c5f9f85d6638a7b71944ba891cebd2", "score": "0.471456", "text": "func FindKeyword(line string, s []string) bool {\n\tline = strings.ToLower(line)\n\n\tfor _, i := range s {\n\t\tif strings.Contains(line, i) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "1d1fa90763a44b78c07ce8d182ae7aa9", "score": "0.46974993", "text": "func (r *TokenREST) isKubeAudiences(tokenAudience []string) bool {\n\t// tokenAudiences must be a strict subset of apiserver audiences\n\treturn r.audsSet.HasAll(tokenAudience...)\n}", "title": "" }, { "docid": "cae16063cb3ad77225c3afa834fddd4a", "score": "0.4674326", "text": "func (_options *CreateOfferingOptions) SetKeywords(keywords []string) *CreateOfferingOptions {\n\t_options.Keywords = keywords\n\treturn _options\n}", "title": "" }, { "docid": "3f3ac0ab0bb51b369fbea6ccfdd4baaf", "score": "0.4672559", "text": "func (me *XsdGoPkgHasElems_Keyword) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElems_Keyword; me != nil {\r\n\t\tif fn != nil {\r\n\t\t\tif err = fn(me, true); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor _, x := range me.Keywords {\r\n\t\t\tif err = x.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\t\t}\r\n\t\tif fn != nil {\r\n\t\t\tif err = fn(me, false); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn\r\n}", "title": "" }, { "docid": "63725dedebff3a05a59d4d4ecd7c1f85", "score": "0.46644935", "text": "func ValidateMinUnit(minUnit string) error {\n\tif !regexpMinUint(minUnit) {\n\t\treturn sdkerrors.Wrapf(ErrInvalidMinUnit, \"invalid minUnit: %s, only accepts english lowercase letters and numbers, length [%d, %d], and begin with an english letter, regexp: %s\", minUnit, MinimumMinUnitLen, MaximumMinUnitLen, regexpMinUintFmt)\n\t}\n\treturn ValidateKeywords(minUnit)\n}", "title": "" }, { "docid": "9608313585cf317d88e69392951e00ce", "score": "0.46550894", "text": "func generateKeywordsArray(keywords string) ([]string, bool) {\n\tvar keywordsArray []string\n\tnilKeywords := false\n\tif len(keywords) == 0 {\n\t\tnilKeywords = true\n\t} else {\n\t\tkeywordsArray = strings.Split(keywords, \",\")\n\t\tfor i := range keywordsArray {\n\t\t\tkeywordsArray[i] = strings.TrimSpace(keywordsArray[i])\n\t\t}\n\t}\n\treturn keywordsArray, nilKeywords\n}", "title": "" }, { "docid": "866ffcf698cb9ff31766f06fad6f08e1", "score": "0.4653847", "text": "func (spec *PackageSpec) validateTypeTokens() hcl.Diagnostics {\n\tvar diags hcl.Diagnostics\n\tallowedPackageNames := map[string]bool{spec.Name: true}\n\tfor _, prefix := range spec.AllowedPackageNames {\n\t\tallowedPackageNames[prefix] = true\n\t}\n\tfor t := range spec.Resources {\n\t\tdiags = diags.Extend(spec.validateTypeToken(allowedPackageNames, \"resources\", t))\n\t}\n\tfor t := range spec.Types {\n\t\tdiags = diags.Extend(spec.validateTypeToken(allowedPackageNames, \"types\", t))\n\t}\n\tfor t := range spec.Functions {\n\t\tdiags = diags.Extend(spec.validateTypeToken(allowedPackageNames, \"functions\", t))\n\t}\n\treturn diags\n}", "title": "" }, { "docid": "f528afc55631be048df78781471d7195", "score": "0.46313557", "text": "func ValidateTokenID(input interface{}, key string) (warnings []string, errors []error) {\n\tv, ok := input.(string)\n\tif !ok {\n\t\terrors = append(errors, fmt.Errorf(\"expected %q to be a string\", key))\n\t\treturn\n\t}\n\n\tif _, err := ParseTokenID(v); err != nil {\n\t\terrors = append(errors, err)\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "cd882b2c7661d63f051de7340f9509ac", "score": "0.46239793", "text": "func (spec *PackageSpec) validateTypeToken(allowedPackageNames map[string]bool, section, token string) hcl.Diagnostics {\n\tvar diags hcl.Diagnostics\n\n\tpath := memberPath(section, token)\n\tparts := strings.Split(token, \":\")\n\tif len(parts) != 3 {\n\t\terr := errorf(path, \"invalid token '%s' (should have three parts)\", token)\n\t\tdiags = diags.Append(err)\n\t\t// Early return because the other two error checks panic if len(parts) < 3\n\t\treturn diags\n\t}\n\tif !allowedPackageNames[parts[0]] {\n\t\terr := errorf(path, \"invalid token '%s' (must have package name '%s')\", token, spec.Name)\n\t\tdiags = diags.Append(err)\n\t}\n\tif (parts[1] == \"\" || strings.EqualFold(parts[1], \"index\")) && strings.EqualFold(parts[2], \"provider\") {\n\t\terr := errorf(path, \"invalid token '%s' (provider is a reserved word for the root module)\", token)\n\t\tdiags = diags.Append(err)\n\t}\n\treturn diags\n}", "title": "" }, { "docid": "c0901b46b36a2cfa4348e75d193a8e3e", "score": "0.46220377", "text": "func (t *CtestschemaRootmod_OrderedMultikeyedLists) ΛValidate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"CtestschemaRootmod_OrderedMultikeyedLists\"], t, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6cbb191214367f797d10fb4fcdab65f2", "score": "0.4621684", "text": "func ValidateToken(n string, min, max int) error {\n\tif l := len(n); l < min || l > max {\n\t\treturn NewValidationError(\"invalid length (%d; expected %d <= length <= %d)\", l, min, max)\n\t} else if len(strings.Trim(n, tokenAlphabet)) != 0 {\n\t\treturn NewValidationError(\"not a valid token (%s)\", n)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c6c5de9127a371253fae6f767b796e90", "score": "0.46203324", "text": "func MakeNewKeyword(kwd string) (Keyword, error) {\n\t// In order to allow spaces, unescape the keywords with spaces because they will be\n\t// coming in from the entered URL using %20 to encode the spaces.\n\tescaped, err := url.QueryUnescape(kwd)\n\tif err != nil {\n\t\tLogError.Printf(\"Keyword could not be unescaped. '%s'\\n\", kwd)\n\t}\n\n\t// first strip known leading and trailing characters users are known to add\n\t// first check for valid characters for a URL string\n\tescaped = strings.TrimPrefix(escaped, \".\")\n\tescaped = strings.TrimPrefix(escaped, \"/\")\n\tescaped = strings.TrimPrefix(escaped, \".\")\n\tescaped = strings.TrimSuffix(escaped, \"/\")\n\n\t// then check for valid characters for a URL string\n\tfor idx, l := range escaped {\n\t\tif unicode.IsLetter(l) || unicode.IsDigit(l) || strings.ContainsAny(string(l), \"-_ ~\") {\n\t\t\tcontinue\n\t\t} else {\n\t\t\tmsg := \"valid characters are ALPHA, DIGIT, or any of -_ ~\"\n\t\t\tLogDebug.Printf(\"Bad character at position %d: '%s'\\n\", idx, string(l))\n\t\t\tLogDebug.Printf(msg)\n\t\t\treturn Keyword(\"\"), errors.New(msg)\n\t\t}\n\t}\n\n\tk := Keyword(strings.ToLower(escaped))\n\treturn k, err\n}", "title": "" }, { "docid": "414119117a3c72a51eb263991acd9ec6", "score": "0.46134683", "text": "func ValidateKeyPhrases(components []types.Component, standard types.NIST80053Standard, componentKeyPhraseResults []*models.KeyPhraseBatchResultItemV2, standardKeyPhraseResults []*models.KeyPhraseBatchResultItemV2) []Validation {\n\n\tvalidations := []Validation{}\n\n\tfor _, component := range components {\n\t\tvalidation := Validation{}\n\t\tvalidation.MatchResult = map[string]MatchResult{}\n\t\tvalidation.ComponentName = component.Name\n\t\tfor _, satisfy := range component.Satisfies {\n\t\tNarrative:\n\t\t\tfor _, narrative := range satisfy.Narrative {\n\t\t\t\tfor _, componentKeyPhraseResult := range componentKeyPhraseResults {\n\t\t\t\t\tif narrative.ID == componentKeyPhraseResult.ID {\n\t\t\t\t\t\tfor _, standardKeyPhraseResult := range standardKeyPhraseResults {\n\t\t\t\t\t\t\tif standard[satisfy.ControlKey].ID == standardKeyPhraseResult.ID {\n\t\t\t\t\t\t\t\tvar matchCount int\n\t\t\t\t\t\t\t\tfor _, phrase := range componentKeyPhraseResult.KeyPhrases {\n\t\t\t\t\t\t\t\t\tif searchKeyPhrases(phrase, standardKeyPhraseResult.KeyPhrases) {\n\t\t\t\t\t\t\t\t\t\tmatchCount++\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tscore := float64(matchCount) / float64(len(standardKeyPhraseResult.KeyPhrases)) * 10\n\t\t\t\t\t\t\t\troundedScore := round(score)\n\t\t\t\t\t\t\t\tvalidation.MatchResult[satisfy.ControlKey] = MatchResult{\n\t\t\t\t\t\t\t\t\tMatches: matchCount,\n\t\t\t\t\t\t\t\t\tExpected: len(standardKeyPhraseResult.KeyPhrases),\n\t\t\t\t\t\t\t\t\tScore: roundedScore,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcontinue Narrative\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tvalidations = append(validations, validation)\n\t}\n\n\treturn validations\n}", "title": "" }, { "docid": "7d42ad0adee1e4c6a135dfa648cff795", "score": "0.46103755", "text": "func ValidateTags(v interface{}, _ string) (warnings []string, errors []error) {\n\ttagsMap := v.(map[string]interface{})\n\n\tif len(tagsMap) > 50 {\n\t\terrors = append(errors, fmt.Errorf(\"a maximum of 50 tags can be applied to each ARM resource\"))\n\t}\n\n\tfor k, v := range tagsMap {\n\t\tif len(k) > 512 {\n\t\t\terrors = append(errors, fmt.Errorf(\"the maximum length for a tag key is 512 characters: %q is %d characters\", k, len(k)))\n\t\t}\n\n\t\tvalue, err := TagValueToString(v)\n\t\tif err != nil {\n\t\t\terrors = append(errors, err)\n\t\t} else if len(value) > 256 {\n\t\t\terrors = append(errors, fmt.Errorf(\"the maximum length for a tag value is 256 characters: the value for %q is %d characters\", k, len(value)))\n\t\t}\n\n\t\tif strings.ContainsAny(k, \"':\") || strings.ContainsAny(value, \"':\") {\n\t\t\terrors = append(errors, fmt.Errorf(\"characters ' or : are not allowed because it it interferes with vfxt.py command line parameter --azure-tag 'key:value'\"))\n\t\t}\n\t}\n\n\treturn warnings, errors\n}", "title": "" }, { "docid": "6bbf1f9d9ab024f57f0245c4157b806a", "score": "0.46006268", "text": "func TestTokenFormat(t *testing.T) {\n\t// Test empty token\n\tp := New(\"\")\n\terr := p.validate()\n\tif err == nil {\n\t\tt.Errorf(\"An empty token should not be valid\")\n\t}\n\n\tif err != ErrEmptyToken {\n\t\tt.Errorf(\"Should get an ErrEmptyToken\")\n\t}\n\n\t// Test good token\n\tgoodTokens := []string{\"uQiRzpo4DXghDmr9QzzfQu27cmVRsG\", \"gznej3rKEVAvPUxu9vvNnqpmZpokzF\"}\n\tfor _, goodToken := range goodTokens {\n\t\tp := New(goodToken)\n\t\terr := p.validate()\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Token '%s' should be valid\", goodToken)\n\t\t}\n\t}\n\n\t// Test bad token\n\tbadTokens := []string{\"uQiR-po4DXghDmr9QzzfQu27cmVRsG\", \"agznej3rKEVAvPUxu9vvNnqpmZpokzF\", \"test\"}\n\tfor _, badToken := range badTokens {\n\t\tp := New(badToken)\n\t\terr := p.validate()\n\t\tif err == nil {\n\t\t\tt.Errorf(\"Token '%s' should not be valid\", badToken)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e391b78ad8db124a30d49806871a1bf6", "score": "0.4590417", "text": "func (t Title) HasKeyword(keyword Keyword) bool {\n\tlowerTitle := strings.ToLower(string(t))\n\tlowerKeyword := strings.ToLower(string(keyword))\n\treturn strings.Contains(lowerTitle, lowerKeyword)\n}", "title": "" }, { "docid": "0f4682adde9dff370e39bf6229b208ac", "score": "0.4573857", "text": "func (e exif) HasKeywords() bool {\n\treturn e.Keywords() != \"\"\n}", "title": "" }, { "docid": "ceacace5bfc2d1f31c7be7051e66d163", "score": "0.4570437", "text": "func (m *Token) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateAccessToken(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateAccessTokenExpire(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateClientID(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateClientSecret(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateDomain(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateRedirectURI(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateRefreshToken(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3f11c32c368fc7927fa9bf04231eba6f", "score": "0.45635286", "text": "func (t *textReader) verifyUnquotedSymbol(val string, ctx string) error {\n\tswitch val {\n\tcase \"null\", \"true\", \"false\", \"nan\":\n\t\treturn &SyntaxError{fmt.Sprintf(\"unquoted keyword '%v' as %v\", val, ctx), t.tok.Pos() - 1}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "624e80c3287572d072723ebc903434b4", "score": "0.45514655", "text": "func Keywords() map[string]Token {\n\tcpy := make(map[string]Token, len(keywords))\n\tfor k, v := range keywords {\n\t\tcpy[k] = v\n\t}\n\treturn cpy\n}", "title": "" }, { "docid": "5cd301658c4877b94bfcee049b3187d9", "score": "0.45406154", "text": "func (_options *ReplaceOfferingOptions) SetKeywords(keywords []string) *ReplaceOfferingOptions {\n\t_options.Keywords = keywords\n\treturn _options\n}", "title": "" }, { "docid": "a82a448ff5233242255a6f84c12fb984", "score": "0.45290604", "text": "func (t *CtestschemaRootmod_OrderedMultikeyedLists_OrderedMultikeyedList) ΛValidate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"CtestschemaRootmod_OrderedMultikeyedLists_OrderedMultikeyedList\"], t, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "82931d491ee85a9ec7ef8b3233a6efe5", "score": "0.45151713", "text": "func (s *Slacker) ValidToken(command, token string) bool {\n\ts.Lock()\n\tdefer s.Unlock()\n\n\t// Under normal execution, we would have already validated whether the command\n\t// exists or not. But this is an exported function, so validate that it does\n\t// indeed exist.\n\tt, exists := s.tokens[command]\n\tvalid := subtle.ConstantTimeCompare([]byte(t), []byte(token)) == 1\n\treturn exists && valid\n}", "title": "" }, { "docid": "ded417be6d8852071a9cddd16a4ef25b", "score": "0.45141637", "text": "func (k *keywordsValueGenerator) Next(_ context.Context) (bool, error) {\n\tk.curKeyword++\n\treturn k.curKeyword < len(lex.KeywordNames), nil\n}", "title": "" }, { "docid": "5b0cbd396863236ced874c0cf0b2ae94", "score": "0.45071697", "text": "func (m *Property) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateTokenization(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c03790cd646095e4e00a794370f347fc", "score": "0.44783226", "text": "func Validate(word string) bool {\n\t_, err := Decode(word)\n\tif err != nil {\n\t\treturn false\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "9a1088c3e825ef2d68f3bb9f1f4f5708", "score": "0.447676", "text": "func (tag *BidderMacro) MacroKeywords(key string) string {\n\tif tag.IsApp {\n\t\treturn tag.Request.App.Keywords\n\t}\n\treturn tag.Request.Site.Keywords\n}", "title": "" }, { "docid": "11cd74b0e316dd332d33ea7cfae8a8b3", "score": "0.44749165", "text": "func checkWords(check string) bool {\n\n\tvar name = strings.Split(check, \" \")\n\n\tvar checkInsideNameArray bool\n\tfor _, v := range name {\n\t\tif v == \"de\" || v == \"da\" || v == \"das\" || v == \"do\" || v == \"dos\" {\n\t\t\tcheckInsideNameArray = true\n\t\t}\n\t}\n\treturn checkInsideNameArray\n}", "title": "" }, { "docid": "8287c0f7e3d5fc553b4b44224a5ca422", "score": "0.4473875", "text": "func (p *TextProcessor) isStopWords(prevWord string, nextWord string) bool {\n\tif prevWord == \"\" || nextWord == \"\" {\n\t\treturn false\n\t}\n\n\tif prevWord[len(prevWord)-1] == POINT {\n\t\tr := []rune(nextWord)\n\t\tif unicode.IsUpper(r[0]) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "1d90d0c5b6ee8beac01d52597e6927ce", "score": "0.4465468", "text": "func TestCheckKeywords(t *testing.T) {\n\tcontent := []byte(\"I know half of you half as well as I ought to\")\n\tdir, err := ioutil.TempDir(\"\", \"test-check-keywords\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.RemoveAll(dir) // clean up\n\n\ttmpfn := filepath.Join(dir, \"tmpfile\")\n\tif err := ioutil.WriteFile(tmpfn, content, 0666); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Walk this tempdir\n\tdh, err := Walk(dir, nil, append(DefaultKeywords, \"sha1\"), nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Check for sanity. This ought to pass.\n\tres, err := Check(dir, dh, nil, nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif len(res) > 0 {\n\t\tt.Errorf(\"%#v\", res)\n\t}\n\n\t// Touch a file, so the mtime changes.\n\tnewtime := time.Date(2006, time.February, 1, 3, 4, 5, 0, time.UTC)\n\tif err := os.Chtimes(tmpfn, newtime, newtime); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Check again. This ought to fail.\n\tres, err = Check(dir, dh, nil, nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif len(res) != 1 {\n\t\tt.Fatal(\"expected to get 1 delta on changed mtimes, but did not\")\n\t}\n\tif res[0].Type() != Modified {\n\t\tt.Errorf(\"expected to get modified delta on changed mtimes, but did not\")\n\t}\n\n\t// Check again, but only sha1 and mode. This ought to pass.\n\tres, err = Check(dir, dh, []Keyword{\"sha1\", \"mode\"}, nil)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif len(res) > 0 {\n\t\tt.Errorf(\"%#v\", res)\n\t}\n}", "title": "" }, { "docid": "ea9ef6d6d605f48ed569951a5c4d4324", "score": "0.4458793", "text": "func (j *Jwt) Validate(tokenString string) error {\n\tif err := j.parseToken(tokenString); err != nil {\n\t\treturn err\n\t}\n\tif !j.token.Valid {\n\t\treturn errors.New(\"token validate failed\")\n\t}\n\tkey, err := j.getKey()\n\tif err != nil {\n\t\treturn err\n\t}\n\tttl, err := j.storage.TTL(key)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif ttl.Seconds() <= 0 {\n\t\treturn errors.New(\"the token has been expired\")\n\t}\n\tif err := j.storage.ExtendKey(key, j.duration); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "04bef38c8234828ae7f6c43cf5576bec", "score": "0.4452814", "text": "func CheckTagFromKeyword(kw string) (string, bool) {\n\tsession := stackongo.NewSession(\"stackoverflow\")\n\n\tparams := make(stackongo.Params)\n\tparams.Key(consts.StackOverflowKey)\n\n\ttag, err := session.TagInfo([]string{kw}, params)\n\tif err != nil {\n\t\treturn kw, false\n\t}\n\n\tif len(tag.Items) != 0 {\n\t\treturn tag.Items[0].Name, true\n\t}\n\n\treturn kw, false\n}", "title": "" }, { "docid": "c47f107d6e2b410359c6a4d97a7619c4", "score": "0.44463733", "text": "func LookUpKeyword(ident string) bool {\n\tfor _, i := range keywords {\n\t\tif i == ident {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "1ab3906881e08f72839a2fa1967a8a52", "score": "0.44458815", "text": "func isValidBlobTagsKeyValue(keyVal string) bool {\n\tfor _, c := range keyVal {\n\t\tif !((c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == ' ' || c == '+' ||\n\t\t\tc == '-' || c == '.' || c == '/' || c == ':' || c == '=' || c == '_') {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "fc9a5df9cd7769f21c716d76f93ab751", "score": "0.44396043", "text": "func (m *FilesystemMessage) Keywords() []string {\n\tvar f []string\n\treturn f\n}", "title": "" }, { "docid": "9e06c3bdfc71bf95618f67cb5c4d4a9b", "score": "0.44282147", "text": "func (m *TopicDetectionInputV2) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateDocuments(formats); err != nil {\n\t\t// prop\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStopWords(formats); err != nil {\n\t\t// prop\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateTopicsToExclude(formats); err != nil {\n\t\t// prop\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9206ca8eb8c422b40fa1b11e77ea2f6d", "score": "0.44276", "text": "func topicTokenise(topic string) (tokens []string, err error) {\n\ttokens = strings.Split(topic, \"/\")\n\n\tfor i, token := range tokens {\n\t\tif token == \"$\" && i != 0 {\n\t\t\terr = errors.New(\"invalid topic filter, $ must at the beginning\")\n\t\t\tbreak\n\t\t}\n\n\t\tif token == \"#\" && i != len(tokens) - 1 {\n\t\t\terr = errors.New(\"invalid topic filter, # must at the ending\")\n\t\t\tbreak\n\t\t}\n\n\t\tif strings.Contains(token, \"+\") && len(token) != 1 {\n\t\t\terr = errors.New(\"invalid topic filter\")\n\t\t\tbreak\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "5704160882410b193a032faf66dd1c77", "score": "0.4424323", "text": "func isValidRekaTag(key string) bool {\n\tk := strings.TrimSpace(strings.ToLower(key))\n\treturn strings.HasPrefix(k, rekaNamespace)\n}", "title": "" }, { "docid": "31bcc4c727718a98b78b3b86ace3eb35", "score": "0.44205478", "text": "func getKeywords(m map[string]string, r *regexp.Regexp) []string {\n var keywords []string\n for _, v := range m {\n keywords = r.FindAllString(v, -1) \n }\n return keywords\n}", "title": "" }, { "docid": "7a8b668ad23fb9b298a9575e42c0a147", "score": "0.44187158", "text": "func isKeywordFirstCharacter(ch rune) bool {\n\treturn 'a' <= ch && ch <= 'z'\n}", "title": "" }, { "docid": "5ca6fcc2e5c06231874e6b73cafa14da", "score": "0.44136688", "text": "func ValidKMSKeyID(v interface{}, k string) (ws []string, errors []error) {\n\tvalue := v.(string)\n\tif len(value) < 1 {\n\t\terrors = append(errors, fmt.Errorf(\"%q cannot be shorter than 1 character\", k))\n\t} else if len(value) > 2048 {\n\t\terrors = append(errors, fmt.Errorf(\"%q cannot be longer than 2048 characters\", k))\n\t}\n\treturn\n}", "title": "" }, { "docid": "14fa460f5aff912471d8bbcb3a008e21", "score": "0.43943253", "text": "func shouldContain(t *testing.T, str string, keyPhrases ...string) {\n\tfor _, phrase := range keyPhrases {\n\t\tindex := strings.Index(str, phrase)\n\t\tif index == -1 {\n\t\t\trequire.Failf(t, \"shouldContain() failed\",\n\t\t\t\t\"Key phrase '%s' was not found in remaining unmatched string: %s\", strconv.Quote(phrase), strconv.Quote(str))\n\t\t}\n\t\tstr = str[index+len(phrase):]\n\t}\n}", "title": "" }, { "docid": "d58cd4dd8fd85b079c24be64dec5b92f", "score": "0.43907514", "text": "func errorIfUnsafeSqlKeyword(sql string) error {\n\n\tunsafeSqlKeywords := [...]string{ // list is incomplete by nature\n\t\t\"ABORT\",\n\t\t\"ALTER\",\n\t\t\"ATTACH\",\n\t\t\"CALL\",\n\t\t\"COMMIT\",\n\t\t\"CREATE\",\n\t\t\"DATABASE\",\n\t\t\"DELETE\",\n\t\t\"DETACH\",\n\t\t\"DISABLE\",\n\t\t\"DO\",\n\t\t\"DROP\",\n\t\t\"ENABLE\",\n\t\t\"EXEC\",\n\t\t\"EXECUTE\",\n\t\t\"GO\",\n\t\t\"GRANT\",\n\t\t\"IGNORE\",\n\t\t\"INDEX\",\n\t\t\"INSERT\",\n\t\t\"MERGE\",\n\t\t\"PROCEDURE\",\n\t\t\"QUERY\",\n\t\t\"RECURSIVE\",\n\t\t\"REFERENCES\",\n\t\t\"REINDEX\",\n\t\t\"RELEASE\",\n\t\t\"RENAME\",\n\t\t\"REPLACE\",\n\t\t\"RETURNING\",\n\t\t\"REVOKE\",\n\t\t\"ROLLBACK\",\n\t\t\"TABLE\",\n\t\t\"TRANSACTION\",\n\t\t\"TRIGGER\",\n\t\t\"TRUNCATE\",\n\t\t\"UPDATE\",\n\t\t\"VACUUM\",\n\t\t\"VIEW\",\n\t}\n\n\t// check if there are any of sql keywords, which are not allowed\n\ts := strings.ToUpper(sql)\n\n\tfor _, w := range unsafeSqlKeywords {\n\n\t\tnc := 0\n\t\tfor n := nc; n < len(sql); {\n\n\t\t\tj := strings.Index(s[nc:], w)\n\t\t\tif j < 0 {\n\t\t\t\tbreak // keyword not found in string\n\t\t\t}\n\t\t\tn = nc + j + len(w) // next char position after keyword\n\n\t\t\tif n >= len(s) {\n\t\t\t\treturn errors.New(\"Error in expression, unsafe SQL keyword: \" + w + \" : \" + sql)\n\t\t\t}\n\t\t\t// else: it is not the end of string, check if next char is delimeter: space, math symbol, etc.\n\n\t\t\tce, _ := utf8.DecodeRuneInString(s[n:])\n\t\t\tif unicode.IsSpace(ce) || unicode.IsPunct(ce) || unicode.IsControl(ce) || unicode.IsSymbol(ce) || unicode.IsMark(ce) {\n\t\t\t\treturn errors.New(\"Error in expression, unsafe SQL keyword: \" + w + \" : \" + sql)\n\t\t\t}\n\n\t\t\tnc = n // skip: it is not a keyword but a prefix\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "08fc08a3818726b147d61c1c2f59f394", "score": "0.43865335", "text": "func (m *Token) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" }, { "docid": "a9627aa27f7db8c216130531aae7cdc4", "score": "0.43848974", "text": "func (t *Token) Validate(token, host string) (bool, error) {\n\tif t.Active != true {\n\t\treturn false, errors.New(\"Token is not active\")\n\t}\n\n\tif t.Token != token {\n\t\treturn false, errors.New(\"Token is invalid\")\n\t}\n\n\tif t.LinkedHost != host {\n\t\treturn false, errors.New(\"Token's host is not the same as the provided one\")\n\t}\n\n\texpires, err := time.Parse(timeFormat, t.Expires)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tnow := time.Now()\n\tif expires.Before(now) {\n\t\treturn false, errors.New(\"Token has expired\")\n\t}\n\treturn true, nil\n}", "title": "" }, { "docid": "36f08fd2223277548f891009afc9d4ee", "score": "0.43825582", "text": "func (t *Token) Validate() url.Values {\n\terrs := url.Values{}\n\n\tif t.Name == \"\" {\n\t\terrs.Add(\"name\", \"Field is required\")\n\t}\n\tif t.Symbol == \"\" {\n\t\terrs.Add(\"symbol\", \"Field is required\")\n\t}\n\tif t.Decimals == 0 {\n\t\terrs.Add(\"decimals\", \"Field is required\")\n\t}\n\tif t.InitialSupply == 0 {\n\t\terrs.Add(\"initialSupply\", \"Field is required\")\n\t}\n\n\treturn errs\n}", "title": "" }, { "docid": "998ecc8ef183760a988d300ecfceb4eb", "score": "0.4379446", "text": "func ValidateTopic(topic string) error {\n\tif len(topic) == 0 {\n\t\treturn errors.New(\"Empty topic\")\n\t}\n\tif strings.ContainsAny(topic, Wildcard+PartWildcard+\"\\u0000\") {\n\t\treturn errors.New(\"Topic contains invalid characters\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "89b4c4bb1ce6cc0585c9d98be0d144b5", "score": "0.4375325", "text": "func (l *SkillLocaleBuilder) WithLocaleKeywords(keywords []string) *SkillLocaleBuilder {\n\tloc, err := l.registry.Resolve(l.locale)\n\tif err != nil {\n\t\tl.error = err\n\t\treturn l\n\t}\n\tloc.Set(l.skillKeywords, keywords)\n\treturn l\n}", "title": "" }, { "docid": "df5f9ec09509103001aced8a9922150f", "score": "0.4374499", "text": "func (t *Token) IsValid() bool {\n\tif t.Category == \"\" {\n\t\treturn false\n\t}\n\n\tif t.Content == \"\" {\n\t\treturn false\n\t}\n\n\tif t.Rarity <= 0.0 {\n\t\treturn false\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "2892da989173b14fdfd66b959263009e", "score": "0.43733576", "text": "func (nt NotSpaceTokenizer) CheckToken(token string) bool {\n\treturn nt.notSpaceRE.MatchString(token)\n}", "title": "" }, { "docid": "2c4daac33c71e2eb24e8bce6edd341ca", "score": "0.4367414", "text": "func (nt NumberTokenizer) CheckToken(token string) bool {\n\treturn nt.numberRE.MatchString(token)\n}", "title": "" }, { "docid": "8be196343b65104e38fa02a4db3fb08f", "score": "0.4361874", "text": "func validateMetadata(m string) error {\n\teparts := strings.Split(m, \".\")\n\tfor _, p := range eparts {\n\t\tif !containsOnly(p, allowed) {\n\t\t\treturn errors.New(\"Invalid Metadata string\")\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "94298684bab72110a3011fb47cf71ff0", "score": "0.43551132", "text": "func validateInvocationToken(ctx context.Context, token string, invID invocations.ID) error {\n\t_, err := invocationTokenKind.Validate(ctx, token, []byte(invID))\n\treturn err\n}", "title": "" }, { "docid": "62e57cd8e8fc3f257013a2c718b2dfd5", "score": "0.43535474", "text": "func IsTokenValid(token string) bool {\n\tmatched, err := regexp.MatchString(\"^[0-9]+:[a-zA-Z0-9_-]+$\", token)\n\treturn matched && err == nil\n}", "title": "" }, { "docid": "4221b8b88566c647edcb40abc3eef5c7", "score": "0.4346856", "text": "func (m *ThirdRequest) Validate() error {\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tswitch m.Corpus.(type) {\n\n\tcase *ThirdRequest_AccessToken:\n\t\t// no validation rules for AccessToken\n\n\tcase *ThirdRequest_Body_:\n\n\t\tif v, ok := interface{}(m.GetBody()).(interface{ Validate() error }); ok {\n\t\t\tif err := v.Validate(); err != nil {\n\t\t\t\treturn ThirdRequestValidationError{\n\t\t\t\t\tfield: \"Body\",\n\t\t\t\t\treason: \"embedded message failed validation\",\n\t\t\t\t\tcause: err,\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "7813b4094ae159e76388798e36b4b812", "score": "0.43451962", "text": "func (m *MockShellExecutor) AssertKeywordIncludedInCommand(t *testing.T, keyword string) {\n\tanyMatches := false\n\n\tfor _, cmd := range m.executedCommands {\n\t\tif strings.Contains(cmd, keyword) {\n\t\t\tanyMatches = true\n\t\t}\n\t}\n\n\tif !anyMatches {\n\t\tt.Fatalf(\"%v should include the keyword %s\", m.executedCommands, keyword)\n\t}\n}", "title": "" }, { "docid": "6773d0090011e7208a8753b21cf7900d", "score": "0.43386823", "text": "func StopWordFilter(tokens []string) (filteredTokens []string) {\n\tfor _, token := range tokens {\n\t\tif !stopWordsSet.Contains(token) {\n\t\t\tfilteredTokens = append(filteredTokens, token)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "a282817354be092fc2062d0246f0d4bc", "score": "0.43318963", "text": "func ValidateToken(token string) (bool, error) {\n\tclaims := &Claims{}\n\n\ttkn, err := jwt.ParseWithClaims(token, claims, func(token *jwt.Token) (interface{}, error) {\n\t\treturn jwtKey, nil\n\t})\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tif !tkn.Valid {\n\t\treturn false, nil\n\t}\n\treturn true, nil\n}", "title": "" }, { "docid": "72ecae6e4774117f21cdcecb1f49c5c5", "score": "0.4325446", "text": "func (sm *sentenceManager) isFilteredWord(word string) bool {\n\tif len(word) < 3 { // filter words which are too short\n\t\treturn true\n\t}\n\tif strings.Contains(word, \"'\") == true || // filter words like Tom's\n\t\t(word[len(word)-1] == '.') == true || // filter words like U.S.\n\t\tstrings.Contains(word, \"-\") == true { // filter words like\n\t\treturn true\n\t}\n\n\treturn sm.filteredWords[word] // filter words in filteredWordsSet\n}", "title": "" } ]
3d7463d49d8544e916a23bf386140355
Bytes accept the body of http response if haven't been accepted yet, return the response body as []byte, body is nil if error happens.
[ { "docid": "ae3e92e856369ba656e40e824cbd3a85", "score": "0.6283697", "text": "func (r *Response) Bytes() (body []byte) {\n\tbody, _ = r.ReceiveBytes()\n\treturn\n}", "title": "" } ]
[ { "docid": "cb3ff7cf5d2f72ccdeae8a27c2bc1ea4", "score": "0.73247296", "text": "func (r *Response) BodyBytes(consume bool) ([]byte, error) {\n\tif consume {\n\t\tdefer r.Body.Close()\n\t\treturn ioutil.ReadAll(r.Body)\n\t}\n\n\tswitch rc := r.Body.(type) {\n\tcase *bufCloser:\n\t\treturn rc.Bytes(), nil\n\n\tdefault:\n\t\tbuf := &bufCloser{}\n\t\tr.Body = buf\n\t\trdr := io.TeeReader(rc, buf)\n\t\t// rc will never again be accessible: once it's copied it must be closed\n\t\tdefer rc.Close()\n\t\treturn ioutil.ReadAll(rdr)\n\t}\n}", "title": "" }, { "docid": "f7d370e8bde1c7dd642919e9f6cd1553", "score": "0.6956001", "text": "func (r *Request) BodyBytes(consume bool) ([]byte, error) {\n\tif consume {\n\t\tdefer r.Body.Close()\n\t\treturn ioutil.ReadAll(r.Body)\n\t}\n\n\tswitch rc := r.Body.(type) {\n\tcase *bufCloser:\n\t\treturn rc.Bytes(), nil\n\tdefault:\n\t\tbuf := &bufCloser{}\n\t\tr.Body = buf\n\t\trdr := io.TeeReader(rc, buf)\n\t\t// rc will never again be accessible: once it's copied it must be closed\n\t\tdefer rc.Close()\n\t\treturn ioutil.ReadAll(rdr)\n\t}\n}", "title": "" }, { "docid": "17b050ebcc96ae6a326a03cdf0600f2f", "score": "0.68050116", "text": "func (self *Client) body(res *http.Response) (io.ReadCloser, error) {\n var body io.ReadCloser\n var err error\n\n if res.Header.Get(\"Content-Encoding\") == \"gzip\" {\n if body, err = gzip.NewReader(res.Body); err != nil {\n return nil, err\n }\n } else {\n body = res.Body\n }\n\n return body, nil\n}", "title": "" }, { "docid": "21a30dcaa6b7cdba9e9bd6c6d45df10a", "score": "0.67483366", "text": "func (r *Response) BodyAsBytes() ([]byte, error) {\n\treturn r.readAndCloseResponseBody()\n}", "title": "" }, { "docid": "6feb71f53ed113adb6262d7be645ac08", "score": "0.67457664", "text": "func (body *HTTPBody) Bytes() ([]byte, error) {\n\tr := body.Reader()\n\tif r == nil {\n\t\treturn nil, nil\n\t}\n\tbuf, err := ioutil.ReadAll(r)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn buf, r.Close()\n}", "title": "" }, { "docid": "cd95477a18d23485db7d7a640d79586c", "score": "0.6694674", "text": "func ResponseBodyToBytes(body io.Reader) []byte {\n b, err := ioutil.ReadAll(body)\n if err != nil {\n panic(err)\n }\n\n return b\n}", "title": "" }, { "docid": "3742cd362bde2e1df2e0ef18c6afd625", "score": "0.6542198", "text": "func RawBody(resp *http.Response, wantStatuses []int, readLimit ...int64) (body []byte, err error) {\n\t// From what I've gathered, checking an error returned from\n\t// closing a resource that you only read from (like a HTTP\n\t// response body) never yields an actionable error:\n\t// https://github.com/kisielk/errcheck/issues/55#issuecomment-68296619,\n\t// https://groups.google.com/d/msg/Golang-Nuts/7Ek7Uo7vSqU/0UfsWpIFQ_YJ,\n\t// https://www.reddit.com/r/golang/comments/3735so/do_we_have_to_check_for_errors_when_we_call_close/.\n\t// The documentation on net/http also does not check this\n\t// error: https://golang.org/pkg/net/http/. If checking the\n\t// error is not useful it kind of feels like it shouldn't even\n\t// return an error, oh well.\n\tdefer resp.Body.Close()\n\t// People say that using ioutil.ReadAll() is not ideal\n\t// (https://www.reddit.com/r/golang/comments/2cdu7s/how_do_i_avoid_using_ioutilreadall/,\n\t// http://jmoiron.net/blog/crossing-streams-a-love-letter-to-ioreader/)\n\t// but I'm still not sure under exactly what conditions it is\n\t// bad. I get that there is no infinity when it comes to\n\t// memory so it could use too much memory and crash the\n\t// process (or something like that). But this function was\n\t// created with the goal of being a helper when parsing\n\t// responses from APIs that return JSON where we need access\n\t// to the raw data (like if you wanted to cache it somewhere)\n\t// and in my experience those APIs never return large amounts\n\t// of data. Just in case though I am limiting the amount of\n\t// data that can be read. The default limit (30 MB) is\n\t// arbitrary and can be changed if desired.\n\tmaxBytes := int64(1 << 20 * 30)\n\tif len(readLimit) > 0 {\n\t\tmaxBytes = readLimit[0]\n\t}\n\tlimitedReader := &io.LimitedReader{\n\t\tR: resp.Body,\n\t\tN: maxBytes + 1,\n\t}\n\tbody, err = ioutil.ReadAll(limitedReader)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"reading response body: %v\", err)\n\t}\n\tif limitedReader.N <= 0 {\n\t\treturn nil, fmt.Errorf(\"ioutil.ReadAll() is used to read the response body and we limit how much it can read because nothing is infinite. The response body contained more than the limit of %d bytes. Either increase the limit or parse the response body another way\", maxBytes)\n\t}\n\tif got, wants := resp.StatusCode, wantStatuses; !contains(wants, got) {\n\t\terrStr := fmt.Sprintf(\"got status code %d but wanted one of %v\", got, wants)\n\t\tif len(wants) == 1 {\n\t\t\terrStr = fmt.Sprintf(\"got status code %d but wanted %d\", got, wants[0])\n\t\t}\n\t\treturn nil, fmt.Errorf(\"%s, body: %s\", errStr, body)\n\t}\n\treturn body, nil\n}", "title": "" }, { "docid": "34a5147d89cb407e9aa235919cf657a5", "score": "0.6382695", "text": "func (r *Response) Bytes() []byte {\n\treturn r.body\n}", "title": "" }, { "docid": "fd0dd1bab7dc24c959369d73dd392c31", "score": "0.63141793", "text": "func (c *ClientWrapper) HTTPGetBodyBytes(ctx context.Context, url string) ([]byte, error) {\n\tresp, err := c.HTTPGet(ctx, url)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\treturn ioutil.ReadAll(resp.Body)\n}", "title": "" }, { "docid": "c5bf4f21b577954be27cd0b2130c67fe", "score": "0.63134986", "text": "func (r *Response) GetBodyBytes() ([]byte, error) {\n\treader, err := r.GetBody()\n\tdefer reader.Close()\n\tif err != nil {\n\t\treturn make([]byte, 0), err\n\t}\n\tbody, err := ioutil.ReadAll(reader)\n\tif err != nil {\n\t\treturn make([]byte, 0), err\n\t}\n\treturn body, nil\n}", "title": "" }, { "docid": "ed4240388dc9bee7d4de55d50c83efb4", "score": "0.6305573", "text": "func (r *response) Body() []byte {\n\treturn r.body\n}", "title": "" }, { "docid": "5fd18d25ba402056e9d60f28756f5763", "score": "0.6293317", "text": "func GetBody(w http.ResponseWriter, r *http.Request) (res []byte) {\n\tb, err := ioutil.ReadAll(r.Body)\n\tdefer r.Body.Close()\n\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), 500)\n\t\treturn\n\t}\n\n\treturn b\n}", "title": "" }, { "docid": "1c94a1ceb0d0be8c99da478f68148416", "score": "0.62884206", "text": "func (r *Response) Body() ([]byte, error) {\n\tif r.IsStream() {\n\t\treturn nil, errors.New(\"cannot perform Body method on a stream response\")\n\t}\n\tif r.bodyCache != nil || r.readErr != nil {\n\t\treturn r.bodyCache, r.readErr\n\t}\n\n\tdefer r.Close()\n\tr.bodyCache, r.readErr = ioutil.ReadAll(r.Raw.Body)\n\treturn r.bodyCache, r.readErr\n}", "title": "" }, { "docid": "ba8e8c960ddeda39cf4f4b46cdd57afb", "score": "0.62800896", "text": "func (r *HTTPHelper) readBody(resp *http.Response, err error) ([]byte, error) {\n\tr.last = nil\n\tif err != nil {\n\t\treturn []byte{}, err\n\t}\n\tdefer resp.Body.Close()\n\n\tb, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn []byte{}, err\n\t}\n\n\tif r.Log != nil {\n\t\tr.Log.TRACE.Printf(\"%s\\n%s\", resp.Request.URL.String(), string(b))\n\t}\n\n\tr.last = resp\n\tif resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusNoContent {\n\t\treturn b, fmt.Errorf(\"unexpected response %d: %s\", resp.StatusCode, string(b))\n\t}\n\n\treturn b, nil\n}", "title": "" }, { "docid": "2db690a198c865bfd541d690f23a23c2", "score": "0.62454885", "text": "func (hr Response) Body() []byte {\n\treturn hr.body\n}", "title": "" }, { "docid": "4d008a29bee0dba57ef2e0e78d64086c", "score": "0.6235016", "text": "func readBody(r *http.Request) (b []byte, err error) {\n\t// if we have no body, like a GET request, set it to \"\"\n\tif r.Body == nil {\n\t\treturn []byte(\"\"), nil\n\t}\n\n\t// try and be smart and pre-allocate buffer\n\tvar n int64 = bytes.MinRead\n\tif r.ContentLength > int64(n) {\n\t\tn = r.ContentLength\n\t}\n\tbuf := bytes.NewBuffer(make([]byte, 0, n))\n\n\t// If the buffer overflows, we will get bytes.ErrTooLarge.\n\t// Return that as an error. Any other panic remains.\n\tdefer func() {\n\t\te := recover()\n\t\tif e == nil {\n\t\t\treturn\n\t\t}\n\t\tif panicErr, ok := e.(error); ok && panicErr == bytes.ErrTooLarge {\n\t\t\terr = panicErr\n\t\t} else {\n\t\t\tpanic(e)\n\t\t}\n\t}()\n\t_, err = buf.ReadFrom(r.Body)\n\n\t// restore the body back to the request\n\tb = buf.Bytes()\n\tr.Body = io.NopCloser(bytes.NewReader(b))\n\n\treturn b, err\n}", "title": "" }, { "docid": "9934878e55067697714c76af19734ae7", "score": "0.61330837", "text": "func (*emptyResponse) Body() []byte {\n\treturn nil\n}", "title": "" }, { "docid": "d303d514c1f6bc2a3b74fb14fbb59d3a", "score": "0.61221284", "text": "func getBodyResponse(req *http.Response) string {\n\tvar err error\n\tsave := req.Body\n\n\tsave, req.Body, err = drainBody(req.Body)\n\tif err != nil {\n\t\treturn \"\"\n\t}\n\n\tvar b bytes.Buffer\n\n\tchunked := len(req.TransferEncoding) > 0 && req.TransferEncoding[0] == \"chunked\"\n\n\tif req.Body != nil {\n\t\tvar dest io.Writer = &b\n\t\tif chunked {\n\t\t\tdest = httputil.NewChunkedWriter(dest)\n\t\t}\n\t\t_, err = io.Copy(dest, req.Body)\n\t\tif chunked {\n\t\t\tdest.(io.Closer).Close()\n\t\t\tio.WriteString(&b, \"\\r\\n\")\n\t\t}\n\t}\n\n\treq.Body = save\n\n\treturn string(b.Bytes())\n}", "title": "" }, { "docid": "c2c9eb6e79f37c91857a8841c6058b72", "score": "0.6089935", "text": "func (r *Response) GetBody() (io.ReadCloser, error) {\n\t// Check that the server actual sent compressed data\n\tswitch r.Header.Get(\"Content-Encoding\") {\n\tcase \"deflate\":\n\t\treader := flate.NewReader(r.Body)\n\t\treturn reader, nil\n\tcase \"gzip\":\n\t\treader, _ := gzip.NewReader(r.Body)\n\t\treturn reader, nil\n\tdefault:\n\t\treturn r.Body, nil\n\t}\n}", "title": "" }, { "docid": "f42bb9f583ad5e64ecf18bf0f4b98ee3", "score": "0.6082796", "text": "func (r *Response) Bytes() ([]byte, error) {\n\tif r.err != nil {\n\t\treturn nil, r.err\n\t}\n\n\tif r.resBody != nil {\n\t\treturn r.resBody, nil\n\t}\n\tdefer r.Res.Body.Close()\n\n\tbody, err := ioutil.ReadAll(r.Res.Body)\n\tif err != nil {\n\t\tr.err = err\n\t\treturn nil, err\n\t}\n\tr.resBody = body\n\treturn r.resBody, nil\n}", "title": "" }, { "docid": "91af4d6f73106c60768d01b1db636f1a", "score": "0.6067182", "text": "func (h *HttpReq) BytesBody(bs []byte) *HttpReq {\n\th.body = bytes.NewReader(bs)\n\treturn h\n}", "title": "" }, { "docid": "8973e1e7e9b67dc8789fa7f4a430bd89", "score": "0.60421497", "text": "func (res *Response) Body() io.ReadCloser {\n\treturn res.body\n}", "title": "" }, { "docid": "2c899e0ac7b8f8609b56319c7dcbd128", "score": "0.6024952", "text": "func readBody(resp *http.Response) ([]byte, error) {\n\tcontentEncoding, ok := resp.Header[\"Content-Encoding\"]\n\tdefer contract.IgnoreClose(resp.Body)\n\tif !ok {\n\t\t// No header implies that there's no additional encoding on this response.\n\t\treturn io.ReadAll(resp.Body)\n\t}\n\n\tif len(contentEncoding) > 1 {\n\t\t// We only know how to deal with gzip. We can't handle additional encodings layered on top of it.\n\t\treturn nil, fmt.Errorf(\"can't handle content encodings %v\", contentEncoding)\n\t}\n\n\tswitch contentEncoding[0] {\n\tcase \"x-gzip\":\n\t\t// The HTTP/1.1 spec recommends we treat x-gzip as an alias of gzip.\n\t\tfallthrough\n\tcase \"gzip\":\n\t\tlogging.V(apiRequestDetailLogLevel).Infoln(\"decompressing gzipped response from service\")\n\t\treader, err := gzip.NewReader(resp.Body)\n\t\tif reader != nil {\n\t\t\tdefer contract.IgnoreClose(reader)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"reading gzip-compressed body: %w\", err)\n\t\t}\n\n\t\treturn io.ReadAll(reader)\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unrecognized encoding %s\", contentEncoding[0])\n\t}\n}", "title": "" }, { "docid": "529cc4827ce238af59221d8cae904c11", "score": "0.601214", "text": "func (req *httpRequest) Body() (io.Reader, error) {\n\treq.mux.Lock()\n\tdefer req.mux.Unlock()\n\n\tresp, err := req.getResponse()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn resp.Body, nil\n}", "title": "" }, { "docid": "bf62614a4cbf8631f0f273a8ea43c585", "score": "0.6002901", "text": "func (response *HTTPResponse) ResponseBody() []byte {\n\treturn response.Body\n}", "title": "" }, { "docid": "172635d722da3d837b2794b4a25eb478", "score": "0.6001046", "text": "func (r *Request) Bytes() ([]byte, error) {\n\tif r.bodyBytes == nil {\n\t\tdefer r.Raw.Body.Close()\n\n\t\tif bts, err := ioutil.ReadAll(r.Raw.Body); err != nil {\n\t\t\treturn nil, err\n\t\t} else {\n\t\t\tr.bodyBytes = bts\n\t\t}\n\t}\n\treturn r.bodyBytes, nil\n}", "title": "" }, { "docid": "68e980ce498e8c69da2bba942772715e", "score": "0.59797025", "text": "func ResponseBody(res *http.Response) ([]byte, error) {\n\tdefer res.Body.Close()\n\tcontents, err := ioutil.ReadAll(res.Body)\n\tif err != nil {\n\t\treturn []byte{}, err\n\t}\n\treturn contents, nil\n}", "title": "" }, { "docid": "7dddcd718e4e915fbc447599cfcfe991", "score": "0.5969337", "text": "func (h *HttpResponse) GetBody() []byte {\n\treturn h.body\n}", "title": "" }, { "docid": "815746cf7fb6d0516b4cc287b1bc8631", "score": "0.5956378", "text": "func (req *HttpRequest) Body() []byte {\n\treturn req.body\n}", "title": "" }, { "docid": "c66fc439bc6c53e460d89f49367fa2ed", "score": "0.5952626", "text": "func handleResponse(resp *http.Response, inErr error) (b []byte, err error) {\n\tif inErr != nil {\n\t\treturn nil, inErr\n\t}\n\n\tdefer func() {\n\t\tif cerr := resp.Body.Close(); cerr != nil {\n\t\t\terr = cerr\n\t\t}\n\t}()\n\n\tb, err = ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif !isOKResponseCode(resp.StatusCode) {\n\t\treturn nil, fmt.Errorf(\"got unexpected response status code: %d. response: %s\", resp.StatusCode, b)\n\t}\n\n\tif len(b) == 0 {\n\t\treturn []byte(fmt.Sprintf(\"response status: %s\", resp.Status)), nil\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "01f3cac5fd875561df70f781a4ed1899", "score": "0.5935906", "text": "func (r *Request) Bytes() ([]byte, error) {\n\tres, err := r.Do()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer res.Close()\n\tif r.expectedStatus > 0 && res.StatusCode() != r.expectedStatus {\n\t\treturn nil, fmt.Errorf(\"Unexpected status received : %s\", res.Status())\n\t}\n\treturn res.Bytes()\n}", "title": "" }, { "docid": "9c14e704a44f528281d4c97301b42ee5", "score": "0.59045887", "text": "func (r *Response) ReceiveBytes() (body []byte, err error) {\n\tif r == nil {\n\t\terr = ErrNilResponse\n\t\treturn\n\t}\n\tif r.body == nil {\n\t\tif err = r.Receive(); err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\tbody = r.body\n\treturn\n}", "title": "" }, { "docid": "ab844ee554c56dbd20cb2db7744cdd69", "score": "0.58912843", "text": "func GetBody(r *http.Request, resetBody bool) ([]byte, func(), error) {\n\tdata, err := io.ReadAll(r.Body)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tif resetBody {\n\t\t// * remember, Request.Body has no Bytes(), we have to consume them first\n\t\t// and after re-set them to the body, this is the only solution.\n\t\treturn data, func() {\n\t\t\tsetBody(r, data)\n\t\t}, nil\n\t}\n\n\treturn data, emptyFunc, nil\n}", "title": "" }, { "docid": "2a0ed14620e36d212404494ef7cd62fe", "score": "0.58907276", "text": "func (c *Config) getBody(req *http.Request) (int, []byte, http.Header, error) {\n\tresp, err := c.Client.Do(req)\n\tif err != nil {\n\t\treturn 0, nil, nil, fmt.Errorf(\"httpClient.Do(req): %w\", err)\n\t}\n\tdefer resp.Body.Close()\n\n\tb, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn resp.StatusCode, nil, resp.Header, fmt.Errorf(\"ioutil.ReadAll: %w\", err)\n\t}\n\n\t// fmt.Println(string(b))\n\tif resp.StatusCode < 200 || resp.StatusCode > 299 {\n\t\treturn resp.StatusCode, b, resp.Header, fmt.Errorf(\"failed: %v (status: %s): %w: %s\",\n\t\t\tresp.Request.RequestURI, resp.Status, ErrInvalidStatusCode, string(b))\n\t}\n\n\treturn resp.StatusCode, b, resp.Header, nil\n}", "title": "" }, { "docid": "64df86eb952d9ccdbc755150fde8cec9", "score": "0.5883868", "text": "func (e *InternalError) ResponseBody() ([]byte, error) {\n\treturn []byte{}, nil\n}", "title": "" }, { "docid": "858bb561c8ee696f10b19a82132f3bc8", "score": "0.5870884", "text": "func GetBody(r *http.Request) ([]byte, error) {\n\tvar bodyBytes []byte\n\tvar err error\n\tif r.Body != nil {\n\t\tbodyBytes, err = ioutil.ReadAll(r.Body)\n\t\tif err != nil {\n\t\t\treturn nil, customerror.New(http.StatusBadRequest, \"GetBody read\", err.Error())\n\t\t}\n\t}\n\tr.Body = ioutil.NopCloser(bytes.NewBuffer(bodyBytes))\n\n\treturn bodyBytes, nil\n}", "title": "" }, { "docid": "b261de4b27c6e7fc147ecc5d7987bb0b", "score": "0.5869713", "text": "func (body *HTTPBody) MustBytes() []byte {\n\tbuf, err := body.Bytes()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn buf\n}", "title": "" }, { "docid": "c0585fd80d56daefd8e8efd01e89467f", "score": "0.5820706", "text": "func (c *container) Body() (reader io.ReadCloser, contentType string, ok bool) {\n\tcontentType, err := ContentType(c.request)\n\treturn c.request.Body, contentType, err == nil\n}", "title": "" }, { "docid": "6996acbd9ce64e21acaa9905291758f2", "score": "0.5774145", "text": "func (r *Request) Bytes() ([]byte, error) {\n\tres, err := r.Do()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer res.Body.Close()\n\tcontents, err := ioutil.ReadAll(res.Body)\n\tif err != nil {\n\t\treturn nil, exception.New(err)\n\t}\n\treturn contents, nil\n}", "title": "" }, { "docid": "397948c94e296973403c37f375b47699", "score": "0.574784", "text": "func ExtractBody(response *http.Response) ([]byte, error) {\n defer response.Body.Close()\n responseBody, err := ioutil.ReadAll(response.Body)\n\n if err != nil {\n return nil, err\n }\n\n return responseBody, nil\n}", "title": "" }, { "docid": "33b606be5e146fcad09e6ff99375662f", "score": "0.573021", "text": "func handleResponse(resp *http.Response, inErr error) (b []byte, response *http.Response, err error) {\n\tif inErr != nil {\n\t\treturn nil, nil, inErr\n\t}\n\n\tdefer func() {\n\t\tif cerr := resp.Body.Close(); cerr != nil {\n\t\t\terr = cerr\n\t\t}\n\t}()\n\n\tresponse = resp\n\tb, err = ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tif !isOKResponseCode(resp.StatusCode) {\n\t\treturn nil, response, fmt.Errorf(\"Got unexpected response status code: %d. response: %s\", resp.StatusCode, string(b))\n\t}\n\n\tif len(b) == 0 {\n\t\treturn []byte(fmt.Sprintf(\"Response status: %s\", resp.Status)), response, nil\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "fd7307170785b456a8e153933c0999d7", "score": "0.5726059", "text": "func (r *Response) GetBody() io.ReadCloser {\n\t//defer r.resp.Body.Close()\n\n\treturn r.resp.Body\n}", "title": "" }, { "docid": "eadc7576abe46f44d20f3a1fdff6e996", "score": "0.57084227", "text": "func (h *HTTPResponse) Body(body interface{}) *HTTPResponse {\n\th.RawBody = body\n\treturn h\n}", "title": "" }, { "docid": "6fbf7519c46fc65f8b4d3df3e2b3f7ca", "score": "0.5702668", "text": "func Bytes(resp *EndpointResponse, err error) ([]byte, error) {\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif resp == nil {\n\t\treturn nil, errors.New(\"no response from endpoint or code incorrectly called.\")\n\t}\n\n\tif resp.HttpResponse == nil {\n\t\treturn nil, errors.New(\"No HttpResponse Response\")\n\t}\n\tif resp.HttpResponse.StatusCode != http.StatusOK {\n\t\treturn nil, errors.New(resp.HttpResponse.Status)\n\t}\n\n\tif bytes, err := resp.Bytes(); err != nil {\n\t\treturn nil, err\n\t} else {\n\t\treturn bytes, nil\n\t}\n}", "title": "" }, { "docid": "1221852b903a8b87660fec49045f12a3", "score": "0.5685301", "text": "func (h *HTTPBin) Bytes(w http.ResponseWriter, r *http.Request) {\n\thandleBytes(w, r, false)\n}", "title": "" }, { "docid": "372461f43b0ca917173544c53b3e2691", "score": "0.56781626", "text": "func readResponseBody(resp *http.Response) ([]byte, error) {\n\tif resp == nil || resp.Body == nil {\n\t\treturn nil, nil\n\t}\n\n\t// dump the data\n\tbodyWriter := bytes.NewBuffer(nil)\n\n\t_, err := io.Copy(bodyWriter, resp.Body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresp.Body.Close()\n\n\tbodyData := bodyWriter.Bytes()\n\n\t// restore original state of the Body source stream\n\tresp.Body = toReadCloser(bodyData)\n\n\treturn bodyData, nil\n}", "title": "" }, { "docid": "1fb56f79756957bf05ed858d41dff996", "score": "0.56762546", "text": "func (r *Response) Body() *String {\n\treturn &String{r.chain, string(r.content)}\n}", "title": "" }, { "docid": "9ea45fe508ecf9b293bc82eff65ea17f", "score": "0.5669827", "text": "func parseBody(w http.ResponseWriter, r *http.Request, resp *bodyResponse) error {\n\tdefer r.Body.Close()\n\n\t// Always set resp.Data to the incoming request body, in case we don't know\n\t// how to handle the content type\n\tbody, err := io.ReadAll(r.Body)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// After reading the body to populate resp.Data, we need to re-wrap it in\n\t// an io.Reader for further processing below\n\tr.Body = io.NopCloser(bytes.NewBuffer(body))\n\n\t// if we read an empty body, there's no need to do anything further\n\tif len(body) == 0 {\n\t\treturn nil\n\t}\n\n\t// Always store the \"raw\" incoming request body\n\tresp.Data = string(body)\n\n\tcontentType, _, _ := strings.Cut(r.Header.Get(\"Content-Type\"), \";\")\n\n\tswitch contentType {\n\tcase \"text/html\", \"text/plain\":\n\t\t// no need for extra parsing, string body is already set above\n\t\treturn nil\n\n\tcase \"application/x-www-form-urlencoded\":\n\t\t// r.ParseForm() does not populate r.PostForm for DELETE or GET\n\t\t// requests, but we need it to for compatibility with the httpbin\n\t\t// implementation, so we trick it with this ugly hack.\n\t\tif r.Method == http.MethodDelete || r.Method == http.MethodGet {\n\t\t\toriginalMethod := r.Method\n\t\t\tr.Method = http.MethodPost\n\t\t\tdefer func() { r.Method = originalMethod }()\n\t\t}\n\t\tif err := r.ParseForm(); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tresp.Form = r.PostForm\n\n\tcase \"multipart/form-data\":\n\t\t// The memory limit here only restricts how many parts will be kept in\n\t\t// memory before overflowing to disk:\n\t\t// https://golang.org/pkg/net/http/#Request.ParseMultipartForm\n\t\tif err := r.ParseMultipartForm(1024); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tresp.Form = r.PostForm\n\t\tfiles, err := parseFiles(r.MultipartForm.File)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tresp.Files = files\n\n\tcase \"application/json\":\n\t\tif err := json.NewDecoder(r.Body).Decode(&resp.JSON); err != nil {\n\t\t\treturn err\n\t\t}\n\n\tdefault:\n\t\t// If we don't have a special case for the content type, return it\n\t\t// encoded as base64 data url\n\t\tresp.Data = encodeData(body, contentType)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "677458ed5f8e2aff8a514357f6da0a8a", "score": "0.5663676", "text": "func getContent(resp *http.Response) ([]byte, error) {\n\tif resp.Body == nil {\n\t\treturn []byte{}, nil\n\t}\n\treturn io.ReadAll(resp.Body)\n}", "title": "" }, { "docid": "258a2f2b2e89d9ec1179f1d58e013bb5", "score": "0.56582403", "text": "func httpGetBody(ctx context.Context, url *url.URL, get httpGetFn, timeout time.Duration) ([]byte, error) {\n\tif url == nil {\n\t\treturn nil, errors.New(\"nil URL\")\n\t}\n\n\tif len(url.Host) == 0 {\n\t\treturn nil, errors.New(\"host address is required\")\n\t}\n\n\tif get == nil {\n\t\treturn nil, errors.New(\"nil get function\")\n\t}\n\n\thttpCtx, cancel := context.WithTimeout(ctx, timeout)\n\tdefer cancel()\n\n\trespChan := make(chan *http.Response)\n\terrChan := make(chan error)\n\n\tgo func() {\n\t\thttpResp, err := get(url.String())\n\t\tif err != nil {\n\t\t\terrChan <- err\n\t\t\treturn\n\t\t}\n\n\t\trespChan <- httpResp\n\t}()\n\n\tselect {\n\tcase <-httpCtx.Done():\n\t\tif httpCtx.Err() == context.DeadlineExceeded {\n\t\t\treturn nil, HTTPReqTimedOut(url.String())\n\t\t}\n\t\treturn nil, httpCtx.Err()\n\tcase resp := <-respChan:\n\t\tdefer resp.Body.Close()\n\t\tif resp.StatusCode < 200 || resp.StatusCode > 299 {\n\t\t\treturn nil, errors.Errorf(\"HTTP response error: %d %s\", resp.StatusCode, http.StatusText(resp.StatusCode))\n\t\t}\n\n\t\tresult, err := ioutil.ReadAll(resp.Body)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"reading HTTP response body\")\n\t\t}\n\t\treturn result, nil\n\tcase err := <-errChan:\n\t\treturn nil, err\n\t}\n}", "title": "" }, { "docid": "f7da40f87fc49185c329e630d11fe704", "score": "0.564312", "text": "func dumpRespBody(resp *http.Response) ([]byte, error) {\n\tif resp.Body == nil {\n\t\treturn nil, nil\n\t}\n\tvar b bytes.Buffer\n\tsavecl := resp.ContentLength\n\tvar save io.ReadCloser\n\tvar err error\n\tsave, resp.Body, err = drainBody(resp.Body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t_, err = io.Copy(&b, resp.Body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresp.Body = save\n\tresp.ContentLength = savecl\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn b.Bytes(), nil\n}", "title": "" }, { "docid": "f7da40f87fc49185c329e630d11fe704", "score": "0.564312", "text": "func dumpRespBody(resp *http.Response) ([]byte, error) {\n\tif resp.Body == nil {\n\t\treturn nil, nil\n\t}\n\tvar b bytes.Buffer\n\tsavecl := resp.ContentLength\n\tvar save io.ReadCloser\n\tvar err error\n\tsave, resp.Body, err = drainBody(resp.Body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t_, err = io.Copy(&b, resp.Body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresp.Body = save\n\tresp.ContentLength = savecl\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn b.Bytes(), nil\n}", "title": "" }, { "docid": "d0f1dd3188770a29b2c26c87566fa7ea", "score": "0.5639799", "text": "func (r *request) Body() interface{} {\n\treturn r.body\n}", "title": "" }, { "docid": "d8123909ba23beb35fcaba7001d46f0c", "score": "0.5636901", "text": "func (r *Response) GetBody() []byte {\n\treturn r.Body\n}", "title": "" }, { "docid": "292b140d51da98cca31d4933053eafdb", "score": "0.5636189", "text": "func GetBody(res *http.Response) string {\n\tdefer checkedResponseBodyClose(res)\n\tbody, _ := ioutil.ReadAll(res.Body)\n\treturn string(body)\n}", "title": "" }, { "docid": "eeac9d89f2b20101774bf7cdba8db38f", "score": "0.5631831", "text": "func httpGetBody(url string) ([]byte, error) {\n\tresp, err := http.Get(url)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\treturn processRequest(resp)\n}", "title": "" }, { "docid": "048a85d1b84543086818b568e99031df", "score": "0.56244797", "text": "func GetResponseBody(resp *http.Response) ([]byte, error) {\n\tif resp == nil {\n\t\treturn nil, ErrHTTPShoudNotBeNil\n\t}\n\n\tdefer resp.Body.Close()\n\tbody, err := ioutil.ReadAll(resp.Body)\n\treturn body, err\n}", "title": "" }, { "docid": "86226f8b9d103b6335282f28f7accc76", "score": "0.562102", "text": "func processRequest(resp *http.Response) ([]byte, error) {\n\n\tif resp.StatusCode != 200 {\n\t\treturn nil, errors.New(\"unexpected HTTP status code: \" + resp.Status)\n\t}\n\n\tif resp.ContentLength < 0 {\n\t\treturn ioutil.ReadAll(resp.Body)\n\t} else {\n\t\tbuf := make([]byte, resp.ContentLength)\n\t\t_, err := io.ReadFull(resp.Body, buf)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn buf, nil\n\t}\n}", "title": "" }, { "docid": "cc4a27f160254fd49442d0584e44f642", "score": "0.5617502", "text": "func (r *Req) GetBody() []byte {\n\tif r.Request.Body == nil {\n\t\treturn []byte{}\n\t}\n\tbody, err := ioutil.ReadAll(r.Request.Body)\n\tif err != nil {\n\t\treturn []byte{}\n\t}\n\tr.Request.Body = ioutil.NopCloser(bytes.NewReader(body))\n\treturn body\n}", "title": "" }, { "docid": "5c758bc3bbbee8b4b811117fb74e0caa", "score": "0.5613838", "text": "func getResponseBody(resp *http.Response) string {\n\tcontentType := resp.Header.Get(\"Content-Type\")\n\tif !ifDumpBody(contentType) {\n\t\treturn \"\"\n\t}\n\tbytesBody, errReadBody := ioutil.ReadAll(resp.Body)\n\tif errReadBody != nil {\n\t\treturn \"\"\n\t}\n\t// So the response body can be read again.\n\tresp.Body = ioutil.NopCloser(bytes.NewBuffer(bytesBody))\n\treturn gconv.UnsafeBytesToStr(bytesBody)\n}", "title": "" }, { "docid": "5a3ae16f6e4a06a6a20a2c67d7779139", "score": "0.5612511", "text": "func (m *Message) BodyBytes() []byte {\n\treturn m.Body[:m.Size]\n}", "title": "" }, { "docid": "4a36df5576e58e6d126f6f4a10797934", "score": "0.560695", "text": "func (ctx *Context) Body() ([]byte, error) {\n\tif ctx.req.Body == nil {\n\t\treturn []byte{}, nil\n\t}\n\n\tbody, err := ioutil.ReadAll(ctx.req.Body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tctx.req.Body.Close()\n\tctx.req.Body = ioutil.NopCloser(bytes.NewBuffer(body))\n\n\treturn body, nil\n}", "title": "" }, { "docid": "7e0943b32a49ef5d229a92ee07a03828", "score": "0.55993485", "text": "func HTTPBody(body io.Reader) Option {\n\treturn func(req *http.Request) error {\n\t\trc, ok := body.(io.ReadCloser)\n\t\tif !ok && body != nil {\n\t\t\trc = ioutil.NopCloser(body)\n\t\t}\n\t\treq.Body = rc\n\t\tfileName := \"\"\n\t\tswitch v := body.(type) {\n\t\tcase *bytes.Buffer:\n\t\t\treq.ContentLength = int64(v.Len())\n\t\tcase *bytes.Reader:\n\t\t\treq.ContentLength = int64(v.Len())\n\t\tcase *strings.Reader:\n\t\t\treq.ContentLength = int64(v.Len())\n\t\tcase *os.File:\n\t\t\treq.ContentLength = tryGetFileSize(v)\n\t\t}\n\t\tif req.Header.Get(\"Content-Type\") == \"\" {\n\t\t\treq.Header.Set(\"Content-Type\", typeByExtension(fileName))\n\t\t}\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "284d22a2c57178e7c021405f2fbf0ba9", "score": "0.5599141", "text": "func ReadWholeBody(httpReq *http.Request) ([]byte, error) {\n\tsize, err := strconv.Atoi(httpReq.Header.Get(\"Content-Length\"))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbody := make([]byte, size)\n\tsize, err = httpReq.Body.Read(body)\n\tif err != nil && err != io.EOF {\n\t\treturn nil, err\n\t}\n\treturn body, nil\n}", "title": "" }, { "docid": "f55475e2680afd97a3dbcadbe927054d", "score": "0.55793494", "text": "func (ctx Context) Body() []byte {\n\tif !ctx.body.hasReadBody {\n\t\tctx.body.body, _ = ioutil.ReadAll(ctx.r.Body)\n\t\tctx.r.Body.Close()\n\t\tctx.body.hasReadBody = true\n\t}\n\treturn ctx.body.body\n}", "title": "" }, { "docid": "a14bf201a0527a4f18fe13895417dd18", "score": "0.55728877", "text": "func (r *Request) GetBody() io.ReadSeeker {\n\treturn r.safeBody\n}", "title": "" }, { "docid": "a81f5cf692eba9dc5b90593ff4087a54", "score": "0.5568416", "text": "func (o AppEngineHttpRequestResponseOutput) Body() pulumi.StringOutput {\n\treturn o.ApplyT(func(v AppEngineHttpRequestResponse) string { return v.Body }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "b18b75d13b638db8c759d9ebb186abd9", "score": "0.5544617", "text": "func Bytes(b []byte, contentType string) ResponseSetter {\n\treturn func(options *responseOptions) error {\n\t\tbody := make([]byte, len(b))\n\t\tcopy(body, b)\n\t\toptions.body = body\n\t\toptions.headers[\"Content-Type\"] = contentType\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "b13ae1ab291e66c30f0c9f1e317da9ed", "score": "0.55393386", "text": "func parseResponseBody(resBody io.Reader) ([]byte, error) {\n\tcontent, err := ioutil.ReadAll(resBody)\n\tif err != nil {\n\t\treturn nil, err\t\n\t}\n\t\n\tlength := binary.BigEndian.Uint32(content[1:5])\n\tif length == 0 {\n\t\treturn nil, nil\n\t}\n\t\n\tif len(content) < int(length) {\n\t\tfmt.Printf(\"len(content)=%d, expected=%d\\n\", len(content), int(length))\n\t\treturn nil, io.ErrUnexpectedEOF\n\t}\n\t\n\treturn content[5:5+int(length)], nil\n\t/*\n\tvar h [5]byte\n\tif _, err := resBody.Read(h[:]); err != nil {\n\t\treturn nil, err\n\t}\n\n\tlength := binary.BigEndian.Uint32(h[1:])\n\tif length == 0 {\n\t\treturn nil, nil\n\t}\n\n\t// TODO: check message size\n\tcontent, err := ioutil.ReadAll(resBody)\n\tif len(content) != int(length) {\n\t\tfmt.Printf(\"len(content)=%d, expected=%d\\n\", len(content), int(length))\n\t\treturn nil, io.ErrUnexpectedEOF\n\t}\n\n\treturn content, err\n\t*/\n}", "title": "" }, { "docid": "de772116632a18f4f25d9453afef8958", "score": "0.5530463", "text": "func (s *Service) GetResponseBody(res *http.Response) ([]byte, error) {\n\tdefer res.Body.Close()\n\tbuffer, err := ioutil.ReadAll(res.Body)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tbody := ioutil.NopCloser(bytes.NewReader(buffer))\n\tres.Body = body\n\tres.ContentLength = int64(len(buffer))\n\tres.Header.Set(\"Content-Length\", strconv.Itoa(len(buffer)))\n\n\treturn buffer, nil\n}", "title": "" }, { "docid": "44ac367e61033cf157790eb3e4a9f264", "score": "0.55183566", "text": "func RequestBodyToBytes(request *http.Request) ([]byte, error) {\n\tcontentType, err := validateContentTypeIsSupported(request)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tbody, err := BodyToBytes(request.Body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif contentType == jsonContentType {\n\t\tif err := validJson(body); err != nil {\n\t\t\treturn nil, &HTTPError{\n\t\t\t\tErrorType: \"BadRequest\",\n\t\t\t\tDescription: fmt.Sprintf(\"Request body is not valid: %s\", err),\n\t\t\t\tStatusCode: http.StatusBadRequest,\n\t\t\t}\n\t\t}\n\t}\n\n\treturn body, nil\n}", "title": "" }, { "docid": "a8bf867bf4c1f9b5525833b4de57a76e", "score": "0.5515491", "text": "func (o HttpRequestResponseOutput) Body() pulumi.StringOutput {\n\treturn o.ApplyT(func(v HttpRequestResponse) string { return v.Body }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "8a762dc6ac266a1cd14ecd872ee5520d", "score": "0.5491202", "text": "func (resp *Response) ReadBody() []byte {\n\treturn resp.r.Body()\n}", "title": "" }, { "docid": "b86522ae5fc318f2e71fccaeeaf8083a", "score": "0.54897636", "text": "func getResponseBody(resp *http.Response, err error) (string, error) {\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer resp.Body.Close()\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn \"\", errors.New(resp.Status)\n\t}\n\tbytes, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn string(bytes), nil\n}", "title": "" }, { "docid": "1064f63128ffaa4ee88c4cb4c4d01152", "score": "0.54811054", "text": "func (o *UcsdconnectorRestClientMessage) GetBodyOk() (*string, bool) {\n\tif o == nil || o.Body == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Body, true\n}", "title": "" }, { "docid": "50469fbecbe6d9641bf59c49a75e3009", "score": "0.54801023", "text": "func (req *Request) Bytes() []byte {\n\tdata := make([]byte, req.Size())\n\n\tpos := req.fillHeaderBytes(data)\n\n\tif len(req.Body) > 0 {\n\t\tcopy(data[pos:pos+len(req.Body)], req.Body)\n\t}\n\n\treturn data\n}", "title": "" }, { "docid": "0a700af2212d3c09c600b90ed54f99c4", "score": "0.54788464", "text": "func getResponseBody(res *http.Response) string {\n\tif res.Body == nil {\n\t\treturn \"\"\n\t}\n\tbodyContent, _ := ioutil.ReadAll(res.Body)\n\tres.Body = utils.NewReadCloser(bodyContent, true)\n\treturn string(bodyContent)\n}", "title": "" }, { "docid": "29299c8d92565a5b0e8ac982ac476b84", "score": "0.54750645", "text": "func (s Server) body(handler http.Handler) http.Handler {\n\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tbody, err := ioutil.ReadAll(io.LimitReader(r.Body, int64(s.bodyLimit)))\n\t\tif err != nil {\n\t\t\tw.WriteHeader(http.StatusInternalServerError)\n\n\t\t\tif err := s.writeJSON(Response{Error: ErrInvalidRequest.Error()}, w); err != nil {\n\t\t\t\tlog.Error().Err(err).Msg(\"writeJSON fail\")\n\t\t\t}\n\n\t\t\treturn\n\t\t}\n\n\t\tr.Body.Close()\n\t\tr.Body = ioutil.NopCloser(bytes.NewBuffer(body))\n\n\t\thandler.ServeHTTP(w, r)\n\t})\n}", "title": "" }, { "docid": "8300e96bd402e273ea928ac7ffe0a52d", "score": "0.5467347", "text": "func CloseBody(res *http.Response) {\n\tif res == nil || res.Body == nil {\n\t\treturn\n\t}\n\t// Justification for 3 byte reads: two for up to \"\\r\\n\" after\n\t// a JSON/XML document, and then 1 to see EOF if we haven't yet.\n\t// TODO(bradfitz): detect Go 1.3+ and skip these reads.\n\t// See https://codereview.appspot.com/58240043\n\t// and https://codereview.appspot.com/49570044\n\tbuf := make([]byte, 1)\n\tfor i := 0; i < 3; i++ {\n\t\t_, err := res.Body.Read(buf)\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t}\n\tres.Body.Close()\n\n}", "title": "" }, { "docid": "ac7d75bb275045aa5a3b31150f80b7f4", "score": "0.5459375", "text": "func getRespBodyPreview(resp *http.Response, len int64) (string, error) {\n\n\tpart, err := ioutil.ReadAll(io.LimitReader(resp.Body, len))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// recombine the buffered part of the body with the rest of the stream\n\tresp.Body = ioutil.NopCloser(io.MultiReader(bytes.NewReader(part), resp.Body))\n\treturn string(part), nil\n}", "title": "" }, { "docid": "7abd88ee4640d44eeab893dad114b772", "score": "0.54579073", "text": "func getHTTPBody(domain string) string{\n\n\treturn \"\"\n}", "title": "" }, { "docid": "2e4514c54ef4313d10155b7be3c625a2", "score": "0.54287785", "text": "func (r *Reply) Body() *bytes.Buffer {\n\treturn r.body\n}", "title": "" }, { "docid": "27552d45df26c11da5ceacb93daa9384", "score": "0.5393927", "text": "func (o AppEngineHttpRequestOutput) Body() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v AppEngineHttpRequest) *string { return v.Body }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "63a4702fa4349f2fa85ed90c56958791", "score": "0.53922635", "text": "func handleResponse(resp *http.Response) ([]byte, error) {\n\tdefer resp.Body.Close()\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn nil, fmt.Errorf(\"http response code is not StatusOK: '%v'\", resp.StatusCode)\n\t}\n\treturn io.ReadAll(resp.Body)\n}", "title": "" }, { "docid": "e74f07df770a58e266e8b2699fc25756", "score": "0.5391108", "text": "func httpResponseToBytes(resp *http.Response) ([]byte, error) {\n\tbuf := new(bytes.Buffer)\n\tif resp == nil {\n\t\treturn nil, fmt.Errorf(\"http response nil\")\n\t}\n\terr := resp.Write(buf)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn buf.Bytes(), nil\n}", "title": "" }, { "docid": "89d22416355a0ef217a2f13cf0efb0ac", "score": "0.53862494", "text": "func (h *HTTPAPICaller) GetBytes(api string) ([]byte, error) {\n\tdefer timeTrack(time.Now(), \"HTTP API Call\")\n\n\tlog.WithFields(log.Fields{\n\t\t\"api\": api,\n\t}).Debug(\"Calling HTTP API\")\n\n\tresp, err := http.Get(api)\n\tif err != nil {\n\t\tlog.WithFields(log.Fields{\n\t\t\t\"api\": api,\n\t\t\t\"err\": err,\n\t\t}).Warn(\"http.Get returned an error\")\n\n\t\treturn []byte{}, err\n\t}\n\n\tresponseBody, err := ioutil.ReadAll(resp.Body)\n\tresp.Body.Close()\n\n\tif err != nil {\n\t\tlog.WithFields(log.Fields{\n\t\t\t\"api\": api,\n\t\t\t\"err\": err,\n\t\t\t\"statusCode\": resp.StatusCode,\n\t\t}).Warn(\"Error reading response body\")\n\n\t\treturn []byte{}, err\n\t}\n\n\tresponseBodyText := fmt.Sprintf(\"%s\", responseBody)\n\n\tif resp.StatusCode != 200 {\n\t\tlog.WithFields(log.Fields{\n\t\t\t\"api\": api,\n\t\t\t\"statusCode\": resp.StatusCode,\n\t\t\t\"body\": responseBodyText,\n\t\t}).Warn(\"Server returned non-200 response\")\n\n\t\treturn []byte{}, fmt.Errorf(\"GET %s returned HTTP %d\", api, resp.StatusCode)\n\t}\n\n\tlog.WithFields(log.Fields{\n\t\t\"api\": api,\n\t\t\"body\": responseBodyText,\n\t}).Debug(\"Received response data\")\n\n\treturn responseBody, nil\n}", "title": "" }, { "docid": "19a8b245a78b26d78ef5b78e7d515d4e", "score": "0.5384187", "text": "func responseData(resp *http.Response) []byte {\n\tif resp == nil {\n\t\treturn nil\n\t}\n\n\tvar reader io.Reader\n\tswitch resp.Header.Get(\"Content-Encoding\") {\n\tcase \"gzip\":\n\t\t//clog.Trace(\"Encoding: %+v\", resp.Header.Get(\"Content-Encoding\"))\n\t\treader, _ = gzip.NewReader(resp.Body)\n\tdefault:\n\t\treader = resp.Body\n\t}\n\n\tdata, err := ioutil.ReadAll(reader)\n\tif err != nil {\n\t\tclog.Error(0, \"读取响应数据失败: %+v\", err)\n\t\treturn nil\n\t}\n\n\treturn data\n}", "title": "" }, { "docid": "fb5cf8abada2c84883dbc84622d7d2d7", "score": "0.5382295", "text": "func (client *HTTPClient) RequestBytes(ctx context.Context, reqData HTTPRequestData) ([]byte, error) {\n\tr, err := client.request(ctx, reqData)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdefer r.Body.Close()\n\n\treturn ioutil.ReadAll(r.Body)\n}", "title": "" }, { "docid": "1d3b689f572a5d2c58b5dd00f5268fbe", "score": "0.53719795", "text": "func (c *Context) Body() io.ReadCloser { return c.req.Body }", "title": "" }, { "docid": "42ba2480888afa02051fd852694762e7", "score": "0.5362488", "text": "func (r *Response) Read() ([]byte, error) {\n\tvar b []byte\n\tif r.Response == nil {\n\t\treturn nil, errors.New(\"no response exists on interface\")\n\t}\n\n\tif r.Response.Body != nil {\n\t\tb, _ = ioutil.ReadAll(r.Response.Body)\n\t}\n\n\tr.Response.Body = ioutil.NopCloser(bytes.NewBuffer(b))\n\n\treturn b, nil\n}", "title": "" }, { "docid": "ce48872c85663d8992f25a81096a8f5a", "score": "0.5356437", "text": "func getBody() (*bytes.Buffer, error) {\n\tresp, err := http.Get(packtPubBaseURL)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\tbody, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbuf := bytes.NewBuffer(body)\n\treturn buf, nil\n}", "title": "" }, { "docid": "87df7deb0badde23adefcfb376211db6", "score": "0.53474075", "text": "func (e *ServerError) ResponseBody() ([]byte, error) {\n\tbody, err := json.Marshal(e)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Error while parsing response body: %v\", err)\n\t}\n\treturn body, nil\n}", "title": "" }, { "docid": "436b34ae1df744ff2974c24b3187e711", "score": "0.53462183", "text": "func (cbhcr *CreateBannerByURLRequest) Body() io.Reader {\n\tbody := new(bytes.Buffer)\n\terr := json.NewEncoder(body).Encode(cbhcr)\n\tif err != nil {\n\t\tlog.Print(err)\n\t\treturn nil\n\t}\n\n\treturn body\n}", "title": "" }, { "docid": "755c147bef2fed235b4eeda4e1aae423", "score": "0.53410715", "text": "func (input *Input) CopyBody() []byte {\n\tbody, _ := ioutil.ReadAll(input.request.Body)\n\tinput.request.Body.Close()\n\tbf := bytes.NewBuffer(body)\n\tinput.request.Body = ioutil.NopCloser(bf)\n\n\treturn body\n}", "title": "" }, { "docid": "2c1d4cf31ec718445d170a6e6cc920fc", "score": "0.5330788", "text": "func (r *Resp) Bytes() []byte {\n\tdata, _ := r.ToBytes()\n\treturn data\n}", "title": "" }, { "docid": "573054bf2dd34db0b89061f69da00826", "score": "0.53258294", "text": "func (resp *Response) Content() ([]byte, error) {\n\tif resp.Err != nil || resp.body != nil {\n\t\treturn resp.body, resp.Err\n\t}\n\tdefer resp.RawResponse.Body.Close()\n\n\tvar err error\n\tresp.body, err = ioutil.ReadAll(resp.RawResponse.Body)\n\treturn resp.body, err\n}", "title": "" }, { "docid": "bc0ad5f1bd85ab0f42a5221cc7186816", "score": "0.53135693", "text": "func (r *Resp) ToBytes() ([]byte, error) {\n\tif r.err != nil {\n\t\treturn nil, r.err\n\t}\n\tif r.respBody != nil {\n\t\treturn r.respBody, nil\n\t}\n\tdefer r.resp.Body.Close()\n\trespBody, err := ioutil.ReadAll(r.resp.Body)\n\tif err != nil {\n\t\tr.err = err\n\t\treturn nil, err\n\t}\n\tr.respBody = respBody\n\treturn r.respBody, nil\n}", "title": "" }, { "docid": "a4a37ef7da1b27cea3d983b665f6dc7c", "score": "0.53084356", "text": "func (ctx *Context) ReadBody(ptr interface{}) error {\n\t// If the ptr is string or byte, read the body as it's.\n\tswitch v := ptr.(type) {\n\tcase *string:\n\t\tb, err := ctx.GetBody()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t*v = string(b)\n\tcase *[]byte:\n\t\tb, err := ctx.GetBody()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tcopy(*v, b)\n\t}\n\n\tif ctx.Method() == http.MethodGet {\n\t\tif ctx.Request().URL.RawQuery != \"\" {\n\t\t\t// try read from query.\n\t\t\treturn ctx.ReadQuery(ptr)\n\t\t}\n\n\t\t// otherwise use the ReadForm,\n\t\t// it's actually the same except\n\t\t// ReadQuery will not fire errors on:\n\t\t// 1. unknown or empty url query parameters\n\t\t// 2. empty query or form (if FireEmptyFormError is enabled).\n\t\treturn ctx.ReadForm(ptr)\n\t}\n\n\tswitch ctx.GetContentTypeRequested() {\n\tcase ContentXMLHeaderValue, ContentXMLUnreadableHeaderValue:\n\t\treturn ctx.ReadXML(ptr)\n\t\t// \"%v reflect.Indirect(reflect.ValueOf(ptr)).Interface())\n\tcase ContentYAMLHeaderValue, ContentYAMLTextHeaderValue:\n\t\treturn ctx.ReadYAML(ptr)\n\tcase ContentFormHeaderValue, ContentFormMultipartHeaderValue:\n\t\treturn ctx.ReadForm(ptr)\n\tcase ContentMultipartRelatedHeaderValue:\n\t\treturn fmt.Errorf(\"context: read body: cannot bind multipart/related: use ReadMultipartRelated instead\")\n\tcase ContentJSONHeaderValue:\n\t\treturn ctx.ReadJSON(ptr)\n\tcase ContentProtobufHeaderValue:\n\t\tmsg, ok := ptr.(proto.Message)\n\t\tif !ok {\n\t\t\treturn ErrContentNotSupported\n\t\t}\n\n\t\treturn ctx.ReadProtobuf(msg)\n\tcase ContentMsgPackHeaderValue, ContentMsgPack2HeaderValue:\n\t\treturn ctx.ReadMsgPack(ptr)\n\tdefault:\n\t\tif ctx.Request().URL.RawQuery != \"\" {\n\t\t\t// try read from query.\n\t\t\treturn ctx.ReadQuery(ptr)\n\t\t}\n\n\t\t// otherwise default to JSON.\n\t\treturn ctx.ReadJSON(ptr)\n\t}\n}", "title": "" }, { "docid": "c22d24953df1328756b4fd9c214cf613", "score": "0.5304665", "text": "func getPostBody(w http.ResponseWriter, r *http.Request, limit int) []byte {\n\tif r.Body == nil || r.Method != \"POST\" {\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\treturn nil\n\t}\n\n\tbuf := new(bytes.Buffer)\n\tbuf.ReadFrom(io.LimitReader(r.Body, int64(limit)))\n\treturn buf.Bytes()\n}", "title": "" }, { "docid": "8d874c67ee7920a1eeea815d1cd1bc3e", "score": "0.5303012", "text": "func (h *ServerHandler) readBodyIfNeeded() chan interface{} {\n\tch := make(chan interface{})\n\tgo func() {\n\t\tb := make([]byte, 4096)\n\t\tcontentLength, _ := h.contentLength()\n\t\tfor n := 0; n < contentLength; {\n\t\t\tm, err := h.h.r.Read(b)\n\t\t\tif err != nil {\n\t\t\t\tnerr := fmt.Errorf(\"Failed to read body: %v\", err)\n\t\t\t\tch <- &ErrorOccurred{nerr}\n\t\t\t\treturn\n\t\t\t}\n\t\t\tn += m\n\t\t\tch <- &ResponseBodyReceived{b[:m], n == contentLength}\n\t\t}\n\t}()\n\treturn ch\n}", "title": "" } ]
1e3c70fec6c04f06b8f090c57fcf9d2e
Bytes estimates the memory footprint of this Index, in bytes.
[ { "docid": "0e83cb9a55d7d75fce015958d7dab07a", "score": "0.74700797", "text": "func (i *Index) Bytes() int {\n\tvar b int\n\ti.mu.RLock()\n\tb += 24 // mu RWMutex is 24 bytes\n\tb += int(unsafe.Sizeof(i.database)) + len(i.database)\n\t// Do not count SeriesFile because it belongs to the code that constructed this Index.\n\tif i.fieldset != nil {\n\t\tb += int(unsafe.Sizeof(i.fieldset)) + i.fieldset.Bytes()\n\t}\n\tb += int(unsafe.Sizeof(i.fieldset))\n\tfor k, v := range i.measurements {\n\t\tb += int(unsafe.Sizeof(k)) + len(k)\n\t\tb += int(unsafe.Sizeof(v)) + v.bytes()\n\t}\n\tb += int(unsafe.Sizeof(i.measurements))\n\tfor k, v := range i.series {\n\t\tb += int(unsafe.Sizeof(k)) + len(k)\n\t\tb += int(unsafe.Sizeof(v)) + v.bytes()\n\t}\n\tb += int(unsafe.Sizeof(i.series))\n\tb += int(unsafe.Sizeof(i.seriesSketch)) + i.seriesSketch.Bytes()\n\tb += int(unsafe.Sizeof(i.seriesTSSketch)) + i.seriesTSSketch.Bytes()\n\tb += int(unsafe.Sizeof(i.measurementsSketch)) + i.measurementsSketch.Bytes()\n\tb += int(unsafe.Sizeof(i.measurementsTSSketch)) + i.measurementsTSSketch.Bytes()\n\tb += 8 // rebuildQueue Mutex is 8 bytes\n\ti.mu.RUnlock()\n\treturn b\n}", "title": "" } ]
[ { "docid": "c8fa0d76eee8dfeb805de943dfcfb807", "score": "0.70518625", "text": "func (i *Index) DiskSizeBytes() int64 { return 0 }", "title": "" }, { "docid": "b429457c99d1609550e0439bf526a954", "score": "0.6824686", "text": "func (mb *MetadataBuilder) NumBytes() int64 { return mb.meta.NumBytes }", "title": "" }, { "docid": "600662f76360336937fcef27122783dc", "score": "0.6645738", "text": "func (b BinaryPrefix) Bytes() float64 {\n\treturn float64(b) * 1024 * 1024\n}", "title": "" }, { "docid": "3073a1897f097c587f91cbdf6b4ffa0d", "score": "0.62044847", "text": "func (blk *MeasurementBlock) bytes() int {\n\tvar b int\n\t// Do not count contents of blk.data or blk.hashData because they reference into an external []byte\n\tb += int(unsafe.Sizeof(*blk))\n\treturn b\n}", "title": "" }, { "docid": "23657a68be5c24129baaf283eb458e9f", "score": "0.6199539", "text": "func memSize(value float64) string {\n\treturn byten.Size(int64(value))\n}", "title": "" }, { "docid": "9ef97416864c8a093ef6861fa2a0d67b", "score": "0.6177232", "text": "func (mb *Megabytes) Bytes() uint64 {\n\treturn mb.Value * bytefmt.MEGABYTE\n}", "title": "" }, { "docid": "cdfa832afc68cf96b1501cc5187fb36c", "score": "0.61295295", "text": "func (txmp *TxMempool) SizeBytes() int64 {\n\treturn atomic.LoadInt64(&txmp.sizeBytes)\n}", "title": "" }, { "docid": "0cda429112475b356c082dacfd799245", "score": "0.60352844", "text": "func (m *Map) MemoryInBytes() uint64 {\n\treturn uint64(m.bucketCount*m.keysPerBucket) +\n\t\tuint64(m.bytesPerKey)*m.count +\n\t\tm.valuesByteCount\n}", "title": "" }, { "docid": "1f347a264773fcba595f84c2ffa9f4ac", "score": "0.60277194", "text": "func (b Datasize) Bytes() float64 {\n\treturn float64(b / Byte)\n}", "title": "" }, { "docid": "4bd3ddc63bff37def0f904574fa05a93", "score": "0.60273945", "text": "func (d *indexData) memoryUse() int {\n\tsz := 0\n\tfor _, a := range [][]uint32{\n\t\td.newlinesIndex, d.docSectionsIndex,\n\t\td.boundaries, d.fileNameIndex,\n\t\td.fileEndRunes, d.fileNameEndRunes,\n\t\td.fileEndSymbol, d.symbols.symKindIndex,\n\t\td.subRepos,\n\t} {\n\t\tsz += 4 * len(a)\n\t}\n\tsz += d.runeOffsets.sizeBytes()\n\tsz += d.fileNameRuneOffsets.sizeBytes()\n\tsz += len(d.languages)\n\tsz += len(d.checksums)\n\tsz += 2 * len(d.repos)\n\tif len(d.ranks) > 0 {\n\t\tsz += 8 * len(d.ranks) * len(d.ranks[0])\n\t}\n\tsz += 8 * len(d.runeDocSections)\n\tsz += 8 * len(d.fileBranchMasks)\n\tsz += d.contentNgrams.SizeBytes()\n\tsz += d.fileNameNgrams.SizeBytes()\n\treturn sz\n}", "title": "" }, { "docid": "e36e4c24ac65cfe7699180ad1311254c", "score": "0.60072017", "text": "func (mem *Malloced) ByteSize() SizeT {\n\tif mem == nil {\n\t\treturn SizeT(0)\n\t}\n\tif mem.ptr == nil {\n\t\treturn SizeT(0)\n\t}\n\treturn mem.size\n}", "title": "" }, { "docid": "280871c06e7c20cff6bdd7d26aa54029", "score": "0.59729403", "text": "func (s Size) Mebibytes() float64 {\n\treturn float64(int64(s)) / float64(Mebibyte)\n}", "title": "" }, { "docid": "0ea4689a6088c4d8bc3a0e10c0dd4d4b", "score": "0.5953724", "text": "func (b BinaryPrefix) KBytes() float64 {\n\treturn float64(b) * 1024\n}", "title": "" }, { "docid": "945081e749639158fbe0d1bff764e1fa", "score": "0.5952324", "text": "func (x *Index) Bytes() []byte {\n\treturn x.data\n}", "title": "" }, { "docid": "14aeefb4fde5a73748c56f098d84c4f7", "score": "0.5938124", "text": "func (a *Allocation) RAMBytes() float64 {\n\tif a.Minutes() <= 0.0 {\n\t\treturn 0.0\n\t}\n\treturn a.RAMByteHours / (a.Minutes() / 60.0)\n}", "title": "" }, { "docid": "a4457c2d9115f74c3caa3f85c51c6cf4", "score": "0.5922393", "text": "func Bytes(n int) []byte { return global.Bytes(n) }", "title": "" }, { "docid": "a4457c2d9115f74c3caa3f85c51c6cf4", "score": "0.5922393", "text": "func Bytes(n int) []byte { return global.Bytes(n) }", "title": "" }, { "docid": "7d9d08abab2b8b85b7db59b6bcd9dc4e", "score": "0.58638096", "text": "func (log *LogOne) sizeBytes() int {\n\tbyteBuffer := new(bytes.Buffer)\n\tencoder := labgob.NewEncoder(byteBuffer)\n\tencoder.Encode(log.FirstUncompressedIndex)\n\tencoder.Encode(log.LastCompressedTerm)\n\tencoder.Encode(log.UncompressedEntries)\n\treturn len(byteBuffer.Bytes())\n}", "title": "" }, { "docid": "13216f16d41393fbb799617258b7d4d7", "score": "0.58230233", "text": "func (b BinaryPrefix) MBytes() float64 {\n\treturn float64(b)\n}", "title": "" }, { "docid": "05b6e30eb394748abdfc747a8f39f6ee", "score": "0.5793737", "text": "func (s Size) Kibibytes() float64 {\n\treturn float64(int64(s)) / float64(Kibibyte)\n}", "title": "" }, { "docid": "9abfffb0a3910611194fcfd02c5389f7", "score": "0.5787918", "text": "func (a Index) Size() Cardinality { return Cardinal(1) }", "title": "" }, { "docid": "d25fda8f98b3f1716c2ebb8581733202", "score": "0.577228", "text": "func (bv BytesView) Size() int { return len(bv) }", "title": "" }, { "docid": "0e8df4eab3da2160cfcf47e7073de9c6", "score": "0.5757314", "text": "func (mem *GoPointer) ByteSize() SizeT {\n\tif mem.ptr == nil {\n\t\treturn SizeT(0)\n\t}\n\tif mem == nil {\n\t\treturn SizeT(0)\n\t}\n\treturn mem.size\n}", "title": "" }, { "docid": "dec7f5831fcbfe4f5a166e572bb4d365", "score": "0.5742205", "text": "func (o LookupSpecResultOutput) SizeBytes() pulumi.IntOutput {\n\treturn o.ApplyT(func(v LookupSpecResult) int { return v.SizeBytes }).(pulumi.IntOutput)\n}", "title": "" }, { "docid": "07fa6f7e760be3c909e74dbd943c2a45", "score": "0.5730746", "text": "func (b Datasize) Exabytes() float64 {\n\treturn float64(b / Exabyte)\n}", "title": "" }, { "docid": "613f4bce740a7e66b18a2f683c31f21b", "score": "0.5727091", "text": "func (b Datasize) Megabytes() float64 {\n\treturn float64(b / Megabyte)\n}", "title": "" }, { "docid": "1b38e13788be335ea35f798bfde5f206", "score": "0.57181025", "text": "func (th *trackHeader) ByteSize() int64 {\n\t// ID + NameSize + len(Name) + 16 steps\n\treturn int64(4 + 1 + th.NameSize + 16)\n\n}", "title": "" }, { "docid": "1d78ad3a3ea3c2473919491dd64fcbe8", "score": "0.5704717", "text": "func (s *Set) SizeBytes() uint64 {\n\tif s == nil {\n\t\treturn 0\n\t}\n\tn := uint64(unsafe.Sizeof(*s))\n\tfor i := range s.buckets {\n\t\tn += s.buckets[i].sizeBytes()\n\t}\n\treturn n\n}", "title": "" }, { "docid": "3d61c4e9351f92d71555fab726337821", "score": "0.5695399", "text": "func (i *Index) Size() int {\n\treturn i.bpt.Size()\n}", "title": "" }, { "docid": "f184524d6558ebc1da30018dc07c32f2", "score": "0.56578207", "text": "func kbytesToBytes(i int64) int64 {\n\treturn 1024 * i\n}", "title": "" }, { "docid": "bc3d6d4b847f159e9e3216a658f184c6", "score": "0.56426346", "text": "func Test_byts_Bytes_Size_(t *testing.T) {\n\tTBegin(t)\n\t//\n\t// (ob *Bytes) Size() int\n\t//\n\t// TODO: TEST return len(ob.ar)\n}", "title": "" }, { "docid": "c96ded6b281fa41745eb3f87df36648d", "score": "0.56388646", "text": "func (b BinaryPrefix) TBytes() float64 {\n\treturn float64(b) / TB\n}", "title": "" }, { "docid": "89a462048dfb3e95870e6817cedfcfc5", "score": "0.5631921", "text": "func (memory memory) Size() int { return len(memory) }", "title": "" }, { "docid": "0ada3e3ccebd771ccf62d869d1ba7b69", "score": "0.56173503", "text": "func (me *recHead) bytes() int {\n\treturn int(me.Len+1) * 4\n}", "title": "" }, { "docid": "a3a93f7b52018a60be3b0ab00accbcf3", "score": "0.55983067", "text": "func (ars AddrRangeSeq) NumBytes() int64 {\n\treturn int64(ars.limit)\n}", "title": "" }, { "docid": "7f34e11115ed8c103b75fdef3f5bcc03", "score": "0.5575558", "text": "func Size_Kibibytes(amount *float64) Size {\n\t_init_.Initialize()\n\n\tvar returns Size\n\n\t_jsii_.StaticInvoke(\n\t\t\"monocdk.Size\",\n\t\t\"kibibytes\",\n\t\t[]interface{}{amount},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "852aebc812aa3f63dd076e33137597a9", "score": "0.555168", "text": "func (o LookupVersionArtifactResultOutput) SizeBytes() pulumi.IntOutput {\n\treturn o.ApplyT(func(v LookupVersionArtifactResult) int { return v.SizeBytes }).(pulumi.IntOutput)\n}", "title": "" }, { "docid": "f5887ba059a32c1e2144392709b6107c", "score": "0.5529087", "text": "func (b Datasize) Petabytes() float64 {\n\treturn float64(b / Petabyte)\n}", "title": "" }, { "docid": "aedf4fa6792ef5b8b1aeb8d7dee02835", "score": "0.5516979", "text": "func allocBytes(f func()) uint64 {\n\tvar stats runtime.MemStats\n\truntime.ReadMemStats(&stats)\n\tt := stats.TotalAlloc\n\tf()\n\truntime.ReadMemStats(&stats)\n\treturn stats.TotalAlloc - t\n}", "title": "" }, { "docid": "aedf4fa6792ef5b8b1aeb8d7dee02835", "score": "0.5516979", "text": "func allocBytes(f func()) uint64 {\n\tvar stats runtime.MemStats\n\truntime.ReadMemStats(&stats)\n\tt := stats.TotalAlloc\n\tf()\n\truntime.ReadMemStats(&stats)\n\treturn stats.TotalAlloc - t\n}", "title": "" }, { "docid": "eba169fdc1dcfd001df1c37304c99edc", "score": "0.55074996", "text": "func Size_Pebibytes(amount *float64) Size {\n\t_init_.Initialize()\n\n\tvar returns Size\n\n\t_jsii_.StaticInvoke(\n\t\t\"monocdk.Size\",\n\t\t\"pebibytes\",\n\t\t[]interface{}{amount},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "8162a18d1a6f3d9888d963316c94e373", "score": "0.5494186", "text": "func Size_Mebibytes(amount *float64) Size {\n\t_init_.Initialize()\n\n\tvar returns Size\n\n\t_jsii_.StaticInvoke(\n\t\t\"monocdk.Size\",\n\t\t\"mebibytes\",\n\t\t[]interface{}{amount},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "85074b1be392edb529f2e2a96a94bf00", "score": "0.5485803", "text": "func (txn *KVTxn) Size() int {\n\treturn txn.us.GetMemBuffer().Size()\n}", "title": "" }, { "docid": "1563752b8a0f6d63f49ac460812688c7", "score": "0.5484561", "text": "func (l *ListBuffer) Bytes() int64 {\n\treturn l.bytes\n}", "title": "" }, { "docid": "ff208e85627d1c7f11d2ab8626444459", "score": "0.54686713", "text": "func (i *IndexZYX) Bytes() []byte {\n\treturn Point3d(*i).ToZYXBytes()\n}", "title": "" }, { "docid": "81b9e2ec2c00e132fa0f443d4872667c", "score": "0.5426959", "text": "func (a *Allocation) PVBytes() float64 {\n\tif a.Minutes() <= 0.0 {\n\t\treturn 0.0\n\t}\n\treturn a.PVByteHours() / (a.Minutes() / 60.0)\n}", "title": "" }, { "docid": "bf88ec67870497bb1c7d4238d4038016", "score": "0.5394168", "text": "func (e *MeasurementBlockElem) Size() int { return e.size }", "title": "" }, { "docid": "4a9b2b1265cea60dbc5efb371b6822ce", "score": "0.5393663", "text": "func (b Datasize) Kilobytes() float64 {\n\treturn float64(b / Kilobyte)\n}", "title": "" }, { "docid": "749683d58320f997773e6e1a4a067d84", "score": "0.53766155", "text": "func (mb *MessageBatch) NumBytes() uint64 {\n\tmb.mu.RLock()\n\tdefer mb.mu.RUnlock()\n\n\treturn mb.currentSize\n}", "title": "" }, { "docid": "2e032472994f9b80455098146e7a7209", "score": "0.53695655", "text": "func (b Datasize) Terabytes() float64 {\n\treturn float64(b / Terabyte)\n}", "title": "" }, { "docid": "20914388a8f751063e903cae6dfc5637", "score": "0.5366534", "text": "func (s Size4K) InBytes() uint32 {\n\treturn uint32(s) * 4096\n}", "title": "" }, { "docid": "c0282ab182f2a584db398a3421c1faea", "score": "0.5364486", "text": "func (m *MemoryCache) Size() uint64 {\n\treturn 0\n}", "title": "" }, { "docid": "f1e2b588c5fff383e3b459f164016a4d", "score": "0.534957", "text": "func (p *MembershipProof) Size() (bytes int) {\n\tbytes = 8 + 8 + len(p.Root) + len(p.Event)\n\tbytes = bytes + len(p.Nodes)*(16+util.HashOutputLen)\n\treturn\n}", "title": "" }, { "docid": "b836fcdc2f73bb3f538e78828b9c3575", "score": "0.5347526", "text": "func (a *archive) Size() string {\n\treturn fmt.Sprintf(\"%.1fMB\", float64(len(a.data))/(1<<20))\n}", "title": "" }, { "docid": "8953aeff1e62a73f7bb4cf6783c09555", "score": "0.5341674", "text": "func (fields FieldsSlice) ByteLength() int {\n\tlength := 0\n\tfor _, field := range fields {\n\t\tlength += field.FieldTypeInfo.Size * field.Elements\n\t}\n\treturn length\n}", "title": "" }, { "docid": "17875fb61c365fc5a5e02bd705d0f29f", "score": "0.5340232", "text": "func referencedBytesStat(pids []int, cycles uint64, resetInterval uint64) (uint64, error) {\n\treferencedKBytes, err := getReferencedKBytes(pids)\n\tif err != nil {\n\t\treturn uint64(0), err\n\t}\n\n\terr = clearReferencedBytes(pids, cycles, resetInterval)\n\tif err != nil {\n\t\treturn uint64(0), err\n\t}\n\treturn referencedKBytes * 1024, nil\n}", "title": "" }, { "docid": "b3e5592e6f5720e58e46b22ac8173baf", "score": "0.53287685", "text": "func Size_Pebibyte(amount *float64) Size {\n\t_init_.Initialize()\n\n\tvar returns Size\n\n\t_jsii_.StaticInvoke(\n\t\t\"monocdk.Size\",\n\t\t\"pebibyte\",\n\t\t[]interface{}{amount},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "79763cd1af62c46ad0a69f0f50916fbd", "score": "0.5313208", "text": "func (o LookupImageResultOutput) SizeBytes() pulumi.IntOutput {\n\treturn o.ApplyT(func(v LookupImageResult) int { return v.SizeBytes }).(pulumi.IntOutput)\n}", "title": "" }, { "docid": "9238a6706b0e87a711d4e9a847d06475", "score": "0.5313068", "text": "func (i *IndexUint8) Bytes() []byte {\n\treturn []byte{byte(*i)}\n}", "title": "" }, { "docid": "50f39c7c3e19b19e0e1e43a1e74bafa5", "score": "0.5312284", "text": "func (o LookupTableResultOutput) NumBytes() pulumi.StringOutput {\n\treturn o.ApplyT(func(v LookupTableResult) string { return v.NumBytes }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "4603ba17268ae0e6b6c8642c7335dec8", "score": "0.53113997", "text": "func (s *baseSchemaProducer) MemoryUsage() (sum int64) {\n\tif s == nil {\n\t\treturn\n\t}\n\n\tsum = size.SizeOfPointer + size.SizeOfSlice + int64(cap(s.names))*size.SizeOfPointer + s.Plan.MemoryUsage()\n\tif s.schema != nil {\n\t\tsum += s.schema.MemoryUsage()\n\t}\n\tfor _, name := range s.names {\n\t\tsum += name.MemoryUsage()\n\t}\n\treturn\n}", "title": "" }, { "docid": "a52783ea37135d2f737eb648a030baa7", "score": "0.5308496", "text": "func (pd *programData) Bytes(offset, length uint64) ([]byte, error) {\n\treturn pd.managedBytes(offset, length)\n}", "title": "" }, { "docid": "c5bf8c7400a28f3040b25848485433b5", "score": "0.529838", "text": "func (fm *FinalModelArrayOptionalBytes) Size() int { return fm.size }", "title": "" }, { "docid": "4ca42222d9fc221e18609133a55050b2", "score": "0.52979875", "text": "func Bytes(length int64, opts Options) (Descriptor, error) {\n\t// offset is 0 because we're not indexing into a file\n\t// fd is -1 and MAP_ANON because we're asking for an anonymous region of memory not tied to a file\n\t// MAP_PRIVATE because we don't plan on sharing this region of memory with other processes\n\treturn mmap(-1, 0, length, syscall.MAP_ANON|syscall.MAP_PRIVATE, opts)\n}", "title": "" }, { "docid": "e666ccba17b948e51453e95f15b3c58a", "score": "0.5296266", "text": "func (a *ArrayF32) Bytes() int {\n\n\treturn len(*a) * int(unsafe.Sizeof(float32(0)))\n}", "title": "" }, { "docid": "b4cd3d57e86cdbf16f672651df7d10ed", "score": "0.52920514", "text": "func (o ReportSummaryAssetAggregateStatsResponseOutput) TotalMemoryBytes() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ReportSummaryAssetAggregateStatsResponse) string { return v.TotalMemoryBytes }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "86381b9f5e32057a7df221429df8abb3", "score": "0.5287177", "text": "func (b BinaryPrefix) PBytes() float64 {\n\treturn float64(b) / PB\n}", "title": "" }, { "docid": "ced03ace6ea7b23be4e5ab5ad2f0dffc", "score": "0.5284387", "text": "func (field fieldFmtBase) LengthBytes() int {\n\tif field.IsFixedLength() {\n\t\treturn field.DataType().ByteSize()\n\t}\n\n\treturn field.DataType().LengthBytes()\n}", "title": "" }, { "docid": "96212c94e444276bfc271c7f7480906e", "score": "0.52778184", "text": "func (idx *Index) Size() int {\n\treturn len(idx.byHash)\n}", "title": "" }, { "docid": "dd8667d2540dd3f7146ed32160bd919f", "score": "0.5274417", "text": "func (m *HashMap) Size() float64 {\n\treturn float64(m.txsSize) / (1024 * 1024)\n}", "title": "" }, { "docid": "4b3dc033259ba7d065f76dcd2c5bf917", "score": "0.5273886", "text": "func Getpagesize() int", "title": "" }, { "docid": "66bfa85d60bb6ab5757cb1cb932b9f5f", "score": "0.5262786", "text": "func Size_Tebibytes(amount *float64) Size {\n\t_init_.Initialize()\n\n\tvar returns Size\n\n\t_jsii_.StaticInvoke(\n\t\t\"monocdk.Size\",\n\t\t\"tebibytes\",\n\t\t[]interface{}{amount},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "5f0f296e2b2c4156bbdf2f53f1e4f02b", "score": "0.5260886", "text": "func (m *memtable) Size() int64 {\n\treturn int64(len(m.data))\n}", "title": "" }, { "docid": "89be8d0a8e06f7877014ac8babf44aa8", "score": "0.52403367", "text": "func (a *ArrayF32) Bytes() int {\n\treturn len(*a) * int(unsafe.Sizeof(float32(0)))\n}", "title": "" }, { "docid": "5a28c8e169dadf63308dbfefbe818964", "score": "0.52298677", "text": "func (nodes Network) GetMemorySize() (size int) {\n\tfor _, n := range nodes {\n\t\tif t, ok := n.(Trainable); ok {\n\t\t\tsize += t.GetMemorySize()\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "de75a4b474f62634e75457ec5c01a01d", "score": "0.52290106", "text": "func byteSize(bytes int64) string {\n\tif bytes < unit {\n\t\treturn fmt.Sprintf(\"%dB\", bytes)\n\t}\n\tb := float64(bytes)\n\texp := math.Floor(math.Log(b) / math.Log(unit))\n\treturn fmt.Sprintf(\"%.2g%ciB\",\n\t\tb/(math.Pow(unit, exp)),\n\t\t\"KMGTPE\"[int(exp)-1])\n}", "title": "" }, { "docid": "a1d9498028554e680dbe1c46d47cb070", "score": "0.52218205", "text": "func (idx *PackIndexV1) Size() int {\n\treturn len(idx.entries)\n}", "title": "" }, { "docid": "7b24c95d2aaf1583febc4cbc14c7cbdf", "score": "0.5215544", "text": "func (t *frequencyTable) byteCount() int64 {\n\tvar n int64\n\tfor i := 0; i < len(t); i++ {\n\t\tn += t[i]\n\t}\n\treturn n\n}", "title": "" }, { "docid": "680c6fbf92f87328bd7a782e7c1e8345", "score": "0.5205973", "text": "func (ns *Namespace) Memory() common.Stats {\n\treturn common.Stats{\n\t\t\"used-bytes-memory\": ns.calcStats.TryInt(\"used-bytes-memory\", 0),\n\t\t\"free-bytes-memory\": ns.calcStats.TryInt(\"free-bytes-memory\", 0),\n\t\t\"total-bytes-memory\": ns.calcStats.TryInt(\"total-bytes-memory\", 0),\n\t}\n}", "title": "" }, { "docid": "c9853c0bbad7f96c84ca25575a6bfc61", "score": "0.5204542", "text": "func (b BinaryPrefix) GBytes() float64 {\n\treturn float64(b) / GB\n}", "title": "" }, { "docid": "a100444d2053ebf228b3f3b37d3518f4", "score": "0.52027595", "text": "func (t *TestTx) Bytes() []byte { return t.BytesV }", "title": "" }, { "docid": "ce058852dd433d3f7b066f80d7678083", "score": "0.520196", "text": "func (bdb *BadgerDB) Size() int64 {\n\tlsm, vlog := bdb.db.Size()\n\treturn lsm + vlog\n}", "title": "" }, { "docid": "a2bd373df26f8a1f766d4817e857d8ba", "score": "0.5193037", "text": "func BytesPerVec() int {\n\treturn bytesPerVec\n}", "title": "" }, { "docid": "4499d1a5222339608d44dd5fdae71dc1", "score": "0.5185342", "text": "func (p *Page) Bytes() ([]byte, error) {\n\tconst op = \"txfile/page-bytes\"\n\n\tif err := p.canRead(op); err != nil {\n\t\treturn nil, err\n\t}\n\tif p.bytes == nil && p.flags.new {\n\t\tconst msg = \"can not read contents of fresh allocated page without contents\"\n\t\treturn nil, &Error{op: op, kind: InvalidOp, ctx: p.errCtx(), msg: msg}\n\t}\n\n\treturn p.getBytes(op)\n}", "title": "" }, { "docid": "6d03aec80bf342417ede74e6bd943d88", "score": "0.51789564", "text": "func (b BinaryPrefix) EBytes() float64 {\n\treturn float64(b) / EB\n}", "title": "" }, { "docid": "c6e96c4bb496e2e005ac1582b3f98024", "score": "0.51727057", "text": "func (offset *Offset) Bytes() []byte {\n\tvar out []byte\n\tout = append(out, Int64ToBytes(offset.TS)...)\n\tout = append(out, Int64ToBytes(offset.Index)...)\n\treturn out\n}", "title": "" }, { "docid": "d88bcc76b87e5f60360f006e8d45bd1e", "score": "0.51699144", "text": "func (mem *Ram) Size() int {\n\treturn 0x8000 // 32K\n}", "title": "" }, { "docid": "a8152f65a59310b48265e86483a0845c", "score": "0.51684636", "text": "func (mtr *Ppappa1intswphvmemMetrics) Size() int {\n\tsz := 0\n\n\tsz += mtr.EccUncorrectable.Size()\n\n\tsz += mtr.EccCorrectable.Size()\n\n\treturn sz\n}", "title": "" }, { "docid": "ae0a5b949f30438f73a34d6530b1cdb3", "score": "0.51660776", "text": "func (c *Cache) Capacity() uint64 { return uint64(c.capacity) }", "title": "" }, { "docid": "da5f36bc970d388423f29b9124de4832", "score": "0.5162903", "text": "func (w *Writer) BytesLen() int {\n\treturn int(w.offset)\n}", "title": "" }, { "docid": "9aed6b1f2bf396d9237d65d6f042f9ae", "score": "0.51590943", "text": "func (b *BackupEngineInfo) GetSize(index int) int64 {\n\treturn int64(C.rocksdb_backup_engine_info_size(b.c, C.int(index)))\n}", "title": "" }, { "docid": "307ef995821142ea37eb8b1d32bd4148", "score": "0.51589555", "text": "func (db *MemDB) Mem() uint64 {\n\treturn db.allocator.capacity + db.vlog.capacity\n}", "title": "" }, { "docid": "874fe8564cb9dcf5d9e5c63cdcd427a5", "score": "0.5156723", "text": "func (proof *QueryProof) Size() (bytes int) {\n\treturn proof.HistoryProof.Size() + proof.TreapProof.Size()\n}", "title": "" }, { "docid": "2e498c2d60f55242578647f59bbc9680", "score": "0.5156077", "text": "func Size_Gibibytes(amount *float64) Size {\n\t_init_.Initialize()\n\n\tvar returns Size\n\n\t_jsii_.StaticInvoke(\n\t\t\"monocdk.Size\",\n\t\t\"gibibytes\",\n\t\t[]interface{}{amount},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "2414fedb07a52f18133eb1ee0da86756", "score": "0.51509494", "text": "func (mtr *Ppappa0intswphvmemMetrics) Size() int {\n\tsz := 0\n\n\tsz += mtr.EccUncorrectable.Size()\n\n\tsz += mtr.EccCorrectable.Size()\n\n\treturn sz\n}", "title": "" }, { "docid": "a353d2764f3705e90aeb5a1ddd90208c", "score": "0.5149202", "text": "func (b *ByteSize) Get() any { return *b }", "title": "" }, { "docid": "b6bbc31d3533e9e1bef0670086b74f33", "score": "0.5138118", "text": "func (tx *Tx) PageSize() int {\n\treturn int(tx.file.allocator.pageSize)\n}", "title": "" }, { "docid": "77add4c41ee03e1ddfaed9513b08efce", "score": "0.5135014", "text": "func (pk *PacketBuffer) MemSize() int {\n\treturn int(pk.buf.Size()) + packetBufferStructSize\n}", "title": "" }, { "docid": "28597b56dcdaf1705d782457ce5a6330", "score": "0.51277524", "text": "func (o LookupTableResultOutput) NumPhysicalBytes() pulumi.StringOutput {\n\treturn o.ApplyT(func(v LookupTableResult) string { return v.NumPhysicalBytes }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "a2fd5cb392e6a7374e56b64745306302", "score": "0.5125049", "text": "func (ps *packageSize) RAM() uint64 {\n\treturn ps.Data + ps.BSS\n}", "title": "" } ]
61a7a39db5e81a653283db803a1cca2c
NewGetMarketsStructuresStructureIDBadRequest creates a GetMarketsStructuresStructureIDBadRequest with default headers values
[ { "docid": "6b49790e02946e65f54f8c7821a830d0", "score": "0.80273825", "text": "func NewGetMarketsStructuresStructureIDBadRequest() *GetMarketsStructuresStructureIDBadRequest {\n\treturn &GetMarketsStructuresStructureIDBadRequest{}\n}", "title": "" } ]
[ { "docid": "d993534866a13f31e557629c739b0b56", "score": "0.6280225", "text": "func NewGetMarketsStructuresStructureIDOK() *GetMarketsStructuresStructureIDOK {\n\treturn &GetMarketsStructuresStructureIDOK{\n\t\tXPages: 1,\n\t}\n}", "title": "" }, { "docid": "d1ae8919e21c7e1015ff62056ad7e73d", "score": "0.6148425", "text": "func NewGetSepainstantIDBadRequest() *GetSepainstantIDBadRequest {\n\treturn &GetSepainstantIDBadRequest{}\n}", "title": "" }, { "docid": "24b3f516e3e9ef558c14c469eb0ad9af", "score": "0.61451185", "text": "func NewGetMarketsStructuresStructureIDForbidden() *GetMarketsStructuresStructureIDForbidden {\n\treturn &GetMarketsStructuresStructureIDForbidden{}\n}", "title": "" }, { "docid": "447bc8365148a3ce3eb9eb03dd7533f7", "score": "0.61136997", "text": "func NewGetMarketsStructuresStructureIDUnauthorized() *GetMarketsStructuresStructureIDUnauthorized {\n\treturn &GetMarketsStructuresStructureIDUnauthorized{}\n}", "title": "" }, { "docid": "aff460b2f159e810d8d6fc5d8c95012b", "score": "0.6109613", "text": "func NewGetMarketsStructuresStructureIDServiceUnavailable() *GetMarketsStructuresStructureIDServiceUnavailable {\n\treturn &GetMarketsStructuresStructureIDServiceUnavailable{}\n}", "title": "" }, { "docid": "2cd1f2dc3fb9e09ef1df9cad6a9d64c1", "score": "0.56678355", "text": "func NewGetCorporationsCorporationIDStructuresBadRequest() *GetCorporationsCorporationIDStructuresBadRequest {\n\treturn &GetCorporationsCorporationIDStructuresBadRequest{}\n}", "title": "" }, { "docid": "5f54d0a6c1fc96eb7a6a007763f885b7", "score": "0.53405744", "text": "func NewGetMarketsStructuresStructureIDNotModified() *GetMarketsStructuresStructureIDNotModified {\n\treturn &GetMarketsStructuresStructureIDNotModified{}\n}", "title": "" }, { "docid": "3d626aeb32997f70be2a9a5317dd1e6f", "score": "0.5310988", "text": "func NewMarketSummaryBadRequest(body *MarketSummaryBadRequestResponseBody) *goa.ServiceError {\n\tv := &goa.ServiceError{\n\t\tName: *body.Name,\n\t\tID: *body.ID,\n\t\tMessage: *body.Message,\n\t\tTemporary: *body.Temporary,\n\t\tTimeout: *body.Timeout,\n\t\tFault: *body.Fault,\n\t}\n\n\treturn v\n}", "title": "" }, { "docid": "7c776cbf227fd9d8d9529974eba5e07d", "score": "0.525139", "text": "func NewGetUniverseStructuresStructureIDNotFound() *GetUniverseStructuresStructureIDNotFound {\n\treturn &GetUniverseStructuresStructureIDNotFound{}\n}", "title": "" }, { "docid": "5eb92e80065bd8eb6506c356fbe07320", "score": "0.51161295", "text": "func NewGetBlockBadRequest() *GetBlockBadRequest {\n\treturn &GetBlockBadRequest{}\n}", "title": "" }, { "docid": "a00ebf59b1cb5688eaa362400c457b48", "score": "0.5077876", "text": "func (ctx *ShowWalletsContext) BadRequest(r *StandardError) error {\n\tif ctx.ResponseData.Header().Get(\"Content-Type\") == \"\" {\n\t\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/standard_error+json\")\n\t}\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 400, r)\n}", "title": "" }, { "docid": "8025d91e2858ee403db1bc03fbe3793a", "score": "0.50650686", "text": "func NewGetUniverseStructuresStructureIDForbidden() *GetUniverseStructuresStructureIDForbidden {\n\treturn &GetUniverseStructuresStructureIDForbidden{}\n}", "title": "" }, { "docid": "befa9945a901877c469a95833a11450e", "score": "0.5052959", "text": "func NewGetMarketsStructuresStructureIDEnhanceYourCalm() *GetMarketsStructuresStructureIDEnhanceYourCalm {\n\treturn &GetMarketsStructuresStructureIDEnhanceYourCalm{}\n}", "title": "" }, { "docid": "da50fa720f24862aca607dca06ade290", "score": "0.5048259", "text": "func NewBadRequest(cause error) BadRequest { return BadRequest(cause.Error()) }", "title": "" }, { "docid": "8a42c5b2aafd5cbe03fbe570641b8ec9", "score": "0.5043844", "text": "func NewAllLooksBadRequest() *AllLooksBadRequest {\n return &AllLooksBadRequest{\n }\n}", "title": "" }, { "docid": "a250447ddb169135986e8b4e5979ee2e", "score": "0.50135785", "text": "func NewSymbolInfoBadRequest(body *SymbolInfoBadRequestResponseBody) *goa.ServiceError {\n\tv := &goa.ServiceError{\n\t\tName: *body.Name,\n\t\tID: *body.ID,\n\t\tMessage: *body.Message,\n\t\tTemporary: *body.Temporary,\n\t\tTimeout: *body.Timeout,\n\t\tFault: *body.Fault,\n\t}\n\n\treturn v\n}", "title": "" }, { "docid": "c16d6b464a00145661bf14ee7540e4ab", "score": "0.5011264", "text": "func NewGetUniverseStructuresStructureIDOK() *GetUniverseStructuresStructureIDOK {\n\treturn &GetUniverseStructuresStructureIDOK{}\n}", "title": "" }, { "docid": "2c3e7f4503c40e3cb8cd5493a6ff699b", "score": "0.4996657", "text": "func NewGetDevicesSolarbeamsIDBadRequest() *GetDevicesSolarbeamsIDBadRequest {\n\treturn &GetDevicesSolarbeamsIDBadRequest{}\n}", "title": "" }, { "docid": "70c49174b0a77caa49a9fb5c50383bca", "score": "0.49530625", "text": "func (ctx *VerifyWalletsContext) BadRequest(r *StandardError) error {\n\tif ctx.ResponseData.Header().Get(\"Content-Type\") == \"\" {\n\t\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/standard_error+json\")\n\t}\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 400, r)\n}", "title": "" }, { "docid": "35bd165b78a5ba3d14e80559a73078b3", "score": "0.4915686", "text": "func NewGetLhvBadRequest() *GetLhvBadRequest {\n\treturn &GetLhvBadRequest{}\n}", "title": "" }, { "docid": "f3dbbc77952572dc9df6e14c1e070b58", "score": "0.49116585", "text": "func NewGetVdsesBadRequest() *GetVdsesBadRequest {\n\treturn &GetVdsesBadRequest{}\n}", "title": "" }, { "docid": "bd4bdf32b2b5a11dc67dd8d5e23ef50d", "score": "0.48780337", "text": "func BadRequest() *SystemError {\n\treturn CustomBadRequest(\"Bad Request\")\n}", "title": "" }, { "docid": "09306c0b54bf5f2f47e712a21d3f9a8d", "score": "0.4858593", "text": "func (ctx *ListTransactionsContext) BadRequest(r *StandardError) error {\n\tif ctx.ResponseData.Header().Get(\"Content-Type\") == \"\" {\n\t\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/standard_error+json\")\n\t}\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 400, r)\n}", "title": "" }, { "docid": "5b67631c8c73fbac399d31bd03b121c9", "score": "0.48563522", "text": "func (ctx *ShowPublicContext) BadRequest(r *StandardError) error {\n\tif ctx.ResponseData.Header().Get(\"Content-Type\") == \"\" {\n\t\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/standard_error+json\")\n\t}\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 400, r)\n}", "title": "" }, { "docid": "b01c0883a2d99a0241c1d91fa7c9150f", "score": "0.48396662", "text": "func NewGetVSphereNodeTypesBadRequest() *GetVSphereNodeTypesBadRequest {\n\n\treturn &GetVSphereNodeTypesBadRequest{}\n}", "title": "" }, { "docid": "7fcac2e4c5502c96c820e2ecf90f6932", "score": "0.48234388", "text": "func NewGetVSphereNodeTypesBadRequest() *GetVSphereNodeTypesBadRequest {\n\treturn &GetVSphereNodeTypesBadRequest{}\n}", "title": "" }, { "docid": "57f345a9912ff638cd3e8baaec5e0122", "score": "0.48037896", "text": "func NewGetVSphereNetworksBadRequest() *GetVSphereNetworksBadRequest {\n\n\treturn &GetVSphereNetworksBadRequest{}\n}", "title": "" }, { "docid": "90c280a8a0cbac38ef5b03d6c4783f01", "score": "0.4797967", "text": "func NewGetProviderTypeByIDBadRequest() *GetProviderTypeByIDBadRequest {\n\treturn &GetProviderTypeByIDBadRequest{}\n}", "title": "" }, { "docid": "237f1dd071b71cc401496421699a9d60", "score": "0.47957018", "text": "func NewGetSoftwareDetailsBadRequest() *GetSoftwareDetailsBadRequest {\n\treturn &GetSoftwareDetailsBadRequest{}\n}", "title": "" }, { "docid": "d48ca9e01c2f65c5f24cd47eea6745d7", "score": "0.4793418", "text": "func (ctx *UpdateWalletsContext) BadRequest(r *StandardError) error {\n\tif ctx.ResponseData.Header().Get(\"Content-Type\") == \"\" {\n\t\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/standard_error+json\")\n\t}\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 400, r)\n}", "title": "" }, { "docid": "e93c0047addd0e6d7fe68fde0a736e41", "score": "0.4788799", "text": "func NewFuturesMarketSummaryBadRequest(body *FuturesMarketSummaryBadRequestResponseBody) *goa.ServiceError {\n\tv := &goa.ServiceError{\n\t\tName: *body.Name,\n\t\tID: *body.ID,\n\t\tMessage: *body.Message,\n\t\tTemporary: *body.Temporary,\n\t\tTimeout: *body.Timeout,\n\t\tFault: *body.Fault,\n\t}\n\n\treturn v\n}", "title": "" }, { "docid": "e2629d2e37939cc7722836aa39df3f9f", "score": "0.47726727", "text": "func NewGetMarketsStructuresStructureIDGatewayTimeout() *GetMarketsStructuresStructureIDGatewayTimeout {\n\treturn &GetMarketsStructuresStructureIDGatewayTimeout{}\n}", "title": "" }, { "docid": "bf72a020f5ee154d833d58f029bfbd82", "score": "0.47506645", "text": "func (ctx *ShowHealthcheckContext) BadRequest(r *StandardError) error {\n\tif ctx.ResponseData.Header().Get(\"Content-Type\") == \"\" {\n\t\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/standard_error+json\")\n\t}\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 400, r)\n}", "title": "" }, { "docid": "23a8cf2b655f4c2aa67aa778c7c9f53a", "score": "0.47477388", "text": "func (ctx *DisplayPublicContext) BadRequest(r *StandardError) error {\n\tif ctx.ResponseData.Header().Get(\"Content-Type\") == \"\" {\n\t\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/standard_error+json\")\n\t}\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 400, r)\n}", "title": "" }, { "docid": "e3c8c887e12b89e6f3db51bf52e0ed9a", "score": "0.4734647", "text": "func NewGetTagBadRequest() *GetTagBadRequest {\n\treturn &GetTagBadRequest{}\n}", "title": "" }, { "docid": "47e846d35d3313c0deb26f1a0e7138cc", "score": "0.4727588", "text": "func (ctx *CreateWorkflowContext) BadRequest(r error) error {\n\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/vnd.goa.error\")\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 400, r)\n}", "title": "" }, { "docid": "1e856d602520ec4613482b6539487a7c", "score": "0.47021374", "text": "func NewGetGroupListPublicV1BadRequest() *GetGroupListPublicV1BadRequest {\n\treturn &GetGroupListPublicV1BadRequest{}\n}", "title": "" }, { "docid": "4bc1bd9ff988705710a2343d5e005fb4", "score": "0.4695869", "text": "func NewFindStudentsByStatusBadRequest() *FindStudentsByStatusBadRequest {\n\n\treturn &FindStudentsByStatusBadRequest{}\n}", "title": "" }, { "docid": "6332c2b937f30dc0c9738477304bba02", "score": "0.4694517", "text": "func NewGetFleetsFleetIDWingsBadRequest() *GetFleetsFleetIDWingsBadRequest {\n\treturn &GetFleetsFleetIDWingsBadRequest{}\n}", "title": "" }, { "docid": "05168addab000c0d4409ee35f6766512", "score": "0.46932083", "text": "func (ctx *ShowTasksContext) BadRequest(r *StandardError) error {\n\tif ctx.ResponseData.Header().Get(\"Content-Type\") == \"\" {\n\t\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/standard_error+json\")\n\t}\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 400, r)\n}", "title": "" }, { "docid": "2009c131b51769bf43f4abad84a197c0", "score": "0.46900427", "text": "func NewGetGocardlessIDBadRequest() *GetGocardlessIDBadRequest {\n\treturn &GetGocardlessIDBadRequest{}\n}", "title": "" }, { "docid": "bf714370cb56818450a51d8d58f67f0d", "score": "0.46662495", "text": "func NewPutSystemNameBadRequest() *PutSystemNameBadRequest {\n\treturn &PutSystemNameBadRequest{}\n}", "title": "" }, { "docid": "ddc5fe61f9b9e36c60464d89aba0b379", "score": "0.46607634", "text": "func NewGetDevicesIDSystemBadRequest() *GetDevicesIDSystemBadRequest {\n\treturn &GetDevicesIDSystemBadRequest{}\n}", "title": "" }, { "docid": "f5f7eb3339098ce7b1db369231db8818", "score": "0.4656598", "text": "func buildHeaderRequest(ctx context.Context, protocol uint32, blocks *storage.BlockRepository,\r\n\trequests *state.State, delta, max int) (*wire.MsgGetHeaders, error) {\r\n\r\n\tgetheaders := wire.NewMsgGetHeaders()\r\n\tgetheaders.ProtocolVersion = protocol\r\n\r\n\tif requests != nil {\r\n\t\thash := requests.BlockRequestHash(delta)\r\n\t\tif hash != nil {\r\n\t\t\tgetheaders.AddBlockLocatorHash(hash)\r\n\t\t}\r\n\t}\r\n\r\n\t// Add block hashes in reverse order\r\n\tfor ; delta <= blocks.LastHeight(); delta *= 2 {\r\n\t\thash, err := blocks.Hash(ctx, blocks.LastHeight()-delta)\r\n\t\tif err != nil {\r\n\t\t\treturn getheaders, err\r\n\t\t}\r\n\t\tgetheaders.AddBlockLocatorHash(hash)\r\n\t\tif len(getheaders.BlockLocatorHashes) > max {\r\n\t\t\tbreak\r\n\t\t}\r\n\t\tif blocks.LastHeight() <= delta {\r\n\t\t\tbreak\r\n\t\t}\r\n\t}\r\n\r\n\treturn getheaders, nil\r\n}", "title": "" }, { "docid": "206b39dabebe56cd0db258f13e876097", "score": "0.46519956", "text": "func (ctx *CreateTasksContext) BadRequest(r *StandardError) error {\n\tif ctx.ResponseData.Header().Get(\"Content-Type\") == \"\" {\n\t\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/standard_error+json\")\n\t}\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 400, r)\n}", "title": "" }, { "docid": "105c4c3007708448584ddb4ba3446131", "score": "0.4645261", "text": "func StatusBadRequest(err error) *models.HTTPStatusMeta {\n\treturn &models.HTTPStatusMeta{\n\t\tCode: errors.ParamFormatErr,\n\t\tMessage: fmt.Sprintf(\"Wrong format of parameters, err: %v\", err),\n\t}\n}", "title": "" }, { "docid": "6fd0d09843e1e1a96321020c957a41ec", "score": "0.46386212", "text": "func NewSetUserRolesBadRequest() *SetUserRolesBadRequest {\n return &SetUserRolesBadRequest{\n }\n}", "title": "" }, { "docid": "f174685c40b7f90d853b94649cb68a6c", "score": "0.463309", "text": "func NewGetTransactionInfoByHashBadRequest() *GetTransactionInfoByHashBadRequest {\n\treturn &GetTransactionInfoByHashBadRequest{}\n}", "title": "" }, { "docid": "b3743c7fe280b99c0458bdb6ff790c7b", "score": "0.4626292", "text": "func NewGetDescriptorBadRequest() *GetDescriptorBadRequest {\n\treturn &GetDescriptorBadRequest{}\n}", "title": "" }, { "docid": "302be2658b67e728f504d2ee27dcab05", "score": "0.46248895", "text": "func BadRequest(w http.ResponseWriter, err error) {\n\tvar message []byte\n\tmessage, err = StructToBytes(err.Error)\n\tif err != nil {\n\t\tmessage = []byte(\"Unknown error occurred\")\n\t}\n\tresponse(w, http.StatusBadRequest, message)\n}", "title": "" }, { "docid": "3167fb5c410bb824ea17e68b15a86f6d", "score": "0.46201837", "text": "func NewGetExternalSystemCallsBadRequest() *GetExternalSystemCallsBadRequest {\n\treturn &GetExternalSystemCallsBadRequest{}\n}", "title": "" }, { "docid": "bfb012478df6c3d634d6d3f49d63c07a", "score": "0.4618343", "text": "func (o *GetMarketsStructuresStructureIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 200:\n\t\tresult := NewGetMarketsStructuresStructureIDOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tcase 304:\n\t\tresult := NewGetMarketsStructuresStructureIDNotModified()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tcase 400:\n\t\tresult := NewGetMarketsStructuresStructureIDBadRequest()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tcase 401:\n\t\tresult := NewGetMarketsStructuresStructureIDUnauthorized()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tcase 403:\n\t\tresult := NewGetMarketsStructuresStructureIDForbidden()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tcase 420:\n\t\tresult := NewGetMarketsStructuresStructureIDEnhanceYourCalm()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tcase 500:\n\t\tresult := NewGetMarketsStructuresStructureIDInternalServerError()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tcase 503:\n\t\tresult := NewGetMarketsStructuresStructureIDServiceUnavailable()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tcase 504:\n\t\tresult := NewGetMarketsStructuresStructureIDGatewayTimeout()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "163879c0a7d034f27b11cd611a92cca2", "score": "0.46093145", "text": "func (ctx *ShowRepositoriesContext) BadRequest(r error) error {\n\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/vnd.goa.error\")\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 400, r)\n}", "title": "" }, { "docid": "1fe6b97f598b385314969f7485845e07", "score": "0.46064237", "text": "func (ctx *GetVideoBookmarksBookmarkContext) BadRequest(r error) error {\n\tif ctx.ResponseData.Header().Get(\"Content-Type\") == \"\" {\n\t\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/vnd.goa.error\")\n\t}\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 400, r)\n}", "title": "" }, { "docid": "0c8cd685c64ee62c85169c2b66f159b7", "score": "0.46056002", "text": "func (ctx *ShowCommitsContext) BadRequest(r error) error {\n\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/vnd.goa.error\")\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 400, r)\n}", "title": "" }, { "docid": "4d775d6f664599e96bdab9c05ac29197", "score": "0.4600038", "text": "func (ctx *ClaimTransactionsContext) BadRequest(r *StandardError) error {\n\tif ctx.ResponseData.Header().Get(\"Content-Type\") == \"\" {\n\t\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/standard_error+json\")\n\t}\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 400, r)\n}", "title": "" }, { "docid": "eaf9fd486e0cfa3b0b583f105b7ad279", "score": "0.4595727", "text": "func NewGetClustersBadRequest() *GetClustersBadRequest {\n\treturn &GetClustersBadRequest{}\n}", "title": "" }, { "docid": "ade1975aed8f370585ceb0822c0059b4", "score": "0.458822", "text": "func (ctx *ListCommitsContext) BadRequest(r error) error {\n\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/vnd.goa.error\")\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 400, r)\n}", "title": "" }, { "docid": "584441025c2a209d29a07bc115392ac7", "score": "0.457628", "text": "func (ctx *GetOpmlContext) BadRequest(r error) error {\n\tif ctx.ResponseData.Header().Get(\"Content-Type\") == \"\" {\n\t\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/vnd.goa.error\")\n\t}\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 400, r)\n}", "title": "" }, { "docid": "f1447214ace241c3b13b82b26503a7f3", "score": "0.45723358", "text": "func NewGetLogsByIDBadRequest() *GetLogsByIDBadRequest {\n\treturn &GetLogsByIDBadRequest{}\n}", "title": "" }, { "docid": "b2eb9669c31e699a05717693fb3ef0e1", "score": "0.45716605", "text": "func NewGetInterruptionByIDBadRequest() *GetInterruptionByIDBadRequest {\n\treturn &GetInterruptionByIDBadRequest{}\n}", "title": "" }, { "docid": "7a575a6fd4e1fe1274bbb9cc448a4cb3", "score": "0.4568274", "text": "func NewGetSlotsForFacilitiesBadRequest() *GetSlotsForFacilitiesBadRequest {\n\n\treturn &GetSlotsForFacilitiesBadRequest{}\n}", "title": "" }, { "docid": "ae9ecd38aad5b965aebd667fd91b0ca8", "score": "0.45673364", "text": "func NewGenerateTKGConfigForVsphereBadRequest() *GenerateTKGConfigForVsphereBadRequest {\n\n\treturn &GenerateTKGConfigForVsphereBadRequest{}\n}", "title": "" }, { "docid": "df71408dfeda6f2505b58420cb173f8c", "score": "0.45663008", "text": "func (ctx *CreateQuizzesContext) BadRequest(r *StandardError) error {\n\tif ctx.ResponseData.Header().Get(\"Content-Type\") == \"\" {\n\t\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/standard_error+json\")\n\t}\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 400, r)\n}", "title": "" }, { "docid": "6f53777441663d7bcada670fdf88915a", "score": "0.45652944", "text": "func (ctx *UpdateCommunitiesStackoverflowharvestContext) BadRequest(r *StandardError) error {\n\tif ctx.ResponseData.Header().Get(\"Content-Type\") == \"\" {\n\t\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/standard_error+json\")\n\t}\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 400, r)\n}", "title": "" }, { "docid": "091de5a3b89ce701fd2dc6041105792f", "score": "0.45652878", "text": "func NewUpdateSectorsBadRequest() *UpdateSectorsBadRequest {\n\treturn &UpdateSectorsBadRequest{}\n}", "title": "" }, { "docid": "6568524b0d9c59ebb6425d68dd82714a", "score": "0.45637253", "text": "func (ctx *SetTargetingContext) BadRequest(r *StandardError) error {\n\tif ctx.ResponseData.Header().Get(\"Content-Type\") == \"\" {\n\t\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/standard_error+json\")\n\t}\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 400, r)\n}", "title": "" }, { "docid": "8332eb8136938ff219af5c83415c91d5", "score": "0.45606664", "text": "func (ctx *VerifyStackoverflowContext) BadRequest(r *StandardError) error {\n\tif ctx.ResponseData.Header().Get(\"Content-Type\") == \"\" {\n\t\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/standard_error+json\")\n\t}\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 400, r)\n}", "title": "" }, { "docid": "c23c79a2b6dd5042b30d26038554ae9c", "score": "0.45580757", "text": "func (ctx *PostBlockchainTransferBlockchainContext) BadRequest(r error) error {\n\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/vnd.goa.error\")\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 400, r)\n}", "title": "" }, { "docid": "5351fe0e7caa6f345e13cd5ea6cdef8a", "score": "0.4556721", "text": "func NewGetBookByIDBadRequest() *GetBookByIDBadRequest {\n\n\treturn &GetBookByIDBadRequest{}\n}", "title": "" }, { "docid": "5baa9cc33bd89240bc883c1a8bc5943f", "score": "0.45514014", "text": "func NewGlobalGetBundleVersionExtensionsBadRequest() *GlobalGetBundleVersionExtensionsBadRequest {\n\treturn &GlobalGetBundleVersionExtensionsBadRequest{}\n}", "title": "" }, { "docid": "344de9705a1e1436bb4255982002336b", "score": "0.45507044", "text": "func NewDescribeBillDetailsRequestWithoutParam() *DescribeBillDetailsRequest {\n\n return &DescribeBillDetailsRequest{\n JDCloudRequest: core.JDCloudRequest{\n URL: \"/regions/{regionId}/describeBillDetails\",\n Method: \"POST\",\n Header: nil,\n Version: \"v1\",\n },\n }\n}", "title": "" }, { "docid": "002182b24f6afdb51cf1f4a5bd11da60", "score": "0.45478714", "text": "func BadRequest(format string, a ...interface{}) *proto.Status {\n\treturn &proto.Status{\n\t\tCode: int32(400),\n\t\tMessage: fmt.Sprintf(format, a...),\n\t}\n}", "title": "" }, { "docid": "130150b808193e332bc120ee623aed71", "score": "0.45248368", "text": "func (ctx *PubPshbContext) BadRequest(r error) error {\n\tif ctx.ResponseData.Header().Get(\"Content-Type\") == \"\" {\n\t\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/vnd.goa.error\")\n\t}\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 400, r)\n}", "title": "" }, { "docid": "406e838ef7e4e2d92e04fe4e01cf6c37", "score": "0.45223376", "text": "func NewGetOrganizationalUnitProductStocksBadRequest() *GetOrganizationalUnitProductStocksBadRequest {\n\treturn &GetOrganizationalUnitProductStocksBadRequest{}\n}", "title": "" }, { "docid": "fe24f74ff0a42488955d3054fccfd769", "score": "0.45093524", "text": "func BadRequest(message string) error {\n\treturn &CustomError{400, message, false}\n}", "title": "" }, { "docid": "7508f275f3c6077bb18f96667ee0b24f", "score": "0.4506533", "text": "func NewGetPublicTestsBadRequest() *GetPublicTestsBadRequest {\n\n\treturn &GetPublicTestsBadRequest{}\n}", "title": "" }, { "docid": "7d68d7480d1dcc87e3918b0bb0e10b74", "score": "0.45057786", "text": "func NewCreateForbiddenInfoCommonRequestWithoutParam() *CreateForbiddenInfoCommonRequest {\n\n return &CreateForbiddenInfoCommonRequest{\n JDCloudRequest: core.JDCloudRequest{\n URL: \"/forbiddenInfoCommon:create\",\n Method: \"POST\",\n Header: nil,\n Version: \"v1\",\n },\n }\n}", "title": "" }, { "docid": "c7df6012c521c2cbadb0c3853090397c", "score": "0.45041475", "text": "func (ctx *ShowStackoverflowContext) BadRequest(r *StandardError) error {\n\tif ctx.ResponseData.Header().Get(\"Content-Type\") == \"\" {\n\t\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/standard_error+json\")\n\t}\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 400, r)\n}", "title": "" }, { "docid": "a62b7f75fee64ac83e7cf8b27e81a506", "score": "0.4495935", "text": "func (ctx *ListTasksContext) BadRequest(r *StandardError) error {\n\tif ctx.ResponseData.Header().Get(\"Content-Type\") == \"\" {\n\t\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/standard_error+json\")\n\t}\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 400, r)\n}", "title": "" }, { "docid": "5744aad26ebf28df8ee079be8abefbfd", "score": "0.44939923", "text": "func NewGetFullAddressInfoByKlsIDUsingGETBadRequest() *GetFullAddressInfoByKlsIDUsingGETBadRequest {\n\treturn &GetFullAddressInfoByKlsIDUsingGETBadRequest{}\n}", "title": "" }, { "docid": "6a5762c6e232d92b75f7cff7a012c022", "score": "0.4491827", "text": "func (v GetMarketsStructuresStructureId200Ok) MarshalJSON() ([]byte, error) {\n\tw := jwriter.Writer{}\n\teasyjsonF64baf53EncodeGithubComAntihaxGoesiEsi1(&w, v)\n\treturn w.Buffer.BuildBytes(), w.Error\n}", "title": "" }, { "docid": "7eb9e5c6575a93898b3aa84210f0c995", "score": "0.44896832", "text": "func (ctx *DisplayTargetingContext) BadRequest(r *StandardError) error {\n\tif ctx.ResponseData.Header().Get(\"Content-Type\") == \"\" {\n\t\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/standard_error+json\")\n\t}\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 400, r)\n}", "title": "" }, { "docid": "d0e649ddbf2fccef4ed7c629c8906a19", "score": "0.44883075", "text": "func (ctx *SendPaycheckContext) BadRequest(r *StandardError) error {\n\tif ctx.ResponseData.Header().Get(\"Content-Type\") == \"\" {\n\t\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/standard_error+json\")\n\t}\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 400, r)\n}", "title": "" }, { "docid": "bc6c30ef6579cfaad0054381a984a1b0", "score": "0.44831783", "text": "func (ctx *UpdateWorkflowContext) BadRequest(r error) error {\n\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/vnd.goa.error\")\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 400, r)\n}", "title": "" }, { "docid": "65e9c859e7fd2bc9653e6daf139606b3", "score": "0.44806612", "text": "func NewStakeholderFindListBadRequest() *StakeholderFindListBadRequest {\n\treturn &StakeholderFindListBadRequest{}\n}", "title": "" }, { "docid": "4fdd3c999621b4ecf94b0238f8792c16", "score": "0.4479707", "text": "func NewPublicGetBulkPlayerCurrentPlatformBadRequest() *PublicGetBulkPlayerCurrentPlatformBadRequest {\n\treturn &PublicGetBulkPlayerCurrentPlatformBadRequest{}\n}", "title": "" }, { "docid": "c95f20e5a65592498dcd9385ab263bd6", "score": "0.44793168", "text": "func NewDescribeServerGroupBadRequest() *DescribeServerGroupBadRequest {\n\treturn &DescribeServerGroupBadRequest{}\n}", "title": "" }, { "docid": "c95f20e5a65592498dcd9385ab263bd6", "score": "0.44793168", "text": "func NewDescribeServerGroupBadRequest() *DescribeServerGroupBadRequest {\n\treturn &DescribeServerGroupBadRequest{}\n}", "title": "" }, { "docid": "65682d6d7e0615e323e8718d18cca737", "score": "0.44787535", "text": "func errBadRequest(format string, v ...interface{}) error {\n\treturn &serviceError{\n\t\tcode: http.StatusBadRequest,\n\t\tMessage: fmt.Sprintf(format, v...),\n\t}\n}", "title": "" }, { "docid": "8d1b06d647727909b1f22165e8a1040d", "score": "0.44769466", "text": "func NewDeleteStarsIDBadRequest() *DeleteStarsIDBadRequest {\n\treturn &DeleteStarsIDBadRequest{}\n}", "title": "" }, { "docid": "56722880ff2d1e47acbfd7ad736d6647", "score": "0.4475521", "text": "func (eiec *ErrInvalidEndpointConfig) BadRequest() {}", "title": "" }, { "docid": "748070e746c98479f54438a64381ed22", "score": "0.44749588", "text": "func (ctx *DisplayStackoverflowContext) BadRequest(r *StandardError) error {\n\tif ctx.ResponseData.Header().Get(\"Content-Type\") == \"\" {\n\t\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/standard_error+json\")\n\t}\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 400, r)\n}", "title": "" }, { "docid": "f442001aaaf8673318199d8416fcdb98", "score": "0.44740254", "text": "func NewBadRequest(err error, msg string) error {\n\treturn &badRequest{wrap(err, msg, \"\")}\n}", "title": "" }, { "docid": "7db5851d720be2a01465b50036dc2274", "score": "0.4469969", "text": "func (ctx *AddVideoBookmarkContext) BadRequest(r error) error {\n\tif ctx.ResponseData.Header().Get(\"Content-Type\") == \"\" {\n\t\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/vnd.goa.error\")\n\t}\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 400, r)\n}", "title": "" }, { "docid": "7a44b0eebaa8a4e88afdafc3a8d6b61b", "score": "0.44631767", "text": "func (ctx *ListTargetingContext) BadRequest(r *StandardError) error {\n\tif ctx.ResponseData.Header().Get(\"Content-Type\") == \"\" {\n\t\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/standard_error+json\")\n\t}\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 400, r)\n}", "title": "" }, { "docid": "3be1a940b7ad9bd169006a3bbec69aa0", "score": "0.44610858", "text": "func (ctx *RegisterAmazonContext) BadRequest(r error) error {\n\tif ctx.ResponseData.Header().Get(\"Content-Type\") == \"\" {\n\t\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/vnd.goa.error\")\n\t}\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 400, r)\n}", "title": "" }, { "docid": "c4f9b8c88f48907f18a3992c14af4435", "score": "0.44605199", "text": "func (ctx *ShowQuizzesContext) BadRequest(r *StandardError) error {\n\tif ctx.ResponseData.Header().Get(\"Content-Type\") == \"\" {\n\t\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/standard_error+json\")\n\t}\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 400, r)\n}", "title": "" }, { "docid": "29aabd363d1522a62a584f58ce202a88", "score": "0.44595063", "text": "func (ctx *CreateResultsContext) BadRequest(r *StandardError) error {\n\tif ctx.ResponseData.Header().Get(\"Content-Type\") == \"\" {\n\t\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/standard_error+json\")\n\t}\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 400, r)\n}", "title": "" }, { "docid": "8ca3ad787c8ee4c4b9e4ee6b9351eb5d", "score": "0.44579685", "text": "func NewGetVSphereOSImagesBadRequest() *GetVSphereOSImagesBadRequest {\n\treturn &GetVSphereOSImagesBadRequest{}\n}", "title": "" } ]
bfbe4aef8ffacc545ff7774ff6b5d97f
Called to test the application.
[ { "docid": "3a203afad586cbfbd5e11262e0b8d61e", "score": "0.653213", "text": "func testApp(c *model.CommandConfig) (err error) {\n\tmode := DefaultRunMode\n\tif c.Test.Mode != \"\" {\n\t\tmode = c.Test.Mode\n\t}\n\n\t// Find and parse app.conf\n\trevelPath, err := model.NewRevelPaths(mode, c.ImportPath, c.AppPath, model.NewWrappedRevelCallback(nil, c.PackageResolver))\n\tif err != nil {\n\t\treturn\n\t}\n\n\t// todo Ensure that the testrunner is loaded in this mode.\n\n\t// Create a directory to hold the test result files.\n\tresultPath := filepath.Join(revelPath.BasePath, \"test-results\")\n\tif err = os.RemoveAll(resultPath); err != nil {\n\t\treturn utils.NewBuildError(\"Failed to remove test result directory \", \"path\", resultPath, \"error\", err)\n\t}\n\tif err = os.Mkdir(resultPath, 0777); err != nil {\n\t\treturn utils.NewBuildError(\"Failed to create test result directory \", \"path\", resultPath, \"error\", err)\n\t}\n\n\t// Direct all the output into a file in the test-results directory.\n\tfile, err := os.OpenFile(filepath.Join(resultPath, \"app.log\"), os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)\n\tif err != nil {\n\t\treturn utils.NewBuildError(\"Failed to create test result log file: \", \"error\", err)\n\t}\n\n\tapp, reverr := harness.Build(c, revelPath)\n\tif reverr != nil {\n\t\treturn utils.NewBuildIfError(reverr, \"Error building: \")\n\t}\n\tvar paths []byte\n\tif len(app.PackagePathMap) > 0 {\n\t\tpaths, _ = json.Marshal(app.PackagePathMap)\n\t}\n\trunMode := fmt.Sprintf(`{\"mode\":\"%s\", \"specialUseFlag\":%v,\"packagePathMap\":%s}`, app.Paths.RunMode, c.GetVerbose(), string(paths))\n\tif c.HistoricMode {\n\t\trunMode = app.Paths.RunMode\n\t}\n\tcmd := app.Cmd(runMode)\n\tcmd.Dir = c.AppPath\n\n\tcmd.Stderr = io.MultiWriter(cmd.Stderr, file)\n\tcmd.Stdout = io.MultiWriter(cmd.Stderr, file)\n\n\t// Start the app...\n\tif err := cmd.Start(c); err != nil {\n\t\treturn utils.NewBuildError(\"Unable to start server\", \"error\", err)\n\t}\n\tdefer cmd.Kill()\n\n\thttpAddr := revelPath.HTTPAddr\n\tif httpAddr == \"\" {\n\t\thttpAddr = \"localhost\"\n\t}\n\n\thttpProto := \"http\"\n\tif revelPath.HTTPSsl {\n\t\thttpProto = \"https\"\n\t}\n\n\t// Get a list of tests\n\tbaseURL := fmt.Sprintf(\"%s://%s:%d\", httpProto, httpAddr, revelPath.HTTPPort)\n\n\tutils.Logger.Infof(\"Testing %s (%s) in %s mode URL %s \\n\", revelPath.AppName, revelPath.ImportPath, mode, baseURL)\n\ttestSuites, _ := getTestsList(baseURL)\n\n\t// If a specific TestSuite[.Method] is specified, only run that suite/test\n\tif c.Test.Function != \"\" {\n\t\ttestSuites = filterTestSuites(testSuites, c.Test.Function)\n\t}\n\n\ttestSuiteCount := len(*testSuites)\n\tfmt.Printf(\"\\n%d test suite%s to run.\\n\", testSuiteCount, pluralize(testSuiteCount, \"\", \"s\"))\n\tfmt.Println()\n\n\t// Run each suite.\n\tfailedResults, overallSuccess := runTestSuites(revelPath, baseURL, resultPath, testSuites)\n\n\tfmt.Println()\n\tif overallSuccess {\n\t\twriteResultFile(resultPath, \"result.passed\", \"passed\")\n\t\tfmt.Println(\"All Tests Passed.\")\n\t} else {\n\t\tfor _, failedResult := range *failedResults {\n\t\t\tfmt.Printf(\"Failures:\\n\")\n\t\t\tfor _, result := range failedResult.Results {\n\t\t\t\tif !result.Passed {\n\t\t\t\t\tfmt.Printf(\"%s.%s\\n\", failedResult.Name, result.Name)\n\t\t\t\t\tfmt.Printf(\"%s\\n\\n\", result.ErrorSummary)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\twriteResultFile(resultPath, \"result.failed\", \"failed\")\n\t\tutils.Logger.Errorf(\"Some tests failed. See file://%s for results.\", resultPath)\n\t}\n\n\treturn\n}", "title": "" } ]
[ { "docid": "3f0b2ca4abafa22e626a382efffe80c0", "score": "0.6958669", "text": "func (s *RingpopTestSuite) TestApp() {\n\ts.Equal(\"test\", s.ringpop.App())\n}", "title": "" }, { "docid": "d029a56cc4951b4fd20abc06318d3591", "score": "0.6819969", "text": "func Test_Application(t *testing.T) {\n\n\tapp := Application{}\n\texit := make(ExitChan)\n\n\t// Set up the graph, much the same was as in main.go – and exactly as in the test\n\t// above, only this time globally\n\tinj.Provide(\n\t\t&app, // This time it is a pointer\n\t\texit, // `ExitChan`, this time shared\n\t\t&MockConfig{}, // Use the mock config\n\t\tMockLogger, // `Logger`, as above\n\t\tMockWriteResponse, // Our specialised response writer\n\t\tt, // Pointer to `testing.T`, which is now going to be used\n\t)\n\n\t// Make sure everything was loaded properly again\n\tif valid, messages := inj.Assert(); !valid {\n\t\tt.Fatalf(\"inj.Assert() failed: %s\", messages)\n\t}\n\n\t// Run the application in its own goroutine. It should stay running until it's explicitly\n\t// shut down\n\tgo app.run()\n\n\t// Here we make some requests to the application, and check the responses. Again, there are\n\t// better ways to choose test strings\n\ttests := []string{\n\t\t\"fulfilment\",\n\t\t\"doubt\",\n\t\t\"futility\",\n\t\t\"inetivatable narrative hijacking\",\n\t}\n\n\tfor _, input := range tests {\n\n\t\tres, err := http.Get(fmt.Sprintf(\"http://localhost:%d/%s\", MOCK_HTTP_PORT, input))\n\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"http.Get(): %s\", err)\n\t\t}\n\n\t\tbody, err := ioutil.ReadAll(res.Body)\n\t\tres.Body.Close()\n\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t\tt.Fatalf(\"ioutil.ReadAll %s\", err)\n\t\t}\n\n\t\tt.Logf(\"Testing %s...\", input)\n\n\t\tif g, e := res.StatusCode, 200; g != e {\n\t\t\tt.Errorf(\"Expected status code %d, got %d\", g, e)\n\t\t}\n\n\t\tif g, e := string(body), input; g != e {\n\t\t\tt.Fatalf(\"Got %s, expected %s\")\n\t\t}\n\t}\n\n\t// Kill the app\n\texit <- struct{}{}\n}", "title": "" }, { "docid": "4c577c18374a79695552145a741d8054", "score": "0.6346949", "text": "func TestMain(t *testing.T) {\n\ta = initApp()\n\tgo http.ListenAndServe(\":8000\", a.router)\n}", "title": "" }, { "docid": "c8787c7461fc7b8b64981bb1a64eef5a", "score": "0.6307958", "text": "func newTestApplication() *application {\n\treturn &application{\n\t\tlogger: log.New(io.Discard, \"\", 0),\n\t\tmodels: data.Models{Customers: StubCustomerModel{db: StubDatabase}},\n\t}\n}", "title": "" }, { "docid": "6a6b8cb5efc736889db614ffbba59019", "score": "0.6239091", "text": "func BeforeTestRun() {\n\tsimApp, ctx = sim.CreateTestApp(true)\n\tkeeper = simApp.LongyKeeper\n\tExpect(keeper).ToNot(BeNil())\n}", "title": "" }, { "docid": "37ff96427455b36505fc0f38f9e6d816", "score": "0.6184805", "text": "func TestMain(m *testing.M) {\n\tNewAppLogin()\n}", "title": "" }, { "docid": "998bbf9ded595bbaf683bed068b2b3a9", "score": "0.6112108", "text": "func newTestApplication(t *testing.T) *application {\n\t// Create an instance of the template cache.\n\treturn &application{\n\t\terrorLog: log.New(ioutil.Discard, \"\", 0),\n\t\tinfoLog: log.New(ioutil.Discard, \"\", 0),\n\t\tminiURLModel: &mock.MiniURLModel{},\n\t}\n}", "title": "" }, { "docid": "3993ed1a9689e76e1b9a82d263b65630", "score": "0.59752274", "text": "func (app *App) Run() {\n}", "title": "" }, { "docid": "d89847badb4e88bbf21a73c693c43c8d", "score": "0.5964208", "text": "func TestController(t *testing.T) {\n suite.Run(t, new(ControllerTestSuite))\n}", "title": "" }, { "docid": "483709bea05880fa841c8312b81c67a4", "score": "0.59612805", "text": "func testHome(w http.ResponseWriter, r *http.Request) {\n\tfmt.Println(\"Test Home: Endpoint Hit\")\n\tfmt.Fprintln(w, \"Test Home: Endpoint Hit\")\n}", "title": "" }, { "docid": "28b74a25fa4489568f769c1d34230d39", "score": "0.5910763", "text": "func testMainInEnvironment(m *testing.M) int {\n\n\t// server sends item to channel upon request\n\tts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {\n\t\tinitChan <- struct{}{}\n\t}))\n\tdefer ts.Close()\n\n\tconfig := `\nplugins:\n test:\n key: secret\n`\n\tbadConfig := `\nplugins:\n test:\n key: fake\n`\n\n\tfiles := map[string]string{\n\t\t\"/builtins/true.go\": getBuiltinWithName(\"true\"),\n\t\t\"/plugins/test.go\": getPluginWithNameAndURL(\"test\", ts.URL),\n\t\t\"/plugins/config.yaml\": config,\n\t\t\"/plugins/bad-config.yaml\": badConfig,\n\t}\n\troot, cleanup := makeDirWithSharedObjects(files, \".so\")\n\ttestDirRoot = root\n\tdefer cleanup()\n\treturn m.Run()\n}", "title": "" }, { "docid": "d89505113cbefba5ddcd2c954b562297", "score": "0.5903136", "text": "func TestMain(m *testing.M){\n\trestclient.StartMockups()\n\tos.Exit(m.Run())\n}", "title": "" }, { "docid": "9972136a0183cd096009ecc0ce6db370", "score": "0.59023464", "text": "func TestMain(m *testing.M) {\n\tconf.Init()\n\t//_ = routers.Init()\n\tRouter = routers.GetRouter()\n\tsetupContainers()\n\tservices.Init()\n\t//Token, _ = middleware.ParseJwt(fetchTokenFromKeycloak(), middleware.FetchKeycloakPublicKey())\n\n\tcode := m.Run()\n\tdefer os.Exit(code)\n\tCompose.Down()\n}", "title": "" }, { "docid": "b301aae46c000e8f6b290b221c1bac47", "score": "0.5832745", "text": "func main() {\n\tapplication()\n}", "title": "" }, { "docid": "00596007a3c398f702b7966a0757c56f", "score": "0.58286625", "text": "func main() {\n\tapp.Run()\t\n\n}", "title": "" }, { "docid": "1a485137e406b0c6952fe1b24689e777", "score": "0.58105373", "text": "func (app *App) Run() error {\n\tfmt.Println(\"Setting up our app!\")\n\treturn nil\n}", "title": "" }, { "docid": "aaf65c68573d7dbb18f4af196c0cf63e", "score": "0.5808904", "text": "func InitializeApp(\n\thttpRouter *mux.Router,\n\tgrpcServer *grpc.Server,\n\tpublisher message.Publisher,\n\tlogger logur.Logger,\n\terrorHandler emperror.Handler,\n) {\n\tcommonLogger := commonadapter.NewContextAwareLogger(logger, appkit.ContextExtractor{})\n\n\tendpointMiddleware := []endpoint.Middleware{\n\t\tcorrelation.Middleware(),\n\t}\n\n\tcontextualErrorHandler := emperror.MakeContextAware(emperror.WithFilter(\n\t\terrorHandler,\n\t\tmatch.ErrorMatcherFunc(appkit.IsClientError), // filter out client errors\n\t))\n\n\thttpServerOptions := []kithttp.ServerOption{\n\t\tkithttp.ServerErrorHandler(contextualErrorHandler),\n\t\tkithttp.ServerErrorEncoder(kitxhttp.ProblemErrorEncoder),\n\t\tkithttp.ServerBefore(correlation.HTTPToContext()),\n\t}\n\n\tgrpcServerOptions := []kitgrpc.ServerOption{\n\t\tkitgrpc.ServerErrorHandler(contextualErrorHandler),\n\t\tkitgrpc.ServerBefore(correlation.GRPCToContext()),\n\t}\n\n\t{\n\t\tlogger := commonLogger.WithFields(map[string]interface{}{\"module\": \"todo\"})\n\t\terrorHandler := emperror.MakeContextAware(emperror.WithDetails(errorHandler, \"module\", \"todo\"))\n\n\t\teventBus, _ := cqrs.NewEventBus(\n\t\t\tpublisher,\n\t\t\tfunc(eventName string) string { return todoTopic },\n\t\t\tcqrs.JSONMarshaler{GenerateName: cqrs.StructName},\n\t\t)\n\n\t\tservice := todo.NewService(\n\t\t\tulidgen.NewGenerator(),\n\t\t\ttodo.NewInMemoryStore(),\n\t\t\ttodogen.NewEventDispatcher(eventBus),\n\t\t)\n\t\tservice = tododriver.LoggingMiddleware(logger)(service)\n\t\tservice = tododriver.InstrumentationMiddleware()(service)\n\n\t\tendpoints := tododriver.TraceEndpoints(tododriver.MakeEndpoints(\n\t\t\tservice,\n\t\t\tkitxendpoint.Chain(endpointMiddleware...),\n\t\t\tappkit.EndpointLogger(logger),\n\t\t))\n\n\t\ttododriver.RegisterHTTPHandlers(\n\t\t\tendpoints,\n\t\t\thttpRouter.PathPrefix(\"/todos\").Subrouter(),\n\t\t\tkitxhttp.ServerOptions(httpServerOptions),\n\t\t\tkithttp.ServerErrorHandler(errorHandler),\n\t\t\tkithttp.ServerErrorEncoder(kitxhttp.NewJSONProblemErrorEncoder(appkit.NewProblemConverter())),\n\t\t)\n\n\t\ttodov1beta1.RegisterTodoListServer(\n\t\t\tgrpcServer,\n\t\t\ttododriver.MakeGRPCServer(\n\t\t\t\tendpoints,\n\t\t\t\tkitxgrpc.ServerOptions(grpcServerOptions),\n\t\t\t\tkitgrpc.ServerErrorHandler(errorHandler),\n\t\t\t),\n\t\t)\n\n\t\thttpRouter.PathPrefix(\"/graphql\").Handler(tododriver.MakeGraphQLHandler(endpoints, errorHandler))\n\t}\n\n\tlandingdriver.RegisterHTTPHandlers(httpRouter)\n\thttpRouter.PathPrefix(\"/httpbin\").Handler(http.StripPrefix(\n\t\t\"/httpbin\",\n\t\thttpbin.MakeHTTPHandler(commonLogger.WithFields(map[string]interface{}{\"module\": \"httpbin\"})),\n\t))\n}", "title": "" }, { "docid": "44ee038c484eebd3371d1aa98229d6ee", "score": "0.5785751", "text": "func (App) WhenReady() {}", "title": "" }, { "docid": "44ee038c484eebd3371d1aa98229d6ee", "score": "0.5785751", "text": "func (App) WhenReady() {}", "title": "" }, { "docid": "808ec8fa168b1d04bbe5a123e3472ab1", "score": "0.5774933", "text": "func TestMain(m *testing.M) {\n\tappEnv := os.Getenv(\"APP_ENV\")\n\tAppInstance = app.App{}\n\tAppInstance.Initialize(appEnv)\n\n\tdb, err := sql.Open(\"postgres\",\n\t\tAppInstance.ConnectionString)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tclearDB()\n\tdefer clearDB()\n\tdefer db.Close()\n\n\terrDB := goose.Run(\"up\", db, migrationsPath)\n\tif errDB != nil {\n\t\tlog.Fatal(errDB)\n\t}\n\texitVal := m.Run()\n\tos.Exit(exitVal)\n}", "title": "" }, { "docid": "3181ef79d01e8860bf68edb1d1c03caa", "score": "0.57512397", "text": "func (app *App) Run() error {\n\tfmt.Println(\"This sets up out app\")\n\treturn nil\n}", "title": "" }, { "docid": "ed36dbb8ff4e814a26a3fe129eaa9041", "score": "0.5737452", "text": "func TestMain(m *testing.M) {\n\tframework.Run(\"pilot_test\", m)\n}", "title": "" }, { "docid": "8989976660d0027a3598f6c8432240a4", "score": "0.5729271", "text": "func TestNewApp(t *testing.T) {\n\tsetUpTest()\n\twd, _ := os.Getwd()\n\thome := path.Join(wd, \"test\")\n\ta, _ := NewApp(\"aws\", home)\n\texpectedDefinition := path.Join(home, \"config/aws.ssw\")\n\tif a.Definition != expectedDefinition {\n\t\tt.Errorf(\"Expected definition file to be %s, found %s\", expectedDefinition, a.Definition)\n\t}\n\tif a.EnvType != \"environment\" {\n\t\tt.Errorf(\"Expected envType to be %s, found %s\", \"environment\", a.EnvType)\n\t}\n\texpectedPath := path.Join(home, \"aws\")\n\tif a.Path != expectedPath {\n\t\tt.Errorf(\"Expected path to be %s, found %s\", a.Path, expectedPath)\n\t}\n}", "title": "" }, { "docid": "0095661646f29b8068dd3109245b84e5", "score": "0.57257223", "text": "func createTestApp(isCheckTx bool) (*simapp.SimApp, sdk.Context) {\n\tapp := simapp.Setup(isCheckTx)\n\n\tctx := app.BaseApp.NewContext(isCheckTx, ostproto.Header{})\n\tapp.MintKeeper.SetParams(ctx, types.DefaultParams())\n\tapp.MintKeeper.SetMinter(ctx, types.DefaultInitialMinter())\n\n\treturn app, ctx\n}", "title": "" }, { "docid": "9be15ae231b4059b64aa5d097a4d981c", "score": "0.57238555", "text": "func TestApplicationRoutes(t *testing.T) {\n\th := createTestServer(noAuthConfig)\n\th.Start()\n\tdefer h.Shutdown()\n\n\t// Create a new application\n\tapp := storeApplication(t,\n\t\tapiApplication{Tags: map[string]string{\"name\": \"Value\"}},\n\t\th.loopbackURL()+\"/applications\",\n\t\thttp.StatusCreated)\n\n\t// Storage should contain application\n\teui, err := protocol.EUIFromString(app.ApplicationEUI)\n\tif err != nil {\n\t\tt.Fatal(\"Got invalid EUI from created app: \", err)\n\t}\n\t_, err = h.context.Storage.Application.GetByEUI(eui, model.SystemUserID)\n\tif err != nil {\n\t\tt.Fatal(\"Could not locate app created through rest api: \", err)\n\t}\n\n\t// Retrieve the same application through its endpoint. Should match.\n\turl := h.loopbackURL() + \"/applications/\" + app.ApplicationEUI\n\tresp, err := http.Get(url)\n\tif err != nil {\n\t\tt.Fatalf(\"Could not GET application from %s: %v\", url, err)\n\t}\n\tif resp.StatusCode != http.StatusOK {\n\t\tt.Fatalf(\"Expected 200 OK from %s but got %d\", url, resp.StatusCode)\n\t}\n\n\tcopy := apiApplication{}\n\tbuffer, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\tt.Fatalf(\"Couldn't read response body from %s: %v\", url, err)\n\t}\n\tif err := json.Unmarshal(buffer, &copy); err != nil {\n\t\tt.Fatalf(\"Couldn't unmarshal application: %v\", err)\n\t}\n\n\tif !copy.equals(app) {\n\t\tt.Fatalf(\"Didn't get the same app from the endpoint as the one that was created %v != %v\", copy, app)\n\t}\n\n\totherApp := storeApplication(t,\n\t\tapiApplication{Tags: make(map[string]string)},\n\t\th.loopbackURL()+\"/applications\",\n\t\thttp.StatusCreated)\n\n\t// Retrieve list, check that list contains both apps\n\turl = h.loopbackURL() + \"/applications\"\n\tif resp, err = http.Get(url); err != nil {\n\t\tt.Fatalf(\"Could not GET application list from %s: %v\", url, err)\n\t}\n\n\tif resp.StatusCode != http.StatusOK {\n\t\tt.Fatalf(\"Did not get 200 OK from GET. Got %d\", resp.StatusCode)\n\t}\n\n\tlist := applicationList{}\n\tbuffer, err = ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\tt.Fatal(\"Could not read body of application list: \", err)\n\t}\n\n\tif err := json.Unmarshal(buffer, &list); err != nil {\n\t\tt.Fatal(\"Could not unmarshal list: \", err)\n\t}\n\n\tvar foundOne, foundTwo bool\n\tfor _, v := range list.Applications {\n\t\tif v.equals(app) {\n\t\t\tfoundOne = true\n\t\t}\n\t\tif v.equals(otherApp) {\n\t\t\tfoundTwo = true\n\t\t}\n\t}\n\n\tif !foundOne || !foundTwo {\n\t\tt.Fatal(\"List doesn't contain both applications\")\n\t}\n\n\t// Create ten applications in the storage layer\n\ttmpApp := model.NewApplication()\n\ttmpApp.AppEUI, _ = h.context.KeyGenerator.NewAppEUI()\n\th.context.Storage.Application.Put(tmpApp, model.SystemUserID)\n\n\t// Creating a new application with the EUI set should fail\n\tstoreApplication(t, apiApplication{ApplicationEUI: tmpApp.AppEUI.String()},\n\t\th.loopbackURL()+\"/applications\", http.StatusConflict)\n\n\t// Create 10 applications that will conflict with future applications\n\tfirst := tmpApp.AppEUI.ToUint64() + 1\n\tfor i := 0; i < 15; i++ {\n\t\ta := apiApplication{ApplicationEUI: protocol.EUIFromUint64(first).String()}\n\t\tstoreApplication(t, a, h.loopbackURL()+\"/applications\", http.StatusCreated)\n\t\tfirst++\n\t}\n\n\t// ..and if we try to create a new it would fail the first time (since the check stops at 10) then succeed\n\tstoreApplication(t, apiApplication{}, h.loopbackURL()+\"/applications\", http.StatusInternalServerError)\n\tstoreApplication(t, apiApplication{}, h.loopbackURL()+\"/applications\", http.StatusCreated)\n}", "title": "" }, { "docid": "63a4a9de9a5f5dda8e409b2ceebfc216", "score": "0.57206", "text": "func (a *App) Run() {\n // Run the server\n a.router.Run()\n}", "title": "" }, { "docid": "6df58b7fc9201208b6788202ce1a110a", "score": "0.57111514", "text": "func Run() {\n\n\t// The environment variable \"TEST_DIR\"\n\t// defines the directory for the test data\n\ttestDir = os.Getenv(\"TEST_DIR\")\n\tdir, err := os.Stat(testDir)\n\tif err != nil {\n\t\tfmt.Printf(\"TEST_DIR environment variable invalid: %v\\n\", err)\n\t\treturn\n\t}\n\tif !dir.IsDir() {\n\t\tfmt.Printf(\"TEST_DIR is not a directory\\n\")\n\t\treturn\n\t}\n\n\t// The environment variable \"TEST_PORT\"\n\t// defines the portnumber the test service is listening\n\ttestPort = os.Getenv(\"TEST_PORT\")\n\tif testPort == \"\" {\n\t\tfmt.Printf(\"TEST_PORT environment variable unset or missing\\n\")\n\t\treturn\n\t}\n\n\t// Config logging\n\tlog.SetFlags(log.Ldate | log.Ltime | log.Lshortfile)\n\n\t// Prepare logfile for logging\n\tyear, month, day := time.Now().Date()\n\thour, minute, second := time.Now().Clock()\n\tlogfilename := fmt.Sprintf(\"cli-test-server%v%02d%02d%02d%02d%02d.log\",\n\t\tyear, int(month), int(day), int(hour), int(minute), int(second))\n\t// Todo logdir as env variable\n\tlogfile, err := os.OpenFile(\"log/\"+logfilename, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)\n\tif err != nil {\n\t\tfmt.Printf(\"error opening logfile %v: %v\", logfilename, err)\n\t\treturn\n\t}\n\n\t// Switch logging to logfile\n\tlog.SetOutput(logfile)\n\n\t// TestRun related handler functions\n\thttp.HandleFunc(\"/init\", InitRun)\n\thttp.HandleFunc(\"/getrun\", GetRun)\n\thttp.HandleFunc(\"/resetrun\", ResetRun)\n\n\t// TestRun.Commands related handler functions\n\thttp.HandleFunc(\"/getcommand\", GetCommand)\n\thttp.HandleFunc(\"/removecommand\", RemoveCommand)\n\n\t// TestEventFilter related handler functions\n\thttp.HandleFunc(\"/putevent\", PutTestEvent)\n\thttp.HandleFunc(\"/getevents\", GetTestEvents)\n\n\t// TestResult related handler functions\n\thttp.HandleFunc(\"/putresult\", PutTestResult)\n\thttp.HandleFunc(\"/getresults\", GetTestResults)\n\n\t// TestSummary related handler functions\n\thttp.HandleFunc(\"/preparesummary\", PrepareTestSummary)\n\thttp.HandleFunc(\"/getsummary\", GetTestSummary)\n\n\t// Start the service\n\tlog.Fatal(http.ListenAndServe(\":\"+testPort, nil))\n}", "title": "" }, { "docid": "c338e30289824edce45d3e97acb3e668", "score": "0.5708664", "text": "func TestMain(m *testing.M) {\n\tphoenix.ConnectAvatica(\n\t\t\"fr00nbpnode01\",\n\t\t\"8765\",\n\t)\n\tr := GetRouter()\n\tgo r.Run(\"0.0.0.0:\" + string(port))\n\t<-time.After(1 * time.Second)\n\tos.Exit(m.Run())\n}", "title": "" }, { "docid": "7d3bed39b56e947f620e04b5054b6f9b", "score": "0.5682398", "text": "func TestMain(m *testing.M) {\n\trestclient.StartMockups()\n\tos.Exit(m.Run())\n}", "title": "" }, { "docid": "6cc08ebd01b2b9c75d721cdff0b99c7b", "score": "0.56772286", "text": "func TestMain(m *testing.M) {\n\ttestDb := models.OpenTestPostgresDataBase()\n\ttestApp := testApp{DB: testDb}\n\ttestApp.initialize()\n\n\tcode := m.Run()\n\ttestApp.tearDown()\n\tos.Exit(code)\n}", "title": "" }, { "docid": "c9cd6ec5dce473729610095ba8d083fc", "score": "0.5655654", "text": "func TestController(t *testing.T) {\n\tt.Fatal(\"chat controller tests not complete\")\n}", "title": "" }, { "docid": "5da53d38d66fa0ae5e042f781f33f9be", "score": "0.5653614", "text": "func TestStart(t *testing.T) {\n\tif initErr != nil {\n\t\tt.Error(initErr)\n\t\tt.FailNow()\n\t}\n\tif startErrors := app.Start(); startErrors != nil {\n\t\tt.Error(startErrors)\n\t\tt.FailNow()\n\t}\n\ttime.Sleep(time.Second)\n\tapp.Shutdown()\n\tif read, err := ioutil.ReadFile(\"./testlog\"); err == nil {\n\t\tlogOutput := string(read)\n\t\t//fmt.Println(logOutput)\n\t\tif i := strings.Index(logOutput, \"Listening on TCP 127.0.0.1:4654\"); i < 0 {\n\t\t\tt.Error(\"Server did not listen on 127.0.0.1:4654\")\n\t\t}\n\t\tif i := strings.Index(logOutput, \"Listening on TCP 127.0.0.1:2526\"); i < 0 {\n\t\t\tt.Error(\"Server did not listen on 127.0.0.1:2526\")\n\t\t}\n\t\tif i := strings.Index(logOutput, \"[127.0.0.1:4654] Waiting for a new client\"); i < 0 {\n\t\t\tt.Error(\"Server did not wait on 127.0.0.1:4654\")\n\t\t}\n\t\tif i := strings.Index(logOutput, \"[127.0.0.1:2526] Waiting for a new client\"); i < 0 {\n\t\t\tt.Error(\"Server did not wait on 127.0.0.1:2526\")\n\t\t}\n\t\tif i := strings.Index(logOutput, \"Server [127.0.0.1:4654] has stopped accepting new clients\"); i < 0 {\n\t\t\tt.Error(\"Server did not stop on 127.0.0.1:4654\")\n\t\t}\n\t\tif i := strings.Index(logOutput, \"Server [127.0.0.1:2526] has stopped accepting new clients\"); i < 0 {\n\t\t\tt.Error(\"Server did not stop on 127.0.0.1:2526\")\n\t\t}\n\t\tif i := strings.Index(logOutput, \"shutdown completed for [127.0.0.1:4654]\"); i < 0 {\n\t\t\tt.Error(\"Server did not complete shutdown on 127.0.0.1:4654\")\n\t\t}\n\t\tif i := strings.Index(logOutput, \"shutdown completed for [127.0.0.1:2526]\"); i < 0 {\n\t\t\tt.Error(\"Server did not complete shutdown on 127.0.0.1:2526\")\n\t\t}\n\t\tif i := strings.Index(logOutput, \"shutting down pool [127.0.0.1:4654]\"); i < 0 {\n\t\t\tt.Error(\"Server did not shutdown pool on 127.0.0.1:4654\")\n\t\t}\n\t\tif i := strings.Index(logOutput, \"shutting down pool [127.0.0.1:2526]\"); i < 0 {\n\t\t\tt.Error(\"Server did not shutdown pool on 127.0.0.1:2526\")\n\t\t}\n\t\tif i := strings.Index(logOutput, \"Backend shutdown completed\"); i < 0 {\n\t\t\tt.Error(\"Backend didn't shut down\")\n\t\t}\n\n\t}\n\t// don't forget to reset\n\n\tos.Truncate(\"./testlog\", 0)\n}", "title": "" }, { "docid": "03cfd6bf6c7c57dc3ea0f44d4f568cc8", "score": "0.5648255", "text": "func Run(t *testing.T, commandPath string, commandArgs []string, configFilePath string) *App {\n\tdataDir, err := ioutil.TempDir(\"/tmp\", \"buildbuddy-test-*\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tt.Cleanup(func() {\n\t\tos.RemoveAll(dataDir)\n\t})\n\t// NOTE: No SSL ports are required since the server doesn't have an SSL config by default.\n\tapp := &App{\n\t\thttpPort: FreePort(t),\n\t\tgRPCPort: FreePort(t),\n\t\tmonitoringPort: FreePort(t),\n\t}\n\targs := []string{\n\t\tfmt.Sprintf(\"--config_file=%s\", runfile(t, configFilePath)),\n\t\tfmt.Sprintf(\"--port=%d\", app.httpPort),\n\t\tfmt.Sprintf(\"--grpc_port=%d\", app.gRPCPort),\n\t\tfmt.Sprintf(\"--monitoring_port=%d\", app.monitoringPort),\n\t\t\"--static_directory=static\",\n\t\t\"--app_directory=/app\",\n\t\tfmt.Sprintf(\"--app.build_buddy_url=http://localhost:%d\", app.httpPort),\n\t\t\"--database.data_source=sqlite3://:memory:\",\n\t\tfmt.Sprintf(\"--storage.disk.root_directory=%s\", filepath.Join(dataDir, \"storage\")),\n\t\tfmt.Sprintf(\"--cache.disk.root_directory=%s\", filepath.Join(dataDir, \"cache\")),\n\t}\n\targs = append(args, commandArgs...)\n\tcmd := exec.Command(runfile(t, commandPath), args...)\n\t// TODO: Write server logs to files so they can be used to debug failed tests\n\tcmd.Stdout = &app.stdout\n\tcmd.Stderr = &app.stderr\n\tif err := cmd.Start(); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tt.Cleanup(func() {\n\t\tcmd.Process.Kill() // ignore errors\n\t})\n\tgo func() {\n\t\terr := cmd.Wait()\n\t\tapp.mu.Lock()\n\t\tdefer app.mu.Unlock()\n\t\tapp.exited = true\n\t\tapp.err = err\n\t}()\n\terr = app.waitForReady()\n\tif err != nil {\n\t\tt.Fatal(app.fmtErrorWithLogs(err))\n\t}\n\treturn app\n}", "title": "" }, { "docid": "833abdd6291e140622d67e8d69ba55df", "score": "0.56404835", "text": "func main() {\n\t// Create a new application\n\tapp := NewApp()\n\n\t// Parse application config\n\tif err := app.ParseConfig(); err != nil {\n\t\tlog.Fatalln(err)\n\t}\n\n\t// Prepare the application\n\tif err := app.PrepareComponents(); err != nil {\n\t\tlog.Fatalln(err)\n\t}\n\n\t// Run the application\n\tif err := app.Run(); err != nil {\n\t\tlog.Fatalln(err)\n\t}\n}", "title": "" }, { "docid": "aee03442e9d7b9d9a5c48b164d74c93c", "score": "0.5640181", "text": "func TestMain(m *testing.M) {\n\tfmt.Println(\" TESTING MIDDLEWARE HANDLERS\")\n\tos.Exit(m.Run())\n\tfmt.Println(\" MIDDLEWARE COMPLETED \")\n}", "title": "" }, { "docid": "f2ca064f3fd2475779c9f64baa36962a", "score": "0.5639718", "text": "func TestMain(m *testing.M) {\n\tvar err error\n\n\tctx := context.Background()\n\n\t{\n\t\tlogger, err = micrologger.New(micrologger.Config{})\n\t\tif err != nil {\n\t\t\tpanic(err.Error())\n\t\t}\n\t}\n\n\t{\n\t\tappTest, err = apptest.New(apptest.Config{\n\t\t\tKubeConfigPath: env.KubeConfig(),\n\t\t\tLogger: logger,\n\t\t})\n\t\tif err != nil {\n\t\t\tpanic(err.Error())\n\t\t}\n\t}\n\n\t{\n\t\tapps := []apptest.App{\n\t\t\t{\n\t\t\t\tCatalogName: prodCatalogName,\n\t\t\t\tName: \"cert-manager-app\",\n\t\t\t\tNamespace: metav1.NamespaceSystem,\n\t\t\t\tVersion: \"2.3.1\",\n\t\t\t\tWaitForDeploy: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tCatalogName: testCatalogName,\n\t\t\t\tName: \"app-admission-controller\",\n\t\t\t\tNamespace: \"giantswarm\",\n\t\t\t\tSHA: env.CircleSHA(),\n\t\t\t\tValuesYAML: templates.AppAdmissionControllerValues,\n\t\t\t\tWaitForDeploy: true,\n\t\t\t},\n\t\t}\n\t\terr = appTest.InstallApps(ctx, apps)\n\t\tif err != nil {\n\t\t\tlogger.Errorf(ctx, err, \"install apps failed\")\n\t\t\tos.Exit(2)\n\t\t}\n\t}\n\n\tos.Exit(m.Run())\n}", "title": "" }, { "docid": "4bda416b04bb369f03768eacc27e5624", "score": "0.5636962", "text": "func (app *App) Run() error {\n\treturn nil\n}", "title": "" }, { "docid": "91c38e7aa6174fa59ab57eaf7aeea66f", "score": "0.5632298", "text": "func getMockApp(t *testing.T, numGenAccs int, genState GenesisState, genAccs []auth.Account) (\n\tmapp *mock.App, keeper Keeper, sk staking.Keeper, addrs []sdk.AccAddress,\n\tpubKeys []crypto.PubKey, privKeys []crypto.PrivKey) {\n\n\tmapp = mock.NewApp()\n\n\tstaking.RegisterCodec(mapp.Cdc)\n\tRegisterCodec(mapp.Cdc)\n\n\tkeyStaking := sdk.NewKVStoreKey(staking.StoreKey)\n\ttkeyStaking := sdk.NewTransientStoreKey(staking.TStoreKey)\n\tkeyGov := sdk.NewKVStoreKey(StoreKey)\n\n\tpk := mapp.ParamsKeeper\n\tck := bank.NewBaseKeeper(mapp.AccountKeeper, mapp.ParamsKeeper.Subspace(\"testbank\"), bank.DefaultCodespace)\n\tsk = staking.NewKeeper(mapp.Cdc, keyStaking, tkeyStaking, ck, pk.Subspace(staking.DefaultParamspace), staking.DefaultCodespace, stakekeeper.NopMetrics())\n\tguardianKeeper := guardian.NewKeeper(mapp.Cdc, sdk.NewKVStoreKey(\"guardian\"), guardian.DefaultCodespace)\n\tkeeper = NewKeeper(mapp.Cdc, keyGov, pk, sdk.NewProtocolKeeper(sdk.NewKVStoreKey(\"main\")), guardianKeeper, pk.Subspace(\"testgov\"), ck, sk, DefaultCodespace)\n\n\tmapp.Router().AddRoute(\"gov\", []*sdk.KVStoreKey{keyGov}, NewHandler(keeper))\n\tmapp.QueryRouter().AddRoute(QuerierRoute, NewQuerier(keeper))\n\n\tmapp.SetEndBlocker(getEndBlocker(keeper))\n\tmapp.SetInitChainer(getInitChainer(mapp, keeper, sk, genState))\n\n\trequire.NoError(t, mapp.CompleteSetup(keyStaking, tkeyStaking, keyGov))\n\n\tvalTokens := sdk.TokensFromTendermintPower(42)\n\tif genAccs == nil || len(genAccs) == 0 {\n\t\tgenAccs, addrs, pubKeys, privKeys = mock.CreateGenAccounts(numGenAccs,\n\t\t\tsdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, valTokens)})\n\t}\n\n\tmock.SetGenesis(mapp, genAccs)\n\n\treturn mapp, keeper, sk, addrs, pubKeys, privKeys\n}", "title": "" }, { "docid": "efb7fc146cc8ddf718850901fb41aa42", "score": "0.5624041", "text": "func NewMockAPP(rootDir string, cdc *go_amino.Codec) (QstarsBaseApp, error) {\n\n\n\tlogger := log.NewTMLogger(log.NewSyncWriter(os.Stdout)).With(\"module\", \"main\")\n\tqstarts := QstarsBaseApp{\n\t\tLogger: logger,\n\t\tRootDir: rootDir,\n\t}\n\treturn qstarts, nil\n}", "title": "" }, { "docid": "bb2ebe78ff3786d21e1519c48957ca9b", "score": "0.5617497", "text": "func TestSystem(t *testing.T) {\n\tif *systemTest {\n\t\tmain()\n\t}\n}", "title": "" }, { "docid": "3366f0da7150a63e7b39cf10312f28ce", "score": "0.5608341", "text": "func getMockApp(t *testing.T) (*mock.App, keeper.MockStakingKeeper) {\n\tmApp := mock.NewApp()\n\n\t//RegisterCodec(mApp.Cdc)\n\n\t_, accKeeper, mKeeper := CreateTestInput(t, false, SufficientInitPower)\n\tkeeper := mKeeper.Keeper\n\n\tmApp.Router().AddRoute(RouterKey, NewHandler(keeper))\n\tmApp.SetEndBlocker(getEndBlocker(keeper))\n\tmApp.SetInitChainer(getInitChainer(mApp, keeper, accKeeper, mKeeper.SupplyKeeper))\n\n\trequire.NoError(t, mApp.CompleteSetup(mKeeper.StoreKey, mKeeper.TkeyStoreKey))\n\treturn mApp, mKeeper\n}", "title": "" }, { "docid": "1a76175d6e856635620cab9650111a61", "score": "0.5596888", "text": "func Run(){\n\n\t// Register models.\n\torm.RegisterModel(new(model.User))\n\torm.RegisterModel(new(model.Role))\n\torm.RegisterModel(new(model.UserRole))\n\n\t// Run tests\n\tTest();\n}", "title": "" }, { "docid": "13dc20eae9079ae9c757ab60e74b1526", "score": "0.55958635", "text": "func setupUserApplication(t *testing.T, f *framework.Framework) {\n\tt.Helper()\n\tdeployUserApplication(t, f)\n\tcreatePrometheusAlertmanagerInUserNamespace(t, f)\n}", "title": "" }, { "docid": "dcf1585d7bdf4ad5c1f3adb58cc6470a", "score": "0.55941665", "text": "func TestMain(m *testing.M) {\n\tframework.MainEntry(m)\n}", "title": "" }, { "docid": "6f655ed0eac760454d1176b154e17bcc", "score": "0.558931", "text": "func TestNew_PristineDefault(t *testing.T) {\n\t_, cleanup := newApp(t, app.WithAddress(\"127.0.0.1:9000\"))\n\tdefer cleanup()\n}", "title": "" }, { "docid": "cc1876775b6ec9b460f272aec770f1ea", "score": "0.5587694", "text": "func newTestApp(replyfn func(*internal.ConnectReply), cfgFn ...ConfigOption) expectApplication {\n\tcfgFn = append(cfgFn,\n\t\tfunc(cfg *Config) {\n\t\t\t// Prevent spawning app goroutines in tests.\n\t\t\tif !cfg.ServerlessMode.Enabled {\n\t\t\t\tcfg.Enabled = false\n\t\t\t}\n\t\t},\n\t\tConfigAppName(sampleAppName),\n\t\tConfigLicense(testLicenseKey),\n\t\tConfigCodeLevelMetricsEnabled(false),\n\t)\n\n\tapp, err := NewApplication(cfgFn...)\n\tif nil != err {\n\t\tpanic(err)\n\t}\n\n\tinternal.HarvestTesting(app.Private, replyfn)\n\n\treturn expectApplication{\n\t\tExpect: app.Private.(internal.Expect),\n\t\tApplication: app,\n\t}\n}", "title": "" }, { "docid": "15b284cda014a78ef1d9219a64e3538a", "score": "0.55766", "text": "func (a *BaseApplication) Run() error {\n\tlog.Warn(\"application is not implemented!\")\n\treturn nil\n}", "title": "" }, { "docid": "ed30a2548a3a40da2af0e5658a3a03fe", "score": "0.5572076", "text": "func TestMain(m *testing.M) {\n\ttestEnv.Init()\n\tapp := initServer()\n\tgo app.Run(iris.Addr(\":8080\"), iris.WithOptimizations)\n\n\ttime.Sleep(time.Second)\n\n\texitVal := m.Run()\n\n\tos.Exit(exitVal)\n}", "title": "" }, { "docid": "1cbf2bc5375ebfe295a80f1f795fb52d", "score": "0.5570611", "text": "func TestMain(m *testing.M) {\n\tpageCreator := NewPageCreator()\n\tpageCreator.CreateSimpleHomepage(\"emily@example.com\", \"Homepage.html\")\n}", "title": "" }, { "docid": "df5701c7d6f073fe87bd2fb26efa84db", "score": "0.55668604", "text": "func (this Application) Home() {\n\tthis.Render(\"spec/views/application.html\")\n}", "title": "" }, { "docid": "1c3c791862d2eebf3c55d8e869a74569", "score": "0.5565057", "text": "func setupApp(t *testing.T) *App {\n\ttmpfile, err := ioutil.TempFile(\"\", \"grit_test_db\")\n\tif err != nil {\n\t\tt.Fatalf(\"couldn't create temp file: %v\", err)\n\t}\n\ttmpfile.Close() // We only want the name.\n\td, err := db.New(tmpfile.Name())\n\tif err != nil {\n\t\tt.Fatalf(\"couldn't create db: %v\", err)\n\t}\n\treturn &App{Database: d}\n}", "title": "" }, { "docid": "9e6568ef5cb7659ab9ce5b995f1af2dd", "score": "0.55560356", "text": "func main() {\n\t// For testing purposes only TLS certificate verification is disabled\n\thttp.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true}\n\n\tapp := iris.New()\n\n\t// Register html templates for views\n\tapp.RegisterView(iris.HTML(\"./templates\", \".html\"))\n\n\t// Register routes\n\tapp.Get(\"/\", getIndex)\n\tapp.Get(\"/consent\", getConsent)\n\tapp.Post(\"/consent\", postConsent)\n\tapp.Get(\"/login\", getLogin)\n\tapp.Post(\"/login\", postLogin)\n\tapp.Get(\"/logout\", getLogout)\n\n\t// Now listening on: http://localhost:8080\n\t// Application started. Press CTRL+C to shut down.\n\tapp.Run(iris.Addr(\"localhost:8080\"))\n}", "title": "" }, { "docid": "7aa56121519a5eef2dd6a7292577db1c", "score": "0.5551215", "text": "func testGateApplicationList() *httptest.Server {\n\tmux := util.TestGateMuxWithVersionHandler()\n\tmux.Handle(\"/applications\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Header().Add(\"content-type\", \"application/json\")\n\t\tfmt.Fprintln(w, strings.TrimSpace(applicationListJson))\n\t}))\n\n\treturn httptest.NewServer(mux)\n}", "title": "" }, { "docid": "f8c982480191c67aa9a61fba3c103737", "score": "0.5543707", "text": "func getMockApp(t *testing.T, numGenAccs int) (*mock.App, Keeper, stake.Keeper, []sdk.AccAddress, []crypto.PubKey, []crypto.PrivKey) {\n\tmapp := mock.NewApp()\n\n\tstake.RegisterCodec(mapp.Cdc)\n\tRegisterCodec(mapp.Cdc)\n\n\tkeyGlobalParams := sdk.NewKVStoreKey(\"params\")\n\ttkeyGlobalParams := sdk.NewTransientStoreKey(\"transient_params\")\n\tkeyStake := sdk.NewKVStoreKey(\"stake\")\n\ttkeyStake := sdk.NewTransientStoreKey(\"transient_stake\")\n\tkeyGov := sdk.NewKVStoreKey(\"gov\")\n\n\tpk := params.NewKeeper(mapp.Cdc, keyGlobalParams, tkeyGlobalParams)\n\tck := bank.NewBaseKeeper(mapp.AccountKeeper)\n\tsk := stake.NewKeeper(mapp.Cdc, keyStake, tkeyStake, ck, pk.Subspace(stake.DefaultParamspace), stake.DefaultCodespace)\n\tkeeper := NewKeeper(mapp.Cdc, keyGov, pk, pk.Subspace(\"testgov\"), ck, sk, DefaultCodespace)\n\n\tmapp.Router().AddRoute(\"gov\", NewHandler(keeper))\n\tmapp.QueryRouter().AddRoute(\"gov\", NewQuerier(keeper))\n\n\tmapp.SetEndBlocker(getEndBlocker(keeper))\n\tmapp.SetInitChainer(getInitChainer(mapp, keeper, sk))\n\n\trequire.NoError(t, mapp.CompleteSetup(keyStake, tkeyStake, keyGov, keyGlobalParams, tkeyGlobalParams))\n\n\tgenAccs, addrs, pubKeys, privKeys := mock.CreateGenAccounts(numGenAccs, sdk.Coins{sdk.NewInt64Coin(stakeTypes.DefaultBondDenom, 42)})\n\n\tmock.SetGenesis(mapp, genAccs)\n\n\treturn mapp, keeper, sk, addrs, pubKeys, privKeys\n}", "title": "" }, { "docid": "d8cccc72909a4de100f54806be1588c6", "score": "0.5538377", "text": "func init() {\n\tgin.SetMode(gin.TestMode)\n}", "title": "" }, { "docid": "6175cd68f433f8d7d4a91ba6c76d8aec", "score": "0.5525936", "text": "func RunApp(appContext *AppContext) {\n\tlogger := appContext.Logger\n\n\tlogger.Debug(fmt.Sprintf(\"%+v\\n\", appContext.AppConfig))\n\n\tlogger.Info(\"Starting application...\")\n\n\t// Connect to Kafka\n\tlogger.Debug(\"Connecting to Kafka...\")\n\tkafkaClient := appContext.KafkaClient\n\tkafkaClient.RegisterProcessor(appContext.KafkaProcessor)\n\terr := kafkaClient.Process()\n\tif err != nil {\n\t\tlog.Panic(\"A Kafka processor was not specified: \", err)\n\t}\n\n\t// Start the HTTP service\n\tlogger.Debug(\"Starting HTTP server...\")\n\thttpServer := appContext.HTTPServer\n\thttpServer.RegisterEndpoint(\"/health\", controllers.HealthEndpoint)\n\thttpServer.Run()\n}", "title": "" }, { "docid": "38a3400144198a934dd3d03b7dde9478", "score": "0.55212295", "text": "func RunApp() {\n\trouter := routers.NewMuxRouter()\n\trouter.Get(\"/api/v1/post\", handlers.GetAllPosts)\n\trouter.Post(\"/api/v1/post\", handlers.CreatePost)\n\trouter.ListenAndServe(\":6600\")\n}", "title": "" }, { "docid": "986d9c9ef5759e10b0939c6464cdac48", "score": "0.5520729", "text": "func main() {\n\tif err := config.Load(); err != nil {\n\t\tpanic(err)\n\t}\n\n\tgxlog.CInfo(\"\\n\\n\\nstart to test dubbo\")\n\ttestNormalService()\n\n\ttestComplexService()\n}", "title": "" }, { "docid": "bf1973fb4849511eac8df9356615f463", "score": "0.5513634", "text": "func InitializeApp(\n\thttpRouter *mux.Router,\n\tgrpcServer *grpc.Server,\n\tpublisher message.Publisher,\n\tstorage string,\n\tdb *sql.DB,\n\tlogger Logger,\n\terrorHandler ErrorHandler, // nolint: interfacer\n) {\n\tendpointMiddleware := []endpoint.Middleware{\n\t\tcorrelation.Middleware(),\n\t\topencensus.TraceEndpoint(\"\", opencensus.WithSpanName(func(ctx context.Context, _ string) string {\n\t\t\tname, _ := kitxendpoint.OperationName(ctx)\n\n\t\t\treturn name\n\t\t})),\n\t\tappkitendpoint.LoggingMiddleware(logger),\n\t}\n\n\ttransportErrorHandler := kitxtransport.NewErrorHandler(errorHandler)\n\n\thttpServerOptions := []kithttp.ServerOption{\n\t\tkithttp.ServerErrorHandler(transportErrorHandler),\n\t\tkithttp.ServerErrorEncoder(kitxhttp.NewJSONProblemErrorEncoder(appkithttp.NewDefaultProblemConverter())),\n\t\tkithttp.ServerBefore(correlation.HTTPToContext(), kithttp.PopulateRequestContext),\n\t}\n\n\tgrpcServerOptions := []kitgrpc.ServerOption{\n\t\tkitgrpc.ServerErrorHandler(transportErrorHandler),\n\t\tkitgrpc.ServerBefore(correlation.GRPCToContext()),\n\t}\n\n\t{\n\t\teventBus, _ := cqrs.NewEventBus(\n\t\t\tpublisher,\n\t\t\tfunc(eventName string) string { return todoTopic },\n\t\t\tcqrs.JSONMarshaler{GenerateName: cqrs.StructName},\n\t\t)\n\n\t\tvar store todo.Store = todo.NewInMemoryStore()\n\t\tif storage == \"database\" {\n\t\t\tclient := ent.NewClient(ent.Driver(entsql.OpenDB(\"mysql\", db)))\n\t\t\terr := client.Schema.Create(\n\t\t\t\tcontext.Background(),\n\t\t\t\tmigrate.WithDropIndex(true),\n\t\t\t\tmigrate.WithDropColumn(true),\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\n\t\t\tstore = todoadapter.NewEntStore(client)\n\t\t}\n\n\t\tservice := todo.NewService(ulidgen.NewGenerator(), store)\n\t\tservice = todo2.EventMiddleware(todogen.NewEventDispatcher(eventBus))(service)\n\t\tservice = tododriver2.LoggingMiddleware(logger)(service)\n\t\tservice = tododriver2.InstrumentationMiddleware()(service)\n\n\t\tendpoints := tododriver.MakeEndpoints(\n\t\t\tservice,\n\t\t\tkitxendpoint.Combine(endpointMiddleware...),\n\t\t)\n\n\t\ttododriver.RegisterHTTPHandlers(\n\t\t\tendpoints,\n\t\t\thttpRouter.PathPrefix(\"/todos\").Subrouter(),\n\t\t\tkitxhttp.ServerOptions(httpServerOptions),\n\t\t)\n\t\ttodov1.RegisterTodoListServiceServer(\n\t\t\tgrpcServer,\n\t\t\ttododriver.MakeGRPCServer(endpoints, kitxgrpc.ServerOptions(grpcServerOptions)),\n\t\t)\n\t\thttpRouter.PathPrefix(\"/graphql\").Handler(handler.NewDefaultServer(\n\t\t\ttododriver.MakeGraphQLSchema(endpoints),\n\t\t))\n\t}\n\n\tlandingdriver.RegisterHTTPHandlers(httpRouter, templates.Files())\n\thttpRouter.PathPrefix(\"/httpbin\").Handler(http.StripPrefix(\n\t\t\"/httpbin\",\n\t\thttpbin.MakeHTTPHandler(logger.WithFields(map[string]interface{}{\"module\": \"httpbin\"})),\n\t))\n}", "title": "" }, { "docid": "c368bec3e9429a18b1876e7eb4fc891a", "score": "0.55104876", "text": "func TestWebUI(t *testing.T) {\n\t// get available address\n\taddr := AvailableAddr()\n\n\t// don't use https here...\n\tOpenInBrowser(fmt.Sprintf(\"http://%qhello\", addr))\n\n\t// create simple webserver for test\n\thttp.HandleFunc(\"/hello\", helloHandler)\n\terr := http.ListenAndServe(addr, nil)\n\tif err != nil {\n\t\tpanic(\"serve error\")\n\t}\n}", "title": "" }, { "docid": "9ca4704dcead52188b7d17d20ede2ef6", "score": "0.55009174", "text": "func main() {\n\tfmt.Println(\"APPLICATION BEGIN\")\n\twebserver := new(service.Webserver)\n\tregisterConfig()\n\tregisterErrors()\n\tregisterAllApis()\n\twebserver.Start()\n}", "title": "" }, { "docid": "bf71685d2afb17d956e75fd5c8ca490f", "score": "0.54990244", "text": "func TestCheckApplication(t *testing.T) {\n\tnum := 1\n\tcheck, numdb := CheckApplication(num)\n\tif check && numdb == num {\n\t\tlog.Printf(\"TestCheckApplication Passed\")\n\t} else {\n\t\tlog.Fatal(\"TestCheckApplication Failed. Num Expected:\", num, \" Actual Num:\", numdb, \" Check:\", check)\n\t}\n}", "title": "" }, { "docid": "75f29df88dac4308466d4ae01591735e", "score": "0.5497516", "text": "func NewApplication(t testing.TB) *Application {\n\tmock := &Application{}\n\n\tt.Cleanup(func() { mock.AssertExpectations(t) })\n\n\treturn mock\n}", "title": "" }, { "docid": "f70e21e7911885dbb2d67ff1a89ef631", "score": "0.5492882", "text": "func init() {\n\tif os.Getenv(\"IN_TEST\") != \"\" {\n\t\tmain()\n\t\tos.Exit(0)\n\t}\n}", "title": "" }, { "docid": "25f69d81078dc67d0efe6cef88af5a28", "score": "0.5490311", "text": "func TestHandlers_State(t *testing.T) {\n\th := NewHandlers(apiMgr)\n\th.manager = mockApiManager.MockApiManager{}\n\trr := requestFixture(h.Application, \"GET\", \"/app?name=test\", nil)\n\tif rr.Code != http.StatusOK {\n\t\tt.Fatalf(\"Wrong status code: want %d but got %d\", http.StatusOK, rr.Code)\n\t}\n}", "title": "" }, { "docid": "b01f57c2a7588398bd27ae54ebfab164", "score": "0.54883265", "text": "func TestBeego(t *testing.T) {\n\tr, _ := http.NewRequest(\"GET\", \"/\", nil)\n\tw := httptest.NewRecorder()\n\tbeego.BeeApp.Handlers.ServeHTTP(w, r)\n\n\tbeego.Trace(\"testing\", \"TestBeego\", \"Code[%d]\\n%s\", w.Code, w.Body.String())\n\n\tConvey(\"Subject: Test Station Endpoint\\n\", t, func() {\n\t Convey(\"Status Code Should Be 200\", func() {\n\t So(w.Code, ShouldEqual, 200)\n\t })\n\t Convey(\"The Result Should Not Be Empty\", func() {\n\t So(w.Body.Len(), ShouldBeGreaterThan, 0)\n\t })\n\t})\n}", "title": "" }, { "docid": "45c94e6c6c1044d63a214d4bdbc6730e", "score": "0.5485259", "text": "func TestApp_Integration(t *testing.T) {\n\n\tif testing.Short() {\n\t\tt.Skip(\"Skipping this for Unit Tests\")\n\t}\n\n\tdbClient, cacheClient, err := setupDatabaseAndCache()\n\tif dbClient != nil && cacheClient != nil {\n\t\tdefer cacheClient.Close()\n\t\tdefer dbClient.Disconnect(context.TODO())\n\t} else {\n\t\tif err != nil {\n\t\t\tt.Fatal(\"Database connectivity issues: \", err.Error())\n\t\t} else {\n\t\t\tt.Fatal(\"Cache connectivity issues.\")\n\t\t}\n\t}\n\n\tstore := datastore.NewMongo(dbClient, cacheClient)\n\n\t// creating an application object with a new Router and a Server\n\tapp := application.NewApp(store)\n\n\t// Creating buffer to store the log outputs\n\tvar buf bytes.Buffer\n\tlog.SetOutput(&buf)\n\tdefer func() {\n\t\tlog.SetOutput(os.Stderr)\n\t}()\n\n\tfor _, tc := range []struct {\n\t\tname string\n\t\tgetUrl string\n\t\texpected string\n\t\texpErr string\n\t\tcacheLog string\n\t}{\n\t\t{\n\t\t\tname: \"Valid Url\",\n\t\t\tgetUrl: \"/urlinfo/1/www.compdata.ca/catalog\",\n\t\t\texpected: `{\"RequestId\":\"1\",\"Url\":\"http://www.compdata.ca/catalog\",\"Risk\":\"High\",\"Category\":\"Malware\"}` + \"\\n\",\n\t\t},\n\t\t{\n\t\t\tname: \"Valid Url - Running again to fetch from cache\",\n\t\t\tgetUrl: \"/urlinfo/1/www.compdata.ca/catalog\",\n\t\t\texpected: `{\"RequestId\":\"1\",\"Url\":\"http://www.compdata.ca/catalog\",\"Risk\":\"High\",\"Category\":\"Malware\"}` + \"\\n\",\n\t\t\tcacheLog: \"Returning Cached Results.\",\n\t\t},\n\t\t{\n\t\t\tname: \"Valid Url - Unknown link\",\n\t\t\tgetUrl: \"/urlinfo/1/google.co.uk/catalog\",\n\t\t\texpected: `{\"RequestId\":\"1\",\"Url\":\"http://google.co.uk/catalog\",\"Risk\":\"Unknown\",\"Category\":\"Unknown\"}` + \"\\n\",\n\t\t},\n\t\t{\n\t\t\tname: \"Valid Url with query paramters\",\n\t\t\tgetUrl: \"/urlinfo/1/hybrid-analysis.com/sample?scheme=https\",\n\t\t\texpected: `{\"RequestId\":\"1\",\"Url\":\"https://hybrid-analysis.com/sample\",\"Risk\":\"High\",\"Category\":\"Malware\"}` + \"\\n\",\n\t\t},\n\t\t{\n\t\t\tname: \"Valid Url with encoded path\",\n\t\t\tgetUrl: \"/urlinfo/1/media0.mypage.cz/files%2Fdc5.exe\",\n\t\t\texpected: `{\"RequestId\":\"1\",\"Url\":\"http://media0.mypage.cz/files/dc5.exe\",\"Risk\":\"High\",\"Category\":\"Malware\"}` + \"\\n\",\n\t\t},\n\t\t{\n\t\t\tname: \"Invalid Url - invalid hostname\",\n\t\t\tgetUrl: \"/urlinfo/1/www.make\\\\invalid.compdata.ca/catalog\",\n\t\t\texpErr: \"{\\\"error\\\":\\\"Invalid URL\\\"}\\n\",\n\t\t},\n\t} {\n\t\ttc := tc\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\t// Create a request 'r' to test our server and 'w' to capture the response\n\t\t\tr, _ := http.NewRequest(\"GET\", tc.getUrl, nil)\n\t\t\tw := httptest.NewRecorder()\n\n\t\t\t// Starting the server and deferring the graceful shut down\n\t\t\tapp.Router.ServeHTTP(w, r)\n\t\t\tdefer app.Server.Shutdown(context.TODO())\n\n\t\t\tif tc.expErr != \"\" {\n\t\t\t\trequire.Equal(t, tc.expErr, w.Body.String())\n\t\t\t} else {\n\t\t\t\tif w.Code != http.StatusOK {\n\t\t\t\t\tt.Errorf(\"handler returned wrong status code: got %v want %v\", w.Code, http.StatusOK)\n\t\t\t\t}\n\n\t\t\t\tif got := w.Body.String(); got != tc.expected {\n\t\t\t\t\tt.Errorf(\"handler returned unexpected body: got %v want %v\", got, tc.expected)\n\t\t\t\t}\n\n\t\t\t\tif tc.cacheLog != \"\" {\n\t\t\t\t\trequire.Contains(t, buf.String(), tc.cacheLog)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n}", "title": "" }, { "docid": "a167a79e0ecdd84a1edcd570feefb020", "score": "0.54706746", "text": "func TestConfigureStandardWaveform5(){\n\n}", "title": "" }, { "docid": "922d7d31056447d480ff65392ca59fcc", "score": "0.5466893", "text": "func testMain(m *testing.M) int {\n var dbConfig postgresdb.DBConfig\n var err error\n\n dbConfig = postgresdb.DBConfig{\n Username: envVariablesMap[\"TEST_DB_USERNAME\"],\n Password: envVariablesMap[\"TEST_DB_PASSWORD\"],\n Host: envVariablesMap[\"TEST_DB_HOST\"],\n Port: envVariablesMap[\"TEST_DB_PORT\"],\n Name: envVariablesMap[\"TEST_DB_NAME\"],\n }\n\n s, err = server.CreateServer(\"\", dbConfig)\n\n if err != nil {\n log.Printf(\"Failed to configure the server: %s\", err.Error())\n return 1\n }\n\n r = router.CreateRouter(&s)\n\n return m.Run()\n}", "title": "" }, { "docid": "e6d6327e9d92bdc60c8b57f6929a6685", "score": "0.54613554", "text": "func (*TenantTestingKnobs) ModuleTestingKnobs() {}", "title": "" }, { "docid": "24a2e3d6d549c02aceefd338ee742d81", "score": "0.546012", "text": "func (app *App) Run() error{\n\tfmt.Println(\"Setting up Our App\")\n\n\t//Defining database connection\n\tvar err error \n\tdb, err := database.NewDatabase()\n\tif err != nil{\n\t\tfmt.Println(\"database error\")\n\t\treturn err\n\t}\n\t//Running migrations for database\n\terr = database.MigrateDB(db)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t//Ode se kreira new service na razini servera\n\tcommentService := comment.NewService(db)\n\n\t//Novo kreirani service se stavlja u new handlera na razini servera\n\t//Defining server\n\thandler := transportHTTP.NewHandler(commentService)\n\thandler.SetupRoutes()\n\n\n\t\n\tif err := http.ListenAndServe(\":8080\", handler.Router); err != nil{\n\t\tfmt.Println(\"Failed to set up server\")\n\t\treturn err \n\t}\n\t\n\treturn nil\n\n}", "title": "" }, { "docid": "be24533f601da86c261f4969845a4dca", "score": "0.54521173", "text": "func main() {\n\n\t// Create a new application\n\tapplication := config.NewApplication()\n\n\t// Start the application\n\tapplication.Start()\n}", "title": "" }, { "docid": "dd93781117f944656e1e107c1d993965", "score": "0.54418546", "text": "func (a *Application) Run() {\n\n\n\ta.httpServer.Start()\n}", "title": "" }, { "docid": "bd563488a47e9a30aa761324fb0d451e", "score": "0.5432748", "text": "func SetupTestingRoutes(app *fiber.App) {\n\n\n\tapp.Get(\"/editor\", testing_handler.EditorHandler)\n\t\n}", "title": "" }, { "docid": "553427787789ffd141df92a1a958dac9", "score": "0.54279804", "text": "func (a *App) Run() {\n\ta.RegisterRoutes()\n\ta.RegisterMiddlewares()\n\ta.Echo.Start(fmt.Sprintf(\"%s:%d\", a.Host, a.Port))\n}", "title": "" }, { "docid": "8bf472e0b143efc8206984914ab3dd9f", "score": "0.54261446", "text": "func TestMain(m *testing.M) {\n\tempiretest.Run(m)\n}", "title": "" }, { "docid": "8bf472e0b143efc8206984914ab3dd9f", "score": "0.54261446", "text": "func TestMain(m *testing.M) {\n\tempiretest.Run(m)\n}", "title": "" }, { "docid": "3afaec44bdbf676826d18eb34267d0ce", "score": "0.5424931", "text": "func TestConfigureStandardWaveform2(){\n\n}", "title": "" }, { "docid": "aff213709c272985cb24718fede58f5b", "score": "0.54244435", "text": "func TestStartNoApp(t *testing.T) {\n\tblobstoreClient := new(blobstoremocks.BlobStore)\n\tapp := AppImplementation{BlobStore: blobstoreClient}\n\n\tblobstoreClient.On(\"Get\", \"foo/app.tgz\").Return(nil, errors.New(\"Doesn't exist\"))\n\tblobstoreClient.On(\"IsNotExist\", errors.New(\"Doesn't exist\")).Return(true)\n\n\terr := app.StartRun(\"foo\", \"image\", protocol.StartRunOptions{})\n\tassert.True(t, errors.Is(err, ErrAppNotAvailable))\n\n\tblobstoreClient.AssertExpectations(t)\n}", "title": "" }, { "docid": "c3320d75f9ed44e09ecd43f20363e127", "score": "0.541918", "text": "func TestMain(m *testing.M) {\n\n\t// We need to run init config before any of the server tests\n\tconfig.InitConfig()\n\tos.Setenv(\"METRICS_USERNAME\", \"foo\")\n\tos.Setenv(\"METRICS_PASSWORD\", \"bar\")\n\tos.Exit(m.Run())\n}", "title": "" }, { "docid": "eab13b4c67df609796918475625348ba", "score": "0.54141897", "text": "func main() {\n\tfmt.Println(\"APPLICATION BEGIN\")\n\twebserver := new(service.Webserver)\n\tregisterConfig()\n\tregisterErrors()\n\tregisterBuckets()\n\tregisterAllApis()\n\twebserver.Start()\n}", "title": "" }, { "docid": "fb4ff9c8ca8b0e5d6b8af8505478e634", "score": "0.541236", "text": "func TestMain(m *testing.M) {\n\tmockstorer.ReplaceTimeNow(now)\n\tcode := m.Run()\n\tmockstorer.ReplaceTimeNow(time.Now)\n\tos.Exit(code)\n}", "title": "" }, { "docid": "af3ea18a2befaead3c6f770171ec5f8f", "score": "0.540442", "text": "func CreateATestApp() (*app.App, http.Handler, *entities.Event) {\n\t// Initialize the app\n\tjeparticipe := app.NewApp(\"test.db\")\n\n\t// Initialize the API endpoint\n\trestapi := jeparticipe.BuildApi(app.TestMode, \"\")\n\thandler := restapi.MakeHandler()\n\n\t// Create a new event\n\tevent, _ := entities.NewPendingConfirmationEvent(\"testevent\", \"ip\", \"test@test.com\")\n\tjeparticipe.EventService.ConfirmAndSaveEvent(event)\n\n\treturn jeparticipe, handler, event\n}", "title": "" }, { "docid": "78be0a9dd233defe1ec924cf6fea5191", "score": "0.5404183", "text": "func setup() {\n\t// test server\n\tmux = http.NewServeMux()\n\tserver = httptest.NewServer(mux)\n\n\t// infoblox client configured to use test server\n\tclient = NewClient(nil)\n\turl, _ := url.Parse(server.URL)\n\tclient.BaseURL = url\n}", "title": "" }, { "docid": "9acb2709fc9bd23edfe639bb97ac45ef", "score": "0.54038996", "text": "func (app *Application) Run(runner IrisRunner, conf IrisConfiguration) {\n\tlogLevel := \"debug\"\n\tif level, ok := conf.Other[\"logger_level\"]; ok {\n\t\tlogLevel = level.(string)\n\t}\n\tglobalApp.IrisApp.Logger().SetLevel(logLevel)\n\n\tapp.addMiddlewares(conf)\n\tapp.installDB()\n\tapp.other.booting()\n\tfor index := 0; index < len(prepares); index++ {\n\t\tprepares[index](app)\n\t}\n\n\trepositoryAPIRun(conf)\n\tapp.subEventManager.building()\n\n\tapp.comPool.singleBooting(app)\n\tfor i := 0; i < len(bootManagers); i++ {\n\t\tbootManagers[i](app)\n\t}\n\n\tshutdownSecond := 2\n\tif level, ok := conf.Other[\"shutdown_second\"]; ok {\n\t\ti, err := strconv.Atoi(fmt.Sprint(level))\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tshutdownSecond = i\n\t}\n\tapp.shutdown(shutdownSecond)\n\tapp.Iris().Run(runner, iris.WithConfiguration(conf))\n}", "title": "" }, { "docid": "f37857640dc9a06c039d816bbe086ae4", "score": "0.5400981", "text": "func Tests() error {\n\tmg.Deps(InstallDeps, InstallPlaywright, BuildExampleViewer)\n\n\tfmt.Println(\"Starting example viewer in the background\")\n\n\t// Run the example viewer in the background\n\tvar errOutput bytes.Buffer\n\tcmd := exec.Command(\"go\", \"run\", \"./example/.exampleSwitcher/serve.go\")\n\tcmd.Stdout = os.Stdout\n\tcmd.Stderr = &errOutput\n\terr := cmd.Start()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to run build command %s, %s. Error was %w\", cmd.String(), errOutput.String(), err)\n\t}\n\n\tgo func() {\n\t\terr = cmd.Wait()\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"Command finished with error: %v\", err)\n\t\t}\n\t}()\n\n\tresult, err := sh.Output(\"go\", \"test\", \"./endToEnd\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to run test command, %s. Error was %w\", result, err)\n\t}\n\n\terr = cmd.Process.Kill()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to run kill server. Error was %w\", err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "f774539cc348cee0108e091ebae3b4a8", "score": "0.54008836", "text": "func TestMain(m *testing.M) {\n\tgo createWebserver()\n\n\tsleep()\n\n\tcode := m.Run()\n\n\tos.Exit(code)\n}", "title": "" }, { "docid": "02171eec851555b28a36bc82ebff248d", "score": "0.53810215", "text": "func TestConfigureStandardWaveform6(){\n\n}", "title": "" }, { "docid": "271701c91f3ddc631e8cacf4b68fc2a7", "score": "0.5376596", "text": "func TestMain(m *testing.M) {\n\tserver = httptest.NewServer(handlers())\n\tdb = initDb()\n\tSetUpDatabase(db)\n\n\tres := m.Run()\n\n\tTearDownDatabase(db)\n\n\tos.Exit(res)\n}", "title": "" }, { "docid": "721b8e368028a0da4388a41999db2143", "score": "0.53710115", "text": "func TestMain(m *testing.M) {\n var exitVal int\n\n // Before the tests.\n utils.InitializeRandomization()\n\n exitVal = testMain(m)\n\n // After the tests.\n defer s.Datastore.Close()\n\n os.Exit(exitVal)\n}", "title": "" }, { "docid": "635e6cb2174570a5c324bebe4c5d7f20", "score": "0.53649336", "text": "func setup() {\n\t// test server\n\tmux = http.NewServeMux()\n\tserver = httptest.NewServer(mux)\n\n\t// octokat client configured to use test server\n\tclient = NewClient()\n\tclient.BaseURL = server.URL\n}", "title": "" }, { "docid": "12cd531147c76f1c9b5374f2a8e2f45b", "score": "0.536339", "text": "func (app *App) Run() error {\n\tif err := app.cache.loadInitialData(app.client); err != nil {\n\t\treturn err\n\t}\n\n\tnOperations := app.config.GetInt(\"loadtest.operations.amount\")\n\tintervalDuration := app.config.GetDuration(\"loadtest.operations.interval.duration\")\n\tgetPercent := func(cur int) int {\n\t\treturn int((100 * int64(cur)) / int64(nOperations))\n\t}\n\n\tlogger := app.logger.With(\n\t\tzap.String(\"source\", \"loadtest/app\"),\n\t\tzap.String(\"operation\", \"Run\"),\n\t\tzap.Int(\"nOperations\", nOperations),\n\t\tzap.Duration(\"intervalDuration\", intervalDuration),\n\t)\n\n\tfor i := 0; i < nOperations; i++ {\n\t\terr := app.performOperation()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif i < nOperations-1 {\n\t\t\ttime.Sleep(intervalDuration)\n\t\t}\n\n\t\tif getPercent(i+1)/10 > getPercent(i)/10 {\n\t\t\tlog.I(logger, fmt.Sprintf(\"Goroutine completed %v%%.\", getPercent(i+1)))\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "47f5f3b381bbdb84810951042adbb4c5", "score": "0.53622216", "text": "func main() {\n\tconfig.ReadAllConfig()\n\tInitializeControllers()\n\tapp.InitWebContext()\n\tInitializeRoutes()\n\tInitializeModels()\n\tapp.Run()\n}", "title": "" }, { "docid": "594314830808646095f725e2e088bcd1", "score": "0.5361345", "text": "func TestConfigureStandardWaveform3(){\n\n}", "title": "" }, { "docid": "91415b5e7b3f8b8344a7fae4c049b248", "score": "0.5360529", "text": "func main() {\n\tdefer t.Begin()()\n\n\tgo runSmokeTest()\n\tstartWebserver()\n}", "title": "" }, { "docid": "e99fb87b4d4196084a4bde220762316e", "score": "0.53596383", "text": "func TestConfigureStandardWaveform1(){\n\n}", "title": "" }, { "docid": "bfd8c3e5a1520b261a59e3778a6a8446", "score": "0.53566027", "text": "func Test(w http.ResponseWriter, r *http.Request) {\n\tfmt.Fprintf(w, \"API Running\")\n}", "title": "" }, { "docid": "ca79c98797ab6457c58a51b5661b257e", "score": "0.5350521", "text": "func RevelTestHelper(m *testing.M, mode string, runner func(port int)) {\n\tflag.Parse()\n\t// call flag.Parse() here if TestMain uses flags\n\tlocker := sync.Mutex{}\n\trevel.AddInitEventHandler(func(event revel.Event, value interface{}) (returnType revel.EventResponse) {\n\t\tif event == revel.REVEL_BEFORE_MODULES_LOADED {\n\t\t\trevel.Config.SetOption(\"server.engine\", \"go-test\")\n\t\t\trevel.Config.SetOption(\"module.go-test\", \"github.com/revel/modules/server-engine/gohttptest\")\n\n\t\t} else if event == revel.ENGINE_STARTED {\n\t\t\tgo func() {\n\t\t\t\t// Wait for the server to send back a start response\n\t\t\t\t<-revel.CurrentEngine.(*GoHttpServer).StartedChan\n\t\t\t\tlocker.Unlock()\n\t\t\t}()\n\t\t} else if event == revel.REVEL_FAILURE {\n\t\t\tlocker.Unlock()\n\t\t}\n\n\t\treturn 0\n\t})\n\n\tlocker.Lock()\n\n\trevel.RevelLog.Info(\"Initializing the engine\")\n\t// go test -coverprofile=coverage.out github.com/revel/examples/booking/app/controllers/ -args -revel.importPath=github.com/revel/examples/booking\n\tif len(*importPath)==0 {\n\t\t// TODO add possible detection of import path from executable\n\t\tfor x:=0;x<len(os.Args);x++ {\n\t\t\tprintln(\"App path \", os.Args[x])\n\t\t}\n\t\tserverLog.Fatal(\"No import path specified, aborting. Start test by using -args -revel.importPath=<your app import path>\")\n\t}\n\n\t// Initialize revel, using the test server engine regardless of what is specified in the config.\n\trevel.Init(mode, *importPath, \"\")\n\tgo func() {\n\t\trunner(-1)\n\t}()\n\tlocker.Lock()\n\n\tos.Exit(m.Run())\n}", "title": "" }, { "docid": "326f66a847ab3da9745fac8de1c765a2", "score": "0.53452915", "text": "func Test_main(t *testing.T) {\n\tr := NewUR(\"localhost\", \"30002\")\n\tr.Run()\n}", "title": "" }, { "docid": "e5e4a8608aaa9356ef141e8f7cf871f0", "score": "0.53446406", "text": "func getMockApp(t *testing.T) (*mock.App, staking.Keeper, Keeper) {\n\tmapp := mock.NewApp()\n\n\tRegisterCodec(mapp.Cdc)\n\tstaking.RegisterCodec(mapp.Cdc)\n\tsupply.RegisterCodec(mapp.Cdc)\n\n\tkeyStaking := sdk.NewKVStoreKey(staking.StoreKey)\n\ttkeyStaking := sdk.NewTransientStoreKey(staking.TStoreKey)\n\tkeySlashing := sdk.NewKVStoreKey(StoreKey)\n\tkeySupply := sdk.NewKVStoreKey(supply.StoreKey)\n\n\tfeeCollector := supply.NewEmptyModuleAccount(auth.FeeCollectorName)\n\tnotBondedPool := supply.NewEmptyModuleAccount(types.NotBondedPoolName, supply.Burner, supply.Staking)\n\tbondPool := supply.NewEmptyModuleAccount(types.BondedPoolName, supply.Burner, supply.Staking)\n\n\tblacklistedAddrs := make(map[string]bool)\n\tblacklistedAddrs[feeCollector.String()] = true\n\tblacklistedAddrs[notBondedPool.String()] = true\n\tblacklistedAddrs[bondPool.String()] = true\n\n\tbankKeeper := bank.NewBaseKeeper(mapp.AccountKeeper, nil, mapp.ParamsKeeper.Subspace(bank.DefaultParamspace), bank.DefaultCodespace, blacklistedAddrs)\n\tmaccPerms := map[string][]string{\n\t\tauth.FeeCollectorName: nil,\n\t\tstaking.NotBondedPoolName: []string{supply.Burner, supply.Staking},\n\t\tstaking.BondedPoolName: []string{supply.Burner, supply.Staking},\n\t}\n\tsupplyKeeper := supply.NewKeeper(mapp.Cdc, keySupply, mapp.AccountKeeper, bankKeeper, maccPerms)\n\tstakingKeeper := staking.NewKeeper(mapp.Cdc, keyStaking, tkeyStaking, supplyKeeper, mapp.ParamsKeeper.Subspace(staking.DefaultParamspace), staking.DefaultCodespace)\n\tkeeper := NewKeeper(mapp.Cdc, keySlashing, stakingKeeper, mapp.ParamsKeeper.Subspace(DefaultParamspace), DefaultCodespace)\n\tmapp.Router().AddRoute(staking.RouterKey, staking.NewHandler(stakingKeeper))\n\tmapp.Router().AddRoute(RouterKey, NewHandler(keeper))\n\n\tmapp.SetEndBlocker(getEndBlocker(stakingKeeper))\n\tmapp.SetInitChainer(getInitChainer(mapp, stakingKeeper, mapp.AccountKeeper, supplyKeeper,\n\t\t[]supplyexported.ModuleAccountI{feeCollector, notBondedPool, bondPool}))\n\n\trequire.NoError(t, mapp.CompleteSetup(keyStaking, tkeyStaking, keySupply, keySlashing))\n\n\treturn mapp, stakingKeeper, keeper\n}", "title": "" } ]
c2c0f9a036c6f466ba85e2886224ca95
GroupMemberExists checks if user exists in the list of group members
[ { "docid": "9718a13b53569384445848cb82558451", "score": "0.8234881", "text": "func GroupMemberExists(members *[]models.PrincipalName, userName string, groupName string) bool {\n\tif members != nil {\n\t\tfor _, m := range *members {\n\t\t\tif len(userName) > 0 && m.UserName == userName {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif len(groupName) > 0 && m.GroupName == groupName {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}", "title": "" } ]
[ { "docid": "dc1d4360fb915bbeb4bbc4cafc70a7ab", "score": "0.79882205", "text": "func (gitlab *API) MemberExistsInGroup(userID, groupID int) (bool, error) {\n\tresp, err := gitlab.NewRequest(\n\t\t\"GET\",\n\t\t\"/groups/\"+strconv.Itoa(groupID)+\"/members\",\n\t\tnil,\n\t\thttp.StatusOK,\n\t)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tdefer resp.Body.Close()\n\n\tvar members []User\n\tif err := json.NewDecoder(resp.Body).Decode(&members); err != nil {\n\t\treturn false, err\n\t}\n\tfor _, member := range members {\n\t\tif member.ID == userID {\n\t\t\treturn true, nil\n\t\t}\n\t}\n\treturn false, nil\n}", "title": "" }, { "docid": "4a2d90ee96c551b055ca865bbbc92bbe", "score": "0.7633406", "text": "func ExistMemberByGroupId(groupId int) (res bool) {\n\tres = false\n\to := orm.NewOrm()\n\tdb := o.QueryTable(new(Member))\n\tcount,_ := db.Filter(\"AuthGroup__Id\",groupId).Count()\n\tif count > 0{\n\t\tres = true\n\t}\n\treturn res\n}", "title": "" }, { "docid": "ca01d3cb7002a0c3ae74309bf8713f62", "score": "0.7410007", "text": "func (service groupMembershipService) CheckExistGroupMembership(groupID int64, userID int64) (bool, error) {\n\tstmt := `\n\t\tMATCH (u)-[r:JOIN]->(g:Group)\n\t\tWHERE ID(u)={userID} AND ID(g)= {groupID}\n\t\tRETURN ID(r) AS id\n\t\t`\n\tparams := neoism.Props{\n\t\t\"groupID\": groupID,\n\t\t\"userID\": userID,\n\t}\n\n\tres := []struct {\n\t\tID int64 `json:\"id\"`\n\t}{}\n\tcq := neoism.CypherQuery{\n\t\tStatement: stmt,\n\t\tParameters: params,\n\t\tResult: &res,\n\t}\n\n\terr := conn.Cypher(&cq)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tif len(res) > 0 {\n\t\tif res[0].ID >= 0 {\n\t\t\treturn true, nil\n\t\t}\n\t}\n\treturn false, nil\n}", "title": "" }, { "docid": "82c54a60e4d1ef220f79072d0f9585f3", "score": "0.7277655", "text": "func userExistsInGroup(u, g string) bool {\n\tlog.Debug(\"Checking that user %s is in group %s\", u, g)\n\tluser, err := user.Lookup(u)\n\tif err != nil {\n\t\treturn false\n\t}\n\n\tlgroups, err := luser.GroupIds()\n\tif err != nil {\n\t\tlog.Errorf(\"Encountered error when retreiving groups for user %s: %s\", luser.Name, err)\n\t\treturn false\n\t}\n\n\tfor _, gid := range lgroups {\n\t\tlgroup, err := user.LookupGroupId(gid)\n\t\tif err != nil {\n\t\t\tlog.Infof(\"Encountered error when looking up group ID %s: %s\t\", gid, err)\n\t\t\tcontinue\n\t\t}\n\n\t\tif g == lgroup.Name {\n\t\t\t// Target group found, return\n\t\t\tlog.Infof(\"User %s is in group %s\", u, g)\n\t\t\treturn true\n\t\t}\n\t}\n\t// Fall through signifies failure\n\treturn false\n}", "title": "" }, { "docid": "39b2ad39c2af0c73940cb57b93b73f1f", "score": "0.7271188", "text": "func UsersInGroupExists(ctx context.Context, exec boil.ContextExecutor, iD int) (bool, error) {\n\tvar exists bool\n\tsql := \"select exists(select 1 from `users_in_groups` where `id`=? limit 1)\"\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, sql)\n\t\tfmt.Fprintln(boil.DebugWriter, iD)\n\t}\n\n\trow := exec.QueryRowContext(ctx, sql, iD)\n\n\terr := row.Scan(&exists)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"models: unable to check if users_in_groups exists\")\n\t}\n\n\treturn exists, nil\n}", "title": "" }, { "docid": "6951456d8c695d8153660e0e22ddc104", "score": "0.7071452", "text": "func groupExists(g string) bool {\n\tlog.Debug(\"Running lookup on group:\", g)\n\tif _, err := user.LookupGroup(g); err != nil {\n\t\tif _, ok := err.(user.UnknownGroupError); ok {\n\t\t\tlog.Info(\"Group does not exist: \", g)\n\t\t\treturn false\n\t\t} else {\n\t\t\tlog.Error(\"Encountered unknown error on group lookup: \", err)\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "837b229bcdbaaea01f578791499320a9", "score": "0.7020009", "text": "func (m *manager) HasMember(ctx context.Context, gid *grouppb.GroupId, uid *userpb.UserId) (bool, error) {\n\t// It might be possible to do a somewhat more clever LDAP search here. (First lookup the user and then\n\t// search for (&(objectclass=<groupoc>)(<groupid>=gid)(member=<username/userdn>)\n\t// The GetMembers call used below can be quiet ineffecient for large groups\n\tmembers, err := m.GetMembers(ctx, gid)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tfor _, u := range members {\n\t\tif u.OpaqueId == uid.OpaqueId && u.Idp == uid.Idp {\n\t\t\treturn true, nil\n\t\t}\n\t}\n\treturn false, nil\n}", "title": "" }, { "docid": "89585a1e2200ef99e95a785f777992d7", "score": "0.6955907", "text": "func GroupExists(groups []string, groupName string) bool {\n\tfor _, g := range groups {\n\t\tif g == groupName {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "43f58dfa1fe9d0ee204e48a3a9b9c18a", "score": "0.6871531", "text": "func (q usersInGroupQuery) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRowContext(ctx, exec).Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"models: failed to check if users_in_groups exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "b1a372639368e0e36ffdbe4c5c24a925", "score": "0.67828715", "text": "func (r *teamRepository) CheckMemberExists(ctx context.Context, userId, teamId string) (bool, error) {\n // select role FROM members WHERE user_id=userId AND team_id=teamId\n checkStmt := `SELECT member_role FROM members WHERE user_id=? AND team_id=?`\n // get row\n row := r.db.QueryRow(checkStmt, userId, teamId)\n var role string\n // scan fields into team\n err := row.Scan(&role)\n if err == sql.ErrNoRows {\n fmt.Fprintf(os.Stderr, \"rows checkMember exists: \\n\")\n return false, nil\n } else if err != nil {\n return false, err\n }\n\n // if row exists user is a member on team\n return true, nil\n}", "title": "" }, { "docid": "bee81ec93930720945e20839a8f87780", "score": "0.6715124", "text": "func TeamMemberExists(ctx context.Context, exec boil.ContextExecutor, iD uint) (bool, error) {\n\tvar exists bool\n\tsql := \"select exists(select 1 from `team_members` where `id`=? limit 1)\"\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, sql)\n\t\tfmt.Fprintln(boil.DebugWriter, iD)\n\t}\n\n\trow := exec.QueryRowContext(ctx, sql, iD)\n\n\terr := row.Scan(&exists)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"models: unable to check if team_members exists\")\n\t}\n\n\treturn exists, nil\n}", "title": "" }, { "docid": "147ad584b8fec512c39d1e3d5fc5a160", "score": "0.6634357", "text": "func (m NullUser) HasGroup(g ...string) bool {\n\treturn m.Active\n}", "title": "" }, { "docid": "24b6436e21c5109222107ab122477855", "score": "0.66334605", "text": "func (u User) InGroup(groupName string) bool {\n\tfor _, g := range u.Groups {\n\t\tif g == groupName {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "e4c93914a0fcfad27b917e40166b72f9", "score": "0.6625994", "text": "func (groupser *GroupService) IsGroupMember(groupID , memberID string) bool {\n\ter := groupser.GroupRepo.IsGroupMember(groupID , memberID )\n\tif er != nil {\n\t\treturn false\n\t} \n\treturn true\n}", "title": "" }, { "docid": "6fafe435927794bbeea616a180ad82fb", "score": "0.6593005", "text": "func IsMemberOfGroup(group, userName string) (bool, error) {\n\tu, err := user.Lookup(userName)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tugids, err := u.GroupIds()\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tg, err := user.LookupGroup(group)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tfor _, ugid := range ugids {\n\t\tif g.Gid == ugid {\n\t\t\treturn true, nil\n\t\t}\n\t}\n\treturn false, nil\n}", "title": "" }, { "docid": "c8755def952e215395237ff3211919c8", "score": "0.6535937", "text": "func (db *FakeDB) IsMember(ctx context.Context, id identity.Identity, groups []string) (bool, error) {\n\thits, err := db.CheckMembership(ctx, id, groups)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\treturn len(hits) > 0, nil\n}", "title": "" }, { "docid": "482b51dc6e73b9ff234990da33d39a2d", "score": "0.6514333", "text": "func (g GitlabLazyQuerier) GroupExists(group string) bool {\n\treturn g.GetGroupID(group) != -1\n}", "title": "" }, { "docid": "a3def68a3804f7115f1c650db68f4a17", "score": "0.650745", "text": "func (g *OpenOltGroupMgr) contains(members []*openoltpb2.GroupMember, member *openoltpb2.GroupMember) bool {\n\tfor _, groupMember := range members {\n\t\tif groupMember.InterfaceId == member.InterfaceId {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "4936bc61526531d431af4f9a75e453bf", "score": "0.6370933", "text": "func (gm GroupMap) checkMember(groupName, memberID string) (here bool) {\n\tsaveName := strings.ToLower(groupName)\n\n\tgroup := gm[saveName]\n\n\tif len(group.Members) == 0 {\n\t\there = false\n\t} else {\n\t\there = true\n\t}\n\n\tfor _, member := range group.Members {\n\t\tif memberID == member.GID {\n\t\t\there = true\n\t\t\tbreak\n\t\t} else {\n\t\t\there = false\n\t\t}\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "687617046b2f3d8e220256d02ed1ec48", "score": "0.6349214", "text": "func (q adminGroupQuery) Exists(exec boil.Executor) (bool, error) {\n\tvar count int64\n\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRow(exec).Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"models: failed to check if admin_group exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "a17999000456f6ad3f407419c92f83bb", "score": "0.63258934", "text": "func AdminGroupExists(exec boil.Executor, iD int) (bool, error) {\n\tvar exists bool\n\tsql := \"select exists(select 1 from \\\"admin_group\\\" where \\\"id\\\"=$1 limit 1)\"\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, sql)\n\t\tfmt.Fprintln(boil.DebugWriter, iD)\n\t}\n\n\trow := exec.QueryRow(sql, iD)\n\n\terr := row.Scan(&exists)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"models: unable to check if admin_group exists\")\n\t}\n\n\treturn exists, nil\n}", "title": "" }, { "docid": "64037f13ba2b5b10d50cbf9564e0e3bd", "score": "0.6311028", "text": "func (q teamMemberQuery) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRowContext(ctx, exec).Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"models: failed to check if team_members exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "6f064faa15ab6bfe71fadb2ef7dea307", "score": "0.6278782", "text": "func (g *Group) Exists() bool {\n\treturn g._exists\n}", "title": "" }, { "docid": "50f1d5b3e6123d4d061bd56a5d8b21ed", "score": "0.6266139", "text": "func (m *Member) Exists() bool {\n\treturn m._exists\n}", "title": "" }, { "docid": "ee541d477abda0d32e7da0f239a81a47", "score": "0.6263418", "text": "func (gs *GoogleAdminService) CheckMemberships(groups []string, email string) ([]string, error) {\n\tlogger := log.NewLogEntry()\n\n\ttags := []string{\n\t\t\"provider:google\",\n\t\t\"action:check_memberships_resource\",\n\t}\n\tinGroups := []string{}\n\n\tfor _, group := range groups {\n\t\tstartTS := time.Now()\n\n\t\t// This call includes nested groups so no recursive resolving is required\n\t\treq := gs.adminService.Members.HasMember(group, email)\n\t\tgs.StatsdClient.Incr(\"provider.request\", tags, 1.0)\n\n\t\tresp, err := gs.cb.Call(func() (interface{}, error) {\n\t\t\treturn req.Do()\n\t\t})\n\t\tif err != nil {\n\t\t\tswitch e := err.(type) {\n\t\t\tcase *googleapi.Error:\n\t\t\t\ttags = append(tags, fmt.Sprintf(\"status_code:%d\", e.Code))\n\t\t\t\tgs.StatsdClient.Incr(\"provider.response\", tags, 1.0)\n\t\t\t\tgs.StatsdClient.Incr(\"provider.error\", tags, 1.0)\n\t\t\t\tswitch e.Code {\n\t\t\t\tcase 400:\n\t\t\t\t\tif e.Error() == \"Token expired or revoked\" {\n\t\t\t\t\t\terr = ErrTokenRevoked\n\t\t\t\t\t}\n\t\t\t\t\terr = ErrBadRequest\n\t\t\t\tcase 404:\n\t\t\t\t\tlogger.WithUserGroup(group).Warn(\"could not check memberships, user group not found\")\n\t\t\t\t\tcontinue\n\t\t\t\tcase 429:\n\t\t\t\t\terr = ErrRateLimitExceeded\n\t\t\t\tcase 503:\n\t\t\t\t\terr = ErrServiceUnavailable\n\t\t\t\t}\n\t\t\tcase *circuit.ErrOpenState:\n\t\t\t\ttags = append(tags, \"circuit:open\")\n\t\t\t\tgs.StatsdClient.Incr(\"provider.error\", tags, 1.0)\n\t\t\tdefault:\n\t\t\t\ttags = append(tags, \"error:invalid_response\")\n\t\t\t\tgs.StatsdClient.Incr(\"provider.internal_error\", tags, 1.0)\n\t\t\t}\n\t\t\treturn nil, err\n\t\t}\n\n\t\tr := resp.(*admin.MembersHasMember)\n\n\t\ttags = append(tags, fmt.Sprintf(\"status_code:%d\", r.HTTPStatusCode))\n\t\tgs.StatsdClient.Timing(\"provider.latency\", time.Now().Sub(startTS), tags, 1.0)\n\t\tgs.StatsdClient.Incr(\"provider.response\", tags, 1.0)\n\n\t\tif r.IsMember {\n\t\t\tinGroups = append(inGroups, group)\n\t\t}\n\t}\n\n\treturn inGroups, nil\n}", "title": "" }, { "docid": "104872b5b870082a1a6d51ca54a2479f", "score": "0.62524897", "text": "func mustMembersExist(c client.KeystoneClient, memberIDs []string) {\n\tr, err := c.Users().CheckUsersExist(memberIDs)\n\tif err != nil {\n\t\t// The HTTP request must have failed\n\t\texit(kserrors.UnkownError(err))\n\t}\n\n\tif r.Error != \"\" {\n\t\texit(kserrors.UsersDontExist(r.Error, nil))\n\t}\n}", "title": "" }, { "docid": "b407e22730fc758137c58c99121e3d87", "score": "0.61515677", "text": "func hasGroup(group string, discovery discovery.DiscoveryInterface) (bool, error) {\n\tif discovery != nil {\n\t\tgroups, err := discovery.ServerGroups()\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\tfor _, g := range groups.Groups {\n\t\t\tif strings.Contains(g.Name, group) {\n\t\t\t\treturn true, nil\n\t\t\t}\n\t\t}\n\t}\n\treturn false, nil\n}", "title": "" }, { "docid": "be48f71dd0c7fc7f9a7abd73a35775be", "score": "0.61432374", "text": "func (el EntityManager) isGroupInList(name string) bool {\n\t_, exist := el.Groups[name]\n\treturn exist\n}", "title": "" }, { "docid": "8f4e3000d46cb1c8624e7940bc28621c", "score": "0.6121447", "text": "func (e *LDAPInterface) Exists(ldapGroupUID string) (bool, error) {\n\treturn groupdetector.NewGroupBasedDetector(e).Exists(ldapGroupUID)\n}", "title": "" }, { "docid": "2e12ae7116afa134703e159f77411736", "score": "0.611271", "text": "func HasAccessToGroup(uid uint, groupUUID string, db *gorm.DB) bool {\n\tvar permissions []table.Permission\n\tdb.Where(\"user_id = ?\", uid).Find(&permissions)\n\tfor _, p := range permissions {\n\t\tif p.Role == SuperAdmin {\n\t\t\t// SuperAdmin\n\t\t\treturn true\n\t\t} else if p.Role == GroupAdmin && p.Metadata == groupUUID {\n\t\t\t// GroupAdmin\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "ae0c4ce6ef131f5921140c47cf1414dc", "score": "0.6056948", "text": "func (n *NameService) ExistsKeygroup(kg fred.KeygroupName) (bool, error) {\n\n}", "title": "" }, { "docid": "0c6efad150d5ecae6650d5859d45cd5a", "score": "0.6024425", "text": "func (g *Github) isMember(user string) (bool, error) {\n\tctx, cancel := context.WithTimeout(context.Background(), timeoutShortRequest)\n\tdefer cancel()\n\n\tret, _, err := g.client.Organizations.IsMember(ctx, g.owner, user)\n\n\treturn ret, err\n}", "title": "" }, { "docid": "6d17162020cbf82fe85210c036d80d69", "score": "0.6009233", "text": "func GroupExist(groupname string) (bool, error) {\n\terr := RunCommand(\"getent\", []string{\"group\", groupname})\n\tif err != nil {\n\t\tif exitError, ok := err.(*ExitError); ok {\n\t\t\tif exitError.ExitCode == 2 {\n\t\t\t\treturn false, nil\n\t\t\t}\n\t\t}\n\t\treturn false, err\n\t}\n\n\treturn true, nil\n}", "title": "" }, { "docid": "8fad6098d2fc5162320cee4814ab0e7f", "score": "0.6002978", "text": "func IsGroupnameExists(groupname string) bool {\n\t_, err := FindByName(groupname)\n\tif err != nil {\n\t\treturn false // groupname does not exist\n\t}\n\treturn true // groupname exists\n}", "title": "" }, { "docid": "b0990fe3bf5f98ada24ffc6cfa2691c5", "score": "0.5991369", "text": "func (groupser *GroupService) DoesGroupExist(groupID string ) bool {\n\ter := groupser.GroupRepo.DoesGroupExist(groupID )\n\tif er != nil {\n\t\treturn false \n\t} \n\treturn true \n}", "title": "" }, { "docid": "95a2db11b9d4751f400db477e6d2e846", "score": "0.5969967", "text": "func (m *OrgContactItemRequestBuilder) CheckMemberGroups()(*id7379fe1d66c0786481cb810e571e9cf8ca3a1db19fb8596ae3ab26b168ebd4b.CheckMemberGroupsRequestBuilder) {\n return id7379fe1d66c0786481cb810e571e9cf8ca3a1db19fb8596ae3ab26b168ebd4b.NewCheckMemberGroupsRequestBuilderInternal(m.pathParameters, m.requestAdapter);\n}", "title": "" }, { "docid": "0a071694881e07f46be343bc7b800d3c", "score": "0.5964881", "text": "func (g *Group) Exists(e *GroupExpr) bool {\n\t_, ok := g.fingerprints[e.FingerPrint()]\n\treturn ok\n}", "title": "" }, { "docid": "74f7ef49333c6a059ce2e367cf08ba24", "score": "0.5936205", "text": "func (m *DeviceRequestBuilder) CheckMemberGroups()(*iefab76780545f99656b80edfaf54c2eec044f7828fdbcbad9c50e9c9067d0cd3.CheckMemberGroupsRequestBuilder) {\n return iefab76780545f99656b80edfaf54c2eec044f7828fdbcbad9c50e9c9067d0cd3.NewCheckMemberGroupsRequestBuilderInternal(m.pathParameters, m.requestAdapter);\n}", "title": "" }, { "docid": "d09d0fc4ac3fa9a7449ec870854a5ec1", "score": "0.59335166", "text": "func (db *Database) HasGroup(groupID string) bool {\n\tfor _, group := range db.Groups {\n\t\tif group.Name == groupID {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "0f56458a709e918dec54345cb6d77c69", "score": "0.59223366", "text": "func (q authGroupPermissionQuery) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRowContext(ctx, exec).Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"models: failed to check if auth_group_permissions exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "9b57fdb127192e297840bb5c607fd2b6", "score": "0.5870746", "text": "func (u User) InAnyGroup(groupNames []string) bool {\n\tfor _, groupName := range groupNames {\n\t\tif u.InGroup(groupName) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "feec43cabf2e908ea7a48cace28f6d7a", "score": "0.58688843", "text": "func (el *EntityManager) IsUserPartOfAGroup(groupName string, userName string) bool {\n\tg, err := el.getGroupAddUserToGroup(groupName)\n\tif err != nil {\n\t\treturn false\n\t}\n\treturn g.isUserInGroup(userName)\n}", "title": "" }, { "docid": "320483ebff3c1d27f2f03dbfe4319fd3", "score": "0.58672893", "text": "func (db *FakeDB) CheckMembership(ctx context.Context, id identity.Identity, groups []string) (out []string, err error) {\n\tdb.m.RLock()\n\tdefer db.m.RUnlock()\n\n\tif db.err != nil {\n\t\treturn nil, db.err\n\t}\n\n\tif mocked := db.perID[id]; mocked != nil {\n\t\tfor _, group := range groups {\n\t\t\tif mocked.groups.Has(group) {\n\t\t\t\tout = append(out, group)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "aa51ffc05aa35fa526d66bf68320ea96", "score": "0.58389205", "text": "func (u *Users) Exists(id string) bool {\n\tu.RLock()\n\t_, ok := u.m[id]\n\tu.RUnlock()\n\treturn ok\n}", "title": "" }, { "docid": "265258677bc0c9a4ed8ede892fb4a9b1", "score": "0.5831986", "text": "func (ot *OrgUtils) IsMember(org, user string) (bool, *github.Response, error) {\n\n\tfeh, resp, err := ot.client.Organizations.IsMember(org, user)\n\tif err != nil {\n\t\treturn false, resp, err\n\t}\n\n\treturn feh, resp, nil\n}", "title": "" }, { "docid": "35aa5188bb0d92349012ff6f99ff19d1", "score": "0.58316845", "text": "func checkGroupExists(groupName string) (*GroupObject, error) {\n\tvar group *GroupObject\n\tgetAllGroupResp, err := apiOperation(\"GET\", papertrailApiGroupsEndpoint, nil)\n\tif err != nil {\n\t\treturn group, err\n\t}\n\tif getAllGroupResp.StatusCode == 200 {\n\t\tvar groups []GroupObject\n\t\tjson.Unmarshal([]byte(getAllGroupResp.Body), &groups)\n\t\tfor _, item := range groups {\n\t\t\tif item.Name == groupName {\n\t\t\t\tgroup = NewGroupObject(item.ID, item.Name, item.SystemWildcard, item.Links, item.Systems)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn group, nil\n}", "title": "" }, { "docid": "47640525cffcde638c01f6e18cd84974", "score": "0.58087796", "text": "func AuthGroupPermissionExists(ctx context.Context, exec boil.ContextExecutor, iD int) (bool, error) {\n\tvar exists bool\n\tsql := \"select exists(select 1 from \\\"auth_group_permissions\\\" where \\\"id\\\"=$1 limit 1)\"\n\n\tif boil.IsDebug(ctx) {\n\t\twriter := boil.DebugWriterFrom(ctx)\n\t\tfmt.Fprintln(writer, sql)\n\t\tfmt.Fprintln(writer, iD)\n\t}\n\trow := exec.QueryRowContext(ctx, sql, iD)\n\n\terr := row.Scan(&exists)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"models: unable to check if auth_group_permissions exists\")\n\t}\n\n\treturn exists, nil\n}", "title": "" }, { "docid": "79ac783aab5cdc54374d2d621d9c061e", "score": "0.58083826", "text": "func (this *PresenceChannel) IsMember(channel string, member *types.Member) (bool, error) {\n\tmembers, err := this.GetMembers(channel)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tmembers, err = this.RemoveInactive(channel, members)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tfor _, m := range members {\n\t\tif m.UserId == member.UserId {\n\t\t\treturn true, nil\n\t\t}\n\t}\n\treturn false, err\n}", "title": "" }, { "docid": "64df3a03ffe61a0a14aef434450e6d9d", "score": "0.58056456", "text": "func containsUser(user UserInfo, regUsers []UserInfo) bool {\n\tfor _, regUser := range regUsers {\n\t\tif userEquals(user, regUser) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "fb95ac39b846ad55c2a3a30f25ff97d0", "score": "0.57887363", "text": "func (r *Room) HasMember(member User) bool {\n\treturn r.MemberIDSet.Has(member.ID)\n}", "title": "" }, { "docid": "47c1bff84d64340fa0725820b9bc12fb", "score": "0.5787546", "text": "func (m *ApplicationItemRequestBuilder) CheckMemberGroups()(*i72720b8b61b527b526dacbdb4f1b2ebc44378e69b3a31f054e52851fc51aee5a.CheckMemberGroupsRequestBuilder) {\n return i72720b8b61b527b526dacbdb4f1b2ebc44378e69b3a31f054e52851fc51aee5a.NewCheckMemberGroupsRequestBuilderInternal(m.pathParameters, m.requestAdapter);\n}", "title": "" }, { "docid": "99a2bfae8c916a9200974727cfdcf079", "score": "0.5778939", "text": "func GroupLogExists(ctx context.Context, exec boil.ContextExecutor, iD int64) (bool, error) {\n\tvar exists bool\n\tsql := \"select exists(select 1 from \\\"group_logs\\\" where \\\"id\\\"=? limit 1)\"\n\n\tif boil.IsDebug(ctx) {\n\t\twriter := boil.DebugWriterFrom(ctx)\n\t\tfmt.Fprintln(writer, sql)\n\t\tfmt.Fprintln(writer, iD)\n\t}\n\trow := exec.QueryRowContext(ctx, sql, iD)\n\n\terr := row.Scan(&exists)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"dbmodel: unable to check if group_logs exists\")\n\t}\n\n\treturn exists, nil\n}", "title": "" }, { "docid": "36598102e21a85e3f3664c7587b2c1fe", "score": "0.57637084", "text": "func (o *BlockedUser) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) {\n\treturn BlockedUserExists(ctx, exec, o.ID)\n}", "title": "" }, { "docid": "918f8a16f233836c4020300f24617489", "score": "0.5748489", "text": "func (pg *ProcessGroup) InGroup(procName string, group string) bool {\n\tgroupName, ok := pg.processGroup[procName]\n\tif ok && group == groupName {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "867e086c7b3a54aae64cd9a8c7222d4b", "score": "0.5734037", "text": "func (b *Bot) isMember(owner, repo, user string) (bool, error) {\n\tctx := context.Background()\n\n\t// make sure user is a member of an organization\n\tisMember, _, err := b.git.Organizations.IsMember(ctx, owner, user)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tif !isMember {\n\t\t// make sure user is a collaborator of a repo\n\t\tisCollab, _, err := b.git.Repositories.IsCollaborator(ctx, owner, repo, user)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\tif !isCollab {\n\t\t\treturn false, nil\n\t\t}\n\t}\n\treturn true, nil\n}", "title": "" }, { "docid": "d0dd36e726e07f8f21aabc375590d8ab", "score": "0.5710032", "text": "func (mk *MockStore) HasUsers(projectUUID string, users []string) (bool, []string) {\n\n\tvar notFound []string\n\n\t// for each given username\n\tfor _, username := range users {\n\t\tfound := false\n\t\t// loop through all found users\n\t\tfor _, user := range mk.UserList {\n\t\t\tif username == user.Name {\n\t\t\t\tfound = true\n\t\t\t}\n\t\t}\n\t\t// if not found add it to the notFound\n\t\tif !found {\n\t\t\tnotFound = append(notFound, username)\n\t\t}\n\n\t}\n\n\treturn len(notFound) == 0, notFound\n}", "title": "" }, { "docid": "a9eb140d541d3d50312a2746790ad0f0", "score": "0.5693067", "text": "func IsMember(settings *playfab.Settings, postData *IsMemberRequestModel, entityToken string) (*IsMemberResponseModel, error) {\r\n if entityToken == \"\" {\n return nil, playfab.NewCustomError(\"entityToken should not be an empty string\", playfab.ErrorGeneric)\n }\r\n b, errMarshal := json.Marshal(postData)\r\n if errMarshal != nil {\r\n return nil, playfab.NewCustomError(errMarshal.Error(), playfab.ErrorMarshal)\r\n }\r\n\r\n sourceMap, err := playfab.Request(settings, b, \"/Group/IsMember\", \"X-EntityToken\", entityToken)\r\n if err != nil {\r\n return nil, err\r\n }\r\n \r\n result := &IsMemberResponseModel{}\r\n\r\n config := mapstructure.DecoderConfig{\r\n DecodeHook: playfab.StringToDateTimeHook,\r\n Result: result,\r\n }\r\n \r\n decoder, errDecoding := mapstructure.NewDecoder(&config)\r\n if errDecoding != nil {\r\n return nil, playfab.NewCustomError(errDecoding.Error(), playfab.ErrorDecoding)\r\n }\r\n \r\n errDecoding = decoder.Decode(sourceMap)\r\n if errDecoding != nil {\r\n return nil, playfab.NewCustomError(errDecoding.Error(), playfab.ErrorDecoding)\r\n }\r\n\r\n return result, nil\r\n}", "title": "" }, { "docid": "b1a8a34406a51b3b3317fd52f67f43be", "score": "0.56920093", "text": "func (p *AmazonCognitoProvider) ValidateGroupMembership(email string, allowedGroups []string, accessToken string) ([]string, error) {\n\tlogger := log.NewLogEntry()\n\n\t// if an empty list of allowed groups is passed in, we return an empty list.\n\tif len(allowedGroups) == 0 {\n\t\treturn []string{}, nil\n\t}\n\n\t// cognito tends to work with usernames instead of email addresses,\n\t// so we find the users username and use that while reasoning about their group membership\n\tuserInfo, err := p.GetUserProfile(accessToken)\n\tif err != nil {\n\t\treturn []string{}, err\n\t}\n\tif userInfo.Username == \"\" {\n\t\treturn []string{}, errors.New(\"missing username\")\n\t}\n\tuserName := userInfo.Username\n\n\tmatchingGroups := []string{}\n\tvar useGroupsResource bool\n\t// iterate over the groups. if the group isn't already cached then trigger a refresh loop for that group.\n\tfor _, group := range allowedGroups {\n\t\tmemberSet, ok := p.GroupsCache.Get(group)\n\t\tif !ok {\n\t\t\tuseGroupsResource = true\n\t\t\tif started := p.GroupsCache.RefreshLoop(group); started {\n\t\t\t\tlogger.WithUserGroup(group).Info(\n\t\t\t\t\t\"no member set cached for group; refresh loop started\")\n\t\t\t\tp.StatsdClient.Incr(\"cache_refresh_loop\", []string{\"action:profile\", fmt.Sprintf(\"group:%s\", group)}, 1.0)\n\t\t\t}\n\t\t}\n\t\tif _, exists := memberSet[userName]; exists {\n\t\t\tmatchingGroups = append(matchingGroups, group)\n\t\t}\n\t}\n\t// if the membership for this group is not cached, get all the groups the user is a member of and\n\t// filter out ones that are in `allowedGroups`\n\tif useGroupsResource {\n\t\tgroupMembership, err := p.AdminService.CheckMemberships(userName)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, allowedGroup := range allowedGroups {\n\t\t\tfor _, group := range groupMembership {\n\t\t\t\tif allowedGroup == group {\n\t\t\t\t\tmatchingGroups = append(matchingGroups, group)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn matchingGroups, nil\n}", "title": "" }, { "docid": "4e849b7668ce5b76c5c4443f6ae43e9d", "score": "0.56813866", "text": "func (el EntityManager) isUserInList(name string) bool {\n\t_, exist := el.Users[name]\n\treturn exist\n}", "title": "" }, { "docid": "a21b6ce932521624eadda488be961b52", "score": "0.56803745", "text": "func (q adminGroupQuery) ExistsG() (bool, error) {\n\treturn q.Exists(boil.GetDB())\n}", "title": "" }, { "docid": "9bf39aa383f7f92a01652cc6199e3992", "score": "0.5668758", "text": "func (i identImpl) IsMember(name string) bool {\n\treturn utils.Contains(name, i.Teams())\n}", "title": "" }, { "docid": "eb3c961e94755284399e609cc1c58f84", "score": "0.56378126", "text": "func (database *Database) ExistsGroup(groupName string) int64 {\n\tstmtStr := \"SELECT \" +\n\t\t\" id_group \" +\n\t\t\"FROM \" +\n\t\t\" groups \" +\n\t\t\"WHERE \" +\n\t\t\" groups.name = ? \" +\n\t\t\"LIMIT 1\"\n\ttx, stmt, rows := database.PreparedQuery(stmtStr, groupName)\n\tdefer stmt.Close()\n\tdefer rows.Close()\n\n\tvar id int64\n\tfor rows.Next() {\n\t\terr := rows.Scan(&id)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t}\n\terr := rows.Err()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\ttx.Commit()\n\treturn id\n}", "title": "" }, { "docid": "4478e709b71acefdac198d930747936c", "score": "0.5636539", "text": "func AdminGroupExistsG(iD int) (bool, error) {\n\treturn AdminGroupExists(boil.GetDB(), iD)\n}", "title": "" }, { "docid": "511ba42ea2f26fd89782181f0f540593", "score": "0.56292623", "text": "func (q groupLogQuery) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRowContext(ctx, exec).Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"dbmodel: failed to check if group_logs exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "443cb7d994cb7c83f3dbdb9277a67063", "score": "0.5622576", "text": "func (xdgd *XDemoGroupDef) Exists() bool {\n\treturn xdgd._exists\n}", "title": "" }, { "docid": "e796c57c86ed3594d158e6883129a93d", "score": "0.5621941", "text": "func CacheGroupExists(tx *sql.Tx, name string) (bool, error) {\n\tvar count int\n\tif err := tx.QueryRow(\"SELECT count(name) FROM cachegroup AS cg WHERE cg.name=$1\", name).Scan(&count); err != nil {\n\t\treturn false, fmt.Errorf(\"error getting cache group info: %w\", err)\n\t}\n\tif count == 0 {\n\t\treturn false, nil\n\t}\n\tif count != 1 {\n\t\treturn false, fmt.Errorf(\"getting cache group info - expected row count: 1, actual: %d\", count)\n\t}\n\treturn true, nil\n}", "title": "" }, { "docid": "838f9dc9a283934b7bbaa40c70f3e606", "score": "0.55778533", "text": "func (agr *AgentGroupRelation) Exists() bool {\n\treturn agr._exists\n}", "title": "" }, { "docid": "3a8f4774bcf7d91ed66b7909db384de5", "score": "0.55702317", "text": "func (g PeerGroup) Contains(peer *Member) bool {\n\tfor _, p := range g {\n\t\tif p.Endpoint == peer.Endpoint {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "efc04bbc791d1fdb120f375c02100c13", "score": "0.55335027", "text": "func (s *Stack) IsInGroup(nicID tcpip.NICID, multicastAddr tcpip.Address) (bool, tcpip.Error) {\n\ts.mu.RLock()\n\tdefer s.mu.RUnlock()\n\n\tif nic, ok := s.nics[nicID]; ok {\n\t\treturn nic.isInGroup(multicastAddr), nil\n\t}\n\treturn false, &tcpip.ErrUnknownNICID{}\n}", "title": "" }, { "docid": "bc4c01a064c8bd3aa8ed76764b13039b", "score": "0.5520665", "text": "func (q blockedUserQuery) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRowContext(ctx, exec).Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"models: failed to check if blocked_users exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "c8c6c25bca39cb94c9f584045fdbe141", "score": "0.5509415", "text": "func (file File) HasGroup(sGroup string) bool {\n\tfor _, group := range file.Groups {\n\t\tif group.Name == sGroup {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "6cdaadf24f8394ebd9ee72fe9138de10", "score": "0.55071586", "text": "func (o *AccountDetails) HasRequiredGroupMembership() bool {\n\tif o != nil && o.RequiredGroupMembership != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "dbf9b4152a9d5c223d3f39597c6970a4", "score": "0.548499", "text": "func alreadyAUser(user string) bool {\n for userName,_:= range listIPs {\n if userName == user {return true}\n }\n return false\n}", "title": "" }, { "docid": "ea715d0dc4fe3df9bf5f99e501754666", "score": "0.5483513", "text": "func (c *Client) IsMember(org, user string) (bool, error) {\n\tctx := context.Background()\n\tmember, _, err := c.client.Organizations.IsMember(ctx, org, user)\n\treturn member, err\n}", "title": "" }, { "docid": "ba4db171ed80d8f73dcf828bc716582e", "score": "0.5468029", "text": "func (k Keeper) HasGroup(ctx sdk.Context, id uint64) bool {\n\tstore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.GroupKey))\n\treturn store.Has(GetGroupIDBytes(id))\n}", "title": "" }, { "docid": "c4326fb78994a23df8f07665277d5057", "score": "0.54641676", "text": "func (l *Lobby) IsMember(userID int64) (bool, error) {\n\treturn client.SIsMember(fmt.Sprintf(\"lobby:%d:members\", l.id), userID).Result()\n}", "title": "" }, { "docid": "f6e7384488743d43d571eb7923417e0f", "score": "0.5460192", "text": "func (vi *VoiceIt2) CheckGroupExists(groupId string) string {\n\n body := &bytes.Buffer{}\n writer := multipart.NewWriter(body)\n writer.Close()\n\n req, _ := http.NewRequest(\"GET\", vi.BaseUrl + \"/groups/\" + groupId + \"/exists\", body)\n req.SetBasicAuth(vi.ApiKey, vi.ApiToken)\n req.Header.Add(\"Content-Type\", writer.FormDataContentType())\n\n client := &http.Client{}\n resp, _ := client.Do(req)\n defer resp.Body.Close()\n reply, _ := ioutil.ReadAll(resp.Body)\n return string(reply)\n}", "title": "" }, { "docid": "f30c6a3b0e16e6b813047000c517f1b3", "score": "0.5457585", "text": "func (o *PageAccessUser) HasPageAccessGroupIds() bool {\n\tif o != nil && o.PageAccessGroupIds != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "3b84d3a4e250cd431b9cc2c9fb4e5587", "score": "0.54256475", "text": "func (r *MembRepository) HasRole(aid, uid string, role ...string) error {\n\tq := \"SELECT * FROM %s WHERE account_id = ? AND user_id = ? AND role IN (?) LIMIT 1\"\n\tq = fmt.Sprintf(q, r.tableName)\n\tq, args, err := sqlx.In(q, aid, uid, role)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"bind roles\")\n\t}\n\tq = r.db.Rebind(q)\n\tm := &Member{}\n\tif err := r.db.Get(m, q, args...); err != nil {\n\t\tif err == sql.ErrNoRows {\n\t\t\treturn ErrNotFoundMember\n\t\t}\n\t\treturn errors.Wrap(err, \"has member role\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8c9d0a36849b44c7c24fb5f2ba6aced0", "score": "0.5415422", "text": "func (u *Users) containsUser(n string) bool {\n\tfor _, l := range *u {\n\n\t\tif l.Username == n {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "6abe1d63a60c12ca93c749b2df33db0f", "score": "0.54125375", "text": "func (u *User) Exists() (bool, error) {\n\terr := db.QueryRow(`\n\t\tSELECT id FROM \"users\"\n\t\tWHERE \"telegramID\" = $1;\n\t`, u.TelegramID).Scan(&u.ID)\n\n\tif err == nil {\n\t\treturn true, nil\n\t} else if err == sql.ErrNoRows {\n\t\treturn false, nil\n\t} else {\n\t\treturn false, fmt.Errorf(\"Unable to get user from DB: %v\", err)\n\t}\n}", "title": "" }, { "docid": "197f9ac048fc3f6deca83c497256d8d0", "score": "0.540723", "text": "func (tx *AddMemberTx) addMemberByUPKV2(ctx context.Context, user keybase1.UserPlusKeysV2, role keybase1.TeamRole,\n\tbotSettings *keybase1.TeamBotSettings) (invite bool, err error) {\n\tteam := tx.team\n\tg := team.G()\n\n\tuv := NewUserVersion(user.Uid, user.EldestSeqno)\n\tdefer g.CTrace(ctx, fmt.Sprintf(\"AddMemberTx.addMemberByUPKV2(name:%q uv:%v, %v) to team: %q\",\n\t\tuser.Username, uv, role, team.Name()), &err)()\n\n\tif user.Status == keybase1.StatusCode_SCDeleted {\n\t\treturn false, libkb.UserDeletedError{Msg: fmt.Sprintf(\"User %q (%s) is deleted\", user.Username, uv.Uid)}\n\t}\n\n\tif role == keybase1.TeamRole_OWNER && team.IsSubteam() {\n\t\treturn false, NewSubteamOwnersError()\n\t}\n\n\tif err := assertValidNewTeamMemberRole(role); err != nil {\n\t\treturn false, err\n\t}\n\n\thasPUK := len(user.PerUserKeys) > 0\n\tif !hasPUK {\n\t\tg.Log.CDebugf(ctx, \"Invite required for %v\", uv)\n\n\t\tif !tx.AllowPUKless {\n\t\t\treturn false, UserPUKlessError{username: user.Username, uv: uv}\n\t\t}\n\t}\n\n\tnormalizedUsername := libkb.NewNormalizedUsername(user.Username)\n\n\tcurrentRole, err := team.MemberRole(ctx, uv)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tif currentRole != keybase1.TeamRole_NONE {\n\t\tif !hasPUK {\n\t\t\treturn false, fmt.Errorf(\"user %s (uv %s) is already a member of %s, yet they don't have a PUK\",\n\t\t\t\tnormalizedUsername, uv, team.Name())\n\t\t}\n\t\tif tx.AllowRoleChanges {\n\t\t\tif currentRole == role {\n\t\t\t\t// No-op team.change_membership links that don't change\n\t\t\t\t// member's role are legal, but we are trying to avoid\n\t\t\t\t// them. Caller can catch this error and move onwards,\n\t\t\t\t// it doesn't taint the transaction.\n\t\t\t\treturn false, libkb.ExistsError{Msg: fmt.Sprintf(\"user %s is already a member of team %s with role %s\",\n\t\t\t\t\tnormalizedUsername, team.Name(), role.HumanString())}\n\t\t\t}\n\t\t} else {\n\t\t\treturn false, libkb.ExistsError{Msg: fmt.Sprintf(\"user %s is already a member of team %s\",\n\t\t\t\tnormalizedUsername, team.Name())}\n\t\t}\n\t}\n\n\tif existingUV, err := team.UserVersionByUID(ctx, uv.Uid); err == nil {\n\t\t// There is an edge case where user is in the middle of resetting\n\t\t// (after reset, before provisioning) and has EldestSeqno=0.\n\t\tif hasPUK && existingUV.EldestSeqno > uv.EldestSeqno {\n\t\t\treturn false, fmt.Errorf(\"newer version of user %s (uid:%s) already exists in the team %q (%v > %v)\",\n\t\t\t\tnormalizedUsername, uv.Uid, team.Name(), existingUV.EldestSeqno, uv.EldestSeqno)\n\t\t}\n\t}\n\n\tcurInvite, err := team.chain().FindActiveInvite(uv.TeamInviteName(), keybase1.NewTeamInviteTypeDefault(keybase1.TeamInviteCategory_KEYBASE))\n\tif err != nil {\n\t\tif _, ok := err.(libkb.NotFoundError); !ok {\n\t\t\treturn false, err\n\t\t}\n\t\tcurInvite = nil\n\t\terr = nil\n\t}\n\tif curInvite != nil && !hasPUK {\n\t\treturn false, libkb.ExistsError{Msg: fmt.Sprintf(\"user %s is already invited to team %q\",\n\t\t\tnormalizedUsername, team.Name())}\n\t}\n\n\t// No going back after this point!\n\n\ttx.sweepKeybaseInvites(uv.Uid)\n\n\tif !hasPUK {\n\t\t// An admin is only allowed to remove an owner UV when, in the same\n\t\t// link, replacing them with a 'newer' UV with a greater eldest seqno.\n\t\t// So, if we're an admin re-adding an owner who does not yet have a PUK\n\t\t// then don't try to remove the owner's pre-reset UV. Note that the old\n\t\t// owner UV will still be removed in the transaction during SBS\n\t\t// resolution when they get a PUK later.\n\t\ttx.sweepCryptoMembers(ctx, uv.Uid, true /* exceptAdminsRemovingOwners */)\n\t} else {\n\t\t// This might be a role change, only sweep UVs with EldestSeqno older\n\t\t// than one currently being added, so it doesn't sweep the same UV we\n\t\t// are currently adding.\n\t\ttx.sweepCryptoMembersOlderThan(uv)\n\t}\n\n\tif !hasPUK {\n\t\tif err = tx.createKeybaseInvite(uv, role); err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\treturn true /* invite */, nil\n\t}\n\tif err := tx.addMember(uv, role, botSettings); err != nil {\n\t\treturn false, err\n\t}\n\treturn false, nil\n}", "title": "" }, { "docid": "3454cd7d7af728b889d45c98534b16e3", "score": "0.539655", "text": "func userExists(u string) bool {\n\tlog.Debug(\"Running lookup on user:\", u)\n\tif _, err := user.Lookup(u); err != nil {\n\t\tif _, ok := err.(user.UnknownUserError); ok {\n\t\t\tlog.Info(\"User does not exist: \", u)\n\t\t\treturn false\n\t\t} else {\n\t\t\tlog.Error(\"Encountered unknown error on user lookup: \", err)\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "8c465576519222cdde2186bdf7b8c863", "score": "0.539389", "text": "func DBGetGroupMembers(g Group) GroupWithMembers {\n\tvar gwm GroupWithMembers\n\tgwm.GroupName = g.GroupName\n\tfor _, u := range users {\n\t\tfor _, m := range u.Groups {\n\t\t\tif m == gwm.GroupName {\n\t\t\t\tgwm.GroupMembers = append(gwm.GroupMembers, u.UserID)\n\t\t\t}\n\t\t}\n\t}\n\t//If a group has no members, then the slice is empty, which is okay.\n\treturn gwm\n}", "title": "" }, { "docid": "8dc30a9ddec83ad96906e83c2d711142", "score": "0.53850263", "text": "func checkMasked(maskedUserGroups map[string]int, item ExtendedFailure) bool {\n\tcountBelongGroupMask := 0\n\tfor _, group := range item.Failure.Dependencies.BelongsToGroup {\n\t\tif maskedUserGroups[group] == 1 {\n\t\t\tcountBelongGroupMask++\n\t\t}\n\t}\n\treturn countBelongGroupMask == len(item.Failure.Dependencies.BelongsToGroup)\n}", "title": "" }, { "docid": "26d70e2e6507a98a2b674736d6d86bcf", "score": "0.5381567", "text": "func Exists(username string) bool {\n\t_, ok := config.All().Users[username]\n\treturn ok\n}", "title": "" }, { "docid": "76d3a629c69554ff3905cf0e83359de8", "score": "0.538135", "text": "func (g *Group) IsMatch(check *Group) bool {\n\tif check == nil {\n\t\treturn false\n\t}\n\n\t// Check user\n\tif g.Id == check.GetId() {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "8c25a6006bd2a3287289d38d0217bb9b", "score": "0.5377064", "text": "func (r *Store) IsSetMember(key string, value string) (int, error) {\n\treturn redigo.Int(r.Do(\"SISMEMBER\", (r.prepareArgsWithKey(key, value))...))\n}", "title": "" }, { "docid": "d25d5af8f2a789d33310f1a13883e579", "score": "0.53713423", "text": "func (u *User) Exists() bool {\n\treturn u._exists\n}", "title": "" }, { "docid": "d25d5af8f2a789d33310f1a13883e579", "score": "0.53713423", "text": "func (u *User) Exists() bool {\n\treturn u._exists\n}", "title": "" }, { "docid": "d25d5af8f2a789d33310f1a13883e579", "score": "0.53713423", "text": "func (u *User) Exists() bool {\n\treturn u._exists\n}", "title": "" }, { "docid": "d25d5af8f2a789d33310f1a13883e579", "score": "0.53713423", "text": "func (u *User) Exists() bool {\n\treturn u._exists\n}", "title": "" }, { "docid": "e7cd1b39b0628c2b102b8eb23fe2c414", "score": "0.53659576", "text": "func (g GenericStats) containsUser(u string) bool {\n\tfor _, col := range g.Collaborators {\n\t\tif col == u {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "7adf11e60ae8a9070d6dd4ed81c8419b", "score": "0.53453195", "text": "func (k Keeper) HasGroupAddr(ctx sdk.Context, addr string) bool {\n\tstore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.GroupAddrKey))\n\treturn store.Has(types.GetStringBytes(addr))\n}", "title": "" }, { "docid": "3887e2acb0bdf033177b8b5fb0931c72", "score": "0.5342985", "text": "func (g *GroupMemberLag) IsEmpty() bool { return g.Member == nil }", "title": "" }, { "docid": "ff69504a60a2aec51f4bf36a93cb9599", "score": "0.5338654", "text": "func (m *Manager) HasGroup(namespace string, group string) (bool, error) {\n\tobjects, err := m.kubectl.Get(namespace, \"all\", \"kp-group=\"+group)\n\tif err != nil {\n\t\treturn true, fmt.Errorf(\"HasGroup: %v\", err)\n\t}\n\tif len(objects) > 0 {\n\t\treturn true, nil\n\t}\n\treturn false, nil\n}", "title": "" }, { "docid": "8548c00b572d5e570344baae2d21acc7", "score": "0.5331421", "text": "func (c *Client) ExistsKeygroup(kg string) bool {\n\tresponse, err := c.dbClient.ExistsKeygroup(context.Background(), &storage.Keygroup{Keygroup: kg})\n\tlog.Debug().Err(err).Msgf(\"StorageClient: ExistsKeygroup in: %#v out: %#v\", kg, response)\n\n\tif err != nil {\n\t\treturn false\n\t}\n\n\treturn response.Success\n}", "title": "" }, { "docid": "00fb2a28687880fd9a56379d1240c776", "score": "0.5330204", "text": "func (q userQuery) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRowContext(ctx, exec).Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"models: failed to check if users exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "ae7f878847ede4218c25b35ec29e715b", "score": "0.53101534", "text": "func CheckMembers(ctx *context.Context, ChatId int64, command *CommandData, MembersType int) []*telegram.User {\n\tvar ids []int\n\tvar result []*telegram.User\n\n\tfor _, user := range command.Users {\n\t\tids = append(ids, user.Id)\n\t}\n\n\tfor _, user := range command.UserStrings {\n\t\tdbUserData, err := db.GetUserData(ctx, user)\n\t\tif err != nil {\n\t\t\tif defaults.Debug {\n\t\t\t\tlog.Printf(\"[debug] (CheckMembers) Could not get user data from database for user %s, %+v\", user, err.Error())\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif dbUserData == nil {\n\t\t\tif defaults.Debug {\n\t\t\t\tlog.Printf(\"[debug] (CheckMembers) User not found in database: %s\", user)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tids = append(ids, dbUserData.UserID)\n\t}\n\n\tfor _, userId := range ids {\n\t\tuserData, err := telegram.GetChatMember(ctx, ChatId, userId)\n\t\tif err != nil {\n\t\t\tif defaults.Debug {\n\t\t\t\tlog.Printf(\"[debug] (CheckMembers) Could not get user verification data from Telegram for user ID %d, %+v\", userId, err.Error())\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tif userData.User.IsBot {\n\t\t\tcontinue\n\t\t}\n\n\t\tif defaults.Debug {\n\t\t\tlog.Printf(\"[debug] CheckMembers ChatMember %+v.\", userData)\n\t\t}\n\n\t\tif MembersType == regular {\n\t\t\tif userData.Status != \"member\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tif MembersType == creator {\n\t\t\tif userData.Status != \"creator\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tif MembersType == kicked {\n\t\t\tif userData.Status != \"kicked\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tif MembersType == left {\n\t\t\tif userData.Status != \"left\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tif MembersType == moderators {\n\t\t\tif userData.Status != \"administrator\" || userData.CanPromoteMembers {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tif MembersType == admininstrators {\n\t\t\tif (userData.Status != \"administrator\" || !userData.CanPromoteMembers) && userData.Status != \"creator\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tif defaults.Debug {\n\t\t\tlog.Printf(\"[debug] CheckMembers Keeping ChatMember %+v.\", userData)\n\t\t}\n\n\t\tresult = append(result, userData.User)\n\t}\n\treturn result\n}", "title": "" }, { "docid": "8d1f621ef879e1ebb2f95ee540e364c2", "score": "0.5309438", "text": "func (c CustomCategory) isMember(label string) bool {\n\tfor _, regex := range c.Regexes {\n\t\tisMatch := regex.Match([]byte(label))\n\t\tif isMatch {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}", "title": "" } ]
14ea1aa8b8730d3b6eee024e94598647
/ getItemDescription does string building to make a descriptive invoice item
[ { "docid": "138230db6ca1fb63e6dbff34ef5bda51", "score": "0.7580058", "text": "func getItemDescription(event model.Event, feeType string, split, first bool) string {\n\tfeeName := \"Application fee\"\n\tswitch feeType {\n\tcase model.EventSpaceSingle:\n\t\tfeeName = \"Single Space\"\n\tcase model.EventSpaceDouble:\n\t\tfeeName = \"Double Space\"\n\tcase model.EventSpaceFood:\n\t\tfeeName = \"Food Space\"\n\tcase model.EventSpaceTruck:\n\t\tfeeName = \"Truck Space\"\n\t}\n\tif feeType != model.EventApplicationFee {\n\t\tpredicate := \"Full \"\n\t\tif split {\n\t\t\tpredicate = \"Remainder \"\n\t\t}\n\t\tif first {\n\t\t\tpredicate = \"First \"\n\t\t}\n\t\tfeeName = predicate + feeName\n\t}\n\treturn fmt.Sprintf(\"%s for %s on %s\", feeName, event.Name, event.StartDate.Format(\"January 2, 2006\"))\n}", "title": "" } ]
[ { "docid": "3c891283d6f592dc0efd8586ff5835a2", "score": "0.63745034", "text": "func (o CatalogItemOutput) Description() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *CatalogItem) pulumi.StringOutput { return v.Description }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "6c36c2da5f09e9b0312abff66be14242", "score": "0.636686", "text": "func (i Item) String() string {\n DoNotice := \"F\"\n if i.Meta.DoNotice {\n DoNotice = \"T\"\n }\n\n fields := []string{i.Indicator, i.Type.String(), i.Meta.Source, i.Meta.Desc, i.Meta.URL, DoNotice}\n return strings.Join(fields, \"\\t\")\n}", "title": "" }, { "docid": "3920246ba5708a9982c6502825ebbd52", "score": "0.62070644", "text": "func (i *Item) String() string {\n\tvar builder strings.Builder\n\tbuilder.WriteString(\"Item(\")\n\tbuilder.WriteString(fmt.Sprintf(\"id=%v, \", i.ID))\n\tbuilder.WriteString(\"product_name=\")\n\tbuilder.WriteString(i.ProductName)\n\tbuilder.WriteString(\", \")\n\tbuilder.WriteString(\"quantity=\")\n\tbuilder.WriteString(fmt.Sprintf(\"%v\", i.Quantity))\n\tbuilder.WriteString(\", \")\n\tbuilder.WriteString(\"category_id=\")\n\tbuilder.WriteString(fmt.Sprintf(\"%v\", i.CategoryID))\n\tbuilder.WriteString(\", \")\n\tbuilder.WriteString(\"complete=\")\n\tbuilder.WriteString(fmt.Sprintf(\"%v\", i.Complete))\n\tbuilder.WriteByte(')')\n\treturn builder.String()\n}", "title": "" }, { "docid": "c7e83d989f0291c06bbbf86940ad64c8", "score": "0.61931324", "text": "func (i Item) Description() (string, error) {\n\tif i.description == \"\" {\n\t\treturn \"\", errors.New(\"Item description is not populated\")\n\t}\n\treturn i.description, nil\n}", "title": "" }, { "docid": "9f28d0f4094937129c8a6df01bb8cc7c", "score": "0.6170576", "text": "func (c *ConcretProduct1) Description() string {\n\treturn fmt.Sprintf(\"[Manufacture by XXX] product name: %s\", c.Name)\n}", "title": "" }, { "docid": "ead7ae1b3d7774f13216653d8dc43193", "score": "0.6166201", "text": "func (a Item) String() string {\n\tswitch a {\n\tcase Spot:\n\t\treturn spot\n\tcase Margin:\n\t\treturn margin\n\tcase CrossMargin:\n\t\treturn crossMargin\n\tcase MarginFunding:\n\t\treturn marginFunding\n\tcase Index:\n\t\treturn index\n\tcase Binary:\n\t\treturn binary\n\tcase PerpetualContract:\n\t\treturn perpetualContract\n\tcase PerpetualSwap:\n\t\treturn perpetualSwap\n\tcase Futures:\n\t\treturn futures\n\tcase DeliveryFutures:\n\t\treturn deliveryFutures\n\tcase UpsideProfitContract:\n\t\treturn upsideProfitContract\n\tcase DownsideProfitContract:\n\t\treturn downsideProfitContract\n\tcase CoinMarginedFutures:\n\t\treturn coinMarginedFutures\n\tcase USDTMarginedFutures:\n\t\treturn usdtMarginedFutures\n\tcase USDCMarginedFutures:\n\t\treturn usdcMarginedFutures\n\tcase Options:\n\t\treturn options\n\tdefault:\n\t\treturn \"\"\n\t}\n}", "title": "" }, { "docid": "42feba176f93c784d75e46fc620734b4", "score": "0.6159296", "text": "func (item *JiraItem) GetDescription() string {\r\n\treturn sanitize.HTML(item.Description + item.GetAcceptanceCriteria())\r\n}", "title": "" }, { "docid": "033c56b1699ee7a7d6a9dc638d6980b1", "score": "0.6110009", "text": "func (*Purchase_Item) Descriptor() ([]byte, []int) {\n\treturn file_api_ova_purchase_api_ova_purchase_api_proto_rawDescGZIP(), []int{4, 0}\n}", "title": "" }, { "docid": "df1a3a681ee042987a8e095e3f29a84f", "score": "0.6054552", "text": "func (*DescribePurchaseResponse_Item) Descriptor() ([]byte, []int) {\n\treturn file_api_ova_purchase_api_ova_purchase_api_proto_rawDescGZIP(), []int{2, 0}\n}", "title": "" }, { "docid": "471d2ebbacd67ea284a7abe48714bb3e", "score": "0.59800404", "text": "func (i Item) String() string {\n\t//TODO: return should depends on i.Kind\n\treturn i.Title\n}", "title": "" }, { "docid": "f2baefd16820e2dfaf46ce0bb10f2ead", "score": "0.5831519", "text": "func (im ItemStub) String() string {\n\treturn storageutil.JoinFields(im.Namespace(), im.ID())\n}", "title": "" }, { "docid": "826f0393caf9e81c5e1add62b92ddfb5", "score": "0.58026904", "text": "func (*ItemDetails) Descriptor() ([]byte, []int) {\n\treturn file_items_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "880194ea2649fd003a03b97190416f83", "score": "0.57412094", "text": "func (*CreatePurchaseRequest_Item) Descriptor() ([]byte, []int) {\n\treturn file_api_ova_purchase_api_ova_purchase_api_proto_rawDescGZIP(), []int{0, 0}\n}", "title": "" }, { "docid": "bf27fc9e311a9e27c8d8958aa2d04025", "score": "0.5712945", "text": "func (i Item) String() string {\n\tvar name string\n\tswitch i.Type {\n\tcase ItemEOF:\n\t\treturn fmt.Sprintf(\"[EOF: %d/%d]\", i.Line, i.Pos)\n\tcase ItemError:\n\t\tname = \"Error\"\n\tcase ItemHeader:\n\t\tname = \"Header\"\n\tcase ItemName:\n\t\tname = \"Name\"\n\tcase ItemTags:\n\t\tname = \"Tags\"\n\tcase ItemMetadata:\n\t\tname = \"Metadata\"\n\tcase ItemContent:\n\t\tname = \"Content\"\n\t}\n\tif i.Type != ItemError && len(i.Val) > 80 {\n\t\treturn fmt.Sprintf(\"[%s: %d/%d] %.80q...\", name, i.Line, i.Pos, i.Val)\n\t}\n\treturn fmt.Sprintf(\"[%s: %d/%d] %q\", name, i.Line, i.Pos, i.Val)\n}", "title": "" }, { "docid": "5c51532d5cf8ce7bbdddf3f450538c48", "score": "0.5676861", "text": "func (*CEconItem_Description) Descriptor() ([]byte, []int) {\n\treturn file_steam_client_steammessages_econ_steamclient_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "56bcc2807b62a86fb65374f415a94af6", "score": "0.5676636", "text": "func (*ExplanationOfBenefit_Item_Detail) Descriptor() ([]byte, []int) {\n\treturn file_proto_google_fhir_proto_stu3_resources_proto_rawDescGZIP(), []int{46, 8, 3}\n}", "title": "" }, { "docid": "552077ac1edfca7f685a6797ac54f3f7", "score": "0.5667612", "text": "func (ctx *Context) ItemString(mode etime.Modes, time etime.Times, itemNm string) string {\n\treturn ctx.ItemStringScope(etime.Scope(mode, time), itemNm)\n}", "title": "" }, { "docid": "eaac742af229f573b824a708531afc6a", "score": "0.56387746", "text": "func (*CEconItem_Description) Descriptor() ([]byte, []int) {\n\treturn file_steammessages_econ_steamclient_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "a673df0722fa1caf848eb242adbe1bb0", "score": "0.56304514", "text": "func (sm SteamedMilk) Description() string {\n\treturn sm.beverage.Description() + \", Steamed Milk\"\n}", "title": "" }, { "docid": "61d43b66abfae458f65ffbf6820e12c9", "score": "0.5626509", "text": "func (series Series) DescribeItem(i int) string {\n\tif i < 0 || i > len(series)-1 {\n\t\treturn \"out of range\"\n\t}\n\treturn fmt.Sprintf(\"name %q, %d points\", series[i].Name, len(series[i].Points))\n}", "title": "" }, { "docid": "0f3ce442bd4ec58a54f3191651cbfe32", "score": "0.56168044", "text": "func (im ItemStub) ID() string { return fmt.Sprintf(\"%+v\", im) }", "title": "" }, { "docid": "a879a8b1e0bfb7b02769ada753d26e94", "score": "0.55818874", "text": "func (_GovernanceProposal *GovernanceProposalCaller) Description(opts *bind.CallOpts) (string, error) {\n\tvar out []interface{}\n\terr := _GovernanceProposal.contract.Call(opts, &out, \"description\")\n\n\tif err != nil {\n\t\treturn *new(string), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(string)).(*string)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "4dea387bafc61976f736973096a55c09", "score": "0.5545607", "text": "func (i Item) String() string {\n\treturn fmt.Sprintf(\"%s (%d)\\n%s\\n%s %s\\n\\n\\n\", i.Title, i.Points, i.Url, i.PostedBy, i.PostedAgo)\n}", "title": "" }, { "docid": "c14caa5be2f27984b6a1e2027ee0115a", "score": "0.55411017", "text": "func (*ClaimResponse_Item_ItemDetail) Descriptor() ([]byte, []int) {\n\treturn file_proto_google_fhir_proto_stu3_resources_proto_rawDescGZIP(), []int{16, 0, 1}\n}", "title": "" }, { "docid": "a5b0b0d323de539de022f981baca2df0", "score": "0.55228955", "text": "func (o ProductOutput) Description() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *Product) pulumi.StringOutput { return v.Description }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "a3967ddba86dc7000d5aaa341f7d18d0", "score": "0.5507643", "text": "func (*Medication_Ingredient_Item) Descriptor() ([]byte, []int) {\n\treturn file_proto_google_fhir_proto_stu3_resources_proto_rawDescGZIP(), []int{66, 0, 0}\n}", "title": "" }, { "docid": "6160874bd7192a21d5bf2b6104b50e5b", "score": "0.5498692", "text": "func (i Item) String() string {\n\tswitch i {\n\tcase AmiId:\n\t\treturn \"ami-id\"\n\tcase AmiLaunchIndex:\n\t\treturn \"ami-launch-index\"\n\tcase AmiManifestPath:\n\t\treturn \"ami-manifest-path\"\n\tcase Hostname:\n\t\treturn \"hostname\"\n\tcase InstanceAction:\n\t\treturn \"instance-action\"\n\tcase InstanceId:\n\t\treturn \"instance-id\"\n\tcase InstanceType:\n\t\treturn \"instance-type\"\n\tcase LocalHostname:\n\t\treturn \"local-hostname\"\n\tcase LocalIPv4:\n\t\treturn \"local-ipv4\"\n\tcase Mac:\n\t\treturn \"mac\"\n\tcase Profile:\n\t\treturn \"profile\"\n\tcase PublicIPv4:\n\t\treturn \"public-ipv4\"\n\tcase PublicHostname:\n\t\treturn \"public-hostname\"\n\tcase ReservationId:\n\t\treturn \"reservation-id\"\n\tcase SecurityGroups:\n\t\treturn \"security-groups\"\n\tdefault:\n\t\treturn \"unknown\"\n\t}\n}", "title": "" }, { "docid": "9298cb75f17b330f73222d829f817b2b", "score": "0.5488129", "text": "func (li *LineItem) String() string {\n\tvar builder strings.Builder\n\tbuilder.WriteString(\"LineItem(\")\n\tbuilder.WriteString(fmt.Sprintf(\"id=%v\", li.ID))\n\tbuilder.WriteString(\", quantity=\")\n\tbuilder.WriteString(fmt.Sprintf(\"%v\", li.Quantity))\n\tbuilder.WriteByte(')')\n\treturn builder.String()\n}", "title": "" }, { "docid": "e0bd8ff3826f25ab18956e1fc8b46af3", "score": "0.5477275", "text": "func (*CEconItem_DescriptionLine) Descriptor() ([]byte, []int) {\n\treturn file_steam_client_steammessages_econ_steamclient_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "9b342051b6077256214c3083c11ac78b", "score": "0.5461336", "text": "func (b *BlueChip) Description() string {\n\treturn \"Search for stocks with excellent financial report.\" +\n\t\t\"Medium to long term model, mainly focusing on annualy financial reports.\" +\n\t\t\"· Low latest P/E, normally below 50\" +\n\t\t\"· Growing EPS each year and quarter, up to 3 years\" +\n\t\t\"· Growing ROE each year and quarter\" +\n\t\t\"· Low latest P/U\" +\n\t\t\"· Growing UDPPS each year and quarter, up to 3 years\" +\n\t\t\"· Promissing financial prediction\" +\n\t\t\"Get warnings/penalties if:\" +\n\t\t\"· High latest DAR\" +\n\t\t\"· High average DAR, up to 3 years\"\n}", "title": "" }, { "docid": "de2ee867c8a75367a37bb3a721a9fe82", "score": "0.54601973", "text": "func (d *Dao) Description(c context.Context, aid int64) (desc string, err error) {\n\targ := &archive.ArgAid{Aid: aid}\n\tif desc, err = d.arcRPC.Description2(c, arg); err != nil {\n\t\terr = errors.Wrapf(err, \"%v\", arg)\n\t}\n\treturn\n}", "title": "" }, { "docid": "4f6e279235a75c87032772a69e3c0515", "score": "0.5447212", "text": "func (e exif) Description() string {\n\tvar d string\n\t// IPTC 3.1 p.2 - Description\n\t// IPTC 6 p.39 (40 in PDF) - Caption/Abstract (/ not valid in field so -?)\n\t// IPTC 7 p.18 - dc:description\n\td = e.IPTC[\"Caption-Abstract\"]\n\tif d == \"\" {\n\t\t// Exif 1 p.22 (28) - ImageDescription\n\t\t// Exif 3 p.6 (10) - dc:description\n\t\td = e.Exif[\"ImageDescription\"]\n\t}\n\tif d == \"\" {\n\t\t// XMP 1 p.25 (33) - dc:description\n\t\td = e.XMP[\"Description\"]\n\t}\n\treturn d\n}", "title": "" }, { "docid": "d8c2f1a84e4813cd65cb82cb9c375631", "score": "0.54466087", "text": "func (row *MibIfRow2) Description() string {\n\treturn windows.UTF16ToString(row.description[:])\n}", "title": "" }, { "docid": "2b2056be235292126162a0602b65d002", "score": "0.543484", "text": "func (*CEconItem_DescriptionLine) Descriptor() ([]byte, []int) {\n\treturn file_steammessages_econ_steamclient_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "23d941247d3d212ae5dd0cbf2eedf0f3", "score": "0.5433487", "text": "func (*ExplanationOfBenefit_Item) Descriptor() ([]byte, []int) {\n\treturn file_proto_google_fhir_proto_stu3_resources_proto_rawDescGZIP(), []int{46, 8}\n}", "title": "" }, { "docid": "be706e7fa763786317db1508e0fd9335", "score": "0.5430671", "text": "func (c Client) Description() string {\n\treturn fmt.Sprint(\"Client:%s:%s\", c.ID, c.Name)\n}", "title": "" }, { "docid": "5ce16e6fa29544a01ce67eb3f8bdc6b1", "score": "0.5419524", "text": "func (m *AndroidForWorkAppConfigurationSchemaItem) GetDescription()(*string) {\n val, err := m.GetBackingStore().Get(\"description\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "title": "" }, { "docid": "08aec495bc2145e8a2da9106f6604775", "score": "0.54010266", "text": "func (i *ItemDef) Name() string { return i.name }", "title": "" }, { "docid": "7514b0b053ac114dd2edc4fd9a5b5351", "score": "0.5375891", "text": "func (*ProductCatalogItem) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_recommendationengine_v1beta1_catalog_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "2d949484cf112ddaf12050d7832f0a5a", "score": "0.5370433", "text": "func (_FluxAggregator *FluxAggregatorCaller) Description(opts *bind.CallOpts) (string, error) {\n\tvar (\n\t\tret0 = new(string)\n\t)\n\tout := ret0\n\terr := _FluxAggregator.contract.Call(opts, out, \"description\")\n\treturn *ret0, err\n}", "title": "" }, { "docid": "c41f5fac3f936f15cb1d7cab322d0883", "score": "0.53686035", "text": "func (e *book) getInfo() string {\r\n\treturn fmt.Sprintf(\"name: %s\\npage count: %d\\nprice: %d\", e.name, e.pageCount, e.price)\r\n}", "title": "" }, { "docid": "a1f96a5ebe861b0c85f49a3a59998167", "score": "0.53610617", "text": "func (*UpdatePurchaseRequest_Item) Descriptor() ([]byte, []int) {\n\treturn file_api_ova_purchase_api_ova_purchase_api_proto_rawDescGZIP(), []int{9, 0}\n}", "title": "" }, { "docid": "b2153664299b39a9348e568c29846e6f", "score": "0.5359829", "text": "func (*SupplyDelivery_SuppliedItem_Item) Descriptor() ([]byte, []int) {\n\treturn file_proto_google_fhir_proto_stu3_resources_proto_rawDescGZIP(), []int{110, 0, 0}\n}", "title": "" }, { "docid": "512cb23ccc1ed3ac2f5c08ab23538092", "score": "0.5358252", "text": "func (*CatalogItem) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_recommendationengine_v1beta1_catalog_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "be758c822f331019adc6634d7512cf6f", "score": "0.53452384", "text": "func (o DataExchangeOutput) Description() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *DataExchange) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "3079dad6fbcadfa7256f0e11d6741d0b", "score": "0.53382796", "text": "func item_txtTemplate() string {\n\tvar tmpl = \"{{- with .Data -}}\\n\" +\n\t\t\"Name: {{ .Name }}\\n\" +\n\t\t\"URL: {{ .PublicUrl }}\\n\" +\n\t\t\"By: {{ .Creator.Name }} \\n\" +\n\t\t\"Created: {{ .Added }}\\n\" +\n\t\t\"Summary: {{ .Description }}\\n\" +\n\t\t\"{{ end -}}\"\n\treturn tmpl\n}", "title": "" }, { "docid": "c3e4425ca45da4ed2f84648d47cd510d", "score": "0.5335474", "text": "func StringItems(items []Item) string {\n var lines []string\n for _, item := range items {\n lines = append(lines, item.String())\n }\n\n return strings.Join(lines, \"\\n\")\n}", "title": "" }, { "docid": "7c086ff99aafa5b70d17f753b7a437ab", "score": "0.53302985", "text": "func (i *Item) String() string {\n\treturn i.FullName\n}", "title": "" }, { "docid": "df793c3f7820164e349f77eee204d580", "score": "0.53288513", "text": "func (*ItemComponent) Descriptor() ([]byte, []int) {\n\treturn file_study_service_survey_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "01cfcc970d4780f7affea04455626e8d", "score": "0.53157085", "text": "func (o DeliveryOutput) Description() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *Delivery) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "df9ec1deb4de4174e2ff7cf0d546d986", "score": "0.5312644", "text": "func (o GoogleCloudRetailV2ProductResponseOutput) Description() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GoogleCloudRetailV2ProductResponse) string { return v.Description }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "427f320717409d575191b52defb8b008", "score": "0.5308699", "text": "func (*Claim_Item_Detail) Descriptor() ([]byte, []int) {\n\treturn file_proto_google_fhir_proto_stu3_resources_proto_rawDescGZIP(), []int{15, 8, 2}\n}", "title": "" }, { "docid": "d1928dc5579dce9b366e766163598299", "score": "0.52939975", "text": "func (item *DDLItem) String() string {\n\treturn fmt.Sprintf(\"first-location: %s ddls: %+v source: %s\", item.FirstLocation, item.DDLs, item.Source)\n}", "title": "" }, { "docid": "4489bbf293922fa039ca8228ec551853", "score": "0.5290551", "text": "func (o LookupProductResultOutput) Description() pulumi.StringOutput {\n\treturn o.ApplyT(func(v LookupProductResult) string { return v.Description }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "1a4e1c563290f97b1776487682af0850", "score": "0.52787274", "text": "func (d *Description) Describe() (string, error) {\n\tvar result bytes.Buffer\n\ttmpl := `{{.Kind}} DESCRIPTION:\n\nA PART OF {{if ne .Lot \"\"}}LOT {{.Lot}}, {{end}}{{if ne .Block \"\"}}BLOCK {{.Block}}, {{end}}{{.Subdivision}} TO {{if ne .City \"\"}}THE CITY OF {{.City}}, {{end}}{{.County}} COUNTY, {{.State}}, BEING MORE PARTICULARLY DESCRIBED AS FOLLOWS:\n{{if eq .Commencement true}}COMMENCING {{else}}BEGINNING {{end}} AT THE {{.Start.Describe}} CORNER OF SAID LOT{{if ne .Lot \"\"}} {{.Lot}}{{end}}; {{$prevtan := 0.0}}{{range $i, $m := .Metes}}{{if ne $i 0}}TO {{$m.Preamble $prevtan}}; {{end}}THENCE {{$m.Describe}} {{end}}TO THE POINT OF BEGINNING, CONTAINING {{.Area}} {{.Unit}} MORE OR LESS.`\n\tt := template.Must(template.New(\"description\").Parse(tmpl))\n\terr := t.Execute(&result, d)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tlegal := result.String()\n\tlastSemi := strings.LastIndex(legal, \";\")\n\tif lastSemi != -1 {\n\t\tlegal = legal[:lastSemi] + legal[lastSemi+1:]\n\t}\n\treturn legal, nil\n}", "title": "" }, { "docid": "720bcf3f1f5563252a660a003ffc6995", "score": "0.52786094", "text": "func (*SupplyRequest_OrderedItem_Item) Descriptor() ([]byte, []int) {\n\treturn file_proto_google_fhir_proto_stu3_resources_proto_rawDescGZIP(), []int{111, 0, 0}\n}", "title": "" }, { "docid": "2330cc203385df6e6b005ac055d6dd21", "score": "0.5271125", "text": "func (m *EducationCourse) GetDescription()(*string) {\n return m.description\n}", "title": "" }, { "docid": "8ec6f741ddcd157b59e759244663a724", "score": "0.5269481", "text": "func (c Company) ItemList(pdf *gofpdf.Fpdf, invoice Invoice) error {\n\n\t// Check if invoice is empty.\n\tif len(invoice.Items) == 0 {\n\t\treturn fmt.Errorf(\"corp.InvoiceHeader: empty invoice\")\n\t}\n\n\tw, _ := pdf.GetPageSize()\n\tpdf.SetFont(\"Times\", \"B\", 12)\n\t_, lpt := pdf.GetFontSize()\n\n\t// Write \"Description\"\n\tpdf.MoveTo(itemList1stColumnX, itemListTopY)\n\tpdf.SetTextColor(greyRGB, greyRGB, greyRGB)\n\tpdf.Write(lpt, descriptionText)\n\n\t// Write \"Price Per Unit\"\n\tpdf.MoveTo(itemList2ndColumnX, itemListTopY)\n\tpdf.WriteAligned(100, lpt, pricePerUnitText, \"R\")\n\n\t// Write \"Quantity\"\n\tpdf.MoveTo(itemList3rdColumnX, itemListTopY)\n\tpdf.WriteAligned(100, lpt, quantityText, \"R\")\n\n\t// Write \"Amount\"\n\tpdf.SetTextColor(0, 0, 0)\n\tpdf.MoveTo(itemList4thColumnX, itemListTopY)\n\tpdf.Write(lpt, amountText)\n\n\t// ***** Start items *****\n\tpdf.SetTextColor(0, 0, 0) // Redundant but useful in case we change colors later.\n\tfor i, item := range invoice.Items {\n\t\titemY := float64(i+1)*4*lpt + itemListTopY\n\t\t// Write description.\n\t\tpdf.MoveTo(itemList1stColumnX, itemY-lpt)\n\t\t// pdf.Write(lpt, item.Description)\n\t\tpdf.MultiCell(200, lpt, item.Description, \"0\", \"TL\", false)\n\n\t\t// Write price per unit.\n\t\tpdf.MoveTo(itemList2ndColumnX, itemY)\n\t\tpdf.WriteAligned(100, lpt, FloatToDollar(item.PricePerUnit), \"R\")\n\t\t// Write quantity.\n\t\tpdf.MoveTo(itemList3rdColumnX, itemY)\n\t\tpdf.WriteAligned(100, lpt, FloatToText(item.Quantity), \"R\")\n\t\t// Write total amount.\n\t\tpdf.MoveTo(itemList4thColumnX, itemY)\n\t\tpdf.Write(lpt, FloatToDollar(item.Quantity*item.PricePerUnit))\n\n\t\t// Draw the grey line after each item.\n\t\tlineY := itemY + 2*lpt\n\t\tpdf.SetFillColor(greyRGB, greyRGB, greyRGB)\n\t\tpdf.Rect(xIndent*0.5, lineY, w-xIndent, itemListLineThickness, \"F\")\n\t}\n\n\t// Draw \"Subtotal\"\n\tcurY := pdf.GetY()\n\tpdf.MoveTo(itemList2ndColumnX, curY+4*lpt)\n\tpdf.SetTextColor(greyRGB, greyRGB, greyRGB)\n\tpdf.Write(lpt, subtotalText)\n\n\tpdf.MoveTo(itemList4thColumnX, curY+4*lpt)\n\tpdf.SetTextColor(0, 0, 0)\n\tpdf.Write(lpt, FloatToDollar(invoice.Total))\n\n\treturn nil\n}", "title": "" }, { "docid": "d4a82cf703a5dd7df19a914ffba239bc", "score": "0.5265457", "text": "func (languages *Languages) Description() string {\n\tconst n int = 3\n\tvar colLen int\n\n\tcounter := languages.Len()\n\tif (counter % n) != 0 {\n\t\tcolLen = counter/n + 1\n\t} else {\n\t\tcolLen = counter / n\n\t}\n\toutput := make([]string, colLen)\n\tfor j := 0; j < colLen; j++ {\n\t\tswitch {\n\t\tcase j+2*colLen < counter:\n\t\t\toutput[j] = fmt.Sprintf(\n\t\t\t\t\"%-25v %-25v %-25v\",\n\t\t\t\tlanguages.Languages[j].String(), languages.Languages[j+colLen].String(), languages.Languages[j+2*colLen].String(),\n\t\t\t)\n\t\tcase j+colLen < counter:\n\t\t\toutput[j] = fmt.Sprintf(\"%-25v %-25v\", languages.Languages[j].String(), languages.Languages[j+colLen].String())\n\t\tdefault:\n\t\t\toutput[j] = fmt.Sprintf(\"%-25v\", languages.Languages[j].String())\n\t\t}\n\t}\n\treturn strings.Join(output, \"\\n\")\n}", "title": "" }, { "docid": "33f808e1e0ed42337b5ae78a8ca2ba11", "score": "0.526222", "text": "func (o DetailOutput) Description() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v Detail) *string { return v.Description }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "c5083d93f023c36126a62965c5385adf", "score": "0.52581775", "text": "func (item RuleItem) String() string {\n\ts := \"RuleItem \"\n\tswitch item.ExprType {\n\tcase CharExpr:\n\t\ts += \"CharExpr\"\n\tcase ClassExpr:\n\t\ts += \"ClassExpr\"\n\tcase SymbolExpr:\n\t\ts += \"SymbolExpr\"\n\tcase DataTypeExpr:\n\t\ts += \"DataTypeExpr\"\n\tcase IdentifierExpr:\n\t\ts += \"IdentifierExpr\"\n\t}\n\ts += \" Expression: [\" + item.ExprString + \"]\"\n\tswitch item.Cardinality {\n\tcase CardinalityOne:\n\t\ts += \" ONE\"\n\tcase CardinalityOneOrMore:\n\t\ts += \" ONE OR MORE\"\n\tcase CardinalityZeroOrOne:\n\t\ts += \"ZERO OR ONE\"\n\tcase CardinalityZeroOrMore:\n\t\ts += \"ZERO OR MORE\"\n\t}\n\treturn s\n}", "title": "" }, { "docid": "d740b0da44ac0ce9cdde88358bc593ac", "score": "0.52556103", "text": "func (o CustomDataIdentifierOutput) Description() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *CustomDataIdentifier) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "d4eb8e9593f9d729d8112daa7475b041", "score": "0.5254428", "text": "func (iit InfeItemType) String() string {\n\ts := iit.string()\n\n\tfor _, r := range s {\n\t\tif unicode.IsPrint(r) == false {\n\t\t\treturn fmt.Sprintf(\"TYPE<0x%08x>\", uint32(iit))\n\t\t}\n\t}\n\n\treturn s\n}", "title": "" }, { "docid": "7c8d204a252bcd2a21051d58548f9e57", "score": "0.525407", "text": "func (ar AttributeRecipe) description(bank map[string]AttributeRecipe) ([]string, error) {\n\tdesc := []string{ar.randSynonym()}\n\n\t// base case\n\n\tif pbChainPrefix < rand.Float64() {\n\t\treturn desc, nil\n\t}\n\n\t// recursive case\n\n\tpfx, err := ar.randPrefix(bank)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tp, err := pfx.description(bank)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdesc = append(p, desc...)\n\treturn desc, nil\n}", "title": "" }, { "docid": "9612fcc4554794b8d269a0e12a3dfed1", "score": "0.52516973", "text": "func (o DetailResponseOutput) Description() pulumi.StringOutput {\n\treturn o.ApplyT(func(v DetailResponse) string { return v.Description }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "df4a17747853e619a7d3b3f033ec33f2", "score": "0.5235257", "text": "func (*Questionnaire_Item) Descriptor() ([]byte, []int) {\n\treturn file_proto_google_fhir_proto_stu3_resources_proto_rawDescGZIP(), []int{92, 0}\n}", "title": "" }, { "docid": "c8e5b09cbb6c34f4437f05cb2ae15fba", "score": "0.5233975", "text": "func (o LookupDataExchangeResultOutput) Description() pulumi.StringOutput {\n\treturn o.ApplyT(func(v LookupDataExchangeResult) string { return v.Description }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "d08c19a076f866c343c20e01e4d801ee", "score": "0.5225359", "text": "func (s Item) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "d759fc6c0db31e94609a2c035a8a8ecb", "score": "0.5224914", "text": "func (*ExplanationOfBenefit_AddedItem_AddedItemsDetail) Descriptor() ([]byte, []int) {\n\treturn file_proto_google_fhir_proto_stu3_resources_proto_rawDescGZIP(), []int{46, 9, 0}\n}", "title": "" }, { "docid": "6aa2ae076f933edb137f1183787fdf4e", "score": "0.5212138", "text": "func (o DiskOutput) Description() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *Disk) pulumi.StringOutput { return v.Description }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "0d89fde85128edf66bf022d437d6235b", "score": "0.52073556", "text": "func (ii IlocItem) String() string {\n\treturn fmt.Sprintf(\"IlocItem<%s>\", ii.InlineString())\n}", "title": "" }, { "docid": "d429639e4f4a01e96a4df007e4b408ef", "score": "0.5203262", "text": "func (o CompliancePackOutput) Description() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *CompliancePack) pulumi.StringOutput { return v.Description }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "d55f57625e47ae8c2672e96ad0ed89cd", "score": "0.5189629", "text": "func (*SurveyItem) Descriptor() ([]byte, []int) {\n\treturn file_study_service_survey_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "53b451d31bbcd4677c73722970b16350", "score": "0.51866466", "text": "func (*Item) Descriptor() ([]byte, []int) {\n\treturn file_productSearch_v1_productSearch_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "ccaa742ebc6a4fb51c4d93820cab01a8", "score": "0.5169527", "text": "func addItemInfo() (string, string, int, float64) {\n\tvar addItemName string\n\tvar addCategory string\n\tvar addUnits int\n\tvar addCost float64\n\tfmt.Println(\"What is the name of your item?\")\n\tfmt.Scanln(&addItemName)\n\tfmt.Println(\"What category does it belong to?\")\n\tfmt.Scanln(&addCategory)\n\tfmt.Println(\"How many units are there?\")\n\tfmt.Scanln(&addUnits)\n\tfmt.Println(\"How much does it cost per unit?\")\n\tfmt.Scanln(&addCost)\n\treturn addItemName, addCategory, addUnits, addCost\n\n}", "title": "" }, { "docid": "026efd65ef11d37ec251273c4d7ba7a3", "score": "0.51682025", "text": "func (*LineItem) Descriptor() ([]byte, []int) {\n\treturn file_pkg_playstore_playstore_proto_rawDescGZIP(), []int{20}\n}", "title": "" }, { "docid": "d70fb8b9410b15ba6e0c1d624bd1c7ca", "score": "0.5158666", "text": "func (t ItemType) String() string {\n\treturn string(t)\n}", "title": "" }, { "docid": "564bbc69998a36fb86876f5190afa3ce", "score": "0.51586276", "text": "func (*Sku) Descriptor() ([]byte, []int) {\n\treturn file_chameleon_smelter_v1_crawl_item_product_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "495a6489d83e71f71994767728631ec1", "score": "0.5151021", "text": "func (o ReleaseOutput) Description() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *Release) pulumi.StringOutput { return v.Description }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "4dbeea529b9a0fcfd9c443e69d72cf5a", "score": "0.51484436", "text": "func (*Questionnaire_Item) Descriptor() ([]byte, []int) {\n\treturn file_proto_google_fhir_proto_r4_core_resources_questionnaire_proto_rawDescGZIP(), []int{0, 2}\n}", "title": "" }, { "docid": "ee04474bdd6e9fac8d73047c1528a535", "score": "0.5143265", "text": "func (*ExplanationOfBenefit_AddedItem) Descriptor() ([]byte, []int) {\n\treturn file_proto_google_fhir_proto_stu3_resources_proto_rawDescGZIP(), []int{46, 9}\n}", "title": "" }, { "docid": "5390c358a8c35852d6002a4c5705c6da", "score": "0.51379496", "text": "func (*Medication_Package_Content_Item) Descriptor() ([]byte, []int) {\n\treturn file_proto_google_fhir_proto_stu3_resources_proto_rawDescGZIP(), []int{66, 1, 0, 0}\n}", "title": "" }, { "docid": "ae5bd4e7b7c51da3a3b7d0bf16a4acf5", "score": "0.51369625", "text": "func (o LookupFlowEntitlementResultOutput) Description() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v LookupFlowEntitlementResult) *string { return v.Description }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "6d1642fa8d5c8f238371fe8dcb900c95", "score": "0.51319885", "text": "func TestReceiptString(t *testing.T) {\n SetupTaxes(0.1, 0.05, 0.05)\n\n receipt := NewReceipt()\n receipt.AddItem(NewItem(1, NewProduct(\"book\"), 12.49))\n receipt.AddItem(NewItem(1, NewProduct(\"music cd\"), 14.99))\n receipt.AddItem(NewItem(1, NewProduct(\"chocolate bar\"), 0.85))\n\n res := `1, book, 12.49\n1, music cd, 16.49\n1, chocolate bar, 0.85\n\nSales Taxes: 1.50\nTotal: 29.83`\n\n if res != receipt.String() {\n t.Errorf(\"Receipt print mismatch\\nGot:\\n%s\\n\\nExpected:\\n%s\", receipt, res)\n }\n}", "title": "" }, { "docid": "34d4f439b99cc7d28a9fd53e6d939cd9", "score": "0.513014", "text": "func (*Purchase) Descriptor() ([]byte, []int) {\n\treturn file_api_ova_purchase_api_ova_purchase_api_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "68b6f712197e5ec952194b3297b6926a", "score": "0.512688", "text": "func (*Product) Descriptor() ([]byte, []int) {\n\treturn file_proto_purchase_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "a076d5a5d17e3058c7173bcc573f7e26", "score": "0.512452", "text": "func (i Item) String() string {\n\treturn i.Path()\n}", "title": "" }, { "docid": "4514c1196b4f28b67d43cc12203a50a1", "score": "0.511568", "text": "func (*QuestionnaireResponse_Item) Descriptor() ([]byte, []int) {\n\treturn file_proto_google_fhir_proto_stu3_resources_proto_rawDescGZIP(), []int{93, 0}\n}", "title": "" }, { "docid": "f4caf143751d59eb42304f1873c04489", "score": "0.5111615", "text": "func (*ExplanationOfBenefit_Item_Detail_SubDetail) Descriptor() ([]byte, []int) {\n\treturn file_proto_google_fhir_proto_stu3_resources_proto_rawDescGZIP(), []int{46, 8, 3, 0}\n}", "title": "" }, { "docid": "6cc11ead0af06c41cb25da4843c4380d", "score": "0.5103539", "text": "func (j *DSConfluence) ItemID(item interface{}) string {\n\tid, _ := Dig(item, []string{\"id\"}, true, false)\n\tversionNumber, _ := Dig(item, []string{\"version\", \"number\"}, true, false)\n\treturn id.(string) + \"#v\" + fmt.Sprintf(\"%.0f\", versionNumber.(float64))\n}", "title": "" }, { "docid": "c232fbd726b00ad7ab2e030ca53910bc", "score": "0.51006615", "text": "func (*TechCategoryItem) Descriptor() ([]byte, []int) {\n\treturn file_parser_technology_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "ad127dc6cd9bf282f0898a5e60a77600", "score": "0.5098572", "text": "func (m *multi) Description() string {\n\treturn m.Name()\n}", "title": "" }, { "docid": "204b8c025c0b7e4f78c36dd97ef33e30", "score": "0.5095966", "text": "func (*ClinicalImpression_Finding_Item) Descriptor() ([]byte, []int) {\n\treturn file_proto_google_fhir_proto_stu3_resources_proto_rawDescGZIP(), []int{17, 2, 0}\n}", "title": "" }, { "docid": "108e15feb4fa6eff04edd4d52be393cb", "score": "0.5095508", "text": "func (*Product) Descriptor() ([]byte, []int) {\n\treturn file_chameleon_smelter_v1_crawl_item_product_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "d93c1f5d7742590fca028f87422289f6", "score": "0.5094602", "text": "func Description(result VetResult, quote string) string {\n\tpermalink := result.Permalink()\n\tslocCount := result.End.Line - result.Start.Line + 1\n\n\tvar b strings.Builder\n\terr := parsed.Execute(&b, IssueResult{\n\t\tVetResult: result,\n\t\tLink: permalink,\n\t\tQuote: quote,\n\t\tSlocCount: slocCount,\n\t})\n\tif err != nil {\n\t\tlog.Printf(\"could not create description: %v\", err)\n\t}\n\treturn b.String()\n}", "title": "" }, { "docid": "66d2fe47c3ba6cb920573c4295122573", "score": "0.50773764", "text": "func (s *mCSVHolder) addToDesc(change string) {\n\ts.description = append(s.description, change)\n}", "title": "" }, { "docid": "74a1f84bf2b2fe9ae0b500060aa417b6", "score": "0.5076309", "text": "func (rcw *ReadComics) GetComicDescription(doc *goquery.Document) (Description, error) {\n\tvar description Description\n\tdescription.Name = strings.TrimSpace(doc.Find(\".listmanga-header\").First().Text())\n\tdescription.Description = strings.TrimSpace(doc.Find(\".manga.well\").ChildrenFiltered(\"p\").Text())\n\tdescription.LargeImg, _ = doc.Find(\".img-responsive\").Attr(\"src\")\n\n\tdoc.Find(\".dl-horizontal\").Find(\"dd\").Each(func(index int, item *goquery.Selection) {\n\t\tswitch index {\n\t\tcase 0:\n\t\t\tdescription.Genre = strings.TrimSpace(item.Text())\n\t\tcase 1:\n\t\t\tdescription.Status = strings.TrimSpace(item.Text())\n\t\tcase 2:\n\t\t\tdescription.AlternateName = strings.TrimSpace(item.Text())\n\t\tcase 3:\n\t\t\tdescription.Author = strings.TrimSpace(item.Text())\n\t\tcase 4:\n\t\t\tdescription.ReleaseYear = strings.TrimSpace(item.Text())\n\t\t}\n\t})\n\treturn description, nil\n}", "title": "" }, { "docid": "f0d557e6df3c1d52685ad0d9e91a9382", "score": "0.5075691", "text": "func (o LookupDiskResultOutput) Description() pulumi.StringOutput {\n\treturn o.ApplyT(func(v LookupDiskResult) string { return v.Description }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "2758768f2d7ef34283c5d00a7e63c8e7", "score": "0.5067918", "text": "func (w *Item) Title() string {\n\treturn w.abstraction.Note.Title\n}", "title": "" }, { "docid": "39b2a6b8249ad4e752513d14b25838ae", "score": "0.5066644", "text": "func (o GoogleType__ExprResponseOutput) Description() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GoogleType__ExprResponse) string { return v.Description }).(pulumi.StringOutput)\n}", "title": "" } ]
78b71e5858e4e214c48e47bdcfa9c8d7
TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. Solidity: function transferOwnership(newOwner address) returns()
[ { "docid": "e435d5573c7bf10b15bb47b3c921412e", "score": "0.0", "text": "func (_Ownable *OwnableSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _Ownable.Contract.TransferOwnership(&_Ownable.TransactOpts, newOwner)\n}", "title": "" } ]
[ { "docid": "382f31cf410bb515094ab09d5190ba7e", "score": "0.8306734", "text": "func (_MooniswapFactory *MooniswapFactoryTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _MooniswapFactory.contract.Transact(opts, \"transferOwnership\", newOwner)\n}", "title": "" }, { "docid": "4f0b456964dce8c677dbed99e78e5e10", "score": "0.82870775", "text": "func (_MooniswapFactory *MooniswapFactorySession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _MooniswapFactory.Contract.TransferOwnership(&_MooniswapFactory.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "2c70c84db1294cf7c69d621f0ee051ba", "score": "0.8261245", "text": "func (_MooniswapFactory *MooniswapFactoryTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _MooniswapFactory.Contract.TransferOwnership(&_MooniswapFactory.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "bad59d313182954df3af9ffd0775b3f0", "score": "0.8198503", "text": "func (_OwnableWithAccept *OwnableWithAcceptTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _OwnableWithAccept.contract.Transact(opts, \"transferOwnership\", newOwner)\n}", "title": "" }, { "docid": "24e097291428ee885d1e7769037edb05", "score": "0.816549", "text": "func (_Notary *NotaryTransactor) TransferOwnership(opts *bind.TransactOpts, _newOwner common.Address) (*types.Transaction, error) {\n\treturn _Notary.contract.Transact(opts, \"transferOwnership\", _newOwner)\n}", "title": "" }, { "docid": "027e0ca966020b0d00c7a7a97eaacebe", "score": "0.8161862", "text": "func (_Ownable *OwnableTransactor) TransferOwnership(opts *bind.TransactOpts, _newOwner common.Address) (*types.Transaction, error) {\n\treturn _Ownable.contract.Transact(opts, \"transferOwnership\", _newOwner)\n}", "title": "" }, { "docid": "387af3bb9ca19cc01166e25c15a9afd8", "score": "0.8147502", "text": "func (_Aggregator *AggregatorTransactor) TransferOwnership(opts *bind.TransactOpts, _newOwner common.Address) (*types.Transaction, error) {\n\treturn _Aggregator.contract.Transact(opts, \"transferOwnership\", _newOwner)\n}", "title": "" }, { "docid": "4d66a83bf7361db275c2ade0706329e7", "score": "0.8136686", "text": "func (_BankexPlasma *BankexPlasmaTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _BankexPlasma.contract.Transact(opts, \"transferOwnership\", newOwner)\n}", "title": "" }, { "docid": "70d618dd0a76c8c836d9f530420ac657", "score": "0.8130221", "text": "func (_Paymentchannel *PaymentchannelTransactor) TransferOwnership(opts *bind.TransactOpts, _newOwner common.Address) (*types.Transaction, error) {\n\treturn _Paymentchannel.contract.Transact(opts, \"transferOwnership\", _newOwner)\n}", "title": "" }, { "docid": "b751d83e6a8482bff7e7ff5418559e6c", "score": "0.81299424", "text": "func (_Owned *OwnedTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _Owned.contract.Transact(opts, \"transferOwnership\", newOwner)\n}", "title": "" }, { "docid": "2c70bd55a5107c5babc29f54b64d2589", "score": "0.8123723", "text": "func (_Ownable *OwnableTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _Ownable.contract.Transact(opts, \"transferOwnership\", newOwner)\n}", "title": "" }, { "docid": "2c70bd55a5107c5babc29f54b64d2589", "score": "0.8123723", "text": "func (_Ownable *OwnableTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _Ownable.contract.Transact(opts, \"transferOwnership\", newOwner)\n}", "title": "" }, { "docid": "e04cf0cdb9e3a2ec5578764c73f6c0b8", "score": "0.8093599", "text": "func (_Bike *BikeTransactor) TransferOwnership(opts *bind.TransactOpts, _newOwner common.Address) (*types.Transaction, error) {\n\treturn _Bike.contract.Transact(opts, \"transferOwnership\", _newOwner)\n}", "title": "" }, { "docid": "783db48b4724fc74c0c53933ac42527a", "score": "0.80892754", "text": "func (_OwnableWithAccept *OwnableWithAcceptTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _OwnableWithAccept.Contract.TransferOwnership(&_OwnableWithAccept.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "f34334304ef462f249720dcc2b1e87d5", "score": "0.80739176", "text": "func (_IOTX *IOTXTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _IOTX.contract.Transact(opts, \"transferOwnership\", newOwner)\n}", "title": "" }, { "docid": "124ec27fb21a66595f76cc75ad874710", "score": "0.8067186", "text": "func (_PointCoin *PointCoinTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _PointCoin.contract.Transact(opts, \"transferOwnership\", newOwner)\n}", "title": "" }, { "docid": "f54c2937aa30c09261f6bd36b0985bb0", "score": "0.8065555", "text": "func (_Airdrop *AirdropTransactor) TransferOwnership(opts *bind.TransactOpts, _newOwner common.Address) (*types.Transaction, error) {\n\treturn _Airdrop.contract.Transact(opts, \"transferOwnership\", _newOwner)\n}", "title": "" }, { "docid": "83f00264409bd25d33af4caeb969cec5", "score": "0.8064441", "text": "func (_Payments *PaymentsTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _Payments.contract.Transact(opts, \"transferOwnership\", newOwner)\n}", "title": "" }, { "docid": "cbd8af67376657486777066ea7eddebe", "score": "0.8059225", "text": "func (_DefiFMintAddressProvider *DefiFMintAddressProviderSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _DefiFMintAddressProvider.Contract.TransferOwnership(&_DefiFMintAddressProvider.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "e64e41a63995d28cac3d4332cc220116", "score": "0.8052821", "text": "func (_Opslp *OpslpTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _Opslp.contract.Transact(opts, \"transferOwnership\", newOwner)\n}", "title": "" }, { "docid": "aba509b4ffd1cfd93af7abcee5b091ba", "score": "0.80474794", "text": "func (_DefiFMintAddressProvider *DefiFMintAddressProviderTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _DefiFMintAddressProvider.Contract.TransferOwnership(&_DefiFMintAddressProvider.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "533e064436ebfd5161f7de90d355c5f5", "score": "0.8046135", "text": "func (_Aggregator *AggregatorTransactorSession) TransferOwnership(_newOwner common.Address) (*types.Transaction, error) {\n\treturn _Aggregator.Contract.TransferOwnership(&_Aggregator.TransactOpts, _newOwner)\n}", "title": "" }, { "docid": "dabcd940c417bc4730fbfd6b8f58aff2", "score": "0.80423814", "text": "func (_Paymentchannel *PaymentchannelTransactorSession) TransferOwnership(_newOwner common.Address) (*types.Transaction, error) {\n\treturn _Paymentchannel.Contract.TransferOwnership(&_Paymentchannel.TransactOpts, _newOwner)\n}", "title": "" }, { "docid": "d98c7197c59c412aaa987c82ac362352", "score": "0.8033682", "text": "func (_Staking *StakingTransactor) TransferOwnership(opts *bind.TransactOpts, _newOwner common.Address) (*types.Transaction, error) {\n\treturn _Staking.contract.Transact(opts, \"transferOwnership\", _newOwner)\n}", "title": "" }, { "docid": "0ef29d812d5f5b46904d7642039eb661", "score": "0.8029206", "text": "func (_PointCoin *PointCoinTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _PointCoin.Contract.TransferOwnership(&_PointCoin.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "2589ee36dbfb821fb6ee5061043633b7", "score": "0.8024126", "text": "func (_Registry *RegistryTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _Registry.contract.Transact(opts, \"transferOwnership\", newOwner)\n}", "title": "" }, { "docid": "20c51042b217a4c445a88fe47de751b9", "score": "0.80202866", "text": "func (_Ownable *OwnableTransactorSession) TransferOwnership(_newOwner common.Address) (*types.Transaction, error) {\n\treturn _Ownable.Contract.TransferOwnership(&_Ownable.TransactOpts, _newOwner)\n}", "title": "" }, { "docid": "0c4c9784ea3817c5ee235b60a37bbdbb", "score": "0.8015045", "text": "func (_Token *TokenTransactor) TransferOwnership(opts *bind.TransactOpts, _newOwner common.Address) (*types.Transaction, error) {\n\treturn _Token.contract.Transact(opts, \"transferOwnership\", _newOwner)\n}", "title": "" }, { "docid": "64b396d1d0974e798a95fd24b69a775e", "score": "0.800911", "text": "func (_Notary *NotaryTransactorSession) TransferOwnership(_newOwner common.Address) (*types.Transaction, error) {\n\treturn _Notary.Contract.TransferOwnership(&_Notary.TransactOpts, _newOwner)\n}", "title": "" }, { "docid": "52b7eeb490dbf21050f063d831d515d6", "score": "0.8006059", "text": "func (_Controller *ControllerTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _Controller.contract.Transact(opts, \"transferOwnership\", newOwner)\n}", "title": "" }, { "docid": "117277032980ddb27aae76b89931dd77", "score": "0.80032986", "text": "func (_Collateral *CollateralTransactor) TransferOwnership(opts *bind.TransactOpts, _newOwner common.Address) (*types.Transaction, error) {\n\treturn _Collateral.contract.Transact(opts, \"transferOwnership\", _newOwner)\n}", "title": "" }, { "docid": "089bc95eb34cf29bd9594859b2ff1d2b", "score": "0.80008936", "text": "func (_Airdrop *AirdropTransactorSession) TransferOwnership(_newOwner common.Address) (*types.Transaction, error) {\n\treturn _Airdrop.Contract.TransferOwnership(&_Airdrop.TransactOpts, _newOwner)\n}", "title": "" }, { "docid": "d4ffeb787bc4d71b23513a0bd4689028", "score": "0.8000789", "text": "func (_OwnableWithAccept *OwnableWithAcceptSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _OwnableWithAccept.Contract.TransferOwnership(&_OwnableWithAccept.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "e59ea678bebb7829d8fd6b0cec81480d", "score": "0.7998298", "text": "func (_MicroPaySystem *MicroPaySystemTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _MicroPaySystem.contract.Transact(opts, \"transferOwnership\", newOwner)\n}", "title": "" }, { "docid": "b6127b3475a2fc2f60774ae4de7cfdca", "score": "0.79966366", "text": "func (_PaletteToken *PaletteTokenTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _PaletteToken.contract.Transact(opts, \"transferOwnership\", newOwner)\n}", "title": "" }, { "docid": "4bed2595bfa69611975f493c93a45a9d", "score": "0.7994817", "text": "func (_HoQuConfig *HoQuConfigTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _HoQuConfig.contract.Transact(opts, \"transferOwnership\", newOwner)\n}", "title": "" }, { "docid": "889117dde6d49a457f4b1cd847b6be32", "score": "0.7985238", "text": "func (_Staking *StakingTransactorSession) TransferOwnership(_newOwner common.Address) (*types.Transaction, error) {\n\treturn _Staking.Contract.TransferOwnership(&_Staking.TransactOpts, _newOwner)\n}", "title": "" }, { "docid": "3f91d9fe41cc62d27555e33eb7a5d018", "score": "0.7981081", "text": "func (_Opslp *OpslpTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _Opslp.Contract.TransferOwnership(&_Opslp.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "74dd9df9e9dce74fbbb1bcf185827ccb", "score": "0.79799664", "text": "func (_Owned *OwnedTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _Owned.Contract.TransferOwnership(&_Owned.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "82b0132c99056749c086fc4c4aad0217", "score": "0.79782647", "text": "func (_Aggregator *AggregatorSession) TransferOwnership(_newOwner common.Address) (*types.Transaction, error) {\n\treturn _Aggregator.Contract.TransferOwnership(&_Aggregator.TransactOpts, _newOwner)\n}", "title": "" }, { "docid": "fa75b5f53ad8dc8681bace68fe952c8b", "score": "0.7966482", "text": "func (_DefiFMintAddressProvider *DefiFMintAddressProviderTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _DefiFMintAddressProvider.contract.Transact(opts, \"transferOwnership\", newOwner)\n}", "title": "" }, { "docid": "a635b933a10a355f7e53a6f7aa70912e", "score": "0.79655224", "text": "func (_Nft1155 *Nft1155Transactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _Nft1155.contract.Transact(opts, \"transferOwnership\", newOwner)\n}", "title": "" }, { "docid": "02f7afc32c2d86683e2dc2d44b40dbc6", "score": "0.7964972", "text": "func (_TokenRegistry *TokenRegistryTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _TokenRegistry.contract.Transact(opts, \"transferOwnership\", newOwner)\n}", "title": "" }, { "docid": "ed53722d53659a7205083214666c7524", "score": "0.7960127", "text": "func (_Opslp *OpslpSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _Opslp.Contract.TransferOwnership(&_Opslp.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "8a6ce4417c32a8586b53bee42627f09a", "score": "0.795982", "text": "func (_PointCoin *PointCoinSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _PointCoin.Contract.TransferOwnership(&_PointCoin.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "7f1193d4607b6bd6a083d45e499e7662", "score": "0.79408675", "text": "func (_Controller *ControllerTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _Controller.Contract.TransferOwnership(&_Controller.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "fe856ab265b7f761bd4668e248123f4c", "score": "0.7939939", "text": "func (_ERC721Token *ERC721TokenTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _ERC721Token.contract.Transact(opts, \"transferOwnership\", newOwner)\n}", "title": "" }, { "docid": "2b9c36dc53905949f889fa8846ce0e6b", "score": "0.7939389", "text": "func (_LifCrowdsale *LifCrowdsaleTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _LifCrowdsale.contract.Transact(opts, \"transferOwnership\", newOwner)\n}", "title": "" }, { "docid": "c7b440fb12d348e50d8dd94e499950c8", "score": "0.7934467", "text": "func (_Access *AccessTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _Access.Contract.TransferOwnership(&_Access.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "a73e6a359582a086971086b70c1cf08c", "score": "0.793442", "text": "func (_Ownable *OwnableTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _Ownable.Contract.TransferOwnership(&_Ownable.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "a73e6a359582a086971086b70c1cf08c", "score": "0.793442", "text": "func (_Ownable *OwnableTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _Ownable.Contract.TransferOwnership(&_Ownable.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "45344a980c03f8c32ea02c5029f1634b", "score": "0.7933925", "text": "func (_Payments *PaymentsTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _Payments.Contract.TransferOwnership(&_Payments.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "b117cc013a95df16a6471040988ec9ec", "score": "0.7933652", "text": "func (_Bike *BikeTransactorSession) TransferOwnership(_newOwner common.Address) (*types.Transaction, error) {\n\treturn _Bike.Contract.TransferOwnership(&_Bike.TransactOpts, _newOwner)\n}", "title": "" }, { "docid": "d4b072f53e10f7e7803965344d78b3b8", "score": "0.7932155", "text": "func (_MicroPaySystem *MicroPaySystemTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _MicroPaySystem.Contract.TransferOwnership(&_MicroPaySystem.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "50d7435657a71cbd09019578eadb2a18", "score": "0.79307634", "text": "func (_Airdrop *AirdropSession) TransferOwnership(_newOwner common.Address) (*types.Transaction, error) {\n\treturn _Airdrop.Contract.TransferOwnership(&_Airdrop.TransactOpts, _newOwner)\n}", "title": "" }, { "docid": "6329ccd320547ab88ef437a821991115", "score": "0.792771", "text": "func (_Staking *StakingSession) TransferOwnership(_newOwner common.Address) (*types.Transaction, error) {\n\treturn _Staking.Contract.TransferOwnership(&_Staking.TransactOpts, _newOwner)\n}", "title": "" }, { "docid": "9f93a97c1f3ef0b3ae9351700a9b56c0", "score": "0.7925966", "text": "func (_Registry *RegistryTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _Registry.Contract.TransferOwnership(&_Registry.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "00a79765087887613a3b35487cdccc42", "score": "0.79165024", "text": "func (_Collateral *CollateralTransactorSession) TransferOwnership(_newOwner common.Address) (*types.Transaction, error) {\n\treturn _Collateral.Contract.TransferOwnership(&_Collateral.TransactOpts, _newOwner)\n}", "title": "" }, { "docid": "f4e5a6907b557363d083671cd15a16bf", "score": "0.7911001", "text": "func (_BankexPlasma *BankexPlasmaTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _BankexPlasma.Contract.TransferOwnership(&_BankexPlasma.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "52a56de804182ddf65e7b8617ac93080", "score": "0.7908286", "text": "func (_BankexPlasma *BankexPlasmaSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _BankexPlasma.Contract.TransferOwnership(&_BankexPlasma.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "29c49ede719bb5e190532306b91b3148", "score": "0.79079175", "text": "func (_Dosbridge *DosbridgeTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _Dosbridge.contract.Transact(opts, \"transferOwnership\", newOwner)\n}", "title": "" }, { "docid": "422c1dcf9d127eb5d1985bf01d14d81b", "score": "0.7906506", "text": "func (_Paymentchannel *PaymentchannelSession) TransferOwnership(_newOwner common.Address) (*types.Transaction, error) {\n\treturn _Paymentchannel.Contract.TransferOwnership(&_Paymentchannel.TransactOpts, _newOwner)\n}", "title": "" }, { "docid": "afbcaf81f65b4b0bd4693f5561846f98", "score": "0.79061687", "text": "func (_Migrations *MigrationsTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _Migrations.contract.Transact(opts, \"transferOwnership\", newOwner)\n}", "title": "" }, { "docid": "429f33cecb5cc6d01e741a5335f427c2", "score": "0.79021084", "text": "func (_DAIToken *DAITokenTransactor) TransferOwnership(opts *bind.TransactOpts, _newOwner common.Address) (*types.Transaction, error) {\n\treturn _DAIToken.contract.Transact(opts, \"transferOwnership\", _newOwner)\n}", "title": "" }, { "docid": "951ef73df8573dfe97d2b0a039ee345b", "score": "0.7896753", "text": "func (_Token *TokenTransactorSession) TransferOwnership(_newOwner common.Address) (*types.Transaction, error) {\n\treturn _Token.Contract.TransferOwnership(&_Token.TransactOpts, _newOwner)\n}", "title": "" }, { "docid": "fbf1b4a7244a925912c1a554daf0443e", "score": "0.78938365", "text": "func (_MockOracle *MockOracleTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _MockOracle.contract.Transact(opts, \"transferOwnership\", newOwner)\n}", "title": "" }, { "docid": "45fe78df5f2af7685e23dd41072d3a17", "score": "0.7891716", "text": "func (_IOTX *IOTXTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _IOTX.Contract.TransferOwnership(&_IOTX.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "b08e53a562354c02eec9b8123d1eff9b", "score": "0.78915834", "text": "func (_SingleMessage *SingleMessageTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _SingleMessage.contract.Transact(opts, \"transferOwnership\", newOwner)\n}", "title": "" }, { "docid": "90be61bd355ff6154efc7cfe1991837d", "score": "0.78874975", "text": "func (_MintableToken *MintableTokenTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _MintableToken.contract.Transact(opts, \"transferOwnership\", newOwner)\n}", "title": "" }, { "docid": "f422014fe9e591fb7329f48b51e36220", "score": "0.78868085", "text": "func (_Controller *ControllerSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _Controller.Contract.TransferOwnership(&_Controller.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "a02fa0c5f7e743011a18b424874a1c8d", "score": "0.78836626", "text": "func (_BaasToken *BaasTokenTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _BaasToken.contract.Transact(opts, \"transferOwnership\", newOwner)\n}", "title": "" }, { "docid": "4f1083c5ccd6796c0badc89196879ffc", "score": "0.7878402", "text": "func (a *ERC20) TransferOwnership(newOwner web3.Address) *contract.Txn {\n\treturn a.c.Txn(\"transferOwnership\", newOwner)\n}", "title": "" }, { "docid": "80146416fb7b4a92d2f21c603c170f92", "score": "0.7876603", "text": "func (_Berry *BerryTransactor) TransferOwnership(opts *bind.TransactOpts, _newOwner common.Address) (*types.Transaction, error) {\n\treturn _Berry.contract.Transact(opts, \"transferOwnership\", _newOwner)\n}", "title": "" }, { "docid": "a87ac8e5508f272bb12841a85f8cf2e6", "score": "0.78753024", "text": "func (_Collateral *CollateralSession) TransferOwnership(_newOwner common.Address) (*types.Transaction, error) {\n\treturn _Collateral.Contract.TransferOwnership(&_Collateral.TransactOpts, _newOwner)\n}", "title": "" }, { "docid": "bf1c21f840b1d300c51b9e5ba470bb16", "score": "0.78705996", "text": "func (_Payments *PaymentsSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _Payments.Contract.TransferOwnership(&_Payments.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "5f393c3407558081770a753a20b049b5", "score": "0.78669506", "text": "func (_DowntimeSlasher *DowntimeSlasherTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _DowntimeSlasher.contract.Transact(opts, \"transferOwnership\", newOwner)\n}", "title": "" }, { "docid": "e45c36313d53a470f02047b2f83ec5a2", "score": "0.7863316", "text": "func (_GasPriceOracle *GasPriceOracleTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _GasPriceOracle.contract.Transact(opts, \"transferOwnership\", newOwner)\n}", "title": "" }, { "docid": "854a4bcf1dfbf671bc6f071b7eda7b94", "score": "0.7862707", "text": "func (_Bridge *BridgeTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _Bridge.contract.Transact(opts, \"transferOwnership\", newOwner)\n}", "title": "" }, { "docid": "ea6d89604c3216fd3962b765f2e172f0", "score": "0.78615063", "text": "func (_Owned *OwnedSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _Owned.Contract.TransferOwnership(&_Owned.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "3ac4148fffe098edcc74642a4f9ad6c4", "score": "0.78599775", "text": "func (_MicroPaySystem *MicroPaySystemSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _MicroPaySystem.Contract.TransferOwnership(&_MicroPaySystem.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "14b8d33330bbc2f9e3889f93f86ebe0d", "score": "0.785711", "text": "func (_SampleCrowdsale *SampleCrowdsaleTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {\n\treturn _SampleCrowdsale.contract.Transact(opts, \"transferOwnership\", newOwner)\n}", "title": "" }, { "docid": "924b214150547de6c7cde7d93dc1b60f", "score": "0.78545296", "text": "func (_Ownable *OwnableSession) TransferOwnership(_newOwner common.Address) (*types.Transaction, error) {\n\treturn _Ownable.Contract.TransferOwnership(&_Ownable.TransactOpts, _newOwner)\n}", "title": "" }, { "docid": "80c8ddbcd824c14eae50148daf3142f1", "score": "0.7854341", "text": "func (_Access *AccessSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _Access.Contract.TransferOwnership(&_Access.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "8950a30ce7a81e2289647eb619082c2e", "score": "0.7852754", "text": "func (_IOTX *IOTXSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _IOTX.Contract.TransferOwnership(&_IOTX.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "07d61bdd67c9398040ba1f124912edb5", "score": "0.7846732", "text": "func (_Bike *BikeSession) TransferOwnership(_newOwner common.Address) (*types.Transaction, error) {\n\treturn _Bike.Contract.TransferOwnership(&_Bike.TransactOpts, _newOwner)\n}", "title": "" }, { "docid": "74f8403a4dc404f321645ff6c12f59d5", "score": "0.7841419", "text": "func (_TokenRegistry *TokenRegistryTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _TokenRegistry.Contract.TransferOwnership(&_TokenRegistry.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "9e1f2bfe6ab54b9c740dade7a0cd9c9c", "score": "0.7834165", "text": "func (_Token *TokenSession) TransferOwnership(_newOwner common.Address) (*types.Transaction, error) {\n\treturn _Token.Contract.TransferOwnership(&_Token.TransactOpts, _newOwner)\n}", "title": "" }, { "docid": "9ee3eef6b947c3d161dd85ff7b3afa77", "score": "0.78315485", "text": "func (_Migrations *MigrationsTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _Migrations.Contract.TransferOwnership(&_Migrations.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "3adb94c10b1b16f98f1e80fb4a504d68", "score": "0.7829452", "text": "func (_ShadowAggregator *ShadowAggregatorTransactor) TransferOwnership(opts *bind.TransactOpts, _to common.Address) (*types.Transaction, error) {\n\treturn _ShadowAggregator.contract.Transact(opts, \"transferOwnership\", _to)\n}", "title": "" }, { "docid": "6d4354127fde468f6dccb88e753206ae", "score": "0.78239584", "text": "func (_Registry *RegistrySession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _Registry.Contract.TransferOwnership(&_Registry.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "1ec9e10fa7feef467ac125981fd1cc0d", "score": "0.78212184", "text": "func (_Dosbridge *DosbridgeTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _Dosbridge.Contract.TransferOwnership(&_Dosbridge.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "8efc0bf37d5d74873b7e89ca4df787e6", "score": "0.78156984", "text": "func (_MockOracle *MockOracleTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _MockOracle.Contract.TransferOwnership(&_MockOracle.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "fa3afccfccc7abd28eb12068b5cfb28a", "score": "0.78146404", "text": "func (_Notary *NotarySession) TransferOwnership(_newOwner common.Address) (*types.Transaction, error) {\n\treturn _Notary.Contract.TransferOwnership(&_Notary.TransactOpts, _newOwner)\n}", "title": "" }, { "docid": "0ae267215e2d033f954f3466bc428024", "score": "0.7812943", "text": "func (_DAIToken *DAITokenTransactorSession) TransferOwnership(_newOwner common.Address) (*types.Transaction, error) {\n\treturn _DAIToken.Contract.TransferOwnership(&_DAIToken.TransactOpts, _newOwner)\n}", "title": "" }, { "docid": "e6ee4dad077acb7a0625f1dde14329f0", "score": "0.78072673", "text": "func (_SingleMessage *SingleMessageTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _SingleMessage.Contract.TransferOwnership(&_SingleMessage.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "7b0a18284f1a707ed5d96caecb643edd", "score": "0.77956444", "text": "func (_PaletteToken *PaletteTokenTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _PaletteToken.Contract.TransferOwnership(&_PaletteToken.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "b22c21a655135fb15d3567686e621af7", "score": "0.7791276", "text": "func (_Berry *BerryTransactorSession) TransferOwnership(_newOwner common.Address) (*types.Transaction, error) {\n\treturn _Berry.Contract.TransferOwnership(&_Berry.TransactOpts, _newOwner)\n}", "title": "" }, { "docid": "809fa130508cabfa54a3747c98eeedea", "score": "0.77892834", "text": "func (_MockOracle *MockOracleSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _MockOracle.Contract.TransferOwnership(&_MockOracle.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "8da9d2978f75a27ece967f276dd27f23", "score": "0.7779328", "text": "func (_BaasToken *BaasTokenTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _BaasToken.Contract.TransferOwnership(&_BaasToken.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "eb46dd78757129ee6232152748053cf3", "score": "0.7779253", "text": "func (_ERC721Token *ERC721TokenTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _ERC721Token.Contract.TransferOwnership(&_ERC721Token.TransactOpts, newOwner)\n}", "title": "" }, { "docid": "6c2a981762fd94e41a04028ee3bb8fbf", "score": "0.77701116", "text": "func (_Migrations *MigrationsSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {\n\treturn _Migrations.Contract.TransferOwnership(&_Migrations.TransactOpts, newOwner)\n}", "title": "" } ]
b76ea416b0c9e25ad362692152e0c994
LoadOrStoreConnection returns the UDPConn associated with the host or store a new connection.
[ { "docid": "98202550d02af7cb8b37a2c7d723cbab", "score": "0.7598193", "text": "func (tbl *NatTable) LoadOrStoreConnection(host Host, conn *net.UDPConn) (*net.UDPConn, bool) {\n\tvalue, loaded := tbl.LoadOrStore(host, conn)\n\tnewConn := value.(*net.UDPConn)\n\treturn newConn, loaded\n}", "title": "" } ]
[ { "docid": "1970612f64eb219ca2bb5417cf2c039e", "score": "0.62750256", "text": "func (rpc RPC) GetConnection(d *Daemon, addr string) *Connection {\n\tif d.Pool.Pool == nil {\n\t\treturn nil\n\t}\n\n\tc, err := d.Pool.Pool.GetConnection(addr)\n\tif err != nil {\n\t\tlogger.Error(err)\n\t\treturn nil\n\t}\n\n\tif c == nil {\n\t\treturn nil\n\t}\n\n\tmirror, exist := d.connectionMirrors.Get(addr)\n\tif !exist {\n\t\treturn nil\n\t}\n\n\treturn &Connection{\n\t\tID: c.ID,\n\t\tAddr: addr,\n\t\tLastSent: c.LastSent.Unix(),\n\t\tLastReceived: c.LastReceived.Unix(),\n\t\tOutgoing: !d.outgoingConnections.Get(addr),\n\t\tIntroduced: !d.needsIntro(addr),\n\t\tMirror: mirror,\n\t\tListenPort: d.GetListenPort(addr),\n\t}\n}", "title": "" }, { "docid": "1b0fbcd0feac3c686feee6258bfdb5ba", "score": "0.60476595", "text": "func (cs *Clients) Get(address string) (*net.UDPConn, error) {\n\tconn, ok := cs.Load(address)\n\tif !ok {\n\t\tconn, err := net.Dial(\"udp\", address)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcs.Store(address, conn)\n\t\treturn conn.(*net.UDPConn), nil\n\t}\n\treturn conn.(*net.UDPConn), nil\n}", "title": "" }, { "docid": "1ae9f3de14b602fb59fac7425ac0d666", "score": "0.6027713", "text": "func (p *ProxyTunnelUDPDialer) GetConn() (net.Conn, error) {\n\tif p.Addr == nil {\n\t\treturn nil, errors.New(\"not init dailer address\")\n\t}\n\taddr := p.Addr.UDPAddr\n\tconn, err := net.Dial(addr.Network(), addr.String())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn conn, nil\n}", "title": "" }, { "docid": "9b3d847c0291c280399afa95e85c0af3", "score": "0.5909721", "text": "func (tbl *NatTable) LoadConnection(host Host) (conn *net.UDPConn, ok bool) {\n\tvalue, ok := tbl.Load(host)\n\tif !ok {\n\t\treturn nil, false\n\t}\n\n\tconn, ok = value.(*net.UDPConn)\n\treturn\n}", "title": "" }, { "docid": "47dc3c394ebcb122942821d3b45d8a62", "score": "0.5826579", "text": "func(p *Pool) Get() (*connection, error) {\n //lock\n p.mutex.Lock()\n defer p.mutex.Unlock()\n length := len(p.conn)\n if length > 0 {\n return p.conn[length-1], nil\n }\n\n //conn is empty\n runningNum := int(atomic.LoadInt32(&p.running))\n if runningNum >= p.maxNum {\n return nil, poolOverload\n }\n\n //new one conn\n c, err := p.create(p.addr)\n\tif err != nil {\n return nil, createConnFail\n }\n\tconn := &connection{\n\t Conn : c,\n\t\texpiry : time.Now(),\n\t}\n\tatomic.AddInt32(&p.running, 1)\n return conn, err\n}", "title": "" }, { "docid": "7ce41c6cc56ae911edf62dc0609cf2ff", "score": "0.57748854", "text": "func GetConnByHost(hostName string) (*gorm.DB, error) {\n\n\tif hostName == \"\" {\n\t\tconnection, found := dbConnections[defaultHost]\n\t\tif !found {\n\t\t\tloghelper.LogError(\"Connection not found!\")\n\t\t\treturn nil, errors.New(\"Connection not found\")\n\t\t}\n\t\treturn connection, nil\n\t}\n\n\tconnection, found := dbConnections[hostName]\n\tif !found {\n\t\tloghelper.LogError(\"Connection not found for \", hostName)\n\t\treturn nil, errors.New(\"Connection not found for \" + hostName)\n\t}\n\treturn connection, nil\n\n}", "title": "" }, { "docid": "0eec5bae564d84c0504942a2689c1e78", "score": "0.57632446", "text": "func (dm *Daemon) GetConnection(addr string) (*Connection, error) {\n\tc := dm.connections.get(addr)\n\tif c == nil {\n\t\treturn nil, nil\n\t}\n\n\treturn dm.newConnection(c)\n}", "title": "" }, { "docid": "955f9f3ca613833e7555c503b66a175e", "score": "0.57134306", "text": "func (cp *Pool) Get() (net.Conn, error) {\n\tlog.Debugf(\"Trying to get connection\")\n\t// Try to grab an available connection within 1ms\n\tselect {\n\tcase conn := <-cp.connections:\n\t\treturn prepareConnection(conn)\n\tcase <-time.After(time.Millisecond):\n\t\t// No connection came around in time, let's see\n\t\t// whether we can get one or build a new one first.\n\t\tlog.Debugf(\"No connection in pool\")\n\t\tselect {\n\t\tcase conn := <-cp.connections:\n\t\t\treturn prepareConnection(conn)\n\t\tcase cp.createsem <- true:\n\t\t\t// Room to make a connection\n\t\t\tlog.Debugf(\"About to connect\")\n\t\t\tconn, err := net.Dial(\"tcp\", cp.host)\n\t\t\tif err != nil {\n\t\t\t\t// On error, release our create hold\n\t\t\t\t<-cp.createsem\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn prepareConnection(conn)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d0d5a5bb417d75abf3e1804cd21fe64c", "score": "0.561713", "text": "func (p AddrTCPConnPool) Get(addr string) (c *net.TCPConn, err error) {\n\tvar rp *ResourcePool\n\n\tp.lock.Lock()\n\trp, ok := p.pools[addr]\n\tif !ok {\n\t\trp = NewResourcePool(func() (Resource, error) {\n\t\t\tc, err := net.Dial(\"tcp\", addr)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn Close{Value: c.(*net.TCPConn)}, nil\n\t\t}, p.size, p.size, p.timeout)\n\t\tp.pools[addr] = rp\n\t}\n\tp.lock.Unlock()\n\n\tr, err := rp.Get(context.TODO())\n\tif err != nil {\n\t\treturn\n\t}\n\tc = r.(Close).Value.(*net.TCPConn)\n\treturn\n}", "title": "" }, { "docid": "1999e0a7647d038dce56dd95fbe610c9", "score": "0.5608318", "text": "func (p *Pool) Get() (net.Conn, error) {\n\tselect {\n\tcase conn := <-p.conns:\n\t\treturn conn, nil\n\tdefault:\n\t\tconn, err := p.dialer()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn conn, nil\n\t}\n}", "title": "" }, { "docid": "7ab5bd020e73bf998d351d688fd473cd", "score": "0.5605362", "text": "func (cp *ConnectionPool) GetConnection() (*ConnectionHost, error) {\n\tcp.poolRWLock.RLock()\n\tconns := cp.connections\n\tcp.poolRWLock.RUnlock()\n\tmaxcount := len(conns)\n\ti := 0\n\tfor {\n\t\tif i == maxcount {\n\t\t\tlog.Debug(cp.logger, \"no free connection, creating new one\")\n\t\t\tbreak\n\t\t}\n\t\tselect {\n\t\tcase conn := <-conns:\n\n\t\t\tif conn.CanTakeMoreChannels(cp.maxChannelsPerConnection) {\n\t\t\t\treturn conn, nil\n\t\t\t}\n\t\t\t// put the connection back in the pool\n\t\t\tcp.connections <- conn\n\t\tdefault:\n\t\t\tbreak\n\t\t}\n\t\ti++\n\t}\n\tlog.Debug(cp.logger, \"creating new channel\")\n\n\tconn, err := cp.createConnection(int(time.Now().Unix() * 1000))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn conn, nil\n\n}", "title": "" }, { "docid": "b825aff4c8d348aded12dc757d379d65", "score": "0.55762964", "text": "func (pool *ConnectionPool) GetConnection(addr string) (*Connection, error) {\n\tvar conn *Connection\n\tif err := pool.strand(\"GetConnection\", func() error {\n\t\tif c, ok := pool.addresses[addr]; ok {\n\t\t\t// copy connection\n\t\t\tcc := *c\n\t\t\tconn = &cc\n\t\t}\n\t\treturn nil\n\t}); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn conn, nil\n}", "title": "" }, { "docid": "bdf38890aceea9a946b81122bb24affe", "score": "0.5570742", "text": "func GetUDPConnection(address string) (*net.UDPConn, error) {\n\tudpAddr, err := net.ResolveUDPAddr(\"udp\", address)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn net.DialUDP(\"udp\", nil, udpAddr)\n}", "title": "" }, { "docid": "2a98827fd6bb123af9303e22688093ec", "score": "0.55550516", "text": "func GetConnection(name string) *Connection {\n\treturn connectionPool[name]\n}", "title": "" }, { "docid": "d8c4109dbc4d804eebd4a95247e944a8", "score": "0.5473883", "text": "func (p *Pool) Get(addr string) (net.Conn, bool) {\n\tvalue, ok := p.servers.Load(addr)\n\n\tif !ok {\n\t\treturn nil, false\n\t}\n\tconns := value.(chan net.Conn)\n\n\tselect {\n\tcase conn := <-conns:\n\t\treturn conn, true\n\tdefault:\n\t\tif p.factory == nil {\n\t\t\tlog.Println(\"Factory function is not set for pool\")\n\t\t\treturn nil, false\n\t\t}\n\t\tconn, error := p.factory(addr)\n\n\t\tif error != nil {\n\t\t\tlog.Println(error)\n\t\t\treturn nil, false\n\t\t}\n\t\treturn conn, true\n\t}\n}", "title": "" }, { "docid": "21a3712b00e3c386c61958bffba3acd9", "score": "0.54664725", "text": "func (p *Pool) Get(id ConnectionID) net.Conn {\n\tp.Lock()\n\tdefer p.Unlock()\n\n\tlist, found := p.connsByDest[id]\n\tif !found {\n\t\treturn nil\n\t}\n\tconnIdx := -1\n\tfor idx, conn := range list {\n\t\tif !conn.Expired() {\n\t\t\tconnIdx = idx\n\t\t\tbreak\n\t\t}\n\t}\n\tif connIdx == -1 {\n\t\treturn nil\n\t}\n\tlistLen := len(list)\n\tconn := list[connIdx]\n\tif connIdx != listLen-1 {\n\t\tlist[connIdx] = list[listLen-1]\n\t}\n\tlist = list[:listLen-1]\n\tp.connsByDest[id] = list\n\treturn conn.conn\n}", "title": "" }, { "docid": "8f9139110702f7848bb5a79795d624c8", "score": "0.5462935", "text": "func (cp *connectionPool) GetConnectionByAddr(addr string) (*connection, error) {\n\tif cp.IsClosed() {\n\t\treturn nil, errors.New(\"connection pool is closed\")\n\t}\n\n\tif be := cp.getOrCreateBackend(addr); be != nil {\n\t\tif conn := be.GetConnection(); conn != nil {\n\t\t\treturn conn, nil\n\t\t}\n\t}\n\treturn nil, errors.New(\"failed to get connection\")\n}", "title": "" }, { "docid": "bd01a6dfdaf9fc352e0e27854c6f1e6a", "score": "0.543311", "text": "func (cm *ClientMap) Get(\n\tclientAddr net.Addr,\n\tremote *net.UDPAddr,\n\thandler ServerConnHandler,\n) (*net.UDPConn, error) {\n\tkey := clientAddr.String()\n\n\t// Check if connection exists\n\tcm.mutex.Lock()\n\tdefer cm.mutex.Unlock()\n\n\tif client, ok := cm.clients[key]; ok {\n\t\tclient.lastActive = time.Now()\n\t\treturn client.conn, nil\n\t}\n\n\t// New connection needed\n\tlogger.Printf(\"Opening connection to %s for new client %s!\\n\", remote, clientAddr)\n\tnewServerConn, err := newServerConnection(remote)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcm.clients[key] = &clientEntry{\n\t\tnewServerConn,\n\t\ttime.Now(),\n\t}\n\n\t// Launch goroutine to pass packets from server to client\n\tgo handler(newServerConn)\n\n\treturn newServerConn, nil\n}", "title": "" }, { "docid": "4bf7163876a10422dc5cc5d56ae3ac4b", "score": "0.5430501", "text": "func (p *ProxyTunnelUnixDialer) GetConn() (net.Conn, error) {\n\tif p.Addr == nil {\n\t\treturn nil, errors.New(\"not init dailer address\")\n\t}\n\taddr := p.Addr.UnixAddr\n\tconn, err := net.Dial(addr.Network(), addr.String())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn conn, nil\n}", "title": "" }, { "docid": "fdec423e6b064d3675b98d44b9eea5ba", "score": "0.5427428", "text": "func getConnection(service string) net.Conn {\n\taddress, _ := net.ResolveUDPAddr(\"udp\", service)\n\tconn, err := net.DialUDP(\"udp\", nil, address)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn conn\n}", "title": "" }, { "docid": "57e1ea35c4db2cc63fa52f36fb4088c4", "score": "0.542578", "text": "func getConnection(ip string) *net.UDPConn {\n\tlAddr, err := net.ResolveUDPAddr(\"udp\", ip)\n\tif err != nil {\n\t\tlogger.Fatal(err)\n\t}\n\tl, err := net.ListenUDP(\"udp\", lAddr)\n\tif err != nil {\n\t\tlogger.Fatal(err)\n\t}\n\treturn l\n}", "title": "" }, { "docid": "727e58ebe35abe14df622d8be4c7a66b", "score": "0.54253364", "text": "func (p *Pool) GetConn() (*PoolConn, error) {\n\tc, err := p.PopConn()\n\tif err != nil {\n\t\tfmt.Printf(\"GetConn error : %s \\n\", err)\n\t\treturn nil, err\n\t}\n\treturn &PoolConn{c, p}, nil\n}", "title": "" }, { "docid": "5d07858f11265741967f46ed66ecc2e0", "score": "0.5423093", "text": "func Get() Connection {\n\n\tif connection.HostName != \"\" {\n\t\treturn connection\n\t}\n\tvar once sync.Once\n\n\tonce.Do(func() {\n\t\tconnection = Connection{\n\t\t\tHostName: os.Getenv(kuberaHost),\n\t\t\tUserName: os.Getenv(kuberaUser),\n\t\t\tPassword: os.Getenv(kuberaPass),\n\t\t}\n\t})\n\treturn connection\n\n}", "title": "" }, { "docid": "bd32d52cca0033f6cf211489d343777a", "score": "0.54179686", "text": "func (p *ProxyTunnelTCPDialer) GetConn() (net.Conn, error) {\n\tif p.Addr == nil {\n\t\treturn nil, errors.New(\"not init dailer address\")\n\t}\n\taddr := p.Addr.TCPAddr\n\tconn, err := net.Dial(addr.Network(), addr.String())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn conn, nil\n}", "title": "" }, { "docid": "c1721839e3de69493add4bfc434845fa", "score": "0.53887075", "text": "func (cm *ConnectionsManager) Get(clientID string) *Connection {\n\tconn, exist := cm.connections[clientID]\n\tif exist {\n\t\treturn conn\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1267c319ca588b6bfb5b273f0faff5c4", "score": "0.53821", "text": "func (t *TrackerGroup) GetConnection() (*TrackerServer, error) {\n\tvar currentIndex int\n\tt.lock.Lock()\n\t{\n\t\tt.TrackerServerIndex++\n\t\tif t.TrackerServerIndex >= len(t.TrackerServers) {\n\t\t\tt.TrackerServerIndex = 0\n\t\t}\n\n\t\tcurrentIndex = t.TrackerServerIndex\n\t}\n\tt.lock.Unlock()\n\n\tif server,err := t.GetConnectionByIndex(currentIndex); err == nil {\n\t\treturn server, nil\n\t} else {\n\t\tfmt.Fprintln(os.Stderr, \"connect to server \" + t.TrackerServers[currentIndex].String() + \" fail\")\n\t\tdebug.PrintStack()\n\t}\n\n\tvar trackerServer *TrackerServer\n\tvar err error\n\tfor i := 0; i < len(t.TrackerServers); i++ {\n\t\tif i == currentIndex {\n\t\t\tcontinue\n\t\t}\n\t\ttrackerServer,err = t.GetConnectionByIndex(i)\n\t\tif err == nil {\n\t\t\tt.lock.Lock()\n\t\t\tif t.TrackerServerIndex == currentIndex {\n\t\t\t\tt.TrackerServerIndex = i\n\t\t\t}\n\t\t\tt.lock.Unlock()\n\t\t\treturn trackerServer, nil\n\t\t} else {\n\t\t\tfmt.Fprintln(os.Stderr, \"connect to server \" + t.TrackerServers[i].String() + \" fail\")\n\t\t\tdebug.PrintStack()\n\t\t}\n\t}\n\n\treturn trackerServer, err\n}", "title": "" }, { "docid": "1be6126196d6447539af9eb093a1e2a8", "score": "0.5339715", "text": "func (n *node) getConn(policy ConnHostPolicyEnum, liveness int, seen []*redisconn.Connection) *redisconn.Connection {\n\tif liveness == preferConnected {\n\t\tconn := n.getConnConcreteNeed(policy, needConnected, seen)\n\t\tif conn == nil {\n\t\t\tconn = n.getConnConcreteNeed(policy, mayBeConnected, seen)\n\t\t}\n\t\treturn conn\n\t}\n\treturn n.getConnConcreteNeed(policy, liveness, seen)\n}", "title": "" }, { "docid": "e8d6d759d83fd0a7f902ef88704c761a", "score": "0.53228897", "text": "func (mgr *ConnectionManager) GetConnection(key string) (conn.Connection, bool) {\n\tobj, exist := mgr.connections.Load(key)\n\tif exist {\n\t\treturn obj.(conn.Connection), true\n\t}\n\treturn nil, false\n}", "title": "" }, { "docid": "247b36a2dacc02fc15b1dcc54d7f1a1f", "score": "0.5318912", "text": "func (c *Client) Connect() (conn Connection, err error) {\n conn = c.pool.pop()\n\n if conn == nil {\n conn, err = NewConn(c.Addr, c.Proto)\n\n if err != nil {\n return nil, err\n }\n }\n\n return conn, nil\n}", "title": "" }, { "docid": "a2cd33cded43ea29eaae567fb7d4612b", "score": "0.5317919", "text": "func (b *backend) GetConnection() *connection {\n\tdialTimeout := time.After(b.conf.DialTimeout)\n\tfor {\n\t\tselect {\n\t\tcase <-dialTimeout:\n\t\t\treturn nil\n\n\t\tcase conn := <-b.channel:\n\t\t\tif !conn.IsClosed() {\n\t\t\t\treturn conn\n\t\t\t}\n\n\t\t\t// The connection closed, so decrement our counter.\n\t\t\tatomic.AddInt32(b.counter, -1)\n\n\t\tcase <-time.After(time.Duration(rndIntn(int(b.conf.IdleConnectionWait)))):\n\t\t\tconn, err := b.getNewConnection()\n\t\t\tif err != nil {\n\t\t\t\treturn nil\n\t\t\t} else if conn != nil {\n\t\t\t\treturn conn\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d642f04179aa9a65f31bd8a58c21f043", "score": "0.53111446", "text": "func (self *KvServer) createConnection(replyIp uint32, replyPort uint16, force bool) Connection {\n\n // Generate the key to the connMap.\n replySocket := uint64(replyIp)<<16 | uint64(replyPort)\n\n connection, isPresent := self.getConnection(replySocket)\n\n if !isPresent {\n // Set up a brand new connection object.\n localAddr, err := net.ResolveUDPAddr(\"udp\",\n getSocketString(self.senderIp, self.senderPort))\n checkError(err)\n\n // When replying, remote client is the server.\n remoteAddr, err := net.ResolveUDPAddr(\"udp\",\n getSocketString(replyIp, replyPort))\n checkError(err)\n\n conn, err := net.DialUDP(\"udp\", localAddr, remoteAddr)\n checkError(err)\n\n connection = Connection {\n localAddr : localAddr,\n remoteAddr : remoteAddr,\n conn : conn,\n }\n\n // fmt.Printf(\"Connection %#v\\n\", connection)\n\n self.addConnection(replySocket, connection)\n } else {\n if force {\n // Reestablish the old connection.\n conn, err := net.DialUDP(\"udp\",\n connection.localAddr,\n connection.remoteAddr)\n checkError(err)\n\n connection.conn = conn\n\n self.addConnection(replySocket, connection)\n }\n }\n\n return connection\n}", "title": "" }, { "docid": "e533b66090f64eca09d776c0a90ae452", "score": "0.5304515", "text": "func LoadOrStore(ctx context.Context, cc grpc.ClientConnInterface) (grpc.ClientConnInterface, bool) {\n\tk := nameFromContext(ctx)\n\n\tif v, ok := ctx.Value(mapKey{}).(*genericsync.Map[string, grpc.ClientConnInterface]); ok && k != \"\" {\n\t\treturn v.LoadOrStore(k, cc)\n\t}\n\n\treturn cc, false\n}", "title": "" }, { "docid": "d36c3e05d7621483c6b900975c7d132e", "score": "0.53033864", "text": "func (cc *ConnCache) Get(connid uid.LID) *Conn {\n\tcc.Lock()\n\tdefer cc.Unlock()\n\tif conn := cc.m[connid]; conn != nil {\n\t\treturn conn\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "7d237d724906259a3720e04d4afd29fb", "score": "0.5300656", "text": "func (p *Pool) Get(ctx context.Context, key string, tlsOptions *tlsopts.Options, dial Dialer) (conn Conn, err error) {\n\tdefer mon.Task()(&ctx)(&err)\n\n\tpk := poolKey{\n\t\tkey: key,\n\t\ttlsOptions: tlsOptions,\n\t}\n\n\t// if there is no pool, each conn gets it's own pool so that it doesn't\n\t// need to dial for every rpc.\n\townsPool := false\n\tif p == nil {\n\t\tp = New(Options{Capacity: 1, KeyCapacity: 1})\n\t\townsPool = true\n\t}\n\n\tif ctx.Value(forceDialKey{}) != nil {\n\t\tpv, err := p.get(ctx, pk, dial)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tp.put(pk, pv)\n\n\t\treturn &poolConn{\n\t\t\tclosedChan: make(chan struct{}),\n\t\t\tpk: pk,\n\t\t\tdial: dial,\n\t\t\tstate: pv.state,\n\n\t\t\townsPool: ownsPool,\n\t\t\tpool: p,\n\t\t}, nil\n\t}\n\n\treturn &poolConn{\n\t\tclosedChan: make(chan struct{}),\n\t\tpk: pk,\n\t\tdial: dial,\n\n\t\townsPool: ownsPool,\n\t\tpool: p,\n\t}, nil\n}", "title": "" }, { "docid": "7b5badbd63f2fba7cedba755a10d1483", "score": "0.5297465", "text": "func (c *Client) GetOrResetConnection(service string) (net.Conn, error) {\n\tif c.Status != \"Connecting\" {\n\t\tconn, err := net.Dial(\"tcp\", service)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tc.PersistConnection = conn\n\t\tc.Status = \"Connecting\"\n\t}\n\treturn c.PersistConnection, nil\n}", "title": "" }, { "docid": "ba4341a4392531bae7a9b4ed5ca116fe", "score": "0.52842236", "text": "func (rs *redigoStore) GetConnection() redigo.Conn {\n\treturn rs.pool.Get()\n}", "title": "" }, { "docid": "d81ece1c85d2f0d5640e65e377b54ebd", "score": "0.5262742", "text": "func GetPooledDBConnection(params *EndpointConnectionParams) *Connection {\n\tkey := makePoolKey(params)\n\n\tif connection, existed := dbConnectionPool.Load(key); existed {\n\t\tlog.V(2).F().Info(\"Found pooled connection: %s\", params.GetDSNWithHiddenCredentials())\n\t\treturn connection.(*Connection)\n\t}\n\n\t// Pooled connection not found, need to add it to the pool\n\n\tdbConnectionPoolEntryInitMutex.Lock()\n\tdefer dbConnectionPoolEntryInitMutex.Unlock()\n\n\t// Double check for race condition\n\tif connection, existed := dbConnectionPool.Load(key); existed {\n\t\tlog.V(2).F().Info(\"Found pooled connection: %s\", params.GetDSNWithHiddenCredentials())\n\t\treturn connection.(*Connection)\n\t}\n\n\tlog.V(2).F().Info(\"Add connection to the pool: %s\", params.GetDSNWithHiddenCredentials())\n\tdbConnectionPool.Store(key, NewConnection(params))\n\n\t// Fetch from the pool\n\tif connection, existed := dbConnectionPool.Load(key); existed {\n\t\tlog.V(2).F().Info(\"Found pooled connection: %s\", params.GetDSNWithHiddenCredentials())\n\t\treturn connection.(*Connection)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "98aaf1540d55756df2792f496949c7c8", "score": "0.52492565", "text": "func (s *SQLConn) Get(id string) *Client {\n\ts.mux.Lock()\n\tdefer s.mux.Unlock()\n\tif conn, ok := s.DB[id]; ok {\n\t\treturn conn\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b523dd1c0fbdffe691f6caf6d2f76ee7", "score": "0.52118576", "text": "func GetConn(ctx context.Context) net.Conn {\n\treturn ctx.Value(connKey{}).(net.Conn)\n}", "title": "" }, { "docid": "7589a1944babccb583750b59e62140c2", "score": "0.52101755", "text": "func (mgr *WsManager) Get(conn *websocket.Conn) *WsConnection {\n\treturn mgr.connections[conn]\n}", "title": "" }, { "docid": "1457cc536a1be4ec0583b5685056e1b4", "score": "0.51930934", "text": "func (p *pool) Get() (conn net.Conn, err error) {\n\tdefer p.updateStat(&err)\n\n\tif p.conns == nil || atomic.LoadInt32(&p.running) == 0 {\n\t\treturn nil, ErrClosed\n\t}\n\treturn p.get()\n}", "title": "" }, { "docid": "d622aee2703bad36e54d9120311335da", "score": "0.5187731", "text": "func (cp *ConnPool) GetConn() (Conn, error) {\n\tcp.mu.Lock()\n\tdefer cp.mu.Unlock()\n\t// has idle connection\n\tif cp.idleList.length() > 0 {\n\t\tconn := cp.idleList.pop()\n\t\tif conn.isStale(cp.connLifeTime) {\n\t\t\tconn.close()\n\t\t\treturn cp.connect()\n\t\t}\n\t\tcp.inUseCnt++\n\t\treturn conn, nil\n\t}\n\t// has reached max open connnection\n\tif cp.inUseCnt >= cp.maxOpen {\n\t\treturn Conn{}, errors.New(\"exhausted pool\")\n\t}\n\t// no idle connnection but hasn't reach max open connection\n\tcp.inUseCnt++\n\treturn cp.connect()\n}", "title": "" }, { "docid": "51c5ff834fb7dcda821a9daf761f145f", "score": "0.5154089", "text": "func GetConnection() (*Connection, error) {\n\tif connection == nil {\n\t\terr := connect()\n\t\tif err != nil {\n\t\t\tfmt.Println(\"db is not there\")\n\t\t\treturn connection, err\n\t\t}\n\t}\n\n\treturn connection, nil\n\n}", "title": "" }, { "docid": "18e99cedaa7e9aff7915e48d51f45faa", "score": "0.5145648", "text": "func MakeConnection(options *ConnectionOptions, raddr *net.UDPAddr, firstPacket []byte, fs *FileSystem) (*Connection, error) {\n\tc := new(Connection)\n\n\t// Create a UDP listener on a random port to serve as our end of the connection.\n\tladdr := net.UDPAddr{\n\t\tPort: 0, // The OS will give us a random port from the ephemeral pool.\n\t\tIP: net.ParseIP(options.Host),\n\t}\n\n\tc.RemoteAddr = raddr\n\n\tconn, err := net.ListenUDP(\"udp\", &laddr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tc.Conn = conn\n\n\thandler, err := MakeHandler(firstPacket, fs)\n\n\tif err != nil {\n\t\t// No way to handle this packet, but we can send an error to\n\t\t// the remote host.\n\t\tc.LastReplyPacket = MarshalPacket(\n\t\t\t&ErrorPacket{\n\t\t\t\tERR_ILLEGAL_OPERATION,\n\t\t\t\terr.Error(),\n\t\t\t})\n\t} else {\n\t\tc.Handler = handler\n\t}\n\n\tif c.Handler != nil {\n\t\t// Handle the first packet of information.\n\t\tc.LastReplyPacket = ProcessPacket(c.Handler, firstPacket)\n\t}\n\n\t// Todo: make configurable.\n\tc.Timeout = options.Timeout\n\tc.MaxRetries = options.MaxRetries\n\n\treturn c, nil\n}", "title": "" }, { "docid": "fc0b45dd26c04776bf3105a4111490ee", "score": "0.5144078", "text": "func (p *Pool) Get() (orm.Connection, error) {\n\treturn p.db, nil\n}", "title": "" }, { "docid": "758e6fb0b44e947a54ae04d3ea11dae8", "score": "0.5138902", "text": "func (p *pool) Get() (*grpc.ClientConn, error) {\n\tif p == nil {\n\t\treturn nil, errNoConnection\n\t}\n\n\tselect {\n\tcase conn := <-p.conns:\n\t\treturn conn, nil\n\tdefault:\n\t\treturn p.dialNew()\n\t}\n}", "title": "" }, { "docid": "97a16184313f1588995d0c62bb107add", "score": "0.5136299", "text": "func GetConnection(name string) (*sql.DB, error) {\n\tconn, ok := _connectPool[name]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"Connection %s not found\", name)\n\t}\n\treturn conn, nil\n}", "title": "" }, { "docid": "d93dd594906270ebabeaf2606e6fb805", "score": "0.5122888", "text": "func (e *Executor) GetConn() *connection.Connection {\n\treturn e.GetConn1()\n}", "title": "" }, { "docid": "c6b062ee734ac07fddfc06c17d0b0a8f", "score": "0.5118852", "text": "func udpgwLookupOrCreateConnId(localAddr, remoteAddr string) (uint16, error) {\n\n\tconnID, err := udpgwLookupConnId(localAddr, remoteAddr)\n\n\tif err == nil {\n\t\treturn connID, nil\n\t}\n\n\tif err == errUdpGwNoSuchConn {\n\t\tconn := udpgwGetConnFromPool()\n\n\t\tif conn == nil {\n\t\t\treturn 0, errors.New(\"No connections in pool.\")\n\t\t}\n\n\t\tclient := &udpGwClient{\n\t\t\tconn: conn,\n\t\t\tlocalAddr: localAddr,\n\t\t\tremoteAddr: remoteAddr,\n\t\t}\n\n\t\t// Get ID\n\t\tfor {\n\t\t\t//connID = uint16(rand.Int31() % (1 << 16))\n\t\t\tconnID = uint16(rand.Int31() % 50)\n\t\t\tif _, err := getUdpGwClientById(connID); err != nil {\n\t\t\t\tsetUdpGwClient(connID, client)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tlog.Printf(\"Creating a new connection %s:%s (%d)...\", localAddr, remoteAddr, connID)\n\n\t\tclient.connID = connID\n\t\tclient.conn = conn\n\n\t\tconn.connIDs[connID] = client\n\n\t\tudpgwConnMu.Lock()\n\t\tif udpgwConnMap[localAddr] == nil {\n\t\t\tudpgwConnMap[localAddr] = make(map[string]uint16)\n\t\t}\n\t\tudpgwConnMap[localAddr][remoteAddr] = connID\n\t\tudpgwConnMu.Unlock()\n\n\t} else {\n\t\treturn 0, err\n\t}\n\n\treturn connID, nil\n}", "title": "" }, { "docid": "62fdb240773458e139f5d23c16bba3be", "score": "0.5107513", "text": "func Get(user string, password string, host string) (Connection, error) {\n\tdb, err := sql.Open(\"postgres\", fmt.Sprintf(\n\t\t\"host=%s port=%d user=%s password=%s dbname=%s\",\n\t\thost,\n\t\t5432,\n\t\tuser,\n\t\tpassword,\n\t\t\"postgres\",\n\t))\n\tif err != nil {\n\t\treturn EmptyConnection, errors.Wrap(err, \"cannot connect to backend\")\n\t}\n\terr = db.Ping()\n\tif err != nil {\n\t\treturn EmptyConnection, errors.Wrap(err, \"cannot ping backend\")\n\t}\n\treturn Connection{db: db}, nil\n}", "title": "" }, { "docid": "5874ba157792fd70196de9c7100f7843", "score": "0.5085993", "text": "func (p *Pool) Get(ctx context.Context) Conn {\n\tc, err := p.p.Get(ctx)\n\tif err != nil {\n\t\treturn errConn{err}\n\t}\n\tc1, _ := c.(Conn)\n\treturn &poolConn{p: p, c: c1, ctx: ctx}\n}", "title": "" }, { "docid": "defc7e4131895cff0c6f4b35e42356ea", "score": "0.5083553", "text": "func GetInstance() *connection {\r\n\tonce.Do(func() {\r\n\t\tconn = newConnection()\r\n\t})\r\n\treturn conn\r\n}", "title": "" }, { "docid": "ee65b047a7aa3fb465bae9ce41ef38dd", "score": "0.5081517", "text": "func (cp *connectionPool) GetIdleConnection() *connection {\n\taddrs := cp.GetAllAddrs()\n\n\tfor _, idx := range rndPerm(len(addrs)) {\n\t\tif be := cp.getOrCreateBackend(addrs[idx]); be != nil {\n\t\t\tif conn := be.GetIdleConnection(); conn != nil {\n\t\t\t\treturn conn\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a5b9cdc6669974165a0a75e3ac0bf552", "score": "0.5078884", "text": "func (p *Pool) Get() Conn {\n\treturn &pooledConnection{p: p}\n}", "title": "" }, { "docid": "e6b09fe59e72e565e2746994c098d230", "score": "0.5077716", "text": "func (r *RedisPoolResource) Get() (RedisConn, error) {\n\tif r.pool.IsClosed() {\n\t\tr.initPool()\n\t}\n\n\tresource, err := r.pool.Get(context.TODO())\n\n\tif err != nil {\n\t\treturn RedisConn{}, err\n\t}\n\n\trc := resource.(RedisConn)\n\n\t// if rc is error, close and reconnect\n\tif rc.Err() != nil {\n\t\tconn, err := r.dial()\n\n\t\tif err != nil {\n\t\t\tr.pool.Put(rc)\n\n\t\t\treturn rc, err\n\t\t}\n\n\t\trc.Close()\n\n\t\treturn RedisConn{conn}, nil\n\t}\n\n\treturn rc, nil\n}", "title": "" }, { "docid": "f62a972722c4de3950a0481a7ca3a2fd", "score": "0.50579965", "text": "func newPktConn(laddr net.Addr) (pktConn, error) {\n\tvar err error\n\tpktC, err := net.ListenPacket(laddr.Network(), laddr.String())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// check if UDPConn is over IPv4 or IPv6\n\taddr, err := net.ResolveUDPAddr(laddr.Network(), laddr.String())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif addr.IP.To4() != nil {\n\t\treturn pktConn4{\n\t\t\tmu: &sync.Mutex{},\n\t\t\tudpConn: pktC.(*net.UDPConn),\n\t\t\tPacketConn: ipv4.NewPacketConn(pktC),\n\t\t}, nil\n\t} else if addr.IP.To16() != nil {\n\t\treturn pktConn6{\n\t\t\tmu: &sync.Mutex{},\n\t\t\tudpConn: pktC.(*net.UDPConn),\n\t\t\tPacketConn: ipv6.NewPacketConn(pktC),\n\t\t}, nil\n\t} else {\n\t\treturn nil, fmt.Errorf(\"laddr must refer to an IP address\")\n\t}\n}", "title": "" }, { "docid": "518094a440d660d522d2cef9b759d676", "score": "0.50526124", "text": "func (o *RedisCacher) GetConn() redis.Conn {\n\tconn := o.p.Get()\n\tif o.dbIndex != 0 {\n\t\tconn.Do(\"SELECT\", o.dbIndex)\n\t}\n\treturn conn\n}", "title": "" }, { "docid": "f308a3a76f4068cc3ed885471e5de838", "score": "0.5047697", "text": "func (p *Pool) Get() (*Mongo, error) {\n var conn *Mongo\n select {\n case conn = <-p.conns:\n default:\n var err error\n conn = NewMongo()\n status := conn.Client(p.Host, p.Port)\n if status != MONGO_OK {\n err = conn.Error()\n }\n if err != nil {\n return nil, err\n }\n }\n conn.pool = p\n return conn, nil\n}", "title": "" }, { "docid": "ca1f59fd4cbbb5fa8d67828e78fcc196", "score": "0.5042888", "text": "func setupConnection(conn_type, host string) (net.Conn, error) {\n\taddrs, err := net.LookupIP(host)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\thost = addrs[0].String()\n\tconn, err := net.Dial(\"ip4:icmp\", host)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn conn, nil\n}", "title": "" }, { "docid": "e16b652f68005e5ed73247b57b748f07", "score": "0.50276065", "text": "func (c *Client) GetConn() redis.Conn {\n\treturn c.pool.Get()\n}", "title": "" }, { "docid": "bb3bee4babbd76d6679df392d3f3af7b", "score": "0.50246644", "text": "func (r *Redis) GetConn() *Conn {\n\treturn r.Conn()\n}", "title": "" }, { "docid": "2698b6d1d71ab345354a0186336fca1c", "score": "0.50048876", "text": "func Get_connection() *ldap.Conn {\n revel.TRACE.Printf(\"Get_connection(): %s:%s, %s/%s\", ldap_server, ldap_port, ldap_user, ldap_passwd)\n l, err := ldap.Dial(\"tcp\", fmt.Sprintf(\"%s:%d\", ldap_server, ldap_port))\n if err != nil {\n panic(fmt.Errorf(\"ldap.Dial panic: %s\",err.Error()))\n }\n\n err = l.Bind(ldap_user, ldap_passwd)\n if err != nil {\n panic(fmt.Errorf(\"ldap.Bind panic: %s\",err.Error()))\n }\n\n revel.TRACE.Printf(\"Get_connection() ok\")\n return l\n\n}", "title": "" }, { "docid": "770d2bcc93488751d3696fc649f7b127", "score": "0.5000826", "text": "func GetDatastoreConnection() *gorm.DB {\n\tif datastore != nil {\n\t\treturn datastore\n\t}\n\tvar err error\n\tvar cfg config.Config = config.GetGlobalConfig()\n\tvar databaseName = fmt.Sprintf(\"%v_%v\",\n\t\tcfg.DatastoreNamePrefix, config.Environment())\n\tvar databaseConnectionData = fmt.Sprintf(\"host=%s port=%d user=%s dbname=%s sslmode=%s password=%s\",\n\t\tcfg.DatastoreHost,\n\t\tcfg.DatastorePort,\n\t\tcfg.DatastoreUser,\n\t\tdatabaseName,\n\t\tcfg.DatastoreSslMode,\n\t\tcfg.DatastorePassword,\n\t)\n\tvar safeDatabaseConnectionData = fmt.Sprintf(\"host=%s port=%d user=%s dbname=%s\",\n\t\tcfg.DatastoreHost,\n\t\tcfg.DatastorePort,\n\t\tcfg.DatastoreUser,\n\t\tdatabaseName,\n\t)\n\tfmt.Printf(\"Connected to the following data store: %v\\n\", safeDatabaseConnectionData)\n\tdatastore, err = gorm.Open(postgres.Open(databaseConnectionData), &gorm.Config{})\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"Failed to connect datastore: %v\\n\", err))\n\t}\n\treturn datastore\n}", "title": "" }, { "docid": "530c69e0c813b29719849c9c77f56c07", "score": "0.4980721", "text": "func getConn() (net.Conn, error) {\n\tconn := &net.TCPConn{}\n\treturn conn, nil\n}", "title": "" }, { "docid": "b7746eb0f35abf0c5c5eaa2b395f481c", "score": "0.49776307", "text": "func GetCon(ctx context.Context) *Connection {\n\tif ctx == nil {\n\t\treturn GetConnection()\n\t}\n\tc := ctx.Value(CONNECTION)\n\tif c == nil {\n\t\tcon := GetConnection()\n\t\tcMap := make(connections)\n\t\tcMap[CONNECTION] = con\n\t\treturn con\n\t}\n\tcMap, ok := c.(connections)\n\tif !ok {\n\t\tpanicf(\"invalid setup, type of connection is %T\", c)\n\t}\n\tcon, ok := cMap[CONNECTION]\n\tif !ok {\n\t\tcon = GetConnection()\n\t\tcMap[CONNECTION] = con\n\t}\n\treturn con\n}", "title": "" }, { "docid": "000574509b740e3753a1953a51c54d53", "score": "0.4973869", "text": "func GetConnection(url string) (*DB, error) {\n\tvar err error\n\tdb := DB{}\n\tdb.ctx = context.Background()\n\n\tdb.config, err = pgxpool.ParseConfig(url)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdb.config.MaxConns = 20\n\tdb.config.MaxConnLifetime = 10 * time.Second\n\n\tdb.pool, err = pgxpool.ConnectConfig(db.ctx, db.config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &db, nil\n}", "title": "" }, { "docid": "64cdc4af327f3279142d04e728e3f393", "score": "0.49736485", "text": "func (p *pool) Get() (*grpc.ClientConn, error) {\n\tselect {\n\tcase conn := <-p.conns:\n\t\treturn conn, nil\n\tdefault:\n\t\treturn p.dialNew()\n\t}\n}", "title": "" }, { "docid": "216bb78d7a0ae93d57587baf51e3b168", "score": "0.49673986", "text": "func (transport *TCPTransport) getConn(target string) (*netConn, error) {\n\t// Check for a pooled conn\n\tif conn := transport.getPooledConn(target); conn != nil {\n\t\treturn conn, nil\n\t}\n\n\t// Dial a new connection\n\tconn, err := net.DialTimeout(\"tcp\", string(target), transport.timeout)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnetConn := &netConn{\n\t\ttarget: target,\n\t\tconn: conn,\n\t\tdec: codec.NewDecoder(bufio.NewReader(conn), &codec.MsgpackHandle{}),\n\t\twriter: bufio.NewWriterSize(conn, connSendBufferSize),\n\t}\n\n\tnetConn.enc = codec.NewEncoder(netConn.writer, &codec.MsgpackHandle{})\n\n\treturn netConn, nil\n}", "title": "" }, { "docid": "f0a64158660e72d3e0329194631133de", "score": "0.4962595", "text": "func GetConnection(host, port, user, dbname, password, sslmode string) (*gorm.DB, error) {\n\tdsn := fmt.Sprintf(const_db.AddInfoForConnection,\n\t\thost, port, user, dbname, password, sslmode)\n\tconnection, err := gorm.Open(postgres.Open(dsn), &gorm.Config{})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(const_db.TroubleWithConnection, err)\n\t}\n\treturn connection, nil\n}", "title": "" }, { "docid": "b17774295701da860b4934cde12e75ef", "score": "0.49616724", "text": "func (p *longpool) Get(network, address string, dialer Dialer, dialTimeout time.Duration) (runner.Conn, error) {\n\tfor {\n\t\tconn, _ := p.ring.Pop().(runner.Conn)\n\t\tif conn == nil {\n\t\t\tbreak\n\t\t}\n\t\treturn conn, nil\n\t}\n\tconn, err := dialer.DialTimeout(network, address, dialTimeout)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn conn, nil\n}", "title": "" }, { "docid": "2b92dd8a64a98a1137cedd1b8387665c", "score": "0.49545655", "text": "func (m *Manager) GetConn(ctx context.Context) (Conn, error) {\n\treturn m.getConn(ctx, 0, false)\n}", "title": "" }, { "docid": "bdff6e60ebff5463b9c7985b7706a1b2", "score": "0.4943246", "text": "func GetConnection(r *http.Request) net.Conn {\n\treturn r.Context().Value(grpc.ConnContextKey).(net.Conn)\n}", "title": "" }, { "docid": "e10e16e7b128f10a1aa52ac1fdf1d643", "score": "0.49377367", "text": "func (c *Client) GetConn(addr net.Addr) (conn MiningConn, err error) {\n\n\tc.mutex.Lock()\n\terr = nil\n\tfor c_addr, c_conn := range c.PoolConns {\n\t\tif addr.String() == c_addr.String() {\n\t\t\tconn = c_conn\n\t\t\tc.mutex.Unlock()\n\t\t\treturn\n\t\t}\n\t}\n\terr = errors.New(\"could not find address\")\n\tc.mutex.Unlock()\n\treturn\n}", "title": "" }, { "docid": "8608770dfc853d9f6a40dda3755bb076", "score": "0.4929305", "text": "func (ss *Server) GetConnection(userID string) (*Connection, error) {\n\tconn, ok := ss.connections[userID]\n\tif ok {\n\t\treturn conn, nil\n\t}\n\treturn nil, errors.New(\"La conection no existe\")\n}", "title": "" }, { "docid": "5f1f5503ff4cc431005afdbe150d8432", "score": "0.49278384", "text": "func (dialer Dialer) Dial(address string) (*Conn, error) {\n\tudpConn, err := net.Dial(\"udp\", address)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error dialing UDP conn: %v\", err)\n\t}\n\tpacketConn := udpConn.(net.PacketConn)\n\t_ = udpConn.SetReadDeadline(time.Now().Add(time.Second * 10))\n\ttimeout := time.After(time.Second * 10)\n\n\t// Seed rand with the current time so that we can produce a random ID for the connection.\n\trand.Seed(time.Now().Unix())\n\tid := rand.Int63()\n\n\tif dialer.ErrorLog == nil {\n\t\tdialer.ErrorLog = log.New(os.Stderr, \"\", log.LstdFlags)\n\t}\n\tif dialer.Protocol == 0 {\n\t\tdialer.Protocol = MinecraftProtocol\n\t}\n\tstate := &connState{\n\t\tconn: udpConn,\n\t\tremoteAddr: udpConn.RemoteAddr(),\n\t\tdiscoveringMTUSize: 1492,\n\t\tid: id,\n\t\tprotocol: dialer.Protocol,\n\t}\n\tif err := state.discoverMTUSize(); err != nil {\n\t\treturn nil, fmt.Errorf(\"error discovering MTU size: %v\", err)\n\t}\n\tif err := state.openConnectionRequest(); err != nil {\n\t\treturn nil, fmt.Errorf(\"error receiving open connection reply: %v\", err)\n\t}\n\n\tconn := newConn(&wrappedConn{PacketConn: packetConn}, udpConn.RemoteAddr(), state.mtuSize, id)\n\tgo func() {\n\t\t// Wait for the connection to be closed...\n\t\t<-conn.closeCtx.Done()\n\t\tif err := conn.conn.Close(); err != nil {\n\t\t\t// Should not happen.\n\t\t\tpanic(err)\n\t\t}\n\t}()\n\tif err := conn.requestConnection(); err != nil {\n\t\treturn nil, fmt.Errorf(\"error requesting connection: %v\", err)\n\t}\n\n\tgo clientListen(conn, udpConn, dialer.ErrorLog)\n\tselect {\n\tcase <-conn.completingSequence.Done():\n\t\t// Clear all read deadlines as we no longer need these.\n\t\t_ = udpConn.SetReadDeadline(time.Time{})\n\t\t_ = conn.SetReadDeadline(time.Time{})\n\t\treturn conn, nil\n\tcase <-timeout:\n\t\treturn nil, fmt.Errorf(\"error establishing a connection: connection timed out\")\n\t}\n}", "title": "" }, { "docid": "93a1504f7f16132ef77226de2280ac31", "score": "0.4920254", "text": "func (s *Server) Dial(addr *net.UDPAddr, serviceName string, timeout time.Duration) (net.Conn, error) {\n\tsession, err := s.dial(addr, timeout)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tstream, err := session.OpenStream()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tstream.SetDeadline(\n\t\ttime.Now().Add(timeout),\n\t)\n\n\thash, err := blake2b.New(serviceNameSize, []byte{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\thash.Write([]byte(serviceName))\n\tkey := hash.Sum(nil)\n\n\t_, err = stream.Write(key)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tconn := &localConn{\n\t\tStream: stream,\n\t\tsession: session,\n\t}\n\n\treturn conn, nil\n}", "title": "" }, { "docid": "72c5d060dd0517268cebd125cb7fabd0", "score": "0.4917409", "text": "func (m *ClientPool) Get(ctx context.Context, addr string) (rpcClientConn, error) {\n\tfun := \"ClientPool.Get -->\"\n\tcp := m.getPool(addr)\n\tctx, cancel := context.WithTimeout(ctx, getConnTimeout)\n\tdefer cancel()\n\tc, err := cp.Get(ctx)\n\tif err != nil {\n\t\txlog.Errorf(ctx, \"%s get conn from connection pool failed, callee_service: %s, addr: %s, err: %v\", fun, m.calleeServiceKey, addr, err)\n\t\treturn nil, err\n\t}\n\treturn c.(rpcClientConn), nil\n}", "title": "" }, { "docid": "59aa626be85c4c6413e4ad177eb7841e", "score": "0.49161217", "text": "func (c *Conn) GetProtocol() PacketProtocol {\n\treturn c.protocol\n}", "title": "" }, { "docid": "1bf41c532af7c08a617753f7bf1accf6", "score": "0.49104172", "text": "func get_db_connection() *sql.DB {\n\t//db, err := sql.Open(\"mysql\", \"user:password@/database\")\n\t//db, err := sql.Open(\"mysql\", \"reverse-gol:reverse-gol@/reverse-gol\")\n\tdb, err := sql.Open(\"mysql\", \"reverse-gol:reverse-gol@tcp(square.herald:3306)/reverse-gol\")\n\t\n\tif err != nil {\n\t\tpanic(err.Error()) // Just for example purpose. You should use proper error handling instead of panic\n\t}\n\t\n\t// Open doesn't open a connection. Validate DSN data:\n\terr = db.Ping()\n\tif err != nil {\n\t\tpanic(err.Error()) // proper error handling instead of panic in your app\n\t}\n\t\n\treturn db\n}", "title": "" }, { "docid": "91d49d12435b84b9324748b2b0b18a5c", "score": "0.49081534", "text": "func (serv *Server) GetConn(sessid uint32) (c *Conn) {\n serv.sessionsLock.RLock()\n c = serv.sessions[sessid]\n serv.sessionsLock.RUnlock()\n return\n}", "title": "" }, { "docid": "6e148050bad9baa35e9b64fa6b960eea", "score": "0.49037334", "text": "func (cli *Client) GetConn(serviceName string) (*grpc.ClientConn, error) {\n\tcli.RLock()\n\tif conn, ok := cli.connPool[serviceName]; ok {\n\t\tcli.RUnlock()\n\t\treturn conn, nil\n\t}\n\tcli.RUnlock()\n\n\tcli.Lock()\n\tdefer cli.Unlock()\n\n\tconn, err := grpc.Dial(serviceName, cli.dialOpts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcli.connPool[serviceName] = conn\n\treturn conn, nil\n}", "title": "" }, { "docid": "b9ecbdc056ab7481af432f07c01be16e", "score": "0.48916793", "text": "func (p *APNSConnPool) Get() *APNSConn {\n\treturn <-p.conn\n}", "title": "" }, { "docid": "c6a3e5189ce0757477be75cbdd380268", "score": "0.48911637", "text": "func GetConnection() (*gorm.DB, error) {\n\tif err := dbInstance.DB().Ping(); err != nil {\n\t\tif _, err := Connect(); err != nil {\n\t\t\tlogger.Log().Error(err)\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn dbInstance, nil\n}", "title": "" }, { "docid": "f2346ca60ed16f0e187ed9f009610f30", "score": "0.48877212", "text": "func (s *Session) pickHost(routingKey []byte) (*Conn, error) {\n\tpartitioner := &murmur3Partitioner{}\n\ttoken := partitioner.Hash(routingKey)\n\n\thostIter := s.policy.Pick(&Query{\n\t\tsession: s,\n\t\troutingKey: routingKey,\n\t})\n\tselectedHost := hostIter()\n\n\tfor selectedHost != nil {\n\t\thost := selectedHost.Info()\n\t\tif host == nil || !host.IsUp() {\n\t\t\tselectedHost = hostIter()\n\t\t\tcontinue\n\t\t}\n\n\t\tpool, ok := s.pool.getPool(host)\n\t\tif !ok {\n\t\t\tselectedHost = hostIter()\n\t\t\tcontinue\n\t\t}\n\n\t\tconn := pool.Pick(token)\n\t\tif conn == nil {\n\t\t\tselectedHost = hostIter()\n\t\t\tcontinue\n\t\t}\n\n\t\treturn conn, nil\n\t}\n\treturn nil, ErrNoConnections\n}", "title": "" }, { "docid": "38155da58086d48397446163a5b55285", "score": "0.48856288", "text": "func (s *Service) doozer() *skynet.DoozerConnection {\n\tif s.DoozerConn == nil {\n\t\ts.DoozerConn = skynet.NewDoozerConnectionFromConfig(*s.Config.DoozerConfig, s.Log)\n\n\t\ts.DoozerConn.Connect()\n\t}\n\n\treturn s.DoozerConn\n}", "title": "" }, { "docid": "6ce01ca630cc75da034160ab79f964e0", "score": "0.48807013", "text": "func GetConnection(host string) (conn *grpc.ClientConn, err error) {\n\t/* get connection */\n\tlog.Println(\"Get connection.\")\n\n\tconn, err = grpc.Dial(host, grpc.WithInsecure())\n\tif err != nil {\n\t\tlog.Println(\"grpc dial err: \", err)\n\t\treturn nil, err\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "4442a42c6de0e4f75586f4822c64e152", "score": "0.4870488", "text": "func GetInstance() *Connection {\n\t// only executes this once\n\tonce.Do(func() {\n\t\t_, err := connectProducer()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t})\n\treturn kafkaConnection\n}", "title": "" }, { "docid": "ae0d30bfad5fb8a4b67019617b4ec34e", "score": "0.4870179", "text": "func GetConnection(c Config) *Mongo {\n m := new(Mongo)\n session, err := mgo.Dial(c.MongoURI)\n if err != nil {\n panic(err)\n }\n m.session = session\n return m\n}", "title": "" }, { "docid": "e77d2bda47fed5f28e4557feeeb3cf0b", "score": "0.48572764", "text": "func (e *Executor) GetConn3() *connection.Connection {\n\treturn e.conn3\n}", "title": "" }, { "docid": "fd756dd4601c1f2e15aa4558048c8650", "score": "0.484453", "text": "func (p *Pool) Get() (*redis.Client, error) {\n\tselect {\n\tcase conn := <-p.pool:\n\t\treturn conn, nil\n\tdefault:\n\t\treturn redis.Dial(p.network, p.addr)\n\t}\n}", "title": "" }, { "docid": "cb433eaa6c24f2653222cdfe324af733", "score": "0.48362875", "text": "func (l *Listener) Dial(ctx context.Context, network, addr string) (_ net.Conn, err error) {\n\tif !strings.HasSuffix(network, \"tcp\") {\n\t\treturn nil, net.UnknownNetworkError(network)\n\t}\n\tif connAddr(addr) != l.addr {\n\t\treturn nil, &net.AddrError{\n\t\t\tErr: \"invalid address\",\n\t\t\tAddr: addr,\n\t\t}\n\t}\n\n\tnewConn := l.NewConn\n\tif newConn == nil {\n\t\tnewConn = func(network, addr string, maxBuf int) (Conn, Conn) {\n\t\t\treturn NewConn(addr, maxBuf)\n\t\t}\n\t}\n\tc, s := newConn(network, addr, bufferSize)\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tc.Close()\n\t\t\ts.Close()\n\t\t}\n\t}()\n\n\tselect {\n\tcase <-ctx.Done():\n\t\treturn nil, ctx.Err()\n\tcase <-l.closed:\n\t\treturn nil, net.ErrClosed\n\tcase l.ch <- s:\n\t\treturn c, nil\n\t}\n}", "title": "" }, { "docid": "4770fe9395a0db6bf548e6b5b2117b43", "score": "0.4830531", "text": "func GetConnection(server Server) (*net.Conn, interface{}, error) {\n\treturn getServerConnPool(server).GetConnection()\n}", "title": "" }, { "docid": "d7644572c958c16d1ac1387ddae50451", "score": "0.48299807", "text": "func (p *Pool) Get(ctx context.Context) (*grpc.ClientConn, error) {\n\tselect {\n\tcase conn := <-p.conns:\n\t\treturn conn, nil\n\tdefault:\n\t\treturn grpc.DialContext(ctx, p.address, p.opts...)\n\t}\n}", "title": "" }, { "docid": "41c4b876cca794a4e1ef83c2461111f6", "score": "0.48270398", "text": "func (s *Swarm) Dial(peer *peer.Peer) (*Conn, error) {\n\tk := peer.Key()\n\n\t// check if we already have an open connection first\n\ts.connsLock.RLock()\n\tconn, found := s.conns[k]\n\ts.connsLock.RUnlock()\n\tif found {\n\t\treturn conn, nil\n\t}\n\n\t// open connection to peer\n\tconn, err := Dial(\"tcp\", peer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ts.StartConn(conn)\n\treturn conn, nil\n}", "title": "" }, { "docid": "b1947536c9b422174adc9c1cdd07e190", "score": "0.48240682", "text": "func (s *Session) GetConn() *net.Conn {\n\treturn s.conn\n}", "title": "" }, { "docid": "b0d9c7a6b050d26b5ee271ab1c5cb779", "score": "0.48228115", "text": "func (e *NEpoll) GetConn(fd int) net.Conn {\n\treturn e.connections[fd]\n}", "title": "" }, { "docid": "bfbfe1b68bbf5872624116c114d4740f", "score": "0.48204875", "text": "func Connection(dsn string) *conn {\n\tif _, ok := d.connections[dsn]; !ok {\n\t\td.connections[dsn] = newConn()\n\t}\n\n\treturn d.connections[dsn]\n}", "title": "" }, { "docid": "ad5bba816412e74f266c8a54c618bfa9", "score": "0.4808119", "text": "func (tr *BLETransport) getDeviceConnection(p gatt.Peripheral) *BLEConnection {\n\ttr.peripheralsMutex.Lock()\n\tdefer tr.peripheralsMutex.Unlock()\n\n\td, _ := tr.connectedPeripherals[p.ID()]\n\treturn &d\n}", "title": "" }, { "docid": "0f17271dd9ee82b33302ef5c16f04e6b", "score": "0.48049575", "text": "func (p DatabaseConnector) GetConnection() (dbConnector *pop.Connection, dbConnectionError error) {\n\tvar dbConnectionsDetails pop.ConnectionDetails\n\n\tdbConnectionsDetails.Dialect = os.Getenv(\"DB_DIALECT\")\n\tdbConnectionsDetails.Host = os.Getenv(\"DB_HOST\")\n\tdbConnectionsDetails.Port = os.Getenv(\"DB_PORT\")\n\tdbConnectionsDetails.Database = os.Getenv(\"DB_NAME\")\n\tdbConnectionsDetails.User = os.Getenv(\"DB_USERNAME\")\n\tdbConnectionsDetails.Password = os.Getenv(\"DB_PASSWORD\")\n\tdbConnectionsDetails.RawOptions = \"sslmode=\" + os.Getenv(\"DB_SSLMODE\")\n\tdbConnection, dbError := pop.NewConnection(&dbConnectionsDetails)\n\n\tif dbError != nil {\n\t\treturn dbConnection, dbError\n\t}\n\n\tdbError = dbConnection.Open()\n\n\treturn dbConnection, dbError\n}", "title": "" }, { "docid": "3c677dc90dbc3472a03cb2065523479c", "score": "0.48042077", "text": "func GetInstance() Connection {\n\tif instance == nil {\n\t\tid := time.Now().Unix()\n\t\tinstance = &connectionsInstance{\n\t\t\tHOST: \"localhost\",\n\t\t\tPORT: 3000,\n\t\t\tDB: \"pruebas\",\n\t\t\tID: id,\n\t\t}\n\t}\n\n\treturn instance\n}", "title": "" } ]
6b5bbfa97df652f5c7dfcf3a9c3ad71d
GetLowResolutionTimestamp implements oracle.Oracle interface.
[ { "docid": "6431e707a6b027d89873d05cc84b08e0", "score": "0.8731654", "text": "func (o *MockOracle) GetLowResolutionTimestamp(ctx context.Context, opt *oracle.Option) (uint64, error) {\n\treturn o.GetTimestamp(ctx, opt)\n}", "title": "" } ]
[ { "docid": "28e573aace48f6461cd477700f267323", "score": "0.8505518", "text": "func (o *pdOracle) GetLowResolutionTimestamp(ctx context.Context, opt *oracle.Option) (uint64, error) {\n\tlastTS, ok := o.getLastTS(opt.TxnScope)\n\tif !ok {\n\t\treturn 0, errors.Errorf(\"get low resolution timestamp fail, invalid txnScope = %s\", opt.TxnScope)\n\t}\n\treturn lastTS, nil\n}", "title": "" }, { "docid": "c6acb53a086dc521d55ae064fda25962", "score": "0.6766628", "text": "func (o *MockOracle) GetLowResolutionTimestampAsync(ctx context.Context, opt *oracle.Option) oracle.Future {\n\treturn o.GetTimestampAsync(ctx, opt)\n}", "title": "" }, { "docid": "f0e39dee6ed03590ba6a7bd1870e3d19", "score": "0.64334345", "text": "func (o *MockOracle) GetExternalTimestamp(ctx context.Context) (uint64, error) {\n\treturn o.getExternalTimestamp(ctx)\n}", "title": "" }, { "docid": "91943c0b3636ebdceee6bd2e0a727f4b", "score": "0.6176769", "text": "func (_ChainlinkOracle *ChainlinkOracleCaller) GetTimestamp(opts *bind.CallOpts, _roundId *big.Int) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _ChainlinkOracle.contract.Call(opts, out, \"getTimestamp\", _roundId)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "6fef5422aa6b0b88281f821ec88f90b9", "score": "0.5940156", "text": "func (_ChainlinkOracle *ChainlinkOracleSession) GetTimestamp(_roundId *big.Int) (*big.Int, error) {\n\treturn _ChainlinkOracle.Contract.GetTimestamp(&_ChainlinkOracle.CallOpts, _roundId)\n}", "title": "" }, { "docid": "e86c98e89e36eeb17626e977ebf60586", "score": "0.586073", "text": "func (_ChainlinkOracle *ChainlinkOracleCallerSession) GetTimestamp(_roundId *big.Int) (*big.Int, error) {\n\treturn _ChainlinkOracle.Contract.GetTimestamp(&_ChainlinkOracle.CallOpts, _roundId)\n}", "title": "" }, { "docid": "8b6dc2c848ecbae850bce6798b42c8c9", "score": "0.5632033", "text": "func (o *pdOracle) GetTimestamp(ctx context.Context, opt *oracle.Option) (uint64, error) {\n\tts, err := o.getTimestamp(ctx, opt.TxnScope)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\to.setLastTS(ts, opt.TxnScope)\n\treturn ts, nil\n}", "title": "" }, { "docid": "a8f11440494d1886e9f1f1caf7b28037", "score": "0.56313556", "text": "func (o *MockOracle) GetTimestamp(ctx context.Context, _ *oracle.Option) (uint64, error) {\n\to.Lock()\n\tdefer o.Unlock()\n\n\tif o.stop {\n\t\treturn 0, errors.WithStack(errStopped)\n\t}\n\tts := oracle.GoTimeToTS(time.Now().Add(o.offset))\n\tif oracle.ExtractPhysical(o.lastTS) == oracle.ExtractPhysical(ts) {\n\t\tts = o.lastTS + 1\n\t}\n\to.lastTS = ts\n\treturn ts, nil\n}", "title": "" }, { "docid": "5d8e63cdfb7c5d9abb3e890317d3b178", "score": "0.560972", "text": "func (region *regionDesc) firstTimestamp() int64 {\n\tif region.Start != nil {\n\t\treturn region.Start.Ts\n\t}\n\treturn firstTimestamp()\n}", "title": "" }, { "docid": "055489c08650a58bae88ebb42057e33d", "score": "0.55789185", "text": "func (_Aggregator *AggregatorCaller) GetTimestamp(opts *bind.CallOpts, _roundId *big.Int) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _Aggregator.contract.Call(opts, out, \"getTimestamp\", _roundId)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "57a6ebba07d01fd29f47ef2a689f6f74", "score": "0.5487877", "text": "func (_Impro *ImproCaller) GetTimestamp(opts *bind.CallOpts, _perceptualHash string) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _Impro.contract.Call(opts, out, \"getTimestamp\", _perceptualHash)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "0358e466914cdeb351a264781dd2e40c", "score": "0.5448713", "text": "func (pl *ProvenLedgerInfo) GetTimestampUsec() uint64 {\n\tif !pl.proven {\n\t\tpanic(\"not valid proven ledger info\")\n\t}\n\treturn pl.ledgerInfo.TimestampUsec\n}", "title": "" }, { "docid": "294684bbb6c1678db8f2be29f4c7bf1e", "score": "0.53229326", "text": "func (_Impro *ImproSession) GetTimestamp(_perceptualHash string) (*big.Int, error) {\n\treturn _Impro.Contract.GetTimestamp(&_Impro.CallOpts, _perceptualHash)\n}", "title": "" }, { "docid": "4e7f950dd355e979d61f64db1c37d17c", "score": "0.531398", "text": "func (o *SeriesRequest) GetTimestamp() int64 {\n\tif o == nil {\n\t\tvar ret int64\n\t\treturn ret\n\t}\n\n\treturn o.Timestamp\n}", "title": "" }, { "docid": "7433fdc15c37e6e9ce98ac321cd2f491", "score": "0.5295692", "text": "func (_Impro *ImproCallerSession) GetTimestamp(_perceptualHash string) (*big.Int, error) {\n\treturn _Impro.Contract.GetTimestamp(&_Impro.CallOpts, _perceptualHash)\n}", "title": "" }, { "docid": "9dffd519e7084b08a400697cda2c9b11", "score": "0.52604014", "text": "func (r *eventImpl) Timestamp(p graphql.ResolveParams) (time.Time, error) {\n\tevent := p.Source.(*corev2.Event)\n\treturn time.Unix(event.Timestamp, 0), nil\n}", "title": "" }, { "docid": "92afbde0c446f99fa7b2782d878bb805", "score": "0.5202113", "text": "func (_Aggregator *AggregatorSession) GetTimestamp(_roundId *big.Int) (*big.Int, error) {\n\treturn _Aggregator.Contract.GetTimestamp(&_Aggregator.CallOpts, _roundId)\n}", "title": "" }, { "docid": "49f6a64189ca4f86031edc835701b870", "score": "0.5198383", "text": "func FloorTimestamp(unixTime int64, windowSize uint64) int64 {\n\treturn Timestamp(Bucket(unixTime, windowSize), windowSize)\n}", "title": "" }, { "docid": "c2e8978bfb5a3836573bc1a818338bdd", "score": "0.5190658", "text": "func unifiedTimeStamp(timestamp time.Time) time.Time {\n\thour, min, sec := timestamp.Clock()\n\n\tunifiedDateTime := time.Date(2016, 1, 1, hour, min, sec, 0, time.Local)\n\treturn unifiedDateTime\n}", "title": "" }, { "docid": "f3a1aed92fa18609169b2fc1f2245bf5", "score": "0.5174009", "text": "func (session *Session) SysTimeStamp(tstype TimestampType) (*TimeStamp, error) {\n\n\trslt := makeTimestampInstance(session, tstype)\n\n\terr := checkError(\n\t\tC.OCIDateTimeSysTimeStamp(\n\t\t\tunsafe.Pointer(session.ses),\n\t\t\trslt.err,\n\t\t\trslt.datetime), rslt.err)\n\n\treturn rslt, processError(err)\n\n}", "title": "" }, { "docid": "df6613cc8425009d071e23271b8bf1d6", "score": "0.51719064", "text": "func (o *SeriesRequest) GetTimestampOk() (*int64, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Timestamp, true\n}", "title": "" }, { "docid": "4f6a16c6f06f80527e5f4f717876af93", "score": "0.514536", "text": "func siemensTimestamp(EncodedDate int64) string {\n\treturn time.Date(1984, 1, 1, 0, 0, 0, 0, time.UTC).Add(time.Second * time.Duration((EncodedDate * 86400))).Format(\"02.01.2006\")\n}", "title": "" }, { "docid": "2ad331e4a3f8b6fa0db153285aae9215", "score": "0.51268125", "text": "func (_Aggregator *AggregatorCallerSession) GetTimestamp(_roundId *big.Int) (*big.Int, error) {\n\treturn _Aggregator.Contract.GetTimestamp(&_Aggregator.CallOpts, _roundId)\n}", "title": "" }, { "docid": "a8cb42d783c2614838d488341f7fbf70", "score": "0.51172155", "text": "func (r *Snowflake) GetLatestTimestamp() (time.Time, error) {\n\n\tgetLatestTimeStampQuery := \"select JSONTEXT:data[0]._event_time AS unixtime from \" + r.Table + \" where JSONTEXT:data[0].generator_identifier = '\" + r.GeneratorIdentifier + \"' ORDER BY JSONTEXT:data[0]._event_time DESC limit 1\"\n\trows, err := r.DBConnection.Query(getLatestTimeStampQuery)\n\tif err != nil {\n\t\treturn time.Time{}, fmt.Errorf(\"failed to run a query. %v, err: %v\", getLatestTimeStampQuery, err)\n\t}\n\tvar unixtime interface{}\n\tdefer func() {\n\t\terr := rows.Close()\n\t\tif err != nil {\n\t\t\tlog.Printf(\"failed to close rows: %v\", err)\n\t\t}\n\t}()\n\tfor rows.Next() {\n\t\terr := rows.Scan(&unixtime)\n\t\tif err != nil {\n\t\t\treturn time.Time{}, fmt.Errorf(\"could not find the document %v\", err)\n\t\t}\n\t}\n\tif unixtime != nil {\n\t\tunixtimeFloat, err := strconv.ParseFloat(unixtime.(string), 64)\n\t\tif err != nil {\n\t\t\treturn time.Time{}, fmt.Errorf(\"could not convert unixtime from string to float64 %w\", err)\n\t\t}\n\t\ttimeMicro := int64(unixtimeFloat)\n\t\t// Convert from microseconds to (secs, nanosecs)\n\t\treturn time.Unix(timeMicro/1_000_000, (timeMicro%1_000_000)*1000), nil\n\t}\n\treturn time.Time{}, errors.New(\"malformed result, value is nil\")\n\n}", "title": "" }, { "docid": "84a050f1701acb00a561a4f862e36df4", "score": "0.5115649", "text": "func (m *_CEMIAdditionalInformationRelativeTimestamp) GetRelativeTimestamp() RelativeTimestamp {\n\treturn m.RelativeTimestamp\n}", "title": "" }, { "docid": "dfcb05f083ce7d64a07e93420d87794a", "score": "0.5115334", "text": "func (c *Computer) OldTimestamp() time.Time {\n\tc.lock.RLock()\n\tdefer c.lock.RUnlock()\n\tif c.prev == nil {\n\t\treturn time.Time{}\n\t}\n\treturn c.prev.timestamp\n}", "title": "" }, { "docid": "e1d7f8231cbd40cef9b240b8bde62f6a", "score": "0.5031518", "text": "func (o *SeriesImage) GetTimestamp() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Timestamp\n}", "title": "" }, { "docid": "d48a46cccb09419e366269d666e14fcd", "score": "0.5021997", "text": "func (o *DeviceMonitoring) GetTimestamp() string {\n\tif o == nil || o.Timestamp == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Timestamp\n}", "title": "" }, { "docid": "7e14b6c0d3f94bd44f88098f34e187ce", "score": "0.5017948", "text": "func (o *DeviceMonitoring) GetTimestampOk() (*string, bool) {\n\tif o == nil || o.Timestamp == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Timestamp, true\n}", "title": "" }, { "docid": "fd2d95842fb30b7251f3349512e2a528", "score": "0.5016659", "text": "func (c *SearchCall) CreationTsLow(creationTsLow int64) *SearchCall {\n\tc.urlParams_.Set(\"creation_ts_low\", fmt.Sprint(creationTsLow))\n\treturn c\n}", "title": "" }, { "docid": "5aa9a56277d3d2310bd8c248a29854fc", "score": "0.50156254", "text": "func GetTimestamp() string {\n\tmutex.Lock()\n\tdefer mutex.Unlock()\n\n\tnow := time.Now().UTC()\n\tfor now.Sub(lastTime).Nanoseconds() < 100000000 {\n\t\t// < 0.1 since last time. Sleep for at least 0.1 second\n\t\ttime.Sleep(time.Millisecond * time.Duration(100))\n\t\tnow = time.Now().UTC()\n\t}\n\tlastTime = now\n\n\treturn fmt.Sprintf(\"%04d%02d%02d%02d%02d%02d%01d\", now.Year(), now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second(), now.Nanosecond()/100000000)\n}", "title": "" }, { "docid": "c59a936d7a0fb1154b44d4dcfc971ca6", "score": "0.50144607", "text": "func GetTimestamp() int64 {\n\treturn TimeToMs(time.Now())\n}", "title": "" }, { "docid": "b14756713b3bf609207c83b858e88279", "score": "0.50109196", "text": "func (c *Context) getTimestamp() uint64 {\n\treturn uint64(c.Config.Timer.Now().UnixNano()) / c.Config.TimestampIncrement * c.Config.TimestampIncrement\n}", "title": "" }, { "docid": "bb8bc9c67a01dfe9a5ff8e4f39622130", "score": "0.50014126", "text": "func (task *taskDesc) firstTimestamp() int64 {\n\tif task != nil && task.create != nil {\n\t\treturn task.create.Ts\n\t}\n\treturn firstTimestamp()\n}", "title": "" }, { "docid": "ee9dac128d2cbb1917224a32e50852d6", "score": "0.49959633", "text": "func (o *Model3rdPartyEventOpenNotification) GetStartTimestamp() int64 {\n\tif o == nil {\n\t\tvar ret int64\n\t\treturn ret\n\t}\n\n\treturn o.StartTimestamp\n}", "title": "" }, { "docid": "f0a4022beff18df03595c000b9f25137", "score": "0.4994055", "text": "func (_LifCrowdsale *LifCrowdsaleCaller) StartTimestamp(opts *bind.CallOpts) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _LifCrowdsale.contract.Call(opts, out, \"startTimestamp\")\n\treturn *ret0, err\n}", "title": "" }, { "docid": "3bdb39b4b606319124f9196734441cbe", "score": "0.4987525", "text": "func (o *Model3rdPartyEventOpenNotification) GetStartTimestampOk() (*int64, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.StartTimestamp, true\n}", "title": "" }, { "docid": "9674e7239c7cd822fb046fc557f278d5", "score": "0.4986213", "text": "func (dpx *Demultiplexer) GetTimestamp() Timestamp {\n\treturn Timestamp{int64(dpx.ds.ctx.ctx.timestamp), Rational{1, 1000000}}\n}", "title": "" }, { "docid": "cf229bd43543c70283481ae65f4625c4", "score": "0.49852812", "text": "func (o *SeriesImage) GetTimestampOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Timestamp, true\n}", "title": "" }, { "docid": "c4e81990e8337101923d07d3d56ff7e8", "score": "0.4980015", "text": "func (session *Session) TimeStampFromGoTime(tstype TimestampType, t time.Time) (*TimeStamp, error) {\n\n\tvar year = int16(t.Year())\n\tvar month = uint8(t.Month())\n\tvar day = uint8(t.Day())\n\tvar hour = uint8(t.Hour())\n\tvar min = uint8(t.Minute())\n\tvar sec = uint8(t.Second())\n\tvar fsec = uint32(t.Nanosecond() / 1000000)\n\t_, offset := t.Zone()\n\n\t// offset is number of seconds; convert to a string that Oracle can interpret\n\tz1 := offset / 60 / 60\n\tz2 := (offset - (z1 * 60 * 60)) / 60\n\tif z2 < 0 {\n\t\tz2 = -z2\n\t}\n\n\ttimezone := []byte(fmt.Sprintf(\"%+03d:%02d\\n\", z1, z2))\n\n\trslt := makeTimestampInstance(session, tstype)\n\n\terr := checkError(\n\t\tC.OCIDateTimeConstruct(\n\t\t\tunsafe.Pointer(session.ses),\n\t\t\trslt.err,\n\t\t\trslt.datetime,\n\t\t\t(C.sb2)(year),\n\t\t\t(C.ub1)(month),\n\t\t\t(C.ub1)(day),\n\t\t\t(C.ub1)(hour),\n\t\t\t(C.ub1)(min),\n\t\t\t(C.ub1)(sec),\n\t\t\t(C.ub4)(fsec),\n\t\t\t(*C.OraText)(unsafe.Pointer(&timezone[0])), 6), rslt.err)\n\n\treturn rslt, processError(err)\n\n}", "title": "" }, { "docid": "1e1ddb62204ce303b852eeedae50a416", "score": "0.49792385", "text": "func (r *ceilometerResource) UnixTimestamp() int64 {\n\t/*if t, err := time.Parse(\"2006-01-02T15:04:05Z\", r.Timestamp); err == nil {\n\t\treturn t.Unix()\n\t}*/\n\tt, err := time.Parse(\"2006-01-02T15:04:05Z\", r.Timestamp)\n\tif err == nil {\n\t\treturn t.Unix()\n\t} else {\n\t\tif the_time, err := time.Parse(\"2006-01-02T15:04:05Z\", r.Timestamp + \"Z\"); err == nil {\n\t\t\treturn the_time.Unix()\n\t\t}\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "444420c5d38562a10c060aed58fcdb1d", "score": "0.49681163", "text": "func (_ChainlinkOracle *ChainlinkOracleCaller) LatestTimestamp(opts *bind.CallOpts) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _ChainlinkOracle.contract.Call(opts, out, \"latestTimestamp\")\n\treturn *ret0, err\n}", "title": "" }, { "docid": "36b90a033bf015f36c74919b6c23b24a", "score": "0.4941743", "text": "func (jbobject *UtilTimingInfo) GetStartEpochTimeMilliIfKnown() int64 {\n\tjret, err := jbobject.CallMethod(javabind.GetEnv(), \"getStartEpochTimeMilliIfKnown\", \"java/lang/Long\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tretconv := javabind.NewJavaToGoLong()\n\tdst := new(int64)\n\tretconv.Dest(dst)\n\tif err := retconv.Convert(javabind.ObjectRef(jret)); err != nil {\n\t\tpanic(err)\n\t}\n\tretconv.CleanUp()\n\treturn *dst\n}", "title": "" }, { "docid": "7cecb07a3603e73a143a47df7dabaf06", "score": "0.4935537", "text": "func (r RequestRecord) GetTimestamp() int64 {\n\treturn r.timestamp\n}", "title": "" }, { "docid": "af5d89092ecf8212ebbd000fc0ec0423", "score": "0.49326852", "text": "func (s *Service) GetMinTS(\n\tctx context.Context, request *tsopb.GetMinTSRequest,\n) (*tsopb.GetMinTSResponse, error) {\n\trespKeyspaceGroup := request.GetHeader().GetKeyspaceGroupId()\n\tif errorType, err := s.validRequest(request.GetHeader()); err != nil {\n\t\treturn &tsopb.GetMinTSResponse{\n\t\t\tHeader: s.wrapErrorToHeader(errorType, err.Error(), respKeyspaceGroup),\n\t\t}, nil\n\t}\n\n\tminTS, kgAskedCount, kgTotalCount, err := s.keyspaceGroupManager.GetMinTS(request.GetDcLocation())\n\tif err != nil {\n\t\treturn &tsopb.GetMinTSResponse{\n\t\t\tHeader: s.wrapErrorToHeader(\n\t\t\t\ttsopb.ErrorType_UNKNOWN, err.Error(), respKeyspaceGroup),\n\t\t\tTimestamp: &minTS,\n\t\t\tKeyspaceGroupsServing: kgAskedCount,\n\t\t\tKeyspaceGroupsTotal: kgTotalCount,\n\t\t}, nil\n\t}\n\n\treturn &tsopb.GetMinTSResponse{\n\t\tHeader: s.header(respKeyspaceGroup),\n\t\tTimestamp: &minTS,\n\t\tKeyspaceGroupsServing: kgAskedCount,\n\t\tKeyspaceGroupsTotal: kgTotalCount,\n\t}, nil\n}", "title": "" }, { "docid": "f88d876c07bd25c0c23ba315113b11a2", "score": "0.49320698", "text": "func (o *WafTraffic) GetTimestampOk() (*time.Time, bool) {\n\tif o == nil || o.Timestamp == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Timestamp, true\n}", "title": "" }, { "docid": "7afc68cdcfef494541fdba05652387ec", "score": "0.4902602", "text": "func OptionalTimestamp(value Timestamp) *Timestamp {\n return &value\n}", "title": "" }, { "docid": "0406e0e954974077e3a897fab0715956", "score": "0.48915213", "text": "func (o *AuditLogEntry) GetTimestampOk() (*int64, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Timestamp, true\n}", "title": "" }, { "docid": "02bf3ebf9bceb617fb4a8d631dcf16eb", "score": "0.48837933", "text": "func makeTimestamp() string {\n\ttimenow := time.Now().String()\n\treturn timenow[0:10]\n}", "title": "" }, { "docid": "4f3a0abfd6f2168aad86294d887e4514", "score": "0.4882856", "text": "func (o PreventionDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationPrimitiveTransformationFixedSizeBucketingConfigLowerBoundPtrOutput) TimestampValue() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *PreventionDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationPrimitiveTransformationFixedSizeBucketingConfigLowerBound) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.TimestampValue\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "99031dd4887f8437db85a9201a153f58", "score": "0.48775434", "text": "func (ms IntExemplar) Timestamp() TimestampUnixNano {\n\treturn TimestampUnixNano((*ms.orig).TimeUnixNano)\n}", "title": "" }, { "docid": "52c302330c49e49062087406a135cd81", "score": "0.48747596", "text": "func (*Timestamp) Type() string { return \"Timestamp\" }", "title": "" }, { "docid": "92dd446f287b84de246edfbde9889860", "score": "0.48732135", "text": "func (o *WafTraffic) GetTimestamp() time.Time {\n\tif o == nil || o.Timestamp == nil {\n\t\tvar ret time.Time\n\t\treturn ret\n\t}\n\treturn *o.Timestamp\n}", "title": "" }, { "docid": "c3aaf46748b09f2d050e9088dc720323", "score": "0.48504862", "text": "func resolveTimestamp(fastenJSON *fasten.JSON) {\n\turi := \"https://crates.io/api/v1/crates/\" + fastenJSON.Product + \"/\" + fastenJSON.Version\n\tresp, _ := http.Get(uri)\n\trespBody, _ := ioutil.ReadAll(resp.Body)\n\tvar api CratesioAPI\n\t_ = json.Unmarshal(respBody, &api)\n\t_ = resp.Body.Close()\n\n\tlayout := \"2006-01-02T15:04:05.999999999Z07:00\"\n\tdate := api.Version.CreatedAt\n\tif date != \"\" {\n\t\ttimestamp, _ := time.Parse(layout, date)\n\t\tfastenJSON.Timestamp = timestamp.Unix()\n\t}\n}", "title": "" }, { "docid": "d3dc2151e94d34e1e7ba52ed5e9cc73e", "score": "0.48490828", "text": "func newTimestampMS() uint64 {\n\treturn uint64(time.Now().UnixNano()) / uint64(time.Millisecond)\n}", "title": "" }, { "docid": "be94241d1b930e7400ab1bc073bccc16", "score": "0.48486537", "text": "func (tr Row) ForceLocaltime(nn int) (val time.Time) {\n\tval, _ = tr.LocaltimeErr(nn)\n\treturn\n}", "title": "" }, { "docid": "ea073bc5b164a0651feff81f9b714056", "score": "0.4844576", "text": "func (_LifCrowdsale *LifCrowdsaleSession) StartTimestamp() (*big.Int, error) {\n\treturn _LifCrowdsale.Contract.StartTimestamp(&_LifCrowdsale.CallOpts)\n}", "title": "" }, { "docid": "b1d6e6f89a96e21f0580da10c75d7a64", "score": "0.48326877", "text": "func (info HealthInfo) GetTimestamp() time.Time {\n\treturn info.TimeStamp\n}", "title": "" }, { "docid": "5e69be42e457c194fc2c365007c7b459", "score": "0.48283282", "text": "func (m *DirectRoutingLogRow) GetStartDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) {\n val, err := m.GetBackingStore().Get(\"startDateTime\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)\n }\n return nil\n}", "title": "" }, { "docid": "10ef166979d22edc855a103b8aaa4161", "score": "0.48210472", "text": "func (p *HbaseClient) GetRowTs(tableName Text, row Text, timestamp int64, attributes map[string]Text) (retval229 []*TRowResult, io *IOError, err error) {\n\terr = p.SendGetRowTs(tableName, row, timestamp, attributes)\n\tif err != nil {\n\t\treturn\n\t}\n\treturn p.RecvGetRowTs()\n}", "title": "" }, { "docid": "31e688ba22e1360966a7cb4820954909", "score": "0.48126256", "text": "func (s *IoTDB) convertTimestampOfMetric(m telegraf.Metric) (int64, error) {\n\tswitch s.TimeStampUnit {\n\tcase \"second\":\n\t\treturn m.Time().Unix(), nil\n\tcase \"millisecond\":\n\t\treturn m.Time().UnixMilli(), nil\n\tcase \"microsecond\":\n\t\treturn m.Time().UnixMicro(), nil\n\tcase \"nanosecond\":\n\t\treturn m.Time().UnixNano(), nil\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"unknown timestamp_precision %q\", s.TimeStampUnit)\n\t}\n}", "title": "" }, { "docid": "3e1d67a2c07a7c1652260f4c9e2687bb", "score": "0.4809481", "text": "func (mtr *IPv4FlowLatencyMetrics) SetMinRttLatencyTimestamp(val metrics.Gauge) error {\n\tmtr.metrics.SetGauge(val, mtr.getOffset(\"MinRttLatencyTimestamp\"))\n\treturn nil\n}", "title": "" }, { "docid": "7560897a6c23b73a3c663eedf4d64f8d", "score": "0.4809442", "text": "func NewTimestamp() Timestamp { return Timestamp(time.Now().Format(time.RFC822)) }", "title": "" }, { "docid": "be34decd70372446382e4acf8bc2b54c", "score": "0.48077813", "text": "func (a *Message1) GetTimestamp() (string, error) {\n\tv, err := a.GetProperty(\"Timestamp\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn v.Value().(string), nil\n}", "title": "" }, { "docid": "acd2ecc3a8f710513c7d720a67ee3106", "score": "0.4805921", "text": "func GetXtimestamp() uint64 {\r\n\tt := time.Now().UTC().UnixNano()\r\n\tsec := t / 1e9\r\n\tusec := (t - sec*1e9) / 1e3\r\n\txmsec := (usec << 10) / 1e6\r\n\treturn uint64(sec)<<10 | uint64(xmsec)\r\n}", "title": "" }, { "docid": "628dd128c90848bfb79de556d9e325bd", "score": "0.4800176", "text": "func (msg *GetLargeObjectRequestMessage) GetTimestamp() int64 {\n\treturn msg.HeaderGetTimestamp()\n}", "title": "" }, { "docid": "28436c5d4a236f8d3c86fb7ddd455da4", "score": "0.47990724", "text": "func (tx *TxCommon) GetTimestamp() int64 {\n\treturn tx.Timestamp\n}", "title": "" }, { "docid": "66f6f23313d134f8664c0d8177b09a0e", "score": "0.47872147", "text": "func (m *IpSecurityProfile) GetFirstSeenDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) {\n val, err := m.GetBackingStore().Get(\"firstSeenDateTime\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)\n }\n return nil\n}", "title": "" }, { "docid": "6f40676ab2ff9855ccd1b105cc5f41cd", "score": "0.47866812", "text": "func toTimestamp(t time.Time) *timestamp.Timestamp {\n\tts, _ := ptypes.TimestampProto(t)\n\treturn ts\n}", "title": "" }, { "docid": "2628956edd402f66a7329f97e7a72267", "score": "0.4780743", "text": "func (t LegacyTimestamp) ToTimestamp() Timestamp {\n\tvar flags uint32\n\tif t.Flags != nil {\n\t\tflags = *t.Flags\n\t}\n\treturn Timestamp{WallTime: t.WallTime, Logical: t.Logical, Flags: flags}\n}", "title": "" }, { "docid": "cba47998da4dd89539585dc5b38fc380", "score": "0.47669348", "text": "func (o *MockOracle) GetStaleTimestamp(ctx context.Context, txnScope string, prevSecond uint64) (ts uint64, err error) {\n\treturn oracle.GoTimeToTS(time.Now().Add(-time.Second * time.Duration(prevSecond))), nil\n}", "title": "" }, { "docid": "10c312f642dd00febac67adc98c4bc8c", "score": "0.4765786", "text": "func (o *PeopleAuthData) GetTimestamp() string {\n\tif o == nil || o.Timestamp == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Timestamp\n}", "title": "" }, { "docid": "b9dc033471172410d74b87a7d5fdfce1", "score": "0.47655663", "text": "func NewTimestamp() Timestamp {\n\treturn Timestamp(time.Now().Local())\n}", "title": "" }, { "docid": "95fa6df7074596eb0a833df841239064", "score": "0.47626752", "text": "func (m *FileSecurityProfile) GetFirstSeenDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) {\n val, err := m.GetBackingStore().Get(\"firstSeenDateTime\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)\n }\n return nil\n}", "title": "" }, { "docid": "b4dd54e1091759b403965f6ba0c20157", "score": "0.4762245", "text": "func ReadTimestamp(src []byte) (t, i uint32, rem []byte, ok bool) {\n\ti, rem, ok = readu32(src)\n\tif !ok {\n\t\treturn 0, 0, src, false\n\t}\n\tt, rem, ok = readu32(rem)\n\tif !ok {\n\t\treturn 0, 0, src, false\n\t}\n\treturn t, i, rem, true\n}", "title": "" }, { "docid": "685b7a6253e245df3bf1e679134f8ef7", "score": "0.47587225", "text": "func (o KGObject) ValTimestamp() logentry.KGTimestamp {\n\tif o.ValueType() == KtTimestamp {\n\t\tp := logentry.TimestampPrecision(o.value[31])\n\t\tyear := int(binary.BigEndian.Uint16([]byte(o.value[20:22])))\n\t\tmonth := int(o.value[22])\n\t\tday := int(o.value[23])\n\t\thour := int(o.value[24])\n\t\tmins := int(o.value[25])\n\t\tsecs := int(o.value[26])\n\t\tnano := int(binary.BigEndian.Uint32([]byte(o.value[27:31])))\n\t\treturn logentry.KGTimestamp{\n\t\t\tPrecision: p,\n\t\t\tValue: time.Date(year, time.Month(month), day, hour, mins, secs, nano, time.UTC),\n\t\t}\n\t}\n\treturn logentry.KGTimestamp{}\n}", "title": "" }, { "docid": "0d9dbd4b05633a7f44aa965d9f2b6d8a", "score": "0.47582075", "text": "func (o PreventionDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationPrimitiveTransformationFixedSizeBucketingConfigLowerBoundOutput) TimestampValue() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v PreventionDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationPrimitiveTransformationFixedSizeBucketingConfigLowerBound) *string {\n\t\treturn v.TimestampValue\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "77d33ba8f38f859a479ee2b66d142f02", "score": "0.47573802", "text": "func GetTimestamp(line string) (time.Time, error) {\n\tpieces := strings.Split(line, \" \")\n\ttextTimestamp := pieces[0]\n\n\treturn time.Parse(ChiaDateFormat, textTimestamp)\n}", "title": "" }, { "docid": "75bbc52101985b576de5a8a1f7c19e59", "score": "0.4752796", "text": "func (t Int8) ToTimestamp() Timestamp {\n\treturn Timestamp(t)\n}", "title": "" }, { "docid": "284f2423262ceeea8cf6ee8dbacbcb1c", "score": "0.47395054", "text": "func MinLocalDateTime() LocalDateTime {\n\treturn minLocalDateTime\n}", "title": "" }, { "docid": "46b7ca2c0b963a45dbc70f8d13c0fd00", "score": "0.47391868", "text": "func Timestamp(t time.Time) common.Time {\n\treturn common.Time(t)\n}", "title": "" }, { "docid": "881e33dd616750ec71aad304aee26a30", "score": "0.47379497", "text": "func _820ctimestampFunc(tls crt.TLS, _context uintptr /* *Tsqlite3_context = Ssqlite3_context */, _NotUsed int32, _NotUsed2 uintptr /* **Tsqlite3_value = Ssqlite3_value */) {\n\t_817datetimeFunc(tls, _context, int32(0), null)\n}", "title": "" }, { "docid": "18deaa4910971a4c92987c2d27a38b83", "score": "0.4732191", "text": "func Timestamp(ts *timestamp.Timestamp) time.Time {\n\tif ts == nil {\n\t\treturn time.Unix(0, 0)\n\t}\n\treturn time.Unix(ts.Time, 0)\n}", "title": "" }, { "docid": "2138177f3daf3a9ac2a6129e75a23e10", "score": "0.47255787", "text": "func TestTimestampExtraction_LocalTime(t *testing.T) {\n\tfor _, testCase := range []struct {\n\t\tname string\n\t\ttsLabel model.LabelName\n\t\tinput string\n\t}{\n\t\t{name: \"undefined ts label\", tsLabel: \"\", input: `{\"ts\":444}`},\n\t\t{name: \"non-existing ts entry\", tsLabel: \"asdfasdf\", input: `{\"ts\":444}`},\n\t\t{name: \"non-numeric ts value\", tsLabel: \"ts\", input: `{\"ts\":\"string value\"}`},\n\t\t{name: \"zero ts value\", tsLabel: \"ts\", input: `{\"ts\":0}`},\n\t} {\n\t\tt.Run(testCase.name, func(t *testing.T) {\n\t\t\tfe := fakeEmitter{}\n\t\t\tfe.On(\"Handle\", mock.Anything, mock.Anything, mock.Anything).Return(nil)\n\t\t\tcfg := DefaultConfig()\n\t\t\tcfg.TimestampLabel = testCase.tsLabel\n\t\t\tloki, err := NewLoki(cfg)\n\t\t\trequire.NoError(t, err)\n\t\t\tloki.emitter = &fe\n\t\t\tloki.timeNow = func() time.Time {\n\t\t\t\treturn time.Unix(12345678, 0)\n\t\t\t}\n\t\t\trequire.NoError(t, loki.Process(strings.NewReader(testCase.input)))\n\t\t\tfe.AssertCalled(t, \"Handle\", model.LabelSet{\"app\": \"goflow2\"},\n\t\t\t\ttime.Unix(12345678, 0), testCase.input)\n\t\t})\n\t}\n}", "title": "" }, { "docid": "abc0f04a7029c5606bb5a2cb60da8801", "score": "0.47202072", "text": "func _1432localtimeOffset(tls crt.TLS, _p uintptr /* *TDateTime = SDateTime */, _pCtx uintptr /* *Tsqlite3_context = Ssqlite3_context */, _pRc uintptr /* *int32 */) (r int64) {\n\tesc := crt.MustMalloc(168)\n\tvar (\n\t\t_x = esc // *TDateTime = SDateTime\n\t\t_y = esc + 48 // *TDateTime = SDateTime\n\t\t_t = esc + 96 // *Ttime_t = T__time_t = int64\n\t\t_sLocal = esc + 112 // *Stm\n\t\t_s int32\n\t)\n\tdefer crt.Free(esc)\n\tcrt.Xmemset(tls, _sLocal, int32(0), uint64(56))\n\t*(*SDateTime)(unsafe.Pointer(_x)) = *(*SDateTime)(unsafe.Pointer(_p))\n\t_1109computeYMD_HMS(tls, _x)\n\tif (*(*int32)(unsafe.Pointer(_x + 8))) >= int32(1971) && (*(*int32)(unsafe.Pointer(_x + 8))) < int32(2038) {\n\t\tgoto _1\n\t}\n\n\t*(*int32)(unsafe.Pointer(_x + 8)) = int32(2000)\n\t*(*int32)(unsafe.Pointer(_x + 12)) = int32(1)\n\t*(*int32)(unsafe.Pointer(_x + 16)) = int32(1)\n\t*(*int32)(unsafe.Pointer(_x + 20)) = int32(0)\n\t*(*int32)(unsafe.Pointer(_x + 24)) = int32(0)\n\t*(*float64)(unsafe.Pointer(_x + 32)) = float64(0)\n\tgoto _2\n\n_1:\n\t_s = int32((*(*float64)(unsafe.Pointer(_x + 32))) + float64(0.5))\n\t*(*float64)(unsafe.Pointer(_x + 32)) = float64(_s)\n_2:\n\t*(*int32)(unsafe.Pointer(_x + 28)) = int32(0)\n\t*(*int8)(unsafe.Pointer(_x + 40)) = int8(0)\n\t_1106computeJD(tls, _x)\n\t*(*int64)(unsafe.Pointer(_t)) = int64(((*(*int64)(unsafe.Pointer(_x))) / int64(1000)) - int64(210866760000))\n\tif _1702osLocaltime(tls, _t, _sLocal) == 0 {\n\t\tgoto _3\n\t}\n\n\tXsqlite3_result_error(tls, _pCtx, ts+28938 /* \"local time unavailable\" */, int32(-1))\n\t*(*int32)(unsafe.Pointer(_pRc)) = int32(1)\n\treturn int64(0)\n\n_3:\n\t*(*int32)(unsafe.Pointer(_y + 8)) = (*(*int32)(unsafe.Pointer(_sLocal + 20))) + int32(1900)\n\t*(*int32)(unsafe.Pointer(_y + 12)) = (*(*int32)(unsafe.Pointer(_sLocal + 16))) + int32(1)\n\t*(*int32)(unsafe.Pointer(_y + 16)) = *(*int32)(unsafe.Pointer(_sLocal + 12))\n\t*(*int32)(unsafe.Pointer(_y + 20)) = *(*int32)(unsafe.Pointer(_sLocal + 8))\n\t*(*int32)(unsafe.Pointer(_y + 24)) = *(*int32)(unsafe.Pointer(_sLocal + 4))\n\t*(*float64)(unsafe.Pointer(_y + 32)) = float64(*(*int32)(unsafe.Pointer(_sLocal)))\n\t*(*int8)(unsafe.Pointer(_y + 42)) = int8(1)\n\t*(*int8)(unsafe.Pointer(_y + 43)) = int8(1)\n\t*(*int8)(unsafe.Pointer(_y + 40)) = int8(0)\n\t*(*int8)(unsafe.Pointer(_y + 41)) = int8(0)\n\t*(*int8)(unsafe.Pointer(_y + 44)) = int8(0)\n\t*(*int8)(unsafe.Pointer(_y + 46)) = int8(0)\n\t_1106computeJD(tls, _y)\n\t*(*int32)(unsafe.Pointer(_pRc)) = int32(0)\n\treturn (*(*int64)(unsafe.Pointer(_y))) - (*(*int64)(unsafe.Pointer(_x)))\n}", "title": "" }, { "docid": "549940d11ca0055aa8f6edcae09684c0", "score": "0.4717728", "text": "func (es *Graph) GetTimestamp() string {\n\treturn es.ts.Get(es.graph)\n}", "title": "" }, { "docid": "ff79e7704a8322f980c6b4fbb4049583", "score": "0.4715832", "text": "func (msg *GetLargeObjectResponseMessage) GetTimestamp() int64 {\n\treturn msg.HeaderGetTimestamp()\n}", "title": "" }, { "docid": "6ed24d74f4d454aaebc8e99559308417", "score": "0.47153312", "text": "func (m *TimeSeriesParameter) GetStartDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) {\n val, err := m.GetBackingStore().Get(\"startDateTime\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)\n }\n return nil\n}", "title": "" }, { "docid": "3e28a5053dd02f63f0cc349ef6d35348", "score": "0.47113353", "text": "func GetTimstamp(start string) int64 {\n\ttimeLayout := \"2006-01-02 15:04\"\n\tvar loc = time.FixedZone(\"CST\", 8*3600) // 东八\n\tif runtime.GOOS !=\"windows\" {\n\t\tloc, _ = time.LoadLocation(\"Asia/Shanghai\") //获取时区\n\t}\n\n\tif len(start)==10 {\n\t\tstart = start+\" 00:00\"\n\t}\n\tstarttmp, _ := time.ParseInLocation(timeLayout, start, loc)\n\tstarttimestamp := starttmp.Unix()\n\treturn starttimestamp\n}", "title": "" }, { "docid": "0e854ff612ffcf0953f9551f2e11cc39", "score": "0.47107154", "text": "func (c postgresClient) GetEarliest() (time.Time, error) {\n\t// Query the database to get the earliest datestamp\n\tvar t time.Time\n\terr := c.database.QueryRow(\"SELECT MIN(datestamp) FROM bugs\").Scan(&t)\n\n\tif err != nil {\n\t\treturn time.Time{}, fmt.Errorf(\"error scanning row for earliest datestamp: %v\", err)\n\t}\n\n\treturn t, nil\n}", "title": "" }, { "docid": "96deb2b7407d510d61b0c29485b79ed0", "score": "0.4707614", "text": "func (_LifCrowdsale *LifCrowdsaleCallerSession) StartTimestamp() (*big.Int, error) {\n\treturn _LifCrowdsale.Contract.StartTimestamp(&_LifCrowdsale.CallOpts)\n}", "title": "" }, { "docid": "984f6115acc682eb874e113f3df88aae", "score": "0.47000638", "text": "func ReadTimestamp(r io.Reader) (data time.Time, err error) {\n\tvar seconds uint64\n\tif seconds, err = ReadLonglong(r); err != nil {\n\t\treturn\n\t}\n\treturn time.Unix(int64(seconds), 0), nil\n}", "title": "" }, { "docid": "c45fb29ca7f712403e941e7956ff0f9c", "score": "0.46984595", "text": "func (o ContainerEventResponseOutput) FirstTimestamp() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v ContainerEventResponse) *string { return v.FirstTimestamp }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "606d8f56959a0dbdb69060a93d4506df", "score": "0.4691403", "text": "func GetTimeStamp(id gflake) time.Time {\n\ttimebits := int64((id >> TimeStampOffset) + Epoch)\n\tstamp := time.Unix(timebits, 0)\n\treturn stamp\n}", "title": "" }, { "docid": "6a90d4ce092d7955b9963f6d7dc9bf20", "score": "0.46842864", "text": "func (tk *TimeKit) Timestamp() int64 {\n\treturn tk.Unix()\n}", "title": "" }, { "docid": "3e6510f1be7931020ee117818d15059a", "score": "0.46825856", "text": "func (msg *PingMessage) GetTimestamp() int64 {\n\treturn msg.HeaderGetTimestamp()\n}", "title": "" }, { "docid": "3f60b77eaf59722a6e6243fc823ebd9a", "score": "0.46717373", "text": "func (o *PeopleAuthData) GetTimestampOk() (*string, bool) {\n\tif o == nil || o.Timestamp == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Timestamp, true\n}", "title": "" }, { "docid": "5d8b0071f1c2f67b013b75f74583eae7", "score": "0.46655107", "text": "func (o *PluginState) GetTimestamp() int64 {\n\tif o == nil || o.Timestamp == nil {\n\t\tvar ret int64\n\t\treturn ret\n\t}\n\treturn *o.Timestamp\n}", "title": "" }, { "docid": "df7a0dc8ba4fa1aeff3f9d6ce2f4c358", "score": "0.46642417", "text": "func (ev *Event) ResolveEventTimestamp() time.Time {\n\tif ev.Timestamp.IsZero() {\n\t\tev.Timestamp = ev.resolvers.TimeResolver.ResolveMonotonicTimestamp(ev.TimestampRaw)\n\t\tif ev.Timestamp.IsZero() {\n\t\t\tev.Timestamp = time.Now()\n\t\t}\n\t}\n\treturn ev.Timestamp\n}", "title": "" }, { "docid": "160f08c01b200dc94cc8527471485839", "score": "0.46640036", "text": "func (b *BackupEngineInfo) GetTimestamp(index int) int64 {\n\treturn int64(C.rocksdb_backup_engine_info_timestamp(b.c, C.int(index)))\n}", "title": "" } ]
e55e82b6623db4bf87e5746866ca0075
PopulateCertificate is a paid mutator transaction binding the contract method 0x2db9b7c5. Solidity: function populateCertificate(_cert bytes) returns()
[ { "docid": "16a256cbb39faa6a6d3f640da5edd95c", "score": "0.7796471", "text": "func (_LuxUni_PKI *LuxUni_PKISession) PopulateCertificate(_cert []byte) (*types.Transaction, error) {\n\treturn _LuxUni_PKI.Contract.PopulateCertificate(&_LuxUni_PKI.TransactOpts, _cert)\n}", "title": "" } ]
[ { "docid": "c2d4732a26e7f106d2728710d1993fb8", "score": "0.8244227", "text": "func (_LuxUni_PKI *LuxUni_PKITransactor) PopulateCertificate(opts *bind.TransactOpts, _cert []byte) (*types.Transaction, error) {\n\treturn _LuxUni_PKI.contract.Transact(opts, \"populateCertificate\", _cert)\n}", "title": "" }, { "docid": "5dd70c4659e62adbd89936e043dca9ab", "score": "0.7675523", "text": "func (_LuxUni_PKI *LuxUni_PKITransactorSession) PopulateCertificate(_cert []byte) (*types.Transaction, error) {\n\treturn _LuxUni_PKI.Contract.PopulateCertificate(&_LuxUni_PKI.TransactOpts, _cert)\n}", "title": "" }, { "docid": "cc6e5863b15411419fbafeaf0e457a92", "score": "0.5781106", "text": "func (t *EducationChaincode) insertCertificate(stub shim.ChaincodeStubInterface, args []string) peer.Response {\n\t\n\tif len(args) != 11 {\n\t\treturn shim.Error(\"Incorrect number of arguments. expecting 11 args\")\n\t}\n\n\tcert_id := args[0]\n\tcert_no := args[1]\n\tcert_name := args[2]\t\n\tcert_receiver_id := args[3]\n\tcert_issuer := args[4]\n\tcert_industry := args[5]\n\tcert_create_time := args[6]\n\tcert_update_time := args[7]\n\tcert_remark := args[8]\n\tcert_url_image := args[9]\n\tcert_status := args[10]\n\n\n\t// check if receiver exists\n\tReceAsBytes, err := stub.GetState(cert_receiver_id)\n\tif err != nil {\n\t\treturn shim.Error(\"Failed to get Receiver:\" + cert_receiver_id + \",\" + err.Error())\n\t} else if ReceAsBytes == nil {\n\t fmt.Println(\"Receiver does not exist with id: \" + cert_receiver_id )\n\t\treturn shim.Error(\"Receiver does not exist with id: \" + cert_receiver_id )\n\t}\n\n\t//Fetch receiver name from the state\n\treceiver := &Receiver{}\n\terr = json.Unmarshal([]byte(ReceAsBytes), &receiver)\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\tcert_receiver :=receiver.Receiver_name;\n\tfmt.Println(\"cert_receiver: \"+cert_receiver)\n\n\tobjectType := \"certificate\"\n\tcertificate := &Certificate{objectType,cert_id,cert_no,cert_name,cert_receiver,cert_receiver_id,cert_issuer,cert_industry,cert_create_time,cert_update_time,cert_remark,cert_url_image,cert_status}\n\tcertificateJSONasBytes, err := json.Marshal(certificate)\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\n\t// insert the certificate into the ledger\n\terr = stub.PutState(cert_id, certificateJSONasBytes)\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\n\t// certificate saved - Return success\t\n\treturn shim.Success(nil)\n}", "title": "" }, { "docid": "fc481b50f2de076c14ef12d65488594c", "score": "0.5716164", "text": "func (m *CertificateAuthority) SetCertificate(value []byte)() {\n m.certificate = value\n}", "title": "" }, { "docid": "9c4fd16f79286c932a228aab475bc6af", "score": "0.55327123", "text": "func (_RegistryExtended *RegistryExtendedCaller) GetCertificate(opts *bind.CallOpts, _id *big.Int) (struct {\n\tIssuer common.Address\n\tTopic *big.Int\n\tValidityCall []byte\n\tData []byte\n}, error) {\n\tvar out []interface{}\n\terr := _RegistryExtended.contract.Call(opts, &out, \"getCertificate\", _id)\n\n\toutstruct := new(struct {\n\t\tIssuer common.Address\n\t\tTopic *big.Int\n\t\tValidityCall []byte\n\t\tData []byte\n\t})\n\tif err != nil {\n\t\treturn *outstruct, err\n\t}\n\n\toutstruct.Issuer = *abi.ConvertType(out[0], new(common.Address)).(*common.Address)\n\toutstruct.Topic = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int)\n\toutstruct.ValidityCall = *abi.ConvertType(out[2], new([]byte)).(*[]byte)\n\toutstruct.Data = *abi.ConvertType(out[3], new([]byte)).(*[]byte)\n\n\treturn *outstruct, err\n\n}", "title": "" }, { "docid": "0225104ae2b73d89ed232fec933035c2", "score": "0.5471718", "text": "func GenerateCertificate(priv crypto.Signer) (*tls.Certificate, *x509.CertPool, error) {\n\ttemplate := x509.Certificate{\n\t\tSerialNumber: big.NewInt(1),\n\t\tSubject: pkix.Name{Organization: []string{\"quic-go fuzzer\"}},\n\t\tNotBefore: time.Now().Add(-24 * time.Hour),\n\t\tNotAfter: time.Now().Add(30 * 24 * time.Hour),\n\t\tKeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,\n\t\tExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},\n\t\tDNSNames: []string{\"localhost\"},\n\t\tBasicConstraintsValid: true,\n\t}\n\tderBytes, err := x509.CreateCertificate(rand.Reader, &template, &template, priv.Public(), priv)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tcert, err := x509.ParseCertificate(derBytes)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tcertPool := x509.NewCertPool()\n\tcertPool.AddCert(cert)\n\treturn &tls.Certificate{\n\t\tCertificate: [][]byte{derBytes},\n\t\tPrivateKey: priv,\n\t}, certPool, nil\n}", "title": "" }, { "docid": "636eac1b2508f5c8fdf452077bc7c40c", "score": "0.54651177", "text": "func (client DevicesClient) GenerateCertificateResponder(resp *http.Response) (result GenerateCertResponse, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK),\n\t\tautorest.ByUnmarshallingJSON(&result),\n\t\tautorest.ByClosing())\n\tresult.Response = autorest.Response{Response: resp}\n\treturn\n}", "title": "" }, { "docid": "b9447694ec750747b1fa37c402633e7a", "score": "0.5405621", "text": "func (s *StakeAddress) RegistrationCertificate() {}", "title": "" }, { "docid": "41ccb121ca2f147ce59125527630e36e", "score": "0.54025257", "text": "func GenerateCertificate(keyPEM []byte, cn string, lifetime time.Duration, usage CertificateUsage, sans []string, caKeyPEM, caCertPEM []byte) ([]byte, error) {\n\tkey, err := DecodePrivateKey(keyPEM)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Catch user misconfigurations.\n\tif _, ok := key.(ed25519.PrivateKey); ok {\n\t\treturn nil, errors.NewConfigurationError(\"cannot use ed25519 keys for x.509 certificates\")\n\t}\n\n\treq := &x509.CertificateRequest{\n\t\tSubject: pkix.Name{\n\t\t\tCommonName: cn,\n\t\t},\n\t}\n\n\tcsr, err := x509.CreateCertificateRequest(rand.Reader, req, key)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq, err = x509.ParseCertificateRequest(csr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tserialNumber, err := generateSerial()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tsubjectKeyID, err := generateSubjectKeyIdentifier(req.PublicKey)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tnotBefore := time.Now()\n\tnotAfter := notBefore.Add(lifetime)\n\n\tcertificate := &x509.Certificate{\n\t\tSerialNumber: serialNumber,\n\t\tSubject: req.Subject,\n\t\tNotBefore: notBefore,\n\t\tNotAfter: notAfter,\n\t\tBasicConstraintsValid: true,\n\t\tSubjectKeyId: subjectKeyID,\n\t}\n\n\tfor _, san := range sans {\n\t\t// A type and a name.\n\t\trequiredFields := 2\n\n\t\tfields := strings.Split(san, \":\")\n\t\tif len(fields) != requiredFields {\n\t\t\treturn nil, fmt.Errorf(\"%w: malformed SAN %s\", ErrInvalidSubjectAltName, san)\n\t\t}\n\n\t\tswitch fields[0] {\n\t\tcase \"DNS\":\n\t\t\tcertificate.DNSNames = append(certificate.DNSNames, fields[1])\n\t\tcase \"EMAIL\":\n\t\t\tcertificate.EmailAddresses = append(certificate.EmailAddresses, fields[1])\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"%w unsupported SAN type %s\", ErrInvalidSubjectAltName, fields[0])\n\t\t}\n\t}\n\n\tswitch usage {\n\tcase CA:\n\t\tcertificate.IsCA = true\n\t\tcertificate.KeyUsage = x509.KeyUsageCertSign | x509.KeyUsageCRLSign\n\tcase Server:\n\t\tcertificate.KeyUsage = x509.KeyUsageDigitalSignature | x509.KeyUsageKeyEncipherment\n\t\tcertificate.ExtKeyUsage = []x509.ExtKeyUsage{\n\t\t\tx509.ExtKeyUsageServerAuth,\n\t\t}\n\tcase Client:\n\t\tcertificate.KeyUsage = x509.KeyUsageDigitalSignature\n\t\tcertificate.ExtKeyUsage = []x509.ExtKeyUsage{\n\t\t\tx509.ExtKeyUsageClientAuth,\n\t\t}\n\tdefault:\n\t\treturn nil, errors.NewConfigurationError(\"unknown usage type %v\", usage)\n\t}\n\n\t// Default to self signing.\n\tcaKey := key\n\tcaCert := certificate\n\n\tif caKeyPEM != nil {\n\t\tcaKey, err = DecodePrivateKey(caKeyPEM)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tcaCert, err = DecodeCertificate(caCertPEM)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tcert, err := x509.CreateCertificate(rand.Reader, certificate, caCert, req.PublicKey, caKey)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcertPEMBlock := &pem.Block{\n\t\tType: pemTypeCertificate,\n\t\tBytes: cert,\n\t}\n\n\tcertPEM := pem.EncodeToMemory(certPEMBlock)\n\n\treturn certPEM, nil\n}", "title": "" }, { "docid": "7dafbd664053a308019f98f173051fb0", "score": "0.534337", "text": "func (t *EducationChaincode) approveCertificate(stub shim.ChaincodeStubInterface, args []string) peer.Response {\n\n\tvar err error\n\t// check args\n\tif len(args) != 3 {\n\t\treturn shim.Error(\"Incorrect number of arguments. Expecting 3\")\n\t}\n\tif len(args[0]) <= 0 {\n\t\treturn shim.Error(\"1st argument must be a non-empty string\")\n\t}\n\tif len(args[1]) <= 0 {\n\t\treturn shim.Error(\"2nd argument must be a non-empty string\")\n\t}\n\tif len(args[2]) <= 0 {\n\t\treturn shim.Error(\"3rd argument must be a non-empty string\")\n\t}\n\n\tcert_id := args[0]\n\tstatus := args[1]\n\tupdate_time := args[2]\n\n\t//Read certificate details from the ledger\n\tvalAsbytes, err := stub.GetState(cert_id) \n\t\tif err != nil {\n\t\t\treturn shim.Error(err.Error())\n\t\t} else if valAsbytes == nil {\n\t\t\treturn shim.Error(\"certificate not exist\")\n\t\t}\n\t\n\tcertificate := &Certificate{}\n\terr = json.Unmarshal([]byte(valAsbytes), &certificate)\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\tcertificate.Cert_status = status\n\tcertificate.Cert_update_time = update_time\n\n\tvalAsbytes, err = json.Marshal(certificate)\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\t//Update the certificate in the ledger\n\terr = stub.PutState(cert_id, valAsbytes)\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\n\t//Publishing a custom event\n\tvar testEventValue []byte\n\ttestEventValue=[]byte(\"Certificate \"+cert_id+\" status is changed to \"+status)\n\tstub.SetEvent(\"testEvent\",testEventValue)\n\t\n\treturn shim.Success(nil)\n\n}", "title": "" }, { "docid": "c6cfb3fd534dc73f61c25fa5d4dc0e8e", "score": "0.53194344", "text": "func populateCertificates(s Specification) {\n\tlog.Println(\"[populateCertificates] job started\")\n\t_, mobs := GetUrls(s)\n\n\tcache := \"/tmp/tld.cache\"\n\textract, _ := tldextract.New(cache, false)\n\n\tfor _, mob := range mobs {\n\t\trootDomain := extract.Extract(mob.CustomDomain)\n\t\tfmt.Printf(\"%s\\n\", rootDomain.Root)\n\n\t\tvar cachedCert = RedisReadMobilization(\"cached_certificates:\" + rootDomain.Root)\n\t\tif string(cachedCert.Name) == \"\" {\n\t\t\tlog.Println(\"[populateCertificate] NEW CERT FOUND\")\n\t\t\tgenerateNewCertificates()\n\t\t} else {\n\n\t\t}\n\t}\n\t// time.Sleep(30 * time.Second)\n\t// pid := os.Getpid()\n\t// proc, _ := os.FindProcess(pid)\n\t// proc.Signal(os.Interrupt)\n}", "title": "" }, { "docid": "586398242ab444f38cfde7bd3c8b68c5", "score": "0.5302005", "text": "func (o AuthenticatedOriginPullsCertificateOutput) Certificate() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *AuthenticatedOriginPullsCertificate) pulumi.StringOutput { return v.Certificate }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "68b22a6c4342c9c8d244a8440fb13c1f", "score": "0.52607495", "text": "func (m *CertificateAuthority) GetCertificate()([]byte) {\n return m.certificate\n}", "title": "" }, { "docid": "bb8ae63b9412d5b0a3113cb3b65be71b", "score": "0.52567786", "text": "func generateCert() ([]byte, []byte, error) {\n\tvar err error\n\n\tpriv, err := rsa.GenerateKey(rand.Reader, 2048)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"failed to generate rsa key: %w\", err)\n\t}\n\n\tkeyBytes, err := x509.MarshalPKCS8PrivateKey(priv)\n\tif err != nil {\n\t\treturn nil, keyBytes, fmt.Errorf(\"failed to marshal private key: %w\", err)\n\t}\n\n\tserialNumber, err := rand.Int(rand.Reader, new(big.Int).Lsh(big.NewInt(1), 128))\n\tif err != nil {\n\t\treturn nil, keyBytes, fmt.Errorf(\"failed to generate random serial number: %w\", err)\n\t}\n\n\tkeyID, err := func() ([]byte, error) {\n\t\tbytes := make([]byte, 20)\n\t\tif _, err := rand.Read(bytes); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to generate random bytes: %w\", err)\n\t\t}\n\n\t\treturn bytes, nil\n\t}()\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"failed to generate x509 certificate key ID: %w\", err)\n\t}\n\n\tnotBefore := time.Now()\n\ttemplate := x509.Certificate{\n\t\tSerialNumber: serialNumber,\n\t\tSubject: pkix.Name{\n\t\t\tCommonName: \"mitm-proxy-ca\",\n\t\t},\n\t\tNotBefore: notBefore,\n\t\tNotAfter: notBefore.Add(time.Hour),\n\t\tSubjectKeyId: keyID,\n\t\tAuthorityKeyId: keyID,\n\t\tBasicConstraintsValid: true,\n\t\tIsCA: true,\n\t}\n\n\tcertBytes, err := x509.CreateCertificate(rand.Reader, &template, &template, &priv.PublicKey, priv)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"failed to generate X.509 certificate: %w\", err)\n\t}\n\n\treturn certBytes, keyBytes, nil\n}", "title": "" }, { "docid": "a55e1b8f38ae552bf6b92161e220a6fc", "score": "0.52389574", "text": "func (c App) createCertificate(id int, certificate models.FullCertificate) (*models.Certificate, error) {\n\n\t// Keep track of whether this is a self signed certificate\n\tvar sign_cert *models.Certificate\n\n\t// Get the CA certificate that is signing this new cert\n\tvar project *models.Project\n\tif id >= 0 {\n\t\tproject = c.getProject(id)\n\t\tif project == nil {\n\t\t\treturn nil, errors.New(\"Unable to retreive project\")\n\t\t}\n\t\tcas := c.getProjectCAs(project)\n\n\t\tca := c.Params.Values[\"certificate.SignedBy\"][0]\n\t\tca_val, _ := strconv.Atoi(ca)\n\t\tfor _, c := range cas {\n\t\t\tif c.Id == ca_val {\n\t\t\t\tsign_cert = c\n\t\t\t}\n\t\t}\n\t}\n\n\tserialNumber := 1\n\tcaCount := &models.CACount{}\n\tvar CRLLocation []string\n\tif sign_cert != nil {\n\t\t// Another Cert is CA\n\t\tobj, err := c.Txn.Get(models.CACount{}, sign_cert.Id)\n\t\tif err != nil {\n\t\t\treturn nil, errors.New(\"Error determining Serial Number\")\n\t\t}\n\t\tcaCount = obj.(*models.CACount)\n\t\tserialNumber = caCount.SerialNumber + 1\n\t\tcaCount.SerialNumber = serialNumber\n\t\t_, err = c.Txn.Update(caCount)\n\t\tif err != nil {\n\t\t\treturn nil, newError(\"Error saving ca count\", err)\n\t\t}\n\t\t// Use the CRL of the cert that is signing it\n\t\tCRLLocation := []string{c.makeCRLLocation(caCount.Id)}\n\t\tif certificate.IsCA {\n\t\t\t// This certificate should now have it's own\n\t\t\tCRLLocation = append(CRLLocation, c.makeCRLLocation(caCount.Id))\n\n\t\t}\n\t} else {\n\t\tcrlCount := c.getCRLCount()\n\t\tCRLLocation = []string{c.makeCRLLocation(crlCount + 1)}\n\n\t}\n\n\t// Set up ways Key can be used\n\tcertificate.KeyUses = c.Params.Values[\"certificate.KeyUses\"]\n\tcertificate.ExtKeyUses = c.Params.Values[\"certificate.ExtKeyUses\"]\n\n\t//Set up primary key uses\n\tkeyUsage := 0\n\tfor _, use := range certificate.KeyUses {\n\t\tv, _ := strconv.Atoi(use)\n\t\tkeyUsage = keyUsage | v\n\t}\n\t// CAs need to be able to sign other certificates and Certificate Revocation Lists\n\tif certificate.IsCA {\n\t\tkeyUsage = keyUsage | int(x509.KeyUsageCertSign) | int(x509.KeyUsageCRLSign)\n\t}\n\n\t// Set up extra key uses for certificate\n\textKeyUsage := make([]x509.ExtKeyUsage, 0)\n\tfor _, use := range certificate.ExtKeyUses {\n\t\tv, _ := strconv.Atoi(use)\n\t\textKeyUsage = append(extKeyUsage, x509.ExtKeyUsage(v))\n\t}\n\n\tendTime, _ := time.Parse(\"2006-01-02\", certificate.Expires)\n\n\tencrypted := false\n\n\ttemplate := x509.Certificate{\n\t\tSerialNumber: new(big.Int).SetInt64(int64(serialNumber)),\n\t\tSubject: pkix.Name{\n\t\t\tOrganization: []string{certificate.Organization},\n\t\t\tOrganizationalUnit: []string{certificate.OrganizationUnit},\n\t\t\tCountry: []string{certificate.Country},\n\t\t\tProvince: []string{certificate.State},\n\t\t\tLocality: []string{certificate.City},\n\t\t\tCommonName: certificate.CommonName,\n\t\t},\n\t\tNotBefore: time.Now(),\n\t\tNotAfter: endTime,\n\t\tIsCA: certificate.IsCA,\n\t\tKeyUsage: x509.KeyUsage(keyUsage),\n\t\tExtKeyUsage: extKeyUsage,\n\t\tBasicConstraintsValid: true,\n\t\tCRLDistributionPoints: CRLLocation,\n\t}\n\n\tenc := strings.Split(certificate.PrivateKeyType, \" \")\n\tvar privCert []byte\n\tvar pubCert []byte\n\tvar keyType models.KeyType\n\tvar signKey interface{}\n\tvar parent *x509.Certificate\n\n\t// Create RSA Cert\n\tif strings.HasPrefix(enc[0], \"RSA\") {\n\t\tkeyType = models.RSA\n\t\tsize, err := strconv.Atoi(enc[1])\n\t\tif err != nil {\n\t\t\treturn nil, newError(\"Failed to generate private key\", err)\n\t\t}\n\t\tpriv, err := rsa.GenerateKey(rand.Reader, size)\n\n\t\tif err != nil {\n\t\t\treturn nil, newError(\"Failed to generate private key\", err)\n\t\t}\n\t\tif sign_cert == nil {\n\t\t\tsignKey = priv\n\t\t\tparent = &template\n\t\t} else {\n\n\t\t\t// Getting signed by CA, get CA private key bytes\n\t\t\tvar ca_bytes []byte\n\t\t\tca_block, _ := pem.Decode(sign_cert.PrivateKey)\n\t\t\tif ca_block == nil {\n\t\t\t\treturn nil, newError(\"Unable to decode CA privatekey\", nil)\n\t\t\t}\n\t\t\tca_bytes = ca_block.Bytes\n\t\t\tif x509.IsEncryptedPEMBlock(ca_block) {\n\t\t\t\tif len(certificate.CAEncryptionKey) == 0 {\n\t\t\t\t\treturn nil, errors.New(\"Unable to unlock CA key\")\n\t\t\t\t} else {\n\t\t\t\t\t// CA is encrypted so decrypt it\n\t\t\t\t\tca_bytes, err = x509.DecryptPEMBlock(ca_block, []byte(certificate.CAEncryptionKey))\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, errors.New(\"Unable to decrypt CA key\")\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Obtain the key for the CA for signing\n\t\t\tif sign_cert.KeyType == models.RSA {\n\t\t\t\tsignKey, err = x509.ParsePKCS1PrivateKey(ca_bytes)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, newError(\"Error parsing certificate\", err)\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tsignKey, err = x509.ParseECPrivateKey(ca_bytes)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, newError(\"Error parsing certificate\", err)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// We need the public certificate of the CA as well\n\t\t\tblock, _ := pem.Decode(sign_cert.PEM)\n\t\t\tif block == nil {\n\t\t\t\treturn nil, newError(\"Unable to decode CA cert\", nil)\n\t\t\t}\n\t\t\tparent, err = x509.ParseCertificate(block.Bytes)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, newError(\"Failed to generate private key:\", err)\n\t\t\t}\n\n\t\t}\n\t\tpub := priv.PublicKey\n\t\tmarshalledKey := x509.MarshalPKCS1PrivateKey(priv)\n\t\tderBytes, err := x509.CreateCertificate(rand.Reader, &template, parent, &pub, signKey)\n\t\tif err != nil {\n\t\t\treturn nil, newError(\"Failed to create certificate \\n\", err)\n\t\t}\n\t\t// Convert certificate to PEM to be stored in DB\n\t\tpubCert = pem.EncodeToMemory(&pem.Block{Type: \"CERTIFICATE\", Bytes: derBytes})\n\t\tpemKeyBlock := &pem.Block{Type: \"RSA PRIVATE KEY\", Bytes: marshalledKey}\n\t\t// Encrypt the private key if an encryption key was provided\n\t\tif len(certificate.EncryptionKey) > 0 {\n\t\t\tpemKeyBlock, err = x509.EncryptPEMBlock(rand.Reader, pemKeyBlock.Type, pemKeyBlock.Bytes, []byte(certificate.EncryptionKey), x509.PEMCipherAES256)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, newError(\"Failed to encrypt key\", err)\n\t\t\t}\n\t\t\tencrypted = true\n\t\t}\n\t\tprivCert = pem.EncodeToMemory(pemKeyBlock)\n\n\t} else { // Create ECDSA Cert\n\n\t\tkeyType = models.ECDSA\n\t\tvar curve elliptic.Curve\n\t\t// Select the Elliptic curve to use\n\t\tswitch enc[1] {\n\t\tcase \"224\":\n\t\t\tcurve = elliptic.P224()\n\n\t\tcase \"256\":\n\t\t\tcurve = elliptic.P256()\n\n\t\tcase \"384\":\n\t\t\tcurve = elliptic.P384()\n\n\t\tcase \"521\":\n\t\t\tcurve = elliptic.P521()\n\t\t}\n\t\tpriv, err := ecdsa.GenerateKey(curve, rand.Reader)\n\t\tpub := priv.PublicKey\n\t\tif err != nil {\n\t\t\treturn nil, newError(\"Failed to generate private key\", err)\n\t\t}\n\n\t\tif sign_cert == nil {\n\t\t\tsignKey = priv\n\t\t\tparent = &template\n\t\t} else {\n\n\t\t\t// Getting signed by CA, get CA private key bytes\n\t\t\tvar ca_bytes []byte\n\t\t\tca_block, _ := pem.Decode(sign_cert.PrivateKey)\n\t\t\tif ca_block == nil {\n\t\t\t\treturn nil, newError(\"Unable to decode CA privatekey\", nil)\n\t\t\t}\n\t\t\tca_bytes = ca_block.Bytes\n\t\t\tif x509.IsEncryptedPEMBlock(ca_block) {\n\t\t\t\tif len(certificate.CAEncryptionKey) == 0 {\n\t\t\t\t\treturn nil, errors.New(\"Unable to unlock CA key\")\n\t\t\t\t} else {\n\t\t\t\t\t// CA is encrypted so decrypt it\n\t\t\t\t\tca_bytes, err = x509.DecryptPEMBlock(ca_block, []byte(certificate.CAEncryptionKey))\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, errors.New(\"Unable to decrypt CA key\")\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Obtain the key for the CA for signing\n\t\t\tif sign_cert.KeyType == models.RSA {\n\t\t\t\tsignKey, err = x509.ParsePKCS1PrivateKey(ca_bytes)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, newError(\"Error parsing certificate\", err)\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tsignKey, err = x509.ParseECPrivateKey(ca_bytes)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, newError(\"Error parsing certificate\", err)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// We need the public certificate of the CA as well\n\t\t\tblock, _ := pem.Decode(sign_cert.PEM)\n\t\t\tif block == nil {\n\t\t\t\treturn nil, newError(\"Unable to decode CA cert\", nil)\n\t\t\t}\n\t\t\tparent, err = x509.ParseCertificate(block.Bytes)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, newError(\"Error parsing certificate\", err)\n\t\t\t}\n\n\t\t}\n\n\t\t// All the parts to make a certificate are available\n\t\t// Create an x509 certificate\n\t\tderBytes, err := x509.CreateCertificate(rand.Reader, &template, parent, &pub, signKey)\n\t\tif err != nil {\n\t\t\treturn nil, newError(\"Failed to create certificate\", err)\n\t\t}\n\n\t\t// Convert certificate to PEM to be stored in DB\n\t\tpubCert = pem.EncodeToMemory(&pem.Block{Type: \"CERTIFICATE\", Bytes: derBytes})\n\n\t\t//marshalledKey, err := MarshalECPrivateKey(priv)\n\t\tmarshalledKey, err := x509.MarshalECPrivateKey(priv) // To be used for go 1.2 (added to default x509 lib)\n\t\tif err != nil {\n\t\t\treturn nil, newError(\"Failed Marshal EC Private Key\", err)\n\t\t}\n\n\t\tpemKeyBlock := &pem.Block{Type: \"EC PRIVATE KEY\", Bytes: marshalledKey}\n\t\tif len(certificate.EncryptionKey) > 0 {\n\t\t\tpemKeyBlock, err = x509.EncryptPEMBlock(rand.Reader, pemKeyBlock.Type, pemKeyBlock.Bytes, []byte(certificate.EncryptionKey), x509.PEMCipherAES256)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, newError(\"Failed to encrypt key\", err)\n\t\t\t}\n\t\t\tencrypted = true\n\t\t}\n\t\tprivCert = pem.EncodeToMemory(pemKeyBlock)\n\t}\n\n\t// Create Certificate model for certificate table\n\tcert := models.Certificate{PEM: pubCert, PrivateKey: privCert, CommonName: certificate.CommonName, CA: certificate.IsCA, Project: project, KeyType: keyType, Encrypted: encrypted, SerialNumber: serialNumber}\n\n\t// Save the certificate in the database\n\terr := c.Txn.Insert(&cert)\n\tif err != nil {\n\t\treturn nil, newError(\"Error saving certificate\", err)\n\t}\n\n\tif sign_cert == nil {\n\t\t// Cert is self signed\n\t\tcaCount.SerialNumber = serialNumber\n\t\tcaCount.Certificate = &cert\n\n\t\terr := c.Txn.Insert(caCount)\n\t\tif err != nil {\n\t\t\treturn nil, newError(\"Error saving ca count\", err)\n\t\t}\n\t}\n\n\treturn &cert, nil\n}", "title": "" }, { "docid": "ce54c7d561dd2fcba3c4d11faf9a643e", "score": "0.5209621", "text": "func (c *Certificate) GetCertificate() *x509.Certificate {\n\tcert := new(x509.Certificate)\n\t// Unparsed data\n\tcert.PublicKey = c.PublicKey\n\tcert.PublicKeyAlgorithm = c.PublicKeyAlgorithm\n\n\t// SANs are directly converted.\n\tcert.DNSNames = c.DNSNames\n\tcert.EmailAddresses = c.EmailAddresses\n\tcert.IPAddresses = c.IPAddresses\n\tcert.URIs = c.URIs\n\n\t// SANs slice.\n\tfor _, san := range c.SANs {\n\t\tsan.Set(cert)\n\t}\n\n\t// Subject.\n\tc.Subject.Set(cert)\n\n\t// Defined extensions.\n\tc.KeyUsage.Set(cert)\n\tc.ExtKeyUsage.Set(cert)\n\tc.UnknownExtKeyUsage.Set(cert)\n\tc.SubjectKeyID.Set(cert)\n\tc.AuthorityKeyID.Set(cert)\n\tc.OCSPServer.Set(cert)\n\tc.IssuingCertificateURL.Set(cert)\n\tc.CRLDistributionPoints.Set(cert)\n\tc.PolicyIdentifiers.Set(cert)\n\tif c.BasicConstraints != nil {\n\t\tc.BasicConstraints.Set(cert)\n\t}\n\tif c.NameConstraints != nil {\n\t\tc.NameConstraints.Set(cert)\n\t}\n\n\t// Custom Extensions.\n\tfor _, e := range c.Extensions {\n\t\te.Set(cert)\n\t}\n\n\t// Others.\n\tc.SerialNumber.Set(cert)\n\tc.SignatureAlgorithm.Set(cert)\n\n\treturn cert\n}", "title": "" }, { "docid": "9a6e34244a7b1feed68b46cd63c03565", "score": "0.51591015", "text": "func (mem *InMemoryKP) ImportCertificate(derBytes []byte) error {\n\tcert, err := x509.ParseCertificate(derBytes)\n\tif err != nil {\n\t\tlog.Println(\"Error parsing imported certificate: \", err.Error())\n\t\treturn err\n\t}\n\n\tmem.Certificate = cert\n\treturn nil\n}", "title": "" }, { "docid": "5ce031f438b1fc6bfe39256fc60a2cff", "score": "0.5143406", "text": "func genCertificate(mgr manager.Manager, certDir string) error {\n\t// client-go client for generating certificate\n\tclientSet, err := kubernetes.NewForConfig(mgr.GetConfig())\n\tif err != nil {\n\t\treturn fmt.Errorf(\"fail to generate the clientset: %s\", err)\n\t}\n\tcsrClient := clientSet.CertificatesV1beta1().CertificateSigningRequests()\n\n\t// 1. delete the VC CSR if exist\n\tif err := delVCWebhookCSRIfExist(csrClient); err != nil {\n\t\treturn fmt.Errorf(\"fail to delete existing webhook: %s\", err)\n\t}\n\t// 2. generate csr\n\tcsrPEM, keyPEM, privateKey, err := generateCSR(clientSet)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"fail to geneate csr: %s\", err)\n\t}\n\n\t// 3. approve the csr\n\tgo approveVCWebhookCSR(csrClient)\n\n\t// 4. submit csr and wait for it to be signed\n\t// NOTE this step will block until the CSR is issued\n\tcsrPEM, err = submitCSRAndWait(csrClient, csrPEM, privateKey)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"fail to submit CSR: %s\", err)\n\t}\n\n\t// 5. generate certificate files (i.e., tls.crt and tls.key)\n\tif err := genCertAndKeyFile(csrPEM, keyPEM, certDir); err != nil {\n\t\treturn fmt.Errorf(\"fail to generate certificate and key: %s\", err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "0826b600730fbdbd8f9da80155efb5fe", "score": "0.5136584", "text": "func (s *StakeAddress) DeregistrationCertificate() {}", "title": "" }, { "docid": "8bb330f303a2fec983c42cfb6daad9c5", "score": "0.5124031", "text": "func GenerateCertificate(rand io.Reader) (*Certificate, error) {\n\th, err := ecdsa.GenerateKey(StandardCurve, rand)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error generating encryption ECDSA key: %s\", err)\n\t}\n\te, err := ecdsa.GenerateKey(StandardCurve, rand)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error generating encryption ECDSA key: %s\", err)\n\t}\n\n\treturn &Certificate{\n\t\tHandshakePublicKey: &h.PublicKey,\n\t\tEncryptionPublicKey: &e.PublicKey,\n\t\tHandshakePrivateKey: h,\n\t\tEncryptionPrivateKey: e,\n\t}, nil\n}", "title": "" }, { "docid": "4211c24f02f1c2643eeff2433ecfdfce", "score": "0.5111572", "text": "func (_RegistryExtended *RegistryExtendedCallerSession) GetCertificate(_id *big.Int) (struct {\n\tIssuer common.Address\n\tTopic *big.Int\n\tValidityCall []byte\n\tData []byte\n}, error) {\n\treturn _RegistryExtended.Contract.GetCertificate(&_RegistryExtended.CallOpts, _id)\n}", "title": "" }, { "docid": "2a212e7d1fe26bfa9c873a2ffb03b1af", "score": "0.51110554", "text": "func GenerateCertificate(privateKeyBuilder PrivateKeyBuilder, hosts []string, validFrom time.Time, validFor time.Duration, isCA bool) ([]byte, []byte, error) {\n\tprivateKey, err := privateKeyBuilder.Build()\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"unable to build private key: %w\", err)\n\t}\n\n\tnotBefore := validFrom\n\tnotAfter := validFrom.Add(validFor)\n\n\tserialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)\n\n\tserialNumber, err := rand.Int(rand.Reader, serialNumberLimit)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"failed to generate serial number: %v\", err)\n\t}\n\n\ttemplate := x509.Certificate{\n\t\tSerialNumber: serialNumber,\n\t\tSubject: pkix.Name{\n\t\t\tOrganization: []string{\"Acme Co\"},\n\t\t},\n\t\tNotBefore: notBefore,\n\t\tNotAfter: notAfter,\n\n\t\tKeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,\n\t\tExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth, x509.ExtKeyUsageClientAuth},\n\t\tBasicConstraintsValid: true,\n\t}\n\n\tfor _, h := range hosts {\n\t\tif ip := net.ParseIP(h); ip != nil {\n\t\t\ttemplate.IPAddresses = append(template.IPAddresses, ip)\n\t\t} else {\n\t\t\ttemplate.DNSNames = append(template.DNSNames, h)\n\t\t}\n\t}\n\n\tif isCA {\n\t\ttemplate.IsCA = true\n\t\ttemplate.KeyUsage |= x509.KeyUsageCertSign\n\t}\n\n\tcertDERBytes, err := x509.CreateCertificate(rand.Reader, &template, &template, publicKey(privateKey), privateKey)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"failed to create certificate: %v\", err)\n\t}\n\n\tcertPEMBytes, err := ConvertDERToPEM(certDERBytes, Certificate)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"failed to convert certificate in DER format into PEM: %v\", err)\n\t}\n\n\tkeyDERBytes, err := x509.MarshalPKCS8PrivateKey(privateKey)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"failed to marshal private key: %v\", err)\n\t}\n\n\tkeyPEMBytes, err := ConvertDERToPEM(keyDERBytes, PrivateKey)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"faile to convert certificate in DER format into PEM: %v\", err)\n\t}\n\n\treturn certPEMBytes, keyPEMBytes, nil\n}", "title": "" }, { "docid": "3f636d312191357bfa39ec5f460fadac", "score": "0.5095843", "text": "func (c *CertGenConfig) PopulateFrom(vp *viper.Viper) {\n\tc.Debug = vp.GetBool(Debug)\n\tc.K8sKubeConfigPath = vp.GetString(K8sKubeConfigPath)\n\tc.K8sRequestTimeout = vp.GetDuration(K8sRequestTimeout)\n\n\tc.HubbleCACertFile = vp.GetString(HubbleCACertFile)\n\tc.HubbleCAKeyFile = vp.GetString(HubbleCAKeyFile)\n\n\tc.HubbleCAGenerate = vp.GetBool(HubbleCAGenerate)\n\tc.HubbleCAReuseSecret = vp.GetBool(HubbleCAReuseSecret)\n\tc.HubbleCACommonName = vp.GetString(HubbleCACommonName)\n\tc.HubbleCAValidityDuration = vp.GetDuration(HubbleCAValidityDuration)\n\tc.HubbleCASecretName = vp.GetString(HubbleCASecretName)\n\tc.HubbleCASecretNamespace = getStringWithFallback(vp, HubbleCASecretNamespace, CiliumNamespace)\n\n\tc.HubbleCAConfigMapCreate = vp.GetBool(HubbleCAConfigMapCreate)\n\tc.HubbleCAConfigMapName = vp.GetString(HubbleCAConfigMapName)\n\tc.HubbleCAConfigMapNamespace = getStringWithFallback(vp, HubbleCAConfigMapNamespace, CiliumNamespace)\n\n\tc.HubbleRelayClientCertGenerate = vp.GetBool(HubbleRelayClientCertGenerate)\n\tc.HubbleRelayClientCertCommonName = vp.GetString(HubbleRelayClientCertCommonName)\n\tc.HubbleRelayClientCertValidityDuration = vp.GetDuration(HubbleRelayClientCertValidityDuration)\n\tc.HubbleRelayClientCertSecretName = vp.GetString(HubbleRelayClientCertSecretName)\n\tc.HubbleRelayClientCertSecretNamespace = getStringWithFallback(vp, HubbleRelayClientCertSecretNamespace, CiliumNamespace)\n\n\tc.HubbleRelayServerCertGenerate = vp.GetBool(HubbleRelayServerCertGenerate)\n\tc.HubbleRelayServerCertCommonName = vp.GetString(HubbleRelayServerCertCommonName)\n\tc.HubbleRelayServerCertValidityDuration = vp.GetDuration(HubbleRelayServerCertValidityDuration)\n\tc.HubbleRelayServerCertSecretName = vp.GetString(HubbleRelayServerCertSecretName)\n\tc.HubbleRelayServerCertSecretNamespace = getStringWithFallback(vp, HubbleRelayServerCertSecretNamespace, CiliumNamespace)\n\n\tc.HubbleServerCertGenerate = vp.GetBool(HubbleServerCertGenerate)\n\tc.HubbleServerCertCommonName = vp.GetString(HubbleServerCertCommonName)\n\tc.HubbleServerCertValidityDuration = vp.GetDuration(HubbleServerCertValidityDuration)\n\tc.HubbleServerCertSecretName = vp.GetString(HubbleServerCertSecretName)\n\tc.HubbleServerCertSecretNamespace = getStringWithFallback(vp, HubbleServerCertSecretNamespace, CiliumNamespace)\n\n\tc.CiliumNamespace = vp.GetString(CiliumNamespace)\n\n\tc.ClustermeshApiserverCACertFile = vp.GetString(ClustermeshApiserverCACertFile)\n\tc.ClustermeshApiserverCAKeyFile = vp.GetString(ClustermeshApiserverCAKeyFile)\n\n\tc.ClustermeshApiserverCACertGenerate = vp.GetBool(ClustermeshApiserverCACertGenerate)\n\tc.ClustermeshApiserverCAReuseSecret = vp.GetBool(ClustermeshApiserverCACertReuseSecret)\n\tc.ClustermeshApiserverCACertCommonName = vp.GetString(ClustermeshApiserverCACertCommonName)\n\tc.ClustermeshApiserverCACertValidityDuration = vp.GetDuration(ClustermeshApiserverCACertValidityDuration)\n\tc.ClustermeshApiserverCACertSecretName = vp.GetString(ClustermeshApiserverCACertSecretName)\n\n\tc.ClustermeshApiserverServerCertGenerate = vp.GetBool(ClustermeshApiserverServerCertGenerate)\n\tc.ClustermeshApiserverServerCertCommonName = vp.GetString(ClustermeshApiserverServerCertCommonName)\n\tc.ClustermeshApiserverServerCertValidityDuration = vp.GetDuration(ClustermeshApiserverServerCertValidityDuration)\n\tc.ClustermeshApiserverServerCertSecretName = vp.GetString(ClustermeshApiserverServerCertSecretName)\n\n\tc.ClustermeshApiserverAdminCertGenerate = vp.GetBool(ClustermeshApiserverAdminCertGenerate)\n\tc.ClustermeshApiserverAdminCertCommonName = vp.GetString(ClustermeshApiserverAdminCertCommonName)\n\tc.ClustermeshApiserverAdminCertValidityDuration = vp.GetDuration(ClustermeshApiserverAdminCertValidityDuration)\n\tc.ClustermeshApiserverAdminCertSecretName = vp.GetString(ClustermeshApiserverAdminCertSecretName)\n\n\tc.ClustermeshApiserverClientCertGenerate = vp.GetBool(ClustermeshApiserverClientCertGenerate)\n\tc.ClustermeshApiserverClientCertCommonName = vp.GetString(ClustermeshApiserverClientCertCommonName)\n\tc.ClustermeshApiserverClientCertValidityDuration = vp.GetDuration(ClustermeshApiserverClientCertValidityDuration)\n\tc.ClustermeshApiserverClientCertSecretName = vp.GetString(ClustermeshApiserverClientCertSecretName)\n\n\tc.ClustermeshApiserverRemoteCertGenerate = vp.GetBool(ClustermeshApiserverRemoteCertGenerate)\n\tc.ClustermeshApiserverRemoteCertCommonName = vp.GetString(ClustermeshApiserverRemoteCertCommonName)\n\tc.ClustermeshApiserverRemoteCertValidityDuration = vp.GetDuration(ClustermeshApiserverRemoteCertValidityDuration)\n\tc.ClustermeshApiserverRemoteCertSecretName = vp.GetString(ClustermeshApiserverRemoteCertSecretName)\n}", "title": "" }, { "docid": "391fd47ee8b091090af6ee5bc4558f65", "score": "0.5094119", "text": "func generateCertificate(forwarderName string) error {\n\t// Generating a private key to sign the certificate\n\tprivateKey, _ := rsa.GenerateKey(rand.Reader, 2048)\n\tpublicKey := &privateKey.PublicKey\n\n\t// Use the private key to generate a Certificate Signing Request (CSR), and then sign it with the private key\n\tcertificateTemplate := &x509.Certificate{\n\t\tSerialNumber: big.NewInt(1),\n\t\tSubject: pkix.Name{\n\t\t\tCommonName: forwarderName,\n\t\t\tCountry: []string{\"US\"},\n\t\t\tProvince: []string{\"CA\"},\n\t\t\tOrganization: []string{\"Splunk\"},\n\t\t},\n\t\tNotAfter: time.Now().AddDate(5, 0, 0),\n\t}\n\tcertificate, err := x509.CreateCertificate(rand.Reader, certificateTemplate, certificateTemplate, publicKey, privateKey)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Create the .pem certificate file and output the certificate created into .pem file\n\tpemFileName := fmt.Sprintf(\"%v.pem\", forwarderName)\n\tpemFile, err := os.Create(pemFileName)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpem.Encode(pemFile, &pem.Block{Type: \"CERTIFICATE\", Bytes: certificate})\n\tpemFile.Close()\n\n\treturn nil\n}", "title": "" }, { "docid": "fd982e918c8d25f66d2e0e6b50d45c3d", "score": "0.5091508", "text": "func UnmarshalCertificate(b []byte) (*Certificate, error) {\n\tm := &marshalCert{}\n\tif err := msgpack.Unmarshal(b, &m); err != nil {\n\t\treturn nil, errors.Wrapf(err, \"error unmarshaling certificate\")\n\t}\n\n\thpkX, hpkY := elliptic.Unmarshal(StandardCurve, m.HandshakePublicKey)\n\tepkX, epkY := elliptic.Unmarshal(StandardCurve, m.EncryptionPublicKey)\n\n\thpk := &ecdsa.PublicKey{\n\t\tCurve: StandardCurve,\n\t\tX: hpkX,\n\t\tY: hpkY,\n\t}\n\tepk := &ecdsa.PublicKey{\n\t\tCurve: StandardCurve,\n\t\tX: epkX,\n\t\tY: epkY,\n\t}\n\n\treturn &Certificate{\n\t\tID: m.ID,\n\t\tHandshakePublicKey: hpk,\n\t\tEncryptionPublicKey: epk,\n\t}, nil\n}", "title": "" }, { "docid": "1832a734a66eb13283fc62cfe6f59531", "score": "0.50860935", "text": "func generateWeakCertificate() (*pemCertificate, error) {\n\tpriv, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tkeyUsage := x509.KeyUsageDigitalSignature\n\tnotBefore := time.Now()\n\tnotAfter := notBefore.Add(time.Hour)\n\tserialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)\n\tserialNumber, err := rand.Int(rand.Reader, serialNumberLimit)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ttemplate := x509.Certificate{\n\t\tSerialNumber: serialNumber,\n\t\tSubject: pkix.Name{\n\t\t\tOrganization: []string{\"otel-go\"},\n\t\t},\n\t\tNotBefore: notBefore,\n\t\tNotAfter: notAfter,\n\t\tKeyUsage: keyUsage,\n\t\tExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},\n\t\tBasicConstraintsValid: true,\n\t\tDNSNames: []string{\"localhost\"},\n\t\tIPAddresses: []net.IP{net.IPv6loopback, net.IPv4(127, 0, 0, 1)},\n\t}\n\tderBytes, err := x509.CreateCertificate(rand.Reader, &template, &template, &priv.PublicKey, priv)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcertificateBuffer := new(bytes.Buffer)\n\tif err := pem.Encode(certificateBuffer, &pem.Block{Type: \"CERTIFICATE\", Bytes: derBytes}); err != nil {\n\t\treturn nil, err\n\t}\n\tprivDERBytes, err := x509.MarshalPKCS8PrivateKey(priv)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tprivBuffer := new(bytes.Buffer)\n\tif err := pem.Encode(privBuffer, &pem.Block{Type: \"PRIVATE KEY\", Bytes: privDERBytes}); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &pemCertificate{\n\t\tCertificate: certificateBuffer.Bytes(),\n\t\tPrivateKey: privBuffer.Bytes(),\n\t}, nil\n}", "title": "" }, { "docid": "fced64326ece2b3f008a8766d38e80f3", "score": "0.5084173", "text": "func (s Store) Update(certificate x509.Certificate) error {\n\treturn s.updateAttribute(\n\t\ts.config.GetCertificateTemplate(),\n\t\t[]*pkcs11.Attribute{pkcs11.NewAttribute(pkcs11.CKA_VALUE, certificate.Raw)},\n\t)\n}", "title": "" }, { "docid": "939832fa45df9d5375c7056cb9aded84", "score": "0.5083701", "text": "func (certGen *TLSCertGen) GenerateCertificate(host string) (certPem []byte, keyPem []byte, err error) {\n\n\tvar priv *rsa.PrivateKey\n\t\n\tif certGen.TurboCertGen {\n\t\tpriv = certGen.SharedRsaKey\n\t} else {\n\t\tpriv, err = rsa.GenerateKey(rand.Reader, 2048)\t\n\t}\n\n\tif err != nil {\n\t\treturn\n\t}\n\n\tnotBefore := time.Now()\n\n\tnotAfter := notBefore.Add(365 * 24 * time.Hour)\n\n\tserialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)\n\tserialNumber, err := rand.Int(rand.Reader, serialNumberLimit)\n\tif err != nil {\n\t\treturn\n\t}\n\n\ttemplate := x509.Certificate{\n\t\tSerialNumber: serialNumber,\n\t\tSubject: pkix.Name{\n\t\t\tOrganization: []string{certGen.OrganizationPrefix + host},\n\t\t},\n\t\tNotBefore: notBefore,\n\t\tNotAfter: notAfter,\n\n\t\tKeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,\n\t\tExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},\n\t\tBasicConstraintsValid: true,\n\t}\n\n\thosts := strings.Split(host, \",\")\n\tfor _, h := range hosts {\n\t\tif ip := net.ParseIP(h); ip != nil {\n\t\t\ttemplate.IPAddresses = append(template.IPAddresses, ip)\n\t\t} else {\n\t\t\ttemplate.DNSNames = append(template.DNSNames, h)\n\t\t}\n\t}\n\n\tvar derBytes []byte\n\n\tif certGen.RootAuthorityCert != nil {\n\t\tderBytes, err = x509.CreateCertificate(rand.Reader, &template, certGen.RootAuthorityCert, &priv.PublicKey, certGen.RootAuthorityPrivateKey)\n\t} else {\n\t\ttemplate.IsCA = true\n\t\ttemplate.KeyUsage |= x509.KeyUsageCertSign\n\t\tderBytes, err = x509.CreateCertificate(rand.Reader, &template, &template, &priv.PublicKey, priv)\n\t}\n\tif err != nil {\n\t\treturn\n\t}\n\n\tvar certOut, keyOut bytes.Buffer\n\n\tpem.Encode(&certOut, &pem.Block{Type: \"CERTIFICATE\", Bytes: derBytes})\n\tpem.Encode(&keyOut, &pem.Block{Type: \"RSA PRIVATE KEY\", Bytes: x509.MarshalPKCS1PrivateKey(priv)})\n\n\tcertPem = certOut.Bytes()\n\tkeyPem = keyOut.Bytes()\n\n\treturn\n}", "title": "" }, { "docid": "406945e97bd7304b6e526199fcf85ecf", "score": "0.50641954", "text": "func TestVerifyCertificate(t *testing.T) {\n\tt.Parallel()\n\n\t// Generate ECDSA key pair.\n\tprivateKey, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tpublicKey := privateKey.Public()\n\n\t// Get the PEM for the public key.\n\tx509EncodedPub, err := x509.MarshalPKIXPublicKey(publicKey)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tpemEncodedPub := pem.EncodeToMemory(&pem.Block{Type: \"PUBLIC KEY\", Bytes: x509EncodedPub})\n\tpemPublicKey := string(pemEncodedPub)\n\n\t// Set up database. Create HealthAuthority + HAKey for the test.\n\ttestDB := coredb.NewTestDatabase(t)\n\tctx := context.Background()\n\thaDB := database.New(testDB)\n\n\thealthAuthority := model.HealthAuthority{\n\t\tIssuer: \"doh.my.gov\",\n\t\tAudience: \"exposure-notifications-server\",\n\t\tName: \"Very Real Health Authority\",\n\t}\n\tif err := haDB.AddHealthAuthority(ctx, &healthAuthority); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\thak := model.HealthAuthorityKey{\n\t\tVersion: \"v1\",\n\t\tFrom: time.Now(),\n\t\tPublicKeyPEM: pemPublicKey,\n\t}\n\tif err := haDB.AddHealthAuthorityKey(ctx, &healthAuthority, &hak); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Build the verification certificate.\n\thmacKeyBytes := make([]byte, 32)\n\tif _, err := rand.Read(hmacKeyBytes); err != nil {\n\t\tt.Fatal(err)\n\t}\n\thmacKeyB64 := base64.StdEncoding.EncodeToString(hmacKeyBytes)\n\n\t// Fake authorized app.\n\tauthApp := aamodel.NewAuthorizedApp()\n\tauthApp.AllowedHealthAuthorityIDs[healthAuthority.ID] = struct{}{}\n\n\t// Build a sample certificate.\n\tpublish := pubmodel.Publish{\n\t\tKeys: []pubmodel.ExposureKey{\n\t\t\t{\n\t\t\t\tKey: \"IRgYIhYiy4WMl9z68bMk6w==\",\n\t\t\t\tIntervalNumber: 2650032,\n\t\t\t\tIntervalCount: 144,\n\t\t\t\tTransmissionRisk: 4,\n\t\t\t},\n\t\t\t{\n\t\t\t\tKey: \"dPCphLzfG4uzXneNimkPRQ====\",\n\t\t\t\tIntervalNumber: 2650032 + 144,\n\t\t\t\tIntervalCount: 144,\n\t\t\t\tTransmissionRisk: 4,\n\t\t\t},\n\t\t\t{\n\t\t\t\tKey: \"5AUyPfJKcg5cr3OgKdR8Sw==\",\n\t\t\t\tIntervalNumber: 2650032 + 144*2,\n\t\t\t\tIntervalCount: 144,\n\t\t\t\tTransmissionRisk: 4,\n\t\t\t},\n\t\t},\n\t}\n\n\t// Calculate the HMAC.\n\thmac, err := utils.CalculateExposureKeyHMAC(publish.Keys, hmacKeyBytes)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tclaims := verifyapi.NewVerificationClaims()\n\tclaims.Audience = \"exposure-notifications-server\"\n\tclaims.Issuer = \"doh.my.gov\"\n\tclaims.IssuedAt = time.Now().UTC().Unix()\n\tclaims.ExpiresAt = time.Now().UTC().Add(5 * time.Minute).Unix()\n\tclaims.SignedMAC = base64.StdEncoding.EncodeToString(hmac) // would be generated on the client and passed through.\n\tclaims.KeyVersion = \"v1\" // matches the key configured above.\n\t// leaves PHAClaims and transmission risk overrides out of it.\n\n\ttoken := jwt.NewWithClaims(jwt.SigningMethodES256, claims)\n\tjwtText, err := token.SignedString(privateKey)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Insert this data into the publish request.\n\tpublish.VerificationPayload = jwtText\n\tpublish.HMACKey = hmacKeyB64\n\n\t// Actually test the verify code.\n\tverifier := New(haDB)\n\toverrides, err := verifier.VerifyDiagnosisCertificate(ctx, authApp, &publish)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif len(overrides) != 0 {\n\t\tt.Errorf(\"wanted no overrides, got %v\", overrides)\n\t}\n}", "title": "" }, { "docid": "afff39d05ac68ccca0b65759df176b48", "score": "0.5045161", "text": "func (certificate *Certificate) CreateCertificate(commonName string, organization []string, extraSANs []string) (string, string, error) {\n\tklog.V(2).Infof(\"creating certificate with common name %q\", commonName)\n\tserialNumber, err := rand.Int(rand.Reader, (&big.Int{}).Exp(big.NewInt(2), big.NewInt(159), nil))\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\tsansHosts := []string{\"localhost\"}\n\tsansIps := []net.IP{net.IPv4(127, 0, 0, 1), net.IPv6loopback}\n\tknownSans := map[string]struct{}{\n\t\t\"localhost\": {},\n\t\t\"127.0.0.1\": {},\n\t\tnet.IPv6loopback.String(): {},\n\t}\n\tfor _, extraSAN := range extraSANs {\n\t\tif _, exists := knownSans[extraSAN]; exists {\n\t\t\tcontinue\n\t\t}\n\t\tif ip := net.ParseIP(extraSAN); ip != nil {\n\t\t\tsansIps = append(sansIps, ip)\n\t\t} else {\n\t\t\tsansHosts = append(sansHosts, extraSAN)\n\t\t}\n\t\tknownSans[extraSAN] = struct{}{}\n\t}\n\tprivateKey, err := rsa.GenerateKey(rand.Reader, constants.DefaultKeyBitSize)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\tnewCertificate := x509.Certificate{\n\t\tSerialNumber: serialNumber,\n\t\tSubject: pkix.Name{\n\t\t\tCommonName: commonName,\n\t\t\tOrganization: organization,\n\t\t\tCountry: []string{\"Some Country\"},\n\t\t\tProvince: []string{\"Some Province\"},\n\t\t\tLocality: []string{\"Some Locality\"},\n\t\t\tStreetAddress: []string{\"Some StreetAddress\"},\n\t\t\tPostalCode: []string{\"Some PostalCode\"},\n\t\t},\n\t\tDNSNames: sansHosts,\n\t\tIPAddresses: sansIps,\n\t\tNotBefore: time.Now(),\n\t\tNotAfter: time.Now().AddDate(1, 0, 0),\n\t\tSubjectKeyId: []byte{1, 2, 3, 4, 6},\n\t\tExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth, x509.ExtKeyUsageServerAuth},\n\t\tKeyUsage: x509.KeyUsageDigitalSignature,\n\t}\n\tcertificateBytes, err := x509.CreateCertificate(rand.Reader, &newCertificate, certificate.certificate, &privateKey.PublicKey, certificate.privateKey)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\tcertificatePEM := new(bytes.Buffer)\n\terr = pem.Encode(certificatePEM, &pem.Block{\n\t\tType: \"CERTIFICATE\",\n\t\tBytes: certificateBytes,\n\t})\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\tcertificatePrivKeyPEM := new(bytes.Buffer)\n\terr = pem.Encode(certificatePrivKeyPEM, &pem.Block{\n\t\tType: \"RSA PRIVATE KEY\",\n\t\tBytes: x509.MarshalPKCS1PrivateKey(privateKey),\n\t})\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\treturn certificatePEM.String(), certificatePrivKeyPEM.String(), nil\n}", "title": "" }, { "docid": "9016d64a7739fe0be1fae6daf391f876", "score": "0.5036463", "text": "func GenerateCertificate(ctx context.Context, cn string, dnsName string) ([]byte, []byte, error) {\n\tvar err error\n\tpemCert := &bytes.Buffer{}\n\n\t// generate private key\n\tpriv, err := ecdsa.GenerateKey(elliptic.P521(), rand.Reader)\n\tif err != nil {\n\t\tlog.AddContext(ctx).Errorf(\"error generating crypt keys: %v\", err)\n\t\treturn nil, nil, err\n\t}\n\n\t// create certificate\n\ttemplate := x509.Certificate{\n\t\tSerialNumber: big.NewInt(1),\n\t\tSubject: pkix.Name{\n\t\t\tCommonName: cn,\n\t\t},\n\t\tNotBefore: time.Now(),\n\t\tNotAfter: time.Now().AddDate(10, 0, 0),\n\t\tKeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign,\n\t\tExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},\n\t\tBasicConstraintsValid: true,\n\t\tIsCA: true,\n\t\tDNSNames: []string{dnsName},\n\t}\n\tderBytes, err := x509.CreateCertificate(rand.Reader, &template, &template, &priv.PublicKey, priv)\n\tif err != nil {\n\t\tlog.AddContext(ctx).Errorf(\"Failed to create x509 certificate: %s\", err)\n\t\treturn nil, nil, err\n\t}\n\n\terr = pem.Encode(pemCert, &pem.Block{Type: \"CERTIFICATE\", Bytes: derBytes})\n\tif err != nil {\n\t\tlog.AddContext(ctx).Errorf(\"Unable to encode x509 certificate to PEM format: %v\", err)\n\t\treturn nil, nil, err\n\t}\n\n\tb, err := x509.MarshalECPrivateKey(priv)\n\tif err != nil {\n\t\tlog.AddContext(ctx).Errorf(\"Unable to marshal ECDSA private key: %v\", err)\n\t\treturn nil, nil, err\n\t}\n\tprivateBlock := pem.Block{\n\t\tType: \"RSA PRIVATE KEY\",\n\t\tHeaders: nil,\n\t\tBytes: b,\n\t}\n\n\treturn pemCert.Bytes(), pem.EncodeToMemory(&privateBlock), nil\n}", "title": "" }, { "docid": "119420f0aed165d62b85d125a3364802", "score": "0.5036341", "text": "func (certificate *VaultCertificate) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {\n\ttypedInput, ok := armInput.(VaultCertificate_ARM)\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected type supplied for PopulateFromARM() function. Expected VaultCertificate_ARM, got %T\", armInput)\n\t}\n\n\t// Set property \"CertificateStore\":\n\tif typedInput.CertificateStore != nil {\n\t\tcertificateStore := *typedInput.CertificateStore\n\t\tcertificate.CertificateStore = &certificateStore\n\t}\n\n\t// Set property \"CertificateUrl\":\n\tif typedInput.CertificateUrl != nil {\n\t\tcertificateUrl := *typedInput.CertificateUrl\n\t\tcertificate.CertificateUrl = &certificateUrl\n\t}\n\n\t// No error\n\treturn nil\n}", "title": "" }, { "docid": "71f0930d0eb9d7b0415503e0bce83d47", "score": "0.5016752", "text": "func (c *Controller) syncCertificate(key string) error {\n\tobj, exists, err := c.cIndexer.GetByKey(key)\n\tif err != nil {\n\t\tglog.Errorf(\"Fetching object with key %s from store failed with %v\", key, err)\n\t\treturn err\n\t}\n\n\tif !exists {\n\t\t// Below we will warm up our cache with a Certificate, so that we will see a delete for one d\n\t\tfmt.Printf(\"Certificate %s does not exist anymore\\n\", key)\n\t} else {\n\t\td := obj.(*api.Certificate)\n\t\tfmt.Printf(\"Sync/Add/Update for Certificate %s\\n\", d.GetName())\n\n\t\terr := c.mountCertificate(d)\n\t\tif err != nil {\n\t\t\tif r, e2 := c.getIngress(); e2 == nil {\n\t\t\t\tc.recorder.Event(\n\t\t\t\t\tr.ObjectReference(),\n\t\t\t\t\tapiv1.EventTypeWarning,\n\t\t\t\t\teventer.EventReasonIngressTLSMountFailed,\n\t\t\t\t\terr.Error(),\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "69b4201f653814c309e5ec177fd680ab", "score": "0.500937", "text": "func reconcileCertificate(ctx context.Context, log logr.Logger, client client.Client, cert *certv1.Certificate, cluster *v1alpha1.NifiCluster) error {\n\tobj := &certv1.Certificate{}\n\tvar err error\n\tif err = client.Get(ctx, types.NamespacedName{Name: cert.Name, Namespace: cert.Namespace}, obj); err != nil {\n\t\tif !apierrors.IsNotFound(err) {\n\t\t\treturn err\n\t\t}\n\t\treturn client.Create(ctx, cert)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3b40671e1a4f4c071a1e0101da6bb466", "score": "0.49988595", "text": "func (t *AgrifoodChaincode) add_cert(stub shim.ChaincodeStubInterface, args []string) ([]byte, error) {\n\t// Can only be called by party\n\tmyLogger.Info(\"Add certificate..\")\n\n\tparty, err := t.getCallerParty(stub)\n\tif err != nil {\n\t\tmsg := \"Failed retrieving party\"\n\t\tmyLogger.Error(msg)\n\t\treturn nil, errors.New(msg)\n\t}\n\n\tmyLogger.Debugf(\"Add cert to: %s\", party.ID)\n\n\t// Check number of arguments\n\tif len(args) != 1 {\n\t\tmsg := \"Incorrect number of arguments. Expecting 1\"\n\t\tmyLogger.Error(msg)\n\t\treturn nil, errors.New(msg)\n\t}\n\n\t// add (encoded) cert to array\n\tparty.Certs = append(party.Certs, args[0])\n\n\t// save updated party\n\terr = t.saveParty(stub, party, false)\n\tif err != nil {\n\t\tmsg := \"Failed saving party\"\n\t\tmyLogger.Error(msg)\n\t\treturn nil, errors.New(msg)\n\t}\n\n\tmyLogger.Info(\"Saved updated party\")\n\n\treturn []byte(\"Successfully saved party\"), nil\n}", "title": "" }, { "docid": "e9c46d269de4c7247366fe2316093bac", "score": "0.49893266", "text": "func execParseCertificate(_ int, p *gop.Context) {\n\targs := p.GetArgs(1)\n\tret, ret1 := x509.ParseCertificate(args[0].([]byte))\n\tp.Ret(1, ret, ret1)\n}", "title": "" }, { "docid": "3fe4052ae8c28d9db2de9affe87668e6", "score": "0.4985965", "text": "func (d *CouchbaseAccessor) InsertCertificate(cr certdb.CertificateRecord) error {\n d.SetBucket(d.config[\"bucket\"], d.config[\"password\"])\n defer d.closeBucket()\n err := d.checkBucket()\n if err != nil {\n return err\n }\n fmt.Printf(\"Inserting certificate into bucket %s\\n\", d.bucketName)\n _, err = d.bucket.Insert(certificateId(cr.Serial, cr.AKI), &CertificateWrapper{Type: certificateType, Record: cr}, 0)\n if err != nil {\n fmt.Printf(\"Failed to insert document into couchbase: %s\\n\", err.Error())\n }\n return err\n}", "title": "" }, { "docid": "203233892a0b3e7ef16d051c8afd76da", "score": "0.4983968", "text": "func sendCertificate(g *Gossiper, rec awot.TrustedKeyRecord) {\n\tmsg := rec.ConstructMessage(g.key, g.Parameters.Identifier)\n\tcommon.Log(KeyExchangeSignString(msg.Owner, msg.Signature), common.LOG_MODE_REACTIVE)\n\n\tnextSeq := g.vectorClock.Get(g.Parameters.Identifier)\n\n\t// create rumor from message\n\trumor := RumorMessage{\n\t\tOrigin: g.Parameters.Identifier,\n\t\tID: nextSeq,\n\t\tText: \"\",\n\t\tKeyExchange: &msg,\n\t}\n\n\t// update status vector\n\tg.vectorClock.Update(g.Parameters.Identifier)\n\n\t// update messages\n\tg.messages.Add(&rumor)\n\n\t// and send the rumor\n\tdestPeer := g.peerSet.RandomPeer()\n\tif destPeer != nil {\n\t\tcommon.Log(KeyExchangeSendString(msg.Owner, destPeer.Address), common.LOG_MODE_FULL)\n\t\tgo g.rumormonger(&rumor, destPeer)\n\t}\n}", "title": "" }, { "docid": "5c18f82c71f65fcdd4b8012bdc6bb22c", "score": "0.49653417", "text": "func createTestCertificate(data *Scanner, uploadDetails *db.TestCertifyUploads) error {\n\n\tdateAdr := func(d strfmt.Date) *strfmt.Date { return &d }\n\tdateTimeAdr := func(dt strfmt.DateTime) *strfmt.DateTime { return &dt }\n\n\tuploadDetails.TotalRecords = uploadDetails.TotalRecords + 1\n\n\t// convert to certificate csv fields\n\tcertifyData := convertToTestCertifyUploadFields(data)\n\n\tvar certifyUploadErrors db.TestCertifyUploadErrors\n\tcertifyUploadErrors.CertifyUploadID = uploadDetails.ID\n\tcertifyUploadErrors.TestCertifyUploadFields = *certifyData\n\tcertifyUploadErrors.Status = db.CERTIFY_UPLOAD_PROCESSING_STATUS\n\tdb.CreateTestCertifyUploadError(&certifyUploadErrors)\n\t// validating data errors\n\tif err := validateBulkTestCertifyCSVRowData(data); err != nil {\n\t\tlog.Info(\"validationErrors : \", err.Error())\n\t\tcertifyUploadErrors.Errors = err.Error()\n\t\tcertifyUploadErrors.Status = db.CERTIFY_UPLOAD_FAILED_STATUS\n\t\treturn db.UpdateTestCertifyUploadError(&certifyUploadErrors)\n\t}\n\n\tcontact := []string{\"tel:\" + certifyData.RecipientMobileNumber}\n\tdob, terr := time.Parse(\"2006-01-02\", certifyData.RecipientDOB)\n\tif terr != nil {\n\t\tdob2, terr := time.Parse(\"02-Jan-2006\", certifyData.RecipientDOB)\n\t\tif terr != nil {\n\t\t\tlog.Info(\"error while parsing DOB \", certifyData.RecipientDOB)\n\t\t} else {\n\t\t\tdob = dob2\n\t\t}\n\t}\n\n\trecipient := &models.TestCertificationRequestRecipient{\n\t\tName: &certifyData.RecipientName,\n\t\tAddress: &models.TestCertificationRequestRecipientAddress{\n\t\t\tAddressLine1: &certifyData.RecipientAddressLine1,\n\t\t\tAddressLine2: certifyData.RecipientAddressLine2,\n\t\t\tDistrict: &certifyData.RecipientDistrict,\n\t\t\tPincode: &certifyData.RecipientPincode,\n\t\t\tState: &certifyData.RecipientState,\n\t\t},\n\t\tContact: contact,\n\t\tDob: dateAdr(strfmt.Date(dob)),\n\t\tGender: &certifyData.RecipientGender,\n\t\tNationality: certifyData.RecipientNationality,\n\t\tIdentity: &certifyData.RecipientIdentity,\n\t}\n\n\tsampleCollectionTimestamp, terr := time.Parse(time.RFC3339, certifyData.SampleCollectionTimestamp)\n\tif terr != nil {\n\t\tlog.Info(\"error while parsing sampleCollectionTimestamp \", certifyData.SampleCollectionTimestamp)\n\t}\n\tresultTimestamp, terr := time.Parse(time.RFC3339, certifyData.ResultTimestamp)\n\tif terr != nil {\n\t\tlog.Info(\"error while parsing resultTimestamp \", certifyData.ResultTimestamp)\n\t}\n\ttestDetails := &models.TestCertificationRequestTestDetails{\n\t\tBatch: certifyData.TestBatch,\n\t\tDisease: &certifyData.Disease,\n\t\tManufacturer: certifyData.Manufacturer,\n\t\tResult: &certifyData.Result,\n\t\tResultTimestamp: dateTimeAdr(strfmt.DateTime(resultTimestamp)),\n\t\tSampleCollectionTimestamp: dateTimeAdr(strfmt.DateTime(sampleCollectionTimestamp)),\n\t\tSampleOrigin: certifyData.SampleOrigin,\n\t\tTestName: certifyData.TestName,\n\t\tTestType: &certifyData.TestType,\n\t}\n\n\tverifier := &models.TestCertificationRequestVerifier{\n\t\tName: &certifyData.Verifier,\n\t}\n\n\tfacility := &models.TestCertificationRequestFacility{\n\t\tName: &certifyData.FacilityName,\n\t\tAddress: &models.TestCertificationRequestFacilityAddress{\n\t\t\tAddressLine1: &certifyData.FacilityAddressLine1,\n\t\t\tAddressLine2: certifyData.FacilityAddressLine2,\n\t\t\tDistrict: &certifyData.FacilityDistrict,\n\t\t\tState: &certifyData.FacilityState,\n\t\t\tPincode: &certifyData.FacilityPincode,\n\t\t},\n\t}\n\n\tcertificate := models.TestCertificationRequest{\n\t\tPreEnrollmentCode: &certifyData.PreEnrollmentCode,\n\t\tFacility: facility,\n\t\tRecipient: recipient,\n\t\tTestDetails: testDetails,\n\t\tVerifier: verifier,\n\t}\n\tif jsonRequestString, err := json.Marshal(certificate); err == nil {\n\t\tlog.Infof(\"Certificate request %+v\", string(jsonRequestString))\n\t\tuploadId, _ := json.Marshal(uploadDetails.ID)\n\t\tjrowId, _ := json.Marshal(certifyUploadErrors.ID)\n\t\tservices.PublishTestCertifyMessage(jsonRequestString, uploadId, jrowId)\n\t} else {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f11ae720b2d71561fd7f17565eebc26e", "score": "0.49580136", "text": "func GenerateCertificate(host, destDir, organization string) error {\n\t//flag.Parse()\n\n\tif len(host) == 0 {\n\t\tlog.Fatalf(\"Missing required host parameter\")\n\t}\n\n\tif len(destDir) == 0 {\n\t\tdestDir = \"./\"\n\t}\n\n\tif len(organization) == 0 {\n\t\torganization = \"ACME Company\"\n\t}\n\n\tvalidFrom := \"\"\n\tvalidFor := 365 * 24 * time.Hour\n\tisCA := false\n\trsaBits := 2048\n\tecdsaCurve := \"\"\n\n\tvar priv interface{}\n\tvar err error\n\tswitch ecdsaCurve {\n\tcase \"\":\n\t\tpriv, err = rsa.GenerateKey(rand.Reader, rsaBits)\n\tcase \"P224\":\n\t\tpriv, err = ecdsa.GenerateKey(elliptic.P224(), rand.Reader)\n\tcase \"P256\":\n\t\tpriv, err = ecdsa.GenerateKey(elliptic.P256(), rand.Reader)\n\tcase \"P384\":\n\t\tpriv, err = ecdsa.GenerateKey(elliptic.P384(), rand.Reader)\n\tcase \"P521\":\n\t\tpriv, err = ecdsa.GenerateKey(elliptic.P521(), rand.Reader)\n\tdefault:\n\t\tfmt.Fprintf(os.Stderr, \"Unrecognized elliptic curve: %q\", ecdsaCurve)\n\t\tos.Exit(1)\n\t}\n\tif err != nil {\n\t\treturn err\n\t\t//log.Fatalf(\"failed to generate private key: %s\", err)\n\t}\n\n\tvar notBefore time.Time\n\tif len(validFrom) == 0 {\n\t\tnotBefore = time.Now()\n\t} else {\n\t\tnotBefore, err = time.Parse(\"Jan 2 15:04:05 2006\", validFrom)\n\t\tif err != nil {\n\t\t\tfmt.Fprintf(os.Stderr, \"Failed to parse creation date: %s\\n\", err)\n\t\t\t//os.Exit(1)\n\t\t\treturn err\n\t\t}\n\t}\n\n\tnotAfter := notBefore.Add(validFor)\n\n\tserialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)\n\tserialNumber, err := rand.Int(rand.Reader, serialNumberLimit)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to generate serial number: %s\", err)\n\t\treturn err\n\t}\n\n\ttemplate := x509.Certificate{\n\t\tSerialNumber: serialNumber,\n\t\tSubject: pkix.Name{\n\t\t\tOrganization: []string{organization},\n\t\t},\n\t\tNotBefore: notBefore,\n\t\tNotAfter: notAfter,\n\n\t\tKeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,\n\t\tExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},\n\t\tBasicConstraintsValid: true,\n\t}\n\n\thosts := strings.Split(host, \",\")\n\tfor _, h := range hosts {\n\t\tif ip := net.ParseIP(h); ip != nil {\n\t\t\ttemplate.IPAddresses = append(template.IPAddresses, ip)\n\t\t} else {\n\t\t\ttemplate.DNSNames = append(template.DNSNames, h)\n\t\t}\n\t}\n\n\tif isCA {\n\t\ttemplate.IsCA = true\n\t\ttemplate.KeyUsage |= x509.KeyUsageCertSign\n\t}\n\n\tderBytes, err := x509.CreateCertificate(rand.Reader, &template, &template, publicKey(priv), priv)\n\tif err != nil {\n\t\tlog.Fatalf(\"Failed to create certificate: %s\", err)\n\t\treturn err\n\t}\n\n\tcertOut, err := os.Create(pgORMcrtFile)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to open %s for writing: %s\", pgORMcrtFile, err)\n\t\treturn err\n\t}\n\n\tif err := pem.Encode(certOut, &pem.Block{Type: \"CERTIFICATE\", Bytes: derBytes}); err != nil {\n\t\tlog.Fatalf(\"failed to write data to %s: %s\", pgORMcrtFile, err)\n\t\treturn err\n\t}\n\n\tif err := certOut.Close(); err != nil {\n\t\tlog.Fatalf(\"error closing %s: %s\", pgORMcrtFile, err)\n\t\treturn err\n\t}\n\tlog.Printf(\"wrote %s\\n\", pgORMcrtFile)\n\n\tkeyOut, err := os.OpenFile(pgORMkeyFile, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600)\n\tif err != nil {\n\t\tlog.Printf(\"failed to open %s for writing: %s\", pgORMkeyFile, err)\n\t\treturn err\n\t}\n\n\tif err := pem.Encode(keyOut, pemBlockForKey(priv)); err != nil {\n\t\tlog.Fatalf(\"failed to write data to %s: %s\", pgORMkeyFile, err)\n\t\treturn err\n\t}\n\n\tif err := keyOut.Close(); err != nil {\n\t\tlog.Fatalf(\"error closing %s: %s\", pgORMkeyFile, err)\n\t\treturn err\n\t}\n\n\tlog.Printf(\"wrote %s\\n\", pgORMkeyFile)\n\treturn nil\n}", "title": "" }, { "docid": "59ba7bc126a30fee0f0bcb8e9bf9b10e", "score": "0.49412113", "text": "func (_RegistryExtended *RegistryExtendedSession) GetCertificate(_id *big.Int) (struct {\n\tIssuer common.Address\n\tTopic *big.Int\n\tValidityCall []byte\n\tData []byte\n}, error) {\n\treturn _RegistryExtended.Contract.GetCertificate(&_RegistryExtended.CallOpts, _id)\n}", "title": "" }, { "docid": "2d96438fbe1f367c5b3be1cf0248dd0e", "score": "0.49408016", "text": "func (client DevicesClient) GenerateCertificate(ctx context.Context, deviceName string, resourceGroupName string) (result GenerateCertResponse, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/DevicesClient.GenerateCertificate\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response.Response != nil {\n\t\t\t\tsc = result.Response.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\treq, err := client.GenerateCertificatePreparer(ctx, deviceName, resourceGroupName)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"databoxedge.DevicesClient\", \"GenerateCertificate\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.GenerateCertificateSender(req)\n\tif err != nil {\n\t\tresult.Response = autorest.Response{Response: resp}\n\t\terr = autorest.NewErrorWithError(err, \"databoxedge.DevicesClient\", \"GenerateCertificate\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.GenerateCertificateResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"databoxedge.DevicesClient\", \"GenerateCertificate\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "f04cbc09760b4ce2b27efa0e37bc5157", "score": "0.492329", "text": "func GenCACert(name pkix.Name, days int) (*Cert, error) {\n\tcert, err := genCert(nil, name, days)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcertree = nil // forces full reload later\n\treturn cert, nil\n}", "title": "" }, { "docid": "3f3d5d077bb65e4ba0edf3170d574706", "score": "0.49179283", "text": "func (srv *Server) LoadCertificate(certFile, keyFile string) (err error) {\n\tcert, err := tls.LoadX509KeyPair(certFile, keyFile)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"smtp: LoadCertificate: \" + err.Error())\n\t}\n\n\tsrv.TLSCert = &cert\n\n\treturn nil\n}", "title": "" }, { "docid": "21fe5fb2157898e184a6c0bce3423972", "score": "0.49118516", "text": "func NewCertificate(typ int, certificate []byte) *CertificateDataElement {\n\tc := &CertificateDataElement{\n\t\tCertificateType: NewNumber(typ, 1),\n\t\tContent: NewBinary(certificate, 2048),\n\t}\n\tc.DataElement = NewDataElementGroup(certificateDEG, 2, c)\n\treturn c\n}", "title": "" }, { "docid": "418cc0233fb302b882003db5a06c4749", "score": "0.4910919", "text": "func certificate() string {\n\treturn `-----BEGIN CERTIFICATE-----\nMIIE6DCCAtACCQCzHO2a8qU6KzANBgkqhkiG9w0BAQsFADA2MRIwEAYDVQQDDAls\nb2NhbGhvc3QxIDAeBgNVBAoMF0NsaWVudCBDZXJ0aWZpY2F0ZSBEZW1vMB4XDTE5\nMTIwNTE3MjY1N1oXDTIwMTIwNDE3MjY1N1owNjESMBAGA1UEAwwJbG9jYWxob3N0\nMSAwHgYDVQQKDBdDbGllbnQgQ2VydGlmaWNhdGUgRGVtbzCCAiIwDQYJKoZIhvcN\nAQEBBQADggIPADCCAgoCggIBAJ3iM9y8yWa9P+MRVj9Jj+rpNGDDrS1z2kl7SgDB\nZisFYCHccvLfnz10OCWkI4fUWeAbsg2QJZ8i1EdFDtWnqhPXyqUsHRZRAI92ujvf\n4g9r7ID0MENfVKOIY7ye3aphHUEW5lAkkJae12QcxyjTbrbfE0kQXpBHYaqFPRZs\nCTXZOOZfSuEVxcrRJMjlt1J8thnGGmaa3yH6o1yt6hQdTp9JNzzeUwWe78PaAms8\nRaLcaDXC7fsgByI8j9coKOluQdinYxkBLAHMpo7x6QuOYA3oguZXAUpMXJMJCQD2\nNd0WL33Dy4XHcPrhw+lfCVW7E1sbWO3Ka1ZVeu0FEF0erOKAmfQk2eoMJzR9qKwm\nkbM2rYq5qrN19a5Rdtxxov4zOuOyvI6b1Uz5PajN1dyXzuKImOXFmiEL7ykC8kxD\nu8HA90pC2VK3V0mx6tsR/H6zMBIg2je51nJ/11VCmIgS5/+jso1h+oUtqHAsWi1/\n5u8lrQzMC3CR3VKLGCWhfF7NpQ82DYLnBh60t/E4mY0WX7GDAY8QTMKd4dnmKU6d\nnKYDzXZR1he1c08+6NX+pdzJxih8Q/EG0PkNNla0MabMDsi7eFMUCjSPOUG99vGW\nPNvMqP/EvCmCW7VKmph4NSNHjwkxTTOQD/ZGX9IpQWZkCxyCIMxAi1hCgu0zKR++\nU+7BAgMBAAEwDQYJKoZIhvcNAQELBQADggIBAC8av9I4ezwlmM7ysaJvC1IfCzNN\nVawIK1U7bfj9Oyjl49Bn/yTwbbiQ8j5VjOza4umIwnYp1HP6/mlBO+ey8WFYPmDM\nJAspk6sYEQW7MrbZ9QOmq24YAkwMzgK1hDASCKq4GJCzGDym3Zx6fvPnMCPdei2c\njgtjzzBmyewE0zcegOHDrFXTaUIfoSbduTbV9zClJ/pJDkTklRX1cYBtIox77gpZ\n1cnIC803gi1rVCHRNdq85ltOTjoF1/wVamLy5c6CYlp5IPyVOm0nqbqra47QIwss\nQSGxn5l52BC1jP1l3eK1mEr64+dbMhqX3ZQwhfuiQ9VmdovNN1NarPWfmQia6Spq\nTfxN+3VhloKFUh+fgwNzWYLKCMnwBuPVhVGcpclvrj50MsyeiT2IfE8pqWw26g6g\n0xu85AbqYKePaZ7wPoDddbwCIGr6BBT87Nsu+AqtnkH3uw34FDDcjWR1CmNuI1mP\nac6d1jdfbkL5ZUJTpTJi0BxWbTGupv8VzufteFRNa7U2h1O6+kyPmEpA3heEZcEO\nHq5zIfW6QTUmBXDfMFzQ9h0764oBVwm29bjZ59bU3RhcAZtL8fi5BapNtoKAy55d\nP/0WahbwNjP68QYVLBeK9Sfo0XxLU0hJP4RJUZSXy9kUuZ8xhAM/6PdE04cDq71v\nZfq6/HA3phy85qyj\n-----END CERTIFICATE-----\n`\n}", "title": "" }, { "docid": "f006d276b0ce88669a5ba812593358fa", "score": "0.4906716", "text": "func upgradeCACertificate(cert *x509.Certificate, caUpgradeCN string) {\n\tif caUpgradeCN != \"\" && caUpgradeCN == cert.Issuer.CommonName {\n\t\tcert.BasicConstraintsValid = true\n\t\tcert.IsCA = true\n\t\tcert.KeyUsage = x509.KeyUsageCertSign\n\t\tlog.Printf(\"[INFO] cert: Upgrading cert %s to CA cert\", cert.Issuer.CommonName)\n\t}\n}", "title": "" }, { "docid": "9d393f269b076558d31f00ee7498b162", "score": "0.4902364", "text": "func GenCert(parent *Cert, certname string, days int) (*Cert, error) {\n\tname := copyName(parent.Crt.Subject)\n\tname.CommonName = certname\n\tcert, err := genCert(parent, name, days)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcertree = nil // forces full reload later\n\treturn cert, nil\n}", "title": "" }, { "docid": "480023e3755cb67c443fded2fac164c1", "score": "0.4882787", "text": "func SyncCert(ns, name, domain, certDir string) error {\n\tsecretName := fmt.Sprintf(\"%s-webhook-cert\", name)\n\tcs := utils.K8sClient\n\t// check secret\n\tvar serverCertBytes, serverKeyBytes, caCertBytes []byte\n\n\t// get cert from secret or generate it\n\texistSecret, err := cs.CoreV1().Secrets(ns).Get(context.Background(), secretName, metav1.GetOptions{})\n\tif err != nil {\n\t\tif !errors.IsNotFound(err) {\n\t\t\treturn fmt.Errorf(\"error get cert from secret, %w\", err)\n\t\t}\n\t\t// create certs\n\t\ts, err := GenerateCerts(ns, name, domain)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error generate cert, %w\", err)\n\t\t}\n\n\t\tserverCertBytes = s.Data[serverCertKey]\n\t\tserverKeyBytes = s.Data[serverKeyKey]\n\t\tcaCertBytes = s.Data[caCertKey]\n\t\ts.Name = secretName\n\t\ts.Namespace = ns\n\t\t// create secret this make sure one is the leader\n\t\t_, err = cs.CoreV1().Secrets(ns).Create(context.Background(), s, metav1.CreateOptions{})\n\t\tif err != nil {\n\t\t\tif !errors.IsAlreadyExists(err) {\n\t\t\t\treturn fmt.Errorf(\"error create cert to secret, %w\", err)\n\t\t\t}\n\t\t\tsecret, err := cs.CoreV1().Secrets(ns).Get(context.Background(), secretName, metav1.GetOptions{})\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"error get cert from secret, %w\", err)\n\t\t\t}\n\t\t\tserverCertBytes = secret.Data[serverCertKey]\n\t\t\tserverKeyBytes = secret.Data[serverKeyKey]\n\t\t\tcaCertBytes = secret.Data[caCertKey]\n\t\t}\n\t} else {\n\t\tserverCertBytes = existSecret.Data[serverCertKey]\n\t\tserverKeyBytes = existSecret.Data[serverKeyKey]\n\t\tcaCertBytes = existSecret.Data[caCertKey]\n\t}\n\tif len(serverCertBytes) == 0 || len(serverKeyBytes) == 0 || len(caCertBytes) == 0 {\n\t\treturn fmt.Errorf(\"invalid cert\")\n\t}\n\n\terr = os.MkdirAll(certDir, os.ModeDir)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// write cert to file\n\terr = os.WriteFile(filepath.Join(certDir, serverCertKey), serverCertBytes, os.ModePerm)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error create secret file, %w\", err)\n\t}\n\terr = os.WriteFile(filepath.Join(certDir, serverKeyKey), serverKeyBytes, os.ModePerm)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error create secret file, %w\", err)\n\t}\n\terr = os.WriteFile(filepath.Join(certDir, caCertKey), caCertBytes, os.ModePerm)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error create secret file, %w\", err)\n\t}\n\n\t// update webhook\n\tmutatingWebhook, err := cs.AdmissionregistrationV1().MutatingWebhookConfigurations().Get(context.Background(), name, metav1.GetOptions{})\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(mutatingWebhook.Webhooks) == 0 {\n\t\treturn fmt.Errorf(\"no webhook config found\")\n\t}\n\tmutatingCfg := mutatingWebhook.DeepCopy()\n\tchanged := false\n\tfor i, hook := range mutatingWebhook.Webhooks {\n\t\tif len(hook.ClientConfig.CABundle) != 0 {\n\t\t\tcontinue\n\t\t}\n\t\tchanged = true\n\t\t// patch ca\n\t\tmutatingCfg.Webhooks[i].ClientConfig.CABundle = caCertBytes\n\t}\n\tif changed {\n\t\tmutatPatchBytes, err := json.Marshal(mutatingCfg)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\terr = wait.ExponentialBackoff(utils.DefaultPatchBackoff, func() (bool, error) {\n\t\t\t_, innerErr := cs.AdmissionregistrationV1().MutatingWebhookConfigurations().Patch(context.Background(), mutatingWebhook.Name, types.StrategicMergePatchType, mutatPatchBytes, metav1.PatchOptions{})\n\t\t\tif innerErr != nil {\n\t\t\t\tlog.Error(innerErr)\n\t\t\t\treturn false, nil\n\t\t\t}\n\t\t\treturn true, nil\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tlog.Info(\"update MutatingWebhook ca bundle success\")\n\t}\n\n\tvalidateWebhook, err := cs.AdmissionregistrationV1().ValidatingWebhookConfigurations().Get(context.Background(), name, metav1.GetOptions{})\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(validateWebhook.Webhooks) == 0 {\n\t\treturn fmt.Errorf(\"no webhook config found\")\n\t}\n\tchanged = false\n\tvalidateCfg := validateWebhook.DeepCopy()\n\tfor i, hook := range validateWebhook.Webhooks {\n\t\tif len(hook.ClientConfig.CABundle) != 0 {\n\t\t\tcontinue\n\t\t}\n\t\t// patch ca\n\t\tvalidateCfg.Webhooks[i].ClientConfig.CABundle = caCertBytes\n\t\tchanged = true\n\t}\n\tif changed {\n\t\tvalidatePatchBytes, err := json.Marshal(validateCfg)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\terr = wait.ExponentialBackoff(utils.DefaultPatchBackoff, func() (bool, error) {\n\t\t\t_, innerErr := cs.AdmissionregistrationV1().ValidatingWebhookConfigurations().Patch(context.Background(), validateWebhook.Name, types.StrategicMergePatchType, validatePatchBytes, metav1.PatchOptions{})\n\t\t\tif innerErr != nil {\n\t\t\t\tlog.Error(innerErr)\n\t\t\t\treturn false, nil\n\t\t\t}\n\t\t\treturn true, nil\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tlog.Info(\"update ValidatingWebhook ca bundle success\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "c7f8b2b60213ab1a69529501d17866e8", "score": "0.48682064", "text": "func genCert(p *Cert, name pkix.Name, days int) (*Cert, error) {\n\tt := &Cert{}\n\tkey, err := rsa.GenerateKey(rand.Reader, 1024)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Failed to generate private key: %s\", err)\n\t}\n\tnow := time.Now()\n\tserial, err := rand.Int(rand.Reader, new(big.Int).SetInt64(9223372036854775807))\n\tski := []byte{0, 0, 0, 0}\n\trand.Reader.Read(ski)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Failed to generate random serial number: %s\", err)\n\t}\n\t//log.Println(\"serial:\", serial)\n\t//log.Println(\"ski:\", ski)\n\tt.Crt = &x509.Certificate{\n\t\tSerialNumber: serial,\n\t\tSubject: name,\n\t\tNotBefore: now.Add(-5 * time.Minute).UTC(),\n\t\tNotAfter: now.AddDate(0, 0, days).UTC(), // valid for days\n\n\t\tSubjectKeyId: ski,\n\t\tKeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,\n\t}\n\tt.Key = key\n\tif p == nil {\n\t\tt.Crt.BasicConstraintsValid = true\n\t\tt.Crt.IsCA = true\n\t\tt.Crt.MaxPathLen = 0\n\t\tt.Crt.KeyUsage = t.Crt.KeyUsage | x509.KeyUsageCertSign\n\t\tp = t\n\t\t//log.Println(\"t.Key.PublicKey=\", t.Key.PublicKey)\n\t\t//log.Println(\"p.Key=\", t.Key)\n\t} else {\n\t\tt.Parent = p\n\t}\n\n\tcertname := name.CommonName + CERT_SUFFIX\n\tkeyname := name.CommonName + KEY_SUFFIX\n\n\tderBytes, err := x509.CreateCertificate(rand.Reader, t.Crt, p.Crt, &t.Key.PublicKey, p.Key)\n\t//log.Println(\"Generated:\", tmpl)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Failed to create Certificate: %s\", err)\n\t}\n\n\tcertOut, err := os.Create(certname)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Failed to open \"+certname+\" for writing: %s\", err)\n\t}\n\tpem.Encode(certOut, &pem.Block{Type: \"CERTIFICATE\", Bytes: derBytes})\n\tcertOut.Close()\n\t//log.Print(\"Written \" + certname + \"\\n\")\n\n\tkeyOut, err := os.OpenFile(keyname, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Failed to open \"+keyname+\" for writing: %s\", err)\n\t}\n\tpem.Encode(keyOut, &pem.Block{Type: \"RSA PRIVATE KEY\",\n\t\tBytes: x509.MarshalPKCS1PrivateKey(t.Key)})\n\tkeyOut.Close()\n\t//log.Print(\"Written \" + keyname + \"\\n\")\n\treturn t, nil\n}", "title": "" }, { "docid": "85ab4f2a70f476d1fd90b359bc7fd3f0", "score": "0.4865563", "text": "func (*Config) makeCertificate(certPEMBlock, keyPEMBlock []byte) (Certificate, error) {\n\tvar cert Certificate\n\n\t// Convert to a tls.Certificate\n\ttlsCert, err := tls.X509KeyPair(certPEMBlock, keyPEMBlock)\n\tif err != nil {\n\t\treturn cert, err\n\t}\n\n\t// Extract necessary metadata\n\terr = fillCertFromLeaf(&cert, tlsCert)\n\tif err != nil {\n\t\treturn cert, err\n\t}\n\n\treturn cert, nil\n}", "title": "" }, { "docid": "4ee8254d01966bc767528da45a39b1aa", "score": "0.48619968", "text": "func setRegisterCACertificateInput(cert string, verCert string) *iot.RegisterCACertificateInput {\r\n\r\n\tcertInput := new(iot.RegisterCACertificateInput)\r\n\tcertInput.SetAllowAutoRegistration(true)\r\n\tcertInput.SetCaCertificate(cert)\r\n\tcertInput.SetSetAsActive(true)\r\n\tcertInput.SetVerificationCertificate(verCert)\r\n\r\n\terr := certInput.Validate()\r\n\tif err != nil {\r\n\t\tfmt.Println(\"Error in registering CA cert: \", err)\r\n\t}\r\n\r\n\treturn certInput\r\n}", "title": "" }, { "docid": "196e4a0ee09aca7b3e0ee8aaeec276b2", "score": "0.48351228", "text": "func GenerateCert() (tls.Certificate, error) {\n\tpriv, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)\n\tif err != nil {\n\t\treturn tls.Certificate{}, fmt.Errorf(\"creating private key: %w\", err)\n\t}\n\n\tnotBefore := time.Now()\n\tnotAfter := notBefore.Add(certValidDuration)\n\n\tserialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)\n\tserialNumber, err := rand.Int(rand.Reader, serialNumberLimit)\n\n\tif err != nil {\n\t\treturn tls.Certificate{}, fmt.Errorf(\"generating serial number: %w\", err)\n\t}\n\n\ttemplate := x509.Certificate{\n\t\tSerialNumber: serialNumber,\n\t\tSubject: pkix.Name{\n\t\t\tOrganization: []string{\"OpenSlides\"},\n\t\t},\n\t\tNotBefore: notBefore,\n\t\tNotAfter: notAfter,\n\t\tKeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,\n\t\tExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},\n\t\tBasicConstraintsValid: true,\n\t}\n\n\tcertData, err := x509.CreateCertificate(rand.Reader, &template, &template, &priv.PublicKey, priv)\n\tif err != nil {\n\t\treturn tls.Certificate{}, fmt.Errorf(\"create certificate: %w\", err)\n\t}\n\n\tcert := tls.Certificate{\n\t\tCertificate: [][]byte{certData},\n\t\tPrivateKey: priv,\n\t}\n\n\treturn cert, nil\n}", "title": "" }, { "docid": "d73f16a40dc54ef7c28e2fd4c8cf9c46", "score": "0.48328495", "text": "func (g *GRPCServer) GenerateDatabaseCert(ctx context.Context, req *authpb.DatabaseCertRequest) (*authpb.DatabaseCertResponse, error) {\n\tauth, err := g.authenticate(ctx)\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err)\n\t}\n\tresponse, err := auth.GenerateDatabaseCert(ctx, req)\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err)\n\t}\n\treturn response, nil\n}", "title": "" }, { "docid": "db8e411e3bd500c36b0d3f206063afd2", "score": "0.48222435", "text": "func (s *StakeAddress) DelegationCertificate() {}", "title": "" }, { "docid": "334b8145edb478d6c9ce2e0bf4f17e6e", "score": "0.4810421", "text": "func (f *FortiOS) Deploy(cert *certificate.Certificate) bool {\n\tif ac, err := f.availableCertificates(); err != nil {\n\t\tlog.Fatal(err)\n\t} else {\n\t\tcreatedAt := cert.CreatedAt.Format(\"2006-01-02\")\n\t\tname := createdAt + \"_letsencrypt_\" + f.domains[0]\n\n\t\tif c := ac.Has(name); c == nil {\n\t\t\tlog.Println(name)\n\t\t\tkey, err := getPrivateKey(cert.Pem)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatal(err)\n\t\t\t}\n\n\t\t\tf.insertCertificate(name, cert.Pem, key)\n\t\t} else {\n\t\t\tlog.Println(\"[fortios] Certificate already uptodate.\")\n\t\t}\n\n\t\t// Firmware:\n\t\t// /api/v2/monitor/system/firmware\n\t\tfirmwareVersion, err := f.getFirmwareVersion()\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\t// Admin-Interface:\n\t\t// /api/v2/cmdb/system/global?access_token=\n\t\t// PUT {\"admin-server-cert\": cert_name}\n\t\tif f.conf.FortiosAdminServerCert {\n\t\t\tif serv, err := f.getAdminServerCert(); err != nil {\n\t\t\t\tlog.Println(err)\n\t\t\t\tf.setAdminServerCert(name)\n\t\t\t} else {\n\t\t\t\tif *serv.Results.AdminServerCert.Name != name {\n\t\t\t\t\tf.setAdminServerCert(name)\n\t\t\t\t} else {\n\t\t\t\t\tlog.Println(\"[fortios] Admin Certificate already uptodate.\")\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// deep inspection:\n\t\t// /api/v2/cmdb/firewall/ssl-ssh-profile/<profile-name>?datasource=1\n\t\t// PUT {\"server-cert\": cert_name}\n\t\tfor _, profile := range f.conf.FortiosSslSSHProfiles {\n\t\t\tif firmwareVersion.Result.Current.Major < 7 {\n\t\t\t\tif serv, err := f.getSslSSHProfileServerCertBeforeV7(profile); err != nil {\n\t\t\t\t\tlog.Println(err)\n\t\t\t\t\tf.setSslSSHProfileServerCertBeforeV7(profile, name)\n\t\t\t\t} else {\n\t\t\t\t\tif *serv.Results[0].ServerCert.Name != name {\n\t\t\t\t\t\tf.setSslSSHProfileServerCertBeforeV7(profile, name)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlog.Printf(\"[fortios:%s] SslSSHProfile Certificate already uptodate.\", *profile)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif serv, err := f.getSslSSHProfileServerCert(profile); err != nil {\n\t\t\t\t\tlog.Println(err)\n\t\t\t\t\tf.setSslSSHProfileServerCert(profile, name)\n\t\t\t\t} else {\n\t\t\t\t\tif *serv.Results[0].ServerCert[0].Name != name {\n\t\t\t\t\t\tf.setSslSSHProfileServerCert(profile, name)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlog.Printf(\"[fortios:%s] SslSSHProfile Certificate already uptodate.\", *profile)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "5d8076ba1dd68138f002738dd25c8045", "score": "0.4806889", "text": "func generateCert(priv *rsa.PrivateKey) Cert {\n\n\thost, err := os.Hostname()\n\tif err != nil {\n\t\tlog.Fatalf(\"#ERROR: failed to get HostName: %s\", err)\n\t\tpanic(\"\")\n\t}\n\n\t//Start date\n\t//var notBefore time.Time\n\tnotBefore := time.Now()\n\t//Duration\n\tnotAfter := notBefore.Add(365 * 24 * time.Hour)\n\n\t// end of ASN.1 time\n\tendOfTime := time.Date(2049, 12, 31, 23, 59, 59, 0, time.UTC)\n\tif notAfter.After(endOfTime) {\n\t\tnotAfter = endOfTime\n\t}\n\n\ttemplate := x509.Certificate{\n\t\tSerialNumber: new(big.Int).SetInt64(0),\n\t\tSubject: pkix.Name{\n\t\t\tOrganization: []string{\"SDS 2014 Co\"},\n\t\t},\n\t\tNotBefore: notBefore,\n\t\tNotAfter: notAfter,\n\n\t\tKeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,\n\t\tExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},\n\t\tBasicConstraintsValid: true,\n\t}\n\n\thosts := strings.Split(host, \",\")\n\n\tfor _, h := range hosts {\n\t\tif ip := net.ParseIP(h); ip != nil {\n\t\t\ttemplate.IPAddresses = append(template.IPAddresses, ip)\n\t\t} else {\n\t\t\ttemplate.DNSNames = append(template.DNSNames, h)\n\t\t}\n\t}\n\n\tvar isCA = false\n\n\tif isCA {\n\t\ttemplate.IsCA = true\n\t\ttemplate.KeyUsage |= x509.KeyUsageCertSign\n\t}\n\n\tderBytes, err := x509.CreateCertificate(rand.Reader, &template, &template, &priv.PublicKey, priv)\n\tif err != nil {\n\t\tlog.Fatalf(\"Failed to create certificate: %s\", err)\n\t\tpanic(\"\")\n\t}\n\n\tcertPem := pem.EncodeToMemory(&pem.Block{Type: \"CERTIFICATE\", Bytes: derBytes})\n\tkeyPem := pem.EncodeToMemory(&pem.Block{Type: \"RSA PRIVATE KEY\", Bytes: x509.MarshalPKCS1PrivateKey(priv)})\n\n\treturn Cert{certPem: certPem, keyPem: keyPem}\n}", "title": "" }, { "docid": "981983d5b739cd9fcb9a6fcdeecd62aa", "score": "0.48025143", "text": "func (o RegionSslCertificateOutput) Certificate() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *RegionSslCertificate) pulumi.StringOutput { return v.Certificate }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "fb3696ab6962a678835ff9abbb6f4527", "score": "0.48006922", "text": "func Certificate() *Command {\n\tcmd := &Command{\n\t\tCommand: &cobra.Command{\n\t\t\tUse: \"certificate\",\n\t\t\tShort: \"Display commands that manage SSL certificates and private keys\",\n\t\t\tLong: `The subcommands of ` + \"`\" + `doctl compute certificate` + \"`\" + ` allow you to store and manage your SSL certificates, private keys, and certificate paths.\n\nOnce a certificate has been stored, it is assigned a unique certificate ID that can be referenced in your doctl and API workflows.`,\n\t\t},\n\t}\n\tcertDetails := `\n\n- The certificate ID\n- The name you gave the certificate\n- A comma-separated list of domain names associated with the certificate\n- The SHA-1 fingerprint of the certificate\n- The certificate's expiration date given in ISO8601 date/time format\n- The certificate's creation date given in ISO8601 date/time format\n- The certificate type (` + \"`\" + `custom` + \"`\" + ` or ` + \"`\" + `lets_encrypt` + \"`\" + `)\n- The certificate state (` + \"`\" + `pending` + \"`\" + `, ` + \"`\" + `verified` + \"`\" + `, or ` + \"`\" + `error` + \"`\" + `)`\n\n\tCmdBuilder(cmd, RunCertificateGet, \"get <id>\", \"Retrieve details about a certificate\", `This command retrieves the following details about a certificate:`+certDetails, Writer,\n\t\taliasOpt(\"g\"), displayerType(&displayers.Certificate{}))\n\tcmdCertificateCreate := CmdBuilder(cmd, RunCertificateCreate, \"create\",\n\t\t\"Create a new certificate\", `This command allows you to create a certificate. There are two supported certificate types: Let's Encrypt certificates, and custom certificates.\n\nLet's Encrypt certificates are free and will be auto-renewed and managed for you by DigitalOcean.\n\nTo create a Let's Encrypt certificate, you'll need to add the domain(s) to your account at cloud.digitalocean.com, or via `+\"`\"+`doctl compute domain create`+\"`\"+`, then provide a certificate name and a comma-separated list of the domain names you'd like to associate with the certificate:\n\n\tdoctl compute certificate create --type lets_encrypt --name mycert --dns-names example.org\n\nTo upload a custom certificate, you'll need to provide a certificate name, the path to the certificate, the path to the private key for the certificate, and the path to the certificate chain, all in PEM format:\n\n\tdoctl compute certificate create --type custom --name mycert --leaf-certificate-path cert.pem --certificate-chain-path fullchain.pem --private-key-path privkey.pem`, Writer, aliasOpt(\"c\"))\n\tAddStringFlag(cmdCertificateCreate, doctl.ArgCertificateName, \"\", \"\",\n\t\t\"Certificate name\", requiredOpt())\n\tAddStringSliceFlag(cmdCertificateCreate, doctl.ArgCertificateDNSNames, \"\",\n\t\t[]string{}, \"Comma-separated list of domains for which the certificate will be issued. The domains must be managed using DigitalOcean's DNS.\")\n\tAddStringFlag(cmdCertificateCreate, doctl.ArgPrivateKeyPath, \"\", \"\",\n\t\t\"The path to a PEM-formatted private-key corresponding to the SSL certificate.\")\n\tAddStringFlag(cmdCertificateCreate, doctl.ArgLeafCertificatePath, \"\", \"\",\n\t\t\"The path to a PEM-formatted public SSL certificate.\")\n\tAddStringFlag(cmdCertificateCreate, doctl.ArgCertificateChainPath, \"\", \"\",\n\t\t\"The path to a full PEM-formatted trust chain between the certificate authority's certificate and your domain's SSL certificate.\")\n\tAddStringFlag(cmdCertificateCreate, doctl.ArgCertificateType, \"\", \"\",\n\t\t\"Certificate type [custom|lets_encrypt]\")\n\n\tCmdBuilder(cmd, RunCertificateList, \"list\", \"Retrieve list of the account's stored certificates\", `This command retrieves a list of all certificates associated with the account. The following details are shown for each certificate:`+certDetails, Writer,\n\t\taliasOpt(\"ls\"), displayerType(&displayers.Certificate{}))\n\n\tcmdCertificateDelete := CmdBuilder(cmd, RunCertificateDelete, \"delete <id>\",\n\t\t\"Delete the specified certificate\", `This command deletes the specified certificate.\n\nUse `+\"`\"+`doctl compute certificate list`+\"`\"+` to see all available certificates associated with your account.`, Writer, aliasOpt(\"d\", \"rm\"))\n\tAddBoolFlag(cmdCertificateDelete, doctl.ArgForce, doctl.ArgShortForce, false,\n\t\t\"Delete the certificate without a confirmation prompt\")\n\n\treturn cmd\n}", "title": "" }, { "docid": "f9eb9dc7d115ccec8d1fc8b081043b90", "score": "0.47886676", "text": "func RegisterCACertificate(rootCert string, veriCert string) {\r\n\t// read the CA certificate\r\n\tcert, err := ioutil.ReadFile(rootCert)\r\n\tif err != nil {\r\n\t\tfmt.Println(\"Failed to read CA file \", err)\r\n\t\treturn\r\n\t}\r\n\r\n\t//read the verification certificate\r\n\tverCert, err := ioutil.ReadFile(veriCert)\r\n\tif err != nil {\r\n\t\tfmt.Println(\"Failed to read verification file \", err)\r\n\t\treturn\r\n\t}\r\n\tresp, err := svc.RegisterCACertificate(setRegisterCACertificateInput(string(cert), string(verCert)))\r\n\r\n\tif err != nil {\r\n\t\tfmt.Printf(\"Failed to register CA cert: %v\\n\\n\", err)\r\n\t\tos.Exit(1)\r\n\t}\r\n\r\n\tfmt.Println(\"Cert ARN: \", *resp.CertificateArn)\r\n\tfmt.Println(\"Cert ID: \", *resp.CertificateId)\r\n}", "title": "" }, { "docid": "5179a6828d52898762bffe0c6827a0c7", "score": "0.47706735", "text": "func NoCertificate(caBundlePath string) (Certificate, error) {\n\tc := trustBundle{\n\t\tcaBundlePath: caBundlePath,\n\t}\n\terr := c.Reload()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &c, nil\n}", "title": "" }, { "docid": "55eaaab96098efb8d724d1abcc6a01a0", "score": "0.47644114", "text": "func (acm SDKClient) InflateCertificate(c *Certificate) error {\n\tresp, err := acm.client.DescribeCertificate(\n\t\t&awsacm.DescribeCertificateInput{\n\t\t\tCertificateArn: aws.String(c.ARN),\n\t\t},\n\t)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tc.Status = aws.StringValue(resp.Certificate.Status)\n\tc.SubjectAlternativeNames = aws.StringValueSlice(resp.Certificate.SubjectAlternativeNames)\n\tc.Type = aws.StringValue(resp.Certificate.Type)\n\n\tfor _, domainValidation := range resp.Certificate.DomainValidationOptions {\n\t\tvalidation := CertificateValidation{\n\t\t\tStatus: aws.StringValue(domainValidation.ValidationStatus),\n\t\t\tDomainName: aws.StringValue(domainValidation.DomainName),\n\t\t}\n\n\t\tif domainValidation.ResourceRecord != nil {\n\t\t\tvalidation.ResourceRecord = CertificateResourceRecord{\n\t\t\t\tType: aws.StringValue(domainValidation.ResourceRecord.Type),\n\t\t\t\tName: aws.StringValue(domainValidation.ResourceRecord.Name),\n\t\t\t\tValue: aws.StringValue(domainValidation.ResourceRecord.Value),\n\t\t\t}\n\t\t}\n\n\t\tc.AddValidation(validation)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "172c9574a59827fc9cc3df88cd081c52", "score": "0.47566807", "text": "func (mmNewUnsignedCertificate *mCertificateManagerMockNewUnsignedCertificate) Set(f func(pKey string, role string, nodeRef string) (c1 mm_insolar.Certificate, err error)) *CertificateManagerMock {\n\tif mmNewUnsignedCertificate.defaultExpectation != nil {\n\t\tmmNewUnsignedCertificate.mock.t.Fatalf(\"Default expectation is already set for the CertificateManager.NewUnsignedCertificate method\")\n\t}\n\n\tif len(mmNewUnsignedCertificate.expectations) > 0 {\n\t\tmmNewUnsignedCertificate.mock.t.Fatalf(\"Some expectations are already set for the CertificateManager.NewUnsignedCertificate method\")\n\t}\n\n\tmmNewUnsignedCertificate.mock.funcNewUnsignedCertificate = f\n\treturn mmNewUnsignedCertificate.mock\n}", "title": "" }, { "docid": "0002e9685235eb97bf9edc8fb3eeee55", "score": "0.47415748", "text": "func SignCertificate(template *x509.Certificate, issuerCert *x509.Certificate, publicKey crypto.PublicKey, signerKey interface{}) ([]byte, *x509.Certificate, error) {\n\tderBytes, err := x509.CreateCertificate(rand.Reader, template, issuerCert, publicKey, signerKey)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"error creating x509 certificate: %s\", err.Error())\n\t}\n\n\tcert, err := x509.ParseCertificate(derBytes)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"error decoding DER certificate bytes: %s\", err.Error())\n\t}\n\n\tpemBytes := bytes.NewBuffer([]byte{})\n\terr = pem.Encode(pemBytes, &pem.Block{Type: \"CERTIFICATE\", Bytes: derBytes})\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"error encoding certificate PEM: %s\", err.Error())\n\t}\n\n\treturn pemBytes.Bytes(), cert, err\n}", "title": "" }, { "docid": "389a3479e43b800a9f467a9d08551797", "score": "0.47402132", "text": "func (acs *ActiveCertService) pullCertificate(addr string) {\n\tvar roots []string\n\tvar requests []*AmassRequest\n\n\t// Check hosts for certificates that contain subdomain names\n\tfor _, port := range acs.Config().Ports {\n\t\tstrPort := strconv.Itoa(port)\n\t\tcfg := tls.Config{InsecureSkipVerify: true}\n\n\t\tconn, err := tls.Dial(\"tcp\", addr+\":\"+strPort, &cfg)\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tcertChain := conn.ConnectionState().PeerCertificates\n\t\tcert := certChain[0]\n\n\t\tvar cn string\n\t\tfor _, name := range cert.Subject.Names {\n\t\t\toid := name.Type\n\t\t\tif len(oid) == 4 && oid[0] == 2 && oid[1] == 5 && oid[2] == 4 {\n\t\t\t\tif oid[3] == 3 {\n\t\t\t\t\tcn = fmt.Sprintf(\"%s\", name.Value)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\troot := removeAsteriskLabel(cn)\n\t\troots = append(roots, root)\n\n\t\tvar subdomains []string\n\t\tfor _, name := range cert.DNSNames {\n\t\t\tsubdomains = append(subdomains, removeAsteriskLabel(name))\n\t\t}\n\t\tsubdomains = NewUniqueElements([]string{}, subdomains...)\n\n\t\tfor _, name := range subdomains {\n\t\t\trequests = append(requests, &AmassRequest{\n\t\t\t\tName: name,\n\t\t\t\tDomain: root,\n\t\t\t\tTag: \"cert\",\n\t\t\t\tSource: \"Active Cert\",\n\t\t\t})\n\t\t}\n\n\t\tfor _, ip := range cert.IPAddresses {\n\t\t\tacs.add(&AmassRequest{Address: ip.String()})\n\t\t}\n\t}\n\t// Add the new root domain names to our Config\n\tacs.Config().Domains = UniqueAppend(acs.Config().Domains, roots...)\n\t// Send all the new requests out\n\tfor _, req := range requests {\n\t\tacs.SendOut(req)\n\t}\n}", "title": "" }, { "docid": "f145aea909abb25ea1eb15cb74a33e01", "score": "0.47358787", "text": "func genCertPair(certFile, keyFile string) error {\n\tlog.Infof(\"Generating TLS certificates...\")\n\n\torg := \"dcrdex autogenerated cert\"\n\tvalidUntil := time.Now().Add(10 * 365 * 24 * time.Hour)\n\tcert, key, err := certgen.NewTLSCertPair(elliptic.P521(), org,\n\t\tvalidUntil, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Write cert and key files.\n\tif err = ioutil.WriteFile(certFile, cert, 0644); err != nil {\n\t\treturn err\n\t}\n\tif err = ioutil.WriteFile(keyFile, key, 0600); err != nil {\n\t\tos.Remove(certFile)\n\t\treturn err\n\t}\n\n\tlog.Infof(\"Done generating TLS certificates\")\n\treturn nil\n}", "title": "" }, { "docid": "82bfafef3c8d20f0b4cf22950f6e9ba5", "score": "0.47307408", "text": "func (c *Client) RequestCertificate(ctx context.Context, url string) (*Certificate, error) {\n\treq, err := http.NewRequest(http.MethodGet, url, nil)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"error initializing certificate request\")\n\t}\n\treq.Header.Set(\"Accept\", derFormat)\n\treq = req.WithContext(ctx)\n\n\tres, err := c.hc.Do(req)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"error requesting certificate\")\n\t}\n\tdefer res.Body.Close()\n\n\tif res.StatusCode != http.StatusOK {\n\t\treturn nil, reportProblem(res.Body, \"error requesting certificate\")\n\t}\n\n\tb, err := ioutil.ReadAll(res.Body)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"error reading certificate DER data\")\n\t}\n\n\tvar certs []*x509.Certificate\n\tif res.Header.Get(\"Content-Type\") == pemFormat {\n\t\tct, err := decodePEMCertificates(b)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"error parsing certificate PEM data\")\n\t\t}\n\t\tcerts = ct\n\t} else {\n\t\tct, err := x509.ParseCertificates(b)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"error parsing certificate DER data\")\n\t\t}\n\t\tcerts = ct\n\t}\n\n\treturn &Certificate{\n\t\tCertificate: certs[0],\n\t\tChain: certs[1:],\n\t}, nil\n}", "title": "" }, { "docid": "21eda71c8ebe8bc57b20600d65326727", "score": "0.47305375", "text": "func GenerateTestCertificate(serial int64, teamID, teamName, commonName string, expiry time.Time) (*x509.Certificate, *rsa.PrivateKey, error) {\n\tCAtemplate := &x509.Certificate{\n\t\tIsCA: true,\n\t\tBasicConstraintsValid: true,\n\t\tSubjectKeyId: []byte{1, 2, 3},\n\t\tSerialNumber: big.NewInt(1234),\n\t\tSubject: pkix.Name{\n\t\t\tCountry: []string{\"US\"},\n\t\t\tOrganization: []string{\"Pear Worldwide Developer Relations\"},\n\t\t\tCommonName: \"Pear Worldwide Developer Relations CA\",\n\t\t},\n\t\tNotBefore: time.Now(),\n\t\tNotAfter: time.Now().AddDate(1, 0, 0),\n\t\t// see http://golang.org/pkg/crypto/x509/#KeyUsage\n\t\tExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth, x509.ExtKeyUsageServerAuth},\n\t\tKeyUsage: x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign,\n\t}\n\n\tCAprivatekey, err := rsa.GenerateKey(rand.Reader, 2048)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\t// Self-signed certificate, parent is the template\n\tCAcertData, err := x509.CreateCertificate(rand.Reader, CAtemplate, CAtemplate, &CAprivatekey.PublicKey, CAprivatekey)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tCAcert, err := x509.ParseCertificate(CAcertData)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\ttemplate := &x509.Certificate{\n\t\tIsCA: true,\n\t\tBasicConstraintsValid: true,\n\t\tSerialNumber: big.NewInt(serial),\n\t\tSubject: pkix.Name{\n\t\t\tCountry: []string{\"US\"},\n\t\t\tOrganization: []string{teamName},\n\t\t\tOrganizationalUnit: []string{teamID},\n\t\t\tCommonName: commonName,\n\t\t},\n\t\tNotBefore: time.Now(),\n\t\tNotAfter: expiry,\n\t\t// see http://golang.org/pkg/crypto/x509/#KeyUsage\n\t\tKeyUsage: x509.KeyUsageDigitalSignature,\n\t}\n\n\tprivatekey, err := rsa.GenerateKey(rand.Reader, 2048)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tcertData, err := x509.CreateCertificate(rand.Reader, template, CAcert, &privatekey.PublicKey, CAprivatekey)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tcert, err := x509.ParseCertificate(certData)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treturn cert, privatekey, nil\n}", "title": "" }, { "docid": "c07225821ae816318dad2b0d82bc7295", "score": "0.47286308", "text": "func prepareCertification(t *testing.T) (string, error) {\n\ttmpDir := t.TempDir()\n\tcmd := exec.Command(\n\t\t\"go\",\n\t\t\"run\",\n\t\tfilepath.FromSlash(filepath.Join(runtime.GOROOT(), \"/src/crypto/tls/generate_cert.go\")),\n\t\t\"-host\",\n\t\t\"127.0.0.1\",\n\t\t\"-duration\",\n\t\t\"720h0m0s\", // 30*24*time.Hour\n\t)\n\tcmd.Dir = tmpDir\n\terr := cmd.Run()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tos.Rename(filepath.Join(tmpDir, \"cert.pem\"), filepath.Join(tmpDir, \"client.crt\"))\n\tos.Rename(filepath.Join(tmpDir, \"key.pem\"), filepath.Join(tmpDir, \"client.key\"))\n\n\tcmd2 := exec.Command(\n\t\t\"go\",\n\t\t\"run\",\n\t\tfilepath.FromSlash(filepath.Join(runtime.GOROOT(), \"/src/crypto/tls/generate_cert.go\")),\n\t\t\"-host\",\n\t\t\"127.0.0.1\",\n\t\t\"-duration\",\n\t\t\"720h0m0s\", // 30*24*time.Hour\n\t)\n\tcmd2.Dir = tmpDir\n\terr = cmd2.Run()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn tmpDir, nil\n}", "title": "" }, { "docid": "185e09b39a0535379f5d9ce51dedc374", "score": "0.47284353", "text": "func (o *CertificateCredentialsAllOf) SetCertificate(v string) {\n\to.Certificate = &v\n}", "title": "" }, { "docid": "7095fb82a589b69fa36c95d59f5102f3", "score": "0.47283873", "text": "func GenerateCert(certFile, keyFile, host, organization string, rsaBits int,\n\tisCA bool, validFrom time.Time, validFor time.Duration) error {\n\tpriv, err := rsa.GenerateKey(rand.Reader, rsaBits)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to generate private key: %v\", err)\n\t}\n\n\tnotBefore := validFrom\n\tnotAfter := notBefore.Add(validFor)\n\n\t// end of ASN.1 time\n\tendOfTime := time.Date(2049, 12, 31, 23, 59, 59, 0, time.UTC)\n\tif notAfter.After(endOfTime) {\n\t\tnotAfter = endOfTime\n\t}\n\n\ttemplate := x509.Certificate{\n\t\tSerialNumber: new(big.Int).SetInt64(0),\n\t\tSubject: pkix.Name{\n\t\t\tOrganization: []string{organization},\n\t\t},\n\t\tNotBefore: notBefore,\n\t\tNotAfter: notAfter,\n\n\t\tKeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,\n\t\tExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},\n\n\t\tBasicConstraintsValid: true,\n\t}\n\n\thosts := strings.Split(host, \",\")\n\tfor _, h := range hosts {\n\t\tif ip := net.ParseIP(h); ip != nil {\n\t\t\ttemplate.IPAddresses = append(template.IPAddresses, ip)\n\t\t} else {\n\t\t\ttemplate.DNSNames = append(template.DNSNames, h)\n\t\t}\n\t}\n\n\tif isCA {\n\t\ttemplate.IsCA = true\n\t\ttemplate.KeyUsage |= x509.KeyUsageCertSign\n\t}\n\n\tderBytes, err := x509.CreateCertificate(rand.Reader, &template, &template, &priv.PublicKey, priv)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to create certificate: %v\", err)\n\t}\n\n\tcertOut, err := os.Create(certFile)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to open %s for writing: %v\", certFile, err)\n\t}\n\tdefer certOut.Close()\n\tpem.Encode(certOut, &pem.Block{Type: \"CERTIFICATE\", Bytes: derBytes})\n\n\tkeyOut, err := os.OpenFile(keyFile, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to open %s for writing:%v\", keyFile, err)\n\t}\n\tdefer keyOut.Close()\n\tpem.Encode(keyOut, &pem.Block{Type: \"RSA PRIVATE KEY\", Bytes: x509.MarshalPKCS1PrivateKey(priv)})\n\n\treturn nil\n}", "title": "" }, { "docid": "b32a21cb6758225462bcc905f26816a8", "score": "0.47172922", "text": "func GetCertificate( appName string ) ( err error ) {\n\tdomainNames, err := nginx.FindDomainNamesFor( appName )\n\tif err != nil { return }\n\n\temail, err := checkLetsEncryptMail( appName )\n\tif err != nil { return }\n\tfmt.Printf( \"email: %s\\n\", email )\n\n\tif err = performRetrieval( appName, email, domainNames ) ; err != nil { return }\n\tif err = addCronJob( appName ) ; err != nil { return }\n\n\treturn\n}", "title": "" }, { "docid": "2b7471ef7d98edb30e999709e0b4a89b", "score": "0.47085384", "text": "func (m *DeviceManagement) SetApplePushNotificationCertificate(value ApplePushNotificationCertificateable)() {\n m.applePushNotificationCertificate = value\n}", "title": "" }, { "docid": "1bebccf94001d0550c6d2ebe2e330e5b", "score": "0.47061765", "text": "func Certificate(o resources.Object) *CertificateObject {\n\n\tif o.IsA(certificateType) {\n\t\treturn &CertificateObject{o}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "bedb7c15a41dcb0247464c5de6e92587", "score": "0.4697814", "text": "func (s *DescribedServer) SetCertificate(v string) *DescribedServer {\n\ts.Certificate = &v\n\treturn s\n}", "title": "" }, { "docid": "367e59c4d512265cb889bbaef2d8869e", "score": "0.46888572", "text": "func (s *UpdateServerInput) SetCertificate(v string) *UpdateServerInput {\n\ts.Certificate = &v\n\treturn s\n}", "title": "" }, { "docid": "fac9964676ddb3d262743663b6857331", "score": "0.46874505", "text": "func (c *Certificate) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", c, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"id\":\n\t\t\terr = unpopulate(val, \"ID\", &c.ID)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"name\":\n\t\t\terr = unpopulate(val, \"Name\", &c.Name)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"properties\":\n\t\t\terr = unpopulate(val, \"Properties\", &c.Properties)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"systemData\":\n\t\t\terr = unpopulate(val, \"SystemData\", &c.SystemData)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"type\":\n\t\t\terr = unpopulate(val, \"Type\", &c.Type)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", c, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "65f3f00a9fadc5146a56577895607842", "score": "0.4678837", "text": "func createCertificate(country string, organization string,\n\torganizationalUnit string, pemFile string, keyFile string) bool {\n\n\tca := &x509.Certificate{\n\t\tSerialNumber: big.NewInt(7829),\n\t\tSubject: pkix.Name{\n\t\t\tCountry: []string{country},\n\t\t\tOrganization: []string{organization},\n\t\t\tOrganizationalUnit: []string{organizationalUnit},\n\t\t},\n\t\tNotBefore: time.Now(),\n\t\tNotAfter: time.Now().AddDate(10, 0, 0), // 10 years\n\t\tSubjectKeyId: []byte{1, 2, 3, 4, 5},\n\t\tBasicConstraintsValid: true,\n\t\tIsCA: true,\n\t\tExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth,\n\t\t\tx509.ExtKeyUsageServerAuth},\n\t\tKeyUsage: x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign,\n\t}\n\n\tpriv, _ := rsa.GenerateKey(rand.Reader, 2048)\n\tpub := &priv.PublicKey\n\tca_b, err := x509.CreateCertificate(rand.Reader, ca, ca, pub, priv)\n\n\tif err != nil {\n\t\tlog.Println(\"create ca failed\", err)\n\t\treturn false\n\t}\n\n\tlog.Println(\"write to\", pemFile)\n\tioutil.WriteFile(pemFile, ca_b, 0777)\n\n\tpriv_b := x509.MarshalPKCS1PrivateKey(priv)\n\tlog.Println(\"write to\", keyFile)\n\tioutil.WriteFile(keyFile, priv_b, 0777)\n\n\treturn true\n}", "title": "" }, { "docid": "6b0433983bb860d03ec457b6ac41ca36", "score": "0.46762934", "text": "func (client APIManagementServicesClient) UploadCertificateResponder(resp *http.Response) (result CertificateInformation, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tclient.ByInspecting(),\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK),\n\t\tautorest.ByUnmarshallingJSON(&result),\n\t\tautorest.ByClosing())\n\tresult.Response = autorest.Response{Response: resp}\n\treturn\n}", "title": "" }, { "docid": "7cc1b9f7096a025b9f2be4130391d0e0", "score": "0.46752745", "text": "func genCertAndKeyFile(certData, keyData []byte, certDir string) error {\n\t// always remove first\n\tif err := os.RemoveAll(certDir); err != nil {\n\t\treturn fmt.Errorf(\"fail to remove certificates: %s\", err)\n\t}\n\tif err := os.MkdirAll(certDir, 0755); err != nil {\n\t\treturn fmt.Errorf(\"could not create directory %q to store certificates: %v\", certDir, err)\n\t}\n\tcertPath := filepath.Join(certDir, VCWebhookCertFileName)\n\tf, err := os.OpenFile(certPath, os.O_CREATE|os.O_TRUNC|os.O_RDWR, 0600)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not open %q: %v\", certPath, err)\n\t}\n\tdefer f.Close()\n\tcertBlock, _ := pem.Decode(certData)\n\tif certBlock == nil {\n\t\treturn fmt.Errorf(\"invalid certificate data\")\n\t}\n\tpem.Encode(f, certBlock)\n\n\tkeyPath := filepath.Join(certDir, VCWebhookKeyFileName)\n\tkf, err := os.OpenFile(keyPath, os.O_CREATE|os.O_TRUNC|os.O_RDWR, 0600)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not open %q: %v\", keyPath, err)\n\t}\n\n\tkeyBlock, _ := pem.Decode(keyData)\n\tif keyBlock == nil {\n\t\treturn fmt.Errorf(\"invalid key data\")\n\t}\n\tpem.Encode(kf, keyBlock)\n\tlog.Info(\"successfully generate certificate and key file\")\n\treturn nil\n}", "title": "" }, { "docid": "b8298f0479c5459d4f25900a3c0a0089", "score": "0.4673165", "text": "func genCertPair(certFile, keyFile string, altDNSNames []string) error {\n\tlog.Infof(\"Generating TLS certificates...\")\n\n\torg := \"dcrdex autogenerated cert\"\n\tvalidUntil := time.Now().Add(10 * 365 * 24 * time.Hour)\n\tcert, key, err := certgen.NewTLSCertPair(elliptic.P521(), org,\n\t\tvalidUntil, altDNSNames)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Write cert and key files.\n\tif err = ioutil.WriteFile(certFile, cert, 0644); err != nil {\n\t\treturn err\n\t}\n\tif err = ioutil.WriteFile(keyFile, key, 0600); err != nil {\n\t\tos.Remove(certFile)\n\t\treturn err\n\t}\n\n\tlog.Infof(\"Done generating TLS certificates\")\n\treturn nil\n}", "title": "" }, { "docid": "c1c5de6c447de1e87d38632cc7dae17b", "score": "0.46718186", "text": "func (this *Signer) Populate(ctx context.Context, row core.Signer) {\n\tthis.PublicKey = row.Publickey\n\tthis.Weight = row.Weight\n\tthis.Key = row.Publickey\n\tthis.Type = MustKeyTypeFromAddress(this.PublicKey)\n}", "title": "" }, { "docid": "ae94d2c3df286c5162f57ba39ee761e6", "score": "0.46702203", "text": "func (r UpdateCACertificateRequest) Send(ctx context.Context) (*UpdateCACertificateResponse, error) {\n\tr.Request.SetContext(ctx)\n\terr := r.Request.Send()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp := &UpdateCACertificateResponse{\n\t\tUpdateCACertificateOutput: r.Request.Data.(*UpdateCACertificateOutput),\n\t\tresponse: &aws.Response{Request: r.Request},\n\t}\n\n\treturn resp, nil\n}", "title": "" }, { "docid": "6f2a32d601a884d20572d41c83edd580", "score": "0.4664979", "text": "func loadCert(pool *x509.CertPool, pem []byte) error {\n\tif ok := pool.AppendCertsFromPEM(pem); !ok {\n\t\treturn fmt.Errorf(\"failed to parse PEM\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d344e4544e52f344692018cbc38b40cc", "score": "0.46648693", "text": "func (db *Database) AddCertificate(cert *Certificate) error {\n\tnow := time.Now()\n\tdefer db.s.TimingDuration(\"submission.parsing.db.insert-update-latency.certificates\", time.Since(now), 1.0)\n\t_, err := db.m.Exec(\n\t\t`INSERT INTO certificates (\n\t\t size, fingerprint, key_fingerprint, key_alg, valid, version, root, expired, basic_constraints, name_constraints_critical,\n\t\t max_path_len, max_path_zero, signature_alg, signature, not_before, not_after, key_usage,\n\t\t subject_key_identifier, authority_key_identifier, serial, common_name, country, province, locality,\n\t\t\t organization, organizational_unit, issuer_common_name, times_seen, first_seen, last_seen\n\t\t )\n\t\t VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\n\t\t ON DUPLICATE KEY UPDATE last_seen=?, times_seen=VALUES(times_seen)+1`,\n\t\t// And now the long journey to the end of this insert begins, fraught with\n\t\t// terror and intrigue...\n\t\tcert.Size,\n\t\tcert.Fingerprint,\n\t\tcert.KeyFingerprint,\n\t\tcert.PublicKeyAlg,\n\t\tcert.Valid,\n\t\tcert.CertVersion,\n\t\tcert.Root,\n\t\tcert.Expired,\n\t\tcert.BasicConstraints,\n\t\tcert.NameConstraintsCritical,\n\t\tcert.MaxPathLen,\n\t\tcert.MaxPathLenZero,\n\t\tcert.SignatureAlg,\n\t\tcert.Signature,\n\t\tcert.NotBefore,\n\t\tcert.NotAfter,\n\t\tcert.KeyUsage,\n\t\tcert.SubjectKeyIdentifier,\n\t\tcert.AuthorityKeyIdentifier,\n\t\tcert.Serial,\n\t\tcert.CommonName,\n\t\tcert.Country,\n\t\tcert.Province,\n\t\tcert.Locality,\n\t\tcert.Organization,\n\t\tcert.OrganizationalUnit,\n\t\tcert.IssuerCommonName,\n\t\t1, // times seen, if this is the first time\n\t\tnow, // first seen, now\n\t\tnow, // last seen, ...now\n\t\t// Duplicate section of insert\n\t\tnow, // last seen, if a duplicate\n\t)\n\treturn err\n}", "title": "" }, { "docid": "ff8d1e642daa61ad80872cd40c20185f", "score": "0.4664709", "text": "func (c *Certificate) Marshal() ([]byte, error) {\n\thpk := elliptic.Marshal(\n\t\tc.HandshakePublicKey.Curve,\n\t\tc.HandshakePublicKey.X,\n\t\tc.HandshakePublicKey.Y,\n\t)\n\tepk := elliptic.Marshal(\n\t\tc.EncryptionPublicKey.Curve,\n\t\tc.EncryptionPublicKey.X,\n\t\tc.EncryptionPublicKey.Y,\n\t)\n\n\tm := &marshalCert{\n\t\tID: c.ID,\n\t\tHandshakePublicKey: hpk,\n\t\tEncryptionPublicKey: epk,\n\t}\n\n\treturn msgpack.Marshal(m)\n}", "title": "" }, { "docid": "835d8adfd4e49989658cc54b2c066674", "score": "0.46644178", "text": "func ensureCertOnEnrollmentProfile(\n\tdevice types.Device,\n\tprofileLists []types.ProfileList,\n\tsigningCert *x509.Certificate,\n) error {\n\t// Return early if we don't want to sign\n\tif !utils.Sign() {\n\t\treturn nil\n\t}\n\n\tfor i := range profileLists {\n\t\tfor j := range profileLists[i].PayloadContent {\n\t\t\tif profileLists[i].PayloadContent[j].PayloadType == \"com.apple.mdm\" {\n\t\t\t\tprofileForVerification := ProfileForVerification{\n\t\t\t\t\tPayloadUUID: profileLists[i].PayloadUUID,\n\t\t\t\t\tPayloadIdentifier: profileLists[i].PayloadIdentifier,\n\t\t\t\t\tHashedPayloadUUID: profileLists[i].PayloadUUID,\n\t\t\t\t\tDeviceUDID: device.UDID,\n\t\t\t\t\tInstalled: true, // You always want an enrollment profile to be installed\n\t\t\t\t}\n\n\t\t\t\t_, needsReinstall, err := validateProfileInProfileList(\n\t\t\t\t\tprofileForVerification,\n\t\t\t\t\tprofileLists,\n\t\t\t\t\tsigningCert,\n\t\t\t\t)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn errors.Wrap(err, \"validateProfileInProfileList\")\n\t\t\t\t}\n\n\t\t\t\tif needsReinstall {\n\t\t\t\t\terr = reinstallEnrollmentProfile(device)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn errors.Wrap(err, \"reinstallEnrollmentProfile\")\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "6931053bc59f2cb8d99f054bcf25379b", "score": "0.46605265", "text": "func parseCertificate(cert []byte) (*x509.Certificate, error) {\n\tblock, _ := pem.Decode(cert)\n\tif block == nil {\n\t\treturn nil, fmt.Errorf(\"failed to parse PEM certificate\")\n\t}\n\n\tx509Cert, err := x509.ParseCertificate(block.Bytes)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to parse certificate: %w\", err)\n\t}\n\n\treturn x509Cert, nil\n}", "title": "" }, { "docid": "4d39082eba1dc7f0227dbfd5e81705df", "score": "0.46594673", "text": "func (m *MySQL) SetCertificate(crt, key string) (err error) {\n\tm.certificate, err = tls.LoadX509KeyPair(crt, key)\n\treturn\n}", "title": "" }, { "docid": "4f107fe0b3668916c70840f03d41e3f3", "score": "0.4655517", "text": "func (k Keychain) importCertificate(path string, passphrase stepconf.Secret) error {\n\treturn runSecurityCmd(k.factory, \"import\", path, \"-k\", k.path, \"-P\", passphrase, \"-A\")\n}", "title": "" }, { "docid": "de9f09399649806f84fda76e62d39a94", "score": "0.46536148", "text": "func (s Store) Certificate() (*x509.Certificate, error) {\n\tcertAttribute, err := s.getAttribute(\n\t\ts.config.GetCertificateTemplate(),\n\t\t[]*pkcs11.Attribute{pkcs11.NewAttribute(pkcs11.CKA_VALUE, nil)},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn x509.ParseCertificate(certAttribute.Value)\n}", "title": "" }, { "docid": "9134f74630aa17284148389f963d9dad", "score": "0.46461308", "text": "func (m *Manager) signCertificate(host string) (*tls.Certificate, error) {\n\tx509ca, err := x509.ParseCertificate(m.cert.Certificate[0])\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tnotBefore := time.Now()\n\tnotAfter := notBefore.Add(time.Duration(365*24) * time.Hour)\n\tserialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)\n\tserialNumber, err := rand.Int(rand.Reader, serialNumberLimit)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ttemplate := x509.Certificate{\n\t\tSerialNumber: serialNumber,\n\t\tIssuer: x509ca.Subject,\n\t\tSubject: pkix.Name{\n\t\t\tOrganization: []string{organization},\n\t\t\tCountry: []string{country},\n\t\t\tProvince: []string{province},\n\t\t\tLocality: []string{locality},\n\t\t\tStreetAddress: []string{streetAddress},\n\t\t\tPostalCode: []string{postalCode},\n\t\t\tCommonName: host,\n\t\t},\n\t\tNotBefore: notBefore,\n\t\tNotAfter: notAfter,\n\t\tKeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign,\n\t\tExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth, x509.ExtKeyUsageServerAuth},\n\t\tBasicConstraintsValid: true,\n\t}\n\n\tif ip := net.ParseIP(host); ip != nil {\n\t\ttemplate.IPAddresses = append(template.IPAddresses, ip)\n\t} else {\n\t\ttemplate.DNSNames = append(template.DNSNames, host)\n\t}\n\n\tcertpriv, err := rsa.GenerateKey(rand.Reader, bits)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tderBytes, err := x509.CreateCertificate(rand.Reader, &template, x509ca, &certpriv.PublicKey, m.cert.PrivateKey)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &tls.Certificate{Certificate: [][]byte{derBytes, m.cert.Certificate[0]}, PrivateKey: certpriv}, nil\n}", "title": "" }, { "docid": "61399cc36a53ae388c5836e357f44b84", "score": "0.4643147", "text": "func (c *CustomerCertificate) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", c, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"certificateAuthority\":\n\t\t\terr = unpopulate(val, \"CertificateAuthority\", &c.CertificateAuthority)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"expirationDate\":\n\t\t\terr = unpopulate(val, \"ExpirationDate\", &c.ExpirationDate)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"secretSource\":\n\t\t\terr = unpopulate(val, \"SecretSource\", &c.SecretSource)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"secretVersion\":\n\t\t\terr = unpopulate(val, \"SecretVersion\", &c.SecretVersion)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"subject\":\n\t\t\terr = unpopulate(val, \"Subject\", &c.Subject)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"subjectAlternativeNames\":\n\t\t\terr = unpopulate(val, \"SubjectAlternativeNames\", &c.SubjectAlternativeNames)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"thumbprint\":\n\t\t\terr = unpopulate(val, \"Thumbprint\", &c.Thumbprint)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"type\":\n\t\t\terr = unpopulate(val, \"Type\", &c.Type)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"useLatestVersion\":\n\t\t\terr = unpopulate(val, \"UseLatestVersion\", &c.UseLatestVersion)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", c, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b51d8323fa428f4d905ce6d6015aaa91", "score": "0.46362728", "text": "func genCertPair(certFile, keyFile string) error {\n\tlog.Infof(\"Generating TLS certificates...\")\n\n\t// Create directories for cert and key files if they do not yet exist.\n\tcertDir, _ := filepath.Split(certFile)\n\tkeyDir, _ := filepath.Split(keyFile)\n\tif err := os.MkdirAll(certDir, 0700); err != nil {\n\t\treturn err\n\t}\n\tif err := os.MkdirAll(keyDir, 0700); err != nil {\n\t\treturn err\n\t}\n\n\t// Generate cert pair.\n\torg := \"btcwallet autogenerated cert\"\n\tvalidUntil := time.Now().Add(10 * 365 * 24 * time.Hour)\n\tcert, key, err := btcutil.NewTLSCertPair(org, validUntil, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Write cert and key files.\n\tif err = ioutil.WriteFile(certFile, cert, 0666); err != nil {\n\t\treturn err\n\t}\n\tif err = ioutil.WriteFile(keyFile, key, 0600); err != nil {\n\t\tif rmErr := os.Remove(certFile); rmErr != nil {\n\t\t\tlog.Warnf(\"Cannot remove written certificates: %v\", rmErr)\n\t\t}\n\t\treturn err\n\t}\n\n\tlog.Info(\"Done generating TLS certificates\")\n\treturn nil\n}", "title": "" }, { "docid": "e8d60a7ca8a7aef1647eddfe99f8c9c7", "score": "0.4633671", "text": "func (p *PocketNodeTeleportProcess) RequestSignedCertificateWithAuthServer(token string, role teleport.Role, eventName string) {\n cfg := p.Config\n identityID := auth.IdentityID{Role: role, HostUUID: cfg.HostUUID}\n log.Infof(\"RequestSignedCertificateWithAuthServer role %s cfg.HostUUID %s\", role, cfg.HostUUID)\n\n // this means the server has not been initialized yet, we are starting\n // the registering client that attempts to connect to the auth server\n // and provision the keys\n var authClient *auth.TunClient\n p.RegisterFunc(func() error {\n retryTime := pcdefaults.ServerHeartbeatTTL / 3\n for {\n connector, err := p.connectToAuthService(role)\n if err == nil {\n p.BroadcastEvent(service.Event{Name: eventName, Payload: connector})\n authClient = connector.Client\n return nil\n }\n if trace.IsConnectionProblem(err) {\n utils.Consolef(cfg.Console, \"[%v] connecting to auth server: %v\", role, err)\n time.Sleep(retryTime)\n continue\n }\n/*\n TODO : need to look into IsNotFound Error to see what really happens\n if !trace.IsNotFound(err) {\n return trace.Wrap(err)\n }\n*/\n // Auth server is remote, so we need a provisioning token\n if token == \"\" {\n return trace.BadParameter(\"%v must request a signed certificate and needs a provisioning token\", role)\n }\n log.Infof(\"[Node] %v requesting a signed certificate with a token %v\", role, token)\n err = pcauth.RequestSignedCertificate(cfg, identityID, token)\n if err != nil {\n utils.Consolef(cfg.Console, \"[%v] failed to receive a signed certificate : %v\", role, err)\n time.Sleep(retryTime)\n } else {\n utils.Consolef(cfg.Console, \"[%v] Successfully received a signed certificate\", role)\n continue\n }\n }\n })\n\n p.onExit(func(interface{}) {\n if authClient != nil {\n authClient.Close()\n }\n })\n}", "title": "" }, { "docid": "8a31667aee8b4bd1da5d13d1ec90a2a2", "score": "0.46308666", "text": "func generateCert(sn int, commonName string, parentCert *x509.Certificate, parentCertKey *rsa.PrivateKey, outKeyFile string, outCertFile string, opts ...func(c *x509.Certificate)) (*x509.Certificate, *rsa.PrivateKey, error) {\n\tprivateKey, err := rsa.GenerateKey(rand.Reader, 528)\n\tif err != nil {\n\t\treturn nil, nil, errors.Trace(err)\n\t}\n\tnotBefore := time.Now().Add(-10 * time.Minute).UTC()\n\tnotAfter := notBefore.Add(1 * time.Hour).UTC()\n\n\ttemplate := x509.Certificate{\n\t\tSerialNumber: big.NewInt(int64(sn)),\n\t\tSubject: pkix.Name{CommonName: commonName, Names: []pkix.AttributeTypeAndValue{util.MockPkixAttribute(util.CommonName, commonName)}},\n\t\tDNSNames: []string{commonName},\n\t\tNotBefore: notBefore,\n\t\tNotAfter: notAfter,\n\t\tKeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,\n\t\tExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth, x509.ExtKeyUsageClientAuth},\n\t\tBasicConstraintsValid: true,\n\t}\n\tfor _, opt := range opts {\n\t\topt(&template)\n\t}\n\n\tvar parent *x509.Certificate\n\tvar priv *rsa.PrivateKey\n\n\tif parentCert == nil || parentCertKey == nil {\n\t\ttemplate.IsCA = true\n\t\ttemplate.KeyUsage |= x509.KeyUsageCertSign\n\t\tparent = &template\n\t\tpriv = privateKey\n\t} else {\n\t\tparent = parentCert\n\t\tpriv = parentCertKey\n\t}\n\n\tderBytes, err := x509.CreateCertificate(rand.Reader, &template, parent, &privateKey.PublicKey, priv)\n\tif err != nil {\n\t\treturn nil, nil, errors.Trace(err)\n\t}\n\n\tcert, err := x509.ParseCertificate(derBytes)\n\tif err != nil {\n\t\treturn nil, nil, errors.Trace(err)\n\t}\n\n\tcertOut, err := os.Create(outCertFile)\n\tif err != nil {\n\t\treturn nil, nil, errors.Trace(err)\n\t}\n\terr = pem.Encode(certOut, &pem.Block{Type: \"CERTIFICATE\", Bytes: derBytes})\n\tif err != nil {\n\t\treturn nil, nil, errors.Trace(err)\n\t}\n\terr = certOut.Close()\n\tif err != nil {\n\t\treturn nil, nil, errors.Trace(err)\n\t}\n\n\tkeyOut, err := os.OpenFile(outKeyFile, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600)\n\tif err != nil {\n\t\treturn nil, nil, errors.Trace(err)\n\t}\n\terr = pem.Encode(keyOut, &pem.Block{Type: \"RSA PRIVATE KEY\", Bytes: x509.MarshalPKCS1PrivateKey(privateKey)})\n\tif err != nil {\n\t\treturn nil, nil, errors.Trace(err)\n\t}\n\terr = keyOut.Close()\n\tif err != nil {\n\t\treturn nil, nil, errors.Trace(err)\n\t}\n\n\treturn cert, privateKey, nil\n}", "title": "" }, { "docid": "cfcdf46dc97300bc4937c866b1ac9e07", "score": "0.46297914", "text": "func (infra *Infrastructure) setupAwsAcmCertificate(log *log.Logger, domainName string, alternativeNames []string) (*AwsAcmCertificateResult, error) {\n\n\tlog.Println(\"\\tACM - Get or create certificate\")\n\n\tinput := &acm.RequestCertificateInput{\n\t\t// Fully qualified domain name (FQDN), such as www.example.com, that you want\n\t\t// to secure with an ACM certificate. Use an asterisk (*) to create a wildcard\n\t\t// certificate that protects several sites in the same domain. For example,\n\t\t// *.example.com protects www.example.com, site.example.com, and images.example.com.\n\t\t//\n\t\t// The first domain name you enter cannot exceed 63 octets, including periods.\n\t\t// Each subsequent Subject Alternative Name (SAN), however, can be up to 253\n\t\t// octets in length.\n\t\t//\n\t\t// DomainName is a required field\n\t\tDomainName: aws.String(domainName),\n\n\t\t// Currently, you can use this parameter to specify whether to add the certificate\n\t\t// to a certificate transparency log. Certificate transparency makes it possible\n\t\t// to detect SSL/TLS certificates that have been mistakenly or maliciously issued.\n\t\t// Certificates that have not been logged typically produce an error message\n\t\t// in a browser. For more information, see Opting Out of Certificate Transparency\n\t\t// Logging (https://docs.aws.amazon.com/acm/latest/userguide/acm-bestpractices.html#best-practices-transparency).\n\t\tOptions: &acm.CertificateOptions{\n\t\t\tCertificateTransparencyLoggingPreference: aws.String(\"ENABLED\"),\n\t\t},\n\n\t\t// The method you want to use if you are requesting a public certificate to\n\t\t// validate that you own or control domain. You can validate with DNS (https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-validate-dns.html)\n\t\t// or validate with email (https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-validate-email.html).\n\t\t// We recommend that you use DNS validation.\n\t\tValidationMethod: aws.String(\"DNS\"),\n\t}\n\n\tif len(alternativeNames) > 0 {\n\t\t// Additional FQDNs to be included in the Subject Alternative Name extension\n\t\t// of the ACM certificate. For example, add the name www.example.net to a certificate\n\t\t// for which the DomainName field is www.example.com if users can reach your\n\t\t// site by using either name. The maximum number of domain names that you can\n\t\t// add to an ACM certificate is 100. However, the initial limit is 10 domain\n\t\t// names. If you need more than 10 names, you must request a limit increase.\n\t\t// For more information, see Limits (https://docs.aws.amazon.com/acm/latest/userguide/acm-limits.html).\n\t\tinput.SubjectAlternativeNames = aws.StringSlice(alternativeNames)\n\t}\n\n\tinputHash := getInputHash(input)\n\n\tif infra.AwsAcmCertificate == nil {\n\t\tinfra.AwsAcmCertificate = make(map[string]*AwsAcmCertificateResult)\n\t}\n\n\tresult, ok := infra.AwsAcmCertificate[domainName]\n\tif ok && result != nil && result.InputHash == inputHash && result.Status != \"PENDING_VALIDATION\" && !infra.skipCache {\n\t\tlog.Printf(\"\\t\\tExists: %s\", domainName)\n\t\treturn result, nil\n\t}\n\n\tsvc := acm.New(infra.AwsSession())\n\n\tvar certificateArn string\n\terr := svc.ListCertificatesPages(&acm.ListCertificatesInput{},\n\t\tfunc(res *acm.ListCertificatesOutput, lastPage bool) bool {\n\t\t\tfor _, cert := range res.CertificateSummaryList {\n\t\t\t\tif *cert.DomainName == domainName {\n\t\t\t\t\tcertificateArn = *cert.CertificateArn\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn !lastPage\n\t\t})\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"Failed to list certificates for '%s'\", domainName)\n\t}\n\n\tif certificateArn == \"\" {\n\t\t// Customer chosen string that can be used to distinguish between calls to RequestCertificate.\n\t\t// Idempotency tokens time out after one hour. Therefore, if you call RequestCertificate\n\t\t// multiple times with the same idempotency token within one hour, ACM recognizes\n\t\t// that you are requesting only one certificate and will issue only one. If\n\t\t// you change the idempotency token for each call, ACM recognizes that you are\n\t\t// requesting multiple certificates.\n\t\t// Create hash of all the domain names to be used to mark unique requests.\n\t\tidempotencyToken := domainName + \"|\" + strings.Join(alternativeNames, \"|\")\n\t\tidempotencyToken = fmt.Sprintf(\"%x\", md5.Sum([]byte(idempotencyToken)))\n\n\t\tinput.IdempotencyToken = aws.String(idempotencyToken)\n\n\t\t// If no certicate was found, create one.\n\t\tcreateRes, err := svc.RequestCertificate(input)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrapf(err, \"Failed to create certificate '%s'\", domainName)\n\t\t}\n\t\tcertificateArn = *createRes.CertificateArn\n\n\t\tlog.Printf(\"\\t\\tCreated certificate '%s'\", domainName)\n\t} else {\n\t\tlog.Printf(\"\\t\\tFound certificate '%s'\", domainName)\n\t}\n\n\tdescRes, err := svc.DescribeCertificate(&acm.DescribeCertificateInput{\n\t\tCertificateArn: aws.String(certificateArn),\n\t})\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"Failed to describe certificate '%s'\", certificateArn)\n\t}\n\tcert := descRes.Certificate\n\n\tlog.Printf(\"\\t\\t\\tStatus: %s\", *cert.Status)\n\n\tif *cert.Status == \"PENDING_VALIDATION\" {\n\t\tsvc := route53.New(infra.AwsSession())\n\n\t\tlog.Println(\"\\t\\t\\tList all hosted zones.\")\n\n\t\tvar zoneValOpts = map[string][]*acm.DomainValidation{}\n\t\tfor _, opt := range cert.DomainValidationOptions {\n\n\t\t\tzone, err := infra.GetRoute53ZoneByDomain(*opt.DomainName)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.Wrapf(err, \"Failed to find zone ID for '%s'\", *opt.DomainName)\n\t\t\t}\n\n\t\t\tif _, ok := zoneValOpts[zone.ZoneId]; !ok {\n\t\t\t\tzoneValOpts[zone.ZoneId] = []*acm.DomainValidation{}\n\t\t\t}\n\t\t\tzoneValOpts[zone.ZoneId] = append(zoneValOpts[zone.ZoneId], opt)\n\t\t}\n\n\t\tfor zoneId, opts := range zoneValOpts {\n\t\t\tfor _, opt := range opts {\n\t\t\t\tif *opt.ValidationStatus == \"SUCCESS\" {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tinput := &route53.ChangeResourceRecordSetsInput{\n\t\t\t\t\tChangeBatch: &route53.ChangeBatch{\n\t\t\t\t\t\tChanges: []*route53.Change{\n\t\t\t\t\t\t\t&route53.Change{\n\t\t\t\t\t\t\t\tAction: aws.String(\"UPSERT\"),\n\t\t\t\t\t\t\t\tResourceRecordSet: &route53.ResourceRecordSet{\n\t\t\t\t\t\t\t\t\tName: opt.ResourceRecord.Name,\n\t\t\t\t\t\t\t\t\tResourceRecords: []*route53.ResourceRecord{\n\t\t\t\t\t\t\t\t\t\t&route53.ResourceRecord{Value: opt.ResourceRecord.Value},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tType: opt.ResourceRecord.Type,\n\t\t\t\t\t\t\t\t\tTTL: aws.Int64(60),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tHostedZoneId: aws.String(zoneId),\n\t\t\t\t}\n\n\t\t\t\tlog.Printf(\"\\t\\t\\tAdded verification record for '%s'.\\n\", *opt.ResourceRecord.Name)\n\t\t\t\t_, err := svc.ChangeResourceRecordSets(input)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, errors.Wrapf(err, \"Failed to update A records for zone '%s'\", zoneId)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tresult = &AwsAcmCertificateResult{\n\t\tCertificateArn: certificateArn,\n\t\tDomainName: domainName,\n\t\tStatus: *cert.Status,\n\t\tInputHash: inputHash,\n\t}\n\tinfra.AwsAcmCertificate[domainName] = result\n\n\tlog.Printf(\"\\t%s\\tCertificate available\\n\", Success)\n\n\treturn result, nil\n}", "title": "" }, { "docid": "76daf67aa84ba1d3bd87165ed4be2ea5", "score": "0.46282285", "text": "func generateCert(privateKey *ecdsa.PrivateKey) []byte {\n\ttemplate := x509.Certificate{}\n\n\tserialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)\n\ttemplate.SerialNumber, _ = rand.Int(rand.Reader, serialNumberLimit)\n\n\ttemplate.KeyUsage = x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign\n\n\ttemplate.NotBefore = time.Now()\n\ttemplate.NotAfter = time.Now().Add(365 * 24 * time.Hour)\n\n\ttemplate.SignatureAlgorithm = x509.ECDSAWithSHA256\n\n\tderBytes, err := x509.CreateCertificate(rand.Reader, &template, &template, &(privateKey.PublicKey), privateKey)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\n\treturn derBytes\n}", "title": "" }, { "docid": "f630b3978fe0bdfc1988a563170715d6", "score": "0.46281922", "text": "func processAttributeCertificates(certs []byte) (asn1, appendedTag []byte, err error) {\n\tif len(certs) < 8 {\n\t\terr = errors.NewError(1009)\n\t\treturn\n\t}\n\n\t// This reads a WIN_CERTIFICATE structure from\n\t// TODO Struct this up\n\t// http://msdn.microsoft.com/en-us/library/ms920091.aspx.\n\tcertificateLength := binary.LittleEndian.Uint32(certs[:4])\n\trevision := binary.LittleEndian.Uint16(certs[4:6])\n\tcertificateType := binary.LittleEndian.Uint16(certs[6:8])\n\n\tif int(certificateLength) != len(certs) {\n\t\terr = errors.NewError(1008)\n\t\treturn\n\t}\n\n\tif revision != certificateRevision {\n\t\terr = errors.NewError(1007)\n\t\treturn\n\t}\n\n\tif certificateType != certificateType {\n\t\terr = errors.NewError(1006)\n\t\treturn\n\t}\n\n\tasn1 = certs[8:]\n\n\tif len(asn1) < 2 {\n\t\terr = errors.NewError(1005)\n\t\treturn\n\t}\n\n\t// Read the ASN.1 length of the object.\n\tvar asn1Length int\n\tif asn1[1]&0x80 == 0 {\n\t\t// Short form length.\n\t\tasn1Length = int(asn1[1]) + 2\n\t} else {\n\t\tnumBytes := int(asn1[1] & 0x7f)\n\t\tif numBytes == 0 || numBytes > 2 {\n\t\t\terr = errors.NewError(1004)\n\t\t\treturn\n\t\t}\n\t\tif len(asn1) < numBytes+2 {\n\t\t\terr = errors.NewError(1005)\n\t\t\treturn\n\t\t}\n\t\tasn1Length = int(asn1[2])\n\t\tif numBytes == 2 {\n\t\t\tasn1Length <<= 8\n\t\t\tasn1Length |= int(asn1[3])\n\t\t}\n\t\tasn1Length += 2 + numBytes\n\t}\n\n\tappendedTag = asn1[asn1Length:]\n\tasn1 = asn1[:asn1Length]\n\n\treturn\n}", "title": "" }, { "docid": "e5a43395cf1fba3163cb4f58624205d7", "score": "0.46147776", "text": "func (o *ServiceCertificate) Patch(sparse elemental.SparseIdentifiable) {\n\tif !sparse.Identity().IsEqual(o.Identity()) {\n\t\tpanic(\"cannot patch from a parse with different identity\")\n\t}\n\n\tso := sparse.(*SparseServiceCertificate)\n\tif so.ID != nil {\n\t\to.ID = *so.ID\n\t}\n\tif so.Annotations != nil {\n\t\to.Annotations = *so.Annotations\n\t}\n\tif so.AssociatedTags != nil {\n\t\to.AssociatedTags = *so.AssociatedTags\n\t}\n\tif so.CreateIdempotencyKey != nil {\n\t\to.CreateIdempotencyKey = *so.CreateIdempotencyKey\n\t}\n\tif so.CreateTime != nil {\n\t\to.CreateTime = *so.CreateTime\n\t}\n\tif so.Description != nil {\n\t\to.Description = *so.Description\n\t}\n\tif so.Fingerprint != nil {\n\t\to.Fingerprint = *so.Fingerprint\n\t}\n\tif so.Name != nil {\n\t\to.Name = *so.Name\n\t}\n\tif so.Namespace != nil {\n\t\to.Namespace = *so.Namespace\n\t}\n\tif so.NormalizedTags != nil {\n\t\to.NormalizedTags = *so.NormalizedTags\n\t}\n\tif so.Private != nil {\n\t\to.Private = *so.Private\n\t}\n\tif so.Propagate != nil {\n\t\to.Propagate = *so.Propagate\n\t}\n\tif so.Protected != nil {\n\t\to.Protected = *so.Protected\n\t}\n\tif so.Public != nil {\n\t\to.Public = *so.Public\n\t}\n\tif so.UpdateIdempotencyKey != nil {\n\t\to.UpdateIdempotencyKey = *so.UpdateIdempotencyKey\n\t}\n\tif so.UpdateTime != nil {\n\t\to.UpdateTime = *so.UpdateTime\n\t}\n\tif so.ZHash != nil {\n\t\to.ZHash = *so.ZHash\n\t}\n\tif so.Zone != nil {\n\t\to.Zone = *so.Zone\n\t}\n}", "title": "" } ]
74193d01c66288082e6e830874437f1e
Err returns the first of either the write err or the read err. If this return is nonnil, the request/response had an error.
[ { "docid": "34ba406e1ed6435a358e319c3f9f16df", "score": "0.5892082", "text": "func (e *E2EInfo) Err() error {\n\tif e.WriteErr != nil {\n\t\treturn e.WriteErr\n\t}\n\treturn e.ReadErr\n}", "title": "" } ]
[ { "docid": "c1d2d5efc3b6b82bdcd352fa8114623a", "score": "0.68542117", "text": "func (w *Write) Err() error {\n\treturn w.err\n}", "title": "" }, { "docid": "3cebca08dd1a7beac55f612ae2091ea8", "score": "0.6699522", "text": "func (w *ErrWriter) Err() error { return w.err }", "title": "" }, { "docid": "2078ecce7e2fad26e7b05c4e1705a796", "score": "0.61373067", "text": "func (r *response) Err() error {\n\treturn r.err\n}", "title": "" }, { "docid": "437ae3b3c348a96abe3fde07bc798e8a", "score": "0.6120712", "text": "func (r *Reader) Err() error {\n\treturn r.err\n}", "title": "" }, { "docid": "437ae3b3c348a96abe3fde07bc798e8a", "score": "0.6120712", "text": "func (r *Reader) Err() error {\n\treturn r.err\n}", "title": "" }, { "docid": "36ea4789bd1832be6a8ccfb188039d89", "score": "0.611851", "text": "func (w *writeFile) Err() error {\n\tif w.err == nil {\n\t\treturn nil\n\t}\n\n\treturn w.err\n}", "title": "" }, { "docid": "d20ccbd3eaba41d761a5f3dc6b704816", "score": "0.6071607", "text": "func (w *Writer) Err() error {\n\tw.c.L.Lock()\n\terr := w.err\n\tw.c.L.Unlock()\n\treturn err\n}", "title": "" }, { "docid": "8d6abdf2fd6a43b15af8d008138b11c9", "score": "0.6024061", "text": "func (r *Reader) Err() error {\n\tif r.err == io.EOF {\n\t\treturn nil\n\t}\n\treturn r.err\n}", "title": "" }, { "docid": "8d6abdf2fd6a43b15af8d008138b11c9", "score": "0.6024061", "text": "func (r *Reader) Err() error {\n\tif r.err == io.EOF {\n\t\treturn nil\n\t}\n\treturn r.err\n}", "title": "" }, { "docid": "d468a637ca042cc8191cb18e0cad87c4", "score": "0.6007828", "text": "func (r *Response) Err() error {\n\treturn r.Error\n}", "title": "" }, { "docid": "26d82af1d45dad122a84c28cc3c8b3ae", "score": "0.598281", "text": "func (d *Reader) Err() error {\n\treturn d.err\n}", "title": "" }, { "docid": "3fee2cb4d626bcceee6ba47f107e7ae6", "score": "0.596143", "text": "func (r *Reader) Err() error {\n\tif r.fields.err != io.EOF {\n\t\treturn r.fields.err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9b3e6b63c186f5a16635da1b26d3a7b5", "score": "0.57627636", "text": "func (d *Decoder) Err() error {\n\tif d.err == io.EOF {\n\t\treturn nil\n\t}\n\treturn d.err\n}", "title": "" }, { "docid": "9b3e6b63c186f5a16635da1b26d3a7b5", "score": "0.57627636", "text": "func (d *Decoder) Err() error {\n\tif d.err == io.EOF {\n\t\treturn nil\n\t}\n\treturn d.err\n}", "title": "" }, { "docid": "3dac8db7dcd29e2ee8c75bd0ec0dbfda", "score": "0.5740904", "text": "func writeErr(w http.ResponseWriter, err error, status int) {\n\tvar id string\n\tswitch status {\n\tcase http.StatusBadRequest:\n\t\tid = \"bad_request\"\n\tcase http.StatusInternalServerError:\n\t\tid = \"internal_error\"\n\tdefault:\n\t\tid = \"unknown_error\"\n\t\tstatus = http.StatusInternalServerError\n\t}\n\thttp.Error(w, fmt.Sprintf(`{\"id\":\"%s\",\"message\":\"%s\"}`, id, err), status)\n}", "title": "" }, { "docid": "2346ea1f8f8a3e03ef756016875425bd", "score": "0.57015157", "text": "func (r *msgReader) Err() error {\n\treturn r.err\n}", "title": "" }, { "docid": "6df4556286b1bc68c7d0412776e41f74", "score": "0.5691266", "text": "func (o *ocfStream) Err() error {\n\treturn o.err\n}", "title": "" }, { "docid": "725bf9f304818ba3deb0e83a52c346ff", "score": "0.5673528", "text": "func (d *download) Err() (err error) {\n\td.mu.Lock()\n\terr = d.err\n\td.mu.Unlock()\n\treturn err\n}", "title": "" }, { "docid": "bc407044cc98d53cf5e917de16a05e0a", "score": "0.56722146", "text": "func (r *ByteValueReader) Err() error {\n\treturn r.err\n}", "title": "" }, { "docid": "5fc6e0a6b409446613370729e925e734", "score": "0.56700367", "text": "func (o *Out) Err() error {\n\to.mu.Lock()\n\tdefer o.mu.Unlock()\n\tfmt.Println(\"Out\", o.err)\n\treturn o.err\n}", "title": "" }, { "docid": "66f7568f643454c1f093a9e1ccf6371e", "score": "0.5650264", "text": "func (c *Container) Err() error {\n\tif c.err == io.EOF {\n\t\treturn nil\n\t}\n\treturn c.err\n}", "title": "" }, { "docid": "cd72dc2f66fe9be4846982b8582ddf91", "score": "0.5585662", "text": "func (s *RecordScanner) Err() error {\n\tif s.err == io.EOF {\n\t\treturn nil\n\t}\n\treturn s.err\n}", "title": "" }, { "docid": "1ba61a7377bebe50b93ee4c8d6f7394c", "score": "0.55424887", "text": "func (c *ReadChunkIterator) Err() error {\n\treturn nil\n}", "title": "" }, { "docid": "58b42f32724ad43eec048d0e1cf617f8", "score": "0.5535225", "text": "func (r *avroRecordStream) Err() error {\n\treturn r.err\n}", "title": "" }, { "docid": "6883eb79826572509bf36c202b0b16e5", "score": "0.5527691", "text": "func (r *Reader) Error() error {\n\treturn r.Err\n}", "title": "" }, { "docid": "a9cf14d48e58bd8ce244a7c023aebe4b", "score": "0.552146", "text": "func (q *RErr) getErr() error {\n\tif q.count == 0 {\n\t\treturn q.err\n\t}\n\treturn q.errs[0]\n}", "title": "" }, { "docid": "1759946aa25b54afbbac65d4f1dca711", "score": "0.5521442", "text": "func (r *Records) Err() error {\n\treturn r.err\n}", "title": "" }, { "docid": "fa658a03c3981d07f5123116b849b9de", "score": "0.5482464", "text": "func (rConn *redigoConn) Err() error {\n\treturn rConn.conn.Err()\n}", "title": "" }, { "docid": "cf05ccaaf7b0ff9c9b153b1fb576a435", "score": "0.5481357", "text": "func (e Errors) Err() error {\n\tif len(e) == 0 {\n\t\treturn nil\n\t}\n\n\treturn e\n}", "title": "" }, { "docid": "cdd8b41763bf7504942d971bb64056e4", "score": "0.5474293", "text": "func (r *ByteKVReader) Err() error {\n\tif r.vr != nil {\n\t\treturn r.vr.Err()\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e28443db3072f9a1a0d07cefa3f38b81", "score": "0.54345864", "text": "func (d *decoder) Err() error {\n\treturn d.lastErr\n}", "title": "" }, { "docid": "eb1d0fda86a4e77c7b7a134af5c21773", "score": "0.54331577", "text": "func (w *errHandlerWriter) Write(p []byte) (n int, err error) {\n\tif err = w.Err; err != nil {\n\t\treturn\n\t}\n\tn, err = w.Writer.Write(p)\n\tw.Err = err\n\treturn\n}", "title": "" }, { "docid": "35b0984ea875daa1807e98ed07696dd2", "score": "0.54220605", "text": "func (s *streamCtx) Err() error { return s.sig.Err() }", "title": "" }, { "docid": "9fab9437c26bbd86ee89a12b844c497e", "score": "0.5413549", "text": "func (p *Pipe) Err() error {\n\tp.ensure()\n\n\tp.mutex.Lock()\n\tdefer p.mutex.Unlock()\n\n\treturn p.err\n}", "title": "" }, { "docid": "4a87f91f9dbe63359cedd71e24568959", "score": "0.5411667", "text": "func (r *LastRequestErr) Get() error {\n\tr.Lock()\n\tdefer r.Unlock()\n\treturn r.Err\n}", "title": "" }, { "docid": "16de73c4f8ce74d75d16153e0749d4cd", "score": "0.5392143", "text": "func (j ExecJob) GetErr() []byte {\n\treturn j.err\n}", "title": "" }, { "docid": "1904afe007f15f1a259cb8d34449f870", "score": "0.5389774", "text": "func (zr *ZipReader) Err() error {\n\treturn zr.sr.Err()\n}", "title": "" }, { "docid": "eea0389b46c6c1535cfdf5e50b6393a7", "score": "0.53847915", "text": "func (e *ErrReader) Read(p []byte) (n int, err error) {\n\treturn 0, e.err\n}", "title": "" }, { "docid": "174d6e4601e88ac72cd3e07397531bd8", "score": "0.53831685", "text": "func (m *Session) Err() error {\n\tif atomic.LoadInt32(&m.errOnce.state) == onceDone {\n\t\treturn m.err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f846326886aa08fd28187e95780013de", "score": "0.53782296", "text": "func (w *writerHelper) setErr(err error) {\n\tif w.err == nil {\n\t\tw.err = err\n\t}\n}", "title": "" }, { "docid": "da22f2dc5eb994b3bd28b2d9dbd439e7", "score": "0.53623646", "text": "func (changeStream *ChangeStream) Err() error {\n\tchangeStream.m.Lock()\n\tdefer changeStream.m.Unlock()\n\treturn changeStream.err\n}", "title": "" }, { "docid": "5f299f0271c408f65a2f210d903ce26d", "score": "0.534901", "text": "func (s *Scanner) Err() error {\n\tif s.err == io.EOF {\n\t\treturn nil\n\t}\n\treturn s.err\n}", "title": "" }, { "docid": "833aba1235b9bbc251db787e8d7daeb3", "score": "0.53379977", "text": "func (one *oneconn) setErr(neterr error, conn *Connection) {\n\t// lets sure error is set only once\n\tone.erronce.Do(func() {\n\t\t// notify writer to stop writing\n\t\tclose(one.control)\n\t\trerr, ok := neterr.(*errorx.Error)\n\t\tif !ok {\n\t\t\trerr = conn.errWrap(redis.ErrIO, neterr)\n\t\t}\n\t\trerr = conn.addProps(rerr)\n\t\tone.err = rerr\n\t\t// and try to reconnect asynchronously\n\t\tgo conn.reconnect(rerr, one.c)\n\t})\n}", "title": "" }, { "docid": "9999a1df91dd14b395026d71c945ef38", "score": "0.53369516", "text": "func (ocfr *OCFReader) Err() error {\n\treturn ocfr.err\n}", "title": "" }, { "docid": "b5cca8bff8529a34b66d1ce1e842f5df", "score": "0.53352755", "text": "func (out *Emitter) Err() error {\n\treturn out.err\n}", "title": "" }, { "docid": "bd09e60d2c5375e5f8b69dee55a822ad", "score": "0.5326876", "text": "func (r *Rows) Err() error {\n\treturn r.r.Err()\n}", "title": "" }, { "docid": "11e4eb1617c3f443da4d8f669396bd66", "score": "0.53252363", "text": "func (t *Throttler) Err() error {\n\tt.errsMutex.Lock()\n\tdefer t.errsMutex.Unlock()\n\tif atomic.LoadInt32(&t.errorCount) == 0 {\n\t\treturn nil\n\t}\n\treturn multiError(t.errs)\n}", "title": "" }, { "docid": "06bf8e8db6ec9df92de34c9002c51c87", "score": "0.52818274", "text": "func WriteErr(str string) {\n\tname(nvim_err_write)\n}", "title": "" }, { "docid": "81ec83839f3fc264c2b2f5b2167c6920", "score": "0.52810276", "text": "func (mc *MemoryConnection) Err() error {\n\treturn nil\n}", "title": "" }, { "docid": "e131a53cf1ade2e171b7e60155d72736", "score": "0.52689433", "text": "func (f *Files) Err() error {\n\treturn f.err\n}", "title": "" }, { "docid": "287fa43d5e2c5951b6305617f3e3fb73", "score": "0.5252529", "text": "func (this *AppErr) Err() error {\n\treturn this.err\n}", "title": "" }, { "docid": "3b307724403b9767a637a1942a66b8e9", "score": "0.5251185", "text": "func (b *BucketScanner) Err() error {\n\tif b.err == io.EOF {\n\t\treturn nil\n\t}\n\treturn b.err\n}", "title": "" }, { "docid": "3ac3995315ab7918e703bf62b0ff302c", "score": "0.5246541", "text": "func (it *Iterator) Err() error {\n\treturn it.err\n}", "title": "" }, { "docid": "2df9cbe796d899ba75957f22844568aa", "score": "0.524087", "text": "func (r *LastRequestErr) Set(err error) {\n\tr.Lock()\n\tdefer r.Unlock()\n\tr.Err = err\n}", "title": "" }, { "docid": "3583af9fac61d25e831a2645aabbdc9b", "score": "0.5235591", "text": "func (s *V3ioSeriesSet) Err() error {\n\tif s.iter.Err() != nil {\n\t\treturn s.iter.Err()\n\t}\n\treturn s.err\n}", "title": "" }, { "docid": "7a1addaf91bca3a3ba856d93a9ffb710", "score": "0.5209385", "text": "func (r *errorReader) Read(b []byte) (int, error) {\n\tif r.err != nil {\n\t\treturn 0, r.err\n\t}\n\tvar n int\n\tn, r.err = r.r.Read(b)\n\treturn n, r.err\n}", "title": "" }, { "docid": "60e11eb67b7e91914d6f75ce70efd2a4", "score": "0.52024776", "text": "func (a alwaysFailReadCloser) Read([]byte) (int, error) { return 0, a.err }", "title": "" }, { "docid": "1fe2c6ed809cd0eaacafa5634f8619b6", "score": "0.51885146", "text": "func (r *Result) Err() error {\n\treturn r.err\n}", "title": "" }, { "docid": "3e4d100fd5eb39679bacfdf38d85cd86", "score": "0.5187548", "text": "func (s *MarshalState) Err() error {\n\tif s.err.Err != nil {\n\t\treturn s.err\n\t}\n\tif s.inner.Error != nil {\n\t\treturn s.inner.Error\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "acf5c8cccf955e3e734864cb093ae406", "score": "0.5180775", "text": "func (q N1QLRowReader) Err() error {\n\terr := q.streamer.Err()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmeta, metaErr := q.streamer.MetaData()\n\tif metaErr != nil {\n\t\treturn metaErr\n\t}\n\n\tdescs, err := parseN1QLError(bytes.NewReader(meta))\n\tif err != nil {\n\t\treturn &N1QLError{\n\t\t\tInnerError: err,\n\t\t\tErrors: descs,\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "13dcfe6a24a6c0ebe183d73a6289cfd5", "score": "0.51756454", "text": "func (s *MultiStream) Err() <-chan error {\n\treturn s.parentErr\n}", "title": "" }, { "docid": "b5b3889b3e6e5afc738798dc30af2edd", "score": "0.51731634", "text": "func WriteErr(w http.ResponseWriter, code int, msg string) {\n\terrBytes, err := json.Marshal(&ErrorResponse{\n\t\tCode: code,\n\t\tMessage: msg,\n\t})\n\tif err != nil {\n\t\tw.WriteHeader(500)\n\t\tfmt.Fprint(w, `{\"code\": 500, \"message\": \"failed to generate correct error message\"}`)\n\t}\n\n\tw.WriteHeader(code)\n\t_, _ = w.Write(errBytes)\n}", "title": "" }, { "docid": "60482843bb315fd109071fbe684ef0d5", "score": "0.51683336", "text": "func (p *Parser) Err() error {\n\tif p.err != nil {\n\t\treturn p.err\n\t}\n\tif p.l.err == io.EOF {\n\t\treturn nil\n\t}\n\treturn p.l.err\n}", "title": "" }, { "docid": "9255d76c0274cb763f70fb91f46733c6", "score": "0.515484", "text": "func (c *ChunkIterator) Err() error {\n\treturn c.err\n}", "title": "" }, { "docid": "d31c9c0bc6e930f279a5107954c5dddd", "score": "0.5154579", "text": "func (c *Closer) Err() error {\n\treturn c.ctx.Err()\n}", "title": "" }, { "docid": "04d55c622c692b2f5da69b4f12acb877", "score": "0.5150249", "text": "func (di *DirectoryIterator) Err() error {\n return di.err\n}", "title": "" }, { "docid": "8cb6f79ec6a31544b23a7d478d0aa0bd", "score": "0.5148783", "text": "func (hr *hashReader) Err() error {\n\treturn hr.err\n}", "title": "" }, { "docid": "758d89d1df41e617f7411b38673d255e", "score": "0.51435053", "text": "func (d *XORDecoder) Err() error {\n\treturn d.err\n}", "title": "" }, { "docid": "6bcd247e3a7012145ed57646943c4da8", "score": "0.51297086", "text": "func (p *Poller) Err() error {\n\treturn p.last\n}", "title": "" }, { "docid": "3f922fefe9405c14092cba60d8a98ac7", "score": "0.5111835", "text": "func (h *Handshake) Err() error { return h.err }", "title": "" }, { "docid": "21aafca2032a3b3b56b2ca12a61b5637", "score": "0.51061", "text": "func (h *HTTPJSONResponse) Err(w http.ResponseWriter, code int, err error) {\n\tb, err := json.Marshal(httpError{\n\t\tError: httpErrorData{\n\t\t\tCode: code,\n\t\t\tMessage: err,\n\t\t},\n\t})\n\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(code)\n\tw.Write(b)\n}", "title": "" }, { "docid": "66c443a7a402f6fba45f2d2bd41fadf0", "score": "0.5086755", "text": "func (rows *Rows) Err() error {\n\treturn rows.err\n}", "title": "" }, { "docid": "71d2df1f1d8436ee09f31c5e63ef31ea", "score": "0.506821", "text": "func (f *Filter) Err() error {\n\treturn f.Streamer.Err()\n}", "title": "" }, { "docid": "a03c82e0478ae95e40a1ccc6ff62ca65", "score": "0.5059753", "text": "func (g *Gatherer) Err() error {\n\tg.mutex.Lock()\n\tdefer g.mutex.Unlock()\n\tif g.errs == nil { // Because accumulatedError(nil) != error(nil).\n\t\treturn nil\n\t}\n\treturn g.errs\n}", "title": "" }, { "docid": "f5de88b3f6de5ec99785cef589691c34", "score": "0.50587523", "text": "func (s *Sensor) Err() error {\n\terr := s.err\n\ts.err = nil\n\treturn err\n}", "title": "" }, { "docid": "d8fcd7c39828621ade17d984a024d0cb", "score": "0.5056549", "text": "func ErrHandler(rew http.ResponseWriter, req *http.Request, wrote bool, err error) {\n\tif err == nil {\n\t\treturn\n\t}\n\n\tif !wrote {\n\t\trew.WriteHeader(http.StatusInternalServerError)\n\t\t_, err = fmt.Fprint(rew, err)\n\t\tif err != nil {\n\t\t\t// Logged below.\n\t\t\terr = fmt.Errorf(`secondary error while writing error response: %w`, err)\n\t\t}\n\t}\n\n\tif err != nil {\n\t\tfmt.Fprintf(os.Stderr, \"%+v\\n\", err)\n\t}\n}", "title": "" }, { "docid": "b0e79aa7e1385a23bf6fe2ad84d3c39b", "score": "0.50327873", "text": "func (f *Scanner) Err() error {\n\tif f.err == errEOF {\n\t\treturn nil\n\t}\n\treturn f.err\n}", "title": "" }, { "docid": "5946abfda1c95139918cf55e809cdf6f", "score": "0.5029471", "text": "func (m *MockClientStorer) GetErr(key string) (string, error) {\n\tif m.GetShouldFail {\n\t\treturn \"\", authboss.ClientDataErr{Name: key}\n\t}\n\n\tv, ok := m.Values[key]\n\tif !ok {\n\t\treturn v, authboss.ClientDataErr{Name: key}\n\t}\n\treturn v, nil\n}", "title": "" }, { "docid": "3d19371d9b38e4849fa068afe9a2f606", "score": "0.5023854", "text": "func (e *SyncMultiError) Get(i int) error {\n\te.RLock()\n\tdefer e.RUnlock()\n\n\treturn e.errs[i]\n}", "title": "" }, { "docid": "05c99628e6f2394fc527743a8ba79919", "score": "0.5016889", "text": "func (s *Series) Err() error {\n\treturn s.err\n}", "title": "" }, { "docid": "1fc8a0702d6103ce2a152bba2ab11fce", "score": "0.5011757", "text": "func (p *Pipeline) Err() error {\n\treturn p.err\n}", "title": "" }, { "docid": "b6cffbca87f35de5f49a9ef05514e885", "score": "0.50072265", "text": "func Err(err error) error {\n\tif err != nil {\n\t\tlog.Error(err)\n\t}\n\treturn err\n}", "title": "" }, { "docid": "8ea0ec7c6aab2784b0a75b48f98d9d06", "score": "0.5003697", "text": "func (sc *SentinelClient) Err() error {\n\treturn sc.Conn.Err()\n}", "title": "" }, { "docid": "aae92b71c7f21889813c155f688edff2", "score": "0.50036347", "text": "func (c *Client) GetError() error {\n\tif c.queue == nil {\n\t\treturn nil\n\t}\n\treturn c.queue.writeError\n}", "title": "" }, { "docid": "7238b87b8a6a1e434b7a0527d789d5a5", "score": "0.4993911", "text": "func (it *InAllDocIDSetIterator) Err() error { return it.err }", "title": "" }, { "docid": "857f9e86c15ea65fb6eba74e96c12cbc", "score": "0.4992435", "text": "func (self *Device) Err() error {\n\tswitch code := self.getError(); code {\n\tcase 0x0000:\n\t\treturn nil\n\tcase 0xA001:\n\t\treturn ErrInvalidDevice\n\tcase 0xA002:\n\t\treturn ErrInvalidContext\n\tcase 0xA003:\n\t\treturn ErrInvalidEnum\n\tcase 0xA004:\n\t\treturn ErrInvalidValue\n\tcase 0xA005:\n\t\treturn ErrOutOfMemory\n\tdefault:\n\t\treturn ErrorCode(code)\n\t}\n}", "title": "" }, { "docid": "0ad23ea376dc4f4883a5226db93373c5", "score": "0.49923894", "text": "func setErr(err1, err2 error) error {\n\tif err1 != nil {\n\t\treturn err1\n\t}\n\n\treturn err2\n}", "title": "" }, { "docid": "46d130066595eea7dcf69171b431734e", "score": "0.49829334", "text": "func (conn *Connection) err(kind *errorx.Type) *errorx.Error {\n\treturn conn.addProps(kind.NewWithNoMessage())\n}", "title": "" }, { "docid": "a2b8c830151594c10aa01b8c5a97458e", "score": "0.49813056", "text": "func (self *ErrorList) Err() error {\n\tif self.errs == nil {\n\t\treturn nil\n\t} else {\n\t\tl := len(self.errs)\n\t\tif l == 0 {\n\t\t\treturn nil\n\t\t}\n\t\tif l == 1 {\n\t\t\treturn self.errs[0]\n\t\t}\n\t\treturn self\n\t}\n}", "title": "" }, { "docid": "9d8432ba17dd4ae31ae17f85de788abc", "score": "0.4979947", "text": "func (v *Error) Get() error { return protoutil.OneOf(v.Err).(error) }", "title": "" }, { "docid": "59988eb449b7db5530385d5b97dfddf1", "score": "0.49781445", "text": "func (d *Driver) Err(clear bool) error {\n\te := d.err\n\tif e == 0 {\n\t\treturn nil\n\t}\n\tif clear {\n\t\td.err = 0\n\t}\n\tif err := DriverError(e >> 16); err != 0 {\n\t\treturn err\n\t}\n\tif err := Error(e >> 8); err != 0 {\n\t\tif err&ErrOverrun != 0 && clear {\n\t\t\td.p.LoadByte()\n\t\t\td.p.Status()\n\t\t}\n\t\treturn err\n\t}\n\treturn dma.Error(e)\n}", "title": "" }, { "docid": "652d17da89a44044ec9803b973231b40", "score": "0.497307", "text": "func (r *Result) Err() error {\n\tr.errMu.RLock()\n\tdefer r.errMu.RUnlock()\n\treturn r.err\n}", "title": "" }, { "docid": "b65604ccbc4cc17253f7dcdbb6d4362f", "score": "0.4968622", "text": "func (c *Cursor) Err() error {\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\n\treturn c.err\n}", "title": "" }, { "docid": "347840e158ffe86692ac13918256de75", "score": "0.49612474", "text": "func (it *BPFMapIterator) Err() error {\n\treturn it.err\n}", "title": "" }, { "docid": "c52b7f5c3c648701fbfbda93e82bd5b1", "score": "0.49586344", "text": "func (n IntCommon) Err() error {\n\treturn n.Error\n}", "title": "" }, { "docid": "2b25bfd388e71a854943fb0f3a9bd819", "score": "0.4951403", "text": "func (i *Iter) Err() error {\n\tif i.err != nil {\n\t\treturn i.err\n\t}\n\n\treturn i.iter.Err()\n}", "title": "" }, { "docid": "ca3b62663dd7e544d281affb093145a9", "score": "0.49467692", "text": "func (w *Worker) Err() error {\n\tw.mu.Lock()\n\tdefer w.mu.Unlock()\n\treturn w.err\n}", "title": "" }, { "docid": "d7dd22d360e854540abd51025cefa1f7", "score": "0.4942939", "text": "func (i *iterator) Err() error {\n\treturn i.iter.Err()\n}", "title": "" }, { "docid": "f3ea7bc1b3fbc6e06aa99f48f233626c", "score": "0.49418816", "text": "func (p *Parser) Err() error {\n\tif p.err != nil {\n\t\treturn p.err\n\t}\n\treturn p.r.Err()\n}", "title": "" }, { "docid": "681e81e0328e591efb754c2decd1e11c", "score": "0.49311393", "text": "func (a ErrorList) Err() error {\n\tif len(a) > 0 {\n\t\treturn a\n\t}\n\treturn nil\n}", "title": "" } ]
550345dd613df8cb9fcc9776b0f569ef
addEvent add event channel
[ { "docid": "fd1fac9f4465ab9cb422ab4e57a59a69", "score": "0.6381702", "text": "func (l *Libvirt) addEvent(id uint32, c chan *libvirt.Event) {\n\tl.em.Lock()\n\tl.messages[id] = c\n\tl.em.Unlock()\n}", "title": "" } ]
[ { "docid": "d4e972c6da2a30ae2a31ef62c61e91ec", "score": "0.6367723", "text": "func addChannel(ch cha.Channel) {\n\tinstance.channels = append(instance.channels, ch)\n}", "title": "" }, { "docid": "3b704e5c7415461ac4e0b7e30ab423cb", "score": "0.62405485", "text": "func Add(name string){\n\t//todo add size?\n\tchannels[name] = make(chan interface{})\n}", "title": "" }, { "docid": "fac3b64638ea3ceacbefa586a7b0fcf2", "score": "0.62070745", "text": "func (c *capture) addEvent(ev *portmidi.Event) {\n\t// Only consider note down events.\n\tif ev.Status&0xf0 != 0x90 {\n\t\treturn\n\t}\n\n\t// If the last note(s) played are recent enough, add this note\n\t// as a chord. 80ms is fairly arbitrarily chosen, but seems\n\t// to work pretty well.\n\tif len(c.notes) > 0 && ev.Timestamp-c.lastTime < 80 {\n\t\tlast := len(c.notes) - 1\n\t\tc.notes[last] = append(c.notes[last], Note(ev.Data1))\n\t} else {\n\t\t// Otherwise, this note starts a new chord.\n\t\tc.notes = append(c.notes, []Note{Note(ev.Data1)})\n\t}\n\tc.lastTime = ev.Timestamp\n\tc.idleCount = 0\n}", "title": "" }, { "docid": "1d35c53a8a382873e0344aca594fb7f9", "score": "0.5991432", "text": "func AddEvents(data []byte, sdkVersion string, machineIP string, machineName string) {\n\tevent := eventChanMessage{\n\t\tSdkVersion: sdkVersion,\n\t\tMachineIP: machineIP,\n\t\tMachineName: machineName,\n\t\tData: data,\n\t}\n\n\teventChannel <- event\n}", "title": "" }, { "docid": "849d335dcf11119d2c550204b4ba5408", "score": "0.59431547", "text": "func Event(channel string) broadcast.Broadcaster {\n\tb, ok := eventChannels[channel]\n\tif !ok {\n\t\tb = broadcast.NewBroadcaster(1)\n\t\teventChannels[channel] = b\n\t}\n\treturn b\n}", "title": "" }, { "docid": "96e97f6a4a2aae5c187ff5c10bb7a024", "score": "0.58363295", "text": "func (o *PluginCdpClient) OnEvent(msg string, a, b interface{}) {\n\n}", "title": "" }, { "docid": "e78e286d9d90bbf152b7af8b51092dd2", "score": "0.5807229", "text": "func (lp *LoadPoint) pushEvent(event string) {\n\tlp.pushChan <- push.Event{Event: event}\n}", "title": "" }, { "docid": "0254892740114a50c345cf711a5341fc", "score": "0.57236177", "text": "func (i *InfluxdbInterface) AddEvent(e *KlessEvent) error {\n\tfmt.Println(\"Entering AddEvent\")\n\n\t// Make client\n\tc, err := client.NewHTTPClient(client.HTTPConfig{\n\t\tAddr: influxdbAddress,\n\t})\n\n\tif err != nil {\n\t\tlog.Fatalln(\"Error: \", err)\n\t}\n\n\tfmt.Println(\"Connected\")\n\n\t// Create a new point batch\n\tbp, err := client.NewBatchPoints(client.BatchPointsConfig{\n\t\tDatabase: db,\n\t\tPrecision: \"ms\",\n\t})\n\n\tif err != nil {\n\t\tlog.Fatalln(\"Error: \", err)\n\t}\n\n\t// Create a point and add to batch\n\ttags := map[string]string{\"namespace\": e.Namespace, \"handler\": e.EventHandler, \"version\": e.Version, \"podname\": e.PodName}\n\tfields := map[string]interface{}{\n\t\t\"reqSize\": e.RequestSize,\n\t\t\"respSize\": e.ResponseSize,\n\t\t\"respTime\": e.ResponseTime,\n\t}\n\tpt, err := client.NewPoint(seriesName, tags, fields, time.Now())\n\n\tif err != nil {\n\t\tlog.Fatalln(\"Error: \", err)\n\t}\n\n\tbp.AddPoint(pt)\n\n\t// Write the batch\n\tc.Write(bp)\n\n\tfmt.Println(\"Leaving AddEvent\")\n\n\treturn nil\n}", "title": "" }, { "docid": "adcfe523a2e0a7a2f20e68ce6d4b9d48", "score": "0.5690037", "text": "func pushChangeEvent(event *ChangeEvent) {\n\t// if channel is null ,mean no listener,don't need to push msg\n\tif notifyChan == nil {\n\t\treturn\n\t}\n\n\tnotifyChan <- event\n}", "title": "" }, { "docid": "9cd75787dd4100ff0b37473406726def", "score": "0.567499", "text": "func (c IComm) PushEvent(event Event) {\n\tfor i := range c {\n\t\tif c[i].IsEnabled() && c[i].IsConnected() {\n\t\t\terr := c[i].PushEvent(event)\n\t\t\tif err != nil {\n\t\t\t\tlog.Errorf(\"Communications error - PushEvent() in package %s with %v\",\n\t\t\t\t\tc[i].GetName(), event)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f9c9aef2e9781dcc7fb7e19e8e42cbc2", "score": "0.56705344", "text": "func (b *eventsBroker) addClient(uuid string, messageChan eventsBrokerSubscribe) {\n\tb.mutex.Lock()\n\tdefer b.mutex.Unlock()\n\tb.clients[uuid] = messageChan\n}", "title": "" }, { "docid": "3a1a429d9da48942e4ba74d6f4e48c0c", "score": "0.56626755", "text": "func (t *TopicEventHandler) addToEventLog(evt PeerEvent) {\n\te, ok := t.evtLog[evt.Peer]\n\tif !ok {\n\t\tt.evtLog[evt.Peer] = evt.Type\n\t\t// send signal that an event has been added to the event log\n\t\tselect {\n\t\tcase t.evtLogCh <- struct{}{}:\n\t\tdefault:\n\t\t}\n\t} else if e != evt.Type {\n\t\tdelete(t.evtLog, evt.Peer)\n\t}\n}", "title": "" }, { "docid": "648c7bb1de544f7dc3553d72c7f47d88", "score": "0.5640598", "text": "func (eventReceiver *secretEventReceiver) addClient(client chan SecretEvent) {\n\teventReceiver.clients = append(eventReceiver.clients, client)\n}", "title": "" }, { "docid": "cb5dbc1518cee886260c54ea519a757b", "score": "0.56388503", "text": "func (c *Chronograph) AddEvent(t time.Duration) {\n\tc.Lock()\n\tc.Timeslices = append(c.Timeslices, t)\n\tc.Count = c.Count + 1\n\tc.Unlock()\n}", "title": "" }, { "docid": "d3aa9bd7c4c5b3ae0c92f6baeee9cf2e", "score": "0.56015533", "text": "func (eventReceiver *serviceEventReceiver) addClient(client chan ServiceEvent) {\n\teventReceiver.clients = append(eventReceiver.clients, client)\n}", "title": "" }, { "docid": "89d2a68ef83a53df5aee2f3461a49a14", "score": "0.5574953", "text": "func newEvent() chan struct{} {\n\treturn make(chan struct{}, eventbufsiz)\n}", "title": "" }, { "docid": "0ff6befd6394ff4ae2601eea4f142a29", "score": "0.5573104", "text": "func (t *Track) AddEvent(event Event) error {\n\n\t//check nil\n\tif event == nil {\n\t\treturn &MidiError{\"Try to add nil event\"}\n\t}\n\n\t//add event\n\tt.eventsList.PushBack(event)\n\n\treturn nil\n}", "title": "" }, { "docid": "79a7683797e11cd53135cc489c85337a", "score": "0.5569435", "text": "func (s *subscriber) event(ev terminalapi.Event) {\n\tif len(s.filter) == 0 {\n\t\ts.queue.Push(ev)\n\t}\n\n\tt := reflect.TypeOf(ev)\n\tif s.filter[t] {\n\t\ts.queue.Push(ev)\n\t}\n}", "title": "" }, { "docid": "154c87ff3c361951fbd4ab13486eacc9", "score": "0.55193347", "text": "func (r *ec2Instances) AddEventListener(filter int) EventCh {\n\t// step: make a buffered channel for them\n\tch := make(EventCh, 10)\n\tglog.V(4).Infof(\"Adding a event listner, channel: %v, filter: %d, filters: %s\", ch, filter, r.filterToString(filter))\n\tr.listeners[ch] = filter\n\treturn ch\n}", "title": "" }, { "docid": "85c53d005eac89a7090d55fd165e0ef1", "score": "0.55177045", "text": "func (c *Conn) AddEventListener(ch chan<- Event, events ...EventCode) error {\n\tc.addEventListenerToMap(ch, events...)\n\t// If there is an error updating the events, remove what we just added\n\terr := c.sendSetEvents()\n\tif err != nil {\n\t\tc.removeEventListenerFromMap(ch, events...)\n\t}\n\treturn err\n}", "title": "" }, { "docid": "3857c50aea0879923586171aff62f02b", "score": "0.55053884", "text": "func (mock *DockerClient) AddEventListener(channel chan<- *docker.APIEvents) error {\n\tmock.eventListeners = append(mock.eventListeners, channel)\n\treturn nil\n}", "title": "" }, { "docid": "c31dee4539c9ecfbe5f288c9e5f7805e", "score": "0.5503831", "text": "func (eventReceiver *nodeEventReceiver) addClient(client chan NodeEvent) {\n\teventReceiver.clients = append(eventReceiver.clients, client)\n}", "title": "" }, { "docid": "d83b9abd617ccbd8afb76321e4fc13fd", "score": "0.5501245", "text": "func (app *Application) addSub(pk ProjectKey, ch Channel, c clientConn) error {\n\tchID := app.channelID(pk, ch)\n\tfirst, err := app.clients.addSub(chID, c)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif first {\n\t\treturn app.engine.subscribe(chID)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "791205cc65aa14528efcb6734ca41ada", "score": "0.5500147", "text": "func deliverEvent(event *Event) {\n\teventChan <- event\n}", "title": "" }, { "docid": "4a10768508f358712a93bf4bc5b31d41", "score": "0.54939306", "text": "func (eventReceiver *configMapEventReceiver) addClient(client chan ConfigMapEvent) {\n\teventReceiver.clients = append(eventReceiver.clients, client)\n}", "title": "" }, { "docid": "511557c817e7468efea2dc6cfe463689", "score": "0.5491718", "text": "func (u *User) addChannel(name string) {\n\tif u.InChannel(name) {\n\t\treturn\n\t}\n\n\tu.ChannelList = append(u.ChannelList, ToRFC1459(name))\n\tsort.Strings(u.ChannelList)\n\n\tu.Perms.set(name, Perms{})\n}", "title": "" }, { "docid": "bd22d3bea17a5baa880f09a2cf821b0f", "score": "0.54848987", "text": "func (me *consumers) add(tag string, ch chan Delivery) {\n\tme.Lock()\n\tdefer me.Unlock()\n\n\tif prev, found := me.chans[tag]; found {\n\t\tclose(prev)\n\t}\n\n\tme.chans[tag] = ch\n}", "title": "" }, { "docid": "1aff24ce73746458adc50a49b65af4d4", "score": "0.54757524", "text": "func (eventReceiver *podEventReceiver) addClient(client chan PodEvent) {\n\teventReceiver.clients = append(eventReceiver.clients, client)\n}", "title": "" }, { "docid": "083f8118fafe8747ea32e27525959f5c", "score": "0.5475046", "text": "func (eventReceiver *persistentVolumeEventReceiver) addClient(client chan PersistentVolumeEvent) {\n\teventReceiver.clients = append(eventReceiver.clients, client)\n}", "title": "" }, { "docid": "ee12cadd2a1d17cd03b7cc402a41d819", "score": "0.547355", "text": "func (el *EventLoop) AddEvent(event Event) {\n\t// TODO: consider making it possible to register as an event handler for a specific kind of event.\n\t// We could also have two types of handlers that run at different times.\n\t// For example, the blockchain should process events at the time that they arrive.\n\t// On the other hand, the consensus algorithm must wait until the event is at the front of the queue.\n\t// It should also be possible to \"consume\" an event such that it is not added to the event queue,\n\t// for example if we were unable to verify a signature.\n\n\t// We let the blockchain process the event first, if it is able to, so that it may store blocks early.\n\t// This could help avoid unnecessarily making fetch requests when blocks arrive out of order.\n\tif ep, ok := el.mod.BlockChain().(EventProcessor); ok {\n\t\tep.ProcessEvent(event)\n\t}\n\tel.eventQ <- event\n}", "title": "" }, { "docid": "7bb9e3e8821f64441b1e7333d415cda2", "score": "0.5471993", "text": "func PushEvent(e *Event) {\n\t//special processing for certain IDs\n\tswitch e.ID {\n\tcase EV_UPDATE_UI:\n\t\tif uiEvents[e.Message] {\n\t\t\treturn\n\t\t}\n\t\tuiEvents[e.Message] = true\n\t}\n\n\tif internalEvent[e.ID] {\n\t\taddEvent(e, eventStreamInternal)\n\t} else {\n\t\taddEvent(e, eventStream)\n\t}\n}", "title": "" }, { "docid": "e491b99e9a335608f4f052c3d303158e", "score": "0.5465499", "text": "func (repo *ChannelRepository) AddChannelEvent(appID string, channelID string, event *core.ChannelEvent) error {\n\n\tstmt, err := repo.dbHolder.db.Prepare(addChannelEventSQL)\n\n\tif err != nil {\n\t\t_, _ = fmt.Fprintf(os.Stderr, \"AddChannelEvent: preparing statement failed: %v\\n\", err)\n\t\treturn err\n\t}\n\n\t_, err = stmt.Exec(event.SenderID, event.EventType, event.Payload, channelID, appID, event.Timestamp)\n\n\tif err != nil {\n\t\t_, _ = fmt.Fprintf(os.Stderr, \"AddChannelEvent: statement execution failed: %v\\n\", err)\n\t\treturn err\n\t}\n\n\tdefer stmt.Close()\n\n\treturn nil\n}", "title": "" }, { "docid": "2858fd9111cbe0ee3c86ae6d65d1e539", "score": "0.54631925", "text": "func (sender *Sender) add(event analyticsEvent) bool {\n\tif event.eventCollection == \"\" {\n\t\t// nil event, don't add\n\t\treturn false\n\t}\n\tsender.events[event.eventCollection] = append(sender.events[event.eventCollection], event.data)\n\tsender.count++\n\n\tif sender.count > send_threshold {\n\t\tsender.send()\n\t}\n\treturn true\n}", "title": "" }, { "docid": "6df244c5ea20d7877df9d859e558e11e", "score": "0.5445646", "text": "func (m *ChannelManager) Add(ch *serverSecureChannel) error {\n\tm.Lock()\n\tm.channelsByID[ch.channelID] = ch\n\tm.Unlock()\n\treturn nil\n}", "title": "" }, { "docid": "f625608e9a71f160c35a8fb316df09e8", "score": "0.5440371", "text": "func (n *server) SubscribeEvent(chanBuffer int, messages ...interface{}) (outch chan P2PMessage, err error) {\n\tif chanBuffer > 0 {\n\t\toutch = make(chan P2PMessage, chanBuffer)\n\t} else {\n\t\toutch = make(chan P2PMessage)\n\t}\n\tfor _, m := range messages {\n\t\tn.subscribe <- subscription{reflect.TypeOf(m).String(), outch}\n\t}\n\treturn\n}", "title": "" }, { "docid": "c7a0d71d9c1da9df4f50032686c8ad85", "score": "0.5438588", "text": "func subscribeChannel(socket *websocket.Conn) {\n\t// rethinkDB Query / changefeed\n\tfor {\n\t\t// pause for one second in for loop\n\t\ttime.Sleep(time.Second * 1)\n\t\t// construct a new message and encode to JSON\n\t\tmsg := Message{\"channel add\",\n\t\t\tChannel{\"1\", \"software support\"}}\n\t\tsocket.WriteJSON(msg)\n\t\tfmt.Println(\"sent new channel\")\n\t}\n}", "title": "" }, { "docid": "800a7f149cf9694d3bd267e09cb6a22e", "score": "0.54113406", "text": "func (eventReceiver *daemonSetEventReceiver) addClient(client chan DaemonSetEvent) {\n\teventReceiver.clients = append(eventReceiver.clients, client)\n}", "title": "" }, { "docid": "65c23cbf6b53adf490d4daf5b7ea64b1", "score": "0.53956324", "text": "func (eventReceiver *roleEventReceiver) addClient(client chan RoleEvent) {\n\teventReceiver.clients = append(eventReceiver.clients, client)\n}", "title": "" }, { "docid": "69bbbc8fe2856c02152b46d98fffd15f", "score": "0.53950024", "text": "func (m *Manager) broadcastEvent(e keyboard.ButtonEvent) {\n\tfor _, c := range m.consumers {\n\t\tc <- e\n\t}\n}", "title": "" }, { "docid": "04ed35f938b57036b4a2781bcf5add29", "score": "0.53738934", "text": "func (eventReceiver *namespaceEventReceiver) addClient(client chan NamespaceEvent) {\n\teventReceiver.clients = append(eventReceiver.clients, client)\n}", "title": "" }, { "docid": "f04914fbc2be16bc6c57ffccb99f9cc0", "score": "0.53735673", "text": "func (a *App) AddEvent(ctx *fasthttp.RequestCtx) {\n\te := new(models.Event)\n\terr := jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal(ctx.Request.Body(), e)\n\tif err != nil {\n\t\tctx.Error(errors.WithMessage(err, \"invalid input\").Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\tif err = e.Validate(nil); err != nil {\n\t\tctx.Error(errors.WithMessage(err, \"invalid input\").Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\tif err = a.redis.AddEvent(e); err != nil {\n\t\tlogrus.WithError(err).Error(\"failed to save event into cache\")\n\t\tctx.Error(\"failed to save event\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\ta.wp.Submit(func() {\n\t\tb, _ := jsoniter.MarshalToString(e.Params)\n\t\ta.events <- []string{e.EventType, strconv.Itoa(int(*e.Ts)), b}\n\t})\n\tctx.SetStatusCode(fasthttp.StatusAccepted)\n}", "title": "" }, { "docid": "5931e662b591b428accfe1a11994ec80", "score": "0.5373422", "text": "func (queue *EventQueue) AddEvent(evt Event) {\n\tqueue.events = append(queue.events, evt)\n}", "title": "" }, { "docid": "817e03ab1bc298250f2d4405e36bc59e", "score": "0.5364845", "text": "func (s *ServiceEngine) AddOutputChannel(o chan interface{}, desc string) error {\n env.Output.WriteChDebug(\"(ServiceEngine::AddOutputChannel)\")\n\n channels := s.GetOutputChannels()\n if _, exist := channels[o]; !exist {\n channels[o] = desc\n } else {\n return errors.New(\"(ServiceEngine::AddOutputChannel) You are trying to add an existing channel\")\n }\n\n return nil\n}", "title": "" }, { "docid": "0dbee8d7073399e1ac90eefcbb0fd62b", "score": "0.53583384", "text": "func (sw *SignalFxWriter) EventChannel() chan<- *event.Event {\n\tif sw.dpChan == nil {\n\t\tpanic(\"You must call Configure on the writer before getting the event channel\")\n\t}\n\treturn sw.eventChan\n}", "title": "" }, { "docid": "8b5b899d10082d6eee2be2b5c2f419ad", "score": "0.5340552", "text": "func (h *subHub) add(chID ChannelID, c clientConn) error {\n\th.Lock()\n\tdefer h.Unlock()\n\n\tuid := c.uid()\n\n\t_, ok := h.subs[chID]\n\tif !ok {\n\t\th.subs[chID] = make(map[ConnID]clientConn)\n\t}\n\th.subs[chID][uid] = c\n\treturn nil\n}", "title": "" }, { "docid": "36131d658474ec31c40d1014f4563b33", "score": "0.53348553", "text": "func (eventReceiver *cronJobEventReceiver) addClient(client chan CronJobEvent) {\n\teventReceiver.clients = append(eventReceiver.clients, client)\n}", "title": "" }, { "docid": "731fb829b631006e9846e7cfc28a0b23", "score": "0.53247595", "text": "func (eventReceiver *serviceAccountEventReceiver) addClient(client chan ServiceAccountEvent) {\n\teventReceiver.clients = append(eventReceiver.clients, client)\n}", "title": "" }, { "docid": "70c0e4960bd088f2d5a102c5eb5e7fa2", "score": "0.53214", "text": "func (eventReceiver *deploymentEventReceiver) addClient(client chan DeploymentEvent) {\n\teventReceiver.clients = append(eventReceiver.clients, client)\n}", "title": "" }, { "docid": "d7653c11015890aefd99e7b48a6d6110", "score": "0.5320882", "text": "func (ic *Config) Event2Channel(s, c int) *Config {\n\tic.ev2chan[byte(s % nEvents)] = byte(c % nChannels)\n\treturn ic\n}", "title": "" }, { "docid": "730dbce2001f1e665ada7472840734e6", "score": "0.5319767", "text": "func (eventReceiver *storageClassEventReceiver) addClient(client chan StorageClassEvent) {\n\teventReceiver.clients = append(eventReceiver.clients, client)\n}", "title": "" }, { "docid": "cc5df59c7dd918fa8b5964d5109ad5c2", "score": "0.5317028", "text": "func (d *dogstatsd) event(level EventLevel, title, text, source, aggregation string, low bool, tags ...string) {\n\tev := datadog.NewEvent(title, text)\n\tswitch level {\n\tcase Success:\n\t\tev.AlertType = datadog.Success\n\tcase Warning:\n\t\tev.AlertType = datadog.Warning\n\tcase Error:\n\t\tev.AlertType = datadog.Error\n\tcase Info:\n\t\tev.AlertType = datadog.Info\n\t}\n\n\tif aggregation != \"\" {\n\t\tev.AggregationKey = aggregation\n\t}\n\n\tif source != \"\" {\n\t\tev.SourceTypeName = source\n\t}\n\n\tif low {\n\t\tev.Priority = datadog.Low\n\t}\n\n\tif len(tags) == 0 {\n\t\ttags = []string{d.ns}\n\t} else {\n\t\ttags = append(tags, d.ns)\n\t}\n\n\tev.Tags = tags\n\n\tif err := d.a.Event(ev); err != nil {\n\t\tlog.Printf(\"Unable to send stats event: %s\", err)\n\t}\n}", "title": "" }, { "docid": "81e3c10b56f56d85c0f6f54d97c4c150", "score": "0.5317004", "text": "func (e *Event) AddEvent(event msg.Event) {\n\tif len(e.Events) == 0 {\n\t\te.Events = make([]msg.Event, 0)\n\t}\n\te.Events = append(e.Events, event)\n}", "title": "" }, { "docid": "21111bc9bfec9b3a06a5128a559ab171", "score": "0.53150934", "text": "func (t *Telegram) PushEvent(event base.Event) error {\n\tif !t.Connected {\n\t\treturn ErrNotConnected\n\t}\n\n\tmsg := fmt.Sprintf(\"Type: %s Message: %s\",\n\t\tevent.Type, event.Message)\n\n\tvar errors error\n\tfor user, ID := range t.AuthorisedClients {\n\t\tif ID == 0 {\n\t\t\tlog.Warnf(log.CommunicationMgr, \"Telegram: Unable to send message to %s as their ID isn't set. A user must issue any supported command to begin a session.\\n\", user)\n\t\t\tcontinue\n\t\t}\n\t\tif err := t.SendMessage(msg, ID); err != nil {\n\t\t\terrors = common.AppendError(errors, err)\n\t\t}\n\t}\n\treturn errors\n}", "title": "" }, { "docid": "cfee8699ce2ae499b7a6d5b9009aac61", "score": "0.530643", "text": "func (b *Broadcast) Event(e Event) {\n\tgo func() {\n\t\tb.EventChan <- e\n\t\treturn\n\t}()\n}", "title": "" }, { "docid": "baf0f6bcbd5c403fa174409ca5499497", "score": "0.5305722", "text": "func (eventReceiver *jobEventReceiver) addClient(client chan JobEvent) {\n\teventReceiver.clients = append(eventReceiver.clients, client)\n}", "title": "" }, { "docid": "9ffc6b857f605b9539712ad5ef9b84fa", "score": "0.529977", "text": "func (sg *streamGroup) addEvent(ctx context.Context, id string, event *events.Performance) error {\n\tsg.mu.Lock()\n\tdefer sg.mu.Unlock()\n\n\tstream, ok := sg.streams[id]\n\tif !ok {\n\t\treturn errors.Errorf(\"stream '%s' does not exist in this stream group\", id)\n\t}\n\tif stream.closed {\n\t\treturn errors.Errorf(\"stream '%s' already closed\", id)\n\t}\n\n\tif stream.inHeap {\n\t\tstream.buffer.PushBack(event)\n\t\treturn nil\n\t}\n\tsg.eventHeap.SafePush(&performanceHeapItem{id: id, event: event})\n\tstream.inHeap = true\n\n\treturn errors.Wrap(sg.flush(), \"flushing to collector\")\n}", "title": "" }, { "docid": "884350c8b1d01635636f4bc786cd291a", "score": "0.5297346", "text": "func voiceEvents(s *discordgo.Session, e *discordgo.VoiceStateUpdate) {\n\t// Check for pending events\n\tguildChan, ok := eventChan[e.GuildID]\n\tif !ok {\n\t\tguildChan = make(chan int, 1)\n\t\teventChan[e.GuildID] = guildChan\n\t}\n\tselect {\n\tcase guildChan <- 1: // Put 1 in the channel unless it is full\n\tdefault:\n\t\t// Event pending, return\n\t\treturn\n\t}\n\tdefer func() { <-guildChan }()\n\n\t// Sleep to avoid spam\n\tif cfg.EventSpacing > 0 {\n\t\ttime.Sleep(time.Second * time.Duration(cfg.EventSpacing))\n\t}\n\n\t// Get a guild from state\n\tguild, err := s.Guild(e.GuildID)\n\tif err != nil {\n\t\tlog.Print(\"guild not found in state\")\n\t\treturn\n\t}\n\n\t// Update guild in state\n\terr = s.State.GuildAdd(guild)\n\tif err != nil {\n\t\tlog.Print(\"failed to update guild in state\")\n\t\treturn\n\t}\n\n\tguild, _ = s.State.Guild(e.GuildID)\n\n\t// Map to store member count per channel\n\tvar validChannels map[string][]*discordgo.Channel = make(map[string][]*discordgo.Channel)\n\n\t// Enebled cats\n\tvar enabledCats []string = database.GetGuildCategories(e.GuildID)\n\n\t// Valid channel IDs\n\tvar validNames map[string]map[int]bool = make(map[string]map[int]bool)\n\n\t// Channel name template\n\tvar nameTemplate map[string]string = make(map[string]string)\n\n\t// Channel name template\n\tvar userLimit map[string]int = make(map[string]int)\n\n\t// Get a list of channels\n\tfor _, channel := range guild.Channels {\n\t\t// Check type and cetegory ID\n\t\tif channel.Type != discordgo.ChannelTypeGuildVoice || !utils.StringInSlice(channel.ParentID, enabledCats) {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Check if channel is added already\n\t\tvar skip bool\n\t\tfor _, c := range validChannels[channel.ParentID] {\n\t\t\tif c.ID == channel.ID {\n\t\t\t\tskip = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif !skip {\n\t\t\t// Set ID as taken\n\t\t\tvar sep string = \"#\"\n\t\t\tnameSlice := strings.Split(channel.Name, sep)\n\t\t\tif len(nameSlice) == 1 {\n\t\t\t\tsep = \" \"\n\t\t\t\tnameSlice = strings.Split(channel.Name, sep)\n\t\t\t}\n\t\t\tchannelNum, _ := strconv.Atoi(nameSlice[len(nameSlice)-1])\n\n\t\t\t// Set number as used\n\t\t\t_, ok := validNames[channel.ParentID]\n\t\t\tif !ok {\n\t\t\t\tvalidNames[channel.ParentID] = make(map[int]bool)\n\t\t\t}\n\t\t\tvalidNames[channel.ParentID][channelNum] = true\n\n\t\t\t// Set name template\n\t\t\tif nameTemplate[channel.ParentID] == \"\" {\n\t\t\t\tnameTemplate[channel.ParentID] = nameSlice[0] + sep\n\t\t\t}\n\n\t\t\t// Set user limit\n\t\t\tif channel.UserLimit > userLimit[channel.ParentID] {\n\t\t\t\tuserLimit[channel.ParentID] = channel.UserLimit\n\t\t\t}\n\n\t\t\t// Save channel data\n\t\t\tvalidChannels[channel.ParentID] = append(validChannels[channel.ParentID], channel)\n\t\t}\n\t}\n\n\t// Find empty channels\n\tfor _, state := range guild.VoiceStates {\n\t\t// Get channel\n\t\tchannel, err := s.Channel(e.ChannelID)\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Check if channel is in a right cat\n\t\tif !utils.StringInSlice(channel.ParentID, enabledCats) {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Get category channels\n\t\tcatChannels, ok := validChannels[channel.ParentID]\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Pop channel from list\n\t\tfor i, c := range catChannels {\n\t\t\tif c.ID == state.ChannelID {\n\t\t\t\tvalidChannels[channel.ParentID] = append(catChannels[:i], catChannels[i+1:]...)\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check if channels need to be added or deleted\n\tfor cat, emptyChannels := range validChannels {\n\t\t// Sleep to avoid spamming Discord API with requests\n\t\ttime.Sleep(time.Second)\n\n\t\t// Sort channels by position\n\t\temptyChannels = utils.QuickSort(emptyChannels)\n\n\t\t// Delete extra channels\n\t\tif len(emptyChannels) > cfg.ChannelsBuff {\n\t\t\tfor i := len(emptyChannels) - 1; i >= (cfg.ChannelsBuff); i-- {\n\t\t\t\t// Delete channel\n\t\t\t\t_, err := s.ChannelDelete(emptyChannels[i].ID)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Printf(\"failed to delete a channel: %v\", err)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\t// Add free channels\n\t\tif len(emptyChannels) < cfg.ChannelsBuff {\n\t\t\tfor i := 0; i < (cfg.ChannelsBuff - len(emptyChannels)); i++ {\n\t\t\t\t// Find next available id\n\t\t\t\tvar channelID int\n\t\t\t\tfor i := 1; true; i++ {\n\t\t\t\t\tif !validNames[cat][i] {\n\t\t\t\t\t\tchannelID = i\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Create a channel\n\t\t\t\tvar chanData discordgo.GuildChannelCreateData\n\n\t\t\t\tif cfg.UserLimit > 0 { // User Limit set in config\n\t\t\t\t\tchanData.UserLimit = cfg.UserLimit\n\t\t\t\t} else { // Limit based on category\n\t\t\t\t\tchanData.UserLimit = userLimit[cat]\n\t\t\t\t}\n\n\t\t\t\tchanData.Name = fmt.Sprintf(\"%v%v\", nameTemplate[cat], channelID)\n\t\t\t\tchanData.Type = discordgo.ChannelTypeGuildVoice\n\t\t\t\tchanData.ParentID = cat\n\n\t\t\t\t_, err := s.GuildChannelCreateComplex(e.GuildID, chanData)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Printf(\"failed to create a channel: %v\", err)\n\t\t\t\t}\n\t\t\t\tvalidNames[cat][channelID] = true\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t}\n}", "title": "" }, { "docid": "fd3e6db199d7089a29355a4fd403a8ee", "score": "0.52881765", "text": "func (this *Channel) ClientEvent(socket socketio.Socket, data types.Data) {\n\tif data.Event != \"\" && data.Channel != \"\" {\n\t\tif this.IsClientEvent(data.Event) &&\n\t\t\tthis.IsPrivate(data.Channel) &&\n\t\t\tthis.IsInChannel(socket, data.Channel) {\n\t\t\tsocket.BroadcastTo(data.Channel, data.Event, data.Channel, data.Data)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "18bab9f2db10066332408f8b5f994f1d", "score": "0.5283062", "text": "func NewEventChannel(application, service, module string) EventChannel {\n\n\tapplication = strings.ReplaceAll(strings.ToLower(application), `.`, ``)\n\tservice = strings.ReplaceAll(strings.ToLower(service), `.`, ``)\n\tmodule = strings.ReplaceAll(strings.ToLower(module), `.`, ``)\n\n\treturn EventChannel{\n\t\tApplication: application,\n\t\tService: service,\n\t\tModule: module,\n\t}\n}", "title": "" }, { "docid": "c075d2f98d28a57b01837027c7aa8179", "score": "0.5270628", "text": "func (p *BeersPlugin) Event(kind string, message bot.Message) bool {\n\treturn false\n}", "title": "" }, { "docid": "0b1923daf3227b3204c5a689197dca5c", "score": "0.5258956", "text": "func (eventReceiver *statefulSetEventReceiver) addClient(client chan StatefulSetEvent) {\n\teventReceiver.clients = append(eventReceiver.clients, client)\n}", "title": "" }, { "docid": "49225cb0c226d34baf769c97caf8cc45", "score": "0.52383626", "text": "func (e *event) send() {\n\tUdevEventMessageChannel <- e.eventDetails\n}", "title": "" }, { "docid": "8250407990665c9375b0993d5b855e0e", "score": "0.52346617", "text": "func (eventReceiver *clusterRoleEventReceiver) addClient(client chan ClusterRoleEvent) {\n\teventReceiver.clients = append(eventReceiver.clients, client)\n}", "title": "" }, { "docid": "a0d7b64503c9ba347326bd860b9e47b2", "score": "0.52214396", "text": "func (c *channelLogWriter) addChannelLog(log *channels.ChangeLog) {\n\tc.io <- &changeEntry{replacementLog: log}\n}", "title": "" }, { "docid": "cd3398749c6641c92b2abe4d36910107", "score": "0.52195984", "text": "func (f *RaceFreeFakeWatcher) Add(obj runtime.Object) {\n\tf.Lock()\n\tdefer f.Unlock()\n\tif !f.Stopped {\n\t\tselect {\n\t\tcase f.result <- Event{Added, obj}:\n\t\t\treturn\n\t\tdefault:\n\t\t\tpanic(fmt.Errorf(\"channel full\"))\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0d85cb53543ae02d3e128d4ab5dba78a", "score": "0.5219548", "text": "func (NoOpEventRecorder) Event(object runtime.Object, eventtype, reason, message string) {\n}", "title": "" }, { "docid": "0f9da0ba745de064f273561a8106a62f", "score": "0.5212097", "text": "func ChannelJoinEvent(p *Player, Data []byte) {\n\ts := ReadStringNPos(Data)\n\tif s == \"\" || s[0] != '#' {\n\t\treturn\n\t}\n\tif c := FindChannel(s); c.PlayerJoin(p) {\n\t\tp.Queue.WritePacket(64, s)\n\t\tfmt.Printf(\"%s joined %s[%d]\\n\", p.Username, s, c.Users())\n\t\tfor i := 0; i < len(Players); i++ {\n\t\t\tif Players[i].Bot || (c.AdminRead && !p.IsAdmin()) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tPlayers[i].Queue.WritePacket(65, c.Name, c.Topic, c.Users())\n\t\t}\n\t\treturn\n\t}\n\tp.Queue.WritePacket(66, s)\n}", "title": "" }, { "docid": "c99afd3e7e10ca5afe5302c6f722fc19", "score": "0.52096987", "text": "func (eventReceiver *networkPolicyEventReceiver) addClient(client chan NetworkPolicyEvent) {\n\teventReceiver.clients = append(eventReceiver.clients, client)\n}", "title": "" }, { "docid": "c1b435567f06311581b6fc4e6becd6c1", "score": "0.5208787", "text": "func (ui *UI) addChannel(channel *discordgo.Channel, selected bool) {\n\tif ui.CurrentGuild == \"\" || ui.CurrentGuild != channel.GuildID {\n\t\treturn\n\t}\n\n\titem, _ := gtk.ListBoxRowNew()\n\tl, _ := gtk.LabelNew(\"#\" + channel.Name)\n\tl.SetJustify(gtk.JUSTIFY_LEFT)\n\tl.SetHAlign(gtk.ALIGN_START)\n\titem.Add(l)\n\n\titem.ShowAll()\n\n\tui.Channels.List.Add(item)\n\tui.channelRows[item.GetIndex()] = channel.ID\n\tif selected {\n\t\tui.Channels.List.SelectRow(item)\n\t}\n}", "title": "" }, { "docid": "37fd997d8161a3acc060f0b22ab5e5b0", "score": "0.51964843", "text": "func (c *CommandSet) AddEvent(event IEvent) {\n\tc.events = append(c.events, event)\n\tc.eventsByName[event.Name()] = event\n}", "title": "" }, { "docid": "0ceb66992e2e2d938c9e07f22ac880e7", "score": "0.5192307", "text": "func (b *Broker) Add(c chan []byte) {\n\tb.clients[c] = true\n\tlog.Println(\"Added new client:\", c)\n}", "title": "" }, { "docid": "d10e158cedc5b039bc68b9c2987bb8b2", "score": "0.5191864", "text": "func (w *Widget) AddEvents(events int) {\r\n\tw.Candy().Guify(\"gtk_widget_add_events\", w, events)\r\n}", "title": "" }, { "docid": "c65a1b2ad3fc9e0e27da9eeeae4648cb", "score": "0.5191615", "text": "func (c *Client) RegisterChaincodeEvent(ccid, eventName string) (fab.Registration, <-chan *fab.CCEvent, error) {\n\treturn c.cc.RegisterChaincodeEvent(ccid, eventName)\n}", "title": "" }, { "docid": "c65a1b2ad3fc9e0e27da9eeeae4648cb", "score": "0.5191615", "text": "func (c *Client) RegisterChaincodeEvent(ccid, eventName string) (fab.Registration, <-chan *fab.CCEvent, error) {\n\treturn c.cc.RegisterChaincodeEvent(ccid, eventName)\n}", "title": "" }, { "docid": "a45693032e2682b1b87b99afa511920a", "score": "0.5178962", "text": "func (_this *Connection) AddEventMessage(listener func(event *channel.MessageEvent, currentTarget *Connection)) js.Func {\n\tcb := eventFuncConnection_channel_MessageEvent(listener)\n\t_this.Value_JS.Call(\"addEventListener\", \"message\", cb)\n\treturn cb\n}", "title": "" }, { "docid": "5638e2ceb56feb7977d66a078ec4b5a4", "score": "0.51750356", "text": "func AddEvent(w http.ResponseWriter, r *http.Request) {\n\tctx := appengine.NewContext(r)\n\n\t// Set the timestamps\n\tat := time.Now()\n\tconst timeformat = \"2006-01-02 15:04:05 -0700\"\n\tst, _ := time.Parse(timeformat, r.FormValue(\"start_time\"))\n\tet, _ := time.Parse(timeformat, r.FormValue(\"end_time\"))\n\tdt, _ := time.Parse(timeformat, r.FormValue(\"door_time\"))\n\n\t// Create the event object\n\te1 := Event{\n\t\tStartDate: st,\n\t\tEndDate: et,\n\t\tDateAdded: at,\n\t\tDoorTime: dt,\n\t\tName: r.FormValue(\"headline\"),\n\t\tDescription: r.FormValue(\"description\"),\n\t\tURL: r.FormValue(\"event_url\"),\n\t\tImage: r.FormValue(\"poster_file\"),\n\t}\n\n\t// Load the Venue Key\n\tif len(r.FormValue(\"venue\")) > 0 {\n\t\tvenue, err := datastore.DecodeKey(r.FormValue(\"venue\"))\n\t\tfmt.Fprintf(w,\"%+v\",venue)\n\t\tif err != nil {\n\t\t\tJSONError(&w, err.Error())\n\t\t\treturn\n\t\t}\n\t\te1.Venue = venue\n\t}\n\n\t// Load the Promoter Key\n\tif len(r.FormValue(\"promoter\")) > 0 {\n\t\tpromoter, err := datastore.DecodeKey(r.FormValue(\"promoter\"))\n\t\tif err != nil {\n\t\t\tJSONError(&w, err.Error())\n\t\t\treturn\n\t\t}\n\t\te1.Promoter = promoter\n\t\tfmt.Fprintf(w,\"%+v\",e1)\n\t}\n\n\t// Add the event to the Datastore\n\tk, err := e1.Store(ctx)\n\tif err != nil {\n\t\tJSONError(&w, err.Error())\n\t\treturn\n\t}\n\n\te1.DatastoreKey = *k\n\treturn\n}", "title": "" }, { "docid": "99ee65544db714a1a6199956a00e04b0", "score": "0.51573324", "text": "func InsertChannelClient(context appengine.Context, eventId, userId string) error {\n\t// Create key for given event\n\tkey := datastore.NewKey(context, \"Channels\", eventId, 0, nil)\n\treturn datastore.RunInTransaction(context, func(context appengine.Context) error {\n\t\tevent := new(Event)\n\t\t// Get the datastore entity for the given key\n\t\terr := datastore.Get(context, key, event)\n\t\tif err != nil && err != datastore.ErrNoSuchEntity {\n\t\t\tcontext.Errorf(\"db > channel.go > InsertChannelClient > datastore.Get(): %v\", err)\n\t\t\treturn err\n\t\t}\n\t\t// If there is no entity in the datastore for the given event, we have to insert the event id too\n\t\tif err == datastore.ErrNoSuchEntity {\n\t\t\tevent.EventId = eventId\n\t\t}\n\t\t// Append new client to the event\n\t\tevent.Clients = append(event.Clients, userId+\"-\"+eventId)\n\t\t// Put it into the datastore\n\t\t_, err = datastore.Put(context, key, event)\n\t\tif err != nil {\n\t\t\tcontext.Errorf(\"db > channel.go > InsertChannelClient > datastore.Put(): %v\", err)\n\t\t}\n\t\treturn err\n\t}, nil)\n}", "title": "" }, { "docid": "d1f04c313d02ade57811a1103ae72a46", "score": "0.51520336", "text": "func (c *CatchupSubscriberManager) processEvent(_ client.CatchUpSubscription, e *client.ResolvedEvent) error {\n\n\t// Get channels for event types, send it on.\n\tevent := e.Event()\n\n\tif event != nil {\n\t\tet := e.Event().EventType()\n\t\tchannelsToSend, ok := c.eventTypeChannelMap[et]\n\t\tif ok {\n\t\t\tfor _, ch := range channelsToSend {\n\t\t\t\tch <- *e\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "14c6e24d95f25ab23bbbbe02db1b963a", "score": "0.5149455", "text": "func (eventReceiver *persistentVolumeClaimEventReceiver) addClient(client chan PersistentVolumeClaimEvent) {\n\teventReceiver.clients = append(eventReceiver.clients, client)\n}", "title": "" }, { "docid": "ce6efa2535278df5ad4b86cd12be1f51", "score": "0.51464564", "text": "func (shared *InotifyTracker) sendEvent(event fsnotify.Event) {\n\tname := filepath.Clean(event.Name)\n\n\tshared.mux.Lock()\n\tch := shared.chans[name]\n\tdone := shared.done[name]\n\tshared.mux.Unlock()\n\n\tif ch != nil && done != nil {\n\t\tselect {\n\t\tcase ch <- event:\n\t\tcase <-done:\n\t\t}\n\t}\n}", "title": "" }, { "docid": "330d87c956c888d64f48fbc3dbbf7088", "score": "0.5139147", "text": "func pushEvent(event * C.SDL_Event) (int) { \n return int(C.SDL_PushEvent(event))\n}", "title": "" }, { "docid": "c659836b53f868f2348416865c608835", "score": "0.5137624", "text": "func (eventReceiver *nodeMetricsEventReceiver) addClient(client chan NodeMetricsEvent) {\n\teventReceiver.clients = append(eventReceiver.clients, client)\n}", "title": "" }, { "docid": "0583ab2489279365ccec301bf65a1651", "score": "0.51347595", "text": "func (bs *BasicSubscriber) register(s libts.Subscription) error {\n\t// create command for subscription\n\tr := libts.Request{\n\t\tServerID: bs.serverID,\n\t\tCommand: \"servernotifyregister\",\n\t\tArgs: map[string]interface{}{\n\t\t\t\"event\": s.Name,\n\t\t},\n\t}\n\tif s.Name == \"channel\" {\n\t\tr.Args[\"id\"] = s.ChannelID\n\t}\n\t// run command\n\t_, err := bs.query.DoRaw(r)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor i, v := range s.Events {\n\t\tbs.subscriptions.Add(i, &v) // override existing subscriptions and add new ones\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1629447006bd8460e1f6998831a34b42", "score": "0.51288", "text": "func (eventReceiver *podMetricsEventReceiver) addClient(client chan PodMetricsEvent) {\n\teventReceiver.clients = append(eventReceiver.clients, client)\n}", "title": "" }, { "docid": "4c2630c4202ffaecab77428b14251fc8", "score": "0.5126463", "text": "func (_this *Connection) AddEventConnect(listener func(event *domcore.Event, currentTarget *Connection)) js.Func {\n\tcb := eventFuncConnection_domcore_Event(listener)\n\t_this.Value_JS.Call(\"addEventListener\", \"connect\", cb)\n\treturn cb\n}", "title": "" }, { "docid": "1c728d2d03f5c079334625dd58a3350d", "score": "0.51225924", "text": "func (t *Tracker) sendEvent(event fsnotify.Event) {\n\tname := filepath.Clean(event.Name)\n\n\tt.mux.Lock()\n\tch := t.chans[name]\n\tdone := t.done[name]\n\tt.mux.Unlock()\n\n\tif ch != nil && done != nil {\n\t\tselect {\n\t\tcase ch <- event:\n\t\tcase <-done:\n\t\t}\n\t}\n}", "title": "" }, { "docid": "3a9dc0fddb491d517c388b18721f70b4", "score": "0.51225275", "text": "func (w *Watcher) AddEvent(obj interface{}) {\n\tdMeta, isObj := obj.(metav1.Object)\n\tif !isObj {\n\t\tglog.Errorf(\"Error casting to k8s metav1 object, new obj: %+v\", obj)\n\t\treturn\n\t}\n\n\t// ignore managedFields field\n\tif !options.IsWatchManagedFields {\n\t\tdMeta.SetManagedFields(nil)\n\t}\n\n\titem := types.NamespacedName{\n\t\tName: dMeta.GetName(),\n\t\tNamespace: dMeta.GetNamespace(),\n\t}\n\tw.eventQueue.Forget(item)\n\tw.eventQueue.Add(item)\n}", "title": "" }, { "docid": "cf7a2c9a5c68a4a5c8de8dac6b362a09", "score": "0.5117712", "text": "func (o *operation) add(l ...EventListener) {\n\to.mu.RLock()\n\tdefer o.mu.RUnlock()\n\tif o.disabled {\n\t\treturn\n\t}\n\tfor _, l := range l {\n\t\tif l == nil {\n\t\t\tcontinue\n\t\t}\n\t\tkey := l.ListenedType()\n\t\to.eventRegister.add(key, l)\n\t}\n}", "title": "" }, { "docid": "251f820ec52b7003aaa750ab8049cbca", "score": "0.5109142", "text": "func (es *EventStore) AddEvent(event Event) {\n\tes.Lock()\n\tdefer es.Unlock()\n\tes.events = append(es.events, event)\n\tlog.Printf(\"Now have %d events\", len(es.events))\n}", "title": "" }, { "docid": "89ed80c2d359546f70d8bf48cb77cb69", "score": "0.5105733", "text": "func (c *Client) EventSub(msg Configuration) error {\n\tc.mtx.Lock()\n\tdefer c.mtx.Unlock()\n\tif err := c.conn.WriteJSON(&msg); err != nil {\n\t\treturn err\n\t}\n\n\tvar out ConnectResponse\n\terr := c.conn.ReadJSON(&out)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif out.Status != \"ok\" {\n\t\treturn errors.Errorf(\"failed to create subscription reason:%v\", out.Reason)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "1190d59f7a2c08d5ee1260176a9dfc6d", "score": "0.5105102", "text": "func AddEvent(e *model.Event) {\n\tconn, err := sql.Open(DB_DRIVER, CONNECTION)\n\tErrorCheck(err)\n\tdefer conn.Close()\n\tCreateAndUseDB(DB_NAME, conn)\n\tInsertNewEvent(e.ApiKey, e, conn)\n}", "title": "" }, { "docid": "6a0d780c8041d1f9cce2b351529bc6c8", "score": "0.51017666", "text": "func PushEvent(mods ...string) JSONEvent {\n\treturn JSONEvent{Name: strcase.ToKebab(\"push\"), Targets: mods}\n}", "title": "" }, { "docid": "ec690b18bd269ec2f2a0e2901aa50c04", "score": "0.5101228", "text": "func (c *client) On(event string, f iwebsocket.MessageFunc) {\n\tif c.onEventListeners[event] == nil {\n\t\tc.onEventListeners[event] = make([]iwebsocket.MessageFunc, 0)\n\t}\n\n\tc.onEventListeners[event] = append(c.onEventListeners[event], f)\n}", "title": "" }, { "docid": "2a866815f7c55df797bbcef37bfbce66", "score": "0.5098064", "text": "func (r *EventSpooler) Add(event EventProcessor) {\n\tr.events = append(r.events, event)\n}", "title": "" }, { "docid": "43606842df9cce5dd80833de8283d997", "score": "0.5095996", "text": "func (client *Client) Subscribe(event EventType, handle Handle) {\n\tif client.events[event] == nil {\n\t\tclient.mutex.Lock()\n\t\tclient.events[event] = &Collection{subscriptions: []Handle{}}\n\t\tclient.mutex.Unlock()\n\t}\n\n\tclient.events[event].mutex.Lock()\n\tdefer client.events[event].mutex.Unlock()\n\n\tclient.events[event].subscriptions = append(client.events[event].subscriptions, handle)\n}", "title": "" }, { "docid": "64e504da7a5961a08bd521ceb7bf92ef", "score": "0.5094927", "text": "func (cricdClient *CricdESClient) PushEvent(event cricd.Delivery, dedupe bool) (string, error) {\n\n\te, err := json.Marshal(event)\n\tif err != nil {\n\t\t// Handle errors\n\t\tlog.WithFields(log.Fields{\"value\": err}).Error(\"Unable to marshal event to JSON\")\n\t\treturn \"\", err\n\t}\n\n\t// Store cache\n\tif dedupe == true {\n\t\tkeySHA := sha256.Sum256([]byte(e))\n\t\tkey := hex.EncodeToString(keySHA[:])\n\t\t_, found := c.Get(key)\n\t\tif found {\n\t\t\tlog.WithFields(log.Fields{\"value\": key}).Error(\"Event already received in the last 5 minutes\")\n\t\t\treturn \"\", fmt.Errorf(\"Received this event in the last 5 minutes\")\n\t\t}\n\t\t// In future we could just store nil here\n\t\tc.Set(key, &event, cache.DefaultExpiration)\n\t}\n\tuuid := es.NewUUID()\n\tmyESEvent := es.NewEvent(uuid, \"cricket_event\", event, nil)\n\n\t// Create a new StreamWriter\n\twriter := cricdClient.client.NewStreamWriter(cricdClient.eventStoreStreamName)\n\terr = writer.Append(nil, myESEvent)\n\tif err != nil {\n\t\t// Handle errors\n\t\tlog.WithFields(log.Fields{\"value\": err}).Error(\"Unable to push event to ES\")\n\t\treturn \"\", err\n\t}\n\n\treturn uuid, nil\n\n}", "title": "" }, { "docid": "e62201ca86e5dcb2acffc92c6092ca89", "score": "0.5086644", "text": "func (eventReceiver *roleBindingEventReceiver) addClient(client chan RoleBindingEvent) {\n\teventReceiver.clients = append(eventReceiver.clients, client)\n}", "title": "" }, { "docid": "e07980ba331137aa7cf390db93a07da0", "score": "0.50849247", "text": "func (h *Handler) AddEvent(pe *pbpod.PodEvent) error {\n\tif pe == nil {\n\t\treturn yarpcerrors.InvalidArgumentErrorf(\"podevent is nil\")\n\t}\n\th.metrics.AddEventAPI.Inc(1)\n\tlog.WithField(\"pod_event\", pe).Debug(\"Adding podevent to eventstream\")\n\n\titem, err := h.circularBuffer.AddItem(pe)\n\tif err != nil {\n\t\th.metrics.AddEventFail.Inc(1)\n\t\treturn err\n\t}\n\th.metrics.AddEventSuccess.Inc(1)\n\n\thead, tail := h.circularBuffer.GetRange()\n\th.metrics.Head.Update(float64(head))\n\th.metrics.Tail.Update(float64(tail))\n\th.metrics.Size.Update(float64(head - tail))\n\tlog.WithField(\"current_head\", item.SequenceID).Debug(\"Event added\")\n\treturn nil\n}", "title": "" }, { "docid": "b261bdb854dba072bbf21dcb0028fbb6", "score": "0.50823075", "text": "func AddEvent(w http.ResponseWriter, r *http.Request) {\n\tlog.Println(\"Calling Add event api\")\n\tvar Event model.Event\n\n\tbody, err := ioutil.ReadAll(r.Body)\n\tif err != nil {\n\t\tlog.Fatalln(\"Unable to read a data\")\n\t}\n\n\terr = json.Unmarshal(body, &Event)\n\n\t// call service to add an event and get response from service\n\tserviceResponse := service.AddEvent(Event)\n\t// writing a response\n\tlog.Println(\"sending a response after add an event\")\n\tjson.NewEncoder(w).Encode(serviceResponse)\n}", "title": "" }, { "docid": "14a9f6f1e3972fbbc789c820d30eb279", "score": "0.5079749", "text": "func SubscribeEvent(event string, callback CallbackType) {\n\tif observers[event] == nil {\n\t\tobservers[event] = make([]CallbackType, 0)\n\t}\n\tobservers[event] = append(observers[event], callback)\n}", "title": "" } ]
e354dfbd90c84a5817fa1acaa48d1fdd
The Droplet image ID or slug.
[ { "docid": "c2689c08f3aabbc570d96578ec2fa3f0", "score": "0.62629855", "text": "func (o GetDropletsDropletOutput) Image() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetDropletsDroplet) string { return v.Image }).(pulumi.StringOutput)\n}", "title": "" } ]
[ { "docid": "de41eef23e7eb698d8b08d2c6d1343f4", "score": "0.6946994", "text": "func (d *Droplet) ImageSlug() string {\n\tif _, ok := d.Image[\"slug\"]; ok {\n\t\tif attr, ok := d.Image[\"slug\"].(string); ok {\n\t\t\treturn attr\n\t\t}\n\t}\n\n\treturn \"\"\n}", "title": "" }, { "docid": "1a00632619539365df8658aed6c8fb5a", "score": "0.6644256", "text": "func (i *Image) ID() string {\n\treturn i.storageImage.ID\n}", "title": "" }, { "docid": "78aa1815bb58c8ac154d62c7345d71ef", "score": "0.6596066", "text": "func (s *StorageImage) PhotoID() string {\n\tname := s.ImageName\n\tif strings.HasPrefix(name, \"thumb_\") {\n\t\tname = name[len(\"thumb_\"):]\n\t}\n\treturn strings.TrimSuffix(name, filepath.Ext(name))\n}", "title": "" }, { "docid": "1bc2f56a9c6610abe754f8c65c2957e3", "score": "0.6482792", "text": "func (i *Info) ImageID() string {\n\treturn utils.TruncateID(i.ContainerImageID)\n}", "title": "" }, { "docid": "f0e1c85526594e5791d6b4c8986945ce", "score": "0.64004296", "text": "func (ctx *Context) ImageID() string {\n\treturn ctx.ContainerImageID[:12]\n}", "title": "" }, { "docid": "0870536ac8b6578ce1fe40b3d3e7f8b8", "score": "0.63940954", "text": "func (c *Container) ImageID() string {\n\treturn c.imgInfo.ID\n}", "title": "" }, { "docid": "b3efd952b6413796806f6ed52f994cff", "score": "0.6272246", "text": "func (o OceanOutput) ImageId() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *Ocean) pulumi.StringPtrOutput { return v.ImageId }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "18985736fc61b2fd6781f16d46061601", "score": "0.6266844", "text": "func (c Container) ImageID() string {\n\treturn c.imageInfo.ID\n}", "title": "" }, { "docid": "a495805d5020fc444087fee5574650e2", "score": "0.6181147", "text": "func (o VolumeV1Output) ImageId() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *VolumeV1) pulumi.StringPtrOutput { return v.ImageId }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "72e4bc787254a546e6e2710076e2e10d", "score": "0.6058465", "text": "func (entry ImgEntry) ID(_ *IDCounter) string {\n\treturn \"\"\n}", "title": "" }, { "docid": "286b7d05ed17515e5fb7ee1658d032f9", "score": "0.6037476", "text": "func ImageID(containerNameOrID string) (string, error) {\n\tlines, err := ImageInspect(containerNameOrID, \"{{ .Id }}\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif len(lines) != 1 {\n\t\treturn \"\", errors.Errorf(\"Docker image ID should only be one line, got %d lines\", len(lines))\n\t}\n\treturn lines[0], nil\n}", "title": "" }, { "docid": "9fb354f2d68456d51633413c020ea12d", "score": "0.599338", "text": "func (o *Object) ID() string {\n\treturn o.file.URL\n}", "title": "" }, { "docid": "d2a5a131e7489ec62a24c0bcf74a7e24", "score": "0.59781873", "text": "func (img *Image) ID() ID {\n\treturn img.computedID\n}", "title": "" }, { "docid": "33a9b01cedaa4bac9c487a52a3681ac1", "score": "0.5899706", "text": "func (i *Info) ImageFullID() string {\n\treturn i.ContainerImageID\n}", "title": "" }, { "docid": "1862e4f9a0638729899ba3483a0a9538", "score": "0.5859929", "text": "func (o LaunchConfigurationOutput) ImageId() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *LaunchConfiguration) pulumi.StringOutput { return v.ImageId }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "dc0970f7fcb4e4eb04678ef017e6b99b", "score": "0.5850701", "text": "func (d *DockerImage) ImageID() string {\n\treturn d.imageConfig.Config.Image\n}", "title": "" }, { "docid": "d038e18fb189b2954058d86d493f8d3f", "score": "0.5845201", "text": "func (this Gist) GetID() string { return this.ID }", "title": "" }, { "docid": "fd135515ddfcb170cfd0181383d8df97", "score": "0.5803505", "text": "func (ctx *Context) ImageFullID() string {\n\treturn ctx.ContainerImageID\n}", "title": "" }, { "docid": "8729413d101a6086bce16ac50b11f176", "score": "0.57863474", "text": "func (f *File) ID() string {\n\treturn f.FullURL\n}", "title": "" }, { "docid": "f02986a0e1045ae9cc67c0d916d25f85", "score": "0.5786178", "text": "func (o RemoteImageOutput) ImageId() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *RemoteImage) pulumi.StringOutput { return v.ImageId }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "0e467b2fab1dcc181a2ec7636fcbf20b", "score": "0.5679887", "text": "func (this ReleaseAsset) GetID() string { return this.ID }", "title": "" }, { "docid": "485597e6ff0b12c0ed09f54bc7a6d03a", "score": "0.56747854", "text": "func (o GetDropletsDropletOutput) Id() pulumi.IntOutput {\n\treturn o.ApplyT(func(v GetDropletsDroplet) int { return v.Id }).(pulumi.IntOutput)\n}", "title": "" }, { "docid": "07475ed05cd08d4b44ea45972743e8b5", "score": "0.5651033", "text": "func getImageID(name string) (string, error) {\n\tclient := getDockerClient()\n\timg, _, err := client.ImageInspectWithRaw(context.Background(), name)\n\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"Cannot find image %s\", name)\n\t}\n\timageID := img.ID\n\n\treturn imageID, nil\n}", "title": "" }, { "docid": "7e9586f186b8d7a3cf4ef4390c686d50", "score": "0.56504506", "text": "func (b *Build) GetImageID() string {\n\treturn b.state.ImageID\n}", "title": "" }, { "docid": "eea48b3eb4bdbe181be3d63fd78181d6", "score": "0.5645237", "text": "func (img contentAddressableDescriptor) ID() string {\n\treturn img.id\n}", "title": "" }, { "docid": "5fb2f16c83f7462e4ae5bd2538695663", "score": "0.5591795", "text": "func dropletHref(id int) string {\n\treturn fmt.Sprintf(\"/droplets/%d\", id)\n}", "title": "" }, { "docid": "0d6a20fd4f9998f3034a83068925475e", "score": "0.5521971", "text": "func (m *Thumbnail) GetSourceItemId()(*string) {\n val, err := m.GetBackingStore().Get(\"sourceItemId\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "title": "" }, { "docid": "cfae6dd29a559da80a76d7c73e56b401", "score": "0.55217373", "text": "func (r *Runtime) getImageID(imageName string) (string, error) {\n\toutput, err := r.runCommand(\"fetch\", imageName)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif len(output) == 0 {\n\t\treturn \"\", fmt.Errorf(\"no result from rkt fetch\")\n\t}\n\tlast := output[len(output)-1]\n\tif !strings.HasPrefix(last, \"sha512-\") {\n\t\treturn \"\", fmt.Errorf(\"unexpected result: %q\", last)\n\t}\n\treturn last, nil\n}", "title": "" }, { "docid": "ca6ec07c1fbac9633383818e432aad9f", "score": "0.55139136", "text": "func createImageID(ID string) string {\n\treturn strings.TrimPrefix(ID, \"pvc-\")[:8]\n}", "title": "" }, { "docid": "a8809166890d57350fb122d975e2a288", "score": "0.5512737", "text": "func (iu ImgurUploader) UploaderID() string {\n\treturn \"imgur\"\n}", "title": "" }, { "docid": "d47cbc9f9bf1471152598475ec995428", "score": "0.5511024", "text": "func (i Imgur) ClientID() string {\n\treturn i.clientID\n}", "title": "" }, { "docid": "5ef9fa4f89303ae2bfa4b9482f77ac54", "score": "0.54988676", "text": "func (layer *dockerLayer) ShortId() string {\n\trangeBound := 25\n\tid := layer.Id()\n\tif length := len(id); length < 25 {\n\t\trangeBound = length\n\t}\n\tid = id[0:rangeBound]\n\n\t// show the tagged image as the last layer\n\t// if len(layer.History.Tags) > 0 {\n\t// \tid = \"[\" + strings.Join(layer.History.Tags, \",\") + \"]\"\n\t// }\n\n\treturn id\n}", "title": "" }, { "docid": "c32135a7e5d10cbf0222e5dc1e3b483e", "score": "0.54763013", "text": "func (rv *rbdVolume) getImageID() error {\n\tif rv.ImageID != \"\" {\n\t\treturn nil\n\t}\n\timage, err := rv.open()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer image.Close()\n\n\tid, err := image.GetId()\n\tif err != nil {\n\t\treturn err\n\t}\n\trv.ImageID = id\n\treturn nil\n}", "title": "" }, { "docid": "d35b4718ea45e5eeda01ba8dfe5f25b4", "score": "0.5469586", "text": "func (daemon *Daemon) GetImageID(refOrID string) (image.ID, error) {\n\tid, ref, err := reference.ParseIDOrReference(refOrID)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif id != \"\" {\n\t\tif _, err := daemon.imageStore.Get(image.IDFromDigest(id)); err != nil {\n\t\t\treturn \"\", ErrImageDoesNotExist{refOrID}\n\t\t}\n\t\treturn image.IDFromDigest(id), nil\n\t}\n\n\tif id, err := daemon.referenceStore.Get(ref); err == nil {\n\t\treturn image.IDFromDigest(id), nil\n\t}\n\n\t// deprecated: repo:shortid https://github.com/docker/docker/pull/799\n\tif tagged, ok := ref.(reference.NamedTagged); ok {\n\t\tif tag := tagged.Tag(); stringid.IsShortID(stringid.TruncateID(tag)) {\n\t\t\tif id, err := daemon.imageStore.Search(tag); err == nil {\n\t\t\t\tfor _, namedRef := range daemon.referenceStore.References(id.Digest()) {\n\t\t\t\t\tif namedRef.Name() == ref.Name() {\n\t\t\t\t\t\treturn id, nil\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Search based on ID\n\tif id, err := daemon.imageStore.Search(refOrID); err == nil {\n\t\treturn id, nil\n\t}\n\n\treturn \"\", ErrImageDoesNotExist{refOrID}\n}", "title": "" }, { "docid": "4065690f06eeea218e733f778ef63f46", "score": "0.5463403", "text": "func (this SponsorsListingFeaturedItem) GetID() string { return this.ID }", "title": "" }, { "docid": "e8a51be7cf9a5a9c072ecc4210cb9507", "score": "0.5458037", "text": "func (o GetImagesResultOutput) Id() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetImagesResult) string { return v.Id }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "8104dbcdc1a78fa92bc61db76bcf816b", "score": "0.5436674", "text": "func imageID(image string) string {\n\tids := map[string]map[string]string{\n\t\t\"pause\": {\n\t\t\t\"amd64\": \"0184c1613d929\",\n\t\t\t\"arm64\": \"3d18732f8686c\",\n\t\t},\n\t}\n\n\tif imgIds, ok := ids[image]; ok {\n\t\tif id, ok := imgIds[runtime.GOARCH]; ok {\n\t\t\treturn id\n\t\t}\n\t\tpanic(fmt.Sprintf(\"unexpected architecture for image %q: %v\", image, runtime.GOARCH))\n\t}\n\tpanic(\"unexpected image name: \" + image)\n}", "title": "" }, { "docid": "b38daf1094b5077185a1dd0028bc3a52", "score": "0.5420993", "text": "func (this Tag) GetID() string { return this.ID }", "title": "" }, { "docid": "0699d8ad8dd5c6095a6f748b8f0efb6b", "score": "0.5408999", "text": "func (o TagOutput) SourceImageId() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *Tag) pulumi.StringOutput { return v.SourceImageId }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "68f97f031b2f5f315b44631ae12fec73", "score": "0.5404199", "text": "func (o EnvironmentEC2Output) ImageId() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *EnvironmentEC2) pulumi.StringPtrOutput { return v.ImageId }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "4aeb5d62195262c90bdbc0ef0d1ff8b0", "score": "0.5357811", "text": "func (o GetDropletsResultOutput) Id() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetDropletsResult) string { return v.Id }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "8429bf85625ec3dff4e9561b4fa4cba3", "score": "0.5353632", "text": "func (this EnterpriseServerUserAccountsUpload) GetID() string { return this.ID }", "title": "" }, { "docid": "bd1644b67f5cd1e1ef82b1ae2fbfc380", "score": "0.5352712", "text": "func ShortID(imageID string) (short string) {\n\tprefixSep := strings.IndexRune(imageID, ':')\n\toffset := 0\n\tlength := 12\n\tif prefixSep >= 0 {\n\t\tif imageID[0:prefixSep] == \"sha256\" {\n\t\t\toffset = prefixSep + 1\n\t\t} else {\n\t\t\tlength += prefixSep + 1\n\t\t}\n\t}\n\n\tif len(imageID) >= offset+length {\n\t\treturn imageID[offset : offset+length]\n\t}\n\n\treturn imageID\n}", "title": "" }, { "docid": "e8d26a153659196a209591d7b313daf9", "score": "0.5343367", "text": "func (img *SLImages) ImageByID(id int) (*Image, error) {\n\tpath := fmt.Sprintf(\"%s/%d/getObject.json\", img.block.GetName(), id)\n\tp, err := img.client.DoRawHttpRequestWithObjectMask(path, imageMask, \"GET\", empty)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err = newError(p); err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar image Image\n\tif err = json.Unmarshal(p, &image); err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to unmarshal response: %s\", err)\n\t}\n\n\timage.decode()\n\treturn &image, nil\n}", "title": "" }, { "docid": "5be58d48a9f2b48429235784ad72e2d3", "score": "0.5330514", "text": "func (d *driver) ID() string {\n\treturn d.Config.Bucket\n}", "title": "" }, { "docid": "88713f6a9af60ba2a11742bc7953af29", "score": "0.5320817", "text": "func image_path(imageid string) string {\n\treturn image_col_path() + slash(imageid)\n}", "title": "" }, { "docid": "8ba512069c34dd4e9ad05bd98dcf95d8", "score": "0.5312561", "text": "func (this Deployment) GetID() string { return this.ID }", "title": "" }, { "docid": "b8ce0a3432ebbb5c92cd60089045a4ba", "score": "0.52933216", "text": "func (i *image) Name() string {\n\treturn i.name\n}", "title": "" }, { "docid": "8efdc0704cfef44b3a4a98d708d9eba6", "score": "0.52635664", "text": "func (idol Idol) GetImgURL() string {\r\n\tresp, err := http.Get(idol.URL)\r\n\tif err != nil {\r\n\t\treturn \"\"\r\n\t}\r\n\tdefer resp.Body.Close()\r\n\r\n\tvar buf *bytes.Buffer = new(bytes.Buffer)\r\n\tio.Copy(buf, resp.Body)\r\n\tvar ret []byte = buf.Bytes()\r\n\r\n\tif !strings.Contains(string(ret), \"id=\\\"content_1_1\\\"\") {\r\n\t\treturn \"\"\r\n\t}\r\n\tvar top []byte = bytes.Split(ret, []byte(\"id=\\\"content_1_1\\\"\"))[1]\r\n\r\n\tif !strings.Contains(string(top), \"a href=\\\"\") {\r\n\t\treturn \"\"\r\n\t}\r\n\tvar url []byte = bytes.Split(bytes.Split(top, []byte(\"a href=\\\"\"))[1], []byte(\"\\\"\"))[0]\r\n\r\n\treturn string(url)\r\n}", "title": "" }, { "docid": "cb9b494f2f3f04bdbaec97b0e60c8e17", "score": "0.5240348", "text": "func (s *Base) ID() string { return s.id }", "title": "" }, { "docid": "f783bf10bda06d945ecf46bdb55b3ed2", "score": "0.5237294", "text": "func (d *Droplet) RegionSlug() string {\n\tif _, ok := d.Region[\"slug\"]; ok {\n\t\treturn d.Region[\"slug\"].(string)\n\t}\n\n\treturn \"\"\n}", "title": "" }, { "docid": "c2e67b7f457f00d1c15ed3e6d1ba9dbe", "score": "0.523672", "text": "func (this Repository) GetID() string { return this.ID }", "title": "" }, { "docid": "b58dcefeb2e4c2ce681be5b195b8fcb3", "score": "0.5219904", "text": "func (this DeploymentReview) GetID() string { return this.ID }", "title": "" }, { "docid": "dd3505bf904cc719351a2c9dc4590882", "score": "0.52176356", "text": "func (t Tags) ID() string { return t.id }", "title": "" }, { "docid": "1c5596db7ce16a8f0da7db0a8d8c4ecf", "score": "0.5215593", "text": "func getImageName(name string) string {\n\t_, tag, id := parseRepositoryTag(name)\n\tif len(tag) == 0 && len(id) == 0 {\n\t\t//_, tag, _ := parseRepositoryTag(name)\n\t\t//if len(tag) == 0 {\n\t\treturn strings.Join([]string{name, api.DefaultTag}, \":\")\n\t}\n\n\treturn name\n}", "title": "" }, { "docid": "738532fcaec803f8755c451976d5501a", "score": "0.5206205", "text": "func (sp BundleProduct) Identifier() string {\n\treturn sp.product.GetIdentifier()\n}", "title": "" }, { "docid": "ff15955630e23daf1478ef94b385108c", "score": "0.5202441", "text": "func (texture *GameTexture) ID() int {\n\treturn texture.id\n}", "title": "" }, { "docid": "2eac23340c56d650a919b0623a388dc3", "score": "0.5200979", "text": "func (self *Artifact) Id() string {\n\treturn self.uuid\n}", "title": "" }, { "docid": "894d8efa789574d905aa86cdaef991f8", "score": "0.5196236", "text": "func (d *stiDocker) GetImageID(name string) (string, error) {\n\tname = getImageName(name)\n\timage, err := d.InspectImage(name)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn image.ID, nil\n}", "title": "" }, { "docid": "a06b4add67b15d322715780ceeeda8aa", "score": "0.51952606", "text": "func (this PackageTag) GetID() string { return this.ID }", "title": "" }, { "docid": "358967a9681017bf01b70c9121958488", "score": "0.5187616", "text": "func (b *Bridge) ID() string {\n\treturn b.id\n}", "title": "" }, { "docid": "d70bd20cc2e13764aeb7ef8fcd37da06", "score": "0.5183672", "text": "func (r *Revision) Slug() string {\n\tif r.Category != \"\" {\n\t\treturn r.Category + \"/\" + r.ID\n\t}\n\treturn r.ID\n}", "title": "" }, { "docid": "42904284a45c5f305d1f7ea19b72d4fb", "score": "0.5183004", "text": "func (o KubernetesNodePoolNodeOutput) DropletId() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v KubernetesNodePoolNode) *string { return v.DropletId }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "a8fd086c6526716f34758baba7c34bd4", "score": "0.51804024", "text": "func (o *SPATSourcesPool) Identifier() string {\n\n\treturn o.ID\n}", "title": "" }, { "docid": "59d0abaa3883c67a0882b82130c16e84", "score": "0.51770735", "text": "func Grab(products vendapi.ProductUpload) (string, error) {\n\n\t// Grab the image based on provided URL.\n\timage, err := urlGet(products.ImageURL)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// Split the URL up to make it easier to grab the file extension.\n\tparts := strings.Split(products.ImageURL, \".\")\n\textension := parts[len(parts)-1]\n\t// If the extension looks about the right length then use it for the\n\t// filename, otherwise do not.\n\tvar fileName string\n\tif len(extension) == 3 {\n\t\tfileName = fmt.Sprintf(\"%s.%s\", products.ID, extension)\n\t} else {\n\t\tfileName = fmt.Sprintf(\"%s\", products.ID)\n\t}\n\n\t// Write product data to file\n\terr = ioutil.WriteFile(fileName, image, 0666)\n\tif err != nil {\n\t\tlog.WithError(err).Error(\"Something went wrong writing image to file\")\n\t\treturn \"\", err\n\t}\n\n\treturn fileName, err\n}", "title": "" }, { "docid": "f53011e3eaa756c280135d09c449510d", "score": "0.5172043", "text": "func (s ImageIdentifier) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "5cd86666a3534fe453d2c31a05f6d7a4", "score": "0.5164158", "text": "func (d *Droplet) StringId() string {\n\treturn strconv.FormatInt(d.Id, 10)\n}", "title": "" }, { "docid": "acfe96695099abe3e8ed421f0c29009c", "score": "0.5158321", "text": "func GetLocalID(ctx context.Context, dockerCli *dockerclient.Client, imageName string) (string, error) {\n\timageFilter := filters.NewArgs()\n\timageFilter.Add(\"reference\", imageName)\n\tresult, err := dockerCli.ImageList(ctx, types.ImageListOptions{\n\t\tAll: false,\n\t\tFilters: imageFilter,\n\t})\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif len(result) == 0 {\n\t\treturn \"\", errors.Errorf(\"Image %s not found locally.\", imageName)\n\t}\n\treturn result[0].ID, nil\n}", "title": "" }, { "docid": "bc5e285c12aebc336a9503e6e621e230", "score": "0.5152988", "text": "func (i *Info) ID() string {\n\treturn utils.TruncateID(i.ContainerID)\n}", "title": "" }, { "docid": "e20ad05412be1f9d4891f388e25f0758", "score": "0.51472414", "text": "func (i *image) Tag() string {\n\treturn i.tag\n}", "title": "" }, { "docid": "76d9ebeadd5a3867f04ab06172bc4aae", "score": "0.5142614", "text": "func (object Tag) Id() string {\n\treturn object.Name\n}", "title": "" }, { "docid": "9208ef708ce6e55d74f872b2fa5b08ed", "score": "0.51282746", "text": "func GetImageNameForDefault() (string, string, error) {\n\tdi, err := InspectContainer(\"mongo-1-1\")\n\tif err != nil {\n\t\treturn \"\", \"\", errors.Wrapf(err, \"cannot get error for container %q\", \"mongo-1-1\")\n\t}\n\n\tif len(di) == 0 {\n\t\treturn \"\", \"\", errors.Wrapf(err, \"cannot get error for container %q (empty array)\", \"mongo-1-1\")\n\t}\n\n\tsplit := strings.Split(di[0].Config.Image, \":\")\n\n\tconst numOfImageNameParts = 2\n\tif len(split) != numOfImageNameParts {\n\t\treturn \"\", \"\", errors.New(fmt.Sprintf(\"image name is not correct: %s\", di[0].Config.Image))\n\t}\n\n\timageBaseName, version := split[0], split[1]\n\n\tfor _, s := range di[0].Config.Env {\n\t\tif strings.HasPrefix(s, \"MONGO_VERSION=\") {\n\t\t\tversion = strings.ReplaceAll(s, \"MONGO_VERSION=\", \"\")\n\n\t\t\tbreak\n\t\t}\n\t\tif strings.HasPrefix(s, \"PSMDB_VERSION=\") {\n\t\t\tversion = strings.ReplaceAll(s, \"PSMDB_VERSION=\", \"\")\n\n\t\t\tbreak\n\t\t}\n\t}\n\treturn imageBaseName, version, nil\n}", "title": "" }, { "docid": "e57f67b3a94b30f9d2b7dab2214e4445", "score": "0.51196855", "text": "func (o KubernetesClusterNodePoolNodeOutput) DropletId() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v KubernetesClusterNodePoolNode) *string { return v.DropletId }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "fd2521760d62b30b2d2158cc4b7077fc", "score": "0.51144385", "text": "func (l *LogItem) ID() string {\n\tif l.Pod != \"\" {\n\t\treturn l.Pod\n\t}\n\treturn l.Container\n}", "title": "" }, { "docid": "23b71f7c7a9ad4b9c2d834c00e4a26b4", "score": "0.51114595", "text": "func (i *image) URL() string {\n\treturn i.ImageURL\n}", "title": "" }, { "docid": "25f446f83845c04418e8033a0c958d3c", "score": "0.5107063", "text": "func getIDParam(c *echo.Context) (int, *echo.HTTPError) {\n\tsid := c.Param(\"id\")\n\tif sid == \"\" {\n\t\treturn 0, Error(fmt.Errorf(\"missing droplet id\"))\n\t}\n\tid, err := strconv.Atoi(sid)\n\tif err != nil {\n\t\treturn 0, Error(fmt.Errorf(\"invalid droplet id '%s' - must be a number\", sid))\n\t}\n\treturn id, nil\n}", "title": "" }, { "docid": "e2e4fd5db77c0a4c7ceeb89d1bd3144b", "score": "0.50986284", "text": "func (d *DockerRepo) imageTagByID(imageID string) (string, error) {\n\timages, err := d.docker.Cli.ImageList(context.Background(), types.ImageListOptions{})\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\t// Extract imageID, RepoTags for specific type of images\n\tfor _, image := range images {\n\t\tif image.ID[7:19] == imageID {\n\t\t\ts := image.RepoTags[0]\n\t\t\treturn s[strings.LastIndex(s, \":\")+1:], nil\n\t\t}\n\t}\n\treturn \"\", nil\n}", "title": "" }, { "docid": "86e877dbb58a5849e12f25f210e2c3ed", "score": "0.50985116", "text": "func getID(wikidataURI string) string {\n\tsplitURI := strings.Split(wikidataURI, \"/\")\n\treturn splitURI[len(splitURI)-1]\n}", "title": "" }, { "docid": "6155c196eeb662ce5115b837c3a9bb45", "score": "0.5093101", "text": "func (this MarketplaceListing) GetID() string { return this.ID }", "title": "" }, { "docid": "dd43c8817c3572e7662a2d4080e2d34b", "score": "0.5085253", "text": "func getImageName(repo string) string {\n\timage := strings.Split(repo, \"/\")\n\treturn image[len(image)-1]\n}", "title": "" }, { "docid": "e8d5277d51dd3c17e221762c644b6f4f", "score": "0.5084131", "text": "func (i *ImageWithRgbaWidget) ID(id string) *ImageWithRgbaWidget {\n\ti.id = id\n\treturn i\n}", "title": "" }, { "docid": "4196fae5442ba386907c002fc9bdd885", "score": "0.5081377", "text": "func (img *Image) BaseImgVariant() string {\n\treturn img.Variant\n}", "title": "" }, { "docid": "5df0150859aa1ee9a4439b52755006d7", "score": "0.50803024", "text": "func (s *ImageStore) getImageID(ctx context.Context, hash []byte) (string, error) {\n\tvar imageID string\n\terr := s.db.QueryRow(ctx, getImageIDDBQ, hash).Scan(&imageID)\n\tif err != nil {\n\t\tif errors.Is(err, pgx.ErrNoRows) {\n\t\t\treturn \"\", nil\n\t\t}\n\t\treturn \"\", err\n\t}\n\treturn imageID, nil\n}", "title": "" }, { "docid": "8dd7f75ff60531fe7a4291f1770e7d51", "score": "0.50795144", "text": "func (gdt Object) ID() string {\n\treturn fmt.Sprintf(\"%p\", gdt.base)\n}", "title": "" }, { "docid": "6e965d5ef635a467aed608a106a092e3", "score": "0.5078648", "text": "func (s *Slab) ID() string {\n\treturn s.name\n}", "title": "" }, { "docid": "fb2aceb24c80cf73ed40bbc2e698bd1e", "score": "0.5069713", "text": "func (s *FileStore) ID() string {\n\treturn s.sid\n}", "title": "" }, { "docid": "ce9c92907ff2f3c4fc82f55ad9563ce3", "score": "0.50679594", "text": "func (this PackageFile) GetID() string { return this.ID }", "title": "" }, { "docid": "72acd27cb14e53c51dc4fb5c1eeaad7f", "score": "0.50658077", "text": "func (b *Bundle) DocID() string { return b.ID }", "title": "" }, { "docid": "fc004f2c2747c664dfb2f9908161e49f", "score": "0.50654864", "text": "func (p *PageBlockEmbed) GetPosterPhotoID() (value int64, ok bool) {\n\tif p == nil {\n\t\treturn\n\t}\n\tif !p.Flags.Has(4) {\n\t\treturn value, false\n\t}\n\treturn p.PosterPhotoID, true\n}", "title": "" }, { "docid": "fc674c811393ae9222a289b045fc0e35", "score": "0.5059725", "text": "func (s *shim) ID() string {\n\treturn s.bundle.ID\n}", "title": "" }, { "docid": "e42177862c4dec8e5fdbea6f14dafd75", "score": "0.5057218", "text": "func fetchImageID(ec2_client *ec2.EC2, amiName string) (string, error) {\n\tparams := &ec2.DescribeImagesInput{\n\t\tFilters: []*ec2.Filter{\n\t\t\t{\n\t\t\t\tName: aws.String(\"name\"),\n\t\t\t\tValues: []*string{\n\t\t\t\t\taws.String(amiName),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tresult, err := ec2_client.DescribeImages(params)\n\tif err != nil {\n\t\tif aerr, ok := err.(awserr.Error); ok {\n\t\t\tswitch aerr.Code() {\n\t\t\tdefault:\n\t\t\t\tfmt.Println(aerr.Error())\n\t\t\t}\n\t\t} else {\n\t\t\t// Print the error, cast err to awserr.Error to get the Code and\n\t\t\t// Message from an error.\n\t\t\tfmt.Println(err.Error())\n\t\t}\n\t\treturn \"\", err\n\t}\n\timage := \"\"\n\tfmt.Println(\"[+] Getting latest NixOS ami to use in the launch template\")\n\tfmt.Printf(\"[+] AMI name: %q\\n\", amiName)\n\tfor _, img := range result.Images {\n\t\tfmt.Printf(\"[+] Description: %q\\n\", *img.Description)\n\t\tfmt.Printf(\"[+] ImageId: %q\\n\", *img.ImageId)\n\t\timage = *img.ImageId\n\t}\n\treturn image, nil\n\n}", "title": "" }, { "docid": "a26b8f4bc570c4e4fd884db96e64e7b7", "score": "0.50559235", "text": "func (t *Texture) ID() uint32 {\n\treturn t.tex.obj\n}", "title": "" }, { "docid": "4d64b62142700271c505f57302571e4b", "score": "0.50553083", "text": "func (ir ImageRepository) Tag() string {\n\t// No check here, should call Valid() before calling name\n\tsegments := strings.SplitN(string(ir), \":\", 2)\n\tif len(segments) < 2 {\n\t\treturn \"\"\n\t}\n\n\treturn segments[1]\n}", "title": "" }, { "docid": "04e849aa8d4efbeb2323f11f917d4453", "score": "0.50458807", "text": "func (b *Bank) GetSlug() string {\n\tif b == nil || b.Slug == nil {\n\t\treturn \"\"\n\t}\n\treturn *b.Slug\n}", "title": "" }, { "docid": "0fade2826a6ab374b30731e14578df70", "score": "0.50426584", "text": "func (o *VirtualizationCloudVmConfigurationAllOf) GetImageId() string {\n\tif o == nil || o.ImageId == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.ImageId\n}", "title": "" }, { "docid": "6a0f6dc3b9ed77e6d96582f28a6faf64", "score": "0.5041385", "text": "func (*PageBlockPhoto) TypeID() uint32 {\n\treturn PageBlockPhotoTypeID\n}", "title": "" }, { "docid": "6a0f6dc3b9ed77e6d96582f28a6faf64", "score": "0.5041385", "text": "func (*PageBlockPhoto) TypeID() uint32 {\n\treturn PageBlockPhotoTypeID\n}", "title": "" }, { "docid": "56e8ce5c4108801c76cf16062ca9ea96", "score": "0.5039551", "text": "func (o *ControllersUpdateDeploymentRequest) GetImageId() string {\n\tif o == nil || o.ImageId == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.ImageId\n}", "title": "" }, { "docid": "22d4cbb3bfbed6be1f9e5df5108f7cb0", "score": "0.50366914", "text": "func (this EnterpriseRepositoryInfo) GetID() string { return this.ID }", "title": "" }, { "docid": "1bbb76b48efaae9360927069494203f7", "score": "0.503226", "text": "func (helper *Helper) ID() string {\n\treturn helper.id\n}", "title": "" } ]
d5751124000c0e3a72b6cec8798589e3
rpc QueryAuthKey(AuthKeyRequest) returns (AuthKeyData);
[ { "docid": "831de625070bfa413b3cd0890a495aa7", "score": "0.8038427", "text": "func (s *AuthKeyServiceImpl) QueryAuthKey(ctx context.Context, request *mtproto.AuthKeyRequest) (*mtproto.AuthKeyData, error) {\n\tglog.Infof(\"auth_key.queryAuthKey - request: %s\", logger.JsonDebugData(request))\n\n\tauthKeyData := &mtproto.AuthKeyData{\n\t\tResult: 0,\n\t\tAuthKeyId: request.AuthKeyId,\n\t}\n\n\t// Check auth_key_id\n\tif request.AuthKeyId == 0 {\n\t\tauthKeyData.Result = 1000\n\t}\n\n\t// TODO(@benqi): cache auth_key\n\tdo, err := dao.GetAuthKeysDAO(dao.DB_MASTER).SelectByAuthId(request.AuthKeyId)\n\tif err != nil {\n\t\tglog.Error(err)\n\t\tauthKeyData.Result = 1001\n\t} else {\n\t\tif do == nil {\n\t\t\tglog.Errorf(\"read keyData error: not find keyId = %d\", request.AuthKeyId)\n\t\t\tauthKeyData.Result = 1002\n\t\t} else {\n\t\t\tauthKeyData.AuthKey, err = base64.RawStdEncoding.DecodeString(do.Body)\n\t\t\tif err != nil {\n\t\t\t\tglog.Errorf(\"read keyData error - keyId = %d, %v\", request.AuthKeyId, err)\n\t\t\t\tauthKeyData.Result = 1003\n\t\t\t}\n\t\t}\n\t}\n\n\tglog.Infof(\"queryAuthKey {auth_key_id: %d} ok.\", request.AuthKeyId)\n\treturn authKeyData, nil\n}", "title": "" } ]
[ { "docid": "14f715151e91aa323b2a5a05ef5e1fcd", "score": "0.647388", "text": "func getAuthQuery(targetAddr net.Addr, key []byte) string {\n\tvar ts = fmt.Sprintf(\"%d\", time.Now().Unix())\n\tvar msg = fmt.Sprintf(\"%s%s%s\", targetAddr.Network(), targetAddr.String(), ts)\n\tvar sig = fmt.Sprintf(\"%x\", sign([]byte(msg), key))\n\tvar q = url.Values{\n\t\t\"time\": []string{ts},\n\t\t\"network\": []string{targetAddr.Network()},\n\t\t\"target\": []string{targetAddr.String()},\n\t\t\"sig\": []string{sig},\n\t}\n\treturn q.Encode()\n}", "title": "" }, { "docid": "0cb02cf12855f26e97fbd5b76fa3e707", "score": "0.60846156", "text": "func (cdsa commitDBStoreAdapter) Query(req abci.RequestQuery) (res abci.ResponseQuery) {\n\tif len(req.Data) == 0 {\n\t\treturn sdkerrors.QueryResult(sdkerrors.Wrap(sdkerrors.ErrTxDecode, \"query cannot be zero length\"))\n\t}\n\n\tswitch req.Path {\n\tcase \"/key\": // get by key\n\t\tkey := req.Data // data holds the key bytes\n\t\tres.Key = key\n\t\tres.Value = cdsa.Get(key)\n\tcase \"/subspace\":\n\t\tpairs := kv.Pairs{\n\t\t\tPairs: make([]kv.Pair, 0),\n\t\t}\n\n\t\tsubspace := req.Data\n\t\tres.Key = subspace\n\n\t\titerator := types.KVStorePrefixIterator(cdsa.Store, subspace)\n\t\tfor ; iterator.Valid(); iterator.Next() {\n\t\t\tpairs.Pairs = append(pairs.Pairs, kv.Pair{Key: iterator.Key(), Value: iterator.Value()})\n\t\t}\n\t\titerator.Close()\n\n\t\tbz, err := pairs.Marshal()\n\t\tif err != nil {\n\t\t\tpanic(fmt.Errorf(\"failed to marshal KV pairs: %w\", err))\n\t\t}\n\n\t\tres.Value = bz\n\tdefault:\n\t\treturn sdkerrors.QueryResult(sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, \"unexpected query path: %v\", req.Path))\n\t}\n\n\treturn res\n}", "title": "" }, { "docid": "3da6181250d6a2f4de14231b7e395a03", "score": "0.60476536", "text": "func (c *AccountKeyClient) Query() *AccountKeyQuery {\n\treturn &AccountKeyQuery{config: c.config}\n}", "title": "" }, { "docid": "1effd32176a63fed9ff89d3992468550", "score": "0.5995528", "text": "func keyFromQuery(param string) func(c *fiber.Ctx) (string, error) {\n\treturn func(c *fiber.Ctx) (string, error) {\n\t\tkey := c.Query(param)\n\t\tif key == \"\" {\n\t\t\treturn \"\", ErrMissingOrMalformedAPIKey\n\t\t}\n\t\treturn key, nil\n\t}\n}", "title": "" }, { "docid": "01cad9e4e8bd61e20f2fabc6a448d4c8", "score": "0.5939197", "text": "func (c *CouponChaincode) QueryByKey(stub shim.ChaincodeStubInterface, args []string) sc.Response {\n\tvar queryKey QueryKey\n\tjson.Unmarshal([]byte (args[0]), &queryKey)\n\tkey := strings.ToLower(queryKey.Key)\n\tresultAsBytes , err := stub.GetState(key)\n\tif err != nil || resultAsBytes == nil {\n\t\treturn shim.Error(fmt.Sprintf(\"QueryByKey failed for Key : %s error : %s\",key ,err.Error())) \n\t} \n\treturn shim.Success(resultAsBytes)\n}", "title": "" }, { "docid": "6d7892c14130c29c279fa552c59b2f98", "score": "0.5934376", "text": "func (client *Client) QueryXmetrictagKey(request *QueryXmetrictagKeyRequest) (_result *QueryXmetrictagKeyResponse, _err error) {\n\truntime := &util.RuntimeOptions{}\n\theaders := make(map[string]*string)\n\t_result = &QueryXmetrictagKeyResponse{}\n\t_body, _err := client.QueryXmetrictagKeyEx(request, headers, runtime)\n\tif _err != nil {\n\t\treturn _result, _err\n\t}\n\t_result = _body\n\treturn _result, _err\n}", "title": "" }, { "docid": "ecacbd27a3e6761ba4a7835703422f4f", "score": "0.58660716", "text": "func AccountKeyRequest(name string) []byte {\n\treturn action.Message(\"Identity=\" + name)\n}", "title": "" }, { "docid": "5e58f06126f750ec6f579da518cd8249", "score": "0.5860518", "text": "func (t *SimpleChaincode) queryByKey(stub shim.ChaincodeStubInterface, args []string) pb.Response {\n\n\tif len(args) != 1 {\n\t\treturn shim.Error(\"Incorrect number of arguments. Expecting 1\")\n\t}\n\n\tqueryResponse, _ := stub.GetState(args[0])\n\tif queryResponse != nil {\n\t\treturn shim.Success(queryResponse)\n\t}\n\treturn shim.Error(\"Can't query or value is empty\")\n}", "title": "" }, { "docid": "637f4ccf51801ec17f56daec5f5ba943", "score": "0.57612085", "text": "func (_Sdctsetup *SdctsetupSession) Pkauth() (struct {\n\tX *big.Int\n\tY *big.Int\n}, error) {\n\treturn _Sdctsetup.Contract.Pkauth(&_Sdctsetup.CallOpts)\n}", "title": "" }, { "docid": "3d78707f7a58c7a79905fc8f61bca92e", "score": "0.57237524", "text": "func (contract *Contract)queryrichkey(stub shim.ChaincodeStubInterface, args []string) peer.Response {\n\n\tif len(args) != 1 {\n\t\treturn shim.Error(\"rich parameter must be 1\")\n\t}\n\n\tvalue:= args[0]\n\tkey,err := stub.GetState(\"richkey\")\n\tif err != nil || key == nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\n\tqueryStr := fmt.Sprintf(\"{\\\"selector\\\":{\\\"%s\\\":\\\"%s\\\"}}\",key,value)\n\n\tresultsIterator ,err := stub.GetQueryResult(queryStr)\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\n\tdefer resultsIterator.Close()\n\n\tvar buffer bytes.Buffer\n\tbuffer.WriteString(\"[\")\n\n\tbArrayMemberAlreadyWritten := false\n\tfor resultsIterator.HasNext() {\n\t\tqueryResult, err := resultsIterator.Next()\n\t\tif err != nil {\n\t\t\treturn shim.Error(err.Error())\n\t\t}\n\n\t\tif bArrayMemberAlreadyWritten == true {\n\t\t\tbuffer.WriteString(\",\")\n\t\t}\n\n\t\tbuffer.WriteString(\"{\\\"Key\\\":\")\n\t\tbuffer.WriteString(\"\\\"\")\n\t\tbuffer.WriteString(queryResult.Key)\n\t\tbuffer.WriteString(\"\\\"\")\n\n\t\tbuffer.WriteString(\", \\\"Record\\\":\")\n\t\tbuffer.WriteString(string(queryResult.Value))\n\t\tbuffer.WriteString(\"}\")\n\n\t\tbArrayMemberAlreadyWritten = true\n\t}\n\n\tbuffer.WriteString(\"]\")\n\n\tfmt.Printf(\"- getContractUser queryResult:\\n%s\\n\",buffer.String())\n\treturn shim.Success(buffer.Bytes())\n\n}", "title": "" }, { "docid": "83770e780fad5a3de2d9c3cbe3f4f3b0", "score": "0.5723157", "text": "func (dm *DataManager) QueryAuthInfo(ctx context.Context, req *pb.QueryAuthInfoReq) (*pb.QueryAuthInfoResp, error) {\n\trtime := time.Now()\n\tlogger.V(2).Infof(\"QueryAuthInfo[%d]| input[%+v]\", req.Seq, req)\n\tresponse := &pb.QueryAuthInfoResp{Seq: req.Seq, ErrCode: pbcommon.ErrCode_E_OK, ErrMsg: \"OK\"}\n\n\tdefer func() {\n\t\tcost := dm.collector.StatRequest(\"QueryAuthInfo\", response.ErrCode, rtime, time.Now())\n\t\tlogger.V(2).Infof(\"QueryAuthInfo[%d]| output[%dms][%+v]\", req.Seq, cost, response)\n\t}()\n\n\taction := businessaction.NewAuthInfoAction(dm.viper, dm.smgr, req, response)\n\tdm.executor.Execute(action)\n\n\treturn response, nil\n}", "title": "" }, { "docid": "347bd420d4bedb183805e04b4e866709", "score": "0.5695289", "text": "func (app *KVStoreApplication) Query(req abcitypes.RequestQuery) (res abcitypes.ResponseQuery) {\n\t// Attach the key to the response\n\tres.Key = req.Data\n\terr := app.db.View(func(txn *badger.Txn) error {\n\t\titem, err := txn.Get(req.Data)\n\t\tif err != nil && err != badger.ErrKeyNotFound {\n\t\t\treturn err\n\t\t}\n\t\t// If the key is not found attach the not found status\n\t\tif err == badger.ErrKeyNotFound {\n\t\t\tres.Log = \"does not exist\"\n\t\t} else {\n\t\t\t// Attach the value associated with the key\n\t\t\treturn item.Value(func(val []byte) error {\n\t\t\t\tres.Log = \"exists\"\n\t\t\t\tres.Value = val\n\t\t\t\treturn nil\n\t\t\t})\n\t\t}\n\t\treturn nil\n\t})\n\t// db error, panic\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}", "title": "" }, { "docid": "e21e85603a88c08a8b2798f64c25ae8f", "score": "0.56933373", "text": "func QueryKey(symbol string) {\n\tif noSymbol := len(symbol) < 1; noSymbol {\n\t\terrors.Error(\"No argument supplied\")\n\t}\n\n\tk := &Key{}\n\tbody := iex.Query(\"/stock/\" + symbol + \"/stats\")\n\terr := json.Unmarshal(body, &k)\n\n\tif err != nil {\n\t\terrors.Error(\"Failed to unmarshal\", err)\n\t}\n\n\tt := table.NewWriter()\n\tt.SetOutputMirror(os.Stdout)\n\tt.AppendRows([]table.Row{\n\t\t{\"Symbol\", k.Symbol},\n\t\t{\"Company Name\", k.CompanyName},\n\t\t{\"Marketcap\", humanize.Comma(k.Marketcap)},\n\t\t{\"Beta\", k.Beta},\n\t\t{\"Week 52 High\", k.Week52High},\n\t\t{\"Week 52 Low\", k.Week52Low},\n\t\t{\"Week 52 Change\", k.Week52Change},\n\t\t{\"Short Interest\", k.ShortInterest},\n\t\t{\"Short Date\", k.ShortDate},\n\t\t{\"Dividend Rate\", k.DividendRate},\n\t\t{\"Dividend Yield\", k.DividendYield},\n\t\t{\"Ex Dividend Date\", k.ExDividendDate},\n\t\t{\"Latest EPS\", k.LatestEPS},\n\t\t{\"Latest EPS Date\", k.LatestEPSDate},\n\t\t{\"Shares Outstanding\", k.SharesOutstanding},\n\t\t{\"Float\", k.Float},\n\t\t{\"Return On Equity\", k.ReturnOnEquity},\n\t\t{\"Consensus EPS\", k.ConsensusEPS},\n\t\t{\"Number Of Estimates\", k.NumberOfEstimates},\n\t\t{\"EPS Surprise Dollar\", k.EPSSurpriseDollar},\n\t\t{\"EPS Surprise Percent\", k.EPSSurprisePercent},\n\t\t{\"EBITDA\", humanize.Comma(k.EBITDA)},\n\t\t{\"Revenue\", humanize.Comma(k.Revenue)},\n\t\t{\"Gross Profit\", humanize.Comma(k.GrossProfit)},\n\t\t{\"Cash\", humanize.Comma(k.Cash)},\n\t\t{\"Debt\", humanize.Comma(k.Debt)},\n\t\t{\"Ttm EPS\", k.TtmEPS},\n\t\t{\"Revenue Per Share\", k.RevenuePerShare},\n\t\t{\"Revenue Per Employee\", k.RevenuePerEmployee},\n\t\t{\"Pe Ratio High\", k.PeRatioHigh},\n\t\t{\"Pe Ratio Low\", k.PeRatioLow},\n\t\t{\"Return On Assets\", k.ReturnOnAssets},\n\t\t{\"Return On Capital\", k.ReturnOnCapital},\n\t\t{\"Profit Margin\", k.ProfitMargin},\n\t\t{\"Price To Sales\", k.PriceToSales},\n\t\t{\"Price To Book\", k.PriceToBook},\n\t\t{\"Day 200 Moving Avg\", k.Day200MovingAvg},\n\t\t{\"Day 50 Moving Avg\", k.Day50MovingAvg},\n\t\t{\"Institution Percent\", k.InstitutionPercent},\n\t\t{\"Insider Percent\", k.InsiderPercent},\n\t\t{\"Short Ratio\", k.ShortRatio},\n\t\t{\"Year 5 Change Percent\", k.Year5ChangePercent},\n\t\t{\"Year 2 Change Percent\", k.Year2ChangePercent},\n\t\t{\"Year 1 ChangePercent\", k.Year1ChangePercent},\n\t\t{\"Ytd Change Percent\", k.YtdChangePercent},\n\t\t{\"Month 6 Change Percent\", k.Month6ChangePercent},\n\t\t{\"Month 3 Change Percent\", k.Month3ChangePercent},\n\t\t{\"Month 1 Change Percent\", k.Month1ChangePercent},\n\t\t{\"Day 5 Change Percent\", k.Day5ChangePercent},\n\t\t{\"Day 30 Change Percent\", k.Day30ChangePercent},\n\t})\n\n\tt.SortBy([]table.SortBy{{Number: 1, Mode: table.Asc}})\n\n\tt.SetAllowedColumnLengths([]int{40, 40, 40, 40, 40, 40, 40, 40})\n\tt.SetStyle(table.StyleColoredCyanWhiteOnBlack)\n\n\tt.Render()\n}", "title": "" }, { "docid": "658fe44c29ec25b9f4855e7973d0c658", "score": "0.5690859", "text": "func (_Sdctsetup *SdctsetupCallerSession) Pkauth() (struct {\n\tX *big.Int\n\tY *big.Int\n}, error) {\n\treturn _Sdctsetup.Contract.Pkauth(&_Sdctsetup.CallOpts)\n}", "title": "" }, { "docid": "81fcd20804560e73739ef03f3a07659f", "score": "0.56840926", "text": "func (e *Okex) ApiKeyRequest(method string, mapParams map[string]interface{}, strRequestPath string) string {\n\tTimeStamp := IsoTime()\n\n\tjsonParams := \"\"\n\tvar bytesParams []byte\n\tif len(mapParams) != 0 {\n\t\tbytesParams, _ = json.Marshal(mapParams)\n\t\tjsonParams = string(bytesParams)\n\t}\n\n\tvar strMessage string\n\tif method == \"GET\" {\n\t\tif len(mapParams) > 0 {\n\t\t\tstrRequestPath += \"?\" + exchange.Map2UrlQueryInterface(mapParams)\n\t\t}\n\t\tstrMessage = TimeStamp + method + strRequestPath\n\t\tif len(mapParams) > 0 {\n\t\t\tstrMessage += jsonParams\n\t\t}\n\t} else {\n\t\tstrMessage = TimeStamp + method + strRequestPath + jsonParams\n\t}\n\n\t// log.Printf(\"===================strMessage: %v\", strMessage)\n\n\tsignature := exchange.ComputeHmac256Base64(strMessage, e.API_SECRET)\n\tstrUrl := API_URL + strRequestPath\n\n\thttpClient := &http.Client{}\n\trequest, err := http.NewRequest(method, strUrl, bytes.NewReader(bytesParams))\n\tif nil != err {\n\t\treturn err.Error()\n\t}\n\trequest.Header.Add(\"Accept\", \"application/json\")\n\trequest.Header.Add(\"Content-Type\", \"application/json; charset=UTF-8\")\n\trequest.Header.Add(\"OK-ACCESS-KEY\", e.API_KEY)\n\trequest.Header.Add(\"OK-ACCESS-SIGN\", signature)\n\trequest.Header.Add(\"OK-ACCESS-TIMESTAMP\", TimeStamp)\n\trequest.Header.Add(\"OK-ACCESS-PASSPHRASE\", e.Passphrase)\n\n\tresponse, err := httpClient.Do(request)\n\tif nil != err {\n\t\treturn err.Error()\n\t}\n\tdefer response.Body.Close()\n\n\tbody, err := ioutil.ReadAll(response.Body)\n\tif nil != err {\n\t\treturn err.Error()\n\t}\n\n\treturn string(body)\n}", "title": "" }, { "docid": "9e4cbf88e19bac9a323b14b34dacdee0", "score": "0.56402856", "text": "func AuthKey(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt) {\n\tmeta := p.Get(\"metadata\", nil).(ssh.ConnMetadata)\n\tkey := p.Get(\"key\", nil).(ssh.PublicKey)\n\tauthorized := p.Get(\"authorizedKeys\", []string{}).([]string)\n\n\tauth := new(ssh.CertChecker)\n\tauth.UserKeyFallback = func(meta ssh.ConnMetadata, pk ssh.PublicKey) (*ssh.Permissions, error) {\n\n\t\t// This gives us a string in the form \"ssh-rsa LONG_KEY\"\n\t\tsuppliedType := key.Type()\n\t\tsupplied := key.Marshal()\n\n\t\tfor _, allowedKey := range authorized {\n\t\t\tallowed, _, _, _, err := ssh.ParseAuthorizedKey([]byte(allowedKey))\n\t\t\tif err != nil {\n\t\t\t\tlog.Infof(c, \"Could not parse authorized key '%q': %s\", allowedKey, err)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// We use a contstant time compare more as a precaution than anything\n\t\t\t// else. A timing attack here would be very difficult, but... better\n\t\t\t// safe than sorry.\n\t\t\tif allowed.Type() == suppliedType && subtle.ConstantTimeCompare(allowed.Marshal(), supplied) == 1 {\n\t\t\t\tlog.Infof(c, \"Key accepted for user %s.\", meta.User())\n\t\t\t\tperm := &ssh.Permissions{\n\t\t\t\t\tExtensions: map[string]string{\n\t\t\t\t\t\t\"user\": meta.User(),\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t\treturn perm, nil\n\t\t\t}\n\t\t}\n\n\t\treturn nil, fmt.Errorf(\"No matching keys found.\")\n\t}\n\n\treturn auth.Authenticate(meta, key)\n}", "title": "" }, { "docid": "d1cc52ddbb09cb5cff1da7b7afb489dc", "score": "0.56364936", "text": "func (client *Client) QueryXmetrictagKeyEx(request *QueryXmetrictagKeyRequest, headers map[string]*string, runtime *util.RuntimeOptions) (_result *QueryXmetrictagKeyResponse, _err error) {\n\t_err = util.ValidateModel(request)\n\tif _err != nil {\n\t\treturn _result, _err\n\t}\n\t_result = &QueryXmetrictagKeyResponse{}\n\t_body, _err := client.DoRequest(tea.String(\"1.0\"), tea.String(\"antcloud.monitor.xmetrictag.key.query\"), tea.String(\"HTTPS\"), tea.String(\"POST\"), tea.String(\"/gateway.do\"), tea.ToMap(request), headers, runtime)\n\tif _err != nil {\n\t\treturn _result, _err\n\t}\n\t_err = tea.Convert(_body, &_result)\n\treturn _result, _err\n}", "title": "" }, { "docid": "f9329958b60db8bdb7d8b915e2dfcd68", "score": "0.5613571", "text": "func GetAuthKey(addr sdk.AccAddress) []byte {\n\treturn append(AuthKey, addr...)\n}", "title": "" }, { "docid": "5ef9991cfa37ced83751309a4c9c021a", "score": "0.5581416", "text": "func (t *SimpleInventoryChaincode) query(stub shim.ChaincodeStubInterface, args []string) pb.Response {\n\t//fmt.Println(\"########### SimpleInventoryChaincode query key ###########\")\n\tfmt.Println(\"########### Query chain with key ###########\")\n\t// Check whether the number of arguments is sufficient\n\tif len(args) < 2 {\n\t\treturn shim.Error(\"The number of arguments is insufficient.\")\n\t}\n\n\tkey:=t.generatecompositekey(stub,args[1])\n\t\n\t// Get the state of the value matching the key hello in the ledger\n\tstate, err := stub.GetState(key)\n\tfmt.Println(string(state))\n\tif err != nil {\n\t\treturn shim.Error(fmt.Sprintf(\"Failed to get state: %s\", args[1]))\n\t}\n\n\t// Return this value in response\n\treturn shim.Success(state)\n}", "title": "" }, { "docid": "c299cd64831d69485042ccf0a38faf4d", "score": "0.556432", "text": "func (client *Client) AuthrepUserKey(args ...interface{}) Response {\n\tuserKey, usageArr, err := authrepUserKeyParams(args...)\n\tif nil != err {\n panic(err.Error())\n }\n\n\tr := new(Response)\n\turl := \"/transactions/authrep.xml?\"\n\tquery := \"user_key=\" + userKey\n\tquery += \"&provider_key=\" + client.ProviderKey\n\tfor _,element := range usageArr {\n\t\tquery += \"&usage[\" + element.Name + \"]=\" + strconv.Itoa(element.Value)\n\t}\n\n\t// fmt.Printf(\"\\n\"+\"https://\"+client.Host+url+query+\"\\n\")\n\trequest := gorequest.New()\n\tres, body, errs := request.Get(\"https://\"+client.Host+url+query).\n\t\tSet(\"X-3scale-User-Agent\", \"plugin-golang-v#test\").\n\t\tEnd()\n\n\tif errs != nil {\n\t\t// handle error\n\t}\n\tif res.StatusCode == 200 || res.StatusCode == 409 {\n\t\tfmt.Printf(\"\\n\" + \"All good\")\n\t\tr.Succeed()\n\t} else if res.StatusCode >= 400 && res.StatusCode < 409 {\n\t\tfmt.Printf(\"\\n\" + \"Error\"+\"\\n\",body)\n\t\tr.Error(res.StatusCode,\"\")\n\t} else {\n\t\tfmt.Printf(\"\\n\" + \"Mega error\")\n\t}\n\tfmt.Printf(\"\\n\" + body)\n\treturn *r\n}", "title": "" }, { "docid": "02ab59926b48ce658c080bda7730bc1f", "score": "0.55637497", "text": "func (_Sdctsetup *SdctsetupCaller) Pkauth(opts *bind.CallOpts) (struct {\n\tX *big.Int\n\tY *big.Int\n}, error) {\n\tret := new(struct {\n\t\tX *big.Int\n\t\tY *big.Int\n\t})\n\tout := ret\n\terr := _Sdctsetup.contract.Call(opts, out, \"pkauth\")\n\treturn *ret, err\n}", "title": "" }, { "docid": "7ff132ad71b5eec6d7f1c24c539e6049", "score": "0.5529937", "text": "func (_IdentityContract *IdentityContractCallerSession) GetKey(value [32]byte) (struct {\n\tKey [32]byte\n\tPurposes []*big.Int\n\tRevokedAt uint32\n}, error) {\n\treturn _IdentityContract.Contract.GetKey(&_IdentityContract.CallOpts, value)\n}", "title": "" }, { "docid": "8f77bb40fbd00306a74f3cc6cef1ddc1", "score": "0.5510892", "text": "func (_IdentityContract *IdentityContractCaller) GetKey(opts *bind.CallOpts, value [32]byte) (struct {\n\tKey [32]byte\n\tPurposes []*big.Int\n\tRevokedAt uint32\n}, error) {\n\tret := new(struct {\n\t\tKey [32]byte\n\t\tPurposes []*big.Int\n\t\tRevokedAt uint32\n\t})\n\tout := ret\n\terr := _IdentityContract.contract.Call(opts, out, \"getKey\", value)\n\treturn *ret, err\n}", "title": "" }, { "docid": "5df840f380f65582c97ec9e5818b0fb4", "score": "0.5489613", "text": "func (p *plain) Query(qname string, qtype uint16, client net.IPNet) *Answer {\n\tif !p.init {\n\t\tpanic(ErrSourceNotInit.Error())\n\t}\n\n\tp.RLock()\n\tdefer p.RUnlock()\n\n\ta := &authBase{p}\n\tans := a.query(qname, qtype, client)\n\tans.Auth = true\n\tans.RA = false\n\treturn ans\n}", "title": "" }, { "docid": "f426061cb0b7ca0812da6185fc626dac", "score": "0.54885423", "text": "func (_IdentityContract *IdentityContractSession) GetKey(value [32]byte) (struct {\n\tKey [32]byte\n\tPurposes []*big.Int\n\tRevokedAt uint32\n}, error) {\n\treturn _IdentityContract.Contract.GetKey(&_IdentityContract.CallOpts, value)\n}", "title": "" }, { "docid": "157bc0e37d0bcaefeaf9c011c8f0bd94", "score": "0.54625547", "text": "func (t *SimpleChaincode) Query(stub *shim.ChaincodeStub, function string, args []string) ([]byte, error) {\n\tif function != \"query\" {\n\t\treturn nil, errors.New(\"Invalid query function name. Expecting \\\"query\\\"\")\n\t}\n\tvar username string // Entities\n\tvar err error\n\n\tif len(args) != 1 {\n\t\treturn nil, errors.New(\"Incorrect number of arguments. Expecting username to query\")\n\t}\n\n\tusername = args[0]\n\n\t// Get the state from the ledger\n\tpublickeybytes, err := stub.GetState(username)\n\tif err != nil {\n\t\tjsonResp := \"{\\\"Error\\\":\\\"Failed to get state for \" + username + \"\\\"}\"\n\t\treturn nil, errors.New(jsonResp)\n\t}\n\n\tif publickeybytes == nil {\n\t\tjsonResp := \"{\\\"Error\\\":\\\"Nil key for \" + username + \"\\\"}\"\n\t\treturn nil, errors.New(jsonResp)\n\t}\n\n\tjsonResp := \"{\\\"Name\\\":\\\"\" + username + \"\\\",\\\"Amount\\\":\\\"\" + string(publickeybytes) + \"\\\"}\"\n\tfmt.Printf(\"Query Response:%s\\n\", jsonResp)\n\treturn publickeybytes, nil\n}", "title": "" }, { "docid": "93eca9e9acd953926773a03cc444bed1", "score": "0.54426306", "text": "func retrievePAppAuth(db logic.DataCaller, r *http.Request) *logic.PAppAuth {\n\ttype e struct {\n\t\tKeyID string `db:\"id\"`\n\t\tSecretKey string `db:\"secret_key\"`\n\t\tUserID string `db:\"user_id\"`\n\t\tEnterpriseID sql.NullString `db:\"enterprise_id\"`\n\t}\n\tvar ent e\n\n\tq := `SELECT app_keys.id, app_keys.secret_key, app_keys.enterprise_id,\n app_keys.user_id FROM app_keys \n WHERE app_keys.id = ? AND app_keys.active = 1;`\n\n\tif err := db.Get(&ent, q, r.Header.Get(\"X-PLEASESIGN-APP\")); err != nil {\n\t\treturn &logic.PAppAuth{}\n\t}\n\n\tout := &logic.PAppAuth{\n\t\tId: ent.KeyID,\n\t\tSecretKey: ent.SecretKey,\n\t\tEnterpriseID: ent.EnterpriseID.String,\n\t\tUserID: ent.UserID,\n\t}\n\n\treturn out\n}", "title": "" }, { "docid": "becd156da7e864444b8c5820b2445e60", "score": "0.5406608", "text": "func (contract *Contract)querybyComkey(stub shim.ChaincodeStubInterface, args []string) peer.Response {\n\n\tbytes,err := QuerybyCompositekeys(stub,args)\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\n\treturn shim.Success(bytes)\n\n}", "title": "" }, { "docid": "abd7038247bea25eac0403fda98a1a89", "score": "0.5402437", "text": "func (r Request) Key() (string, bool) {\n\tif r.Cmd == \"RANDOMKEY\" {\n\t\treturn \"RANDOMKEY\", false\n\t}\n\tvar n int\n\tswitch r.Cmd {\n\tcase \"EVAL\", \"EVALSHA\":\n\t\tn = 2\n\tcase \"BITOP\":\n\t\tn = 1\n\tdefault:\n\t\tn = 0\n\t}\n\tif len(r.Args) <= n {\n\t\treturn \"\", false\n\t}\n\treturn ArgToString(r.Args[n])\n}", "title": "" }, { "docid": "6896248b7c83cb18bcdcd002cbbcd70d", "score": "0.5375061", "text": "func (auth *KeyAuth) AuthenticateRequest(req *http.Request) error {\n\tparams := req.URL.Query()\n\tparams.Set(\"key\", auth.Key)\n\treq.URL.RawQuery = params.Encode()\n\treturn nil\n}", "title": "" }, { "docid": "ac704217d5cdcace883ce9ab0289437d", "score": "0.5370263", "text": "func getKey(c echo.Context) error {\n\tcblog.Info(\"call getKey()\")\n\n var req struct {\n ConnectionName string\n }\n\n if err := c.Bind(&req); err != nil {\n return echo.NewHTTPError(http.StatusInternalServerError, err.Error())\n }\n\n cldConn, err := ccm.GetCloudConnection(req.ConnectionName)\n\tif err != nil {\n\t\treturn echo.NewHTTPError(http.StatusInternalServerError, err.Error())\n\t}\n\n\thandler, err := cldConn.CreateKeyPairHandler()\n\tif err != nil {\n\t\treturn echo.NewHTTPError(http.StatusInternalServerError, err.Error())\n\t}\n\n rsType := rsKey\nkeyRWLock.RLock()\ndefer keyRWLock.RUnlock()\n// (1) get IID(NameId)\n iidInfo, err := iidRWLock.GetIID(req.ConnectionName, rsType, cres.IID{c.Param(\"Name\"), \"\"})\n if err != nil {\n cblog.Error(err)\n return echo.NewHTTPError(http.StatusInternalServerError, err.Error())\n }\n\n// (2) get resource(SystemId)\n\tinfo, err := handler.GetKey(iidInfo.IId)\n\tif err != nil {\n\t\treturn echo.NewHTTPError(http.StatusInternalServerError, err.Error())\n\t}\n\n// (3) set ResourceInfo(IID.NameId)\n info.IId.NameId = iidInfo.IId.NameId\n\n\treturn c.JSON(http.StatusOK, &info)\n}", "title": "" }, { "docid": "ecbc8ceed4e2b78edaf7e16f5301dce9", "score": "0.5341946", "text": "func verifyAuthQuery(q url.Values, key []byte) (net.Addr, bool) {\n\tvar network = q.Get(\"network\")\n\tvar target = q.Get(\"target\")\n\tvar ts = q.Get(\"time\")\n\tvar sig = q.Get(\"sig\")\n\tif network == \"\" || target == \"\" || ts == \"\" || sig == \"\" {\n\t\treturn nil, false\n\t}\n\tt, err := strconv.Atoi(ts)\n\tif err != nil {\n\t\treturn nil, false\n\t}\n\tvar diff = time.Now().Unix() - int64(t)\n\tif diff < -120 || diff > 120 {\n\t\treturn nil, false\n\t}\n\tvar msg = fmt.Sprintf(\"%s%s%s\", network, target, ts)\n\tvar sig2 = sign([]byte(msg), key)\n\tif fmt.Sprintf(\"%x\", sig2) != sig {\n\t\treturn nil, false\n\t}\n\treturn targetAddr{network, target}, true\n}", "title": "" }, { "docid": "02e7fa61d0dc02aa6344f518551a4ce9", "score": "0.53353536", "text": "func NewKey(query []byte, originParams url.Values, acceptEncoding string, userParamsHash uint32, queryParamsHash uint32, userCredentialHash uint32) *Key {\n\treturn &Key{\n\t\tQuery: query,\n\t\tAcceptEncoding: acceptEncoding,\n\t\tDefaultFormat: originParams.Get(\"default_format\"),\n\t\tDatabase: originParams.Get(\"database\"),\n\t\tCompress: originParams.Get(\"compress\"),\n\t\tEnableHTTPCompression: originParams.Get(\"enable_http_compression\"),\n\t\tNamespace: originParams.Get(\"cache_namespace\"),\n\t\tExtremes: originParams.Get(\"extremes\"),\n\t\tMaxResultRows: originParams.Get(\"max_result_rows\"),\n\t\tResultOverflowMode: originParams.Get(\"result_overflow_mode\"),\n\t\tUserParamsHash: userParamsHash,\n\t\tVersion: Version,\n\t\tQueryParamsHash: queryParamsHash,\n\t\tUserCredentialHash: userCredentialHash,\n\t}\n}", "title": "" }, { "docid": "869add27f87a217c7f12f102a460b743", "score": "0.5325368", "text": "func (s *AuthKeyServiceImpl) QueryUserId(ctx context.Context, request *mtproto.AuthKeyIdRequest) (*mtproto.UserIdResponse, error) {\n\tglog.Infof(\"auth_key.queryUserId - request: %s\", logger.JsonDebugData(request))\n\n\tuserId := &mtproto.UserIdResponse{\n\t\tResult: 0,\n\t\tAuthKeyId: request.AuthKeyId,\n\t}\n\n\t// Check auth_key_id\n\tif request.AuthKeyId == 0 {\n\t\tuserId.Result = 1000\n\t}\n\n\t// TODO(@benqi): cache auth_key\n\tdo, err := dao.GetAuthUsersDAO(dao.DB_MASTER).SelectByAuthId(request.AuthKeyId)\n\tif err != nil {\n\t\tglog.Error(err)\n\t\tuserId.Result = 1001\n\t} else {\n\t\tif do == nil {\n\t\t\tglog.Errorf(\"getUserId error: not find keyId = %d\", request.AuthKeyId)\n\t\t\tuserId.Result = 1002\n\t\t} else {\n\t\t\tuserId.UserId = do.UserId\n\t\t}\n\t}\n\n\tglog.Infof(\"queryUserId {auth_key_id: %d} ok.\", request.AuthKeyId)\n\treturn userId, nil\n}", "title": "" }, { "docid": "c8ba8a2b4cc65901413bde691a59567a", "score": "0.53217554", "text": "func (t *SimpleChaincode) Query(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n\tif len(args) < 1 {\n\t\treturn nil, errors.New(\"get operation must include one argument, a key\")\n\t}\n\n\tswitch function {\n\tcase \"read\":\n\t\treturn t.read(stub, args)\n\tcase \"keys\":\n\t\tkeysIter, err := stub.RangeQueryState(\"\", \"\")\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"keys operation failed. Error accessing state: %s\", err)\n\t\t}\n\t\tdefer keysIter.Close()\n\n\t\tvar keys []string\n\t\tfor keysIter.HasNext() {\n\t\t\tkey, _, iterErr := keysIter.Next()\n\t\t\tif iterErr != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"keys operation failed. Error accessing state: %s\", err)\n\t\t\t}\n\t\t\tkeys = append(keys, key)\n\t\t}\n\n\t\tjsonKeys, err := json.Marshal(keys)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"keys operation failed. Error marshaling JSON: %s\", err)\n\t\t}\n\n\t\treturn jsonKeys, nil\n\tdefault:\n\t\tfmt.Println(\"query did not find func: \" + function)\n\t\treturn nil, errors.New(\"Received unknown function query\")\n\t}\n}", "title": "" }, { "docid": "0b3b6b03f14eca8f3e98a64807745097", "score": "0.5307383", "text": "func (appCtx *AppContext) Query(key string) string {\n\treturn appCtx.ctx.Query(key)\n}", "title": "" }, { "docid": "178d65144e71d7a4f465dd0ca95003c0", "score": "0.5303652", "text": "func (s *chatapisrvc) APIKeyAuth(ctx context.Context, key string, scheme *security.APIKeyScheme) (context.Context, error) {\n\n\t//簡易版、本番環境ではDBからの参照やアクセストークンを使用する方法\n\tif key != \"apikey\" {\n\t\treturn ctx, fmt.Errorf(\"not implemented\")\n\t}\n\treturn ctx, nil\n}", "title": "" }, { "docid": "1975f6a89ae7a246e9c5de4b2310e0fa", "score": "0.5292607", "text": "func checkAuthKey(r *http.Request) bool {\n\t//-- Get URL Parameter 'key'\n\tkey := r.URL.Query().Get(\"key\")\n\n\t//-- Check if we have something\n\tif len(key) != 0 {\n\t\t//-- Validate key\n\t\tif key == authKey {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\treturn false\n}", "title": "" }, { "docid": "7864cee2f541d5f43d59696d07d55a50", "score": "0.52714974", "text": "func (client KmsManagementClient) getKey(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {\n\n\thttpRequest, err := request.HTTPRequest(http.MethodGet, \"/20180608/keys/{keyId}\", binaryReqBody, extraHeaders)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar response GetKeyResponse\n\tvar httpResponse *http.Response\n\thttpResponse, err = client.Call(ctx, &httpRequest)\n\tdefer common.CloseBodyIfValid(httpResponse)\n\tresponse.RawResponse = httpResponse\n\tif err != nil {\n\t\treturn response, err\n\t}\n\n\terr = common.UnmarshalResponse(httpResponse, &response)\n\treturn response, err\n}", "title": "" }, { "docid": "eea5b69e18a40f233bd526df7d894efb", "score": "0.52491915", "text": "func (e *UserService) GetKey(name string, keyname string) (key AccessKey, err error) {\n\turl := fmt.Sprintf(\"users/%s/keys/%s\", name, keyname)\n\terr = e.client.magicRequestDecoder(\"GET\", url, nil, &key)\n\treturn\n}", "title": "" }, { "docid": "e0ec8f1943a1345d6d899325a9cea623", "score": "0.5219558", "text": "func (c *Connection) Get(key string) (string, error) {\n\tvar tempBuffer []byte\n\t// TODO: Add cas\n\trequest := _Request{typeRequest, commandGet, uint16(len(key)), 0x00, 0x00, 0x00,\n\t\tuint32(len(key)), 0x00, 0x00}\n\n\tfinalPayload := bytes.NewBuffer(make([]byte, 0))\n\tfinalPayload.WriteString(key)\n\n\terr := c.writeRequest(request, finalPayload.Bytes())\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tresponse, err := c.readResponse()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\t// TODO: Treat flags\n\ttempBuffer = make([]byte, 4)\n\tc.conn.Read(tempBuffer)\n\n\ttempBuffer = make([]byte, response.bodyLength-uint32(response.extrasLength))\n\tc.conn.Read(tempBuffer)\n\n\treturn string(tempBuffer), nil\n}", "title": "" }, { "docid": "d18ee1b3cc8f1aebb8e9ee17b66d7516", "score": "0.5218165", "text": "func (a *KeyManagementApi) GetCurrentUserApplicationKey(ctx _context.Context, appKeyId string) (ApplicationKeyResponse, *_nethttp.Response, error) {\n\tvar (\n\t\tlocalVarHTTPMethod = _nethttp.MethodGet\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarReturnValue ApplicationKeyResponse\n\t)\n\n\tlocalBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, \"v2.KeyManagementApi.GetCurrentUserApplicationKey\")\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}\n\t}\n\n\tlocalVarPath := localBasePath + \"/api/v2/current_user/application_keys/{app_key_id}\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"app_key_id\"+\"}\", _neturl.PathEscape(datadog.ParameterToString(appKeyId, \"\")), -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := _neturl.Values{}\n\tlocalVarFormParams := _neturl.Values{}\n\tlocalVarHeaderParams[\"Accept\"] = \"application/json\"\n\n\tdatadog.SetAuthKeys(\n\t\tctx,\n\t\t&localVarHeaderParams,\n\t\t[2]string{\"apiKeyAuth\", \"DD-API-KEY\"},\n\t\t[2]string{\"appKeyAuth\", \"DD-APPLICATION-KEY\"},\n\t)\n\treq, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil)\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, err\n\t}\n\n\tlocalVarHTTPResponse, err := a.Client.CallAPI(req)\n\tif err != nil || localVarHTTPResponse == nil {\n\t\treturn localVarReturnValue, localVarHTTPResponse, err\n\t}\n\n\tlocalVarBody, err := datadog.ReadBody(localVarHTTPResponse)\n\tif err != nil {\n\t\treturn localVarReturnValue, localVarHTTPResponse, err\n\t}\n\n\tif localVarHTTPResponse.StatusCode >= 300 {\n\t\tnewErr := datadog.GenericOpenAPIError{\n\t\t\tErrorBody: localVarBody,\n\t\t\tErrorMessage: localVarHTTPResponse.Status,\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 {\n\t\t\tvar v APIErrorResponse\n\t\t\terr = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.ErrorModel = v\n\t\t}\n\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t}\n\n\terr = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\tif err != nil {\n\t\tnewErr := datadog.GenericOpenAPIError{\n\t\t\tErrorBody: localVarBody,\n\t\t\tErrorMessage: err.Error(),\n\t\t}\n\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t}\n\n\treturn localVarReturnValue, localVarHTTPResponse, nil\n}", "title": "" }, { "docid": "f1cc5e8b72df6d96cbd75a69fd1deb3d", "score": "0.52041113", "text": "func (d *Datastore) Query(q dsq.Query) (dsq.Results, error) {\n\treturn nil, errors.New(\"KeyList not implemented.\")\n}", "title": "" }, { "docid": "04176664a302eee677fe0fe43fa9f466", "score": "0.5202244", "text": "func (c *command) Get(key interface{}) Result {\n\tr := newResult()\n\tr.request.cmd = append(r.request.cmd, \"GET\", key)\n\tc.send(CmdGet, r)\n\treturn r\n}", "title": "" }, { "docid": "7cb06ead5add684ac908414775220b43", "score": "0.52010554", "text": "func (as *APIService) GetKey(key string) (entry *models.APIKey, err error) {\n\tentry = new(models.APIKey)\n\n\terr = DB.Select().\n\t\tWhere(dbx.HashExp{\"key\": key}).\n\t\tOne(entry)\n\n\treturn\n}", "title": "" }, { "docid": "ae3dfb810906fc81019bbf814e4ab961", "score": "0.5196377", "text": "func (c *ContractAccount) GetDataKey() []byte {\n\treturn []byte(\"mavl-\" + c.mdb.ExecutorName + \"-jvmContractInfo: \" + c.Addr)\n}", "title": "" }, { "docid": "a7d50727cf05eb96a8217b15e26d2dc1", "score": "0.5193158", "text": "func (q Qq) GetKey() string {\n\treturn q.Key\n}", "title": "" }, { "docid": "836b10a6816a3e9e68ac0118f872cec0", "score": "0.51809835", "text": "func (conn *Conn) Get(key string) Reply {\n\treturn conn.Do(\"GET\", key)\n}", "title": "" }, { "docid": "7db1dd4360639bfd1c5011ff30d65934", "score": "0.5178069", "text": "func (_KillCord *KillCordCaller) GetKey(opts *bind.CallOpts) (string, error) {\n\tvar out []interface{}\n\terr := _KillCord.contract.Call(opts, &out, \"getKey\")\n\n\tif err != nil {\n\t\treturn *new(string), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(string)).(*string)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "4f88a64576cb70de572a522f04eb662b", "score": "0.5163744", "text": "func (t *BankIDChainCode) Query(stub *shim.ChaincodeStub, function string, args []string) ([]byte, error) {\n\n\tswitch function {\n\n\tcase \"get-pubkey\":\n\n\t\tunitAlias := args[0]\n\t\tif unitAlias == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"Invalid unit name.\")\n\t\t}\n\n\t\tpubKey, _ := stub.GetState(fmt.Sprintf(\"%s%s\", bankid_constants.UnitPubKeysStatePrefix, unitAlias))\n\n\t\treturn pubKey, nil\n\n\tcase \"get-request\":\n\n\t\treturn queryHandler.GetRequestById(stub, args)\n\n\tcase \"get-requests-for-approve\":\n\n\t\treturn queryHandler.GetRequestsForApprove(stub, args)\n\n\tcase \"get-requests-all\":\n\n\t\treturn queryHandler.GetRequestsAll(stub, args)\n\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"Invalid query function name.\")\n\t}\n}", "title": "" }, { "docid": "824fc69ee68a2f0105cf42beb91eded9", "score": "0.51371396", "text": "func (b *redisBackend) keyFromQuery(q *dns.Msg) string {\n\tvar key strings.Builder\n\tkey.WriteString(b.opt.KeyPrefix)\n\tkey.WriteString(q.Question[0].Name)\n\tkey.WriteByte(':')\n\tkey.WriteString(dns.Class(q.Question[0].Qclass).String())\n\tkey.WriteByte(':')\n\tkey.WriteString(dns.Type(q.Question[0].Qtype).String())\n\tkey.WriteByte(':')\n\n\tedns0 := q.IsEdns0()\n\tif edns0 != nil {\n\t\tkey.WriteString(fmt.Sprintf(\"%t\", edns0.Do()))\n\t\tkey.WriteByte(':')\n\t\t// See if we have a subnet option\n\t\tfor _, opt := range edns0.Option {\n\t\t\tif subnet, ok := opt.(*dns.EDNS0_SUBNET); ok {\n\t\t\t\tkey.WriteString(subnet.Address.String())\n\t\t\t}\n\t\t}\n\t}\n\treturn key.String()\n}", "title": "" }, { "docid": "cad7c382632ced7ae0632d7d34c27c55", "score": "0.5124028", "text": "func (req Request) GetQuery(key string) string {\n\treturn req.Query.Get(key)\n}", "title": "" }, { "docid": "cc402b858e3588d5251c79e36abaa580", "score": "0.51147217", "text": "func GetQuery(endpoint_path string, keyVals map[string]string) ([]byte, error) {\n\n\tendpoint_url := API_BASE + endpoint_path\n\n\tv := url.Values{}\n\n\tfor key, val := range keyVals {\n\t\tv.Set(key, val)\n\t}\n\n\tlog.Printf(\"Querying %s\", endpoint_url+\"?\"+v.Encode())\n\tresp, err := http.Get(endpoint_url + \"?\" + v.Encode())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\tbody, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn body, err\n}", "title": "" }, { "docid": "9132997b4ccc16d8e28fdac438379cf3", "score": "0.51130545", "text": "func NtQueryKey(\n\tKeyHandle Handle,\n\tKeyInformationClass KeyInformationClass,\n\tKeyInformation *byte,\n\tLength uint32,\n\tResultLength *uint32,\n) NtStatus {\n\tr0, _, _ := procNtQueryKey.Call(uintptr(KeyHandle),\n\t\tuintptr(KeyInformationClass),\n\t\tuintptr(unsafe.Pointer(KeyInformation)),\n\t\tuintptr(Length),\n\t\tuintptr(unsafe.Pointer(ResultLength)))\n\treturn NtStatus(r0)\n}", "title": "" }, { "docid": "d8e44e2963b9a99c7b1fee1071192132", "score": "0.51070666", "text": "func (c *Itsyouonline) GetAPIkey(label, username string, headers, queryParams map[string]interface{}) (UserAPIKey, *http.Response, error) {\n\tqsParam := buildQueryString(queryParams)\n\tvar u UserAPIKey\n\n\t// create request object\n\treq, err := http.NewRequest(\"GET\", rootURL+\"/users/\"+username+\"/apikeys/\"+label+qsParam, nil)\n\tif err != nil {\n\t\treturn u, nil, err\n\t}\n\n\tif c.AuthHeader != \"\" {\n\t\treq.Header.Set(\"Authorization\", c.AuthHeader)\n\t}\n\n\tfor k, v := range headers {\n\t\treq.Header.Set(k, fmt.Sprintf(\"%v\", v))\n\t}\n\n\t//do the request\n\tresp, err := c.client.Do(req)\n\tif err != nil {\n\t\treturn u, nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\treturn u, resp, json.NewDecoder(resp.Body).Decode(&u)\n}", "title": "" }, { "docid": "37deda3a79dc675f59e3aa31d00a17ed", "score": "0.50968295", "text": "func (e *ApiClientService) GetKey(name string, keyname string) (key AccessKey, err error) {\n\turl := fmt.Sprintf(\"clients/%s/keys/%s\", name, keyname)\n\terr = e.client.magicRequestDecoder(\"GET\", url, nil, &key)\n\treturn\n}", "title": "" }, { "docid": "156671d14398a87d2af4d98af30be1db", "score": "0.50967324", "text": "func (t *SimpleChaincode) Query(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n\t\n\tfmt.Println(\"query is running \" + function)\n\t\n\tif function == \"read\" {\n\t\n\t\tvar key, jsonResp string\n\t\tvar err error\n\n\t\tif len(args) != 1 {\n\t\t\treturn nil, errors.New(\"Incorrect number of arguments. Expecting name of the key to query\")\n\t\t}\n\n\t\tkey = args[0]\n\t\tvalAsbytes, err := stub.GetState(key)\n\t\tif err != nil {\n\t\t\tjsonResp = \"{\\\"Error\\\":\\\"Failed to get state for \" + key + \"\\\"}\"\n\t\t\treturn nil, errors.New(jsonResp)\n\t\t}\n\t\t\n\t\treturn valAsbytes, nil\n\t}\n\treturn nil, nil\n}", "title": "" }, { "docid": "5c808763790646aa11d3ac68c77775da", "score": "0.5096618", "text": "func (c *control) Query(key string) string {\n\tfor idx := range c.params {\n\t\tif c.params[idx].key == key {\n\t\t\treturn c.params[idx].value\n\t\t}\n\t}\n\n\treturn c.req.URL.Query().Get(key)\n}", "title": "" }, { "docid": "7621bb5c27301a3caf0913af2684954c", "score": "0.5094421", "text": "func queryIDServerPubKey(ctx context.Context, idServerName string, keyID string) ([]byte, error) {\n\trequestURL := fmt.Sprintf(\"https://%s/_matrix/identity/api/v1/pubkey/%s\", idServerName, keyID)\n\treq, err := http.NewRequest(http.MethodGet, requestURL, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresp, err := http.DefaultClient.Do(req.WithContext(ctx))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar pubKeyRes struct {\n\t\tPublicKey spec.Base64Bytes `json:\"public_key\"`\n\t}\n\n\tif resp.StatusCode != http.StatusOK {\n\t\terrMsg := fmt.Sprintf(\"Couldn't retrieve key %s from server %s\", keyID, idServerName)\n\t\treturn nil, errors.New(errMsg)\n\t}\n\n\terr = json.NewDecoder(resp.Body).Decode(&pubKeyRes)\n\treturn pubKeyRes.PublicKey, err\n}", "title": "" }, { "docid": "aca7dfe556f0914223bac74f05ba8b7d", "score": "0.50925064", "text": "func Query(key string) QueryResult {\n\tdb, err := bolt.Open(\"jdict.db\", 0644, nil)\n\tCheckErr(err)\n\tdefer db.Close()\n\n\tresult := QueryResult{}\n\tresult.Key = key\n\n\terr = db.View(func(tx *bolt.Tx) error {\n\t\t// Lookup index for entry collection\n\n\t\tindexBucket := tx.Bucket(indexBucketName)\n\t\tif indexBucket == nil {\n\t\t\treturn fmt.Errorf(\"Bucket %q not found!\", indexBucketName)\n\t\t}\n\n\t\tentryIdsRaw := indexBucket.Get([]byte(key))\n\t\tif entryIdsRaw == nil {\n\t\t\treturn nil\n\t\t}\n\t\tentryIds := []int{}\n\t\terr := json.Unmarshal(json.RawMessage(entryIdsRaw), &entryIds)\n\n\t\t// Retrieve collect data\n\t\tentryBucket := tx.Bucket(entryBucketName)\n\t\tif entryBucket == nil {\n\t\t\treturn fmt.Errorf(\"Bucket %q not found!\", entryBucketName)\n\t\t}\n\n\t\tfor _, entryId := range entryIds {\n\t\t\tcollectData := entryBucket.Get(itob(entryId))\n\t\t\tcollect := EntryCollect{}\n\t\t\terr = json.Unmarshal(json.RawMessage(collectData), &collect)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t// Extract entry from combination code - [K - R - S] index\n\t\t\tentry := EntryResult{}\n\t\t\tcombineCode := collect.Keys[key]\n\t\t\tif combineCode[0] < 0 {\n\t\t\t\t// Query key in keb\n\t\t\t\tk := Keb{}\n\t\t\t\tk.Key = key\n\t\t\t\tentry.Kanji = append(entry.Kanji, k)\n\t\t\t} else if len(collect.KanjiSet) > 0 {\n\t\t\t\tentry.Kanji = collect.KanjiSet[combineCode[0]]\n\t\t\t}\n\n\t\t\tif combineCode[1] < 0 {\n\t\t\t\t// Query key in reb\n\t\t\t\tr := Reb{}\n\t\t\t\tr.Key = key\n\t\t\t\tentry.Reading = append(entry.Reading, r)\n\t\t\t} else if len(collect.ReadingSet) > 0 {\n\t\t\t\tentry.Reading = collect.ReadingSet[combineCode[1]]\n\t\t\t}\n\n\t\t\tif combineCode[2] < 0 {\n\t\t\t\ts := Sense{}\n\t\t\t\ts.Gloss = append(s.Gloss, key)\n\t\t\t\tentry.Meaning = []Sense{s}\n\t\t\t} else if combineCode[2] >= 0 && len(collect.SenseSet) > 0 {\n\t\t\t\t// Sense\n\t\t\t\tentry.Meaning = collect.SenseSet[combineCode[2]]\n\t\t\t}\n\n\t\t\tresult.Entries = append(result.Entries, entry)\n\t\t}\n\n\t\treturn nil\n\t})\n\tCheckErr(err)\n\n\treturn result\n\n}", "title": "" }, { "docid": "8c7f993a1dc5489a35054f2bfefc7b08", "score": "0.5088786", "text": "func (d *db) GetData(dbName, querierUserID, key string) (*types.ResponseEnvelope, error) {\n\tdataResponse, err := d.worldstateQueryProcessor.getData(dbName, querierUserID, key)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn d.signedResponseEnvelope(dataResponse)\n}", "title": "" }, { "docid": "efd380ec422d1df9291be21f5441b2eb", "score": "0.50702775", "text": "func (c *Context) Query(key string) string {\n\tvalue, _ := c.GetQuery(key)\n\treturn value\n}", "title": "" }, { "docid": "2f2df7b8daa71b3572c8af1193befa36", "score": "0.5069908", "text": "func (a *KeyManagementApi) GetApplicationKey(ctx _context.Context, appKeyId string, o ...GetApplicationKeyOptionalParameters) (ApplicationKeyResponse, *_nethttp.Response, error) {\n\tvar (\n\t\tlocalVarHTTPMethod = _nethttp.MethodGet\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarReturnValue ApplicationKeyResponse\n\t\toptionalParams GetApplicationKeyOptionalParameters\n\t)\n\n\tif len(o) > 1 {\n\t\treturn localVarReturnValue, nil, datadog.ReportError(\"only one argument of type GetApplicationKeyOptionalParameters is allowed\")\n\t}\n\tif len(o) == 1 {\n\t\toptionalParams = o[0]\n\t}\n\n\tlocalBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, \"v2.KeyManagementApi.GetApplicationKey\")\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}\n\t}\n\n\tlocalVarPath := localBasePath + \"/api/v2/application_keys/{app_key_id}\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"app_key_id\"+\"}\", _neturl.PathEscape(datadog.ParameterToString(appKeyId, \"\")), -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := _neturl.Values{}\n\tlocalVarFormParams := _neturl.Values{}\n\tif optionalParams.Include != nil {\n\t\tlocalVarQueryParams.Add(\"include\", datadog.ParameterToString(*optionalParams.Include, \"\"))\n\t}\n\tlocalVarHeaderParams[\"Accept\"] = \"application/json\"\n\n\tdatadog.SetAuthKeys(\n\t\tctx,\n\t\t&localVarHeaderParams,\n\t\t[2]string{\"apiKeyAuth\", \"DD-API-KEY\"},\n\t\t[2]string{\"appKeyAuth\", \"DD-APPLICATION-KEY\"},\n\t)\n\treq, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil)\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, err\n\t}\n\n\tlocalVarHTTPResponse, err := a.Client.CallAPI(req)\n\tif err != nil || localVarHTTPResponse == nil {\n\t\treturn localVarReturnValue, localVarHTTPResponse, err\n\t}\n\n\tlocalVarBody, err := datadog.ReadBody(localVarHTTPResponse)\n\tif err != nil {\n\t\treturn localVarReturnValue, localVarHTTPResponse, err\n\t}\n\n\tif localVarHTTPResponse.StatusCode >= 300 {\n\t\tnewErr := datadog.GenericOpenAPIError{\n\t\t\tErrorBody: localVarBody,\n\t\t\tErrorMessage: localVarHTTPResponse.Status,\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 {\n\t\t\tvar v APIErrorResponse\n\t\t\terr = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.ErrorModel = v\n\t\t}\n\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t}\n\n\terr = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\tif err != nil {\n\t\tnewErr := datadog.GenericOpenAPIError{\n\t\t\tErrorBody: localVarBody,\n\t\t\tErrorMessage: err.Error(),\n\t\t}\n\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t}\n\n\treturn localVarReturnValue, localVarHTTPResponse, nil\n}", "title": "" }, { "docid": "34e00ed7d5e7a3f00806c13978573324", "score": "0.5067163", "text": "func queryRecord(stub shim.ChaincodeStubInterface, args []string) peer.Response {\n\tif len(args) != 2 {\n\t\treturn shim.Error(errorIncorrectParamNum + \" Expecting 2\")\n\t}\n\n\tfmt.Println(\"args=\", args)\n\tobjectName := args[0]\n\tif objectName == \"\" {\n\t\treturn shim.Error(errorMissParam + \" Expect object name\")\n\t}\n\n\tkeywords := args[1]\n\tif keywords == \"\" {\n\t\treturn shim.Error(errorMissParam + \"Expect keywords list\")\n\t}\n\n\tvar keywordsList []string\n\terr := json.Unmarshal([]byte(keywords), &keywordsList)\n\tif err != nil {\n\t\treturn shim.Error(errorInvalidParam + \"Keywords list\")\n\t}\n\n\tkeyType, err := stub.GetState(objectName + \"_keytype\")\n\tif err != nil {\n\t\treturn shim.Error(errorBlockchainError + err.Error())\n\t}\n\tif keyType == nil {\n\t\treturn shim.Error(errorBlockchainError + err.Error())\n\t}\n\n\tkey, err := createKey(stub, objectName, keywordsList, string(keyType))\n\tif err != nil {\n\t\treturn shim.Error(errorBlockchainError + err.Error())\n\t}\n\n\tret, err := stub.GetState(key)\n\tif err != nil {\n\t\treturn shim.Error(errorBlockchainError + err.Error())\n\t} else if ret == nil {\n\t\treturn shim.Error(errorDataNotExist)\n\t} else {\n\t\treturn shim.Success(ret)\n\t}\n}", "title": "" }, { "docid": "97a232a16f21c8e25f29e4cbfb23a607", "score": "0.5052345", "text": "func (ic IritaHubChain) QueryOracle(key []byte) (value []byte, err error) {\n\t// TODO\n\treturn []byte{}, nil\n}", "title": "" }, { "docid": "17b1523fdaf8280f70e98e1d59ac1187", "score": "0.50490946", "text": "func (i *Acct) Query(stub *shim.ChaincodeStub, function string, args []string) ([]byte, error) {\n\n\tposterkey := args[0] + \"-\" + \"accts\"\n\tstateData, _ := stub.GetState(posterkey)\n\n\treturn stateData, nil\n}", "title": "" }, { "docid": "0ddc1ca9df0f9ad55a973d445f405140", "score": "0.50471234", "text": "func (appCtx *AppContext) GetQuery(key string) (string, bool) {\n\treturn appCtx.ctx.GetQuery(key)\n}", "title": "" }, { "docid": "fa3b408c7a885003234a4ef1127deb9a", "score": "0.5034488", "text": "func (c *Context) Query(key string) string {\n\treturn c.Req.URL.Query().Get(key)\n}", "title": "" }, { "docid": "f159b063acadfa924efd305f73be8d55", "score": "0.503447", "text": "func (m *Manager) getKey(unverified *jwt.Token) (interface{}, error) {\n // require token alg to match the set signing method, do not allow none\n if meth := unverified.Method; meth == nil || meth.Alg() != m.method.Alg() {\n return nil, jwt.ErrHashUnavailable\n }\n return m.key, nil\n}", "title": "" }, { "docid": "49d508274e520c2be79b9f29c6ed60f1", "score": "0.5033163", "text": "func (c *handlerRequest) getKey() string {\n\treturn fmt.Sprintf(\"%s:%s\", c.path, c.query)\n}", "title": "" }, { "docid": "f971cb00360341dc06ea7be2e58023ee", "score": "0.5032242", "text": "func queryIssAuthInfo(APIStub shim.ChaincodeStubInterface, args []string) peer.Response {\n\tfmt.Printf(\"queryIssAuthInfo...\")\n\tif len(args) != 1 {\n\t\treturn shim.Error(\"queryIssAuthInfo function needs the arguments: UUID\")\n\t}\n\n\tkey, err := APIStub.CreateCompositeKey(PREFIX_ISS_AUTHINFO, []string{args[0]})\n\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\n\tissAuthInfoAsBytes, err := APIStub.GetState(key)\n\n\tissAuthInfo := &IssAuthInfo{}\n\n\tjson.Unmarshal(issAuthInfoAsBytes, &issAuthInfo)\n\n\tissAuthInfo.UUID = args[0]\n\n\tissAuthInfoAsBytes, err = json.Marshal(issAuthInfo)\n\n\tif err != nil {\n\t\tfmt.Printf(\"APIStub.GetState is error\")\n\t\treturn shim.Error(err.Error())\n\t}\n\n\treturn shim.Success(issAuthInfoAsBytes)\n}", "title": "" }, { "docid": "7ed9da8502a95f3d2c5605ba77131d2d", "score": "0.5030482", "text": "func (s *HybridStorage) GetAuthRequest(id string) (*AuthRequest, error) {\n\trequest, ok := s.authRequests.Get(id)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"request not found\")\n\t}\n\treturn request, nil\n}", "title": "" }, { "docid": "a2d9f3340a1aba88a42d5f8566c04f8b", "score": "0.5029715", "text": "func KvGet(key string) (string, bool) {\n\n // Probably overkill, but we mutex database access\n mutex.Lock()\n defer mutex.Unlock()\n\n var success bool = true\n\n db, err := sql.Open(\"sqlite3\", dbPath)\n\n if (err != nil) {\n log.Fatal(err)\n }\n defer db.Close()\n\n rows, err := db.Query(\"SELECT VALUE FROM KVSTORE WHERE KEY=?;\", key)\n\n if (err != nil) {\n log.Fatal(err)\n }\n defer rows.Close()\n\n var value string = \"\"\n if (rows.Next()) {\n err = rows.Scan(&value)\n\n if (err != nil) {\n log.Fatal(err)\n }\n } else {\n success = false\n }\n\n return value, success\n}", "title": "" }, { "docid": "eba2c5d386e6bbf18986dd8461b33643", "score": "0.5023336", "text": "func (t *HousingChaincode) getRequest(stub shim.ChaincodeStubInterface, args []string) ([]byte, error) {\n\n\tif len(args) != 4 {\n\t\treturn nil, errors.New(\"Incorrect number of arguments. Expecting 4, \\\"RequestID\\\" : \\\"xxxxxx\\\"\")\n\t}\n\n\tif args[0] != \"Caller\" || args[2] != \"RequestID\" {\n\t\treturn nil, errors.New(\"Unsupoprted query arguments [\" + args[0] + \"] or [\" + args[2] + \"]\")\n\t}\n\n\tcallerCert := args[1]\n\n\trcLOK, rcLErr := t.hasRole(stub, callerCert, \"Landlord\")\n\n\tif rcLErr != nil {\n\t\treturn nil, fmt.Errorf(\"Failed checking role [%s]\", rcLErr)\n\t}\n\n\trcTOK, rcTErr := t.hasRole(stub, callerCert, \"Tenant\")\n\n\tif rcTErr != nil {\n\t\treturn nil, fmt.Errorf(\"Failed checking role [%s]\", rcTErr)\n\t}\n\n\trcSOK, rcSErr := t.hasRole(stub, callerCert, \"ServiceProvider\")\n\n\tif rcSErr != nil {\n\t\treturn nil, fmt.Errorf(\"Failed checking role [%s]\", rcSErr)\n\t}\n\n\tif !rcLOK && !rcTOK && !rcSOK {\n\t\treturn nil, errors.New(\"The invoker does not have the required roles.\")\n\t}\n\n\tfmt.Println(\"Start to query a Request ...\")\n\n\trequestID := args[3]\n\n\tvar columns []shim.Column\n\tkeyCol1 := shim.Column{Value: &shim.Column_String_{String_: requestID}}\n\n\tcolumns = append(columns, keyCol1)\n\n\trow, err := stub.GetRow(RequestTableName, columns)\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Query one request (RequestID = %s) in the table Request failed\", requestID)\n\t}\n\n\tif len(row.Columns) == 0 {\n\t\treturn nil, errors.New(\"Request was NOT found\")\n\t}\n\n\tfmt.Println(\"Query one request (RequestID = \" + requestID + \") in the table Request successfully...\")\n\n\t// Convert to the structure Request, the returns would be key1:value1,key2:value2,key3:value3, ...\n\trequest := &Request{\n\t\trow.Columns[0].GetString_(),\n\t\trow.Columns[1].GetString_(),\n\t\trow.Columns[2].GetString_(),\n\t\trow.Columns[3].GetString_(),\n\t\trow.Columns[4].GetString_(),\n\t\trow.Columns[5].GetString_(),\n\t\trow.Columns[6].GetString_(),\n\t\trow.Columns[7].GetString_(),\n\t\trow.Columns[8].GetString_(),\n\t\trow.Columns[9].GetString_(),\n\t\trow.Columns[10].GetString_(),\n\t\trow.Columns[11].GetString_(),\n\t\trow.Columns[12].GetString_(),\n\t}\n\n\treturnRequest, err := json.Marshal(request)\n\n\tif err != nil {\n\t\treturn nil, errors.New(\"getRequest() json marshal error\")\n\t}\n\n\tfmt.Println(\"End to query a Request ...\")\n\n\treturn returnRequest, nil\n}", "title": "" }, { "docid": "83642c4094e149c16ebe222774090216", "score": "0.50187707", "text": "func (m *dataRetriever) Query(ctxt context.Context, key *storeapi.QueryKey) (storeapi.ResultsIterator, error) {\n\tif m.err != nil {\n\t\treturn nil, m.err\n\t}\n\treturn newResultsIterator(m.queryResults[*key]), nil\n}", "title": "" }, { "docid": "381f9bf50417366c2062effaa996ef6d", "score": "0.5015072", "text": "func (r *RequestBuilder) Query(key, value string) *RequestBuilder {\n\tr.header.Add(key, value)\n\treturn r\n}", "title": "" }, { "docid": "18898edccad62ae2e80d7a5d8f99e4c9", "score": "0.5013916", "text": "func queryDBKey(client *redis.Client, key string) (string) {\n\tres, err := client.Get(key).Result()\n\tif err != nil {\n\t\tif err == redis.Nil {\n\t\t\treturn \"\"\n\t\t}\n\t\tlog.Println(\"database error\", err.Error())\n\t\treturn \"\"\n\t}\n\treturn res\n}", "title": "" }, { "docid": "17cd6075b8f581cfe0e144022aabfab7", "score": "0.5012256", "text": "func getRowKey(schemaName, querySignature string) string {\n\treturn schemaName + querySignature\n}", "title": "" }, { "docid": "217df71b4ea6a6910764c9e5c11adc00", "score": "0.50091285", "text": "func New(tp elastictransport.Interface) *QueryApiKeys {\n\tr := &QueryApiKeys{\n\t\ttransport: tp,\n\t\tvalues: make(url.Values),\n\t\theaders: make(http.Header),\n\t\tbuf: gobytes.NewBuffer(nil),\n\n\t\treq: NewRequest(),\n\t}\n\n\treturn r\n}", "title": "" }, { "docid": "0ecf2c83948aa7e163e852807bdde23f", "score": "0.5007469", "text": "func (p *ApiKeyAuthenticationProvider) AuthenticateRequest(ctx context.Context, request *abs.RequestInformation, additionalAuthenticationContext map[string]interface{}) error {\n\tctx, span := otel.GetTracerProvider().Tracer(\"github.com/microsoft/kiota-abstractions-go\").Start(ctx, \"GetAuthorizationToken\")\n\tdefer span.End()\n\tif request == nil {\n\t\treturn errors.New(\"request cannot be nil\")\n\t}\n\n\turl, err := request.GetUri()\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif !(*(p.validator)).IsUrlHostValid(url) {\n\t\tspan.SetAttributes(attribute.Bool(\"com.microsoft.kiota.authentication.is_url_valid\", false))\n\t\treturn nil\n\t}\n\tif !strings.EqualFold(url.Scheme, \"https\") {\n\t\tspan.SetAttributes(attribute.Bool(\"com.microsoft.kiota.authentication.is_url_valid\", false))\n\t\terr := errors.New(\"url scheme must be https\")\n\t\tspan.RecordError(err)\n\t\treturn err\n\t}\n\tspan.SetAttributes(attribute.Bool(\"com.microsoft.kiota.authentication.is_url_valid\", true))\n\n\tswitch p.keyLocation {\n\tcase QUERYPARAMETER_KEYLOCATION:\n\t\tquery := url.Query()\n\t\tquery.Set(p.parameterName, p.apiKey)\n\t\turl.RawQuery = query.Encode()\n\t\trequest.SetUri(*url)\n\tcase HEADER_KEYLOCATION:\n\t\trequest.Headers[p.parameterName] = p.apiKey\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "4c7bd3b8acffd5bb59124e85ff96159c", "score": "0.49892354", "text": "func (input *Input) Query(key string) string {\n\treturn input.QueryStrings().Get(key)\n}", "title": "" }, { "docid": "0e2acbed0c19ecd372917d991d037473", "score": "0.4982239", "text": "func (s *BadgerStore) Query(key string) ([]string, error) {\n\tvar jsStoreValue []byte\n\t// Get the JSON value for this key\n\terr := s.db.View(func(txn *badger.Txn) error {\n\t\titem, err := txn.Get([]byte(key))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tbyteVal, err := item.Value()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tjsStoreValue = byteVal\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Deserialize the JSON value to string array\n\tvar keyList []string\n\tif err := json.Unmarshal(jsStoreValue, &keyList); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn keyList, nil\n}", "title": "" }, { "docid": "65d3c76a35802f344159f7628f4c6232", "score": "0.49712855", "text": "func (e *Ibankdigital) ApiKeyGet(strRequestPath string, mapParams map[string]string) string {\n\tstrMethod := \"GET\"\n\ttimestamp := time.Now().UTC().Format(\"2006-01-02T15:04:05\")\n\n\tmapParams[\"AccessKeyId\"] = e.API_KEY\n\tmapParams[\"SignatureMethod\"] = \"HmacSHA256\"\n\tmapParams[\"SignatureVersion\"] = \"2\"\n\tmapParams[\"Timestamp\"] = timestamp\n\n\thostName := \"www.ibankex.io\"\n\tmapParams[\"Signature\"] = CreateSign(mapParams, strMethod, hostName, strRequestPath, e.API_SECRET)\n\tstrUrl := API_URL + strRequestPath\n\thttpClient := &http.Client{}\n\n\tvar strRequestUrl string\n\tif nil == mapParams {\n\t\tstrRequestUrl = strUrl\n\t} else {\n\t\tstrParams := exchange.Map2UrlQueryUrl(mapParams)\n\t\tstrRequestUrl = strUrl + \"?\" + strParams\n\t}\n\n\t// 构建Request, 并且按官方要求添加Http Header\n\trequest, err := http.NewRequest(\"GET\", strRequestUrl, nil)\n\tif nil != err {\n\t\treturn err.Error()\n\t}\n\trequest.Header.Add(\"User-Agent\", \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36\")\n\n\t// 发出请求\n\tresponse, err := httpClient.Do(request)\n\tif nil != err {\n\t\treturn err.Error()\n\t}\n\tdefer response.Body.Close()\n\n\t// 解析响应内容\n\tbody, err := ioutil.ReadAll(response.Body)\n\tif nil != err {\n\t\treturn err.Error()\n\t}\n\n\treturn string(body)\n}", "title": "" }, { "docid": "bce6b08af8f13cbf1b300727717fed39", "score": "0.49699968", "text": "func (o BgpGroupOutput) AuthKey() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *BgpGroup) pulumi.StringPtrOutput { return v.AuthKey }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "f0b57e30cb0dedfe5243339cad4ef84f", "score": "0.4968748", "text": "func (dal DataAccessLayerImpl) Get(ctx context.Context, key []byte) ([]byte, error) {\n\tcli := dal.rawKV.GetClient().(*rawkv.Client)\n\treturn cli.Get(ctx, key)\n}", "title": "" }, { "docid": "c67860344576146e8389bc39492ab1ae", "score": "0.49673542", "text": "func RequestUserKey(credentials *Credentials, path string) error {\n\tform := createKeyRequestForm(credentials)\n\tkey, err := post(loginURL, strings.NewReader(form.Encode()))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif len(key) != userKeyLen {\n\t\treturn fmt.Errorf(\"invalid user key received: %s\", key)\n\t}\n\n\tkeys := Keys{\n\t\tDevKey: credentials.DevKey,\n\t\tUserKey: key,\n\t}\n\n\treturn keys.save(path)\n}", "title": "" }, { "docid": "ead56da31bed25dc4f8bcda82c1a6c85", "score": "0.49667045", "text": "func (c *UserAccountClient) QueryAccountkeys(ua *UserAccount) *AccountKeyQuery {\n\tquery := &AccountKeyQuery{config: c.config}\n\tid := ua.ID\n\tstep := sqlgraph.NewStep(\n\t\tsqlgraph.From(useraccount.Table, useraccount.FieldID, id),\n\t\tsqlgraph.To(accountkey.Table, accountkey.FieldID),\n\t\tsqlgraph.Edge(sqlgraph.O2M, false, useraccount.AccountkeysTable, useraccount.AccountkeysColumn),\n\t)\n\tquery.sql = sqlgraph.Neighbors(ua.driver.Dialect(), step)\n\n\treturn query\n}", "title": "" }, { "docid": "b57649c0f4a6e61830dbaa248d3d94d4", "score": "0.49663076", "text": "func (o LinkedIntegrationRuntimeKeyAuthorizationResponseOutput) Key() SecureStringResponseOutput {\n\treturn o.ApplyT(func(v LinkedIntegrationRuntimeKeyAuthorizationResponse) SecureStringResponse { return v.Key }).(SecureStringResponseOutput)\n}", "title": "" }, { "docid": "99dc114ac9a748e0dbfe5f365e4127e5", "score": "0.49652177", "text": "func GetKey(c *gin.Context) {\n\tkeyID := c.Param(\"id\")\n\n\tlog.WithFields(log.Fields{\"id\": keyID}).Info(\"Getting key\")\n\n\tfile := \"key-\" + keyID\n\tif key, err := readKey(file); err == nil {\n\t\tc.JSON(http.StatusOK, key)\n\t} else {\n\t\tc.Status(http.StatusNotFound)\n\t}\n}", "title": "" }, { "docid": "ae616da6ad6354a55b62d96877aabc6b", "score": "0.49629286", "text": "func AuthKey() (string, error) {\n\tkey := os.Getenv(\"AUTH_KEY\")\n\n\tif key != \"\" {\n\t\treturn key, nil\n\t}\n\n\treturn \"\", errors.New(\"Environment variable AUTH_KEY does not exist. Make sure it's using the same value as the backend service.\")\n}", "title": "" }, { "docid": "f52a6ac0cfea28ee865d4df2f3cf5899", "score": "0.49497595", "text": "func (c *Client) Auth1() (string, string, error) {\n\tconst authURL = \"https://radiko.jp/v2/api/auth1\"\n\n\treq, err := http.NewRequest(\"GET\", authURL, nil)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\n\tparams := map[string]string{\n\t\t\"User-Agent\": \"curl/7.56.1\",\n\t\t\"Accept\": \"*/*\",\n\t\t\"pragma\": \"no-cache\",\n\t\t\"x-radiko-app\": \"pc_html5\",\n\t\t\"x-radiko-app-version\": \"0.0.1\",\n\t\t\"x-radiko-device\": \"pc\",\n\t\t\"x-radiko-user\": \"dummy_user\",\n\t}\n\n\tresp, err := c.c.Do(addHeader(req, params))\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn \"\", \"\", errors.New(\"failed to get auth token\")\n\t}\n\n\ttoken := resp.Header.Get(\"X-Radiko-AuthToken\")\n\tkeyLength, _ := strconv.Atoi(resp.Header.Get(\"X-Radiko-KeyLength\"))\n\tkeyOffset, _ := strconv.Atoi(resp.Header.Get(\"X-Radiko-KeyOffset\"))\n\n\t// TODO: 正規表現でsrcからちゃんと取得するようにする\n\tkey := \"bcd151073c03b352e1ef2fd66c32209da9ca0afa\"\n\tcnvKey := key[keyOffset : keyOffset+keyLength]\n\tpartialKey := base64.StdEncoding.EncodeToString([]byte(cnvKey))\n\n\treturn token, partialKey, nil\n}", "title": "" }, { "docid": "1fff3d65281b0b08c075803b07f1582a", "score": "0.49496406", "text": "func (s *Server) Get(ctx context.Context, q *gpgkeypkg.GnuPGPublicKeyQuery) (*appsv1.GnuPGPublicKey, error) {\n\tif err := s.enf.EnforceErr(ctx.Value(\"claims\"), rbacpolicy.ResourceGPGKeys, rbacpolicy.ActionGet, \"\"); err != nil {\n\t\treturn nil, err\n\t}\n\n\tkeyID := gpg.KeyID(q.KeyID)\n\tif keyID == \"\" {\n\t\treturn nil, fmt.Errorf(\"KeyID is malformed or empty\")\n\t}\n\n\tkeys, err := s.db.ListConfiguredGPGPublicKeys(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif key, ok := keys[keyID]; ok {\n\t\treturn key, nil\n\t}\n\n\treturn nil, fmt.Errorf(\"No such key: %s\", keyID)\n}", "title": "" }, { "docid": "fe6749cb1d73a4269fae4da3fe037bee", "score": "0.49284187", "text": "func (m *miningHarness) GetKey(addr stdaddr.Address) ([]byte, dcrec.SignatureType, bool, error) {\n\treturn m.signKey, m.sigType, true, nil\n}", "title": "" }, { "docid": "cffe6211130e7760786583fced5eb0a2", "score": "0.4927749", "text": "func requireGetKeySuccess(t *testing.T, dbStore trustmanager.KeyStore, expectedRole string, expectedKey data.PrivateKey) {\n\tretrKey, role, err := dbStore.GetKey(expectedKey.ID())\n\trequire.NoError(t, err)\n\trequire.Equal(t, expectedRole, role)\n\trequire.Equal(t, retrKey.Private(), expectedKey.Private())\n\trequire.Equal(t, retrKey.Algorithm(), expectedKey.Algorithm())\n\trequire.Equal(t, retrKey.Public(), expectedKey.Public())\n\trequire.Equal(t, retrKey.SignatureAlgorithm(), expectedKey.SignatureAlgorithm())\n}", "title": "" }, { "docid": "2dcecf51452b767d537f49966ae28c00", "score": "0.49191108", "text": "func GetKey() []byte {\n\treturn keyData\n}", "title": "" }, { "docid": "6fada5fdd3a4c2840cfe62ea83aa823e", "score": "0.49152756", "text": "func (app *DirectoryBlockChain) Query(reqQuery abci.RequestQuery) (resQuery abci.ResponseQuery) {\n\tresQuery.Key = reqQuery.Data\n\t/*\n\t\terr := app.db.View(func(txn *badger.Txn) error {\n\t\t\titem, err := txn.Get(reqQuery.Data)\n\t\t\tif err != nil && err != badger.ErrKeyNotFound {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err == badger.ErrKeyNotFound {\n\t\t\t\tresQuery.Log = \"does not exist\"\n\t\t\t} else {\n\t\t\t\treturn item.Value(func(val []byte) error {\n\t\t\t\t\tresQuery.Log = \"exists\"\n\t\t\t\t\tresQuery.Value = val\n\t\t\t\t\treturn nil\n\t\t\t\t})\n\t\t\t}\n\t\t\treturn nil\n\t\t})\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t*/\n\treturn\n}", "title": "" }, { "docid": "22c6054f1d384ae41afdec81d4446674", "score": "0.4913615", "text": "func (e ResponseFlags_UnauthorizedValidationError) Key() bool { return e.key }", "title": "" }, { "docid": "d85a1e14b1f0a42b0b2ea0f6c26c20e3", "score": "0.49040043", "text": "func (o *With) GetQueryAccessKey() bool {\n\tif o == nil || o.QueryAccessKey == nil {\n\t\tvar ret bool\n\t\treturn ret\n\t}\n\treturn *o.QueryAccessKey\n}", "title": "" }, { "docid": "0736de2dfee3af6c9c0c81d2251c4890", "score": "0.49035513", "text": "func (c *EncryptionGRPC) Key() string {\n\treturn c.key\n}", "title": "" }, { "docid": "89431dfe31b6344c1fe199df2c150166", "score": "0.49004036", "text": "func Authenticate(state []State, key string) Rc {\n\tcstate, _ := (*C.ykpiv_state)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&state)).Data)), cgoAllocsUnknown\n\tckey, _ := unpackPUcharString(key)\n\t__ret := C.ykpiv_authenticate(cstate, ckey)\n\t__v := (Rc)(__ret)\n\treturn __v\n}", "title": "" } ]
5f7aa499b35191484c978f6052046f7d
SetMaxInst_2 sets cunter in shared memory
[ { "docid": "43f2569de0f96ecdca79ae6a3613f16b", "score": "0.62582314", "text": "func (mtr *Pcrmpu2interrMetrics) SetMaxInst_2(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_2\"))\n\treturn nil\n}", "title": "" } ]
[ { "docid": "13db045f0a6b7379da0a15678eb20662", "score": "0.6369253", "text": "func (mtr *Pcrmpu0interrMetrics) SetMaxInst_2(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_2\"))\n\treturn nil\n}", "title": "" }, { "docid": "c5ce3d290519a3945284a422bb478cf9", "score": "0.6353798", "text": "func (mtr *Pcrmpu5interrMetrics) SetMaxInst_2(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_2\"))\n\treturn nil\n}", "title": "" }, { "docid": "0f9927b41e7011ef023407a8047c6701", "score": "0.63523054", "text": "func (mtr *Pcrmpu4interrMetrics) SetMaxInst_2(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_2\"))\n\treturn nil\n}", "title": "" }, { "docid": "5d095980a22a06c7f13f3e60cbbf56ff", "score": "0.635152", "text": "func (mtr *Pcrmpu6interrMetrics) SetMaxInst_2(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_2\"))\n\treturn nil\n}", "title": "" }, { "docid": "ea05d0aacdeec51f488ad100849dfcd2", "score": "0.63488424", "text": "func (mtr *Pctmpu5interrMetrics) SetMaxInst_2(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_2\"))\n\treturn nil\n}", "title": "" }, { "docid": "d9865fec83144303634ba224174d9a52", "score": "0.6348671", "text": "func (mtr *Pcrmpu7interrMetrics) SetMaxInst_2(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_2\"))\n\treturn nil\n}", "title": "" }, { "docid": "6ce2288a58263417072bd98e61b26521", "score": "0.634644", "text": "func (mtr *Pctmpu0interrMetrics) SetMaxInst_2(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_2\"))\n\treturn nil\n}", "title": "" }, { "docid": "a1ddda8ba6f82d7f787d077c8fd248aa", "score": "0.6345342", "text": "func (mtr *Pctmpu6interrMetrics) SetMaxInst_2(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_2\"))\n\treturn nil\n}", "title": "" }, { "docid": "8aa8bcade7a6776ba916d8016999db88", "score": "0.63398504", "text": "func (mtr *Pctmpu7interrMetrics) SetMaxInst_2(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_2\"))\n\treturn nil\n}", "title": "" }, { "docid": "06bf89426dfa499b0b8a6721a228ed0a", "score": "0.6332576", "text": "func (mtr *Pctmpu4interrMetrics) SetMaxInst_2(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_2\"))\n\treturn nil\n}", "title": "" }, { "docid": "163d88fd21d152bb59409a44375e2c5e", "score": "0.6327619", "text": "func (mtr *Pcrmpu3interrMetrics) SetMaxInst_2(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_2\"))\n\treturn nil\n}", "title": "" }, { "docid": "bed5fafca02aa122cc8ea580661f3064", "score": "0.6319405", "text": "func (mtr *Pctmpu3interrMetrics) SetMaxInst_2(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_2\"))\n\treturn nil\n}", "title": "" }, { "docid": "938a93bbadb70751100ac5335b1cf8fe", "score": "0.62907004", "text": "func (mtr *Pcrmpu1interrMetrics) SetMaxInst_2(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_2\"))\n\treturn nil\n}", "title": "" }, { "docid": "220a90ec833620da5b71beec2cf35a75", "score": "0.6281932", "text": "func (mtr *Pctmpu1interrMetrics) SetMaxInst_2(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_2\"))\n\treturn nil\n}", "title": "" }, { "docid": "7cfc748c0475b5d9c3fcfec4791b06fd", "score": "0.6262675", "text": "func (mtr *Pctmpu2interrMetrics) SetMaxInst_2(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_2\"))\n\treturn nil\n}", "title": "" }, { "docid": "398151a5c8b44ff4b8fdf70dfe4fe869", "score": "0.59268254", "text": "func (mtr *Pcrmpu2interrMetrics) SetMaxInst_1(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_1\"))\n\treturn nil\n}", "title": "" }, { "docid": "00ca442d0dc1e2b82f1d6fb25386d274", "score": "0.59261364", "text": "func (mtr *Pctmpu2interrMetrics) SetMaxInst_1(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_1\"))\n\treturn nil\n}", "title": "" }, { "docid": "eee633622206b1b797cbc8ff4024fefe", "score": "0.5923503", "text": "func (mtr *Pctmpu3interrMetrics) SetMaxInst_1(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_1\"))\n\treturn nil\n}", "title": "" }, { "docid": "b3ce25d49abedce947efff4628b0bb83", "score": "0.59183705", "text": "func (mtr *Pctmpu6interrMetrics) SetMaxInst_1(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_1\"))\n\treturn nil\n}", "title": "" }, { "docid": "91ebdf1ad1a0b537a7df2dea5ddb0ef2", "score": "0.5914767", "text": "func (mtr *Pcrmpu3interrMetrics) SetMaxInst_1(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_1\"))\n\treturn nil\n}", "title": "" }, { "docid": "35bbf24245a318c77c2d400e454ab953", "score": "0.5909433", "text": "func (mtr *Pctmpu4interrMetrics) SetMaxInst_1(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_1\"))\n\treturn nil\n}", "title": "" }, { "docid": "5da3caf6e62d75556367b5e84f8cb1b4", "score": "0.5906168", "text": "func (mtr *Pcrmpu6interrMetrics) SetMaxInst_1(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_1\"))\n\treturn nil\n}", "title": "" }, { "docid": "3e2e8df0d60c09c3b350978f27c72e58", "score": "0.5905251", "text": "func (mtr *Pcrmpu4interrMetrics) SetMaxInst_1(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_1\"))\n\treturn nil\n}", "title": "" }, { "docid": "6a649d4393f316556e144ec26fdb9474", "score": "0.5900503", "text": "func (mtr *Pctmpu7interrMetrics) SetMaxInst_1(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_1\"))\n\treturn nil\n}", "title": "" }, { "docid": "7ae7297c0eba88d45899e9dec529b72c", "score": "0.5885758", "text": "func (mtr *Pcrmpu7interrMetrics) SetMaxInst_1(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_1\"))\n\treturn nil\n}", "title": "" }, { "docid": "84e5f8aee43ebe51e1360e09c8b9e357", "score": "0.5878305", "text": "func (mtr *Pctmpu5interrMetrics) SetMaxInst_1(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_1\"))\n\treturn nil\n}", "title": "" }, { "docid": "9cb05697768432ffccd5faea15d5f326", "score": "0.58684236", "text": "func (mtr *Pcrmpu0interrMetrics) SetMaxInst_1(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_1\"))\n\treturn nil\n}", "title": "" }, { "docid": "c74ca09a2104bf0091cce0909ac54654", "score": "0.5854888", "text": "func (mtr *Pcrmpu5interrMetrics) SetMaxInst_1(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_1\"))\n\treturn nil\n}", "title": "" }, { "docid": "0d36474bf7fe31a2eca8d7114d998a7d", "score": "0.5847118", "text": "func (mtr *Pctmpu0interrMetrics) SetMaxInst_1(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_1\"))\n\treturn nil\n}", "title": "" }, { "docid": "2e33f37b4d9daaf6c70dda110eae4f2c", "score": "0.58029217", "text": "func (mtr *Pctmpu1interrMetrics) SetMaxInst_1(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_1\"))\n\treturn nil\n}", "title": "" }, { "docid": "0aa4780b800d73cfa37d6ef1d5da3d61", "score": "0.57896537", "text": "func (mtr *Pcrmpu1interrMetrics) SetMaxInst_1(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_1\"))\n\treturn nil\n}", "title": "" }, { "docid": "8aca4d4ac4530bf64056f9a1e4b9d88e", "score": "0.57361263", "text": "func (mtr *Pctmpu2interrMetrics) SetMaxInst_0(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_0\"))\n\treturn nil\n}", "title": "" }, { "docid": "7eb0f4b663c775406ec1c0b284a9a09d", "score": "0.5733684", "text": "func (mtr *Pcrmpu2interrMetrics) SetMaxInst_0(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_0\"))\n\treturn nil\n}", "title": "" }, { "docid": "ea6cc65105492d5fc089a3d228df4a2c", "score": "0.569976", "text": "func (mtr *Pctmpu6interrMetrics) SetMaxInst_0(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_0\"))\n\treturn nil\n}", "title": "" }, { "docid": "5077a2b21c4fb77696299f704ea493fd", "score": "0.5695422", "text": "func (mtr *Pctmpu5interrMetrics) SetMaxInst_3(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_3\"))\n\treturn nil\n}", "title": "" }, { "docid": "0216da7f2cbfbf6f4b7a21fafe89a93c", "score": "0.56931406", "text": "func (mtr *Pctmpu6interrMetrics) SetMaxInst_3(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_3\"))\n\treturn nil\n}", "title": "" }, { "docid": "2f39568a960d53ef529c9f511fe816a5", "score": "0.569242", "text": "func (mtr *Pctmpu2interrMetrics) SetMaxInst_3(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_3\"))\n\treturn nil\n}", "title": "" }, { "docid": "4fff7e8d9f7fca6da2198ada0635a799", "score": "0.5691373", "text": "func (mtr *Pctmpu0interrMetrics) SetMaxInst_3(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_3\"))\n\treturn nil\n}", "title": "" }, { "docid": "28e5634511addde93a24476ecebe8391", "score": "0.5686069", "text": "func (mtr *Pcrmpu2interrMetrics) SetMaxInst_3(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_3\"))\n\treturn nil\n}", "title": "" }, { "docid": "8295911d9c910866f3ec42dbb3b9a835", "score": "0.5685157", "text": "func (mtr *Pctmpu5interrMetrics) SetMaxInst_0(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_0\"))\n\treturn nil\n}", "title": "" }, { "docid": "3ad5c78dd00ccdf138a00ca8c65aa70d", "score": "0.56803936", "text": "func (mtr *Pctmpu7interrMetrics) SetMaxInst_3(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_3\"))\n\treturn nil\n}", "title": "" }, { "docid": "633735f19fb3fcb5ade67299391e36c5", "score": "0.5678959", "text": "func (mtr *Pcrmpu0interrMetrics) SetMaxInst_3(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_3\"))\n\treturn nil\n}", "title": "" }, { "docid": "194d6494e90e576c415ad127e7eafc34", "score": "0.5677994", "text": "func (mtr *Pcrmpu6interrMetrics) SetMaxInst_0(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_0\"))\n\treturn nil\n}", "title": "" }, { "docid": "b6d57c38ddaaddc31cb1e8286ad551df", "score": "0.567712", "text": "func (mtr *Pctmpu3interrMetrics) SetMaxInst_0(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_0\"))\n\treturn nil\n}", "title": "" }, { "docid": "5fd5c54ef9c4da8b2582bdba625eb90c", "score": "0.56677336", "text": "func (mtr *Pcrmpu3interrMetrics) SetMaxInst_0(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_0\"))\n\treturn nil\n}", "title": "" }, { "docid": "880d200a874ce620d59f809c5776129d", "score": "0.56651074", "text": "func (mtr *Pctmpu4interrMetrics) SetMaxInst_3(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_3\"))\n\treturn nil\n}", "title": "" }, { "docid": "aee04fb1b77ea34eb191bb7f8e27cf03", "score": "0.5662368", "text": "func (mtr *Pcrmpu6interrMetrics) SetMaxInst_3(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_3\"))\n\treturn nil\n}", "title": "" }, { "docid": "f38cf56ca83caec0552d9cae1ba54e13", "score": "0.5659651", "text": "func (mtr *Pcrmpu5interrMetrics) SetMaxInst_0(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_0\"))\n\treturn nil\n}", "title": "" }, { "docid": "e2af1cea4a1ce3052179fcd7ced7f32b", "score": "0.5657842", "text": "func (mtr *Pctmpu0interrMetrics) SetMaxInst_0(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_0\"))\n\treturn nil\n}", "title": "" }, { "docid": "99dcf79b0164fe16cccf0d38ae93e350", "score": "0.56550217", "text": "func (mtr *Pctmpu7interrMetrics) SetMaxInst_0(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_0\"))\n\treturn nil\n}", "title": "" }, { "docid": "f145b0949cfc54eaede603b0d62c8ee9", "score": "0.5652229", "text": "func (mtr *Pcrmpu1interrMetrics) SetMaxInst_0(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_0\"))\n\treturn nil\n}", "title": "" }, { "docid": "04777a70f80b4e340a5cd1bb4541b796", "score": "0.56518835", "text": "func (mtr *Pctmpu4interrMetrics) SetMaxInst_0(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_0\"))\n\treturn nil\n}", "title": "" }, { "docid": "8e7b224eceeebadf427570868a1a4a1d", "score": "0.5644206", "text": "func (mtr *Pcrmpu4interrMetrics) SetMaxInst_0(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_0\"))\n\treturn nil\n}", "title": "" }, { "docid": "5dabb9c234c09c47e3a2db552dbe0f64", "score": "0.56436", "text": "func (mtr *Pcrmpu0interrMetrics) SetMaxInst_0(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_0\"))\n\treturn nil\n}", "title": "" }, { "docid": "6d7ae5cc10e1ca841d73f469d47fc379", "score": "0.564328", "text": "func (mtr *Pcrmpu7interrMetrics) SetMaxInst_3(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_3\"))\n\treturn nil\n}", "title": "" }, { "docid": "57564033a310318f29c566b4ad06b3df", "score": "0.5642768", "text": "func (mtr *Pcrmpu4interrMetrics) SetMaxInst_3(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_3\"))\n\treturn nil\n}", "title": "" }, { "docid": "856ef708b3188b101e0642d7eb3031e4", "score": "0.5640645", "text": "func (mtr *Pcrmpu5interrMetrics) SetMaxInst_3(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_3\"))\n\treturn nil\n}", "title": "" }, { "docid": "5560e3a248134df80548afe5527843e8", "score": "0.5638311", "text": "func (mtr *Pcrmpu7interrMetrics) SetMaxInst_0(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_0\"))\n\treturn nil\n}", "title": "" }, { "docid": "bb634e3f26177ca4d8790f49f6eb5e5e", "score": "0.5638149", "text": "func (mtr *Pctmpu1interrMetrics) SetMaxInst_0(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_0\"))\n\treturn nil\n}", "title": "" }, { "docid": "d14679d29f4435cf7a495b74a28e7ae6", "score": "0.56305426", "text": "func (mtr *Pctmpu1interrMetrics) SetMaxInst_3(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_3\"))\n\treturn nil\n}", "title": "" }, { "docid": "57416415edd22d53b3d3e16413d9c0f1", "score": "0.5630391", "text": "func (mtr *Pcrmpu1interrMetrics) SetMaxInst_3(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_3\"))\n\treturn nil\n}", "title": "" }, { "docid": "bfd04d09d9d3878dc725688f36d3d3f6", "score": "0.55564386", "text": "func (mtr *Pctmpu3interrMetrics) SetMaxInst_3(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_3\"))\n\treturn nil\n}", "title": "" }, { "docid": "5bbab2b7cf34b88e84773125a3702775", "score": "0.5461329", "text": "func (m *DepIOSEnrollmentProfile) SetSharedIPadMaximumUserCount(value *int32)() {\n err := m.GetBackingStore().Set(\"sharedIPadMaximumUserCount\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "7a5dc403bd82ff38003b4e1a77f3cc77", "score": "0.5451779", "text": "func (mtr *Pcrmpu3interrMetrics) SetMaxInst_3(val metrics.Counter) error {\n\tmtr.metrics.SetCounter(val, mtr.getOffset(\"MaxInst_3\"))\n\treturn nil\n}", "title": "" }, { "docid": "95477b97f6e75d09224f412c64cf3fdc", "score": "0.5403658", "text": "func (p *Pool) SetMaxConnections(m int) {\n}", "title": "" }, { "docid": "ed9b5deebfbf2b48fd1693ba3d783bce", "score": "0.51178944", "text": "func SetMaxThreads(threads int) int", "title": "" }, { "docid": "ed9b5deebfbf2b48fd1693ba3d783bce", "score": "0.51178944", "text": "func SetMaxThreads(threads int) int", "title": "" }, { "docid": "0769a20be3f1795ef0817679de13d9b3", "score": "0.5101714", "text": "func (o GroupMixedInstancesPolicyLaunchTemplateOverrideInstanceRequirementsAcceleratorTotalMemoryMibOutput) Max() pulumi.IntPtrOutput {\n\treturn o.ApplyT(func(v GroupMixedInstancesPolicyLaunchTemplateOverrideInstanceRequirementsAcceleratorTotalMemoryMib) *int {\n\t\treturn v.Max\n\t}).(pulumi.IntPtrOutput)\n}", "title": "" }, { "docid": "5f3b91c95961600aeb576bfd2c89d716", "score": "0.503157", "text": "func (px *Paxos) Max() int {\n // Your code here.\n px.mu.Lock()\n defer px.mu.Unlock()\n //if len(px.instance_map)\n cur_max := -1\n for k := range px.instance_map{\n if k>cur_max{\n cur_max = k\n }\n }\n return cur_max\n}", "title": "" }, { "docid": "3903e864d59938eb1519727995a600c6", "score": "0.5021439", "text": "func (o GroupMixedInstancesPolicyLaunchTemplateOverrideInstanceRequirementsAcceleratorTotalMemoryMibPtrOutput) Max() pulumi.IntPtrOutput {\n\treturn o.ApplyT(func(v *GroupMixedInstancesPolicyLaunchTemplateOverrideInstanceRequirementsAcceleratorTotalMemoryMib) *int {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Max\n\t}).(pulumi.IntPtrOutput)\n}", "title": "" }, { "docid": "c457b2d647ca7e2ff74e36cc21b6f1c8", "score": "0.49631608", "text": "func (o GroupMixedInstancesPolicyLaunchTemplateOverrideInstanceRequirementsMemoryMibOutput) Max() pulumi.IntPtrOutput {\n\treturn o.ApplyT(func(v GroupMixedInstancesPolicyLaunchTemplateOverrideInstanceRequirementsMemoryMib) *int {\n\t\treturn v.Max\n\t}).(pulumi.IntPtrOutput)\n}", "title": "" }, { "docid": "c55010fcde8e765d278ed0a9d4d62355", "score": "0.4955902", "text": "func resetMaxCli() {\n hostName, _ := os.Hostname()\n log.Printf(\"name: %v\\n\", hostName)\n if (hostName == \"zxMBP.local\" || hostName == \"zxmbp.local\" ||\n hostName == \"mini.local\") {\n maxClient = 100\n maxMsgPerClient = 1000\n }\n}", "title": "" }, { "docid": "dffd161c0b66355db3a7b4176383be98", "score": "0.49398267", "text": "func mpreinit(mp *m) {\n\tmp.gsignal = malg(32 * 1024)\n\tmp.gsignal.m = mp\n}", "title": "" }, { "docid": "e6a03b732d5aa0eda3d4eae0a3ee8f4f", "score": "0.49113107", "text": "func init() {\n\truntime.GOMAXPROCS(runtime.NumCPU())\n}", "title": "" }, { "docid": "93b3a7c9c131e2e2df9810de9d3efef0", "score": "0.48861498", "text": "func newInstStopper(maxInst uint64) *instTracer {\n\tt := &instTracer{\n\t\tmaxCount: maxInst,\n\t\tinflightInst: map[string]tracing.Task{},\n\t}\n\treturn t\n}", "title": "" }, { "docid": "f4375966a4f4e70d7638a1994be0417d", "score": "0.4869393", "text": "func initEngine() {\n\tfor i, _ := range registers {\n\t\tregisters[i] = 0\n\t}\n\tregisters[r6] = dMemSize //mp\n}", "title": "" }, { "docid": "e580c0ec26c080443d86317d0576c542", "score": "0.48464924", "text": "func GOMAXTHREADS(n int) int {\n\treturn int(atomic.SwapInt32(&maxThread, int32(n)))\n}", "title": "" }, { "docid": "d715e212f863433086da631042374f3a", "score": "0.48450318", "text": "func init() {\n\tvar rLimit syscall.Rlimit\n\tif err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rLimit); err != nil {\n\t\tstdErr.Printf(\"Could not read max file limit: %s\\n\", err)\n\t}\n\trLimit.Cur = uint64(math.Max(minFileDescriptors, float64(rLimit.Cur)))\n\tif err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rLimit); err != nil {\n\t\tstdErr.Printf(\"Could not set file descriptor limits. Themekit will work, but you might encounter issues if your project holds many files. You can set the limits manually using ulimit -n 2048: %v\", err)\n\t}\n}", "title": "" }, { "docid": "063646fd1cdc8775d56b67d12a44703d", "score": "0.48248187", "text": "func (o GroupMixedInstancesPolicyLaunchTemplateOverrideInstanceRequirementsMemoryMibPtrOutput) Max() pulumi.IntPtrOutput {\n\treturn o.ApplyT(func(v *GroupMixedInstancesPolicyLaunchTemplateOverrideInstanceRequirementsMemoryMib) *int {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Max\n\t}).(pulumi.IntPtrOutput)\n}", "title": "" }, { "docid": "0829b9b32923234a6bf9d01b3a5a1138", "score": "0.4823027", "text": "func configureMultiInstance(t *testing.T, cli *client.Client) (error, string, string, []string) {\n\n\tqmsharedlogs := createVolume(t, cli, \"qmsharedlogs\")\n\tqmshareddata := createVolume(t, cli, \"qmshareddata\")\n\n\terr, qm1aId, qm1aData := startMultiVolumeQueueManager(t, cli, true, qmsharedlogs.Name, qmshareddata.Name, miEnv)\n\tif err != nil {\n\t\treturn err, \"\", \"\", []string{}\n\t}\n\ttime.Sleep(10 * time.Second)\n\terr, qm1bId, qm1bData := startMultiVolumeQueueManager(t, cli, true, qmsharedlogs.Name, qmshareddata.Name, miEnv)\n\tif err != nil {\n\t\treturn err, \"\", \"\", []string{}\n\t}\n\n\tvolumes := []string{qmsharedlogs.Name, qmshareddata.Name, qm1aData, qm1bData}\n\n\treturn nil, qm1aId, qm1bId, volumes\n}", "title": "" }, { "docid": "8ffd9693b786703fa9d12af5ce219985", "score": "0.48203248", "text": "func TestSlabsAlloc2(t *testing.T) {\n mp := &mempool_t{}\n mp.free_slab_list = nil\n mp.mem_allocated = 0\n mp.mem_limit = 0\n s := mp.slab_alloc()\n if s!=nil {\n t.Log(\"s\", s)\n t.Error(\"slab_alloc not correct\")\n }\n}", "title": "" }, { "docid": "dfea976c6349f224d920e5213273c485", "score": "0.48156732", "text": "func configureMultiInstance(t *testing.T, cli ce.ContainerInterface) (error, string, string, []string) {\n\n\tqmsharedlogs := createVolume(t, cli, \"qmsharedlogs\")\n\tqmshareddata := createVolume(t, cli, \"qmshareddata\")\n\n\terr, qm1aId, qm1aData := startMultiVolumeQueueManager(t, cli, true, qmsharedlogs, qmshareddata, miEnv)\n\tif err != nil {\n\t\treturn err, \"\", \"\", []string{}\n\t}\n\ttime.Sleep(10 * time.Second)\n\terr, qm1bId, qm1bData := startMultiVolumeQueueManager(t, cli, true, qmsharedlogs, qmshareddata, miEnv)\n\tif err != nil {\n\t\treturn err, \"\", \"\", []string{}\n\t}\n\n\tvolumes := []string{qmsharedlogs, qmshareddata, qm1aData, qm1bData}\n\n\treturn nil, qm1aId, qm1bId, volumes\n}", "title": "" }, { "docid": "32a6b0b0e0785fa9bee4b1701f352d73", "score": "0.48120204", "text": "func (p *WorkerPool) Max(max int) {\n\tatomic.StoreInt64(&p.maxpool, int64(max))\n}", "title": "" }, { "docid": "3d9c877aa8d2e14da14c8a238d18df19", "score": "0.48069513", "text": "func init() { //init is a special function that runs before the rest of the code\n runtime.GOMAXPROCS(runtime.NumCPU())\n}", "title": "" }, { "docid": "58f1e43492c5d10d0f6e430a0c93ccdf", "score": "0.4784626", "text": "func init() {\n\tif err := mb.Registry.AddMetricSet(\"docker\", \"memory\", New); err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "bd8076d4e610ceb22100af3a5eb009f3", "score": "0.47790575", "text": "func TestSlabsAlloc3(t *testing.T) {\n mp := &mempool_t{}\n mp.is_prealloc = true\n mp.free_slab_list = nil \n mp.mem_allocated = 0\n mp.mem_limit = 1024*1024\n s := mp.slab_alloc()\n if s!=nil {\n t.Log(\"s\", s)\n t.Error(\"slab_alloc not correct\")\n }\n}", "title": "" }, { "docid": "5dfd16068ddaec008b04b7c5eb45e857", "score": "0.47687006", "text": "func set(conn net.Conn,commands []string,noReply *bool) {\n\n key:= strings.TrimSpace(commands[0])\n exptime,_:= strconv.ParseInt(commands[1],10,32)\n numbytes,_:= strconv.ParseInt(commands[2],10,64) \n lastLived:=time.Now().Add(time.Duration(exptime)*time.Second)\n\n var value string\n if(commands[3]==\"noreply\"){\n *noReply=true\n value= strings.TrimSpace(commands[4])\n } else {\n value= strings.TrimSpace(commands[3])\n }\n unique_version+=1\n\n m_instance:= Memcache{\n value,\n numbytes,\n unique_version,\n exptime,\n lastLived,\n }\n \n mutex.Lock()\n store[key]=m_instance\n mutex.Unlock() \n \n if(!(*noReply)) {\n conn.Write([]byte(\"OK \"+strconv.FormatInt(unique_version,10)+\"\\r\\n\"))\n *noReply=false\n }\n}", "title": "" }, { "docid": "396c6c2d5ed8159b9f2caf09816a75de", "score": "0.47465557", "text": "func UseMultipleCPUs() {\n\tif envGOMAXPROCS := os.Getenv(\"GOMAXPROCS\"); envGOMAXPROCS != \"\" {\n\t\tn := gomaxprocs(0)\n\t\tfmt.Printf(\"GOMAXPROCS already set in environment to %q, %d internally\\n\",\n\t\t\tenvGOMAXPROCS, n)\n\t\treturn\n\t}\n\tn := numCPU()\n\tfmt.Printf(\"setting GOMAXPROCS to %d\\n\", n)\n\tgomaxprocs(n)\n}", "title": "" }, { "docid": "0895637ce8247ebcea89012cf09e52c9", "score": "0.4720435", "text": "func (c *Cgroup) SetMemoryMaxUsageInBytes(i uint64) error {\n\treturn c.memory.WriteUint(\"memory.max_usage_in_bytes\", i)\n}", "title": "" }, { "docid": "8589d890b2377fd335d28b6f4f574ae6", "score": "0.4711843", "text": "func runtime_procPin() int", "title": "" }, { "docid": "02e5cf00820a2433c12eb1ad9cd5bd7a", "score": "0.47032294", "text": "func SetMaxStack(bytes int) int", "title": "" }, { "docid": "02e5cf00820a2433c12eb1ad9cd5bd7a", "score": "0.47032294", "text": "func SetMaxStack(bytes int) int", "title": "" }, { "docid": "4174adf14a3252db423bb43878ef5338", "score": "0.47029716", "text": "func TestSlabsAlloc1(t *testing.T) {\n mp := &mempool_t{}\n mp.mem_limit = 1024 * 1024\n t0 := &slab_t{}\n t1 := &slab_t{}\n t0.next = t1\n t0.ptr = nil\n mp.free_slab_list = t0\n s := mp.slab_alloc()\n if s!=t0 || mp.mem_allocated != 0 || mp.free_slab_list != t1 {\n t.Log(\"s\", s, \"t\", t0)\n t.Log(\"mem_allocated\", mp.mem_allocated)\n t.Log(\"free_slab_list\", mp.free_slab_list)\n t.Error(\"slab_alloc not correct\")\n }\n}", "title": "" }, { "docid": "6ca5e042d39d6f14ce9b0568a7004902", "score": "0.46919477", "text": "func (m *DepIOSEnrollmentProfile) GetSharedIPadMaximumUserCount()(*int32) {\n val, err := m.GetBackingStore().Get(\"sharedIPadMaximumUserCount\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*int32)\n }\n return nil\n}", "title": "" }, { "docid": "de1e5cfa17529d9d3828c7d9c0615154", "score": "0.46857467", "text": "func (b *Benchmark) SetUnifiedMemory() {\n\tpanic(\"unified memory is not supported by dnn workloads\")\n}", "title": "" }, { "docid": "fdcfb872f37c1eefc98599d90101987b", "score": "0.46783444", "text": "func updateUsage(v *Varz) {\n\tv.Cores = runtime.NumCPU()\n\tpidStr := fmt.Sprintf(\"%d\", os.Getpid())\n\tout, err := exec.Command(\"ps\", \"o\", \"pcpu=,rss=\", \"-p\", pidStr).Output()\n\tif err != nil {\n\t\t// FIXME(dlc): Log?\n\t\treturn\n\t}\n\tfmt.Sscanf(string(out), \"%f %d\", &v.CPU, &v.Mem)\n\tv.Mem *= 1024 // 1k blocks, want bytes.\n}", "title": "" }, { "docid": "242d6f67a3f40d5f3a0062cf5331ff2f", "score": "0.46722654", "text": "func (p *Policier) setConnMaxChunk(maxChunk uint64) {\n\tp.connPool.Range(func(k, v interface{}) bool {\n\t\tv.(*WrappedConn).calcChunk(maxChunk)\n\t\treturn true\n\t})\n}", "title": "" }, { "docid": "34e665f218f6f10ed7b017d4da3e3aaa", "score": "0.46674544", "text": "func runtime_procUnpin()", "title": "" }, { "docid": "31af548d996247b19f4cce89c8f31a25", "score": "0.46575925", "text": "func (opts *maxThreadsOption) loadMaxThreads(ctx context.Context) (int, error) {\n\tclientOpts := cipd.ClientOptions{MaxThreads: opts.maxThreads}\n\tif err := clientOpts.LoadFromEnv(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\treturn clientOpts.MaxThreads, nil\n}", "title": "" }, { "docid": "edfc57e359d419d8870193a73a7522b2", "score": "0.46544522", "text": "func InitFromConfig(_ Config) {\n\tmaxprocs.Set()\n}", "title": "" } ]
5c097ef2fd53746bcef259cdcdb9c97d
BatchPlaceLimitOrder batch place limit order
[ { "docid": "d5d325476b213eddf33dd2be55a52b5c", "score": "0.78578085", "text": "func (spot *GateSpot) BatchPlaceLimitOrder(orders []LimitOrder) interface{} {\n\tvar params []map[string]interface{}\n\tfor index, item := range orders {\n\t\tparam := map[string]interface{}{}\n\t\tparam[\"currency_pair\"] = spot.getSymbol(item.Symbol)\n\t\tparam[\"price\"] = item.Price\n\t\tparam[\"amount\"] = item.Amount\n\t\tparam[\"side\"] = item.Side.String()\n\t\tparam[\"type\"] = LIMIT\n\t\tparam[\"account\"] = \"spot\"\n\t\tif item.ClientOrderId != \"\" {\n\t\t\tparam[\"text\"] = item.ClientOrderId\n\t\t} else {\n\t\t\tparam[\"text\"] = \"t-\" + GetNowMillisecondStr() + strconv.FormatInt(int64(index), 10)\n\t\t}\n\t\tswitch item.TimeInForce {\n\t\tcase IOC:\n\t\t\tparam[\"time_in_force\"] = \"ioc\"\n\t\tcase GTC:\n\t\t\tparam[\"time_in_force\"] = \"gtc\"\n\t\tcase POC:\n\t\t\tparam[\"time_in_force\"] = \"poc\"\n\t\t}\n\t\tparams = append(params, param)\n\t}\n\treturn spot.httpPostBatch(spot.getURL(\"batch_orders\"), params, true)\n}", "title": "" } ]
[ { "docid": "12bf0a4df32fc29154eaff51e75d91be", "score": "0.801569", "text": "func (swap *SwapUsdt) BatchPlaceLimitOrder(orders []goex.LimitOrder) interface{} {\n\tparams := &url.Values{}\n\n\tvar trustOrders []map[string]interface{}\n\tfor index, item := range orders {\n\t\tif index > 4 {\n\t\t\tbreak\n\t\t}\n\t\tparam := map[string]interface{}{}\n\t\tparam[\"symbol\"] = swap.getSymbol(item.Symbol)\n\t\tparam[\"price\"] = item.Price\n\t\tparam[\"quantity\"] = item.Amount\n\t\tparam[\"timeInForce\"] = item.TimeInForce\n\t\tparam[\"type\"] = strings.ToUpper(goex.LIMIT)\n\t\tparam[\"side\"] = strings.ToUpper(item.Side.String())\n\t\tif item.ClientOrderId != \"\" {\n\t\t\tparam[\"newClientOrderId\"] = item.ClientOrderId\n\t\t}\n\t\tswitch item.TimeInForce {\n\t\tcase goex.IOC:\n\t\t\tparam[\"timeInForce\"] = \"IOC\"\n\t\tcase goex.FOK:\n\t\t\tparam[\"timeInForce\"] = \"FOK\"\n\t\tcase goex.GTX:\n\t\t\tparam[\"timeInForce\"] = \"GTX\"\n\t\tdefault:\n\t\t\tparam[\"timeInForce\"] = \"GTC\"\n\t\t}\n\t\ttrustOrders = append(trustOrders, param)\n\t}\n\tjsonBody, _ := json.Marshal(trustOrders)\n\tparams.Set(\"batchOrders\", string(jsonBody))\n\n\tresult := swap.httpPost(\"/fapi/v1/batchOrders\", params, true)\n\treturn result\n}", "title": "" }, { "docid": "08f596bd7420fe1cc0f7427b8c4a0110", "score": "0.68363315", "text": "func (swap *SwapUsdt) PlaceLimitOrder(symbol goex.Symbol, price string, amount string, side goex.TradeSide, ClientOrderID string) interface{} {\n\tparams := &url.Values{}\n\tparams.Set(\"symbol\", swap.getSymbol(symbol))\n\tparams.Set(\"price\", price)\n\tparams.Set(\"quantity\", amount)\n\tparams.Set(\"timeInForce\", \"GTC\")\n\tparams.Set(\"type\", strings.ToUpper(goex.LIMIT))\n\tparams.Set(\"side\", strings.ToUpper(side.String()))\n\tif ClientOrderID != \"\" {\n\t\tparams.Set(\"newClientOrderId\", ClientOrderID)\n\t}\n\tresult := swap.httpPost(\"/fapi/v1/order\", params, true)\n\treturn result\n}", "title": "" }, { "docid": "0c5c7e08220a6512d7f3c40d08d5bb1f", "score": "0.6722791", "text": "func (spot *GateSpot) PlaceLimitOrder(symbol Symbol, price string, amount string, side TradeSide, ClientOrderID string) interface{} {\n\tparams := &url.Values{}\n\tparams.Set(\"currency_pair\", spot.getSymbol(symbol))\n\tparams.Set(\"price\", price)\n\tparams.Set(\"amount\", amount)\n\tparams.Set(\"type\", \"limit\")\n\tparams.Set(\"account\", \"spot\")\n\tparams.Set(\"side\", side.String())\n\tif ClientOrderID != \"\" {\n\t\tparams.Set(\"text\", ClientOrderID)\n\t}\n\treturn spot.httpPost(spot.getURL(\"orders\"), params, true)\n}", "title": "" }, { "docid": "981892466c0dd2b6f0ff72db957bec8f", "score": "0.6629638", "text": "func (b *Binance) PlaceLimitOrder(l LimitOrder) (res PlacedOrder, err error) {\n\n\terr = l.ValidateLimitOrder()\n\tif err != nil {\n\t\treturn\n\t}\n\n\treqUrl := fmt.Sprintf(\"api/v3/order?symbol=%s&side=%s&type=%s&timeInForce=%s&quantity=%f&price=%.8f&recvWindow=%d\", l.Symbol, l.Side, l.Type, l.TimeInForce, l.Quantity, l.Price, l.RecvWindow)\n\n\t_, err = b.client.do(\"POST\", reqUrl, \"\", true, &res)\n\tif err != nil {\n\t\treturn\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "8da79f4b0b59b358cb07b269a97db0a2", "score": "0.6377808", "text": "func (g *clientWrapper) submitLimitOrder(qty int, ticker string, price float64, side string) error {\n\tif qty > 0 {\n\t\taccount, err := clientContainer.alpaca.GetAccount()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tadjSide := alpaca.Side(side)\n\t\tlimPrice := decimal.NewFromFloat(price)\n\t\torder, err := g.alpaca.PlaceOrder(alpaca.PlaceOrderRequest{\n\t\t\tAccountID: account.ID,\n\t\t\tAssetKey: &ticker,\n\t\t\tQty: decimal.NewFromFloat(float64(qty)),\n\t\t\tSide: adjSide,\n\t\t\tType: \"limit\",\n\t\t\tLimitPrice: &limPrice,\n\t\t\tTimeInForce: \"day\",\n\t\t})\n\t\tfmt.Printf(\"Limit order of | %d %s %s | sent.\\n\", qty, ticker, side)\n\t\tif err == nil {\n\t\t\tfmt.Printf(\"Limit order of | %d %s %s | sent.\\n\", qty, ticker, side)\n\t\t\tg.lastOrderID[ticker] = order.ID\n\t\t}\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "254f0ada1550e45cd8e55ab5aa7be30b", "score": "0.6248777", "text": "func (client *Client) PlaceLimitOrder(userID string, exchangeID string, baseSymbol string, quoteSymbol string, quantity string, side string, timeInForce string, price string) LimitOrderReturn {\r\n\tr := new(LimitOrderReturn)\r\n\tparams := \"\"\r\n\r\n\tvar body LimitOrderRequest\r\n\tbody.BaseSymbol = baseSymbol\r\n\tbody.Quantity = quantity\r\n\tbody.Price = price\r\n\tbody.QuoteSymbol = quoteSymbol\r\n\tbody.TimeInForce = timeInForce\r\n\tbody.Side = side\r\n\r\n\tstringBody, err := json.Marshal(body)\r\n\r\n\tif err != nil {\r\n\t\tfmt.Println(err)\r\n\t}\r\n\r\n\tfinalBody := string(stringBody)\r\n\t//fmt.Println(finalBody)\r\n\r\n\tjsonStringReturn := httpDo(POST, params, \"/v1/users/\"+userID+\"/accounts/\"+exchangeID+\"/orders\", finalBody, client.Config.MasterAPIKey, client.Config.MasterSecretKey)\r\n\r\n\tif client.Config.DebugMessages {\r\n\t\tfmt.Println(jsonStringReturn)\r\n\t}\r\n\r\n\tjson.Unmarshal([]byte(jsonStringReturn), r)\r\n\treturn *r\r\n}", "title": "" }, { "docid": "63b5b708d0da13d3dc8deef63910b0cf", "score": "0.6243109", "text": "func (ob *OrderBook) ProcessLimitOrder(side Side, orderID string, quantity, price decimal.Decimal) (done []*Order, partial *Order, err error) {\n\tif _, ok := ob.orders[orderID]; ok {\n\t\treturn nil, nil, ErrOrderExists\n\t}\n\n\tif quantity.Sign() <= 0 {\n\t\treturn nil, nil, ErrInvalidQuantity\n\t}\n\n\tif price.Sign() <= 0 {\n\t\treturn nil, nil, ErrInvalidPrice\n\t}\n\n\tif side == Buy {\n\t\tminPrice := ob.asks.MinPriceQueue()\n\t\tfor quantity.Sign() > 0 && ob.asks.Len() > 0 && price.GreaterThanOrEqual(minPrice.Price()) {\n\t\t\tordersDone, partialDone, quantityLeft := ob.processQueue(minPrice, quantity)\n\t\t\tdone = append(done, ordersDone...)\n\t\t\tpartial = partialDone\n\t\t\tquantity = quantityLeft\n\t\t\tminPrice = ob.asks.MinPriceQueue()\n\t\t}\n\n\t\to := NewOrder(orderID, side, quantity, price, time.Now().UTC())\n\t\tif quantity.Sign() > 0 {\n\t\t\tpartial = o\n\t\t\tob.orders[orderID] = ob.bids.Append(o)\n\t\t} else {\n\t\t\tdone = append(done, o)\n\t\t}\n\t} else {\n\t\tmaxPrice := ob.bids.MaxPriceQueue()\n\t\tfor quantity.Sign() > 0 && ob.bids.Len() > 0 && price.LessThanOrEqual(maxPrice.Price()) {\n\t\t\tordersDone, partialDone, quantityLeft := ob.processQueue(maxPrice, quantity)\n\t\t\tdone = append(done, ordersDone...)\n\t\t\tpartial = partialDone\n\t\t\tquantity = quantityLeft\n\t\t\tmaxPrice = ob.bids.MaxPriceQueue()\n\t\t}\n\n\t\to := NewOrder(orderID, side, quantity, price, time.Now().UTC())\n\t\tif quantity.Sign() > 0 {\n\t\t\tpartial = o\n\t\t\tob.orders[orderID] = ob.asks.Append(o)\n\t\t} else {\n\t\t\tdone = append(done, o)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "5a4cd43a6c3868ae2f11795ec9f41de1", "score": "0.62234616", "text": "func (ok *OKExSpot) BatchPlaceOrders(orders []Order) ([]PlaceOrderResponse, error) {\n\tvar param []PlaceOrderParam\n\tvar response map[string][]PlaceOrderResponse\n\n\tfor _, ord := range orders {\n\t\tparam = append(param, PlaceOrderParam{\n\t\t\tInstrumentId: ord.Currency.AdaptUsdToUsdt().ToSymbol(\"-\"),\n\t\t\tClientOid: ord.Cid,\n\t\t\tSide: strings.ToLower(ord.Side.String()),\n\t\t\tSize: ord.Amount,\n\t\t\tPrice: ord.Price,\n\t\t\tType: \"limit\",\n\t\t\tOrderType: ord.OrderType})\n\t}\n\treqBody, _, _ := ok.BuildRequestBody(param)\n\terr := ok.DoRequest(\"POST\", \"/api/spot/v3/batch_orders\", reqBody, &response)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar ret []PlaceOrderResponse\n\n\tfor _, v := range response {\n\t\tret = append(ret, v...)\n\t}\n\n\treturn ret, nil\n}", "title": "" }, { "docid": "f0fee3562852665bb147cc87336d2074", "score": "0.5850135", "text": "func (all Orders) Limit() (orders Orders) {\n\tfor _, one := range all {\n\t\tif !one.IsStop {\n\t\t\torders = append(orders, one)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "e0b933ba706b77346e0b3b64a9d55f11", "score": "0.5598168", "text": "func Test_storeLimitOrder(t *testing.T) {\n\tstub, err := sql.Open(\"stub\", \"discardedConnectString\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\ttype args struct {\n\t\tlo *order.LimitOrder\n\t\tstatus order.OrderStatus\n\t}\n\ttests := []struct {\n\t\tname string\n\t\targs args\n\t\twantErr bool\n\t}{\n\t\t{\n\t\t\tname: \"ok\",\n\t\t\targs: args{\n\t\t\t\tlo: newLimitOrder(false, 4500000, 1, order.StandingTiF, 0),\n\t\t\t\tstatus: order.OrderStatusBooked,\n\t\t\t},\n\t\t\twantErr: false,\n\t\t},\n\t}\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tN, err := storeLimitOrder(stub, \"dcrdex\", tt.args.lo, marketToPgStatus(tt.args.status), 123456, 6000)\n\t\t\tif (err != nil) != tt.wantErr {\n\t\t\t\tt.Errorf(\"storeLimitOrder() error = %v, wantErr %v\", err, tt.wantErr)\n\t\t\t}\n\t\t\tif N != 1 {\n\t\t\t\tt.Errorf(\"Expected 1 row affected, got %d\", N)\n\t\t\t}\n\t\t})\n\t}\n}", "title": "" }, { "docid": "749949def8bd06baaaf208055f16e6ba", "score": "0.55939084", "text": "func (m *Mantle) order(sell bool, qty, rate uint64) error {\n\t_, err := m.Trade(pass, coreLimitOrder(sell, qty, rate))\n\tif err != nil {\n\t\tswitch {\n\t\tcase isOverLimitError(err):\n\t\t\tm.log.Infof(\"Over-limit error. Order not placed.\")\n\t\tcase isApprovalPendingError(err):\n\t\t\tm.log.Infof(\"Approval-pending error. Order not placed\")\n\t\tdefault:\n\t\t\tm.fatalError(\"Trade error (limit order, sell = %t, qty = %d, rate = %d): %v\", sell, qty, rate, err)\n\t\t}\n\t\treturn err\n\t}\n\tatomic.AddUint32(&orderCounter, 1)\n\treturn nil\n}", "title": "" }, { "docid": "2c9f4a57f7a562cc2f13c99a7b202d88", "score": "0.5521334", "text": "func (m *market) addOrder(order limitOrder) {\n\n}", "title": "" }, { "docid": "c798bb916a38a70c9282d1bf597784f2", "score": "0.54695594", "text": "func (b *Binance) FuturesBatchOrder(ctx context.Context, data []PlaceBatchOrderData) ([]FuturesOrderPlaceData, error) {\n\tvar resp []FuturesOrderPlaceData\n\tparams := url.Values{}\n\tfor x := range data {\n\t\tunformattedPair, err := currency.NewPairFromString(data[x].Symbol)\n\t\tif err != nil {\n\t\t\treturn resp, err\n\t\t}\n\t\tformattedPair, err := b.FormatExchangeCurrency(unformattedPair, asset.CoinMarginedFutures)\n\t\tif err != nil {\n\t\t\treturn resp, err\n\t\t}\n\t\tdata[x].Symbol = formattedPair.String()\n\t\tif data[x].PositionSide != \"\" {\n\t\t\tif !common.StringDataCompare(validPositionSide, data[x].PositionSide) {\n\t\t\t\treturn resp, errors.New(\"invalid positionSide\")\n\t\t\t}\n\t\t}\n\t\tif data[x].WorkingType != \"\" {\n\t\t\tif !common.StringDataCompare(validWorkingType, data[x].WorkingType) {\n\t\t\t\treturn resp, errors.New(\"invalid workingType\")\n\t\t\t}\n\t\t}\n\t\tif data[x].NewOrderRespType != \"\" {\n\t\t\tif !common.StringDataCompare(validNewOrderRespType, data[x].NewOrderRespType) {\n\t\t\t\treturn resp, errors.New(\"invalid newOrderRespType\")\n\t\t\t}\n\t\t}\n\t}\n\tjsonData, err := json.Marshal(data)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\tparams.Set(\"batchOrders\", string(jsonData))\n\treturn resp, b.SendAuthHTTPRequest(ctx, exchange.RestCoinMargined, http.MethodPost, cfuturesBatchOrder, params, cFuturesBatchOrdersRate, &resp)\n}", "title": "" }, { "docid": "5fced7e94cc15323cb0f5c3030c6086b", "score": "0.5384772", "text": "func (_Gods *GodsTransactor) SetLimit(opts *bind.TransactOpts, id uint16, limit uint64) (*types.Transaction, error) {\n\treturn _Gods.contract.Transact(opts, \"setLimit\", id, limit)\n}", "title": "" }, { "docid": "cf13bd97fb49da43222be55be7ff6597", "score": "0.53540164", "text": "func (wodq *WorkOrderDefinitionQuery) Limit(limit int) *WorkOrderDefinitionQuery {\n\twodq.limit = &limit\n\treturn wodq\n}", "title": "" }, { "docid": "69e4b2f288c23f4404d26a361c585094", "score": "0.53401786", "text": "func (woq *WorkOrderQuery) Limit(limit int) *WorkOrderQuery {\n\twoq.limit = &limit\n\treturn woq\n}", "title": "" }, { "docid": "573b0e59123f7d1a13d73ddd7e9a1097", "score": "0.5325743", "text": "func newBatchStrategyWithLimits(serializer Serializer, batchSize int, contentSize int, batchWait time.Duration) Strategy {\n\treturn &batchStrategy{\n\t\tbuffer: NewMessageBuffer(batchSize, contentSize),\n\t\tserializer: serializer,\n\t\tbatchWait: batchWait,\n\t}\n}", "title": "" }, { "docid": "63d02ccfb2ca9519e994c39a4d67e9e2", "score": "0.52749753", "text": "func (pq *PointpendinglbtransactionQuery) Limit(limit int) *PointpendinglbtransactionQuery {\n\tpq.limit = &limit\n\treturn pq\n}", "title": "" }, { "docid": "1a608cc0aa28eb3345192e2e2ab138cc", "score": "0.52601993", "text": "func (all Orders) LimitStop(t bool) (orders Orders) {\n\tfor _, one := range all {\n\t\tif (t && !one.IsStop) || (!t && one.IsStop) {\n\t\t\torders = append(orders, one)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "e1776d1803797ca02f49b4c74f95e72d", "score": "0.5234562", "text": "func NewLimitOrder(action string, lmtPrice float64, quantity float64) *Order {\n\to := NewOrder()\n\to.OrderType = \"LMT\"\n\to.Action = action\n\to.LimitPrice = lmtPrice\n\to.TotalQuantity = quantity\n\n\treturn o\n}", "title": "" }, { "docid": "572959d5f1c203cb2afbe217ab56a227", "score": "0.51944196", "text": "func (book *OrderBook) processLimitBuy(order Order) []Trade {\n\ttrades := make([]Trade, 0, 1)\n\tn := len(book.SellOrders)\n\t// check if we have at least one matching order\n\tif n != 0 || book.SellOrders[n-1].Price <= order.Price {\n\t\t// traverse all orders that match\n\t\tfor i := n - 1; i >= 0; i-- {\n\t\t\tsellOrder := book.SellOrders[i]\n\t\t\tif sellOrder.Price < order.Price {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t// fill the entire order\n\t\t\tif sellOrder.Amount >= order.Amount {\n\t\t\t\ttrades = append(trades, Trade{order.ID, sellOrder.ID, order.Amount, sellOrder.Price})\n\t\t\t\tsellOrder.Amount -= order.Amount\n\t\t\t\tif sellOrder.Amount == 0 {\n\t\t\t\t\tbook.removeSellOrder(i)\n\t\t\t\t}\n\t\t\t\treturn trades\n\t\t\t}\n\t\t\t// fill a partial order and continue\n\t\t\tif sellOrder.Amount < order.Amount {\n\t\t\t\ttrades = append(trades, Trade{order.ID, sellOrder.ID, sellOrder.Amount, sellOrder.Price})\n\t\t\t\torder.Amount -= sellOrder.Amount\n\t\t\t\tbook.removeSellOrder(i)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t}\n\t// finally add the remaining order to the list\n\tbook.addBuyOrder(order)\n\treturn trades\n}", "title": "" }, { "docid": "50cdfd9fcbf625c223b168eb469aee42", "score": "0.5189063", "text": "func (ob *OrderBook) processLimitBuy(order *Order) ([]Trade, error) {\n\tvar err error\n\tn := len(ob.SellOrders)\n\tif n == 0 {\n\t\terr = ob.Append(order)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn []Trade{}, nil\n\t}\n\n\tif ob.SellOrders[0].Price > order.Price {\n\t\terr = ob.Append(order)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn []Trade{}, nil\n\t}\n\ttrades := []Trade{}\n\t// check if we have at least one matching order\n\t// traverse all orders that match\n\tfinalOrder := &Order{}\n\tfinalOrder, trades, err = ob.fulfilBuy(ob.SellOrders, order, trades)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// finally add the remaining order to the list\n\terr = ob.Append(finalOrder)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn trades, nil\n}", "title": "" }, { "docid": "bbdbc6644236c41e41fa195d48fb03b9", "score": "0.5175125", "text": "func (lq *LimitpointQuery) Order(o ...OrderFunc) *LimitpointQuery {\n\tlq.order = append(lq.order, o...)\n\treturn lq\n}", "title": "" }, { "docid": "52f9f2c4ec6fbcd87cc4754e73f2bdda", "score": "0.5167321", "text": "func (limits *Limits) CheckLimit(t *transaction.Transaction) error {\n\tfor _, limiter := range limits.Limiters {\n\t\tif err := limiter.check(t, limits.Mode); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "bc58bcb3b670351994fe05eac7863be2", "score": "0.51309514", "text": "func (gbq *GroupBudgetQuery) Limit(limit int) *GroupBudgetQuery {\n\tgbq.ctx.Limit = &limit\n\treturn gbq\n}", "title": "" }, { "docid": "8259c838740cb3b83f35b6b3c01fcd75", "score": "0.51282716", "text": "func coreLimitOrder(sell bool, qty, rate uint64) *core.TradeForm {\n\treturn &core.TradeForm{\n\t\tHost: hostAddr,\n\t\tIsLimit: true,\n\t\tSell: sell,\n\t\tBase: baseID,\n\t\tQuote: quoteID,\n\t\tQty: qty,\n\t\tRate: rate,\n\t\tTifNow: false,\n\t}\n}", "title": "" }, { "docid": "1be7f9e4b58855785ca19a9c171034a2", "score": "0.5126765", "text": "func (o *GetPlacementsParams) SetLimit(limit *int64) {\n\to.Limit = limit\n}", "title": "" }, { "docid": "01600019e08cffe6750fbba40b356832", "score": "0.5118883", "text": "func (book *OrderBook) processLimitSell(order Order) []Trade {\n\ttrades := make([]Trade, 0, 1)\n\tn := len(book.BuyOrders)\n\t// check if we have at least one matching order\n\tif n != 0 || book.BuyOrders[n-1].Price <= order.Price {\n\t\t// traverse all orders that match\n\t\tfor i := n - 1; i >= 0; i-- {\n\t\t\tbuyOrder := book.BuyOrders[i]\n\t\t\tif buyOrder.Price > order.Price {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t// fill the entire order\n\t\t\tif buyOrder.Amount >= order.Amount {\n\t\t\t\ttrades = append(trades, Trade{order.ID, buyOrder.ID, order.Amount, buyOrder.Price})\n\t\t\t\tbuyOrder.Amount -= order.Amount\n\t\t\t\tif buyOrder.Amount == 0 {\n\t\t\t\t\tbook.removeBuyOrder(i)\n\t\t\t\t}\n\t\t\t\treturn trades\n\t\t\t}\n\t\t\t// fill a partial order and continue\n\t\t\tif buyOrder.Amount < order.Amount {\n\t\t\t\ttrades = append(trades, Trade{order.ID, buyOrder.ID, buyOrder.Amount, buyOrder.Price})\n\t\t\t\torder.Amount -= buyOrder.Amount\n\t\t\t\tbook.removeBuyOrder(i)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t}\n\t// finally add the remaining order to the list\n\tbook.addSellOrder(order)\n\treturn trades\n}", "title": "" }, { "docid": "ad873e9c668916bb52dbdddd561277b3", "score": "0.5094587", "text": "func (r ApiGetApiKeysRequest) Limit(limit int32) ApiGetApiKeysRequest {\n\tr.limit = &limit\n\treturn r\n}", "title": "" }, { "docid": "b6f004710881cef3bc048e4e1bd7608a", "score": "0.5090841", "text": "func (f *flusher) Flush(ctx context.Context, places []models.Place) []models.Place {\n\n\tbatches, err := utils.SplitPlacesToBatches(places, f.batchSize)\n\n\tif err != nil {\n\t\treturn places\n\t}\n\n\tnotAdded := make([]models.Place, 0, len(places))\n\n\tfor index := range batches {\n\n\t\tspan, _ := opentracing.StartSpanFromContext(ctx, \"batch_save\")\n\t\tspan.LogFields(log.Int(\"places_count\", len(batches[index])))\n\n\t\terr := f.entityRepo.AddEntities(ctx, batches[index])\n\n\t\tif err != nil {\n\t\t\tnotAdded = append(notAdded, batches[index]...)\n\t\t}\n\n\t\tspan.Finish()\n\t}\n\n\tif len(notAdded) == 0 {\n\t\treturn nil\n\t}\n\n\treturn notAdded\n}", "title": "" }, { "docid": "8443a0dd0b78dfe479449a9f96d84652", "score": "0.5089226", "text": "func (s *BaseSOQLListener) EnterLimit_clause(ctx *Limit_clauseContext) {}", "title": "" }, { "docid": "b532a644c0b2b0ac8e670793f7d5361b", "score": "0.5067625", "text": "func (b UpdateBuilder) Limit(limit uint64) UpdateBuilder {\n\treturn builder.Set(b, \"Limit\", fmt.Sprintf(\"%d\", limit)).(UpdateBuilder)\n}", "title": "" }, { "docid": "2d1f3ff1777bc9e86e32139735e0ae73", "score": "0.5040079", "text": "func (_Gods *GodsTransactorSession) SetLimit(id uint16, limit uint64) (*types.Transaction, error) {\n\treturn _Gods.Contract.SetLimit(&_Gods.TransactOpts, id, limit)\n}", "title": "" }, { "docid": "39f5d285e689a39d4af84bfd8aed732d", "score": "0.5023216", "text": "func DoWithLimit(limit int, n int, f func() (interface{}, error)) ([]interface{}, error) {\n\tif limit <= 0 {\n\t\tpanic(\"Incorrect limit value\")\n\t}\n\n\tif n <= 0 {\n\t\tpanic(\"Incorrect n value\")\n\t}\n\n\tfuncs := make([]func() (interface{}, error), n)\n\tfor i := 0; i < n; i++ {\n\t\tfuncs[i] = f\n\t}\n\n\treturn parallel.DoWithLimit(limit, funcs...)\n}", "title": "" }, { "docid": "b74a327038bf813fc17939bab09e6916", "score": "0.5021458", "text": "func (o *QueryOrdersParams) WithLimit(limit *int32) *QueryOrdersParams {\n\to.SetLimit(limit)\n\treturn o\n}", "title": "" }, { "docid": "3b3bd3104a5c31bf60ea1c84612f623d", "score": "0.5016734", "text": "func (pengine *PipeEngine) Limit(limit int64) QueryInterface {\n\treturn pengine.append(\"Limit\",\n\t\tfunc(t timer, ctx context.Context) PipeOut {\n\t\t\to := make(chan Traveler, pipeSize)\n\t\t\tnctx, cancel := context.WithCancel(ctx)\n\t\t\tpipe := pengine.startPipe(nctx)\n\t\t\tgo func() {\n\t\t\t\tt.startTimer(\"all\")\n\t\t\t\tdefer close(o)\n\t\t\t\tvar count int64\n\t\t\t\tfor i := range pipe.Travelers {\n\t\t\t\t\tif count < limit {\n\t\t\t\t\t\to <- i\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcancel()\n\t\t\t\t\t}\n\t\t\t\t\tcount++\n\t\t\t\t}\n\t\t\t\tt.endTimer(\"all\")\n\t\t\t}()\n\t\t\treturn newPipeOut(o, stateCustom(pipe.State), pipe.ValueStates)\n\t\t})\n}", "title": "" }, { "docid": "5a397923747719df5aa07d18dbfdabc8", "score": "0.50135005", "text": "func (r *RateLimit) Limit(f request.EndpointLimit) error {\n\tif f == request.Auth {\n\t\ttime.Sleep(r.Orders.Reserve().Delay())\n\t\treturn nil\n\t}\n\ttime.Sleep(r.GlobalRate.Reserve().Delay())\n\treturn nil\n}", "title": "" }, { "docid": "077c86d0c1359591998526d9f910d862", "score": "0.50018394", "text": "func (b *DeleteBuilder) Limit(limit uint64) *DeleteBuilder {\n\tb.limitCount = limit\n\tb.limitValid = true\n\treturn b\n}", "title": "" }, { "docid": "90b7e1f94c7c8d3637eb80758cbc41c8", "score": "0.49905035", "text": "func (aq *AqlStruct) Limit(s ...int64) *AqlStruct {\n\tvar l AqlLimit\n\tif len(s) > 1 {\n\t\tl.Skip = s[0]\n\t\tl.Limit = s[1]\n\t}\n\n\tif len(s) == 1 {\n\t\tl.Limit = s[0]\n\t\tl.limit = true\n\t}\n\n\tif len(s) == 0 {\n\t\treturn aq\n\t}\n\n\taq.lines = append(aq.lines, l)\n\treturn aq\n}", "title": "" }, { "docid": "c934f592853bafc89f0035cb99dc6e31", "score": "0.49904278", "text": "func (db *DB) Limit(limit int) (tx *DB) {\n\ttx = db.getInstance()\n\ttx.Statement.AddClause(clause.Limit{Limit: &limit})\n\treturn\n}", "title": "" }, { "docid": "ba3d4f2cca4cd62d339e4e5fdead8f22", "score": "0.4986656", "text": "func (r *RateLimit) Limit(f request.EndpointLimit) error {\n\tswitch f {\n\tcase request.Auth:\n\t\ttime.Sleep(r.Auth.Reserve().Delay())\n\tcase orders:\n\t\tres := r.Auth.Reserve()\n\t\ttime.Sleep(r.Order.Reserve().Delay())\n\t\ttime.Sleep(res.Delay())\n\tcase lowVolume:\n\t\tauthShell := r.Auth.Reserve()\n\t\torderShell := r.Order.Reserve()\n\t\ttime.Sleep(r.LowVolume.Reserve().Delay())\n\t\ttime.Sleep(orderShell.Delay())\n\t\ttime.Sleep(authShell.Delay())\n\tdefault:\n\t\ttime.Sleep(r.UnAuth.Reserve().Delay())\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7c91e957b92df098dd01be2217ce9422", "score": "0.498286", "text": "func (dm *DEX) BookOrders(base, quote uint32) ([]*order.LimitOrder, error) {\n\treturn dm.storage.BookOrders(base, quote)\n}", "title": "" }, { "docid": "e9f70ff2f9f59c668bb06198f55c5342", "score": "0.4981375", "text": "func (ob *OrderBook) processLimitSell(order *Order) ([]Trade, error) {\n\tvar err error\n\tn := len(ob.BuyOrders)\n\tif n == 0 {\n\t\tob.AddSell(order)\n\t\treturn []Trade{}, nil\n\t}\n\n\tif ob.BuyOrders[0].Price < order.Price {\n\t\tob.AddSell(order)\n\t\treturn []Trade{}, nil\n\t}\n\ttrades := []Trade{}\n\t// check if we have at least one matching order\n\t// traverse all orders that match\n\tfinalOrder := &Order{}\n\tfinalOrder, trades, err = ob.fulfilSell(ob.BuyOrders, order, trades)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfmt.Println(finalOrder)\n\t// finally add the remaining order to the list\n\terr = ob.Append(finalOrder)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn trades, nil\n}", "title": "" }, { "docid": "866e57d52039dcb530238962b139379d", "score": "0.4969558", "text": "func (c *ConcurrentBuffer) Limit(ctx context.Context, key string) error {\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\tif err := c.locker.Lock(ctx); err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tif err := c.locker.Unlock(ctx); err != nil {\n\t\t\tc.logger.Log(err)\n\t\t}\n\t}()\n\t// Optimistically add the new request.\n\tcounter, err := c.backend.Add(ctx, key)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif counter > c.capacity {\n\t\t// Rollback the Add() operation.\n\t\tif err = c.backend.Remove(ctx, key); err != nil {\n\t\t\tc.logger.Log(err)\n\t\t}\n\t\treturn ErrLimitExhausted\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "56ac9ea5b0b7d2086347301857eaecfb", "score": "0.49660864", "text": "func (e *Fcoin) LimitBuy(pair *pair.Pair, quantity, rate float64) (*market.Order, error) {\n\n\tif e.API_KEY == \"\" || e.API_SECRET == \"\" {\n\t\treturn nil, fmt.Errorf(\"Fcoin API Key or Secret Key are nil.\")\n\t}\n\n\tjsonResponse := JsonResponse{}\n\tvar placeOrder string\n\tstrRequest := \"/orders\"\n\n\tmapParams := make(map[string]string)\n\tmapParams[\"symbol\"] = strings.ToLower(e.GetPairCode(pair))\n\tmapParams[\"type\"] = \"limit\"\n\tmapParams[\"side\"] = \"buy\"\n\tmapParams[\"price\"] = fmt.Sprint(rate)\n\tmapParams[\"amount\"] = fmt.Sprint(quantity)\n\n\tjsonPlaceReturn := e.ApiKeyPost(mapParams, strRequest)\n\tif err := json.Unmarshal([]byte(jsonPlaceReturn), &jsonResponse); err != nil {\n\t\treturn nil, fmt.Errorf(\"Fcoin LimitBuy Unmarshal Err: %v %v\", err, jsonPlaceReturn)\n\t} else if jsonResponse.Status != 0 {\n\t\treturn nil, fmt.Errorf(\"Fcoin LimitBuy failed:%v Message:%v\", jsonResponse.Status, jsonResponse.Message)\n\t}\n\n\tif err := json.Unmarshal(jsonResponse.Data, &placeOrder); err != nil {\n\t\treturn nil, fmt.Errorf(\"Fcoin LimitBuy Data Unmarshal Err: %v %v\", err, jsonResponse.Data)\n\t} else {\n\t\torder := &market.Order{\n\t\t\tOrderID: placeOrder,\n\t\t\tPair: pair,\n\t\t\tRate: rate,\n\t\t\tQuantity: quantity,\n\t\t\tSide: \"Buy\",\n\t\t\tStatus: market.New,\n\t\t\tJsonResponse: jsonPlaceReturn,\n\t\t}\n\t\treturn order, nil\n\t}\n\n\treturn nil, nil\n}", "title": "" }, { "docid": "f1ad74a4c2cb1aa58bf8f2963f41be42", "score": "0.49602142", "text": "func (_Gods *GodsSession) SetLimit(id uint16, limit uint64) (*types.Transaction, error) {\n\treturn _Gods.Contract.SetLimit(&_Gods.TransactOpts, id, limit)\n}", "title": "" }, { "docid": "8e88a4fb38973763ebed33815fc76db1", "score": "0.49400988", "text": "func SetLimit(l []string) func() private {\n\treturn func() private {\n\t\tpronom.limit = l\n\t\treturn private{}\n\t}\n}", "title": "" }, { "docid": "e5086f2f76ae9fce9ca47c95357855cb", "score": "0.49303976", "text": "func (m *LimitOrder) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateClientExtensions(formats); err != nil {\n\t\t// prop\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validatePositionFill(formats); err != nil {\n\t\t// prop\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateState(formats); err != nil {\n\t\t// prop\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateStopLossOnFill(formats); err != nil {\n\t\t// prop\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateTakeProfitOnFill(formats); err != nil {\n\t\t// prop\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateTimeInForce(formats); err != nil {\n\t\t// prop\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateTradeClientExtensions(formats); err != nil {\n\t\t// prop\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateTradeClosedIds(formats); err != nil {\n\t\t// prop\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateTrailingStopLossOnFill(formats); err != nil {\n\t\t// prop\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateTriggerCondition(formats); err != nil {\n\t\t// prop\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateType(formats); err != nil {\n\t\t// prop\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cfed43adf567ecfcd312030aeff8efe6", "score": "0.49276406", "text": "func (o *QueryOrdersParams) SetLimit(limit *int32) {\n\to.Limit = limit\n}", "title": "" }, { "docid": "f5cc6cf5a6806494d43aaa19c39f5e21", "score": "0.49091852", "text": "func (s *batchStorer) StorePendingBatch(batch *Batch, bestHeight uint32) error {\n\t// Prepare the order modifications first.\n\torders := make([]Nonce, len(batch.MatchedOrders))\n\torderModifiers := make([][]Modifier, len(orders))\n\torderIndex := 0\n\tfor nonce, theirOrders := range batch.MatchedOrders {\n\t\t// Get our order first to find out the number of unfulfilled\n\t\t// units.\n\t\tourOrder, err := s.orderStore.GetOrder(nonce)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error getting order: %v\", err)\n\t\t}\n\t\torders[orderIndex] = nonce\n\n\t\t// Find out if the order has unfulfilled units left or not.\n\t\tunitsUnfulfilled := ourOrder.Details().UnitsUnfulfilled\n\t\tfor _, theirOrder := range theirOrders {\n\t\t\tunitsUnfulfilled -= theirOrder.UnitsFilled\n\t\t}\n\t\tswitch {\n\t\t// The order has been fully filled and can be archived.\n\t\tcase unitsUnfulfilled == 0:\n\t\t\torderModifiers[orderIndex] = []Modifier{\n\t\t\t\tStateModifier(StateExecuted),\n\t\t\t\tUnitsFulfilledModifier(0),\n\t\t\t}\n\n\t\t// The order has not been fully filled, but it cannot be matched\n\t\t// again due to its remaining unfulfilled units being below its\n\t\t// allowed minimum, so we'll archive it.\n\t\tcase unitsUnfulfilled < ourOrder.Details().MinUnitsMatch:\n\t\t\torderModifiers[orderIndex] = []Modifier{\n\t\t\t\tStateModifier(StateExecuted),\n\t\t\t\tUnitsFulfilledModifier(unitsUnfulfilled),\n\t\t\t}\n\n\t\t// Some units were not yet filled.\n\t\tdefault:\n\t\t\torderModifiers[orderIndex] = []Modifier{\n\t\t\t\tStateModifier(StatePartiallyFilled),\n\t\t\t\tUnitsFulfilledModifier(unitsUnfulfilled),\n\t\t\t}\n\t\t}\n\n\t\torderIndex++\n\t}\n\n\t// Next create our account modifiers.\n\taccounts := make([]*account.Account, len(batch.AccountDiffs))\n\taccountModifiers := make([][]account.Modifier, len(accounts))\n\n\t// Each account will have the same height hint applied.\n\theightHint := int64(bestHeight) + heightHintPadding\n\tif heightHint < 0 {\n\t\theightHint = 0\n\t}\n\n\tfor idx, diff := range batch.AccountDiffs {\n\t\t// Get the current state of the account first so we can create\n\t\t// a proper diff.\n\t\tacct, err := s.getAccount(diff.AccountKey)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error getting account: %v\", err)\n\t\t}\n\t\taccounts[idx] = acct\n\t\tvar modifiers []account.Modifier\n\n\t\t// Determine the new state of the account and set the on-chain\n\t\t// attributes accordingly.\n\t\tswitch diff.EndingState {\n\t\t// The account output has been recreated and needs to wait to be\n\t\t// confirmed again.\n\t\tcase auctioneerrpc.AccountDiff_OUTPUT_RECREATED:\n\t\t\tmodifiers = append(\n\t\t\t\tmodifiers,\n\t\t\t\taccount.StateModifier(account.StatePendingBatch),\n\t\t\t\taccount.OutPointModifier(wire.OutPoint{\n\t\t\t\t\tIndex: uint32(diff.OutpointIndex),\n\t\t\t\t\tHash: batch.BatchTX.TxHash(),\n\t\t\t\t}),\n\t\t\t\taccount.IncrementBatchKey(),\n\t\t\t)\n\n\t\t// The account was fully spent on-chain. We need to wait for the\n\t\t// batch (spend) TX to be confirmed still.\n\t\tcase auctioneerrpc.AccountDiff_OUTPUT_FULLY_SPENT,\n\t\t\tauctioneerrpc.AccountDiff_OUTPUT_DUST_ADDED_TO_FEES,\n\t\t\tauctioneerrpc.AccountDiff_OUTPUT_DUST_EXTENDED_OFFCHAIN:\n\n\t\t\tmodifiers = append(\n\t\t\t\tmodifiers,\n\t\t\t\taccount.StateModifier(account.StatePendingClosed),\n\t\t\t)\n\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"invalid ending account state %d\",\n\t\t\t\tdiff.EndingState)\n\t\t}\n\n\t\t// Finally update the account value, height hint, and its latest\n\t\t// transaction.\n\t\tmodifiers = append(\n\t\t\tmodifiers, account.ValueModifier(diff.EndingBalance),\n\t\t)\n\t\tmodifiers = append(\n\t\t\tmodifiers, account.HeightHintModifier(uint32(heightHint)),\n\t\t)\n\t\tmodifiers = append(\n\t\t\tmodifiers, account.LatestTxModifier(batch.BatchTX),\n\t\t)\n\t\taccountModifiers[idx] = modifiers\n\t}\n\n\t// Everything is ready to be persisted now.\n\treturn s.orderStore.StorePendingBatch(\n\t\tbatch, orders, orderModifiers, accounts, accountModifiers,\n\t)\n}", "title": "" }, { "docid": "49780f014b7f0e2f9751f2f799d9cdc1", "score": "0.49073538", "text": "func (swap *SwapUsdt) BatchCancelOrder(symbol goex.Symbol, orderIds, clientOrderIds string) interface{} {\n\tparams := &url.Values{}\n\tparams.Set(\"symbol\", swap.getSymbol(symbol))\n\tif clientOrderIds != \"\" {\n\t\tparams.Set(\"origClientOrderIdList\", fmt.Sprintf(\"[%s]\", clientOrderIds))\n\t} else {\n\t\tparams.Set(\"orderIdList\", fmt.Sprintf(\"[%s]\", orderIds))\n\t}\n\tresult := swap.httpDelete(\"/fapi/v1/batchOrders\", params, true)\n\treturn result\n}", "title": "" }, { "docid": "783d063ce8c39f85c1f3e9c8f910dfb1", "score": "0.4905296", "text": "func (a *Client) OrderAmendBulk(params *OrderAmendBulkParams) (*OrderAmendBulkOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewOrderAmendBulkParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"Order.amendBulk\",\n\t\tMethod: \"PUT\",\n\t\tPathPattern: \"/order/bulk\",\n\t\tProducesMediaTypes: []string{\"application/javascript\", \"application/xml\", \"text/javascript\", \"text/xml\"},\n\t\tConsumesMediaTypes: []string{\"application/x-www-form-urlencoded\"},\n\t\tSchemes: []string{\"http\"},\n\t\tParams: params,\n\t\tReader: &OrderAmendBulkReader{formats: a.formats},\n\t\tContext: params.Context,\n\t\tClient: params.HTTPClient,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn result.(*OrderAmendBulkOK), nil\n\n}", "title": "" }, { "docid": "ffad27725d9a0bd0ff97abf248bb8c8a", "score": "0.49018452", "text": "func (spot *GateSpot) BatchCancelOrder(symbol Symbol, orderIds, clientOrderIds string) interface{} {\n\tvar params []map[string]interface{}\n\torderIDList := strings.Split(orderIds, \",\")\n\tfor _, item := range orderIDList {\n\t\tparam := map[string]interface{}{}\n\t\tparam[\"currency_pair\"] = spot.getSymbol(symbol)\n\t\tparam[\"id\"] = item\n\t\tparams = append(params, param)\n\t}\n\treturn spot.httpPostBatch(spot.getURL(\"cancel_batch_orders\"), params, true)\n}", "title": "" }, { "docid": "a3b524580ebb6ca3df0d9edce2e61dca", "score": "0.4880945", "text": "func (qtw *RuntimeQuotaCalculator) updateOneGroupMaxQuota(quotaInfo *QuotaInfo) {\n\tqtw.lock.Lock()\n\tdefer qtw.lock.Unlock()\n\n\tfor resKey := range quotaInfo.CalculateInfo.Max {\n\t\tqtw.resourceKeys[resKey] = struct{}{}\n\t\tif _, exist := qtw.quotaTree[resKey]; !exist {\n\t\t\tqtw.quotaTree[resKey] = NewQuotaTree()\n\t\t}\n\t}\n\n\tlocalReqLimit := qtw.getGroupRequestLimitNoLock(quotaInfo.Name)\n\tnewRequestLimit := quotaInfo.getLimitRequestNoLock()\n\tfor resKey := range qtw.resourceKeys {\n\t\t// update/insert quotaNode\n\t\treqLimitPerKey := *newRequestLimit.Name(resKey, resource.DecimalSI)\n\n\t\tif exist, _ := qtw.quotaTree[resKey].find(quotaInfo.Name); exist {\n\t\t\tqtw.quotaTree[resKey].updateRequest(quotaInfo.Name, getQuantityValue(reqLimitPerKey, resKey))\n\t\t} else {\n\t\t\tsharedWeightPerKey := *quotaInfo.CalculateInfo.SharedWeight.Name(resKey, resource.DecimalSI)\n\t\t\tautoScaleMinQuotaPerKey := *quotaInfo.CalculateInfo.AutoScaleMin.Name(resKey, resource.DecimalSI)\n\t\t\tqtw.quotaTree[resKey].insert(quotaInfo.Name, getQuantityValue(sharedWeightPerKey, resKey), getQuantityValue(reqLimitPerKey, resKey),\n\t\t\t\tgetQuantityValue(autoScaleMinQuotaPerKey, resKey), quotaInfo.AllowLentResource)\n\t\t}\n\n\t\t// update reqLimitPerKey\n\t\tlocalReqLimit[resKey] = reqLimitPerKey\n\t}\n\n\tqtw.globalRuntimeVersion++\n\n\tif klog.V(5).Enabled() {\n\t\tqtw.logQuotaInfoNoLock(\"UpdateOneGroupMaxQuota finish\", quotaInfo)\n\t}\n}", "title": "" }, { "docid": "ba67f499d90bc4323d10a72a1c450b5d", "score": "0.4868382", "text": "func Limit(limit int) CallOption {\n\theader := strconv.Itoa(limit)\n\treturn func(r *Request) error {\n\t\tr.Header.Set(HeaderMaxItemCount, header)\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "3fd7c0ef270cc2657ca07095b345c833", "score": "0.4866457", "text": "func (s *BasePostgreSQLParserListener) EnterLimit_clause(ctx *Limit_clauseContext) {}", "title": "" }, { "docid": "2cc5d62a060cc0074989ca587386e164", "score": "0.4857803", "text": "func (qs TransactionQuerySet) Limit(limit int) TransactionQuerySet {\n\treturn qs.w(qs.db.Limit(limit))\n}", "title": "" }, { "docid": "c61eeff26e9f59149e04e15195c299c0", "score": "0.48516253", "text": "func (spot *GateSpot) BatchCancelAllOrder(symbol Symbol) interface{} {\n\tparams := &url.Values{}\n\tparams.Set(\"currency_pair\", spot.getSymbol(symbol))\n\tparams.Set(\"account\", \"spot\")\n\tresult := spot.httpDelete(spot.getURL(\"orders\"), params, true)\n\treturn result\n}", "title": "" }, { "docid": "8f6356f34df1002d517f6368afd753a4", "score": "0.48463202", "text": "func (gq *GroupsQuery) Limit(limit int) *GroupsQuery {\n\tgq.limit = &limit\n\treturn gq\n}", "title": "" }, { "docid": "105bd3ab1f65fb0763989cb356fe0a7b", "score": "0.48441908", "text": "func (i *Index) putObjectBatch(ctx context.Context,\n\tobjects []*storobj.Object) []error {\n\ttype objsAndPos struct {\n\t\tobjects []*storobj.Object\n\t\tpos []int\n\t}\n\n\tbyShard := map[string]objsAndPos{}\n\tout := make([]error, len(objects))\n\n\tfor pos, obj := range objects {\n\t\tshardName, err := i.shardFromUUID(obj.ID())\n\t\tif err != nil {\n\t\t\tout[pos] = err\n\t\t\tcontinue\n\t\t}\n\n\t\tgroup := byShard[shardName]\n\t\tgroup.objects = append(group.objects, obj)\n\t\tgroup.pos = append(group.pos, pos)\n\t\tbyShard[shardName] = group\n\t}\n\n\twg := &sync.WaitGroup{}\n\n\tfor shardName, group := range byShard {\n\t\twg.Add(1)\n\t\tgo func(shardName string, group objsAndPos) {\n\t\t\tdefer wg.Done()\n\n\t\t\tlocal := i.getSchema.\n\t\t\t\tShardingState(i.Config.ClassName.String()).\n\t\t\t\tIsShardLocal(shardName)\n\n\t\t\tvar errs []error\n\t\t\tif !local {\n\t\t\t\terrs = i.remote.BatchPutObjects(ctx, shardName, group.objects)\n\t\t\t} else {\n\t\t\t\tshard := i.Shards[shardName]\n\t\t\t\terrs = shard.putObjectBatch(ctx, group.objects)\n\t\t\t}\n\t\t\tfor i, err := range errs {\n\t\t\t\tdesiredPos := group.pos[i]\n\t\t\t\tout[desiredPos] = err\n\t\t\t}\n\t\t}(shardName, group)\n\t}\n\n\twg.Wait()\n\n\treturn out\n}", "title": "" }, { "docid": "54afdd13be2324df3bbbfffc2be7f7d0", "score": "0.4839069", "text": "func (m *Mantle) marketOrder(sell bool, qty uint64) {\n\tmo := coreLimitOrder(sell, qty, 0)\n\tmo.IsLimit = false\n\t_, err := m.Trade(pass, mo)\n\tif err != nil {\n\t\tif isOverLimitError(err) || isApprovalPendingError(err) {\n\t\t\tm.log.Infof(\"Over-limit error. Order not placed.\")\n\t\t} else {\n\t\t\tm.fatalError(\"Trade error (market order, sell = %t, qty = %d: %v\", sell, qty, err)\n\t\t}\n\t\treturn\n\t}\n\tatomic.AddUint32(&orderCounter, 1)\n}", "title": "" }, { "docid": "c4f7640f74c101d5203c6cbb245f41da", "score": "0.4838406", "text": "func (q *TransferQueue) batchApiRoutine() {\n\tvar startProgress sync.Once\n\n\ttransferAdapterNames := q.manifest.GetAdapterNames(q.direction)\n\n\tfor {\n\t\tbatch := q.batcher.Next()\n\t\tif batch == nil {\n\t\t\tbreak\n\t\t}\n\n\t\ttracerx.Printf(\"tq: sending batch of size %d\", len(batch))\n\n\t\ttransfers := make([]*api.ObjectResource, 0, len(batch))\n\t\tfor _, i := range batch {\n\t\t\tt := i.(Transferable)\n\t\t\ttransfers = append(transfers, &api.ObjectResource{Oid: t.Oid(), Size: t.Size()})\n\t\t}\n\n\t\tif len(transfers) == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tobjs, adapterName, err := api.Batch(config.Config, transfers, q.transferKind(), transferAdapterNames)\n\t\tif err != nil {\n\t\t\tvar errOnce sync.Once\n\t\t\tfor _, o := range batch {\n\t\t\t\tt := o.(Transferable)\n\n\t\t\t\tif q.canRetryObject(t.Oid(), err) {\n\t\t\t\t\tq.retry(t)\n\t\t\t\t} else {\n\t\t\t\t\terrOnce.Do(func() { q.errorc <- err })\n\t\t\t\t\tq.wait.Done()\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcontinue\n\t\t}\n\n\t\tq.useAdapter(adapterName)\n\t\tstartProgress.Do(q.meter.Start)\n\n\t\tfor _, o := range objs {\n\t\t\tif o.Error != nil {\n\t\t\t\tq.errorc <- errors.Wrapf(o.Error, \"[%v] %v\", o.Oid, o.Error.Message)\n\t\t\t\tq.Skip(o.Size)\n\t\t\t\tq.wait.Done()\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif _, ok := o.Rel(q.transferKind()); ok {\n\t\t\t\t// This object needs to be transferred\n\t\t\t\tq.trMutex.Lock()\n\t\t\t\ttransfer, ok := q.transferables[o.Oid]\n\t\t\t\tq.trMutex.Unlock()\n\n\t\t\t\tif ok {\n\t\t\t\t\ttransfer.SetObject(o)\n\t\t\t\t\tq.meter.Add(transfer.Name())\n\t\t\t\t\tq.addToAdapter(transfer)\n\t\t\t\t} else {\n\t\t\t\t\tq.Skip(transfer.Size())\n\t\t\t\t\tq.wait.Done()\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tq.Skip(o.Size)\n\t\t\t\tq.wait.Done()\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1703a6ddcfaad1d4fadec2311d52d788", "score": "0.48369125", "text": "func (rtq *RequestTargetQuery) Limit(limit int) *RequestTargetQuery {\n\trtq.ctx.Limit = &limit\n\treturn rtq\n}", "title": "" }, { "docid": "eb2256622400ee736e37f6bd22052787", "score": "0.48322168", "text": "func Ratelimit(l Limiter) middleware.Middleware {\n\treturn func(handler middleware.Handler) middleware.Handler {\n\t\treturn func(ctx context.Context, req interface{}) (reply interface{}, err error) {\n\t\t\tif tr, ok := transport.FromServerContext(ctx); ok {\n\t\t\t\tvar args []model.Argument\n\t\t\t\theaders := tr.RequestHeader()\n\t\t\t\t// handle header\n\t\t\t\tfor _, header := range headers.Keys() {\n\t\t\t\t\targs = append(args, model.BuildHeaderArgument(header, headers.Get(header)))\n\t\t\t\t}\n\t\t\t\t// handle http\n\t\t\t\tif ht, ok := tr.(*http.Transport); ok {\n\t\t\t\t\t// url query\n\t\t\t\t\tfor key, values := range ht.Request().URL.Query() {\n\t\t\t\t\t\targs = append(args, model.BuildQueryArgument(key, strings.Join(values, \",\")))\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tdone, e := l.Allow(tr.Operation(), args...)\n\t\t\t\tif e != nil {\n\t\t\t\t\t// rejected\n\t\t\t\t\treturn nil, ErrLimitExceed\n\t\t\t\t}\n\t\t\t\t// allowed\n\t\t\t\treply, err = handler(ctx, req)\n\t\t\t\tdone(ratelimit.DoneInfo{Err: err})\n\t\t\t\treturn\n\t\t\t}\n\t\t\treturn reply, nil\n\t\t}\n\t}\n}", "title": "" }, { "docid": "3b70e6b92c0853484887c4244141a061", "score": "0.48236784", "text": "func (f *FTX) UpdateOrderExecutionLimits(ctx context.Context, _ asset.Item) error {\n\tlimits, err := f.FetchExchangeLimits(ctx)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"cannot update exchange execution limits: %w\", err)\n\t}\n\treturn f.LoadLimits(limits)\n}", "title": "" }, { "docid": "14a37d9cc128d414a3984e9b9c53a406", "score": "0.48236772", "text": "func ModifyClientLimit(limit int64) func(args *ahpb.ApiModifyHuntArgs) {\n\treturn func(args *ahpb.ApiModifyHuntArgs) {\n\t\targs.ClientLimit = proto.Int64(limit)\n\t}\n}", "title": "" }, { "docid": "6441edeb692514a7b7db58b796046ed4", "score": "0.48231375", "text": "func (o *GetDoubleEndorsementsListParams) validateLimit(formats strfmt.Registry) error {\n\n\tif err := validate.MinimumInt(\"limit\", \"query\", int64(*o.Limit), 1, false); err != nil {\n\t\treturn err\n\t}\n\n\tif err := validate.MaximumInt(\"limit\", \"query\", int64(*o.Limit), 500, false); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "5554ead863438444a3d173800aadf1c1", "score": "0.48213175", "text": "func Limit(limit int) QueryMod {\n\treturn func(q *queries.Query) {\n\t\tqueries.SetLimit(q, limit)\n\t}\n}", "title": "" }, { "docid": "f21962cc3d0ea012f6d70e24cec4c8cc", "score": "0.48141935", "text": "func (s *BaseClickHouseParserListener) EnterLimitByClause(ctx *LimitByClauseContext) {}", "title": "" }, { "docid": "97fd6a7053b8d2c6733c672d25d500f9", "score": "0.48115796", "text": "func (q *query) Limit(amount uint) {\n\tq.limit = amount\n}", "title": "" }, { "docid": "617531577be222958dd918495dd4a483", "score": "0.4804373", "text": "func (_LimitBalanceMock *LimitBalanceMockCaller) Limit(opts *bind.CallOpts) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _LimitBalanceMock.contract.Call(opts, out, \"limit\")\n\treturn *ret0, err\n}", "title": "" }, { "docid": "98cefd7cdd3b366b86e5ad3c4b77e0dd", "score": "0.48024112", "text": "func (db *Database) Cap(limit common.StorageSize) error {\n\t// Create a database batch to flush persistent data out. It is important that\n\t// outside code doesn't see an inconsistent state (referenced data removed from\n\t// memory cache during commit but not yet in persistent storage). This is ensured\n\t// by only uncaching existing data when the database write finalizes.\n\tdb.lock.RLock()\n\n\tnodes, storage, start := len(db.nodes), db.nodesSize, time.Now()\n\tbatch := db.diskdb.NewBatch()\n\n\t// db.nodesSize only contains the useful data in the cache, but when reporting\n\t// the total memory consumption, the maintenance metadata is also needed to be\n\t// counted. For every useful node, we track 2 extra hashes as the flushlist.\n\tsize := db.nodesSize + common.StorageSize((len(db.nodes)-1)*2*common.HashLength)\n\n\t// If the preimage cache got large enough, push to disk. If it's still small\n\t// leave for later to deduplicate writes.\n\tflushPreimages := db.preimagesSize > 4*1024*1024\n\tif flushPreimages {\n\t\tfor hash, preimage := range db.preimages {\n\t\t\tbatch.Set(db.secureKey(hash[:]), preimage)\n\t\t\tif batch.ValueSize() > dbm.IdealBatchSize {\n\t\t\t\tif err := batch.Commit(); err != nil {\n\t\t\t\t\tdb.lock.RUnlock()\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tbatch.Reset()\n\t\t\t}\n\t\t}\n\t}\n\t// Keep committing nodes from the flush-list until we're below allowance\n\toldest := db.oldest\n\tfor size > limit && oldest != (common.EmptyHash) {\n\t\t// Fetch the oldest referenced node and push into the batch\n\t\tnode := db.nodes[oldest]\n\t\tbatch.Set(oldest[:], node.ser())\n\t\t// If we exceeded the ideal batch size, commit and reset\n\t\tif batch.ValueSize() >= dbm.IdealBatchSize {\n\t\t\tif err := batch.Commit(); err != nil {\n\t\t\t\tlog.Error(\"Failed to write flush list to disk\", \"err\", err)\n\t\t\t\tdb.lock.RUnlock()\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tbatch.Reset()\n\t\t}\n\t\t// Iterate to the next flush item, or abort if the size cap was achieved. Size\n\t\t// is the total size, including both the useful cached data (hash -> blob), as\n\t\t// well as the flushlist metadata (2*hash). When flushing items from the cache,\n\t\t// we need to reduce both.\n\t\tsize -= common.StorageSize(3*common.HashLength + int(node.size))\n\t\toldest = node.flushNext\n\t}\n\t// Flush out any remainder data from the last batch\n\tif err := batch.Commit(); err != nil {\n\t\tlog.Error(\"Failed to write flush list to disk\", \"err\", err)\n\t\tdb.lock.RUnlock()\n\t\treturn err\n\t}\n\tdb.lock.RUnlock()\n\n\t// Write successful, clear out the flushed data\n\tdb.lock.Lock()\n\tdefer db.lock.Unlock()\n\n\tif flushPreimages {\n\t\tdb.preimages = make(map[common.Hash][]byte)\n\t\tdb.preimagesSize = 0\n\t}\n\tfor db.oldest != oldest {\n\t\tnode := db.nodes[db.oldest]\n\t\tdelete(db.nodes, db.oldest)\n\t\tdb.oldest = node.flushNext\n\n\t\tdb.nodesSize -= common.StorageSize(common.HashLength + int(node.size))\n\t}\n\tif db.oldest != (common.EmptyHash) {\n\t\tdb.nodes[db.oldest].flushPrev = common.EmptyHash\n\t}\n\tdb.flushnodes += uint64(nodes - len(db.nodes))\n\tdb.flushsize += storage - db.nodesSize\n\tdb.flushtime += time.Since(start)\n\n\tmemcacheFlushTimeTimer.Update(time.Since(start))\n\tmemcacheFlushSizeMeter.Mark(int64(storage - db.nodesSize))\n\tmemcacheFlushNodesMeter.Mark(int64(nodes - len(db.nodes)))\n\n\tlog.Debug(\"Persisted nodes from memory database\", \"nodes\", nodes-len(db.nodes), \"size\", storage-db.nodesSize, \"time\", time.Since(start),\n\t\t\"flushnodes\", db.flushnodes, \"flushsize\", db.flushsize, \"flushtime\", db.flushtime, \"livenodes\", len(db.nodes), \"livesize\", db.nodesSize)\n\n\treturn nil\n}", "title": "" }, { "docid": "1e93018cb5d53c78c1620d03acacb2df", "score": "0.47952384", "text": "func (e *Fcoin) LimitSell(pair *pair.Pair, quantity, rate float64) (*market.Order, error) {\n\tif e.API_KEY == \"\" || e.API_SECRET == \"\" {\n\t\treturn nil, fmt.Errorf(\"Fcoin API Key or Secret Key are nil.\")\n\t}\n\n\tjsonResponse := JsonResponse{}\n\tvar placeOrder string\n\tstrRequest := \"/orders\"\n\n\tmapParams := make(map[string]string)\n\tmapParams[\"symbol\"] = strings.ToLower(e.GetPairCode(pair))\n\tmapParams[\"type\"] = \"limit\"\n\tmapParams[\"side\"] = \"sell\"\n\tmapParams[\"price\"] = fmt.Sprint(rate)\n\tmapParams[\"amount\"] = fmt.Sprint(quantity)\n\n\tjsonPlaceReturn := e.ApiKeyPost(mapParams, strRequest)\n\tif err := json.Unmarshal([]byte(jsonPlaceReturn), &jsonResponse); err != nil {\n\t\treturn nil, fmt.Errorf(\"Fcoin LimitSell Unmarshal Err: %v %v\", err, jsonPlaceReturn)\n\t} else if jsonResponse.Status != 0 {\n\t\treturn nil, fmt.Errorf(\"Fcoin LimitSell failed:%v Message:%v\", jsonResponse.Status, jsonResponse.Message)\n\t}\n\n\tif err := json.Unmarshal(jsonResponse.Data, &placeOrder); err != nil {\n\t\treturn nil, fmt.Errorf(\"Fcoin LimitSell Data Unmarshal Err: %v %v\", err, jsonResponse.Data)\n\t} else {\n\t\torder := &market.Order{\n\t\t\tOrderID: placeOrder,\n\t\t\tPair: pair,\n\t\t\tRate: rate,\n\t\t\tQuantity: quantity,\n\t\t\tSide: \"Sell\",\n\t\t\tStatus: market.New,\n\t\t\tJsonResponse: jsonPlaceReturn,\n\t\t}\n\t\treturn order, nil\n\t}\n\n\treturn nil, nil\n}", "title": "" }, { "docid": "f3392dd915fca55783f823f88e1aba51", "score": "0.47925523", "text": "func (bq *BlockQuery) Limit(limit int) *BlockQuery {\n\tbq.limit = &limit\n\treturn bq\n}", "title": "" }, { "docid": "17625a61c93e50c063607f19632f66d5", "score": "0.47918916", "text": "func (o *GetAPIFizzbuzzParams) validateLimit(formats strfmt.Registry) error {\n\n\tif err := validate.MinimumInt(\"limit\", \"query\", int64(o.Limit), 1, false); err != nil {\n\t\treturn err\n\t}\n\n\tif err := validate.MaximumInt(\"limit\", \"query\", int64(o.Limit), 100, false); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "53e9777a5f43edf5f3d04cbcbccd225d", "score": "0.47908998", "text": "func (srq *StatusReserveQuery) Limit(limit int) *StatusReserveQuery {\n\tsrq.limit = &limit\n\treturn srq\n}", "title": "" }, { "docid": "b15df73fa00e6de6e7fd4e5aa0fa951f", "score": "0.47694576", "text": "func (c *Config) BatchSizeLimit(org, repo string) int {\n\t// TODO: Remove once #564 is fixed and batch builds can work again. (APB)\n\treturn -1\n\t//if limit, ok := t.BatchSizeLimitMap[fmt.Sprintf(\"%s/%s\", org, repo)]; ok {\n\t//\treturn limit\n\t//}\n\t//if limit, ok := t.BatchSizeLimitMap[org]; ok {\n\t//\treturn limit\n\t//}\n\t//return t.BatchSizeLimitMap[\"*\"]\n}", "title": "" }, { "docid": "fe2177c0f1121067fd306b874dea35f1", "score": "0.4768514", "text": "func (_c *_customCarsQueryBuilder) Limit(limit int64) (*_customCarsQueryBuilder) {\n if _c.err != nil {\n return _c\n }\n _c.builder.Limit(limit)\n return _c\n}", "title": "" }, { "docid": "542bf2c5beb3061c57ca30825a65f532", "score": "0.47574976", "text": "func (m *Model) Limit(limit ...int) *Model {\n\tmodel := m.getModel()\n\tswitch len(limit) {\n\tcase 1:\n\t\tmodel.limit = limit[0]\n\tcase 2:\n\t\tmodel.start = limit[0]\n\t\tmodel.limit = limit[1]\n\t}\n\treturn model\n}", "title": "" }, { "docid": "cf4be5095a926b702413f2afc36ccee0", "score": "0.4748903", "text": "func (e *Engine) Limit(args ...int) *Engine {\n\n\t//TODO postgresql/mssql limit statement\n\tnArgs := len(args)\n\tif nArgs == 0 {\n\t\treturn e\n\t}\n\n\tswitch e.adapterSqlx {\n\tcase AdapterSqlx_Mssql:\n\t\t{\n\t\t\te.setLimit(fmt.Sprintf(\"TOP %v\", args[0]))\n\t\t}\n\tdefault:\n\t\t{\n\t\t\tif nArgs == 1 {\n\t\t\t\te.setLimit(fmt.Sprintf(\"LIMIT %v\", args[0]))\n\t\t\t} else if nArgs == 2 {\n\t\t\t\te.setLimit(fmt.Sprintf(\"LIMIT %v,%v\", args[0], args[1]))\n\t\t\t}\n\t\t}\n\t}\n\n\treturn e\n}", "title": "" }, { "docid": "d20163fb1a3b1cba92e592e8bda79601", "score": "0.47481066", "text": "func (blq *BlobLinkQuery) Limit(limit int) *BlobLinkQuery {\n\tblq.ctx.Limit = &limit\n\treturn blq\n}", "title": "" }, { "docid": "185999e9b85f20b9a89f057ce17b3d72", "score": "0.4748054", "text": "func (p *MemPostings) EnsureOrder(numberOfConcurrentProcesses int) {\n\tp.mtx.Lock()\n\tdefer p.mtx.Unlock()\n\n\tif p.ordered {\n\t\treturn\n\t}\n\n\tconcurrency := numberOfConcurrentProcesses\n\tif concurrency <= 0 {\n\t\tconcurrency = runtime.GOMAXPROCS(0)\n\t}\n\tworkc := make(chan *[][]storage.SeriesRef)\n\n\tvar wg sync.WaitGroup\n\twg.Add(concurrency)\n\n\tfor i := 0; i < concurrency; i++ {\n\t\tgo func() {\n\t\t\tfor job := range workc {\n\t\t\t\tfor _, l := range *job {\n\t\t\t\t\tslices.Sort(l)\n\t\t\t\t}\n\n\t\t\t\t*job = (*job)[:0]\n\t\t\t\tensureOrderBatchPool.Put(job)\n\t\t\t}\n\t\t\twg.Done()\n\t\t}()\n\t}\n\n\tnextJob := ensureOrderBatchPool.Get().(*[][]storage.SeriesRef)\n\tfor _, e := range p.m {\n\t\tfor _, l := range e {\n\t\t\t*nextJob = append(*nextJob, l)\n\n\t\t\tif len(*nextJob) >= ensureOrderBatchSize {\n\t\t\t\tworkc <- nextJob\n\t\t\t\tnextJob = ensureOrderBatchPool.Get().(*[][]storage.SeriesRef)\n\t\t\t}\n\t\t}\n\t}\n\n\t// If the last job was partially filled, we need to push it to workers too.\n\tif len(*nextJob) > 0 {\n\t\tworkc <- nextJob\n\t}\n\n\tclose(workc)\n\twg.Wait()\n\n\tp.ordered = true\n}", "title": "" }, { "docid": "ca3b3bd9bb968a28443410f784e36195", "score": "0.47429472", "text": "func (o *GetPlacementsParams) WithLimit(limit *int64) *GetPlacementsParams {\n\to.SetLimit(limit)\n\treturn o\n}", "title": "" }, { "docid": "3c25f70646fbe8c916c0fb1c8c82f26a", "score": "0.47426626", "text": "func (rq *ReplyQuery) Limit(limit int) *ReplyQuery {\n\trq.ctx.Limit = &limit\n\treturn rq\n}", "title": "" }, { "docid": "d1286c0bbfbb024df201be2bf77b11ea", "score": "0.47386864", "text": "func (aq *AccountQuery) Limit(limit int) *AccountQuery {\n\taq.ctx.Limit = &limit\n\treturn aq\n}", "title": "" }, { "docid": "52887bf243cfdbb2d8a7776695842b50", "score": "0.47276577", "text": "func TestGlobalLimiter_ApplyLimits2(t *testing.T) {\n\tpolicy := newGlobalPolicy(\"100\", \"100M\")\n\tused := tests.NewResourceList(\"10\", \"10M\")\n\tlimiter := NewGlobalLimiter(policy, used, logr.Discard())\n\n\tsteps := []struct {\n\t\trequested *corev1.ResourceRequirements\n\t\texpRes *corev1.ResourceRequirements\n\t\texpState *corev1.ResourceList\n\t}{\n\t\t{\n\t\t\trequested: tests.NewResourceRequirements(\"5\", \"5M\", \"0\", \"0\"),\n\t\t\texpRes: tests.NewResourceRequirements(\"5\", \"5M\", \"0\", \"0\"),\n\t\t\texpState: tests.NewResourceList(\"85\", \"85M\"),\n\t\t},\n\t\t{\n\t\t\trequested: tests.NewResourceRequirements(\"15\", \"20M\", \"0\", \"0\"),\n\t\t\texpRes: tests.NewResourceRequirements(\"15\", \"20M\", \"0\", \"0\"),\n\t\t\texpState: tests.NewResourceList(\"70\", \"65M\"),\n\t\t},\n\t\t{\n\t\t\trequested: tests.NewResourceRequirements(\"80\", \"20M\", \"0\", \"0\"),\n\t\t\texpRes: tests.NewResourceRequirements(\"70\", \"20M\", \"0\", \"0\"),\n\t\t\texpState: tests.NewResourceList(\"0\", \"45M\"),\n\t\t},\n\t\t{\n\t\t\trequested: tests.NewResourceRequirements(\"-20\", \"-40M\", \"0\", \"0\"),\n\t\t\texpRes: tests.NewResourceRequirements(\"-20\", \"-40M\", \"0\", \"0\"),\n\t\t\texpState: tests.NewResourceList(\"20\", \"85M\"),\n\t\t},\n\t\t{\n\t\t\trequested: tests.NewResourceRequirements(\"-10\", \"-10M\", \"0\", \"0\"),\n\t\t\texpRes: tests.NewResourceRequirements(\"-10\", \"-10M\", \"0\", \"0\"),\n\t\t\texpState: tests.NewResourceList(\"30\", \"95M\"),\n\t\t},\n\t\t{\n\t\t\trequested: tests.NewResourceRequirements(\"25\", \"60M\", \"0\", \"0\"),\n\t\t\texpRes: tests.NewResourceRequirements(\"25\", \"60M\", \"0\", \"0\"),\n\t\t\texpState: tests.NewResourceList(\"5\", \"35M\"),\n\t\t},\n\t}\n\tfor i, step := range steps {\n\t\tr := limiter.ApplyLimits(\"\", step.requested)\n\t\tif helpers.CmpResourceRequirements(*r, *step.expRes) != 0 {\n\t\t\tt.Fatalf(\"step %d - ApplyLimits() results mismatch. \\nWant: \\n%v; \\nGot: \\n%v\", i+1, step.expRes, r)\n\t\t}\n\t\tstate := tests.NewResourceList(limiter.availCPU.String(), limiter.availMem.String())\n\t\tif helpers.CmpResourceList(*state, *step.expState) != 0 {\n\t\t\tt.Fatalf(\"step %d - limiter state results mismatch. \\nWant: \\n%v; \\nGot: \\n%v\", i+1, step.expState, r)\n\t\t}\n\t\t// verify that \".MaxAllowed()\" returns the same amount of \"free\" resources as expected\n\t\tif helpers.CmpResourceList(*limiter.MaxAllowed(\"\"), *step.expState) != 0 {\n\t\t\tt.Fatalf(\"step %d - limiter state results mismatch. \\nWant: \\n%v; \\nGot: \\n%v\", i+1, step.expState, r)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9c98413e26034a6ec3464aff73955f16", "score": "0.4724887", "text": "func (ismq *ImplicitSkippedMessageQuery) Limit(limit int) *ImplicitSkippedMessageQuery {\n\tismq.limit = &limit\n\treturn ismq\n}", "title": "" }, { "docid": "7ffcd574e6108e109647596cf3693a24", "score": "0.4718282", "text": "func (input *DoQueryInput) Limit(n int) *DoQueryInput {\n\tinput.EnsureOptions().Limit = n\n\treturn input\n}", "title": "" }, { "docid": "bd5b1546198902ca7c63e9fd7d2c3522", "score": "0.4711417", "text": "func (swap *SwapUsdt) BatchCancelAllOrder(symbol goex.Symbol) interface{} {\n\tparams := &url.Values{}\n\tparams.Set(\"symbol\", swap.getSymbol(symbol))\n\tresult := swap.httpDelete(\"/fapi/v1/allOpenOrders\", params, true)\n\treturn result\n}", "title": "" }, { "docid": "84b3e1d1286d999a5b31ee3eee258947", "score": "0.47108716", "text": "func (dao *RedisDao) AddLikeIndexBatch(c context.Context, oid int64, tp int8, rpts map[int64]*reply.Report, rs ...*reply.Reply) (err error) {\n\tif len(rs) == 0 {\n\t\treturn\n\t}\n\titems := make([]rItem, 0, len(rs))\n\tfor _, r := range rs {\n\t\tif !r.IsTop() && r.IsRoot() {\n\t\t\tvar rptCn int\n\t\t\tif rpt, ok := rpts[r.RpID]; ok {\n\t\t\t\trptCn = rpt.Count\n\t\t\t}\n\t\t\tscore := int64((float32(r.Like+conf.Conf.Weight.Like) / float32(r.Hate+conf.Conf.Weight.Hate+rptCn)) * 100)\n\t\t\tscore = score<<32 | (int64(r.RCount) & 0xFFFFFFFF)\n\t\t\titems = append(items, rItem{ID: r.RpID, Score: score})\n\t\t}\n\t}\n\tif len(items) > _maxCount {\n\t\tsort.Slice(items, func(i, j int) bool {\n\t\t\treturn items[i].Score > items[j].Score\n\t\t})\n\t\titems = items[:_maxCount]\n\t}\n\n\tkey := keyIdx(oid, tp, reply.SortByLike)\n\tconn := dao.redis.Get(c)\n\tdefer conn.Close()\n\tfor _, item := range items {\n\t\tif err = conn.Send(\"ZADD\", key, item.Score, item.ID); err != nil {\n\t\t\tlog.Error(\"conn.Send(ZADD %s,%d) error(%v)\", key, item.ID, err)\n\t\t\treturn\n\t\t}\n\t}\n\tif err = conn.Send(\"EXPIRE\", key, dao.expireRdsIdx); err != nil {\n\t\tlog.Error(\"conn.Send error(%v)\", err)\n\t\treturn\n\t}\n\tif err = conn.Flush(); err != nil {\n\t\tlog.Error(\"conn.Flush error(%v)\", err)\n\t\treturn\n\t}\n\tfor i := 0; i < len(items)+1; i++ {\n\t\tif _, err = conn.Receive(); err != nil {\n\t\t\tlog.Error(\"conn.Receive() error(%v)\", err)\n\t\t\treturn\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "4fc411dbc381781cfe9f9d706ce77a66", "score": "0.47064355", "text": "func (bq *BouncerQuery) Limit(limit int) *BouncerQuery {\n\tbq.limit = &limit\n\treturn bq\n}", "title": "" }, { "docid": "1aaaee26492bb73dc4eb5c5d3bba160b", "score": "0.4701914", "text": "func (tc *nsCountLimitTestCase) spawnBlockedRequests(\n\thandler *testRequestHandler,\n\tinterceptor *ConcurrentRequestLimitInterceptor,\n) {\n\tfor i := 0; i < tc.numBlockedRequests-1; i++ {\n\t\tgo func() {\n\t\t\t_, err := interceptor.Intercept(context.Background(), tc.request, &grpc.UnaryServerInfo{\n\t\t\t\tFullMethod: tc.methodName,\n\t\t\t}, handler.Handle)\n\t\t\thandler.errs <- err\n\t\t}()\n\t}\n\n\tfor i := 0; i < tc.numBlockedRequests-1; i++ {\n\t\t<-handler.started\n\t}\n}", "title": "" }, { "docid": "35f4020eaa69e4d0e804a360bf0668db", "score": "0.47001848", "text": "func (m *LimitpointMutation) AddLimitPoint(i int) {\n\tif m.add_LimitPoint != nil {\n\t\t*m.add_LimitPoint += i\n\t} else {\n\t\tm.add_LimitPoint = &i\n\t}\n}", "title": "" }, { "docid": "f711a26d5d8e27105a7a9ecb76d97729", "score": "0.46933612", "text": "func (s *BaseClickHouseParserListener) EnterLimitClause(ctx *LimitClauseContext) {}", "title": "" }, { "docid": "624522800dab4d705fb37f4c1c96a6c8", "score": "0.46910182", "text": "func TestBudgetLimit(t *testing.T) {\n\tt.Parallel()\n\n\tinitialBudget := uint64(100)\n\treadCost := uint64(1)\n\twriteCost := uint64(2)\n\n\t// Read full budget\n\tbudget := NewBudget(types.NewCurrency64(initialBudget))\n\tlimit := NewBudgetLimit(budget, types.NewCurrency64(readCost), types.NewCurrency64(writeCost))\n\terr := limit.RecordDownload(initialBudget / readCost)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif limit.Downloaded() != initialBudget/readCost {\n\t\tt.Fatalf(\"expected %v but got %v\", initialBudget/readCost, limit.Downloaded())\n\t}\n\n\t// Write full budget\n\tbudget = NewBudget(types.NewCurrency64(initialBudget))\n\tlimit = NewBudgetLimit(budget, types.NewCurrency64(readCost), types.NewCurrency64(writeCost))\n\terr = limit.RecordUpload(initialBudget / writeCost)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif limit.Uploaded() != initialBudget/writeCost {\n\t\tt.Fatalf(\"expected %v but got %v\", initialBudget/writeCost, limit.Uploaded())\n\t}\n\n\t// Do it half half.\n\tbudget = NewBudget(types.NewCurrency64(initialBudget))\n\tlimit = NewBudgetLimit(budget, types.NewCurrency64(readCost), types.NewCurrency64(writeCost))\n\terr = limit.RecordUpload(initialBudget / writeCost / 2)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\terr = limit.RecordDownload(initialBudget / readCost / 2)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif limit.Downloaded() != initialBudget/readCost/2 {\n\t\tt.Fatalf(\"expected %v but got %v\", initialBudget/readCost/2, limit.Downloaded())\n\t}\n\tif limit.Uploaded() != initialBudget/writeCost/2 {\n\t\tt.Fatalf(\"expected %v but got %v\", initialBudget/writeCost/2, limit.Uploaded())\n\t}\n\n\t// Enough budget for read but not write.\n\tbudget = NewBudget(types.NewCurrency64(readCost))\n\tlimit = NewBudgetLimit(budget, types.NewCurrency64(readCost), types.NewCurrency64(writeCost))\n\terr = limit.RecordUpload(1)\n\tif !errors.Contains(err, ErrInsufficientBandwidthBudget) {\n\t\tt.Fatal(\"expected error but got\", err)\n\t}\n\terr = limit.RecordDownload(1)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif limit.Downloaded() != 1 {\n\t\tt.Fatalf(\"expected %v but got %v\", 1, limit.Downloaded())\n\t}\n\tif limit.Uploaded() != 0 {\n\t\tt.Fatalf(\"expected %v but got %v\", 0, limit.Uploaded())\n\t}\n\n\t// Enough budget for write but not read.\n\tbudget = NewBudget(types.NewCurrency64(readCost))\n\tlimit = NewBudgetLimit(budget, types.NewCurrency64(writeCost), types.NewCurrency64(readCost))\n\terr = limit.RecordDownload(1)\n\tif !errors.Contains(err, ErrInsufficientBandwidthBudget) {\n\t\tt.Fatal(\"expected error but got\", err)\n\t}\n\terr = limit.RecordUpload(1)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif limit.Downloaded() != 0 {\n\t\tt.Fatalf(\"expected %v but got %v\", 0, limit.Downloaded())\n\t}\n\tif limit.Uploaded() != 1 {\n\t\tt.Fatalf(\"expected %v but got %v\", 1, limit.Uploaded())\n\t}\n\n\t// Not enough budget to either write or read at first but after the update.\n\ttotalCost := types.NewCurrency64(readCost + writeCost)\n\tbudget = NewBudget(totalCost)\n\tlimit = NewBudgetLimit(budget, totalCost.Add64(1), totalCost.Add64(1))\n\terr = limit.RecordDownload(1)\n\tif !errors.Contains(err, ErrInsufficientBandwidthBudget) {\n\t\tt.Fatalf(\"expected error %v but got %v\", ErrInsufficientBandwidthBudget, err)\n\t}\n\terr = limit.RecordUpload(1)\n\tif !errors.Contains(err, ErrInsufficientBandwidthBudget) {\n\t\tt.Fatalf(\"expected error %v but got %v\", ErrInsufficientBandwidthBudget, err)\n\t}\n\tlimit.UpdateCosts(types.NewCurrency64(readCost), types.NewCurrency64(writeCost))\n\terr = limit.RecordDownload(1)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\terr = limit.RecordUpload(1)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif limit.Downloaded() != 1 {\n\t\tt.Fatalf(\"expected %v but got %v\", 1, limit.Downloaded())\n\t}\n\tif limit.Uploaded() != 1 {\n\t\tt.Fatalf(\"expected %v but got %v\", 1, limit.Uploaded())\n\t}\n\tif !budget.Remaining().IsZero() {\n\t\tt.Fatal(\"budget should be empty\")\n\t}\n}", "title": "" }, { "docid": "cb0ae367a41b9f21bfbbbe914b240ecb", "score": "0.46869934", "text": "func (pq *PointpendinglbtransactionQuery) Order(o ...OrderFunc) *PointpendinglbtransactionQuery {\n\tpq.order = append(pq.order, o...)\n\treturn pq\n}", "title": "" }, { "docid": "a9080679d265d6b01c8a02883b4eaaa7", "score": "0.4682647", "text": "func (n *limitNode) evalLimit() error {\n\tn.count = math.MaxInt64\n\tn.offset = 0\n\n\tdata := []struct {\n\t\tname string\n\t\tsrc parser.TypedExpr\n\t\tdst *int64\n\t}{\n\t\t{\"LIMIT\", n.countExpr, &n.count},\n\t\t{\"OFFSET\", n.offsetExpr, &n.offset},\n\t}\n\n\tfor _, datum := range data {\n\t\tif datum.src != nil {\n\t\t\tif err := n.p.startSubqueryPlans(datum.src); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tdstDatum, err := datum.src.Eval(&n.p.evalCtx)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif dstDatum == parser.DNull {\n\t\t\t\t// Use the default value.\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tdstDInt := *dstDatum.(*parser.DInt)\n\t\t\tval := int64(dstDInt)\n\t\t\tif val < 0 {\n\t\t\t\treturn fmt.Errorf(\"negative value for %s\", datum.name)\n\t\t\t}\n\t\t\t*datum.dst = val\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0def00378935f77a2965dcb3d74bc8b6", "score": "0.4679815", "text": "func (cur *Cursor) SetLimit(limit int) {\n C.mongo_cursor_set_limit(cur.cursor, C.int(limit))\n}", "title": "" }, { "docid": "81a1556580f771328d1bfa7818accd87", "score": "0.46796888", "text": "func WithLimit(limit int64) OpOption {\n\treturn func(op *Op) { op.limit = limit }\n}", "title": "" }, { "docid": "13a8f379101e3d52a16a3decfa985adf", "score": "0.46775684", "text": "func (bq *BlockQuery) Order(o ...OrderFunc) *BlockQuery {\n\tbq.order = append(bq.order, o...)\n\treturn bq\n}", "title": "" } ]
ab097096089b9dc319eaf5e468af7c9d
ReadResponse waits for a signal that the reqid request is complete. It uses http.ReadResponse to read and return an http.Response object from reqid's response buffer. After the response is read, the reqid is freed, and might immediately be used again for a new request.
[ { "docid": "78ea02ce45eee40e7880e19c8e5fcdb6", "score": "0.7815516", "text": "func (self *wsConn) ReadResponse(reqid uint16, method string) (ret *http.Response, err os.Error) {\n\t<-self.signals[reqid] // wait for this reqid to be finished\n\tret, err = http.ReadResponse(bufio.NewReader(self.buffers[reqid]), method)\n\tself.freeReqId(reqid)\n\treturn ret, err\n}", "title": "" } ]
[ { "docid": "b9167c3309d283f67340b82aa09f5c14", "score": "0.66053164", "text": "func (m *Message) ReadResponse(br *bufio.Reader) error {\n\tdec := m.getDecoder(br)\n\tdefer dec.Reset(empty_) /* Unwire the stream, help the GC. */\n\treturn dec.DecodeMulti(&m.Ok ,&m.Payload)\n}", "title": "" }, { "docid": "44ba49efccbba8e31dbadd71cc25612f", "score": "0.6526419", "text": "func (r *Response) ReadResponse(br *bufio.Reader) error {\n\tvar err error\n\tr.value, err = readBytes(br, r.value[:0], r.header[:])\n\tif err != nil {\n\t\treturn fmt.Errorf(\"cannot read request value: %s\", err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ef70ed779357cf56a0fe774237268741", "score": "0.6369698", "text": "func readResponse(fd int, buf []byte) (int, error) {\n\tn, err := syscall.Read(fd, buf)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn n, nil\n}", "title": "" }, { "docid": "935de02908a5dc20b46ed699a171cdbd", "score": "0.63499296", "text": "func (d *persistentStore) ReadResponse(ctx context.Context, backendID, requestID string) (*types.Response, error) {\n\tsr, err := readStoredResponse(ctx, backendID, requestID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn sr.toResponse(ctx)\n}", "title": "" }, { "docid": "e0ca6fbc62bf7da47dac0690557d81cb", "score": "0.63446486", "text": "func ReadResponse(res *http.Response) (string, int) {\n\tdefer res.Body.Close()\n\tcontent, _ := ioutil.ReadAll(res.Body)\n\treturn string(content), res.StatusCode\n}", "title": "" }, { "docid": "15c8f4106662bc3e5595dfa31acd8918", "score": "0.6299027", "text": "func ReadResponse(r *bufio.Reader, req *Request) (resp *Response, err error) {\n\n\ttp := textproto.NewReader(r)\n\tresp = new(Response)\n\n\tresp.Request = req\n\tresp.Request.Method = strings.ToUpper(resp.Request.Method)\n\n\t// Parse the first line of the response.\n\tline, err := tp.ReadLine()\n\tif err != nil {\n\t\tif err == io.EOF {\n\t\t\terr = io.ErrUnexpectedEOF\n\t\t}\n\t\treturn resp, err\n\t}\n\tf := strings.SplitN(line, \" \", 3)\n\tif len(f) < 2 {\n\t\treturn resp, &badStringError{\"malformed HTTP response\", line}\n\t}\n\treasonPhrase := \"\"\n\tif len(f) > 2 {\n\t\treasonPhrase = f[2]\n\t}\n\tresp.Status = f[1] + \" \" + reasonPhrase\n\tresp.StatusCode, err = strconv.Atoi(f[1])\n\tif err != nil {\n\t\treturn resp, &badStringError{\"malformed HTTP status code\", f[1]}\n\t}\n\n\tresp.Protocol = *(new(Protocol))\n\tresp.Protocol.Name = f[0]\n\tvar ok bool\n\tif resp.Protocol.Major, resp.Protocol.Minor, ok = ParseHTTPVersion(resp.Protocol.Name); !ok {\n\t\treturn resp, &badStringError{\"malformed HTTP version\", resp.Protocol.Name}\n\t}\n\n\t// Parse the response headers.\n\tmimeHeader, err := tp.ReadMIMEHeader()\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\tresp.Headers = Header(mimeHeader)\n\n\t//remove unknown headers\n\tfilterHeaders(resp.Headers)\n\n\tfixPragmaCacheControl(resp.Headers)\n\n\terr = readTransfer(resp, r)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}", "title": "" }, { "docid": "b963de8dd56ea9cec6d844b83fb5fb7c", "score": "0.6269912", "text": "func ReadResponse(lconn *net.TCPConn, rconn *net.TCPConn) {\n\tfor {\n\t\tbuf := make([]byte, 10240)\n\t\tn, err := lconn.Read(buf)\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\n\t\t//fmt.Println(string(buf[:n]))\n\t\trconn.Write(buf[:n]) //send mesg to source\n\t}\n\tlconn.Close()\n}", "title": "" }, { "docid": "da0085027f639822c3adb528398cafb6", "score": "0.62688446", "text": "func (read ClientResponseReaderFunc) ReadResponse(resp ClientResponse, consumer Consumer) (interface{}, error) {\n\treturn read(resp, consumer)\n}", "title": "" }, { "docid": "2e9d84c06711c32da7be32d4ff8047dd", "score": "0.6207867", "text": "func readResponse(conn io.ReadCloser, correlationID int32) ([]byte, error) {\n\tbuf, err := readConn(conn)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(buf) < 4 {\n\t\treturn nil, kbin.ErrNotEnoughData\n\t}\n\tgotID := int32(binary.BigEndian.Uint32(buf))\n\tif gotID != correlationID {\n\t\tconn.Close()\n\t\treturn nil, ErrCorrelationIDMismatch\n\t}\n\treturn buf[4:], nil\n}", "title": "" }, { "docid": "bca4db41e05df357d6930f9b1a4bc699", "score": "0.6166251", "text": "func (o *RecordUsageReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 200:\n\t\tresult := NewRecordUsageOK()\n\t\tresult.HttpResponse = response\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tdefault:\n\t\terrorResult := kbcommon.NewKillbillError(response.Code())\n\t\tif err := consumer.Consume(response.Body(), &errorResult); err != nil && err != io.EOF {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, errorResult\n\t}\n}", "title": "" }, { "docid": "211abec546a08bb9929e8ac0b419c335", "score": "0.6124989", "text": "func (o *PutRecorderIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 200:\n\t\tresult := NewPutRecorderIDOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 201:\n\t\tresult := NewPutRecorderIDCreated()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 403:\n\t\tresult := NewPutRecorderIDForbidden()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 500:\n\t\tresult := NewPutRecorderIDFailure()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"response status code does not match any response statuses defined for this endpoint in the swagger spec\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "3bcc332f5d3f15d4c02ec0685e922d0a", "score": "0.6097112", "text": "func (c *Client) readResponse(r io.Reader) (*internal.Response, error) {\n\t// Read response length.\n\tvar n uint32\n\tif err := binary.Read(r, binary.BigEndian, &n); err != nil {\n\t\treturn nil, fmt.Errorf(\"read response length: %s\", err)\n\t}\n\n\t// Read response.\n\tbuf := make([]byte, n)\n\tif _, err := io.ReadFull(r, buf); err != nil {\n\t\treturn nil, fmt.Errorf(\"read response: %s\", err)\n\t}\n\n\t// Unmarshal response.\n\tresp := &internal.Response{}\n\tif err := proto.Unmarshal(buf, resp); err != nil {\n\t\treturn nil, fmt.Errorf(\"unmarshal response: %s\", err)\n\t}\n\n\treturn resp, nil\n}", "title": "" }, { "docid": "c96bd9acfae2d4a5ec4c94e30b326aae", "score": "0.60970175", "text": "func (o *GetResourceByIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 200:\n\t\tresult := NewGetResourceByIDOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 401:\n\t\tresult := NewGetResourceByIDUnauthorized()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"response status code does not match any response statuses defined for this endpoint in the swagger spec\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "e8bc62e14a67d8a91044fcd33f4502e5", "score": "0.6083057", "text": "func (o *MintNewDRUIDSReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 200:\n\t\tresult := NewMintNewDRUIDSOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "29410eb16c534033d8bbfa25041c78d1", "score": "0.6057461", "text": "func (r *RespReader) Read() *Resp {\n\tresp, err := bufioReadResp(r.r)\n\n\tif err != nil {\n\t\tresp = errToResp(ERR_IO, err)\n\t}\n\n\treturn &resp\n}", "title": "" }, { "docid": "ede20238ab862cf74fe519943f7866f4", "score": "0.6053365", "text": "func (o *PostIPIPDelegationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 200:\n\t\tresult := NewPostIPIPDelegationOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tdefault:\n\t\tresult := NewPostIPIPDelegationDefault(response.Code())\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif response.Code()/100 == 2 {\n\t\t\treturn result, nil\n\t\t}\n\t\treturn nil, result\n\t}\n}", "title": "" }, { "docid": "7ce27149a3fa0fc25e00f77e15ee06a2", "score": "0.6040374", "text": "func (o *GetAuthCheckIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 200:\n\t\tresult := NewGetAuthCheckIDOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "7f7fb35a5426e07598f634b932fa1ccc", "score": "0.60377115", "text": "func (o *GetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 302:\n\t\tresult := NewGetFound()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tcase 404:\n\t\tresult := NewGetNotFound()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "6175c7c6a2066bee6054fa7b49a2316f", "score": "0.6023408", "text": "func ReadResponse(r *http.Response) (string, error) {\n\tbodyResponse := r.Body\n\n\tbodyByte, err := ioutil.ReadAll(bodyResponse)\n\tif err != nil {\n\t\tdefer bodyResponse.Close()\n\t\treturn \"Unable to read from the body response\", err\n\t}\n\treturn string(bodyByte), nil\n}", "title": "" }, { "docid": "111037f3fde31da3ca464275d38e6f3a", "score": "0.6022737", "text": "func readResponse(response *http.Response, err error) ([]byte, error) {\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"request didn't succeed: %v\", err)\n\t}\n\tdefer response.Body.Close()\n\tif response.StatusCode != http.StatusOK {\n\t\treturn nil, fmt.Errorf(\"got status code %v\", response.StatusCode)\n\t}\n\treturn ioutil.ReadAll(response.Body)\n}", "title": "" }, { "docid": "8584186f6f6c9cbe9ffc84cf2c3d943c", "score": "0.6009428", "text": "func (o *GetMeTaskDomainIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 200:\n\t\tresult := NewGetMeTaskDomainIDOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tdefault:\n\t\tresult := NewGetMeTaskDomainIDDefault(response.Code())\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif response.Code()/100 == 2 {\n\t\t\treturn result, nil\n\t\t}\n\t\treturn nil, result\n\t}\n}", "title": "" }, { "docid": "f603e186c338fcd238343946355d3609", "score": "0.6006506", "text": "func (o *ResumeBundleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 204:\n\t\tresult := NewResumeBundleNoContent()\n\t\tresult.HttpResponse = response\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tdefault:\n\t\terrorResult := kbcommon.NewKillbillError(response.Code())\n\t\tif err := consumer.Consume(response.Body(), &errorResult); err != nil && err != io.EOF {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, errorResult\n\t}\n}", "title": "" }, { "docid": "18ca9b06a381564bb5d5bf5adb9fc787", "score": "0.5982902", "text": "func readResponse(r io.Reader) (byte, []byte, error) {\n\tvar msgSize int32\n\n\t// message size\n\terr := binary.Read(r, binary.BigEndian, &msgSize)\n\tif err != nil {\n\t\treturn 0, nil, err\n\t}\n\n\t// message binary data\n\tbuf := make([]byte, msgSize)\n\t_, err = io.ReadFull(r, buf)\n\tif err != nil {\n\t\treturn 0, nil, err\n\t}\n\n\tif len(buf) < 2 {\n\t\treturn 0, nil, errors.New(\"length of response is too small\")\n\t}\n\n\treturn buf[0], buf[1:], nil\n\n}", "title": "" }, { "docid": "5c2e412e2378e6790dd8254b611d55f8", "score": "0.59586746", "text": "func (o *GetResourceByIDUsingGET5Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 200:\n\t\tresult := NewGetResourceByIDUsingGET5OK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 401:\n\t\tresult := NewGetResourceByIDUsingGET5Unauthorized()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"response status code does not match any response statuses defined for this endpoint in the swagger spec\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "76c56f4f12f1edbafb7eab560ff8ca2e", "score": "0.59524703", "text": "func (o *ReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 200:\n\t\tresult := NewReadOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 403:\n\t\tresult := NewReadForbidden()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"response status code does not match any response statuses defined for this endpoint in the swagger spec\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "7e0eab021d4c4be8cb690d66876ab526", "score": "0.59497285", "text": "func (o *GetAttachmentsIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 200:\n\t\tresult := NewGetAttachmentsIDOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 404:\n\t\tresult := NewGetAttachmentsIDNotFound()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 429:\n\t\tresult := NewGetAttachmentsIDTooManyRequests()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "e6ce5b8ab67dfbbd90d643f947c0c6dd", "score": "0.59477836", "text": "func readResponse(body io.ReadCloser) (data []byte, err error) {\n\tif body != nil {\n\t\tdata, err = ioutil.ReadAll(body)\n\t\tbody.Close()\n\t}\n\treturn data, err\n}", "title": "" }, { "docid": "a223226cfa313640d730109c137a642d", "score": "0.59465075", "text": "func (o *UnregisterEventIDHandlerReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 204:\n\t\tresult := NewUnregisterEventIDHandlerNoContent()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 401:\n\t\tresult := NewUnregisterEventIDHandlerUnauthorized()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 403:\n\t\tresult := NewUnregisterEventIDHandlerForbidden()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 404:\n\t\tresult := NewUnregisterEventIDHandlerNotFound()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 500:\n\t\tresult := NewUnregisterEventIDHandlerInternalServerError()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tdefault:\n\t\tdata, err := ioutil.ReadAll(response.Body())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn nil, fmt.Errorf(\"Requested DELETE /event/registry/eventIds/{eventId} returns an error %d: %s\", response.Code(), string(data))\n\t}\n}", "title": "" }, { "docid": "d0d2f99e15d64c5a5518fdd4bb5633ad", "score": "0.59428537", "text": "func (o *DeleteRecordsIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 204:\n\t\tresult := NewDeleteRecordsIDNoContent()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 403:\n\t\tresult := NewDeleteRecordsIDForbidden()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 404:\n\t\tresult := NewDeleteRecordsIDNotFound()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 500:\n\t\tresult := NewDeleteRecordsIDInternalServerError()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "f5e09038ea99d12a542a7ea128ded872", "score": "0.59392077", "text": "func (o *GetTransactionFundingrequestsFundingRequestIDAdmissionsFundingRequestAdmissionIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 200:\n\t\tresult := NewGetTransactionFundingrequestsFundingRequestIDAdmissionsFundingRequestAdmissionIDOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tcase 400:\n\t\tresult := NewGetTransactionFundingrequestsFundingRequestIDAdmissionsFundingRequestAdmissionIDBadRequest()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tcase 403:\n\t\tresult := NewGetTransactionFundingrequestsFundingRequestIDAdmissionsFundingRequestAdmissionIDForbidden()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "db05a6abf681a09db272add8b602635f", "score": "0.5933457", "text": "func (o *GetUsersIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 200:\n\t\tresult := NewGetUsersIDOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tcase 404:\n\t\tresult := NewGetUsersIDNotFound()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "3705509c363e62e4f664c78c76d49bf3", "score": "0.5930476", "text": "func (o *CloseAccountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 204:\n\t\tresult := NewCloseAccountNoContent()\n\t\tresult.HttpResponse = response\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tdefault:\n\t\terrorResult := kbcommon.NewKillbillError(response.Code())\n\t\tif err := consumer.Consume(response.Body(), &errorResult); err != nil && err != io.EOF {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, errorResult\n\t}\n}", "title": "" }, { "docid": "cd70acab006a466fba28944e902ed3f2", "score": "0.59209996", "text": "func (o *ListEventLoopReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 200:\n\t\tresult := NewListEventLoopOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 400:\n\t\tresult := NewListEventLoopBadRequest()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 409:\n\t\tresult := NewListEventLoopConflict()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 500:\n\t\tresult := NewListEventLoopInternalServerError()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "af13a01ad130a90f5e4c8e901bf79b25", "score": "0.5916171", "text": "func (o *PatchLookupsIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 200:\n\t\tresult := NewPatchLookupsIDOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tdefault:\n\t\tresult := NewPatchLookupsIDDefault(response.Code())\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\t}\n}", "title": "" }, { "docid": "ea9d6fe1c6608291690fb1249359eae5", "score": "0.59132797", "text": "func (o *DownloadRequestUsingPOSTReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 202:\n\t\tresult := NewDownloadRequestUsingPOSTAccepted()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 400:\n\t\tresult := NewDownloadRequestUsingPOSTBadRequest()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 404:\n\t\tresult := NewDownloadRequestUsingPOSTNotFound()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"response status code does not match any response statuses defined for this endpoint in the swagger spec\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "e46af7f573cef08a640b1060ee76fd3a", "score": "0.5904725", "text": "func readResponse(resp *http.Response) ([]byte, error) {\n\tdefer resp.Body.Close()\n\n\tbody, err := ioutil.ReadAll(resp.Body)\n\treturn body, err\n}", "title": "" }, { "docid": "6fb2f2e94c6843174191291d1c733fcb", "score": "0.5891416", "text": "func (o *NewIvrRecordingReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 200:\n\t\tresult := NewNewIvrRecordingOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 400:\n\t\tresult := NewNewIvrRecordingBadRequest()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 402:\n\t\tresult := NewNewIvrRecordingPaymentRequired()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 403:\n\t\tresult := NewNewIvrRecordingForbidden()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "7f5b5d47dcd50b2f48458455b13a5995", "score": "0.5891261", "text": "func (o *GetOutputResourceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 200:\n\t\tresult := NewGetOutputResourceOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "25f55dc90963dbfd627d2b2469dbd5ca", "score": "0.58910173", "text": "func (o *RevokeSessionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 204:\n\t\tresult := NewRevokeSessionNoContent()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 400:\n\t\tresult := NewRevokeSessionBadRequest()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 500:\n\t\tresult := NewRevokeSessionInternalServerError()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"response status code does not match any response statuses defined for this endpoint in the swagger spec\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "3c5bc055e2ee16ebfb1b413a5dd8b729", "score": "0.58907694", "text": "func (m *Middleware) ReceiveResponse(id string) (*Response, error) {\n\ttuple, err := space.NewTuple(id, space.NilValue())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t\n\t// Create response tuple to put the result on it\n\tresTuple, err := space.NewTuple()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Send tuple to TupleSpace\n\terr = m.communicate(\"TupleSpace.Take\", m.readTimeout, *tuple, resTuple)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Create response struct\n\tres := new(Response)\n\terr = resTuple.Get(0, &res.ID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\terr = resTuple.Get(1, &res.Args)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn res, nil\n}", "title": "" }, { "docid": "f97f20d16f80ec5208db1e66f7601870", "score": "0.58806753", "text": "func (o *CreateRequestsRequestIDDebugEntriesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 200:\n\t\tresult := NewCreateRequestsRequestIDDebugEntriesOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tcase 400:\n\t\tresult := NewCreateRequestsRequestIDDebugEntriesBadRequest()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tcase 409:\n\t\tresult := NewCreateRequestsRequestIDDebugEntriesConflict()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "fe992eb4b6461b40f01dc556cebf1a17", "score": "0.5880668", "text": "func (o *GetRestByIDByIDDocumentsByIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 404:\n\t\tresult := NewGetRestByIDByIDDocumentsByIDNotFound()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\tresult := NewGetRestByIDByIDDocumentsByIDDefault(response.Code())\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif response.Code()/100 == 2 {\n\t\t\treturn result, nil\n\t\t}\n\t\treturn nil, result\n\t}\n}", "title": "" }, { "docid": "23880b2cc6e657cd92ee34957496de8d", "score": "0.5879443", "text": "func (o *DeleteBindReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 202:\n\t\tresult := NewDeleteBindAccepted()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 204:\n\t\tresult := NewDeleteBindNoContent()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 404:\n\t\tresult := NewDeleteBindNotFound()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tdefault:\n\t\tresult := NewDeleteBindDefault(response.Code())\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif response.Code()/100 == 2 {\n\t\t\treturn result, nil\n\t\t}\n\t\treturn nil, result\n\t}\n}", "title": "" }, { "docid": "1daf0ea94c9d952deb1b1041c7e21bfa", "score": "0.587158", "text": "func (o *PostDocumentDocumentIDDownloadLinkReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 200:\n\t\tresult := NewPostDocumentDocumentIDDownloadLinkOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"response status code does not match any response statuses defined for this endpoint in the swagger spec\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "0162832a199177876cb4dd3726a93097", "score": "0.5866882", "text": "func (o *GetEndpointIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 200:\n\t\tresult := NewGetEndpointIDOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 400:\n\t\tresult := NewGetEndpointIDInvalid()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 404:\n\t\tresult := NewGetEndpointIDNotFound()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 429:\n\t\tresult := NewGetEndpointIDTooManyRequests()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"response status code does not match any response statuses defined for this endpoint in the swagger spec\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "872f7129a73feb12f9f0c68773c55dd9", "score": "0.58636636", "text": "func (o *ListEventLoopReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 200:\n\t\tresult := NewListEventLoopOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 400:\n\t\tresult := NewListEventLoopBadRequest()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 409:\n\t\tresult := NewListEventLoopConflict()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 500:\n\t\tresult := NewListEventLoopInternalServerError()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"response status code does not match any response statuses defined for this endpoint in the swagger spec\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "4155085e3871ba57ca01f7862ac379aa", "score": "0.585919", "text": "func (o *DeleteCharactersCharacterIDFittingsFittingIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 204:\n\t\tresult := NewDeleteCharactersCharacterIDFittingsFittingIDNoContent()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tcase 403:\n\t\tresult := NewDeleteCharactersCharacterIDFittingsFittingIDForbidden()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tcase 500:\n\t\tresult := NewDeleteCharactersCharacterIDFittingsFittingIDInternalServerError()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "9cef322d1e0bd2bef1474844469d07cf", "score": "0.5852927", "text": "func (o *GetAvailableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 200:\n\t\tresult := NewGetAvailableOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tdefault:\n\t\tresult := NewGetAvailableDefault(response.Code())\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif response.Code()/100 == 2 {\n\t\t\treturn result, nil\n\t\t}\n\t\treturn nil, result\n\t}\n}", "title": "" }, { "docid": "014c308a743d2dc6f44ccaef6201388b", "score": "0.58497834", "text": "func readResponse(conn net.Conn) (*Response, error) {\n\tb := make([]byte, 0)\n\tfor {\n\t\tbuf := make([]byte, 512)\n\t\tnr, err := conn.Read(buf)\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t\tbuf = buf[:nr]\n\t\tb = append(b, buf...)\n\t}\n\tres := &Response{}\n\tdecoder := json.NewDecoder(bytes.NewReader(b))\n\terr := decoder.Decode(res)\n\treturn res, err\n}", "title": "" }, { "docid": "e97dcf4a472498ed805dbaaf4e85915b", "score": "0.5847951", "text": "func (o *GetTravelExpenseRateIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 200:\n\t\tresult := NewGetTravelExpenseRateIDOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "a4e56234a9481be16ef146c51acdccb3", "score": "0.58464855", "text": "func (o *UnsubscribeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 204:\n\t\tresult := NewUnsubscribeNoContent()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tcase 400:\n\t\tresult := NewUnsubscribeBadRequest()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tcase 500:\n\t\tresult := NewUnsubscribeInternalServerError()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "730a22b7a44bb6e74bc2fa3ebdf7b93a", "score": "0.5844529", "text": "func (o *DetachCredentialFromRuntimeEnvReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 200:\n\t\tresult := NewDetachCredentialFromRuntimeEnvOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "a473d0559ae7334484b6282264b325eb", "score": "0.58434147", "text": "func (o *GetRequestUsingGET2Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 200:\n\t\tresult := NewGetRequestUsingGET2OK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 401:\n\t\tresult := NewGetRequestUsingGET2Unauthorized()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 404:\n\t\tresult := NewGetRequestUsingGET2NotFound()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"response status code does not match any response statuses defined for this endpoint in the swagger spec\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "e34ebf48f3ff28b0e9554e47edc26878", "score": "0.5842908", "text": "func (o *PatchParkingGaragesGarageIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 204:\n\t\tresult := NewPatchParkingGaragesGarageIDNoContent()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tcase 404:\n\t\tresult := NewPatchParkingGaragesGarageIDNotFound()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tcase 422:\n\t\tresult := NewPatchParkingGaragesGarageIDUnprocessableEntity()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "35cbd17f274f5a3c0e8c3782167708c2", "score": "0.58375967", "text": "func (o *GetMaybeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 200:\n\t\tresult := NewGetMaybeOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tcase 403:\n\t\tresult := NewGetMaybeForbidden()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tcase 500:\n\t\tresult := NewGetMaybeInternalServerError()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "117ea2c581c32a1b2afddc890290f06c", "score": "0.5835837", "text": "func (o *GetLabelsIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 200:\n\t\tresult := NewGetLabelsIDOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 401:\n\t\tresult := NewGetLabelsIDUnauthorized()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 404:\n\t\tresult := NewGetLabelsIDNotFound()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 500:\n\t\tresult := NewGetLabelsIDInternalServerError()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "6bfa275f53ead21d3937213243eb8b87", "score": "0.58272773", "text": "func (o *GetPeoplePersonIDKidsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 200:\n\t\tresult := NewGetPeoplePersonIDKidsOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tcase 401:\n\t\tresult := NewGetPeoplePersonIDKidsUnauthorized()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tcase 404:\n\t\tresult := NewGetPeoplePersonIDKidsNotFound()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "c71522b29c659bdd818c02976fe67d1f", "score": "0.5823661", "text": "func (o *GetWebhooksWebhookIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 200:\n\t\tresult := NewGetWebhooksWebhookIDOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tcase 404:\n\t\tresult := NewGetWebhooksWebhookIDNotFound()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tcase 405:\n\t\tresult := NewGetWebhooksWebhookIDMethodNotAllowed()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "f37a4143acdaf8af04386cc43101e637", "score": "0.5823367", "text": "func (o *PutLTENetworkIDNetworkProbeTasksTaskIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 204:\n\t\tresult := NewPutLTENetworkIDNetworkProbeTasksTaskIDNoContent()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tdefault:\n\t\tresult := NewPutLTENetworkIDNetworkProbeTasksTaskIDDefault(response.Code())\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif response.Code()/100 == 2 {\n\t\t\treturn result, nil\n\t\t}\n\t\treturn nil, result\n\t}\n}", "title": "" }, { "docid": "f315d48dad9b0cb884199e56f939a0ea", "score": "0.58189744", "text": "func (o *GetSeriesIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 200:\n\t\tresult := NewGetSeriesIDOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tcase 401:\n\t\tresult := NewGetSeriesIDUnauthorized()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tcase 404:\n\t\tresult := NewGetSeriesIDNotFound()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "75c522b00227b866aeef83e0c9c8a75b", "score": "0.58159995", "text": "func (r *Response) Read(buf []byte) (int, error) {\n\treturn r.conn.Read(buf)\n}", "title": "" }, { "docid": "0894b43d3fd8c0cdd12b77132b647c50", "score": "0.581424", "text": "func (o *VerifyLdapBindReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 200:\n\t\tresult := NewVerifyLdapBindOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 400:\n\t\tresult := NewVerifyLdapBindBadRequest()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 401:\n\t\tresult := NewVerifyLdapBindUnauthorized()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 500:\n\t\tresult := NewVerifyLdapBindInternalServerError()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "4d595f0a6c4eb1a7d8893074c1964173", "score": "0.58100593", "text": "func ReadResponse(r io.Reader) (*Response, error) {\n\tvar size uint32\n\tif err := binary.Read(r, binary.LittleEndian, &size); err != nil {\n\t\treturn nil, fmt.Errorf(\"could not read response body size: %v\", err)\n\t}\n\tif size > MaxSize+12 {\n\t\treturn nil, fmt.Errorf(\"response body size too large: %d. Max packet size: %d\", size, MaxSize+12)\n\t}\n\tif size < 12 {\n\t\treturn nil, fmt.Errorf(\"response body size too small: %d. Min response size: 12\", size)\n\t}\n\tdata := make([]byte, size)\n\tif _, err := io.ReadFull(r, data); err != nil {\n\t\treturn nil, fmt.Errorf(\"could not read response body (size: %d): %v\", size, err)\n\t}\n\tch := uint32(data[0]) + uint32(data[1])<<8 + uint32(data[2])<<16 + uint32(data[3])<<24\n\tif ch > MaxChannel {\n\t\treturn nil, fmt.Errorf(\"channel is too large: %d. Max channel: %d\", ch, MaxChannel)\n\t}\n\tv := int64(data[4]) + int64(data[5])<<8 + int64(data[6])<<16 + int64(data[7])<<24 +\n\t\tint64(data[8])<<32 + int64(data[9])<<40 + int64(data[10])<<48 + int64(data[11])<<56\n\tts := time.Unix(v/int64(1E9), v%int64(1E9))\n\tdata = data[12:]\n\treturn &Response{\n\t\tChannel: ch,\n\t\tTimestamp: ts,\n\t\tData: data,\n\t}, nil\n}", "title": "" }, { "docid": "2b7d0359cf678b098a906c4d5e777886", "score": "0.58093065", "text": "func (o *DeleteDocumentPaymentsIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 204:\n\t\tresult := NewDeleteDocumentPaymentsIDNoContent()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 404:\n\t\tresult := NewDeleteDocumentPaymentsIDNotFound()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 429:\n\t\tresult := NewDeleteDocumentPaymentsIDTooManyRequests()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "ce88b0760d8bf18360b8d59069d10fc5", "score": "0.5800788", "text": "func (o *PutProjectIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 200:\n\t\tresult := NewPutProjectIDOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "7b9ce8f2edfbde272daa71db851405ed", "score": "0.57995605", "text": "func (o *FindConfigCounterWriteRequestTimeoutInMsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 200:\n\t\tresult := NewFindConfigCounterWriteRequestTimeoutInMsOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tdefault:\n\t\tresult := NewFindConfigCounterWriteRequestTimeoutInMsDefault(response.Code())\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif response.Code()/100 == 2 {\n\t\t\treturn result, nil\n\t\t}\n\t\treturn nil, result\n\t}\n}", "title": "" }, { "docid": "1d97db28e9b42dca5fa02222804e1b08", "score": "0.5796746", "text": "func (o *AllocateOrReleaseFromIPPoolReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 201:\n\t\tresult := NewAllocateOrReleaseFromIPPoolCreated()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tdefault:\n\t\tresult := NewAllocateOrReleaseFromIPPoolDefault(response.Code())\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif response.Code()/100 == 2 {\n\t\t\treturn result, nil\n\t\t}\n\t\treturn nil, result\n\t}\n}", "title": "" }, { "docid": "7dd56b29229e4486978ef10d3b168fd0", "score": "0.579118", "text": "func (o *UnfavoriteARecipeByIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 200:\n\t\tresult := NewUnfavoriteARecipeByIDOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tcase 404:\n\t\tresult := NewUnfavoriteARecipeByIDNotFound()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "7fa12c67414fe9dc0cd599cb442e0853", "score": "0.5789387", "text": "func (o *PutDynamicnodesIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 201:\n\t\tresult := NewPutDynamicnodesIDCreated()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tcase 400:\n\t\tresult := NewPutDynamicnodesIDBadRequest()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tcase 500:\n\t\tresult := NewPutDynamicnodesIDInternalServerError()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "451652fda49d6b5e54781d8424232f68", "score": "0.57806367", "text": "func (o *RepoGetByIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 200:\n\t\tresult := NewRepoGetByIDOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "d121c0c06ec41638cdfc0e1918bc885f", "score": "0.5775043", "text": "func (o *PostDocumentsIDCancelReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 200:\n\t\tresult := NewPostDocumentsIDCancelOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 404:\n\t\tresult := NewPostDocumentsIDCancelNotFound()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 429:\n\t\tresult := NewPostDocumentsIDCancelTooManyRequests()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "6500158db1e156b73c592d2d23a3042b", "score": "0.5773782", "text": "func (bk *baseClient) ReadResponse(resp *resty.Response) ([]byte, error) {\n\tbody := resp.Body()\n\tif resp.StatusCode() != 200 {\n\t\terrResponse := ErrorResponse{}\n\t\tif err := json.Unmarshal(body, &errResponse); err != nil {\n\t\t\treturn nil, errors.Errorf(\"cannot read error response: %s\", string(body))\n\t\t}\n\t\treturn nil, errors.Errorf(errResponse.ErrorText)\n\t}\n\treturn body, nil\n}", "title": "" }, { "docid": "ec42a64a0b510f88f4767763d7ef81eb", "score": "0.5772534", "text": "func (o *ContainerUnpauseReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 204:\n\t\tresult := NewContainerUnpauseNoContent()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tcase 404:\n\t\tresult := NewContainerUnpauseNotFound()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tcase 500:\n\t\tresult := NewContainerUnpauseInternalServerError()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "b2d0258b058561ad55f21bfc4bcc09ca", "score": "0.5771876", "text": "func (r *Request) ReceiveResponse() (resp *Response, err error) {\n\tif r.resp != nil { // provent multiple call\n\t\tresp = r.resp\n\t\treturn\n\t}\n\terr = r.Do()\n\tif err != nil {\n\t\treturn\n\t}\n\tresp = r.resp\n\treturn\n}", "title": "" }, { "docid": "0a21df7322a3dda2c033e2904844aceb", "score": "0.57667065", "text": "func (o *PatchRunsIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 200:\n\t\tresult := NewPatchRunsIDOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "373107d39f8f96c942644efeee349f8b", "score": "0.5764182", "text": "func (o *CreateFileViaFormReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 200:\n\t\tresult := NewCreateFileViaFormOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "b091e04cd18d0c4485d625050d8a26a0", "score": "0.5763859", "text": "func (o *GetRequestUsingGETReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 200:\n\t\tresult := NewGetRequestUsingGETOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 401:\n\t\tresult := NewGetRequestUsingGETUnauthorized()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 404:\n\t\tresult := NewGetRequestUsingGETNotFound()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"response status code does not match any response statuses defined for this endpoint in the swagger spec\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "6f8c9685aec06b112726fe6c4f403cad", "score": "0.5762109", "text": "func (o *GetFeedByIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 200:\n\t\tresult := NewGetFeedByIDOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 400:\n\t\tresult := NewGetFeedByIDBadRequest()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"response status code does not match any response statuses defined for this endpoint in the swagger spec\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "e1aea5b12c4bc61bd9066ddfa7e91967", "score": "0.57602495", "text": "func (req *SrvReq) RespondRread(data []byte) {\n\terr := req.Rc.packRread(data)\n\tif err != nil {\n\t\treq.RespondError(err)\n\t} else {\n\t\treq.Respond()\n\t}\n}", "title": "" }, { "docid": "18a53129721d11fce87c9f53fb0ea19e", "score": "0.5753935", "text": "func (o *RolesByIDGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 200:\n\t\tresult := NewRolesByIDGetOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tcase 401:\n\t\tresult := NewRolesByIDGetUnauthorized()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "d1a2b7bb5bb04c54b8662ce1c196eaf7", "score": "0.574763", "text": "func (o *JoinSessionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 200:\n\t\tresult := NewJoinSessionOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 400:\n\t\tresult := NewJoinSessionBadRequest()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 404:\n\t\tresult := NewJoinSessionNotFound()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 500:\n\t\tresult := NewJoinSessionInternalServerError()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tdefault:\n\t\tdata, err := ioutil.ReadAll(response.Body())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn nil, fmt.Errorf(\"Requested POST /sessionbrowser/namespaces/{namespace}/gamesession/{sessionID}/join returns an error %d: %s\", response.Code(), string(data))\n\t}\n}", "title": "" }, { "docid": "9b3aff249723f6a0e35922b7686268f1", "score": "0.57446766", "text": "func (o *ForbidAddrReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 200:\n\t\tresult := NewForbidAddrOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 400:\n\t\tresult := NewForbidAddrBadRequest()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 500:\n\t\tresult := NewForbidAddrInternalServerError()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "2d2aae42497d2cddbab27e4a772967bf", "score": "0.5743729", "text": "func (o *GetMeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 200:\n\t\tresult := NewGetMeOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tdefault:\n\t\tresult := NewGetMeDefault(response.Code())\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif response.Code()/100 == 2 {\n\t\t\treturn result, nil\n\t\t}\n\t\treturn nil, result\n\t}\n}", "title": "" }, { "docid": "44132f4f62a05d0fab012c697a303bff", "score": "0.5740879", "text": "func (o *DeleteRequestReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 204:\n\t\tresult := NewDeleteRequestNoContent()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 403:\n\t\tresult := NewDeleteRequestForbidden()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"response status code does not match any response statuses defined for this endpoint in the swagger spec\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "05f01de1a002ded1200a8d3d26b8d34c", "score": "0.5739996", "text": "func (req *Req) RespondRread(data []byte) {\n\terr := p.PackRread(req.Rc, data)\n\tif err != nil {\n\t\treq.RespondError(err)\n\t} else {\n\t\treq.Respond()\n\t}\n}", "title": "" }, { "docid": "c71c6b8fe4dca93096af8ebac0836ee7", "score": "0.5738774", "text": "func (o *LogRequestDownloadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 200:\n\t\tresult := NewLogRequestDownloadOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tcase 400:\n\t\tresult := NewLogRequestDownloadBadRequest()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\tresult := NewLogRequestDownloadDefault(response.Code())\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif response.Code()/100 == 2 {\n\t\t\treturn result, nil\n\t\t}\n\t\treturn nil, result\n\t}\n}", "title": "" }, { "docid": "96439a237cec464a212ad3ab233855f8", "score": "0.5723182", "text": "func (o *ForceReleaseReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 204:\n\t\tresult := NewForceReleaseNoContent()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 403:\n\t\tresult := NewForceReleaseForbidden()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 404:\n\t\tresult := NewForceReleaseNotFound()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"response status code does not match any response statuses defined for this endpoint in the swagger spec\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "8643d72852bc7e8efe271c33674ce79c", "score": "0.5720557", "text": "func (r *MarkThreadAsReadResponse) HTTPResponse() *http.Response {\n\treturn r.httpResponse\n}", "title": "" }, { "docid": "e6aab98622deda68334d9a1549607db6", "score": "0.57162964", "text": "func (o *MarkAsReadedReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 200:\n\t\tresult := NewMarkAsReadedOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 401:\n\t\tresult := NewMarkAsReadedUnauthorized()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 403:\n\t\tresult := NewMarkAsReadedForbidden()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "dcc6312bfa8a83c3a37603736e08d5b5", "score": "0.57134354", "text": "func (o *ReportOnClaimedTaskReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 200:\n\t\tresult := NewReportOnClaimedTaskOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 400:\n\t\tresult := NewReportOnClaimedTaskBadRequest()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 403:\n\t\tresult := NewReportOnClaimedTaskForbidden()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 404:\n\t\tresult := NewReportOnClaimedTaskNotFound()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "9c868dd16866697c7efbb4371bf24ca8", "score": "0.5713255", "text": "func (req *Req) RespondRread(data []byte) {\n\terr := ixp.PackRread(req.Rc, data)\n\tif err != nil {\n\t\treq.RespondError(err)\n\t} else {\n\t\treq.Respond()\n\t}\n}", "title": "" }, { "docid": "bc5c28aeeafb8704959677279660f791", "score": "0.5711411", "text": "func (o *TestReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 200:\n\t\tresult := NewTestReadOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 401:\n\t\tresult := NewTestReadUnauthorized()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"response status code does not match any response statuses defined for this endpoint in the swagger spec\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "5224ec150917ef58463aa80e7207edea", "score": "0.5709354", "text": "func (o *PostSitesByIDSlotSearchReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 400:\n\t\tresult := NewPostSitesByIDSlotSearchBadRequest()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\tresult := NewPostSitesByIDSlotSearchDefault(response.Code())\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif response.Code()/100 == 2 {\n\t\t\treturn result, nil\n\t\t}\n\t\treturn nil, result\n\t}\n}", "title": "" }, { "docid": "20ee078e0d091e4e552f156446745d56", "score": "0.5707389", "text": "func (o *SamlSingleLogoutHTTPRedirectConsumerReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tresult := NewSamlSingleLogoutHTTPRedirectConsumerDefault(response.Code())\n\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\treturn nil, err\n\t}\n\tif response.Code()/100 == 2 {\n\t\treturn result, nil\n\t}\n\treturn nil, result\n}", "title": "" }, { "docid": "c95f679df54d1a69c1f6b74d8ba4eeb2", "score": "0.5707331", "text": "func (o *RTRDeleteQueuedSessionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 204:\n\t\tresult := NewRTRDeleteQueuedSessionNoContent()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 400:\n\t\tresult := NewRTRDeleteQueuedSessionBadRequest()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 401:\n\t\tresult := NewRTRDeleteQueuedSessionUnauthorized()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 403:\n\t\tresult := NewRTRDeleteQueuedSessionForbidden()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 429:\n\t\tresult := NewRTRDeleteQueuedSessionTooManyRequests()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"[DELETE /real-time-response/entities/queued-sessions/command/v1] RTR-DeleteQueuedSession\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "9613ac5e8d94e3e5d7a1936ee2545cd6", "score": "0.57072604", "text": "func (o *DeleteIPIPReverseIPReverseReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 200:\n\t\tresult := NewDeleteIPIPReverseIPReverseOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tdefault:\n\t\tresult := NewDeleteIPIPReverseIPReverseDefault(response.Code())\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif response.Code()/100 == 2 {\n\t\t\treturn result, nil\n\t\t}\n\t\treturn nil, result\n\t}\n}", "title": "" }, { "docid": "7d614e1d786bd8134313922ae1fb9b34", "score": "0.570619", "text": "func (o *UpdateUserPasswordReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 204:\n\t\tresult := NewUpdateUserPasswordNoContent()\n\t\tresult.HttpResponse = response\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tdefault:\n\t\terrorResult := kbcommon.NewKillbillError(response.Code())\n\t\tif err := consumer.Consume(response.Body(), &errorResult); err != nil && err != io.EOF {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, errorResult\n\t}\n}", "title": "" }, { "docid": "64bd446d00adaeb7ea4493c8619fb687", "score": "0.5704045", "text": "func (o *DeleteLabelsIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 200:\n\t\tresult := NewDeleteLabelsIDOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 400:\n\t\tresult := NewDeleteLabelsIDBadRequest()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 401:\n\t\tresult := NewDeleteLabelsIDUnauthorized()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 404:\n\t\tresult := NewDeleteLabelsIDNotFound()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 500:\n\t\tresult := NewDeleteLabelsIDInternalServerError()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "2274152d61a0f06ad3a48b7764bc84f3", "score": "0.57027775", "text": "func (o *InvalidatesCacheReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 204:\n\t\tresult := NewInvalidatesCacheNoContent()\n\t\tresult.HttpResponse = response\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tdefault:\n\t\terrorResult := kbcommon.NewKillbillError(response.Code())\n\t\tif err := consumer.Consume(response.Body(), &errorResult); err != nil && err != io.EOF {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, errorResult\n\t}\n}", "title": "" }, { "docid": "d8162c1479263c1614e7e676d89d0135", "score": "0.56994724", "text": "func (o *ExportSearchRelativeChunkedReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\n\tcase 200:\n\t\tresult := NewExportSearchRelativeChunkedOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\n\tcase 400:\n\t\tresult := NewExportSearchRelativeChunkedBadRequest()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" } ]
45644c041bf0c869f2716dde808bc4db
Interface returns from LldpPath the path struct for its child "interface". Name: string
[ { "docid": "b734db71e3a0cfa4d81572d58864f611", "score": "0.76320094", "text": "func (n *LldpPath) Interface(Name string) *Lldp_InterfacePath {\n\treturn &Lldp_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"name\": Name},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" } ]
[ { "docid": "f84c30d949dfeaa6f5fb063a84d1be64", "score": "0.734964", "text": "func (n *LldpPathAny) Interface(Name string) *Lldp_InterfacePathAny {\n\treturn &Lldp_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"name\": Name},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "24f58dd3783b4fc91624229af218019a", "score": "0.73294264", "text": "func (n *LacpPath) Interface(Name string) *Lacp_InterfacePath {\n\treturn &Lacp_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"name\": Name},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "1ed791aeaf5de892d3f835f5a137fa22", "score": "0.7309968", "text": "func (n *Lacp_Interface_MemberPath) Interface() *Lacp_Interface_Member_InterfacePath {\n\treturn &Lacp_Interface_Member_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "d235cdf8010127fe73e18aefdd44fb06", "score": "0.73094755", "text": "func (n *Stp_RstpPath) Interface(Name string) *Stp_Rstp_InterfacePath {\n\treturn &Stp_Rstp_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"name\": Name},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "fc9e47c4275c96d0c9c83ca3b720c961", "score": "0.7177111", "text": "func (n *AclPath) Interface(Id string) *Acl_InterfacePath {\n\treturn &Acl_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"id\": Id},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "79e7bfc37699975d5b15867f3ea4987c", "score": "0.7127727", "text": "func (n *StpPath) Interface(Name string) *Stp_InterfacePath {\n\treturn &Stp_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"name\": Name},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "54d699453a70c3d4acfb03e23877e611", "score": "0.70835626", "text": "func (n *Acl_Interface_InterfaceRefPath) Interface() *Acl_Interface_InterfaceRef_InterfacePath {\n\treturn &Acl_Interface_InterfaceRef_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "d504a54ef74f6619f5dbeb44c94405d8", "score": "0.70780617", "text": "func (n *RelayAgent_DhcpPath) Interface(Id string) *RelayAgent_Dhcp_InterfacePath {\n\treturn &RelayAgent_Dhcp_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"id\": Id},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "81e815f0bf5c98bc48b592926afd9730", "score": "0.7065279", "text": "func (n *NetworkInstance_Protocol_IgmpPath) Interface(InterfaceId string) *NetworkInstance_Protocol_Igmp_InterfacePath {\n\treturn &NetworkInstance_Protocol_Igmp_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"interface-id\": InterfaceId},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "af1e69ad3327f799c82abd5102d41bf6", "score": "0.7064861", "text": "func (n *LacpPathAny) Interface(Name string) *Lacp_InterfacePathAny {\n\treturn &Lacp_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"name\": Name},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "714b8bb169aa02a298727218b773a156", "score": "0.70492345", "text": "func (n *RelayAgent_Dhcpv6Path) Interface(Id string) *RelayAgent_Dhcpv6_InterfacePath {\n\treturn &RelayAgent_Dhcpv6_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"id\": Id},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "5e1b0e16d107a4ffa19145759e84fa7a", "score": "0.70446503", "text": "func (n *Stp_Mstp_MstInstancePath) Interface(Name string) *Stp_Mstp_MstInstance_InterfacePath {\n\treturn &Stp_Mstp_MstInstance_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"name\": Name},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "d6d83aa03895cdfb4384310b81cfb268", "score": "0.7016969", "text": "func (n *LocalRoutes_Static_NextHop_InterfaceRefPath) Interface() *LocalRoutes_Static_NextHop_InterfaceRef_InterfacePath {\n\treturn &LocalRoutes_Static_NextHop_InterfaceRef_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "a9a9ba77e9548448f24a13e04c782f32", "score": "0.69909906", "text": "func (n *NetworkInstance_Protocol_PimPath) Interface(InterfaceId string) *NetworkInstance_Protocol_Pim_InterfacePath {\n\treturn &NetworkInstance_Protocol_Pim_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"interface-id\": InterfaceId},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "3ab54022eabd441d59b5b22151a9eda2", "score": "0.6967562", "text": "func (n *Stp_RstpPathAny) Interface(Name string) *Stp_Rstp_InterfacePathAny {\n\treturn &Stp_Rstp_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"name\": Name},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "60561580aa659ed41069c714e8fd5616", "score": "0.6967273", "text": "func (n *Stp_VlanPath) Interface(Name string) *Stp_Vlan_InterfacePath {\n\treturn &Stp_Vlan_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"name\": Name},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "50ac42702b6b8c1e965e1a5f4cfd3b6b", "score": "0.6938216", "text": "func (n *NetworkInstance_MplsPath) Interface(InterfaceId string) *NetworkInstance_Mpls_InterfacePath {\n\treturn &NetworkInstance_Mpls_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"te-interface-attributes\", \"interface\"},\n\t\t\tmap[string]interface{}{\"interface-id\": InterfaceId},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "455ad7006e85749cf06be75516d7da13", "score": "0.69274426", "text": "func (n *NetworkInstance_Mpls_SignalingProtocols_Ldp_InterfaceAttributesPath) Interface(InterfaceId string) *NetworkInstance_Mpls_SignalingProtocols_Ldp_InterfaceAttributes_InterfacePath {\n\treturn &NetworkInstance_Mpls_SignalingProtocols_Ldp_InterfaceAttributes_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"interface-id\": InterfaceId},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "4061c84867783dded045a42ef4e10033", "score": "0.6922109", "text": "func (n *NetworkInstance_Protocol_Ospfv2_AreaPath) Interface(Id string) *NetworkInstance_Protocol_Ospfv2_Area_InterfacePath {\n\treturn &NetworkInstance_Protocol_Ospfv2_Area_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"id\": Id},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "ac135858fe020c9712f44c015d6e8654", "score": "0.6904442", "text": "func (n *NetworkInstance_Mpls_GlobalPath) Interface(InterfaceId string) *NetworkInstance_Mpls_Global_InterfacePath {\n\treturn &NetworkInstance_Mpls_Global_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interface-attributes\", \"interface\"},\n\t\t\tmap[string]interface{}{\"interface-id\": InterfaceId},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "3d8bde4ffa989b74ec016af8aab956ec", "score": "0.6884729", "text": "func (n *NetworkInstance_Afts_NextHop_InterfaceRefPath) Interface() *NetworkInstance_Afts_NextHop_InterfaceRef_InterfacePath {\n\treturn &NetworkInstance_Afts_NextHop_InterfaceRef_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "b40a0f791a6c5fbc044619464ac0b429", "score": "0.687745", "text": "func (n *NetworkInstance_Protocol_IsisPath) Interface(InterfaceId string) *NetworkInstance_Protocol_Isis_InterfacePath {\n\treturn &NetworkInstance_Protocol_Isis_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"interface-id\": InterfaceId},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "fa587bc634faae90974d7e0c67b1df43", "score": "0.6875472", "text": "func (n *DevicePath) Interface(Name string) *InterfacePath {\n\treturn &InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"name\": Name},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "226349a9e48118f8af61418ffe39f808", "score": "0.6861426", "text": "func (n *NetworkInstance_Mpls_SignalingProtocols_RsvpTePath) Interface(InterfaceId string) *NetworkInstance_Mpls_SignalingProtocols_RsvpTe_InterfacePath {\n\treturn &NetworkInstance_Mpls_SignalingProtocols_RsvpTe_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interface-attributes\", \"interface\"},\n\t\t\tmap[string]interface{}{\"interface-id\": InterfaceId},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "cc31fbdd6508a81a1bcd6b604238a832", "score": "0.6845297", "text": "func (n *StpPathAny) Interface(Name string) *Stp_InterfacePathAny {\n\treturn &Stp_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"name\": Name},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "0dfc34136ffc0e344b42cd24cfdfd39c", "score": "0.6836145", "text": "func (n *NetworkInstance_InterfacePath) Interface() *NetworkInstance_Interface_InterfacePath {\n\treturn &NetworkInstance_Interface_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "0c2b3306bac75b1aaed9d02a17d8e6f5", "score": "0.6835504", "text": "func (n *NetworkInstancePath) Interface(Id string) *NetworkInstance_InterfacePath {\n\treturn &NetworkInstance_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"id\": Id},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "0f02e1a84020e7997f1d08aeb44658d9", "score": "0.6817857", "text": "func (n *AclPathAny) Interface(Id string) *Acl_InterfacePathAny {\n\treturn &Acl_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"id\": Id},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "b08bbf4cbdb92934460028898cd6f05a", "score": "0.68036205", "text": "func (n *RelayAgent_Dhcp_Interface_InterfaceRefPath) Interface() *RelayAgent_Dhcp_Interface_InterfaceRef_InterfacePath {\n\treturn &RelayAgent_Dhcp_Interface_InterfaceRef_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "95e3fb0470d25d1aca127b369ccb31c7", "score": "0.6797866", "text": "func (n *NetworkInstance_Vlan_MemberPath) Interface() *NetworkInstance_Vlan_Member_InterfacePath {\n\treturn &NetworkInstance_Vlan_Member_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "05abbe78cde00891e513f97a97455b56", "score": "0.6792171", "text": "func (n *NetworkInstance_Mpls_SignalingProtocols_SegmentRoutingPath) Interface(InterfaceId string) *NetworkInstance_Mpls_SignalingProtocols_SegmentRouting_InterfacePath {\n\treturn &NetworkInstance_Mpls_SignalingProtocols_SegmentRouting_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"interface-id\": InterfaceId},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "9d656e14f544335717e471441a49958a", "score": "0.67911017", "text": "func (n *NetworkInstance_Mpls_SignalingProtocols_Ldp_Neighbor_HelloAdjacency_InterfaceRefPath) Interface() *NetworkInstance_Mpls_SignalingProtocols_Ldp_Neighbor_HelloAdjacency_InterfaceRef_InterfacePath {\n\treturn &NetworkInstance_Mpls_SignalingProtocols_Ldp_Neighbor_HelloAdjacency_InterfaceRef_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "0250f18ecff720173797a1224f878461", "score": "0.67666435", "text": "func (n *RelayAgent_Dhcpv6PathAny) Interface(Id string) *RelayAgent_Dhcpv6_InterfacePathAny {\n\treturn &RelayAgent_Dhcpv6_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"id\": Id},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "629686f98f4a77e91dba59accb198c5a", "score": "0.67665285", "text": "func (n *Stp_VlanPathAny) Interface(Name string) *Stp_Vlan_InterfacePathAny {\n\treturn &Stp_Vlan_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"name\": Name},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "511e7a391e4a4aba3890eb2789d48f36", "score": "0.6766247", "text": "func (n *OpticalAmplifier_SupervisoryChannelPath) Interface() *OpticalAmplifier_SupervisoryChannel_InterfacePath {\n\treturn &OpticalAmplifier_SupervisoryChannel_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "fd0e0423b11b615b5eabd8a588d78ae0", "score": "0.67515785", "text": "func (n *Interface_RoutedVlan_Ipv6_Unnumbered_InterfaceRefPath) Interface() *Interface_RoutedVlan_Ipv6_Unnumbered_InterfaceRef_InterfacePath {\n\treturn &Interface_RoutedVlan_Ipv6_Unnumbered_InterfaceRef_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "5252c8c06d93aaadfea6befeb481f6e3", "score": "0.6746427", "text": "func (n *NetworkInstance_Mpls_Interface_InterfaceRefPath) Interface() *NetworkInstance_Mpls_Interface_InterfaceRef_InterfacePath {\n\treturn &NetworkInstance_Mpls_Interface_InterfaceRef_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "6f2e185e9feace4109255f644f8736f9", "score": "0.6731216", "text": "func (n *RelayAgent_DhcpPathAny) Interface(Id string) *RelayAgent_Dhcp_InterfacePathAny {\n\treturn &RelayAgent_Dhcp_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"id\": Id},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "bc4c5fd61f1e75694f66a35d465c8829", "score": "0.67263734", "text": "func (n *NetworkInstance_PolicyForwardingPath) Interface(InterfaceId string) *NetworkInstance_PolicyForwarding_InterfacePath {\n\treturn &NetworkInstance_PolicyForwarding_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"interface-id\": InterfaceId},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "9edbbdfc2f205a7775bd2edec2746f26", "score": "0.6725963", "text": "func (n *Lacp_Interface_MemberPathAny) Interface() *Lacp_Interface_Member_InterfacePathAny {\n\treturn &Lacp_Interface_Member_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "742dc76f6386044e04e64ea41815007f", "score": "0.6717481", "text": "func (n *Interface_Subinterface_Ipv6_Unnumbered_InterfaceRefPath) Interface() *Interface_Subinterface_Ipv6_Unnumbered_InterfaceRef_InterfacePath {\n\treturn &Interface_Subinterface_Ipv6_Unnumbered_InterfaceRef_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "0b69a58f10805c21adb72ac257967b92", "score": "0.67102087", "text": "func (n *NetworkInstance_Mpls_Global_Interface_InterfaceRefPath) Interface() *NetworkInstance_Mpls_Global_Interface_InterfaceRef_InterfacePath {\n\treturn &NetworkInstance_Mpls_Global_Interface_InterfaceRef_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "ed000e9b4bef377c13b13bcf9e212278", "score": "0.6706571", "text": "func (n *Interface_RoutedVlan_Ipv4_Unnumbered_InterfaceRefPath) Interface() *Interface_RoutedVlan_Ipv4_Unnumbered_InterfaceRef_InterfacePath {\n\treturn &Interface_RoutedVlan_Ipv4_Unnumbered_InterfaceRef_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "944f27e363ea5b338919388dcd83421a", "score": "0.670287", "text": "func (n *Interface_Subinterface_Ipv4_Unnumbered_InterfaceRefPath) Interface() *Interface_Subinterface_Ipv4_Unnumbered_InterfaceRef_InterfacePath {\n\treturn &Interface_Subinterface_Ipv4_Unnumbered_InterfaceRef_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "1a0255ef83b9af368d55685f36b45b59", "score": "0.67002755", "text": "func (n *NetworkInstance_Protocol_IgmpPathAny) Interface(InterfaceId string) *NetworkInstance_Protocol_Igmp_InterfacePathAny {\n\treturn &NetworkInstance_Protocol_Igmp_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"interface-id\": InterfaceId},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "7c218c70f87cd0ece23b02f15becb817", "score": "0.6677738", "text": "func (n *Stp_Mstp_MstInstancePathAny) Interface(Name string) *Stp_Mstp_MstInstance_InterfacePathAny {\n\treturn &Stp_Mstp_MstInstance_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"name\": Name},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "0d8c2ce150ad61b3b7c95f17b49c2a6f", "score": "0.6663921", "text": "func (n *NetworkInstance_MplsPathAny) Interface(InterfaceId string) *NetworkInstance_Mpls_InterfacePathAny {\n\treturn &NetworkInstance_Mpls_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"te-interface-attributes\", \"interface\"},\n\t\t\tmap[string]interface{}{\"interface-id\": InterfaceId},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "da73be08c43e48576cc7cce2fb4de5ed", "score": "0.6662812", "text": "func (n *NetworkInstance_Protocol_Static_NextHop_InterfaceRefPath) Interface() *NetworkInstance_Protocol_Static_NextHop_InterfaceRef_InterfacePath {\n\treturn &NetworkInstance_Protocol_Static_NextHop_InterfaceRef_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "fbff9eda42e93d4b96f11fc48829d3a1", "score": "0.6647827", "text": "func (n *NetworkInstance_Fdb_MacTable_EntryPath) Interface() *NetworkInstance_Fdb_MacTable_Entry_InterfacePath {\n\treturn &NetworkInstance_Fdb_MacTable_Entry_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "a8534d3b2880a4907a68762db6749b1e", "score": "0.6644904", "text": "func (n *NetworkInstance_Afts_NextHopGroup_Condition_InputInterfacePath) Interface() *NetworkInstance_Afts_NextHopGroup_Condition_InputInterface_InterfacePath {\n\treturn &NetworkInstance_Afts_NextHopGroup_Condition_InputInterface_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "7cb660ec8ac2efe6b02a97525cb8bb11", "score": "0.663783", "text": "func (n *NetworkInstancePathAny) Interface(Id string) *NetworkInstance_InterfacePathAny {\n\treturn &NetworkInstance_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"id\": Id},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "150396db13a2fade0841b2b0f303f0e1", "score": "0.66273534", "text": "func (n *Acl_AclSet_AclEntry_InputInterface_InterfaceRefPath) Interface() *Acl_AclSet_AclEntry_InputInterface_InterfaceRef_InterfacePath {\n\treturn &Acl_AclSet_AclEntry_InputInterface_InterfaceRef_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "f080a1f3bbd73493203660e47fe2286d", "score": "0.6598798", "text": "func (n *RelayAgent_Dhcpv6_Interface_InterfaceRefPath) Interface() *RelayAgent_Dhcpv6_Interface_InterfaceRef_InterfacePath {\n\treturn &RelayAgent_Dhcpv6_Interface_InterfaceRef_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "eabd5089e34c9dcb1d915ef978ea7ea7", "score": "0.6596495", "text": "func (n *NetworkInstance_SegmentRouting_TePolicy_CandidatePath_SegmentList_NextHop_InterfaceRefPath) Interface() *NetworkInstance_SegmentRouting_TePolicy_CandidatePath_SegmentList_NextHop_InterfaceRef_InterfacePath {\n\treturn &NetworkInstance_SegmentRouting_TePolicy_CandidatePath_SegmentList_NextHop_InterfaceRef_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "08d20245daf65e9123cb62f9566eed22", "score": "0.65961224", "text": "func (n *NetworkInstance_Protocol_Igmp_Interface_InterfaceRefPath) Interface() *NetworkInstance_Protocol_Igmp_Interface_InterfaceRef_InterfacePath {\n\treturn &NetworkInstance_Protocol_Igmp_Interface_InterfaceRef_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "2d86a4f8ca6ee2c886ec3f7f9e28be18", "score": "0.6579125", "text": "func (n *NetworkInstance_ConnectionPoint_Endpoint_LocalPath) Interface() *NetworkInstance_ConnectionPoint_Endpoint_Local_InterfacePath {\n\treturn &NetworkInstance_ConnectionPoint_Endpoint_Local_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "e9c82af0079134da673c84fe2699326e", "score": "0.65750176", "text": "func (n *NetworkInstance_Mpls_GlobalPathAny) Interface(InterfaceId string) *NetworkInstance_Mpls_Global_InterfacePathAny {\n\treturn &NetworkInstance_Mpls_Global_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interface-attributes\", \"interface\"},\n\t\t\tmap[string]interface{}{\"interface-id\": InterfaceId},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "66ed35518034ea1106f04363f150e4a3", "score": "0.65296227", "text": "func (n *NetworkInstance_Mpls_SignalingProtocols_Ldp_InterfaceAttributes_Interface_InterfaceRefPath) Interface() *NetworkInstance_Mpls_SignalingProtocols_Ldp_InterfaceAttributes_Interface_InterfaceRef_InterfacePath {\n\treturn &NetworkInstance_Mpls_SignalingProtocols_Ldp_InterfaceAttributes_Interface_InterfaceRef_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "1ac89fc32dadcf5eba6de04e2f4213c6", "score": "0.65250427", "text": "func (n *NetworkInstance_Protocol_Pim_Interface_InterfaceRefPath) Interface() *NetworkInstance_Protocol_Pim_Interface_InterfaceRef_InterfacePath {\n\treturn &NetworkInstance_Protocol_Pim_Interface_InterfaceRef_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "65a0f44f647e53a4f05b6a93159826c7", "score": "0.65201527", "text": "func (n *Acl_Interface_InterfaceRefPathAny) Interface() *Acl_Interface_InterfaceRef_InterfacePathAny {\n\treturn &Acl_Interface_InterfaceRef_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "a79a63967a04b77d0509fd75e3f2a84a", "score": "0.65029675", "text": "func (n *NetworkInstance_Protocol_PimPathAny) Interface(InterfaceId string) *NetworkInstance_Protocol_Pim_InterfacePathAny {\n\treturn &NetworkInstance_Protocol_Pim_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"interface-id\": InterfaceId},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "56dc14067769298f71d4bf865e53fc2e", "score": "0.65016824", "text": "func (n *NetworkInstance_Mpls_SignalingProtocols_SegmentRouting_Interface_InterfaceRefPath) Interface() *NetworkInstance_Mpls_SignalingProtocols_SegmentRouting_Interface_InterfaceRef_InterfacePath {\n\treturn &NetworkInstance_Mpls_SignalingProtocols_SegmentRouting_Interface_InterfaceRef_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "ac57fb1683ff9ff8dba67da428c0d67f", "score": "0.64621395", "text": "func (n *NetworkInstance_Protocol_Isis_Interface_InterfaceRefPath) Interface() *NetworkInstance_Protocol_Isis_Interface_InterfaceRef_InterfacePath {\n\treturn &NetworkInstance_Protocol_Isis_Interface_InterfaceRef_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "fd606a44195e7ac44595baeb78bfd53c", "score": "0.64601344", "text": "func (n *NetworkInstance_Protocol_Ospfv2_Area_Interface_InterfaceRefPath) Interface() *NetworkInstance_Protocol_Ospfv2_Area_Interface_InterfaceRef_InterfacePath {\n\treturn &NetworkInstance_Protocol_Ospfv2_Area_Interface_InterfaceRef_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "e7e3705bef6aa4f764a5917a2d64c15b", "score": "0.64576405", "text": "func (n *NetworkInstance_Mpls_SignalingProtocols_Ldp_InterfaceAttributesPathAny) Interface(InterfaceId string) *NetworkInstance_Mpls_SignalingProtocols_Ldp_InterfaceAttributes_InterfacePathAny {\n\treturn &NetworkInstance_Mpls_SignalingProtocols_Ldp_InterfaceAttributes_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"interface-id\": InterfaceId},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "95ecf3fccd1fb38ca47a319e11942969", "score": "0.6444358", "text": "func (n *NetworkInstance_PolicyForwarding_Interface_InterfaceRefPath) Interface() *NetworkInstance_PolicyForwarding_Interface_InterfaceRef_InterfacePath {\n\treturn &NetworkInstance_PolicyForwarding_Interface_InterfaceRef_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "4c14c7b28baa73aa90d094e8a9627878", "score": "0.64366436", "text": "func (n *NetworkInstance_Fdb_MacTable_Entry_Interface_InterfaceRefPath) Interface() *NetworkInstance_Fdb_MacTable_Entry_Interface_InterfaceRef_InterfacePath {\n\treturn &NetworkInstance_Fdb_MacTable_Entry_Interface_InterfaceRef_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "8af0105787b5f8dcdab367bc57ad110c", "score": "0.64228755", "text": "func (n *RoutingPolicy_PolicyDefinition_Statement_Conditions_MatchInterfacePath) Interface() *RoutingPolicy_PolicyDefinition_Statement_Conditions_MatchInterface_InterfacePath {\n\treturn &RoutingPolicy_PolicyDefinition_Statement_Conditions_MatchInterface_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "0899ebd40ce66ba90f37d898e7afd5d3", "score": "0.64083326", "text": "func (n *NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Interface_InterfaceRefPath) Interface() *NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Interface_InterfaceRef_InterfacePath {\n\treturn &NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Interface_InterfaceRef_InterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "577178f6403a43bc7eb1996e1952940e", "score": "0.63773555", "text": "func (n *Interface_RoutedVlan_Ipv6_Unnumbered_InterfaceRefPathAny) Interface() *Interface_RoutedVlan_Ipv6_Unnumbered_InterfaceRef_InterfacePathAny {\n\treturn &Interface_RoutedVlan_Ipv6_Unnumbered_InterfaceRef_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "13eea8f8788a4869ef65f4a1cc80545f", "score": "0.6376428", "text": "func (n *Interface_Subinterface_Ipv6_Unnumbered_InterfaceRefPathAny) Interface() *Interface_Subinterface_Ipv6_Unnumbered_InterfaceRef_InterfacePathAny {\n\treturn &Interface_Subinterface_Ipv6_Unnumbered_InterfaceRef_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "01917e53001ac31fbdf63d723f43095c", "score": "0.6371885", "text": "func (n *NetworkInstance_Vlan_MemberPathAny) Interface() *NetworkInstance_Vlan_Member_InterfacePathAny {\n\treturn &NetworkInstance_Vlan_Member_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "79d1a65ace0940d13e9d1979fbd2c1ec", "score": "0.6369529", "text": "func (n *NetworkInstance_Protocol_IsisPathAny) Interface(InterfaceId string) *NetworkInstance_Protocol_Isis_InterfacePathAny {\n\treturn &NetworkInstance_Protocol_Isis_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"interface-id\": InterfaceId},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "8a72d4f88ec5ee47565680047667512f", "score": "0.6335039", "text": "func (n *Interface_Subinterface_Ipv4_Unnumbered_InterfaceRefPathAny) Interface() *Interface_Subinterface_Ipv4_Unnumbered_InterfaceRef_InterfacePathAny {\n\treturn &Interface_Subinterface_Ipv4_Unnumbered_InterfaceRef_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "3502f2bc2e6f3fb307acb43b5bc368af", "score": "0.6325783", "text": "func (n *LocalRoutes_Static_NextHop_InterfaceRefPathAny) Interface() *LocalRoutes_Static_NextHop_InterfaceRef_InterfacePathAny {\n\treturn &LocalRoutes_Static_NextHop_InterfaceRef_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "6a6afdbf2ccec28df587d0b44cdb0d68", "score": "0.6323162", "text": "func (n *Interface_RoutedVlan_Ipv4_Unnumbered_InterfaceRefPathAny) Interface() *Interface_RoutedVlan_Ipv4_Unnumbered_InterfaceRef_InterfacePathAny {\n\treturn &Interface_RoutedVlan_Ipv4_Unnumbered_InterfaceRef_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "14a03979b497b2b612d067fd95a4ed22", "score": "0.63140357", "text": "func (n *NetworkInstance_Protocol_Ospfv2_AreaPathAny) Interface(Id string) *NetworkInstance_Protocol_Ospfv2_Area_InterfacePathAny {\n\treturn &NetworkInstance_Protocol_Ospfv2_Area_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"id\": Id},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "a8417d92e65d57728bf3b131165eeac6", "score": "0.63125354", "text": "func (n *NetworkInstance_PolicyForwardingPathAny) Interface(InterfaceId string) *NetworkInstance_PolicyForwarding_InterfacePathAny {\n\treturn &NetworkInstance_PolicyForwarding_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"interface-id\": InterfaceId},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "07d518357b5aa6d081a9a829ea13a188", "score": "0.630579", "text": "func (n *NetworkInstance_InterfacePathAny) Interface() *NetworkInstance_Interface_InterfacePathAny {\n\treturn &NetworkInstance_Interface_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "387f529ed8de44b1925c15e437a1cd24", "score": "0.62987614", "text": "func (n *NetworkInstance_Mpls_SignalingProtocols_Ldp_Neighbor_HelloAdjacency_InterfaceRefPathAny) Interface() *NetworkInstance_Mpls_SignalingProtocols_Ldp_Neighbor_HelloAdjacency_InterfaceRef_InterfacePathAny {\n\treturn &NetworkInstance_Mpls_SignalingProtocols_Ldp_Neighbor_HelloAdjacency_InterfaceRef_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "dc84ea8307878e48f18f1bc4347045fc", "score": "0.62955874", "text": "func (n *RelayAgent_Dhcp_Interface_InterfaceRefPathAny) Interface() *RelayAgent_Dhcp_Interface_InterfaceRef_InterfacePathAny {\n\treturn &RelayAgent_Dhcp_Interface_InterfaceRef_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "44ffab647cf82c7c61572c4b3f9a3dba", "score": "0.6262845", "text": "func (n *NetworkInstance_Mpls_SignalingProtocols_SegmentRoutingPathAny) Interface(InterfaceId string) *NetworkInstance_Mpls_SignalingProtocols_SegmentRouting_InterfacePathAny {\n\treturn &NetworkInstance_Mpls_SignalingProtocols_SegmentRouting_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interfaces\", \"interface\"},\n\t\t\tmap[string]interface{}{\"interface-id\": InterfaceId},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "d403132ef58e6aaec5d10bbf8f778d01", "score": "0.6241495", "text": "func (n *NetworkInstance_Mpls_SignalingProtocols_RsvpTePathAny) Interface(InterfaceId string) *NetworkInstance_Mpls_SignalingProtocols_RsvpTe_InterfacePathAny {\n\treturn &NetworkInstance_Mpls_SignalingProtocols_RsvpTe_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"interface-attributes\", \"interface\"},\n\t\t\tmap[string]interface{}{\"interface-id\": InterfaceId},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "a7f19aae4ee4fd483177ed11c691aa5f", "score": "0.6237291", "text": "func (n *NetworkInstance_Afts_NextHop_InterfaceRefPathAny) Interface() *NetworkInstance_Afts_NextHop_InterfaceRef_InterfacePathAny {\n\treturn &NetworkInstance_Afts_NextHop_InterfaceRef_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "da4b4a1b53441c8112c6f7aa1ff80d8e", "score": "0.6227245", "text": "func (n *NetworkInstance_Mpls_Interface_InterfaceRefPathAny) Interface() *NetworkInstance_Mpls_Interface_InterfaceRef_InterfacePathAny {\n\treturn &NetworkInstance_Mpls_Interface_InterfaceRef_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "d597c72d1c9ef784f06705a845378e1d", "score": "0.6209199", "text": "func (n *NetworkInstance_Afts_NextHopGroup_Condition_InputInterfacePath) Subinterface() *NetworkInstance_Afts_NextHopGroup_Condition_InputInterface_SubinterfacePath {\n\treturn &NetworkInstance_Afts_NextHopGroup_Condition_InputInterface_SubinterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"subinterface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "b47bf042a3f6391d37d223cc2e59e84b", "score": "0.62042576", "text": "func (n *Interface_SubinterfacePath) Name() *Interface_Subinterface_NamePath {\n\treturn &Interface_Subinterface_NamePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"name\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "ea20b16c191899f9fce5d9d607c2e220", "score": "0.61804897", "text": "func (n *OpticalAmplifier_SupervisoryChannelPathAny) Interface() *OpticalAmplifier_SupervisoryChannel_InterfacePathAny {\n\treturn &OpticalAmplifier_SupervisoryChannel_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "357cc32c634156aa208106258a120b50", "score": "0.6147193", "text": "func (n *NetworkInstance_Mpls_Global_Interface_InterfaceRefPathAny) Interface() *NetworkInstance_Mpls_Global_Interface_InterfaceRef_InterfacePathAny {\n\treturn &NetworkInstance_Mpls_Global_Interface_InterfaceRef_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "f67fb3e78312f434ceb31e73930e8006", "score": "0.6127432", "text": "func (n *NetworkInstance_Mpls_SignalingProtocols_Ldp_InterfaceAttributes_Interface_InterfaceRefPathAny) Interface() *NetworkInstance_Mpls_SignalingProtocols_Ldp_InterfaceAttributes_Interface_InterfaceRef_InterfacePathAny {\n\treturn &NetworkInstance_Mpls_SignalingProtocols_Ldp_InterfaceAttributes_Interface_InterfaceRef_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "a4e6c97cd458219da6267cdc95771b01", "score": "0.61146533", "text": "func (n *Lldp_InterfacePath) Name() *Lldp_Interface_NamePath {\n\treturn &Lldp_Interface_NamePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"name\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "55c1ee17522f513ac37947160305d5ad", "score": "0.6101673", "text": "func (n *RelayAgent_Dhcpv6_Interface_InterfaceRefPathAny) Interface() *RelayAgent_Dhcpv6_Interface_InterfaceRef_InterfacePathAny {\n\treturn &RelayAgent_Dhcpv6_Interface_InterfaceRef_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "703fccbe61a29bfa3d12b9bac2a9f63c", "score": "0.6089581", "text": "func (n *Acl_AclSet_AclEntry_InputInterface_InterfaceRefPath) Subinterface() *Acl_AclSet_AclEntry_InputInterface_InterfaceRef_SubinterfacePath {\n\treturn &Acl_AclSet_AclEntry_InputInterface_InterfaceRef_SubinterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"subinterface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "fc2d3282a10f6c5f3264fa1df7078b79", "score": "0.6075527", "text": "func (n *NetworkInstance_Protocol_Igmp_Interface_InterfaceRefPathAny) Interface() *NetworkInstance_Protocol_Igmp_Interface_InterfaceRef_InterfacePathAny {\n\treturn &NetworkInstance_Protocol_Igmp_Interface_InterfaceRef_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "fcd78db956b642ee1c56bda52e2268d1", "score": "0.6049552", "text": "func (n *NetworkInstance_ConnectionPoint_Endpoint_LocalPathAny) Interface() *NetworkInstance_ConnectionPoint_Endpoint_Local_InterfacePathAny {\n\treturn &NetworkInstance_ConnectionPoint_Endpoint_Local_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "521e7f674a99f74365ed5963ef99118c", "score": "0.60418373", "text": "func (n *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_OpaqueLsa_ExtendedPrefix_Tlv_SidLabelBinding_Tlv_EroPath_Segment_UnnumberedHopPath) InterfaceId() *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_OpaqueLsa_ExtendedPrefix_Tlv_SidLabelBinding_Tlv_EroPath_Segment_UnnumberedHop_InterfaceIdPath {\n\treturn &NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_OpaqueLsa_ExtendedPrefix_Tlv_SidLabelBinding_Tlv_EroPath_Segment_UnnumberedHop_InterfaceIdPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"interface-id\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "bcda020cfc607266c27e24ec344f5a99", "score": "0.60274386", "text": "func (n *NetworkInstance_Mpls_SignalingProtocols_Ldp_Neighbor_HelloAdjacency_InterfaceRefPath) Subinterface() *NetworkInstance_Mpls_SignalingProtocols_Ldp_Neighbor_HelloAdjacency_InterfaceRef_SubinterfacePath {\n\treturn &NetworkInstance_Mpls_SignalingProtocols_Ldp_Neighbor_HelloAdjacency_InterfaceRef_SubinterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"subinterface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "b0e2aebe41784e25e7e797df7dcc6557", "score": "0.60165066", "text": "func (n *NetworkInstance_Fdb_MacTable_Entry_Interface_InterfaceRefPath) Subinterface() *NetworkInstance_Fdb_MacTable_Entry_Interface_InterfaceRef_SubinterfacePath {\n\treturn &NetworkInstance_Fdb_MacTable_Entry_Interface_InterfaceRef_SubinterfacePath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"subinterface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "97721bd6604ec207d1dc774f9b264bbb", "score": "0.59975785", "text": "func (n *NetworkInstance_Mpls_SignalingProtocols_Ldp_InterfaceAttributes_InterfacePath) InterfaceId() *NetworkInstance_Mpls_SignalingProtocols_Ldp_InterfaceAttributes_Interface_InterfaceIdPath {\n\treturn &NetworkInstance_Mpls_SignalingProtocols_Ldp_InterfaceAttributes_Interface_InterfaceIdPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"config\", \"interface-id\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "6e539d5feee7e35a6a995f29bf026de6", "score": "0.5996679", "text": "func (n *NetworkInstance_SegmentRouting_TePolicy_CandidatePath_SegmentList_NextHop_InterfaceRefPathAny) Interface() *NetworkInstance_SegmentRouting_TePolicy_CandidatePath_SegmentList_NextHop_InterfaceRef_InterfacePathAny {\n\treturn &NetworkInstance_SegmentRouting_TePolicy_CandidatePath_SegmentList_NextHop_InterfaceRef_InterfacePathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"state\", \"interface\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" } ]
cabe171a3582f55346e820a59d83bfb8
Close closes the database.
[ { "docid": "fba9be12b9efa4d5e59553de06d90818", "score": "0.0", "text": "func (db *firestoreDB) Close(context.Context) error {\n\treturn db.client.Close()\n}", "title": "" } ]
[ { "docid": "908fbff413fb2430cba327bfa3dc6008", "score": "0.8016872", "text": "func (db *database) Close() {\n}", "title": "" }, { "docid": "0347593be3118e04599bb931a6bfa55b", "score": "0.79539347", "text": "func (database *Boltdb) Close() {\n\terr := database.db.Close()\n\tif err != nil {\n\t\tlog.Println(err)\n\t}\n\tdatabase.db = nil\n}", "title": "" }, { "docid": "918556cc25639f44bcee8b00ec3bb4ff", "score": "0.79495686", "text": "func (db *DataBase) Close() {\r\n\tdb.BackingDB.Close()\r\n}", "title": "" }, { "docid": "6aa8164013dc1a64a4847d6a88d40a28", "score": "0.7914183", "text": "func (db *DB) Close() {\n\tdb.db.Close()\n}", "title": "" }, { "docid": "500d3a5b9692c5375811602662003a2f", "score": "0.7893274", "text": "func Close() {\n\tdb.Close()\n}", "title": "" }, { "docid": "f2c267769a02e1d3a88b3415c12a7ba4", "score": "0.78873163", "text": "func (db *Database) Close() error {\n\treturn closeDB(db)\n}", "title": "" }, { "docid": "76bc80f85528281dc5c5b6226ae13997", "score": "0.78668606", "text": "func (db *DB) Close() error {\n\tif db == nil {\n\t\treturn nil\n\t}\n\tif db.seq != nil {\n\t\tdb.seq.Release()\n\t}\n\treturn db.DB.Close()\n}", "title": "" }, { "docid": "fc9501d3d5658ab6e6e5e644ebd80cae", "score": "0.78503495", "text": "func Close() {\n\tif db != nil {\n\t\tdb.Close()\n\t}\n}", "title": "" }, { "docid": "dd842a3bdea4688307169aa2cfda9449", "score": "0.78332615", "text": "func (db *Database) Close() error {\n\tdb.statsCloser()\n\treturn db.db.Close()\n}", "title": "" }, { "docid": "c2f419a36411f5255737db9231b36e45", "score": "0.7817682", "text": "func (db *Database) Close() error {\n\treturn db.DB.Close()\n}", "title": "" }, { "docid": "7f5cf684f6346e5a4383cdce3bff5a89", "score": "0.7808084", "text": "func (db *Database) Close() {\r\n\tdb.mutex.Lock()\r\n\tdb.database.Close()\r\n\tdb.mutex.Unlock()\r\n}", "title": "" }, { "docid": "420e4a70cea83dbfecd1e4daab70ef68", "score": "0.7805874", "text": "func (db *Database) Close() (err error) {\n\tif db.conn != nil {\n\t\tres := C.unqlite_close(db.conn)\n\t\tif res != C.UNQLITE_OK {\n\t\t\terr = UnQLiteError(res)\n\t\t}\n\t\tdb.conn = nil\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "738a8759efe12d39d5321c84b43e86cb", "score": "0.78045714", "text": "func (thisDatabase *Database) Close() {\n\tif thisDatabase.db != nil {\n\t\tthisDatabase.db.Close()\n\t}\n}", "title": "" }, { "docid": "2d5fd1c3c4524debb9aee04e67820be0", "score": "0.7780952", "text": "func Close() {\n\tdatabase.db.Close()\n}", "title": "" }, { "docid": "2d5fd1c3c4524debb9aee04e67820be0", "score": "0.7780952", "text": "func Close() {\n\tdatabase.db.Close()\n}", "title": "" }, { "docid": "4c53c98dfb2cb3432fb1c5832429914f", "score": "0.7771715", "text": "func Close() {\n\tdbInstance.Close()\n}", "title": "" }, { "docid": "0cffd38e7f03c8f1aeb2428f249d7b77", "score": "0.77601635", "text": "func (d *DB) Close() {\n\td.db.Close()\n}", "title": "" }, { "docid": "f6d104883aea5b96a531dc3d8ebcec2f", "score": "0.7750381", "text": "func (db *DB) Close() error {\n\treturn db.db.Close()\n}", "title": "" }, { "docid": "da06e328e00f6bd2ebf8cdaba3ed916f", "score": "0.77403444", "text": "func (d *DB) Close() error {\n\treturn d.close()\n}", "title": "" }, { "docid": "60694496f46af7e2b1e4fc1c1b4e9c4d", "score": "0.7712169", "text": "func (d *Database) Close() error {\n\treturn d.DB.Close()\n}", "title": "" }, { "docid": "d6ad83b91c1e4e22761c00c76869925c", "score": "0.77072513", "text": "func (db *Database) Close() error {\n\treturn db.Connection.Close()\n}", "title": "" }, { "docid": "69cc3cf873b7fe1804fa45a2856b41b6", "score": "0.7706644", "text": "func (db *Database) Close() {\n\tdb.Lock()\n\tdefer db.Unlock()\n\tdb.data = nil\n}", "title": "" }, { "docid": "ab81a03871d1566f2093a8ba5a69b2a9", "score": "0.76910514", "text": "func Close() error {\n\treturn db.Close()\n}", "title": "" }, { "docid": "37322e1f8fa841b628910be982be1b1e", "score": "0.76772755", "text": "func (d *DatabaseModel) Close() {\n\td.db.Close()\n}", "title": "" }, { "docid": "058a454e7f05f7799f8557b0c856d0c3", "score": "0.76771754", "text": "func CloseDB() {\n\tmainConnection.Close()\n}", "title": "" }, { "docid": "651cf5377d0035ace495dec011354bf2", "score": "0.76700914", "text": "func (d *APIDatabase) Close() {\n\t_ = d.DB.Close() // todo: log these errors if needed\n\tif d.dBWrite != d.DB {\n\t\t_ = d.dBWrite.Close()\n\t}\n}", "title": "" }, { "docid": "ad7f0ef75c5672d5c46c69c70d3ab50e", "score": "0.76694906", "text": "func CloseDB() {\n\tdb.Close()\n}", "title": "" }, { "docid": "ad7f0ef75c5672d5c46c69c70d3ab50e", "score": "0.76694906", "text": "func CloseDB() {\n\tdb.Close()\n}", "title": "" }, { "docid": "ad7f0ef75c5672d5c46c69c70d3ab50e", "score": "0.76694906", "text": "func CloseDB() {\n\tdb.Close()\n}", "title": "" }, { "docid": "ad7f0ef75c5672d5c46c69c70d3ab50e", "score": "0.76694906", "text": "func CloseDB() {\n\tdb.Close()\n}", "title": "" }, { "docid": "ad7f0ef75c5672d5c46c69c70d3ab50e", "score": "0.76694906", "text": "func CloseDB() {\n\tdb.Close()\n}", "title": "" }, { "docid": "ad7f0ef75c5672d5c46c69c70d3ab50e", "score": "0.76694906", "text": "func CloseDB() {\n\tdb.Close()\n}", "title": "" }, { "docid": "ad7f0ef75c5672d5c46c69c70d3ab50e", "score": "0.76694906", "text": "func CloseDB() {\n\tdb.Close()\n}", "title": "" }, { "docid": "e52979547bb8bbff70220c3cbfb309a1", "score": "0.7663874", "text": "func (db *DB) Close() error {\n\tif db.badger == nil {\n\t\treturn nil\n\t}\n\treturn db.badger.Close()\n}", "title": "" }, { "docid": "74d31ae57a188a184267f54c97353972", "score": "0.76584345", "text": "func (d *Database) Close() {\n\td.db.Close()\n\tlog.Println(\"[*] closed database connection\")\n}", "title": "" }, { "docid": "d669d086b3b56ef4dd7116740ed36eb1", "score": "0.76521236", "text": "func (dbm *Manager) Close() error { return dbm.DB.Close() }", "title": "" }, { "docid": "1495fc8a0beafdffe340ca57c6f7d6cd", "score": "0.76514864", "text": "func Close() {\n\tlog.Info(\"Closing database\")\n\tdb.Close()\n}", "title": "" }, { "docid": "84ddb5bde55dc6d48b62c6a55f00efe9", "score": "0.76504415", "text": "func (db Database) Close() error {\n\n\terr := db.conn.Close()\n\treturn err\n}", "title": "" }, { "docid": "4377b017651254855993584106a88199", "score": "0.76475406", "text": "func (d *DB) Close() {\n\tif err := d.db.Close(); err != nil {\n\t\tPanic(err)\n\t}\n}", "title": "" }, { "docid": "0c07fc750453c860214f50bf7a54b36d", "score": "0.76400286", "text": "func Close() {\n\tDB().Close()\n}", "title": "" }, { "docid": "f050598f32144491fb1601d18b73d082", "score": "0.7633957", "text": "func (db *DB) Close() error {\n\tif db.c != nil {\n\t\tC.rocksdb_close(db.c)\n\t\tdb.c = nil\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d19730f87284fe5e2508492cc58017eb", "score": "0.76184565", "text": "func (db *DB) Close() {\n\tdb.Lock()\n\tdefer db.Unlock()\n\tdb.close()\n}", "title": "" }, { "docid": "4f6df3fa6f882a94feb9e1d173a1f089", "score": "0.7617017", "text": "func (d *Db) Close() {\n\tlog.Info(\"DB CLOSED\")\n\td.db.Close()\n}", "title": "" }, { "docid": "d7fe2dcf33c350cd58b1eabdb98f6df2", "score": "0.76154834", "text": "func (fdb *DB) Close() error {\n\tfdb.mtx.Lock()\n\tdefer fdb.mtx.Unlock()\n\n\treturn nil\n}", "title": "" }, { "docid": "d7fe2dcf33c350cd58b1eabdb98f6df2", "score": "0.76154834", "text": "func (fdb *DB) Close() error {\n\tfdb.mtx.Lock()\n\tdefer fdb.mtx.Unlock()\n\n\treturn nil\n}", "title": "" }, { "docid": "05f733fd4c45045843e3be16833b3db9", "score": "0.759548", "text": "func (d *Dao) Close() {\n\td.db.Close()\n}", "title": "" }, { "docid": "05f733fd4c45045843e3be16833b3db9", "score": "0.759548", "text": "func (d *Dao) Close() {\n\td.db.Close()\n}", "title": "" }, { "docid": "12f6841ce18235d0151d89f5919f5232", "score": "0.7570899", "text": "func (dao *DBAccessObject) Close() error {\n\treturn dao.db.Close()\n}", "title": "" }, { "docid": "62de4a499d9617acb8655c3b56505948", "score": "0.75707364", "text": "func (db *DB) Close() {\n\tdb.coordinator.Close()\n\tdb.kv.Close()\n}", "title": "" }, { "docid": "6cd57a22df65e49837a58a2d5743f255", "score": "0.75523925", "text": "func (db *DbStore) Close() {\n\tdb.db.Close()\n}", "title": "" }, { "docid": "fff41278662614e09575dcc29acb44ab", "score": "0.7552225", "text": "func (arc *Archive) Close() {\n\tarc.db.Close()\n}", "title": "" }, { "docid": "d1076141e7ce09152677a2cb72b4b3b9", "score": "0.75394446", "text": "func (db *SqliteDb) Close() {\n\tdb.dbLock.Lock()\n\tdefer db.dbLock.Unlock()\n\n\tdb.close()\n}", "title": "" }, { "docid": "2fed5df9193ef5cd67b193ebe70042f7", "score": "0.75345516", "text": "func Close() {\n\tDB.Close()\n}", "title": "" }, { "docid": "2fed5df9193ef5cd67b193ebe70042f7", "score": "0.75345516", "text": "func Close() {\n\tDB.Close()\n}", "title": "" }, { "docid": "b5474a59355cd77aa903d1ce88621af8", "score": "0.75323856", "text": "func (b BoltDB) Close() error {\n\treturn b.db.Close()\n}", "title": "" }, { "docid": "3ccc90a9acffd9940f67e75224657c35", "score": "0.75292647", "text": "func (db *EtcdLeaseDB) Close() error {\n\treturn nil\n}", "title": "" }, { "docid": "692992fbe8a24c7709c86b9d615affff", "score": "0.75285465", "text": "func (db *Database) Close() error {\n\tfor _, lock := range db.locks {\n\t\tlock.Lock()\n\t}\n\n\tif err := db.store.Close(); err != nil {\n\t\treturn err\n\t}\n\n\tfor _, lock := range db.locks {\n\t\tlock.Unlock()\n\t}\n\n\tdb.store = nil\n\tdb.locks = nil\n\tdb.lastIDs = nil\n\n\treturn nil\n}", "title": "" }, { "docid": "6b0a2e5a15f81518d83298e8a10df769", "score": "0.75261664", "text": "func CloseDB() {\n\tDb.Close()\n\treturn\n}", "title": "" }, { "docid": "dc8d0f431571e54b27ab434c566ff871", "score": "0.75191396", "text": "func (db *LabelsDB) Close() {\n\tdb.db.Close()\n}", "title": "" }, { "docid": "5ea6ddcd6f8fc8afa27ff33d10f2a27c", "score": "0.75131464", "text": "func (db *DB) Close() error {\n\treturn db.Database.Client().Disconnect(*db.Context)\n}", "title": "" }, { "docid": "38b64e7e2c1cb65689bed27c449a6e62", "score": "0.7511119", "text": "func (database *InMemoryDB) Close() error {\n\treturn nil\n}", "title": "" }, { "docid": "60f213776d45b30c617e5e62e1ac2d71", "score": "0.7511085", "text": "func (db *DB) Close() error {\n\treturn db.badger.Close()\n}", "title": "" }, { "docid": "8cf91e365652ddc282380d59faaf6458", "score": "0.75047404", "text": "func (bdb *badgerDB) Close() error {\n\treturn bdb.db.Close()\n}", "title": "" }, { "docid": "2d26db2f923484b1fb4e078ea1713846", "score": "0.7497978", "text": "func (d *GormDatabase) Close() {\n\td.DB.Close()\n}", "title": "" }, { "docid": "565234cb5ff173d7f8e9e36ed9fd9d3b", "score": "0.7497641", "text": "func (d *Dao) Close() {\n\tif d.db != nil {\n\t\td.db.Close()\n\t}\n}", "title": "" }, { "docid": "a93019e731668871b1eb45513cb81454", "score": "0.7494494", "text": "func (db *LevelDB) Close() error {\n\tdb.quitLock.Lock()\n\tdefer db.quitLock.Unlock()\n\n\treturn db.db.Close()\n}", "title": "" }, { "docid": "4a47afad495e8896c63de3687f29ea94", "score": "0.74937534", "text": "func (db *DB) Close() error {\n\tdb.closed = true\n\tdefer func() {\n\t\tdb.stop <- true\n\t}()\n\treturn db.db.Close()\n}", "title": "" }, { "docid": "03ba37eddfba74d835033538fb915406", "score": "0.74815744", "text": "func (db *DB) Close() (err error) {\n\treturn db.db.Close()\n}", "title": "" }, { "docid": "b07122cf2d1eb9ad74dddd7ec484c7cb", "score": "0.7474549", "text": "func (db *goLDB) Close() {\n\tif db != nil {\n\t\tif db.ldb != nil {\n\t\t\tdb.ldb.Close()\n\t\t}\n\t\tif db.options.Options != nil {\n\t\t\tdb.options.Options.Close()\n\t\t}\n\t\tif db.options.ReadOptions != nil {\n\t\t\tdb.options.ReadOptions.Close()\n\t\t}\n\t\tif db.options.WriteOptions != nil {\n\t\t\tdb.options.WriteOptions.Close()\n\t\t}\n\t\tif db.options.filter != nil {\n\t\t\tdb.options.filter.Close()\n\t\t}\n\t\tif db.options.cache != nil {\n\t\t\tdb.options.cache.Close()\n\t\t}\n\t\tif db.options.env != nil {\n\t\t\tdb.options.env.Close()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "33253268e92079588c6fcd21a540cfaf", "score": "0.74709094", "text": "func (cdb *CDB) Close() {\n\terr := cdb.db.Close()\n\tif err != nil {\n\t\tlogger.LogAppErrorf(\"Error closing country database: %s\", err)\n\t}\n}", "title": "" }, { "docid": "7187142728ddb85498971de048003e87", "score": "0.7470752", "text": "func CloseDB() {\n\tdefer db.Close()\n}", "title": "" }, { "docid": "7187142728ddb85498971de048003e87", "score": "0.7470752", "text": "func CloseDB() {\n\tdefer db.Close()\n}", "title": "" }, { "docid": "cf57e179b9f151ba7a2dbf6a133b38d5", "score": "0.74598837", "text": "func (db *Database) Close() error {\n\treturn db.directSess.Close()\n}", "title": "" }, { "docid": "486143395fe6fadd1f645a82a6c2a744", "score": "0.74420404", "text": "func (db *LevelDB) Close() error {\n\treturn db.connect.Close()\n}", "title": "" }, { "docid": "f5cc1785119bc25d8ae68c5eace15710", "score": "0.7434121", "text": "func (db *Database) Close() {\n\tdb.session.Close()\n}", "title": "" }, { "docid": "1a6d96a05c513a2f98873f95b39ab91a", "score": "0.74291855", "text": "func Close() {\n\tif db != nil {\n\t\terr := db.Close()\n\t\tif err != nil {\n\t\t\tlogger.Debug().Error(err.Error())\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b2800c96daef54150887dc81ca3171a9", "score": "0.7427814", "text": "func (d *Dao) Close() {\n\tif d.DB != nil {\n\t\td.DB.Close()\n\t}\n}", "title": "" }, { "docid": "b2800c96daef54150887dc81ca3171a9", "score": "0.7427814", "text": "func (d *Dao) Close() {\n\tif d.DB != nil {\n\t\td.DB.Close()\n\t}\n}", "title": "" }, { "docid": "b2800c96daef54150887dc81ca3171a9", "score": "0.7427814", "text": "func (d *Dao) Close() {\n\tif d.DB != nil {\n\t\td.DB.Close()\n\t}\n}", "title": "" }, { "docid": "b87e621987e84a36c97fd5f884b2f4de", "score": "0.74267936", "text": "func (dao *BoltDao) Close() error {\n\treturn dao.db.Close()\n}", "title": "" }, { "docid": "52f38ee77b2d29e3a2341fc303b332e8", "score": "0.7425465", "text": "func (db *DB) Close() error {\n\tdb.Mu.Lock()\n\tclosing := db.closing\n\tdb.closing = true\n\tdb.Mu.Unlock()\n\n\tif closing {\n\t\treturn errors.New(\"etcd.DB: close already called\")\n\t}\n\n\tdb.watchCancel()\n\tdb.shutdownWG.Wait()\n\n\tvar err error\n\tif db.cli != nil {\n\t\terr = db.cli.Close()\n\t}\n\tif db.embedClose != nil {\n\t\tdb.embedClose()\n\t}\n\treturn err\n}", "title": "" }, { "docid": "656a744b548c0a34f53b3b7c24000433", "score": "0.7422767", "text": "func Close() {\n\tsqlDB, err := instance.DB()\n\tif err != nil {\n\t\tlog.Error(\"get *sql.DB error: %s\", err)\n\t} else {\n\t\t_ = sqlDB.Close()\n\t}\n\n\tinstance = nil\n}", "title": "" }, { "docid": "e03409196edfdf90ba3a3f95d11bbb61", "score": "0.7422445", "text": "func (db *LevelDb) Close() error {\n\tdb.dbLock.Lock()\n\tdefer db.dbLock.Unlock()\n\n\treturn db.close()\n}", "title": "" }, { "docid": "e03409196edfdf90ba3a3f95d11bbb61", "score": "0.7422445", "text": "func (db *LevelDb) Close() error {\n\tdb.dbLock.Lock()\n\tdefer db.dbLock.Unlock()\n\n\treturn db.close()\n}", "title": "" }, { "docid": "d16c0643f45353cc330d081f452f8a7e", "score": "0.74056107", "text": "func (s *MetaStore) Close() {\n\ts.db.Close()\n}", "title": "" }, { "docid": "b619cf5bd8cae4ff7a82bd5c95dfaac9", "score": "0.74003184", "text": "func (store *SQLStore) Close() error {\n\tif store.db != nil {\n\t\treturn store.db.Close()\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ba4376731388d901576dfcd430fcae56", "score": "0.7390939", "text": "func (ctx *postresdb) Close() error {\n\tctx.logger.Info(\"Closing database connection\")\n\t// Get sql database\n\tsqlDB, err := ctx.db.DB()\n\t// Check error\n\tif err != nil {\n\t\treturn errors.WithStack(err)\n\t}\n\n\treturn sqlDB.Close()\n}", "title": "" }, { "docid": "5fff65e4cc0339f08d4f20008f2c2a4d", "score": "0.73909134", "text": "func (p *DB) Close() {\n\tp.session.Close()\n}", "title": "" }, { "docid": "9a9c2aa9b6109b2de1600662efe972fd", "score": "0.7386439", "text": "func (db *DB) Close() error {\n\tif err := db.Flush(); err != nil {\n\t\treturn err\n\t}\n\tclose(db.shutdown)\n\tif db.DiskBacked {\n\t\treturn db.removeFlock()\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "933fd71a492915dfdb8757803c8affb2", "score": "0.7384068", "text": "func (mysqlPersistence *MysqlPersistence) Close() {\n\terr := mysqlPersistence.db.Close()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "6dd92a7c66750ed62244e96ca416df7c", "score": "0.7383381", "text": "func DatabaseClose(db *sql.DB) {\n\tdb.Close()\n}", "title": "" }, { "docid": "f4a5e5669865179a8c64ada2b4346518", "score": "0.7380416", "text": "func (d *Database) Close() {\n\tvar err error\n\n\t// Drop the database:\n\t_, err = d.server.handle.Exec(fmt.Sprintf(\n\t\t`drop database if exists %s with (force)`,\n\t\td.name,\n\t))\n\tExpect(err).ToNot(HaveOccurred())\n\n\t// Drop the user:\n\t_, err = d.server.handle.Exec(fmt.Sprintf(\n\t\t`drop user if exists %s`,\n\t\td.user,\n\t))\n\tExpect(err).ToNot(HaveOccurred())\n}", "title": "" }, { "docid": "7eb2759eb0d884aaeb099f9ff84a613c", "score": "0.7368941", "text": "func Close() {\n\tif err := db.Close(); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "cd41b4bd659291b9734b4c6c7f8baa07", "score": "0.7368743", "text": "func (db *DB) Close() error {\n\tif db.connect != nil {\n\t\treturn db.connect.Close()\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d0c7024543846da576670901e9519a41", "score": "0.73639095", "text": "func (kb dbKeybase) Close() error { return kb.db.Close() }", "title": "" }, { "docid": "6418f1682148569471df5261058cbe96", "score": "0.7361121", "text": "func (m *Database) Close() {\n\tm.session.Close()\n}", "title": "" }, { "docid": "53d7d9fe8eeb3dec336037bf927fb6d2", "score": "0.73535246", "text": "func (bc *Blockchain) Close() {\n\tbc.db.Close()\n}", "title": "" }, { "docid": "7d25ee0674edcb8679af69d13b989bbe", "score": "0.7343415", "text": "func DBClose(db *sql.DB) {\n\tdb.Close()\n}", "title": "" }, { "docid": "466a2d9b941b27ce2cc7e738880fef68", "score": "0.73252755", "text": "func (mgr *SqliteManager) Close() {\n\tmgr.db.Close()\n}", "title": "" }, { "docid": "677fe54292bca2d7f24767d7e3dfa83b", "score": "0.73241806", "text": "func (d *Database) Close() error {\n\tlog.Info(\"Closing database\")\n\n\tif d.closed {\n\t\tlog.Warning(\"Tried to close database that has already been closed\")\n\t\treturn nil\n\t}\n\td.closeLock.Lock()\n\tdefer d.closeLock.Unlock()\n\tif d.closed {\n\t\tlog.Warning(\"Tried to close database that has already been closed\")\n\t\treturn nil\n\t}\n\n\td.lock.Lock()\n\tdefer d.lock.Unlock()\n\td.closed = true\n\n\treturn d.db.Close()\n}", "title": "" }, { "docid": "54f561bec4a68980583b91f2270aa34c", "score": "0.73233587", "text": "func (d *DB) Close() {\n\td.session.Close()\n}", "title": "" } ]
fddd5c6a1eaa09ad778a974a9dc62427
HistoricalInfo queries the historical info for given height
[ { "docid": "bc0e3aab3f08da1038b28f183b59eee2", "score": "0.7670893", "text": "func (k Querier) HistoricalInfo(ctx context.Context, req *types.QueryHistoricalInfoRequest) (*types.QueryHistoricalInfoResponse, error) {\n\tif req == nil {\n\t\treturn nil, status.Error(codes.InvalidArgument, \"empty request\")\n\t}\n\n\tif req.Height < 0 {\n\t\treturn nil, status.Error(codes.InvalidArgument, \"height cannot be negative\")\n\t}\n\n\thi, err := k.Keeper.HistoricalInfo.Get(ctx, uint64(req.Height))\n\tif err != nil {\n\t\treturn nil, status.Errorf(codes.NotFound, \"historical info for height %d not found\", req.Height)\n\t}\n\n\treturn &types.QueryHistoricalInfoResponse{Hist: &hi}, nil\n}", "title": "" } ]
[ { "docid": "edd79b912544a02b2a4127f9d1d22e40", "score": "0.782724", "text": "func (k Keeper) HistoricalInfo(c context.Context, req *types.QueryHistoricalInfoRequest) (*types.QueryHistoricalInfoResponse, error) {\n\tif req == nil {\n\t\treturn nil, status.Error(codes.InvalidArgument, \"empty request\")\n\t}\n\n\tif req.Height < 0 {\n\t\treturn nil, status.Error(codes.InvalidArgument, \"height cannot be negative\")\n\t}\n\tctx := sdk.UnwrapSDKContext(c)\n\thi, found := k.GetHistoricalInfo(ctx, req.Height)\n\tif !found {\n\t\treturn nil, status.Errorf(codes.NotFound, \"historical info for height %d not found\", req.Height)\n\t}\n\n\treturn &types.QueryHistoricalInfoResponse{Hist: &hi}, nil\n}", "title": "" }, { "docid": "4b2ffb668827332a6ea9ea7ae720f64f", "score": "0.6649283", "text": "func GetHistoricalInfoKey(height int64) []byte {\n\treturn append(HistoricalInfoKey, []byte(strconv.FormatInt(height, 10))...)\n}", "title": "" }, { "docid": "c9298e513efe9e94654bc46e5fe9d447", "score": "0.6219046", "text": "func (p *Proxy) Historical(startDate time.Time, endDate time.Time) ([]byte, error) {\n\trelativePath := \"v1/bpi/historical/close.json\"\n\tp.APIURL.Path = relativePath\n\tquery := url.Values{}\n\tquery.Add(\"start\", startDate.Format(RFC3339custom))\n\tquery.Add(\"end\", endDate.Format(RFC3339custom))\n\tp.APIURL.RawQuery = query.Encode()\n\tresponse, err := httpGet(p.APIURL.String())\n\tif err != nil {\n\t\treturn []byte{}, err\n\t}\n\tdefer response.Body.Close()\n\tbody, err := ioutil.ReadAll(response.Body)\n\tif err != nil {\n\t\treturn []byte{}, err\n\t}\n\treturn body, nil\n}", "title": "" }, { "docid": "f1a9529fc71f9dc5d792b71f5a89b0ce", "score": "0.5701601", "text": "func (k Keeper) HistoricalEntries(ctx sdk.Context) (res uint32) {\n\tk.paramspace.Get(ctx, types.KeyHistoricalEntries, &res)\n\treturn\n}", "title": "" }, { "docid": "837b1258b0df2b19576e14bdf3bb372a", "score": "0.5566048", "text": "func getHistory(ctx context.Context, args *map[string]interface{}) error {\n\tvar resultRows []Operation\n\n\tha, ok := (*args)[\"historyArgs\"].(historyArgs)\n\tif !ok {\n\t\treturn fmt.Errorf(\"unable to cast arguments to type historyArgs\")\n\t}\n\n\texportType := ha.exportType\n\n\t// Get everything from the fhir_endpoints_info_history table for the given URL\n\n\tvar selectHistory string\n\tif exportType == \"month\" {\n\t\tselectHistory = `\n\t\tSELECT fhir_endpoints_info_history.url, fhir_endpoints_metadata.http_response, fhir_endpoints_metadata.response_time_seconds, fhir_endpoints_metadata.errors,\n\t\tcapability_statement, tls_version, mime_types, operation_resource,\n\t\tfhir_endpoints_metadata.smart_http_response, smart_response, fhir_endpoints_info_history.updated_at, capability_fhir_version\n\t\tFROM fhir_endpoints_info_history, fhir_endpoints_metadata\n\t\tWHERE fhir_endpoints_info_history.metadata_id = fhir_endpoints_metadata.id AND fhir_endpoints_info_history.url=$1 AND (date_trunc('month', fhir_endpoints_info_history.updated_at) = date_trunc('month', current_date - INTERVAL '1 month'))\n\t\tORDER BY fhir_endpoints_info_history.updated_at DESC;`\n\t} else if exportType == \"30days\" {\n\t\tselectHistory = `\n\t\tSELECT fhir_endpoints_info_history.url, fhir_endpoints_metadata.http_response, fhir_endpoints_metadata.response_time_seconds, fhir_endpoints_metadata.errors,\n\t\tcapability_statement, tls_version, mime_types, operation_resource,\n\t\tfhir_endpoints_metadata.smart_http_response, smart_response, fhir_endpoints_info_history.updated_at, capability_fhir_version\n\t\tFROM fhir_endpoints_info_history, fhir_endpoints_metadata\n\t\tWHERE fhir_endpoints_info_history.metadata_id = fhir_endpoints_metadata.id AND fhir_endpoints_info_history.url=$1 AND (date_trunc('day', fhir_endpoints_info_history.updated_at) >= date_trunc('day', current_date - INTERVAL '30 day'))\n\t\tORDER BY fhir_endpoints_info_history.updated_at DESC;`\n\t} else if exportType == \"all\" {\n\t\tselectHistory = `\n\t\tSELECT fhir_endpoints_info_history.url, fhir_endpoints_metadata.http_response, fhir_endpoints_metadata.response_time_seconds, fhir_endpoints_metadata.errors,\n\t\tcapability_statement, tls_version, mime_types, operation_resource,\n\t\tfhir_endpoints_metadata.smart_http_response, smart_response, fhir_endpoints_info_history.updated_at, capability_fhir_version\n\t\tFROM fhir_endpoints_info_history, fhir_endpoints_metadata\n\t\tWHERE fhir_endpoints_info_history.metadata_id = fhir_endpoints_metadata.id AND fhir_endpoints_info_history.url=$1\n\t\tORDER BY fhir_endpoints_info_history.updated_at DESC;`\n\t}\n\n\thistoryRows, err := ha.store.DB.QueryContext(ctx, selectHistory, ha.fhirURL)\n\tif err != nil {\n\t\tlog.Warnf(\"Failed getting the history rows for URL %s. Error: %s\", ha.fhirURL, err)\n\t\tresult := Result{\n\t\t\tURL: ha.fhirURL,\n\t\t\tRows: resultRows,\n\t\t}\n\t\tha.result <- result\n\t\treturn nil\n\t}\n\n\t// Puts the rows in an array and sends it back on the channel to be processed\n\tdefer historyRows.Close()\n\tfor historyRows.Next() {\n\t\tvar op Operation\n\t\tvar url string\n\t\tvar capStat []byte\n\t\tvar smartRsp []byte\n\t\tvar opRes []byte\n\t\terr = historyRows.Scan(\n\t\t\t&url,\n\t\t\t&op.HTTPResponse,\n\t\t\t&op.HTTPResponseTimeSecond,\n\t\t\t&op.Errors,\n\t\t\t&capStat,\n\t\t\t&op.TLSVersion,\n\t\t\tpq.Array(&op.MIMETypes),\n\t\t\t&opRes,\n\t\t\t&op.SMARTHTTPResponse,\n\t\t\t&smartRsp,\n\t\t\t&op.UpdatedAt,\n\t\t\t&op.FHIRVersion)\n\t\tif err != nil {\n\t\t\tlog.Warnf(\"Error while scanning the rows of the history table for URL %s. Error: %s\", ha.fhirURL, err)\n\t\t\tresult := Result{\n\t\t\t\tURL: ha.fhirURL,\n\t\t\t\tRows: resultRows,\n\t\t\t}\n\t\t\tha.result <- result\n\t\t\treturn nil\n\t\t}\n\n\t\top.SMARTResponse = getSMARTResponse(smartRsp)\n\t\top.SupportedResources = getSupportedResources(opRes)\n\n\t\tresultRows = append(resultRows, op)\n\t}\n\tresult := Result{\n\t\tURL: ha.fhirURL,\n\t\tRows: resultRows,\n\t}\n\tha.result <- result\n\treturn nil\n}", "title": "" }, { "docid": "d41daecbf72d0977d989dbff084ab8f3", "score": "0.55051464", "text": "func (store *Store) GetInfo(height int64, hash []byte) Info {\n\tkey := keyLookupFromHeightAndHash(height, hash)\n\tval, _ := store.db.Get(key)\n\n\tif len(val) == 0 {\n\t\treturn Info{}\n\t}\n\tvar ei Info\n\terr := cdc.UnmarshalBinaryBare(val, &ei)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ei\n}", "title": "" }, { "docid": "36321091a0a13bf3fa458b1a3643596c", "score": "0.5432502", "text": "func (s *sourceDatastore) HistoryInformation(ctx context.Context, fqid string, w io.Writer) error {\n\treq, err := http.NewRequestWithContext(\n\t\tctx,\n\t\t\"POST\",\n\t\ts.url+urlHistoryInformation,\n\t\tstrings.NewReader(fmt.Sprintf(`{\"fqids\":[%q]}`, fqid)),\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"creating request for datastore: %w\", err)\n\t}\n\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tresp, err := s.client.Do(req)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"sending request to datastore: %w\", err)\n\t}\n\tdefer resp.Body.Close()\n\tdefer io.ReadAll(resp.Body)\n\n\tif resp.StatusCode != 200 {\n\t\t// TODO LAST ERROR\n\t\treturn fmt.Errorf(\"datastore returned %s\", resp.Status)\n\t}\n\n\tif _, err := io.Copy(w, resp.Body); err != nil {\n\t\t// TODO External Error\n\t\treturn fmt.Errorf(\"copping datastore response to client: %w\", err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "f0e27411edb0e1ce0b89630c931a2b45", "score": "0.53813213", "text": "func (i *Inspector) History(qname string, n int) ([]*DailyStats, error) {\n\tif err := base.ValidateQueueName(qname); err != nil {\n\t\treturn nil, err\n\t}\n\tstats, err := i.rdb.HistoricalStats(qname, n)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar res []*DailyStats\n\tfor _, s := range stats {\n\t\tres = append(res, &DailyStats{\n\t\t\tQueue: s.Queue,\n\t\t\tProcessed: s.Processed,\n\t\t\tFailed: s.Failed,\n\t\t\tDate: s.Time,\n\t\t})\n\t}\n\treturn res, nil\n}", "title": "" }, { "docid": "627afc120bc69e38c3ea96b11bfb7ef0", "score": "0.5328259", "text": "func (pp *AWSSpotPricer) History(start, end time.Time, filter map[string]string) (tsdb.DataPoints, error) {\n\treturn pp.SpotHistory(start, end, filter)\n}", "title": "" }, { "docid": "2ca0ed1e6c9afe822e87e8211a64f401", "score": "0.53188777", "text": "func (_EthCrossChain *EthCrossChainCaller) LatestHeight(opts *bind.CallOpts) (uint64, error) {\n\tvar (\n\t\tret0 = new(uint64)\n\t)\n\tout := ret0\n\terr := _EthCrossChain.contract.Call(opts, out, \"LatestHeight\")\n\treturn *ret0, err\n}", "title": "" }, { "docid": "554be1b38caf528a654341bff49257f1", "score": "0.5300142", "text": "func (d *Dao) History(c context.Context, mid int64) (h *model.UserEventHistory, err error) {\n\tvar (\n\t\trow *sql.Row\n\t)\n\th = &model.UserEventHistory{}\n\trow = d.db.QueryRow(c, fmt.Sprintf(_getLastHistorySQL, hitHistory(mid)), mid)\n\tif err = row.Scan(&h.ID, &h.Mid, &h.EventID, &h.Score, &h.BaseScore, &h.EventScore, &h.Remark, &h.Reason, &h.FactorVal, &h.CTime); err != nil {\n\t\tif err == sql.ErrNoRows {\n\t\t\terr = nil\n\t\t\th = nil\n\t\t\treturn\n\t\t}\n\t\tlog.Error(\"History row.Scan(%d) error(%v)\", mid, err)\n\t}\n\treturn\n}", "title": "" }, { "docid": "b8d939e6fd5b7c677e5af6fc1c715a91", "score": "0.5196846", "text": "func (_EthCrossChain *EthCrossChainCallerSession) LatestHeight() (uint64, error) {\n\treturn _EthCrossChain.Contract.LatestHeight(&_EthCrossChain.CallOpts)\n}", "title": "" }, { "docid": "f8aebba67d1ffb9d9f942aa1903e3b08", "score": "0.514478", "text": "func (sc *LoanMarketShareContract) History(ctx contractapi.TransactionContextInterface, key string) ([]LoanMarketShareHistory, error) {\n\n\titer, err := ctx.GetStub().GetHistoryForKey(key)\n\tif err != nil {\n return nil, err\n\t}\n\tdefer func() { _ = iter.Close() }()\n\n\tvar results []LoanMarketShareHistory\n\tfor iter.HasNext() {\n\t\tstate, err := iter.Next()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tentryObj := new(LoanMarketShareObj)\n\t\tif errNew := json.Unmarshal(state.Value, entryObj); errNew != nil {\n\t\t\treturn nil, errNew\n\t\t}\n\n\t\tentry := LoanMarketShareHistory{\n\t\t\tTxID:\t\tstate.GetTxId(),\n\t\t\tTimestamp:\ttime.Unix(state.GetTimestamp().GetSeconds(), 0),\n\t\t\tLoanMarketShare:\tentryObj,\n\t\t}\n\n\t\tresults = append(results, entry)\n\t}\n\treturn results, nil\n}", "title": "" }, { "docid": "ece0f616f72353896c3580f33173c371", "score": "0.51315856", "text": "func (s *HeroesServiceChaincode) gethistory(stub shim.ChaincodeStubInterface, args []string) pb.Response {\n\tif len(args) < 2 {\n\t\treturn shim.Error(\"Incorrect number of arguments. Expecting 3\")\n\t}\n\n\tvegKey := args[1]\n\tfmt.Printf(\"##### start History of Record: %s\\n\", vegKey)\n\n\tresultsIterator, err := stub.GetHistoryForKey(vegKey)\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\tdefer resultsIterator.Close()\n\n\t// buffer is a JSON array containing historic values for the marble\n\tvar buffer bytes.Buffer\n\tbuffer.WriteString(\"[\")\n\n\tbArrayMemberAlreadyWritten := false\n\tfor resultsIterator.HasNext() {\n\t\tresponse, err := resultsIterator.Next()\n\t\tif err != nil {\n\t\t\treturn shim.Error(err.Error())\n\t\t}\n\t\t// Add a comma before array members, suppress it for the first array member\n\t\tif bArrayMemberAlreadyWritten == true {\n\t\t\tbuffer.WriteString(\",\")\n\t\t}\n\t\tbuffer.WriteString(\"{\\\"TxId\\\":\")\n\t\tbuffer.WriteString(\"\\\"\")\n\t\tbuffer.WriteString(response.TxId)\n\t\tbuffer.WriteString(\"\\\"\")\n\n\t\tbuffer.WriteString(\", \\\"Value\\\":\")\n\t\t// if it was a delete operation on given key, then we need to set the\n\t\t//corresponding value null. Else, we will write the response.Value\n\t\t//as-is (as the Value itself a JSON marble)\n\t\tif response.IsDelete {\n\t\t\tbuffer.WriteString(\"null\")\n\t\t} else {\n\t\t\tbuffer.WriteString(string(response.Value))\n\t\t}\n\n\t\tbuffer.WriteString(\", \\\"Timestamp\\\":\")\n\t\tbuffer.WriteString(\"\\\"\")\n\t\tbuffer.WriteString(time.Unix(response.Timestamp.Seconds, int64(response.Timestamp.Nanos)).String())\n\t\tbuffer.WriteString(\"\\\"\")\n\n\t\tbuffer.WriteString(\", \\\"IsDelete\\\":\")\n\t\tbuffer.WriteString(\"\\\"\")\n\t\tbuffer.WriteString(strconv.FormatBool(response.IsDelete))\n\t\tbuffer.WriteString(\"\\\"\")\n\n\t\tbuffer.WriteString(\"}\")\n\t\tbArrayMemberAlreadyWritten = true\n\t}\n\tbuffer.WriteString(\"]\")\n\n\tfmt.Printf(\"- getHistoryForVegetable returning:\\n%s\\n\", buffer.String())\n\n\treturn shim.Success(buffer.Bytes())\n}", "title": "" }, { "docid": "4680062cbf22e620c8db28f5eb3285e7", "score": "0.51170343", "text": "func (s *State) GetHistory(height uint32) (*StateKeyFrame, error) {\n\ts.mtx.RLock()\n\tdefer s.mtx.RUnlock()\n\n\t// Seek to state to target height.\n\tif err := s.history.SeekTo(height); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Take a snapshot of the history.\n\treturn s.snapshot(), nil\n}", "title": "" }, { "docid": "1b7f4493a70980f3e8a505467681557e", "score": "0.5114019", "text": "func (_EthCrossChain *EthCrossChainSession) LatestHeight() (uint64, error) {\n\treturn _EthCrossChain.Contract.LatestHeight(&_EthCrossChain.CallOpts)\n}", "title": "" }, { "docid": "7258a8f39294b84b3a4073d9941f7614", "score": "0.50903153", "text": "func (bfx *bloomfilterIndexer) Height() (uint64, error) {\n\th, err := bfx.flusher.KVStoreWithBuffer().Get(RangeBloomFilterNamespace, []byte(CurrentHeightKey))\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn byteutil.BytesToUint64(h), nil\n}", "title": "" }, { "docid": "06ba947fc5ce1e4c68913592cf729a0d", "score": "0.5084135", "text": "func (hf *Historical) Evaluate(f Feed) {\n\tswitch f.Metric {\n\tcase \"query/time\":\n\t\tval, _ := f.Value.(float64)\n\t\tlabels := map[string]string{\n\t\t\t\"dataSource\": f.DataSource,\n\t\t\t\"remoteAddress\": f.RemoteAddess,\n\t\t\t\"id\": f.ID,\n\t\t\t\"numMetrics\": f.Metric,\n\t\t\t\"type\": f.Type,\n\t\t\t\"hasFilters\": f.HasFilters,\n\t\t\t\"duration\": f.Duration,\n\t\t\t\"numComplexMetrics\": f.NumComplexMetrics,\n\t\t\t\"numDimensions\": f.NumDimensions,\n\t\t\t\"threshold\": f.Threshold,\n\t\t\t\"dimension\": f.Dimension,\n\t\t}\n\t\thf.QueryHistoricalExporter.SetQueryTime(labels, float64(val))\n\t\tbreak\n\tcase \"query/segment/time\":\n\t\tval, _ := f.Value.(float64)\n\t\tlabels := map[string]string{\n\t\t\t\"id\": f.ID,\n\t\t\t\"status\": f.Status,\n\t\t\t\"segment\": f.Segment,\n\t\t}\n\t\thf.QueryHistoricalExporter.SetQuerySegmentTime(labels, float64(val))\n\t\tbreak\n\tcase \"query/wait/time\":\n\t\tval, _ := f.Value.(float64)\n\t\tlabels := map[string]string{\n\t\t\t\"id\": f.ID,\n\t\t\t\"segment\": f.Segment,\n\t\t}\n\t\thf.QueryHistoricalExporter.SetQueryWaitTime(labels, float64(val))\n\t\tbreak\n\tcase \"query/segmentAndCache/time\":\n\t\tval, _ := f.Value.(float64)\n\t\tlabels := map[string]string{\n\t\t\t\"id\": f.ID,\n\t\t\t\"segment\": f.Segment,\n\t\t}\n\t\thf.QueryHistoricalExporter.SetQuerySegmentAndCacheTime(labels, float64(val))\n\t\tbreak\n\tcase \"query/cpu/time\":\n\t\tval, _ := f.Value.(float64)\n\t\tlabels := map[string]string{\n\t\t\t\"dataSource\": f.DataSource,\n\t\t\t\"remoteAddress\": f.RemoteAddess,\n\t\t\t\"id\": f.ID,\n\t\t\t\"numMetrics\": f.Metric,\n\t\t\t\"type\": f.Type,\n\t\t\t\"hasFilters\": f.HasFilters,\n\t\t\t\"duration\": f.Duration,\n\t\t\t\"numComplexMetrics\": f.NumComplexMetrics,\n\t\t\t\"numDimensions\": f.NumDimensions,\n\t\t\t\"threshold\": f.Threshold,\n\t\t\t\"dimension\": f.Dimension,\n\t\t}\n\t\thf.QueryHistoricalExporter.SetQueryCPUTime(labels, float64(val))\n\t\tbreak\n\tcase \"query/count\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.QueryHistoricalExporter.SetQueryCount(float64(val))\n\t\tbreak\n\tcase \"query/success/count\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.QueryHistoricalExporter.SetQuerySuccessCount(float64(val))\n\t\tbreak\n\tcase \"query/failed/count\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.QueryHistoricalExporter.SetQueryFailedCount(float64(val))\n\t\tbreak\n\tcase \"query/interrupted/count\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.QueryHistoricalExporter.SetQueryInterruptedCount(float64(val))\n\t\tbreak\n\tcase \"segment/scan/pending\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.QueryHistoricalExporter.SetSegmentScanPending(float64(val))\n\t\tbreak\n\tcase \"sqlQuery/time\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.SQLExporter.SetSQLQueryTime(float64(val))\n\t\tbreak\n\tcase \"sqlQuery/bytes\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.SQLExporter.SetSQLQueryBytes(float64(val))\n\t\tbreak\n\tcase \"query/cache/delta/numEntries\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.QueryCacheExporter.SetDeltaNumEntries(float64(val))\n\t\tbreak\n\tcase \"query/cache/delta/sizeBytes\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.QueryCacheExporter.SetDeltaSizeBytes(float64(val))\n\t\tbreak\n\tcase \"query/cache/delta/hits\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.QueryCacheExporter.SetDeltaHits(float64(val))\n\t\tbreak\n\tcase \"query/cache/delta/misses\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.QueryCacheExporter.SetDeltaMisses(float64(val))\n\t\tbreak\n\tcase \"query/cache/delta/evictions\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.QueryCacheExporter.SetDeltaEvictions(float64(val))\n\t\tbreak\n\tcase \"query/cache/delta/hitRate\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.QueryCacheExporter.SetDeltaHitRate(float64(val))\n\t\tbreak\n\tcase \"query/cache/delta/averageBytes\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.QueryCacheExporter.SetDeltaAverageBytes(float64(val))\n\t\tbreak\n\tcase \"query/cache/delta/timeouts\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.QueryCacheExporter.SetDeltaTimeouts(float64(val))\n\t\tbreak\n\tcase \"query/cache/delta/errors\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.QueryCacheExporter.SetDeltaErrors(float64(val))\n\t\tbreak\n\tcase \"query/cache/delta/put/ok\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.QueryCacheExporter.SetDeltaPutOK(float64(val))\n\t\tbreak\n\tcase \"query/cache/delta/put/error\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.QueryCacheExporter.SetDeltaPutError(float64(val))\n\t\tbreak\n\tcase \"query/cache/delta/put/oversized\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.QueryCacheExporter.SetDeltaPutOversized(float64(val))\n\t\tbreak\n\tcase \"query/cache/total/numEntries\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.QueryCacheExporter.SetTotalNumEntries(float64(val))\n\t\tbreak\n\tcase \"query/cache/total/sizeBytes\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.QueryCacheExporter.SetTotalSizeBytes(float64(val))\n\t\tbreak\n\tcase \"query/cache/total/hits\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.QueryCacheExporter.SetTotalHits(float64(val))\n\t\tbreak\n\tcase \"query/cache/total/misses\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.QueryCacheExporter.SetTotalMisses(float64(val))\n\t\tbreak\n\tcase \"query/cache/total/evictions\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.QueryCacheExporter.SetTotalEvictions(float64(val))\n\t\tbreak\n\tcase \"query/cache/total/hitRate\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.QueryCacheExporter.SetTotalHitRate(float64(val))\n\t\tbreak\n\tcase \"query/cache/total/averageBytes\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.QueryCacheExporter.SetTotalAverageBytes(float64(val))\n\t\tbreak\n\tcase \"query/cache/total/timeouts\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.QueryCacheExporter.SetTotalTimeouts(float64(val))\n\t\tbreak\n\tcase \"query/cache/total/errors\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.QueryCacheExporter.SetTotalErrors(float64(val))\n\t\tbreak\n\tcase \"query/cache/total/put/ok\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.QueryCacheExporter.SetTotalPutOK(float64(val))\n\t\tbreak\n\tcase \"query/cache/total/put/error\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.QueryCacheExporter.SetTotalPutError(float64(val))\n\t\tbreak\n\tcase \"query/cache/total/put/oversized\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.QueryCacheExporter.SetTotalPutOversized(float64(val))\n\t\tbreak\n\tcase \"jvm/pool/committed\":\n\t\tval, _ := f.Value.(float64)\n\t\tlabels := map[string]string{\n\t\t\t\"poolKind\": f.PoolKind,\n\t\t\t\"poolName\": f.PoolName,\n\t\t}\n\t\thf.HealthJVMExporter.SetPoolCommited(labels, float64(val))\n\t\tbreak\n\tcase \"jvm/pool/init\":\n\t\tval, _ := f.Value.(float64)\n\t\tlabels := map[string]string{\n\t\t\t\"poolKind\": f.PoolKind,\n\t\t\t\"poolName\": f.PoolName,\n\t\t}\n\t\thf.HealthJVMExporter.SetPoolInit(labels, float64(val))\n\t\tbreak\n\tcase \"jvm/pool/max\":\n\t\tval, _ := f.Value.(float64)\n\t\tlabels := map[string]string{\n\t\t\t\"poolKind\": f.PoolKind,\n\t\t\t\"poolName\": f.PoolName,\n\t\t}\n\t\thf.HealthJVMExporter.SetPoolMax(labels, float64(val))\n\t\tbreak\n\tcase \"jvm/pool/used\":\n\t\tval, _ := f.Value.(float64)\n\t\tlabels := map[string]string{\n\t\t\t\"poolKind\": f.PoolKind,\n\t\t\t\"poolName\": f.PoolName,\n\t\t}\n\t\thf.HealthJVMExporter.SetPoolUsed(labels, float64(val))\n\t\tbreak\n\tcase \"jvm/bufferpool/count\":\n\t\tval, _ := f.Value.(float64)\n\t\tlabels := map[string]string{\n\t\t\t\"bufferPoolName\": f.BufferPoolName,\n\t\t}\n\t\thf.HealthJVMExporter.SetBufferpoolCount(labels, float64(val))\n\t\tbreak\n\tcase \"jvm/bufferpool/used\":\n\t\tval, _ := f.Value.(float64)\n\t\tlabels := map[string]string{\n\t\t\t\"bufferPoolName\": f.BufferPoolName,\n\t\t}\n\t\thf.HealthJVMExporter.SetBufferpoolUsed(labels, float64(val))\n\t\tbreak\n\tcase \"jvm/bufferpool/capacity\":\n\t\tval, _ := f.Value.(float64)\n\t\tlabels := map[string]string{\n\t\t\t\"bufferPoolName\": f.BufferPoolName,\n\t\t}\n\t\thf.HealthJVMExporter.SetBufferpoolCapacity(labels, float64(val))\n\t\tbreak\n\tcase \"jvm/mem/init\":\n\t\tval, _ := f.Value.(float64)\n\t\tlabels := map[string]string{\n\t\t\t\"memKind\": f.MemKind,\n\t\t}\n\t\thf.HealthJVMExporter.SetMemInit(labels, float64(val))\n\t\tbreak\n\tcase \"jvm/mem/max\":\n\t\tval, _ := f.Value.(float64)\n\t\tlabels := map[string]string{\n\t\t\t\"memKind\": f.MemKind,\n\t\t}\n\t\thf.HealthJVMExporter.SetMemMax(labels, float64(val))\n\t\tbreak\n\tcase \"jvm/mem/used\":\n\t\tval, _ := f.Value.(float64)\n\t\tlabels := map[string]string{\n\t\t\t\"memKind\": f.MemKind,\n\t\t}\n\t\thf.HealthJVMExporter.SetMemUsed(labels, float64(val))\n\t\tbreak\n\tcase \"jvm/mem/committed\":\n\t\tval, _ := f.Value.(float64)\n\t\tlabels := map[string]string{\n\t\t\t\"memKind\": f.MemKind,\n\t\t}\n\t\thf.HealthJVMExporter.SetMemCommitted(labels, float64(val))\n\t\tbreak\n\tcase \"jvm/gc/count\":\n\t\tval, _ := f.Value.(float64)\n\t\tlabels := map[string]string{\n\t\t\t\"gcName\": strings.Join(f.GCName, \",\"),\n\t\t\t\"gcGen\": strings.Join(f.GCGen, \",\"),\n\t\t}\n\t\thf.HealthJVMExporter.SetGCCount(labels, float64(val))\n\t\tbreak\n\tcase \"jvm/gc/cpu\":\n\t\tval, _ := f.Value.(float64)\n\t\tlabels := map[string]string{\n\t\t\t\"gcName\": strings.Join(f.GCName, \",\"),\n\t\t\t\"gcGen\": strings.Join(f.GCGen, \",\"),\n\t\t}\n\t\thf.HealthJVMExporter.SetGCCPU(labels, float64(val))\n\t\tbreak\n\tcase \"jetty/numOpenConnections\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.QueryJettyExporter.SetNumOpenConnections(float64(val))\n\t\tbreak\n\tcase \"sys/swap/free\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.SysExporter.SetSwapFree(float64(val))\n\t\tbreak\n\tcase \"sys/swap/max\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.SysExporter.SetSwapMax(float64(val))\n\t\tbreak\n\tcase \"sys/swap/pageIn\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.SysExporter.SetSwapPageIn(float64(val))\n\t\tbreak\n\tcase \"sys/swap/pageOut\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.SysExporter.SetSwapPageOut(float64(val))\n\t\tbreak\n\tcase \"sys/disk/write/count\":\n\t\tval, _ := f.Value.(float64)\n\t\tlabels := map[string]string{\n\t\t\t\"fsDevName\": f.FSDevName,\n\t\t\t\"fsDirName\": f.FSDirName,\n\t\t\t\"fsTypeName\": f.FSTypeName,\n\t\t\t\"fsSysTypeName\": f.FSSysTypeName,\n\t\t\t\"fsOptions\": strings.Join(f.FSOptions, \",\"),\n\t\t}\n\t\thf.SysExporter.SetDiskWriteCount(labels, float64(val))\n\t\tbreak\n\tcase \"sys/disk/read/count\":\n\t\tval, _ := f.Value.(float64)\n\t\tlabels := map[string]string{\n\t\t\t\"fsDevName\": f.FSDevName,\n\t\t\t\"fsDirName\": f.FSDirName,\n\t\t\t\"fsTypeName\": f.FSTypeName,\n\t\t\t\"fsSysTypeName\": f.FSSysTypeName,\n\t\t\t\"fsOptions\": strings.Join(f.FSOptions, \",\"),\n\t\t}\n\t\thf.SysExporter.SetDiskReadCount(labels, float64(val))\n\t\tbreak\n\tcase \"sys/disk/write/size\":\n\t\tval, _ := f.Value.(float64)\n\t\tlabels := map[string]string{\n\t\t\t\"fsDevName\": f.FSDevName,\n\t\t\t\"fsDirName\": f.FSDirName,\n\t\t\t\"fsTypeName\": f.FSTypeName,\n\t\t\t\"fsSysTypeName\": f.FSSysTypeName,\n\t\t\t\"fsOptions\": strings.Join(f.FSOptions, \",\"),\n\t\t}\n\t\thf.SysExporter.SetDiskWriteSize(labels, float64(val))\n\t\tbreak\n\tcase \"sys/disk/read/size\":\n\t\tval, _ := f.Value.(float64)\n\t\tlabels := map[string]string{\n\t\t\t\"fsDevName\": f.FSDevName,\n\t\t\t\"fsDirName\": f.FSDirName,\n\t\t\t\"fsTypeName\": f.FSTypeName,\n\t\t\t\"fsSysTypeName\": f.FSSysTypeName,\n\t\t\t\"fsOptions\": strings.Join(f.FSOptions, \",\"),\n\t\t}\n\t\thf.SysExporter.SetDiskReadSize(labels, float64(val))\n\t\tbreak\n\tcase \"sys/net/read/size\":\n\t\tval, _ := f.Value.(float64)\n\t\tlabels := map[string]string{\n\t\t\t\"netName\": f.NetName,\n\t\t\t\"netAddress\": f.NetAddress,\n\t\t\t\"netHwaddr\": f.NetHwAddr,\n\t\t}\n\t\thf.SysExporter.SetNetReadSize(labels, float64(val))\n\t\tbreak\n\tcase \"sys/mem/max\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.SysExporter.SetMemMax(float64(val))\n\t\tbreak\n\tcase \"sys/mem/used\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.SysExporter.SetMemUsed(float64(val))\n\t\tbreak\n\tcase \"sys/fs/max\":\n\t\tval, _ := f.Value.(float64)\n\t\tlabels := map[string]string{\n\t\t\t\"fsDevName\": f.FSDevName,\n\t\t\t\"fsDirName\": f.FSDirName,\n\t\t\t\"fsTypeName\": f.FSTypeName,\n\t\t\t\"fsSysTypeName\": f.FSSysTypeName,\n\t\t\t\"fsOptions\": strings.Join(f.FSOptions, \",\"),\n\t\t}\n\t\thf.SysExporter.SetFSMax(labels, float64(val))\n\t\tbreak\n\tcase \"sys/fs/used\":\n\t\tval, _ := f.Value.(float64)\n\t\tlabels := map[string]string{\n\t\t\t\"fsDevName\": f.FSDevName,\n\t\t\t\"fsDirName\": f.FSDirName,\n\t\t\t\"fsTypeName\": f.FSTypeName,\n\t\t\t\"fsSysTypeName\": f.FSSysTypeName,\n\t\t\t\"fsOptions\": strings.Join(f.FSOptions, \",\"),\n\t\t}\n\t\thf.SysExporter.SetFSUsed(labels, float64(val))\n\t\tbreak\n\tcase \"sys/net/write/size\":\n\t\tval, _ := f.Value.(float64)\n\t\tlabels := map[string]string{\n\t\t\t\"netName\": f.NetName,\n\t\t\t\"netAddress\": f.NetAddress,\n\t\t\t\"netHwaddr\": f.NetHwAddr,\n\t\t}\n\t\thf.SysExporter.SetNetWriteSize(labels, float64(val))\n\t\tbreak\n\tcase \"sys/storage/used\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.SysExporter.SetStorageUsed(f.FSDirName, float64(val))\n\t\tbreak\n\tcase \"sys/cpu\":\n\t\tval, _ := f.Value.(float64)\n\t\tlabels := map[string]string{\n\t\t\t\"cpuName\": f.CPUName,\n\t\t\t\"cpuTime\": f.CPUTime,\n\t\t}\n\t\thf.SysExporter.SetCPU(labels, float64(val))\n\t\tbreak\n\tcase \"segment/max\":\n\t\tval, _ := f.Value.(float64)\n\t\thf.HealthHistoricalExporter.SetSegmentMax(float64(val))\n\t\tbreak\n\tdefault:\n\t\tbreak\n\t}\n}", "title": "" }, { "docid": "63d9aa8a4ef078c6f0629633f5817bc3", "score": "0.50304776", "text": "func getHistory(stub shim.ChaincodeStubInterface, args []string) (string, error) {\n\tif len(args) != 1 {\n\t\treturn \"\", fmt.Errorf(\"Incorrect arguments. Expecting a key\")\n\t}\n\n\tresultsIterator, err := stub.GetHistoryForKey(args[0])\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"Failed to get asset: %s with error: %s\", args[0], err)\n\t}\n\tif resultsIterator == nil {\n\t\treturn \"\", fmt.Errorf(\"history not found: %s\", args[0])\n\t}\n\n\tdefer resultsIterator.Close()\n\n\t// buffer is a JSON array containing historic values for the marble\n\tvar buffer bytes.Buffer\n\tbuffer.WriteString(\"[\")\n\n\tbArrayMemberAlreadyWritten := false\n\tfor resultsIterator.HasNext() {\n\t\tresponse, err := resultsIterator.Next()\n\t\tif err != nil {\n\t\t\treturn \"iterating error\", err\n\t\t}\n\t\t// Add a comma before array members, suppress it for the first array member\n\t\tif bArrayMemberAlreadyWritten == true {\n\t\t\tbuffer.WriteString(\",\")\n\t\t}\n\t\tbuffer.WriteString(\"{\\\"TxId\\\":\")\n\t\tbuffer.WriteString(\"\\\"\")\n\t\tbuffer.WriteString(response.TxId)\n\t\tbuffer.WriteString(\"\\\"\")\n\n\t\tbuffer.WriteString(\", \\\"Value\\\":\")\n\t\t// if it was a delete operation on given key, then we need to set the\n\t\t//corresponding value null. Else, we will write the response.Value\n\t\t//as-is (as the Value itself a JSON marble)\n\t\tif response.IsDelete {\n\t\t\tbuffer.WriteString(\"null\")\n\t\t} else {\n\t\t\tbuffer.WriteString(string(response.Value))\n\t\t}\n\n\t\tbuffer.WriteString(\", \\\"Timestamp\\\":\")\n\t\tbuffer.WriteString(\"\\\"\")\n\t\tbuffer.WriteString(time.Unix(response.Timestamp.Seconds, int64(response.Timestamp.Nanos)).String())\n\t\tbuffer.WriteString(\"\\\"\")\n\n\t\tbuffer.WriteString(\", \\\"IsDelete\\\":\")\n\t\tbuffer.WriteString(\"\\\"\")\n\t\tbuffer.WriteString(strconv.FormatBool(response.IsDelete))\n\t\tbuffer.WriteString(\"\\\"\")\n\n\t\tbuffer.WriteString(\"}\")\n\t\tbArrayMemberAlreadyWritten = true\n\t}\n\tbuffer.WriteString(\"]\")\n\n\tfmt.Printf(\"- getHistoryForMarble returning:\\n%s\\n\", buffer.String())\n\n\treturn buffer.String(), nil\n}", "title": "" }, { "docid": "1e141ef97f93f451536f4e90f81418a3", "score": "0.502875", "text": "func Hist(habitMap habits.HabitMap) {\n\ttaskHeader := \"Task\"\n\ttickHeader := \"Ticks\"\n\torderedHabits := orderByTag(habitMap)\n\tcolorAssignments := buildColorOrder(orderedHabits)\n\n\t// Format padding of the headers\n\tmaxKeyLength := len(taskHeader)\n\tfor _, habit := range habitMap {\n\t\tshortNameLength := len(habit.ShortName)\n\t\tif shortNameLength > maxKeyLength {\n\t\t\tmaxKeyLength = shortNameLength\n\t\t}\n\t}\n\tpaddingStringFmt := fmt.Sprintf(\"%%-%dv|\", maxKeyLength)\n\tcolor.OpBold.Printf(paddingStringFmt, taskHeader)\n\tcolor.OpBold.Print(tickHeader)\n\tfmt.Println()\n\n\t// TODO: be smart about aggregation and density\n\t// i.e. different symbol, more intense color, etc\n\tfor habitIndex, colorToUse := range colorAssignments.ColorOrder {\n\t\thabit := orderedHabits[habitIndex]\n\t\tfmt.Printf(paddingStringFmt, habit.ShortName)\n\t\tfor i := 0; i < len(habit.Occurrences); i++ {\n\t\t\tcolor.S256(colorToUse).Print(\"■\")\n\t\t\tfmt.Print(\"|\")\n\t\t}\n\t\tfmt.Println()\n\t}\n}", "title": "" }, { "docid": "e54d66d653a8e78f9ffd5b093ee3e1cf", "score": "0.4896602", "text": "func (_EthCrossChain *EthCrossChainCaller) LatestBookKeeperHeight(opts *bind.CallOpts) (uint64, error) {\n\tvar (\n\t\tret0 = new(uint64)\n\t)\n\tout := ret0\n\terr := _EthCrossChain.contract.Call(opts, out, \"LatestBookKeeperHeight\")\n\treturn *ret0, err\n}", "title": "" }, { "docid": "696e0060e5e029a5369f007bbc39613c", "score": "0.48681414", "text": "func (l *Linenoise) historyGet(idx int) string {\n\treturn l.history[len(l.history)-1-idx]\n}", "title": "" }, { "docid": "8a617ded098251e304dc80ac36040472", "score": "0.4864067", "text": "func (dbc *DatabaseCfg) GetAlertEventHistArrayWithParams(filter string, maxrows int64, page int64, itemsPerPage int64, maxSize int64, sortColumn string, sortDir string) ([]*AlertEventHist, error) {\n\tlog.Debugf(\"Getting AlertEventHist data filtered with filter: %s, maxrows: %d, page: %d, itemsPerPage: %d, maxSize: %d, sortColumn: %s, sortDir: %s\", filter, maxrows, page, itemsPerPage, maxSize, sortColumn, sortDir)\n\tvar err error\n\tvar alevts []*AlertEventHist\n\t/*\n\t\tSELECT * FROM alert_event_hist\n\t\tWHERE filter\n\t\tORDER BY sortColumn\n\t\tsortDir (ASC/DESC)\n\t\tLIMIT itemsPerPage * maxSize\n\t\tOFFSET itemsPerPage * (page - 1)\n\t*/\n\tsqlquery := \"SELECT * FROM alert_event_hist\"\n\tif len(filter) > 0 {\n\t\tsqlquery = sqlquery + \" WHERE \" + filter\n\t}\n\tif len(sortColumn) > 0 {\n\t\tsqlquery = sqlquery + \" ORDER BY \" + sortColumn\n\t}\n\tif len(sortDir) > 0 {\n\t\tsqlquery = sqlquery + \" \" + sortDir\n\t}\n\tif maxrows > 0 {\n\t\tsqlquery = sqlquery + \" LIMIT \" + strconv.FormatInt(maxrows, 10)\n\t} else if itemsPerPage > 0 && maxSize > 0 {\n\t\tmaxrows = itemsPerPage * maxSize\n\t\tsqlquery = sqlquery + \" LIMIT \" + strconv.FormatInt(maxrows, 10)\n\t}\n\tif itemsPerPage > 0 && maxSize > 0 && page > 0 {\n\t\toffset := itemsPerPage * maxSize * ((page - 1) / maxSize)\n\t\tsqlquery = sqlquery + \" OFFSET \" + strconv.FormatInt(offset, 10)\n\t}\n\n\tlog.Debugf(\"Getting AlertEventHist data filtered with sqlquery: %s\", sqlquery)\n\n\tstart := time.Now()\n\tif err = dbc.x.SQL(sqlquery).Find(&alevts); err != nil {\n\t\tlog.Warnf(\"Fail to get AlertEventHist data filtered with sqlquery: %s. Error : %s\", sqlquery, err)\n\t\treturn nil, err\n\t}\n\telapsed := time.Since(start)\n\tlog.Debugf(\"TIMELOG: GetAlertEventHistArrayWithParams took %v\", elapsed)\n\treturn alevts, nil\n}", "title": "" }, { "docid": "9cca92df178dc3ca9b0eb81789630b9a", "score": "0.48582467", "text": "func (ac *AddressCache) HistoryStats() (hits, misses int) {\n\treturn ac.cacheMetrics.historyStats()\n}", "title": "" }, { "docid": "a37eefd10f9b90251de5ab2ff8e052a9", "score": "0.48209986", "text": "func (sink *influxdbSink) Historical() core.HistoricalSource {\n\treturn sink\n}", "title": "" }, { "docid": "d02e9495df5fcd02853df0b25b822e95", "score": "0.48172957", "text": "func (t *BenchmarkerChaincode) GetHistoryForKey(stub shim.ChaincodeStubInterface, seed, keySizeLo, keySizeHi int) pb.Response {\n\tvar (\n\t\tkm NoopKeyMapper\n\t)\n\n\tkey := km.GetKeys(seed, 1, keySizeLo, keySizeHi)[0]\n\n\tresultsIterator, err := stub.GetHistoryForKey(key)\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\tdefer resultsIterator.Close()\n\n\tfmt.Printf(\"GetHistoryForKey: Getting history for key '%s'\\n\", key)\n\n\t// buffer is a JSON array containing historic values for the marble\n\tvar buffer bytes.Buffer\n\tbuffer.WriteString(\"[\")\n\n\tbArrayMemberAlreadyWritten := false\n\tfor resultsIterator.HasNext() {\n\t\tresponse, err := resultsIterator.Next()\n\t\tif err != nil {\n\t\t\treturn shim.Error(err.Error())\n\t\t}\n\t\t// Add a comma before array members, suppress it for the first array member\n\t\tif bArrayMemberAlreadyWritten == true {\n\t\t\tbuffer.WriteString(\",\")\n\t\t}\n\t\tbuffer.WriteString(\"{\\\"TxId\\\":\")\n\t\tbuffer.WriteString(\"\\\"\")\n\t\tbuffer.WriteString(response.TxId)\n\t\tbuffer.WriteString(\"\\\"\")\n\n\t\tbuffer.WriteString(\", \\\"Value\\\":\")\n\t\t// if it was a delete operation on given key, then we need to set the\n\t\t//corresponding value null. Else, we will write the response.Value\n\t\t//as-is (as the Value itself a JSON marble)\n\t\tif response.IsDelete {\n\t\t\tbuffer.WriteString(\"null\")\n\t\t} else {\n\t\t\tbuffer.WriteString(string(response.Value))\n\t\t}\n\n\t\tbuffer.WriteString(\", \\\"Timestamp\\\":\")\n\t\tbuffer.WriteString(\"\\\"\")\n\t\tbuffer.WriteString(time.Unix(response.Timestamp.Seconds, int64(response.Timestamp.Nanos)).String())\n\t\tbuffer.WriteString(\"\\\"\")\n\n\t\tbuffer.WriteString(\", \\\"IsDelete\\\":\")\n\t\tbuffer.WriteString(\"\\\"\")\n\t\tbuffer.WriteString(strconv.FormatBool(response.IsDelete))\n\t\tbuffer.WriteString(\"\\\"\")\n\n\t\tbuffer.WriteString(\"}\")\n\t\tbArrayMemberAlreadyWritten = true\n\t}\n\tbuffer.WriteString(\"]\")\n\n\treturn shim.Success(buffer.Bytes())\n}", "title": "" }, { "docid": "6135f289c58a1188e4eae903bcab5c75", "score": "0.48100102", "text": "func (f *ReleaseStoreGetLatestFunc) History() []ReleaseStoreGetLatestFuncCall {\n\tf.mutex.Lock()\n\thistory := make([]ReleaseStoreGetLatestFuncCall, len(f.history))\n\tcopy(history, f.history)\n\tf.mutex.Unlock()\n\n\treturn history\n}", "title": "" }, { "docid": "232f17de8e74905ee186bf2278f2de83", "score": "0.479937", "text": "func (client *Client) QueryTaskInfoHistory(request *QueryTaskInfoHistoryRequest) (response *QueryTaskInfoHistoryResponse, err error) {\n\tresponse = CreateQueryTaskInfoHistoryResponse()\n\terr = client.DoAction(request, response)\n\treturn\n}", "title": "" }, { "docid": "6e1e5d7950cd201e736797c000cbc38a", "score": "0.47960302", "text": "func (t ThriftHandler) DescribeHistoryHost(ctx context.Context, request *shared.DescribeHistoryHostRequest) (response *shared.DescribeHistoryHostResponse, err error) {\n\tresponse, err = t.h.DescribeHistoryHost(ctx, request)\n\treturn response, thrift.FromError(err)\n}", "title": "" }, { "docid": "03fe819f64bd379a2ce6478fc9a2349b", "score": "0.47941315", "text": "func (d *Dao) HistoryView(c context.Context, mid, hid int64, ip string) (history *archive.ArcHistory, err error) {\n\tparams := url.Values{}\n\tparams.Set(\"hid\", strconv.FormatInt(hid, 10))\n\tparams.Set(\"mid\", strconv.FormatInt(mid, 10))\n\tvar res struct {\n\t\tCode int `json:\"code\"`\n\t\tData *archive.ArcHistory `json:\"data\"`\n\t}\n\tif err = d.client.Get(c, d.hView, ip, params, &res); err != nil {\n\t\tlog.Error(\"archive.HistoryView url(%s) mid(%d) error(%v)\", d.hView+\"?\"+params.Encode(), mid, err)\n\t\terr = ecode.CreativeArchiveAPIErr\n\t\treturn\n\t}\n\tif res.Code != 0 {\n\t\tlog.Error(\"archive.HistoryView url(%s) mid(%d) res(%v)\", d.hView+\"?\"+params.Encode(), mid, res)\n\t\terr = ecode.CreativeArchiveAPIErr\n\t\treturn\n\t}\n\thistory = res.Data\n\treturn\n}", "title": "" }, { "docid": "ea1f5c043d9a9ed4840d455d0f7f1b19", "score": "0.47837144", "text": "func (store *Store) getInfo(evidence types.Evidence) Info {\n\treturn store.GetInfo(evidence.Height(), evidence.Hash())\n}", "title": "" }, { "docid": "1aa70362ed69a28cc1ff90ada38db95f", "score": "0.4775674", "text": "func (b *Bitmex) GetHistoricCandles(_ context.Context, _ currency.Pair, _ asset.Item, _ kline.Interval, _, _ time.Time) (*kline.Item, error) {\n\treturn nil, common.ErrFunctionNotSupported\n}", "title": "" }, { "docid": "24710c837454e8186744f4a15b94dd39", "score": "0.47505242", "text": "func (f *ReleaseStoreGetLatestBatchFunc) History() []ReleaseStoreGetLatestBatchFuncCall {\n\tf.mutex.Lock()\n\thistory := make([]ReleaseStoreGetLatestBatchFuncCall, len(f.history))\n\tcopy(history, f.history)\n\tf.mutex.Unlock()\n\n\treturn history\n}", "title": "" }, { "docid": "b19f37141318d80c01fdc7677a284fd2", "score": "0.47377157", "text": "func (d *InfluxDevops) AvgMemAvailableDayByHour(q *Query) {\n\tinterval := d.AllInterval.RandWindow(24 * time.Hour)\n\n\tv := url.Values{}\n\tv.Set(\"db\", d.DatabaseName)\n\tv.Set(\"q\", fmt.Sprintf(\"SELECT mean(available) from mem where time >= '%s' and time < '%s' group by time(1h)\", interval.StartString(), interval.EndString()))\n\n\thumanLabel := []byte(\"Influx avg mem, all hosts, rand 1d by 1h\")\n\tq.HumanLabel = humanLabel\n\tq.HumanDescription = []byte(fmt.Sprintf(\"%s: %s\", humanLabel, interval.StartString()))\n\tq.Method = []byte(\"GET\")\n\tq.Path = []byte(fmt.Sprintf(\"/query?%s\", v.Encode()))\n\tq.Body = nil\n}", "title": "" }, { "docid": "2db0fcf725120b2b607d047f27f7acc8", "score": "0.47302458", "text": "func (t *SupplyChaincode) getTradeHistory(stub shim.ChaincodeStubInterface, args []string) pb.Response {\n\n\tif len(args) < 1 {\n\t\treturn shim.Error(\"Incorrect number of arguments. Expecting 1\")\n\t}\n\n\tmarbleName := args[0]\n\n\tfmt.Printf(\"- start getHistoryForMarble: %s\\n\", marbleName)\n\n/*\n// TODO: not implemented in current stable version. Waiting for v1.0 beta release.\n\tresultsIterator, err := stub.GetHistoryForKey(marbleName)\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\tdefer resultsIterator.Close()\n\n\t// buffer is a JSON array containing historic values for the marble\n\tvar buffer bytes.Buffer\n\tbuffer.WriteString(\"[\")\n\n\tbArrayMemberAlreadyWritten := false\n\tfor resultsIterator.HasNext() {\n\t\ttxID, historicValue, err := resultsIterator.Next()\n\t\tif err != nil {\n\t\t\treturn shim.Error(err.Error())\n\t\t}\n\t\t// Add a comma before array members, suppress it for the first array member\n\t\tif bArrayMemberAlreadyWritten == true {\n\t\t\tbuffer.WriteString(\",\")\n\t\t}\n\t\tbuffer.WriteString(\"{\\\"TxId\\\":\")\n\t\tbuffer.WriteString(\"\\\"\")\n\t\tbuffer.WriteString(txID)\n\t\tbuffer.WriteString(\"\\\"\")\n\n\t\tbuffer.WriteString(\", \\\"Value\\\":\")\n\t\t// historicValue is a JSON marble, so we write as-is\n\t\tbuffer.WriteString(string(historicValue))\n\t\tbuffer.WriteString(\"}\")\n\t\tbArrayMemberAlreadyWritten = true\n\t}\n\tbuffer.WriteString(\"]\")\n\n\tfmt.Printf(\"- getHistoryForMarble returning:\\n%s\\n\", buffer.String())\n\n\treturn shim.Success(buffer.Bytes())\n*/\n\n\tqueryString := args[0]\n\tqueryResults, err := stub.GetState(queryString)\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\t\n\treturn shim.Success(queryResults)\t\n}", "title": "" }, { "docid": "fc3b8d8ef1086f67cdb3ab24016b7d24", "score": "0.47238654", "text": "func (a *APIv1) GetThingByHistoricalLocation(id interface{}, qo *odata.QueryOptions, path string) (*entities.Thing, error) {\n\tt, err := a.db.GetThingByHistoricalLocation(id, qo)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ta.SetLinks(t, qo)\n\treturn t, nil\n}", "title": "" }, { "docid": "9e5c8e05686c3b2b6d2a5a9a9f1c86fc", "score": "0.47186035", "text": "func migrateHistoricalInfoKeys(store storetypes.KVStore, logger log.Logger) error {\n\t// old key is of format:\n\t// prefix (0x50) || heightBytes (string representation of height in 10 base)\n\t// new key is of format:\n\t// prefix (0x50) || heightBytes (byte array representation using big-endian byte order)\n\toldStore := prefix.NewStore(store, HistoricalInfoKey)\n\n\toldStoreIter := oldStore.Iterator(nil, nil)\n\tdefer sdk.LogDeferred(logger, func() error { return oldStoreIter.Close() })\n\n\tfor ; oldStoreIter.Valid(); oldStoreIter.Next() {\n\t\tstrHeight := oldStoreIter.Key()\n\n\t\tintHeight, err := strconv.ParseInt(string(strHeight), 10, 64)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"can't parse height from key %q to int64: %w\", strHeight, err)\n\t\t}\n\n\t\tnewStoreKey := GetHistoricalInfoKey(intHeight)\n\n\t\t// Set new key on store. Values don't change.\n\t\tstore.Set(newStoreKey, oldStoreIter.Value())\n\t\toldStore.Delete(oldStoreIter.Key())\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "2977a0e56629e734ecff3ef99d715ca0", "score": "0.46959782", "text": "func (_EthCrossChain *EthCrossChainCallerSession) LatestBookKeeperHeight() (uint64, error) {\n\treturn _EthCrossChain.Contract.LatestBookKeeperHeight(&_EthCrossChain.CallOpts)\n}", "title": "" }, { "docid": "f517564f94663d3ed37f7617716798f6", "score": "0.46935776", "text": "func (d *AddressCacheItem) HistoryChart(addrChart dbtypes.HistoryChart, chartGrouping dbtypes.TimeBasedGrouping) (*dbtypes.ChartsData, *BlockID) {\n\td.mtx.RLock()\n\tdefer d.mtx.RUnlock()\n\n\tif int(chartGrouping) >= dbtypes.NumIntervals {\n\t\tlog.Errorf(\"Invalid chart grouping: %v\", chartGrouping)\n\t\treturn nil, nil\n\t}\n\n\tvar cd *dbtypes.ChartsData\n\tswitch addrChart {\n\tcase dbtypes.TxsType:\n\t\tcd = d.history.TypeByInterval[chartGrouping]\n\tcase dbtypes.AmountFlow:\n\t\tcd = d.history.AmtFlowByInterval[chartGrouping]\n\t}\n\n\tif cd == nil {\n\t\treturn nil, nil\n\t}\n\treturn cd, d.blockID()\n}", "title": "" }, { "docid": "50181e48dcdb1a3e2ec95559e0af98f9", "score": "0.46900845", "text": "func (s *Server) History(w http.ResponseWriter, r *http.Request) {\n\tteam, err := s.currentTeam(w, r)\n\tif err != nil {\n\t\ts.unauthorized(w, err)\n\t\treturn\n\t}\n\n\tscores, err := models.NewScore().History(team.ID)\n\tif err != nil {\n\t\tError(w, http.StatusNotFound, err, \"failed to get history\")\n\t}\n\tJSON(w, http.StatusOK, scores)\n}", "title": "" }, { "docid": "09939cff5931293efcd9f6853c637d6e", "score": "0.46815205", "text": "func (s *Service) TogetherHistory(c context.Context, res []*hismodle.Resource, mid, build int64, platform string, plat int8) (data []*history.ListRes) {\n\tvar (\n\t\taids []int64\n\t\tepids []int64\n\t\tarticleIDs []int64\n\t\troomIDs []int64\n\t\tarchive map[int64]*arcmdl.View3\n\t\tpgcInfo map[int64]*history.PGCRes\n\t\tarticle map[int64]*artmodle.Meta\n\t\tlive map[int64]*livemdl.RoomInfo\n\t)\n\ti := 0\n\tfor _, his := range res {\n\t\ti++\n\t\t//由于出现过history吐出数量无限制,限制请求archive的数量逻辑保留\n\t\tif i > 80 {\n\t\t\tbreak\n\t\t}\n\t\tswitch his.TP {\n\t\tcase _tpOld, _tpOffline, _tpArchive:\n\t\t\taids = append(aids, his.Oid)\n\t\tcase _tpPGC:\n\t\t\taids = append(aids, his.Oid) //用cid拿时长duration\n\t\t\tepids = append(epids, his.Epid)\n\t\tcase _tpArticle:\n\t\t\tarticleIDs = append(articleIDs, his.Oid)\n\t\tcase _tpLive:\n\t\t\troomIDs = append(roomIDs, his.Oid)\n\t\tcase _tpCorpus:\n\t\t\tarticleIDs = append(articleIDs, his.Cid)\n\t\tdefault:\n\t\t\tlog.Warn(\"unknow history type(%d) msg(%+v)\", his.TP, his)\n\t\t}\n\t}\n\teg, ctx := errgroup.WithContext(c)\n\tif len(aids) > 0 {\n\t\teg.Go(func() (err error) {\n\t\t\tarchive, err = s.historyDao.Archive(ctx, aids)\n\t\t\tif err != nil {\n\t\t\t\tlog.Error(\"%+v\", err)\n\t\t\t\terr = nil\n\t\t\t}\n\t\t\treturn\n\t\t})\n\t}\n\tif len(epids) > 0 {\n\t\teg.Go(func() (err error) {\n\t\t\tpgcInfo, err = s.historyDao.PGC(ctx, xstr.JoinInts(epids), platform, build, mid)\n\t\t\tif err != nil {\n\t\t\t\tlog.Error(\"%+v\", err)\n\t\t\t\terr = nil\n\t\t\t}\n\t\t\treturn\n\t\t})\n\t}\n\tif len(articleIDs) > 0 {\n\t\teg.Go(func() (err error) {\n\t\t\tarticle, err = s.historyDao.Article(ctx, articleIDs)\n\t\t\tif err != nil {\n\t\t\t\tlog.Error(\"%+v\", err)\n\t\t\t\terr = nil\n\t\t\t}\n\t\t\treturn\n\t\t})\n\t}\n\tif len(roomIDs) > 0 {\n\t\teg.Go(func() (err error) {\n\t\t\tlive, err = s.liveDao.LiveByRIDs(ctx, roomIDs)\n\t\t\tif err != nil {\n\t\t\t\tlog.Error(\"%+v\", err)\n\t\t\t\terr = nil\n\t\t\t}\n\t\t\treturn\n\t\t})\n\t}\n\teg.Wait()\n\tfor _, his := range res {\n\t\t// 国际版不出直播\n\t\tif plat == model.PlatAndroidI && his.TP == _tpLive {\n\t\t\tcontinue\n\t\t}\n\t\ttmpInfo := &history.ListRes{\n\t\t\tGoto: gotoDesc[his.TP],\n\t\t\tViewAt: his.Unix,\n\t\t}\n\t\ttmpInfo.History.Oid = his.Oid\n\t\ttmpInfo.History.Tp = his.TP\n\t\ttmpInfo.History.Business = his.Business\n\t\tswitch his.TP {\n\t\tcase _tpOld, _tpOffline, _tpArchive:\n\t\t\tarc, ok := archive[his.Oid]\n\t\t\tif !ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\ttmpInfo.Title = arc.Title\n\t\t\ttmpInfo.Cover = arc.Pic\n\t\t\ttmpInfo.Mid = arc.Author.Mid\n\t\t\ttmpInfo.Name = arc.Author.Name\n\t\t\ttmpInfo.Progress = his.Pro\n\t\t\ttmpInfo.Videos = arc.Videos\n\t\t\tfor _, p := range arc.Pages {\n\t\t\t\tif p.Cid == his.Cid {\n\t\t\t\t\ttmpInfo.Duration = p.Duration\n\t\t\t\t\ttmpInfo.History.Cid = p.Cid\n\t\t\t\t\ttmpInfo.History.Page = p.Page\n\t\t\t\t\ttmpInfo.History.Part = p.Part\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\ttmpInfo.URI = model.FillURI(tmpInfo.Goto, strconv.FormatInt(his.Oid, 10), model.AvHandler(arc.Archive3))\n\t\tcase _tpPGC:\n\t\t\tpgc, okPGC := pgcInfo[his.Epid]\n\t\t\tarc, okArc := archive[his.Oid]\n\t\t\tif !okPGC || !okArc {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\ttmpInfo.Title = pgc.Title\n\t\t\ttmpInfo.ShowTitle = pgc.ShowTitle\n\t\t\ttmpInfo.Cover = pgc.Cover\n\t\t\ttmpInfo.Badge = badge[his.STP]\n\t\t\ttmpInfo.Progress = his.Pro\n\t\t\ttmpInfo.URI = model.FillURI(tmpInfo.Goto, strconv.FormatInt(his.Sid, 10), nil)\n\t\t\tfor _, p := range arc.Pages {\n\t\t\t\tif p.Cid == his.Cid {\n\t\t\t\t\ttmpInfo.Duration = p.Duration\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\tcase _tpArticle:\n\t\t\tart, ok := article[his.Oid]\n\t\t\tif !ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\ttmpInfo.Title = art.Title\n\t\t\ttmpInfo.Covers = art.ImageURLs\n\t\t\ttmpInfo.Mid = art.Author.Mid\n\t\t\ttmpInfo.Name = art.Author.Name\n\t\t\ttmpInfo.Badge = \"专栏\"\n\t\t\ttmpInfo.URI = model.FillURI(tmpInfo.Goto, strconv.FormatInt(his.Oid, 10), nil)\n\t\tcase _tpLive:\n\t\t\tlv, ok := live[his.Oid]\n\t\t\tif !ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\ttmpInfo.Title = lv.Title\n\t\t\ttmpInfo.Cover = lv.UserCover\n\t\t\tif lv.UserCover == \"\" {\n\t\t\t\ttmpInfo.Cover = lv.Cover\n\t\t\t}\n\t\t\ttmpInfo.Mid = lv.Mid\n\t\t\ttmpInfo.Name = lv.Name\n\t\t\ttmpInfo.TagName = lv.TagName\n\t\t\tif lv.Status == 1 { //1是直播中,0、2是未开播\n\t\t\t\ttmpInfo.LiveStatus = 1\n\t\t\t}\n\t\t\tif model.IsAndroid(plat) && build < _androidBroadcast {\n\t\t\t\tlv = nil\n\t\t\t}\n\t\t\ttmpInfo.URI = model.FillURI(tmpInfo.Goto, strconv.FormatInt(his.Oid, 10), model.LiveHandler(lv))\n\t\tcase _tpCorpus:\n\t\t\tart, ok := article[his.Cid]\n\t\t\tif !ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\ttmpInfo.Title = art.Title\n\t\t\ttmpInfo.Covers = art.ImageURLs\n\t\t\ttmpInfo.Mid = art.Author.Mid\n\t\t\ttmpInfo.Name = art.Author.Name\n\t\t\ttmpInfo.Badge = \"专栏\"\n\t\t\ttmpInfo.URI = model.FillURI(\"article\", strconv.FormatInt(his.Cid, 10), nil)\n\t\tdefault:\n\t\t\tcontinue\n\t\t}\n\t\tdata = append(data, tmpInfo)\n\t}\n\treturn\n}", "title": "" }, { "docid": "eb2efbb5f0b07f478384092279b81126", "score": "0.46702442", "text": "func CurrentHeight(name string) uint32 {\n coin := Config.GetCoin(name)\n // Caches currentHeight for 10 seconds.\n if coin.CurrentHeightTime == 0 ||\n coin.CurrentHeightTime+CURRENT_HEIGHT_CACHE_SEC < time.Now().Unix() {\n currentHeight := rpc.GetCurrentHeight(coin.Name)\n coin.CurrentHeight = currentHeight\n coin.CurrentHeightTime = time.Now().Unix()\n }\n return coin.CurrentHeight;\n}", "title": "" }, { "docid": "28b6733e6c7bf41fb07401173ce00835", "score": "0.46687898", "text": "func (cc CoinCap) GetHistory(baseID, interval string, timeFrom, timeTo int64) (history []CCHistoryItem, err error) {\n\tbaseID = strings.ToLower(strings.Join(strings.Split(baseID, \" \"), \"-\"))\n\turl := fmt.Sprintf(\"%s/assets/%s/history?interval=%s&start=%d&end=%d\",\n\t\tcc.BaseURL, baseID, interval, timeFrom, timeTo)\n\tresponse, err := http.Get(url)\n\tif err != nil {\n\t\treturn\n\t}\n\tresult := struct {\n\t\tError string `json:\"error\"`\n\t\tData []CCHistoryItem `json:\"Data\"`\n\t}{}\n\terr = json.NewDecoder(response.Body).Decode(&result)\n\tif err != nil {\n\t\treturn\n\t}\n\tif result.Error != \"\" {\n\t\terr = errors.New(result.Error)\n\t\treturn\n\t}\n\thistory = result.Data\n\treturn\n}", "title": "" }, { "docid": "ab861a2c0c96895160a6322fc4f5e8ba", "score": "0.46625775", "text": "func (c *CloudWatch) DescribeAlarmHistory(req *DescribeAlarmHistoryInput) (resp *DescribeAlarmHistoryResult, err error) {\n\tresp = &DescribeAlarmHistoryResult{}\n\terr = c.client.Do(\"DescribeAlarmHistory\", \"POST\", \"/\", req, resp)\n\treturn\n}", "title": "" }, { "docid": "03daf72e14fffb8d1d324631197133d8", "score": "0.46540606", "text": "func (t *HeathCare_Chaincode) historyQuery(stub shim.ChaincodeStubInterface, args []string) pb.Response {\n\tfmt.Println(\"\\n=============== start historyQuery function ===============\")\n\tstart := time.Now()\n\ttime.Sleep(time.Second)\n\n\t// check require argument\n\tif len(args) != 1 {\n\t\treturn shim.Error(\"expecting 1 argument\")\n\t}\n\n\tfor i := 0; i < len(args); i++ {\n\t\tif len(args[i]) == 0 {\n\t\t\treturn shim.Error(\"argument \" + strconv.Itoa(i+1) + \" must be delare\")\n\t\t}\n\t}\n\n\t//define argument\n\tuserid := args[0]\n\n\t//query\n\tqueryDataAsBytes, errQueryDataAsByte := stub.GetPrivateData(\"queryCollection\", userid)\n\tif errQueryDataAsByte != nil {\n\t\treturn shim.Error(\"cannot get data of query\")\n\t} else if queryDataAsBytes == nil {\n\t\treturn shim.Error(\"query data history does not exist\")\n\t}\n\n\tend := time.Now()\n\telapsed := time.Since(start)\n\n\tfmt.Println(\"\\nfunction historyQuery\")\n\tfmt.Println(\"time start: \", start.String())\n\tfmt.Println(\"time end: \", end.String())\n\tfmt.Println(\"time execute: \", elapsed.String())\n\tfmt.Println(\"=============== end historyQuery function ===============\")\n\ttime.Sleep(time.Second)\n\n\treturn shim.Success(queryDataAsBytes)\n}", "title": "" }, { "docid": "7f9ba48933d20e5212a1fe936ce47d37", "score": "0.46540576", "text": "func (c cacheProvider) GetByHeight(h int) (fc FullCommit, err error) {\n\tfor _, p := range c.Providers {\n\t\tvar tfc FullCommit\n\t\ttfc, err = p.GetByHeight(h)\n\t\tif err == nil {\n\t\t\tif tfc.Height() > fc.Height() {\n\t\t\t\tfc = tfc\n\t\t\t}\n\t\t\tif tfc.Height() == h {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\t// even if the last one had an error, if any was a match, this is good\n\tif fc.Height() > 0 {\n\t\terr = nil\n\t}\n\treturn fc, err\n}", "title": "" }, { "docid": "ba7294506f16e8d02cddb8d81bb568b6", "score": "0.46424952", "text": "func GetHistoriesByBystanders(bystanders int , o orm.Ormer , comparator int) ([] *models.History){\n\tvar histories []*models.History\n\tcomparatorStr := \"\"\n\tif (comparator==0){\n\t\tcomparatorStr = \"=\"\n\t} else if (comparator>0){\n\t\tcomparatorStr = \">\"\n\t}else {\n\t\tcomparatorStr = \"<\"\n\t}\n\tnum , err := o.Raw(\"SELECT * FROM history WHERE bystanders \" + comparatorStr + \" ?\" , bystanders).QueryRows(&histories)\n\tif (err ==nil){\n\t\tfmt.Println(\"histories nums: \" , num)\n\t}\n\treturn histories\n}", "title": "" }, { "docid": "92dacd958be173989108df11f1be0752", "score": "0.4635262", "text": "func (db *Database) QueryAssetChartHistory(asset string, limit int) ([]schema.StatAssetInfoList1H, error) {\n\tchartHistory := make([]schema.StatAssetInfoList1H, 0)\n\n\terr := db.Model(&chartHistory).\n\t\tWhere(\"asset = ?\", asset).\n\t\tLimit(limit).\n\t\tOrder(\"id DESC\").\n\t\tSelect()\n\n\tif err == pg.ErrNoRows {\n\t\treturn chartHistory, fmt.Errorf(\"no rows in block table: %s\", err)\n\t}\n\n\tif err != nil {\n\t\treturn chartHistory, fmt.Errorf(\"unexpected database error: %s\", err)\n\t}\n\n\treturn chartHistory, nil\n}", "title": "" }, { "docid": "a9f22583c9df4eabcd7e0446f6a4c119", "score": "0.4616117", "text": "func (sc *LoanDocContract) History(ctx contractapi.TransactionContextInterface, key string) ([]LoanDocHistory, error) {\n\n\titer, err := ctx.GetStub().GetHistoryForKey(key)\n\tif err != nil {\n return nil, err\n\t}\n\tdefer func() { _ = iter.Close() }()\n\n\tvar results []LoanDocHistory\n\tfor iter.HasNext() {\n\t\tstate, err := iter.Next()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tentryObj := new(LoanDocObj)\n\t\tif errNew := json.Unmarshal(state.Value, entryObj); errNew != nil {\n\t\t\treturn nil, errNew\n\t\t}\n\n\t\tentry := LoanDocHistory{\n\t\t\tTxID:\t\tstate.GetTxId(),\n\t\t\tTimestamp:\ttime.Unix(state.GetTimestamp().GetSeconds(), 0),\n\t\t\tLoanDoc:\tentryObj,\n\t\t}\n\n\t\tresults = append(results, entry)\n\t}\n\treturn results, nil\n}", "title": "" }, { "docid": "ce5a637b32c0cee7cecfb8462811bfc3", "score": "0.46071124", "text": "func (env *Environment) getHeight(latestHeight int64, heightPtr *int64) (int64, error) {\n\tif heightPtr != nil {\n\t\theight := *heightPtr\n\t\tif height <= 0 {\n\t\t\treturn 0, fmt.Errorf(\"%w (requested height: %d)\", coretypes.ErrZeroOrNegativeHeight, height)\n\t\t}\n\t\tif height > latestHeight {\n\t\t\treturn 0, fmt.Errorf(\"%w (requested height: %d, blockchain height: %d)\",\n\t\t\t\tcoretypes.ErrHeightExceedsChainHead, height, latestHeight)\n\t\t}\n\t\tbase := env.BlockStore.Base()\n\t\tif height < base {\n\t\t\treturn 0, fmt.Errorf(\"%w (requested height: %d, base height: %d)\", coretypes.ErrHeightNotAvailable, height, base)\n\t\t}\n\t\treturn height, nil\n\t}\n\treturn latestHeight, nil\n}", "title": "" }, { "docid": "bc66d463c078cd7f49cde45a11508379", "score": "0.46062928", "text": "func (c *BalanceClient) History() (*BalanceTransactionListResponse, error) {\n\treturn c.HistoryWithFilters(Filters{})\n}", "title": "" }, { "docid": "1099fab98acd461027e713341c892b3f", "score": "0.46045086", "text": "func handleHistory(w http.ResponseWriter, r *http.Request) {\r\n\tc := appengine.NewContext(r)\r\n\tparentKey := helpers.GetActivityTableKeyByUser(c)\r\n\r\n\tq := datastore.NewQuery(\"activityRecord\").Ancestor(parentKey)\r\n\t//q = q.Filter()\r\n\tq = q.Order(\"-TimeStamp\")\r\n\tdst := []helpers.ActivityLog{}\r\n\tq.GetAll(c, &dst)\r\n\r\n\tt := template.Must(template.ParseFiles(\r\n\t\t\"html/history.html\",\r\n\t\t\"html/_ActivityList.html\",\r\n\t\t\"html/_SvgButtons.html\",\r\n\t\t\"html/_mdl.html\",\r\n\t\t\"html/_footer.html\",\r\n\t\t\"html/_header.html\",\r\n\t))\r\n\r\n\ta := helpers.HomePgData{user.Current(c).String(), dst}\r\n\r\n\tif err := t.Execute(w, a); err != nil {\r\n\t\tpanic(err)\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "0a212a053ad719f41bb55eb668c4114a", "score": "0.46019152", "text": "func (_EthCrossChain *EthCrossChainSession) LatestBookKeeperHeight() (uint64, error) {\n\treturn _EthCrossChain.Contract.LatestBookKeeperHeight(&_EthCrossChain.CallOpts)\n}", "title": "" }, { "docid": "b4ef801e31686d6a9ea800956ea316a0", "score": "0.45981225", "text": "func (s *SmartContract) GetProductHistory(ctx contractapi.TransactionContextInterface, args []string) error {\n\n\tfmt.Printf(\"In getproducthistory Function\")\n\n\tif len(args) < 1 {\n\t\tfmt.Printf(\"In getproducthistory Error Function\")\n\t\treturn fmt.Errorf(\"Incorrect number of arguments. Expecting 1\")\n\t}\n\n\tSerialNo := args[0]\n\n\tfmt.Printf(\"- start getHistoryForWatch: %s\\n\", SerialNo)\n\n\tresultsIterator, err := ctx.GetStub().GetHistoryForKey(SerialNo)\n\n\tif err != nil {\n\t\treturn fmt.Errorf(err.Error())\n\t}\n\tdefer resultsIterator.Close()\n\n\t// buffer is a JSON array containing historic values for the marble\n\tvar buffer bytes.Buffer\n\n\tbuffer.WriteString(\"[\")\n\n\tbArrayMemberAlreadyWritten := false\n\tfor resultsIterator.HasNext() {\n\t\tresponse, err := resultsIterator.Next()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(err.Error())\n\t\t}\n\t\t// Add a comma before array members, suppress it for the first array member\n\t\tif bArrayMemberAlreadyWritten == true {\n\t\t\tbuffer.WriteString(\",\")\n\t\t}\n\t\tbuffer.WriteString(\"{\\\"TxId\\\":\")\n\t\tbuffer.WriteString(\"\\\"\")\n\t\tbuffer.WriteString(response.TxId)\n\t\tbuffer.WriteString(\"\\\"\")\n\n\t\tbuffer.WriteString(\", \\\"Value\\\":\")\n\t\t// if it was a delete operation on given key, then we need to set the\n\t\t//corresponding value null. Else, we will write the response.Value\n\t\t//as-is (as the Value itself a JSON marble)\n\t\tif response.IsDelete {\n\t\t\tbuffer.WriteString(\"null\")\n\t\t} else {\n\t\t\tbuffer.WriteString(string(response.Value))\n\t\t}\n\n\t\tbuffer.WriteString(\", \\\"Timestamp\\\":\")\n\t\tbuffer.WriteString(\"\\\"\")\n\t\tbuffer.WriteString(time.Unix(response.Timestamp.Seconds, int64(response.Timestamp.Nanos)).String())\n\t\tbuffer.WriteString(\"\\\"\")\n\n\t\tbuffer.WriteString(\", \\\"IsDelete\\\":\")\n\t\tbuffer.WriteString(\"\\\"\")\n\t\tbuffer.WriteString(strconv.FormatBool(response.IsDelete))\n\t\tbuffer.WriteString(\"\\\"\")\n\n\t\tbuffer.WriteString(\"}\")\n\t\tbArrayMemberAlreadyWritten = true\n\t}\n\tbuffer.WriteString(\"]\")\n\n\tfmt.Printf(\"- getHistoryForMarble returning:\\n%s\\n\", buffer.String())\n\n\treturn ctx.GetStub().PutState(args[0], buffer.Bytes())\n}", "title": "" }, { "docid": "a9ec07c10987bae0d729bdce242dbfda", "score": "0.4597056", "text": "func (i *Idasen) GetCurrentHeight(ctx context.Context) (int, error) {\n\tconst (\n\t\tserviceUUID = \"99fa0020-338a-1024-8a49-009c0215f78a\"\n\t\tcharacteristicsUUID = \"99fa0021-338a-1024-8a49-009c0215f78a\"\n\t)\n\n\tsvcUUID, err := bluetooth.ParseUUID(serviceUUID)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"could not parse the service UUID: %v\", err)\n\t}\n\n\tcharUUID, err := bluetooth.ParseUUID(characteristicsUUID)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"could not parse the characteristics UUID: %v\", err)\n\t}\n\n\thuuid := bluetooth.CharacteristicUUIDHeight\n\t_ = huuid\n\n\tsvc, err := i.dev.DiscoverServices([]bluetooth.UUID{svcUUID})\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"could not discover services: %v\", err)\n\t}\n\n\tchar, err := svc[0].DiscoverCharacteristics([]bluetooth.UUID{charUUID})\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"could not discover the characteristic %s: %v\", charUUID, err)\n\t}\n\n\tvar rawHeight uint32\n\n\tif err = binary.Read(&char[0], binary.LittleEndian, &rawHeight); err != nil {\n\t\treturn 0, fmt.Errorf(\"could not read the raw height: %v\", err)\n\t}\n\n\treturn int(float64(baseHeight) + float64(rawHeight/ 100)), nil\n}", "title": "" }, { "docid": "8bacb6e3e7ca0eaf12cfdaaaf85aa2d8", "score": "0.45884252", "text": "func (c *SizesListCall) Height(height int64) *SizesListCall {\n\tc.urlParams_.Set(\"height\", fmt.Sprint(height))\n\treturn c\n}", "title": "" }, { "docid": "b24decdbca6b1ab8a4464c9b4208d113", "score": "0.45877182", "text": "func (c *TempController) GetHistoricalTemperatures(w http.ResponseWriter, req *http.Request) {\n\tearliest := time.Unix(0, 0)\n\tlatest := time.Now()\n\tscale := model.CELSIUS\n\n\t//reusable error\n\tvar err error\n\n\t//query params: earliest, latest\n\tq := req.URL.Query()\n\te := q.Get(\"earliest\")\n\tl := q.Get(\"latest\")\n\tscaleText := q.Get(\"scale\")\n\n\tif len(e) > 0 {\n\t\tearliest, err = time.Parse(NARROW_RFC3339, e) //use a narrowed RFC3339 for usability, precision not necessary\n\t}\n\n\tif len(l) > 0 {\n\t\tlatest, err = time.Parse(NARROW_RFC3339, l)\n\t}\n\n\tif len(scaleText) > 0 {\n\t\tscale = model.StringToScale(scaleText)\n\t}\n\n\t//error checks before db lookup\n\tif (err != nil) {\n\t\trespondMessage(http.StatusBadRequest, w, fmt.Sprintf(\"Error parsing 'earliest' or 'latest' query parameters. Expected date format %v. Error: %v\", NARROW_RFC3339, err))\n\t\treturn\n\t}\n\n\ttempSummary := db.GetTempHistForDateRange(scale, earliest, latest)\n\n\tw.Header().Set(\"Content-Type\", \"application/json; charset=UTF-8\")\n\tw.WriteHeader(http.StatusOK)\n\n\tif err := json.NewEncoder(w).Encode(tempSummary); err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "93d7235b365e48e0edf29c6d516309e2", "score": "0.45851326", "text": "func (t *MedChain) getHistory(stub shim.ChaincodeStubInterface, recordKey string) []byte {\n\n\t\tfmt.Printf(\"- start getHistory: %s\\n\", recordKey)\n\n\t\tresultsIterator, err := stub.GetHistoryForKey(recordKey)\n\t\tif err != nil {\n\t\t\terrors.New(err.Error())\n\t\t//\treturn shim.Error(err.Error())\n\t\t}\n\t\tdefer resultsIterator.Close()\n\n\t\t// buffer is a JSON array containing historic values for the key/value pair\n\t\tvar buffer bytes.Buffer\n\t\tbuffer.WriteString(\"[\")\n\n\t\tbArrayMemberAlreadyWritten := false\n\t\tfor resultsIterator.HasNext() {\n\t\t\tresponse, err := resultsIterator.Next()\n\t\t\tif err != nil {\n\t\t\t\terrors.New(err.Error())\n\t\t\t\t//return shim.Error(err.Error())\n\t\t\t}\n\t\t\t// Add a comma before array members, suppress it for the first array member\n\t\t\tif bArrayMemberAlreadyWritten == true {\n\t\t\t\tbuffer.WriteString(\",\")\n\t\t\t}\n\t\t\tbuffer.WriteString(\"{\\\"TxId\\\":\")\n\t\t\tbuffer.WriteString(\"\\\"\")\n\t\t\tbuffer.WriteString(response.TxId)\n\t\t\tbuffer.WriteString(\"\\\"\")\n\n\t\t\tbuffer.WriteString(\", \\\"Value\\\":\")\n\t\t\t// if it was a delete operation on given key, then we need to set the\n\t\t\t//corresponding value null. Else, we will write the response.Value\n\t\t\t//as-is (as the Value itself a JSON vehiclePart)\n\t\t\tif response.IsDelete {\n\t\t\t\tbuffer.WriteString(\"null\")\n\t\t\t} else {\n\t\t\t\tbuffer.WriteString(string(response.Value))\n\t\t\t}\n\n\t\t\tbuffer.WriteString(\", \\\"Timestamp\\\":\")\n\t\t\tbuffer.WriteString(\"\\\"\")\n\t\t\tbuffer.WriteString(time.Unix(response.Timestamp.Seconds, int64(response.Timestamp.Nanos)).String())\n\t\t\tbuffer.WriteString(\"\\\"\")\n\n\t\t\tbuffer.WriteString(\", \\\"IsDelete\\\":\")\n\t\t\tbuffer.WriteString(\"\\\"\")\n\t\t\tbuffer.WriteString(strconv.FormatBool(response.IsDelete))\n\t\t\tbuffer.WriteString(\"\\\"\")\n\n\t\t\tbuffer.WriteString(\"}\")\n\t\t\tbArrayMemberAlreadyWritten = true\n\t\t}\n\t\tbuffer.WriteString(\"]\")\n\n\t\tfmt.Printf(\"- getHistoryForRecord returning:\\n%s\\n\", buffer.String())\n\n\t\treturn buffer.Bytes()\n\t}", "title": "" }, { "docid": "1f3579ee6771d81307f1a54e7d056915", "score": "0.45809114", "text": "func getQueryHistory(w http.ResponseWriter, req *http.Request) {\n\tr := render.New(render.Options{})\n\tdbHandler := core.GetDBHandler()\n\tsearch := req.URL.Query().Get(\"search[value]\")\n\tstart, _ := strconv.Atoi(req.URL.Query().Get(\"start\"))\n\tdraw, _ := strconv.Atoi(req.URL.Query().Get(\"draw\"))\n\tlength, _ := strconv.Atoi(req.URL.Query().Get(\"length\"))\n\tresponse, err := dbHandler.GetDNSQueryHistory(start, length, search)\n\tif err != nil {\n\t\tr.JSON(w, http.StatusOK, map[string]interface{}{\n\t\t\t\"error\": err.Error(),\n\t\t})\n\t\treturn\n\t}\n\tr.JSON(w, http.StatusOK, map[string]interface{}{\n\t\t\"draw\": draw,\n\t\t\"data\": response,\n\t})\n}", "title": "" }, { "docid": "6da4104464eee9d755e5bf8be331dfc4", "score": "0.45730925", "text": "func History(ctx context.Context, nameOrID string, options *HistoryOptions) ([]*types.HistoryResponse, error) {\n\tif options == nil {\n\t\toptions = new(HistoryOptions)\n\t}\n\t_ = options\n\tvar history []*types.HistoryResponse\n\tconn, err := bindings.GetClient(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresponse, err := conn.DoRequest(ctx, nil, http.MethodGet, \"/images/%s/history\", nil, nil, nameOrID)\n\tif err != nil {\n\t\treturn history, err\n\t}\n\tdefer response.Body.Close()\n\n\treturn history, response.Process(&history)\n}", "title": "" }, { "docid": "ff083eaa38d17a5924589da0af8aa5f4", "score": "0.45720872", "text": "func (d *Dao) HistoryList(c context.Context, mid, aid int64, ip string) (historys []*archive.ArcHistory, err error) {\n\tparams := url.Values{}\n\tparams.Set(\"aid\", strconv.FormatInt(aid, 10))\n\tparams.Set(\"mid\", strconv.FormatInt(mid, 10))\n\tvar res struct {\n\t\tCode int `json:\"code\"`\n\t\tData []*archive.ArcHistory `json:\"data\"`\n\t}\n\tif err = d.client.Get(c, d.hList, ip, params, &res); err != nil {\n\t\tlog.Error(\"archive.HistoryList url(%s) mid(%d) error(%v)\", d.hList+\"?\"+params.Encode(), mid, err)\n\t\terr = ecode.CreativeArchiveAPIErr\n\t\treturn\n\t}\n\tif res.Code != 0 {\n\t\tlog.Error(\"archive.HistoryList url(%s) mid(%d) res(%v)\", d.hList+\"?\"+params.Encode(), mid, res)\n\t\terr = ecode.CreativeArchiveAPIErr\n\t\treturn\n\t}\n\thistorys = res.Data\n\treturn\n}", "title": "" }, { "docid": "01cc170adf4f33ed3bff05506aeca59b", "score": "0.45682967", "text": "func (f *ReleaseStoreGetArtifactsFunc) History() []ReleaseStoreGetArtifactsFuncCall {\n\tf.mutex.Lock()\n\thistory := make([]ReleaseStoreGetArtifactsFuncCall, len(f.history))\n\tcopy(history, f.history)\n\tf.mutex.Unlock()\n\n\treturn history\n}", "title": "" }, { "docid": "ab845e281ca60aea09cdca267fc0d810", "score": "0.4560406", "text": "func (st *DBstore) GetHistoricalConfiguration(ctx context.Context, orgID int64, id int64) (*models.HistoricAlertConfiguration, error) {\n\tvar config models.HistoricAlertConfiguration\n\tif err := st.SQLStore.WithDbSession(ctx, func(sess *db.Session) error {\n\t\tok, err := sess.Table(\"alert_configuration_history\").\n\t\t\tWhere(\"id = ? AND org_id = ?\", id, orgID).\n\t\t\tGet(&config)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif !ok {\n\t\t\treturn ErrNoAlertmanagerConfiguration\n\t\t}\n\t\treturn nil\n\t}); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &config, nil\n}", "title": "" }, { "docid": "9d05c74e85282e3bbd8f8d81730416b8", "score": "0.45597914", "text": "func get_history(stub shim.ChaincodeStubInterface, args []string) pb.Response {\n\tif len(args) != 1 {\n\t\treturn shim.Error(\"Incorrect number of arguments. Expecting 1\")\n\t}\n\n\tkey := args[0]\n\tfmt.Printf(\"- start getHistory: %s\\n\", key)\n\n\t// Get History\n\tresultsIterator, err := stub.GetHistoryForKey(key)\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\tdefer resultsIterator.Close()\n\n\tresults, err := ConvHistoryResult(resultsIterator)\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\tfmt.Println(\"end getHistory\")\n\n\treturn shim.Success(results)\n}", "title": "" }, { "docid": "45871f8e7d3864a5e383a23900e222a4", "score": "0.45538837", "text": "func (t *SimpleChaincode) queryHist(stub shim.ChaincodeStubInterface, args []string) pb.Response {\n\tvar A string // Entities\n\tvar err error\n\n\tif len(args) != 1 {\n\t\treturn shim.Error(\"Incorrect number of arguments. Expecting name of the person to query\")\n\t}\n\n\tA = args[0]\n\n\t// Get the state from the ledger\n\t//Avalbytes, err := stub.GetState(A)\n\tAvalbytes, err := stub.GetHistoryForKey(A)\n\n\tsentaraVal := sentara{}\n\n\tif err != nil {\n\t\tjsonResp := \"{\\\"Error\\\":\\\"Failed to get state for \" + A + \"\\\"}\"\n\t\treturn shim.Error(jsonResp)\n\t}\n\n\tif Avalbytes == nil {\n\t\tjsonResp := \"{\\\"Error\\\":\\\"Nil amount for \" + A + \"\\\"}\"\n\t\treturn shim.Error(jsonResp)\n\t}\n\n\tif singErr := json.Unmarshal(Avalbytes, &sentaraVal); singErr != nil {\n\t\treturn shim.Error(\"Data structure is not recognized\")\n\t}\n\tjsonResp := \"{\\\"SingleName\\\":\\\"\" + A + \"\\\",\\\"Amount\\\":\\\"\" + sentaraVal.Message +\" \"+ sentaraVal.Message + \"\\\"}\"\n\tfmt.Printf(\"Query Response:%s\\n\", jsonResp)\n\n\treturn shim.Success(Avalbytes)\n\n}", "title": "" }, { "docid": "6eb3513822c57bcecf2cc0451eec3047", "score": "0.4553256", "text": "func (s *SmartContract) getHistoryForAuditLogKey(APIstub shim.ChaincodeStubInterface, args []string) sc.Response {\n\n\tif len(args) < 1 {\n\t\treturn shim.Error(\"Incorrect number of arguments.\")\n\t}\n\n\tresultsIterator, err := APIstub.GetHistoryForKey(args[0])\n\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\n\tdefer resultsIterator.Close()\n\n\tbuffer := buildTimeLine(resultsIterator)\n\n\tfmt.Printf(\"- getHistoryForAuditKey returning:\\n%s\\n\", buffer.String())\n\n\treturn shim.Success(buffer.Bytes())\n\n}", "title": "" }, { "docid": "6e73239668659b7423dace651f3bceee", "score": "0.4552429", "text": "func read_smart_history_table() {\r\n\tvar buffer string\r\n\r\n\tnum_hist = 0\r\n db, err := sql.Open(\"mysql\", mysql_connect_string)\r\n if err != nil {\r\n\t\tstatus_info.status_code = 1\r\n\t\tstatus_info.error_message = \"database error. failed to connect\"\r\n\t\tbuffer = fmt.Sprintf(\"%q\",err)\r\n\t\tstatus_info.error_details = buffer\r\n\t\tsend_response()\r\n }\r\n if err := db.Ping(); err != nil {\r\n\t\tstatus_info.status_code = 1\r\n\t\tstatus_info.error_message = \"database error. failed to ping\"\r\n\t\tbuffer = fmt.Sprintf(\"%q\",err)\r\n\t\tstatus_info.error_details = buffer\r\n\t\tsend_response()\r\n }\r\n\r\n\tquery := `select id,mod_date,user1,user1_balance bal1,user2,user2_balance bal2,operation,status,amount,void_date,\r\n(select username from smart_users where id = h.user1) name1,\r\n(select username from smart_users where id = h.user2) name2\r\nfrom smart_users_history h`\r\n\r\n\tresults, err := db.Query(query)\r\n if err != nil {\r\n\t\tstatus_info.status_code = 1\r\n\t\tstatus_info.error_message = \"database error. Query failed\"\r\n\t\tbuffer = fmt.Sprintf(\"%q\",err)\r\n\t\tstatus_info.error_details = buffer\r\n\t\tsend_response()\r\n\t}\r\n\r\n\tfor results.Next() {\r\n\t\tnum_hist += 1\r\n\t\terr = results.Scan(&trans_rec.id,&trans_rec.mod_date,&trans_rec.user1,&trans_rec.user1_balance,\r\n\t\t\t\t\t&trans_rec.user2,&trans_rec.user2_balance,&trans_rec.operation,&trans_rec.status,\r\n\t\t\t\t\t&trans_rec.amount,&trans_rec.void_date,&trans_rec.name1,&trans_rec.name2)\r\n\t\tif err != nil {\r\n\t\t\tstatus_info.status_code = 1\r\n\t\t\tstatus_info.error_message = \"database error. failed to scan record data\"\r\n\t\t\tbuffer = fmt.Sprintf(\"%q\",err)\r\n\t\t\tstatus_info.error_details = buffer\r\n\t\t\tsend_response()\r\n\t\t}\r\n\t\thistory = append(history,trans_rec)\r\n\t} // FOR\r\n\r\n\treturn\r\n}", "title": "" }, { "docid": "d23a2482672fa4707978455111abd1ab", "score": "0.45520198", "text": "func (c *Client) History(asset int) *HistoryService {\n\treturn &HistoryService{service{c}, asset}\n}", "title": "" }, { "docid": "36937923cb932bbc8c63f834847ea22e", "score": "0.4546042", "text": "func GetHistoricalPrices(baseURL string, symbol string, timeframe string, limit int) []t.HistoricalPrice {\n\tvar url strings.Builder\n\n\tfmt.Fprintf(&url, \"%s/klines?symbol=%s&interval=%s&limit=%d\", baseURL, symbol, timeframe, limit)\n\tdata, err := h.Get(url.String())\n\tif err != nil {\n\t\treturn nil\n\t}\n\n\tvar hPrices []t.HistoricalPrice\n\tfor _, data := range gjson.ParseBytes(data).Array() {\n\t\td := data.Array()\n\t\tp := t.HistoricalPrice{\n\t\t\tSymbol: symbol,\n\t\t\tTime: d[0].Int(),\n\t\t\tOpen: d[1].Float(),\n\t\t\tHigh: d[2].Float(),\n\t\t\tLow: d[3].Float(),\n\t\t\tClose: d[4].Float(),\n\t\t}\n\t\thPrices = append(hPrices, p)\n\t}\n\treturn hPrices\n}", "title": "" }, { "docid": "61b626faf2bd9bc9b7d32926c8bf0f7e", "score": "0.45448998", "text": "func GetHeight(hostURL string, hostPort int) *bytes.Buffer {\n\treturn makeGetRequest(\"getheight\", hostURL, hostPort)\n}", "title": "" }, { "docid": "dd827c33cb33ac49589f201b11ca8afc", "score": "0.45232305", "text": "func (r Virtual_Host) GetLiveGuestRecentMetricData(uuid *string, time *int, limit *int, interval *int) (resp []datatypes.Metric_Tracking_Object, err error) {\n\tparams := []interface{}{\n\t\tuuid,\n\t\ttime,\n\t\tlimit,\n\t\tinterval,\n\t}\n\terr = r.Session.DoRequest(\"SoftLayer_Virtual_Host\", \"getLiveGuestRecentMetricData\", params, &r.Options, &resp)\n\treturn\n}", "title": "" }, { "docid": "2da272ef9778dad91c2dcd143c6857ab", "score": "0.45123002", "text": "func GetPlayerHistoriesByPlayerId(playerId int , o orm.Ormer) ([]*models.History){\n\tvar histories []*models.History\n\tnum , err := o.Raw(\"SELECT * FROM history WHERE player1_id = ? OR player2_id = ?\" , playerId , playerId).QueryRows(&histories)\n\tif (err ==nil){\n\t\tfmt.Println(\"histories nums: \" , num)\n\t}\n\treturn histories\n}", "title": "" }, { "docid": "cc0c9384e2f13df2f3b8f4527a2da860", "score": "0.45082134", "text": "func (iUpdateSearcher *IUpdateSearcher) QueryHistory(startIndex int32, count int32) ([]*IUpdateHistoryEntry, error) {\n\tupdateHistoryEntriesDisp, err := oleconv.ToIDispatchErr(oleutil.CallMethod(iUpdateSearcher.disp, \"QueryHistory\", startIndex, count))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn toIUpdateHistoryEntries(updateHistoryEntriesDisp)\n}", "title": "" }, { "docid": "0feac03c991378c97d235073164bd59b", "score": "0.45028186", "text": "func (client *Client) QueryTaskDetailHistory(request *QueryTaskDetailHistoryRequest) (response *QueryTaskDetailHistoryResponse, err error) {\n\tresponse = CreateQueryTaskDetailHistoryResponse()\n\terr = client.DoAction(request, response)\n\treturn\n}", "title": "" }, { "docid": "a8066f439b447378ea97d97418095c8f", "score": "0.449858", "text": "func (o *WorkbookChart) HasHeight() bool {\n\tif o != nil && o.Height != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "b8dddedfbbfd7ea9e416ac8f608a8af3", "score": "0.44949293", "text": "func (h *History) GetLine(idx int) string {\n return h.histories[idx]\n}", "title": "" }, { "docid": "7d816cd0034a287bcdf2f60db95d034d", "score": "0.4493833", "text": "func (b *BarChart) BarHeight(i int) float64 {\n\n// fmt.Println (\" BarHeight start i\" ,i)\n\n\tht := 0.0\n\tif b == nil {\n\n//\t ht= ht + 2.\n\n//\t fmt.Println (\" BarHeight ht \" ,ht )\n\n\t\treturn ht\n\t}\n\tif i >= 0 && i < len(b.Values) {\n\t\tht += b.Values[i]\n\t}\n\tif b.stackedOn != nil {\n\t\tht += b.stackedOn.BarHeight(i)\n\t}\n\n//\tfmt.Println (\" BarHeight end\" )\n\n\treturn ht\n}", "title": "" }, { "docid": "fe85ef92b30ac8d760b4d3302d7d74d4", "score": "0.44896087", "text": "func (ac *AddressCache) HistoryChart(addr string, addrChart dbtypes.HistoryChart,\n\tchartGrouping dbtypes.TimeBasedGrouping) (*dbtypes.ChartsData, *BlockID) {\n\taci := ac.addressCacheItem(addr)\n\tif aci == nil {\n\t\tac.cacheMetrics.historyMiss()\n\t\treturn nil, nil\n\t}\n\n\tcd, blockID := aci.HistoryChart(addrChart, chartGrouping)\n\tif cd == nil || blockID == nil {\n\t\tac.cacheMetrics.historyMiss()\n\t\treturn nil, nil\n\t}\n\n\tac.cacheMetrics.historyHit()\n\treturn cd, blockID\n}", "title": "" }, { "docid": "08994e5d3f63e19233d6631fad814913", "score": "0.4486684", "text": "func (f *DBStoreSelectRepositoriesForRetentionScanFunc) History() []DBStoreSelectRepositoriesForRetentionScanFuncCall {\n\tf.mutex.Lock()\n\thistory := make([]DBStoreSelectRepositoriesForRetentionScanFuncCall, len(f.history))\n\tcopy(history, f.history)\n\tf.mutex.Unlock()\n\n\treturn history\n}", "title": "" }, { "docid": "f06de7bfc2113756f59671772943a09d", "score": "0.44792193", "text": "func HostInfo(endpoint string) (int, []byte) {\n\tbuffer := getEndpointwithHost(endpoint)\n\tstatus, data := hq.Get(buffer.String())\n\n\treturn status, data\n}", "title": "" }, { "docid": "d8e6f48206f58a6efa38ff956837d242", "score": "0.44766834", "text": "func (app *BandApp) LoadHeight(height int64) error {\n\treturn app.LoadVersion(height, app.keys[bam.MainStoreKey])\n}", "title": "" }, { "docid": "becc60bea6fefd2c16c3b7d98652162f", "score": "0.44757134", "text": "func (db *Database) QueryLatestBlockHeight() (int64, error) {\n\tvar block schema.Block\n\n\terr := db.Model(&block).\n\t\tColumn(\"height\").\n\t\tLimit(1).\n\t\tOrder(\"id DESC\").\n\t\tSelect()\n\n\tif err == pg.ErrNoRows {\n\t\treturn 0, fmt.Errorf(\"no rows in block table: %s\", err)\n\t}\n\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"unexpected database error: %s\", err)\n\t}\n\n\treturn block.Height, nil\n}", "title": "" }, { "docid": "2f4847e20f017dbe3a8aab6005856885", "score": "0.44721848", "text": "func (hub *Hub) preHandleNewHeightInfo(msgType string, bz []byte) {\n\tif msgType != \"height_info\" {\n\t\treturn\n\t}\n\n\tchainID := getChainID(bz)\n\tv := hub.parseHeightInfo(bz, chainID == hub.oldChainID)\n\tif v == nil {\n\t\treturn\n\t}\n\tif hub.currBlockHeight >= v.Height {\n\t\t//The incoming msg is lagging behind hub's internal state\n\t\thub.skipHeight = true\n\t\tlog.Info(fmt.Sprintf(\"Skipping Height %d<%d\\n\", hub.currBlockHeight, v.Height))\n\n\t\t// When receive new chain, reset height info and chain-id\n\t\tif v.ChainID != hub.oldChainID && v.Height == hub.upgradeHeight+1 {\n\t\t\thub.chainID = v.ChainID\n\t\t\thub.currBlockHeight = v.Height\n\t\t\thub.skipHeight = false\n\t\t}\n\t} else if hub.currBlockHeight+1 == v.Height {\n\t\t//The incoming msg catches up hub's internal state\n\t\thub.currBlockHeight = v.Height\n\t\thub.skipHeight = false\n\t\thub.chainID = v.ChainID\n\t} else {\n\t\t//The incoming msg can not be higher than hub's internal state\n\t\thub.skipHeight = true\n\t\tlog.Info(fmt.Sprintf(\"Invalid Height! %d+1!=%d\\n\", hub.currBlockHeight, v.Height))\n\t\tpanic(fmt.Sprintf(\"currBlockHeight height info [%d] < v.Height[%d] msg\", hub.currBlockHeight, 9))\n\t}\n\thub.msgEntryList = hub.msgEntryList[:0]\n}", "title": "" }, { "docid": "fe8e3fa5a7e8673b6f1928e90cd9d8f9", "score": "0.44710276", "text": "func (l *Ledger) QueryBlockByHeight(height int64) (*pb.InternalBlock, error) {\n\tsHeight := []byte(fmt.Sprintf(\"%020d\", height))\n\tblockID, kvErr := l.heightTable.Get(sHeight)\n\tif kvErr != nil {\n\t\tif def.NormalizedKVError(kvErr) == def.ErrKVNotFound {\n\t\t\treturn nil, ErrBlockNotExist\n\t\t}\n\t\treturn nil, kvErr\n\t}\n\treturn l.QueryBlock(blockID)\n}", "title": "" }, { "docid": "aa79bc52ca0b701c67f9abd2aefc6cc0", "score": "0.44706586", "text": "func (b *BinanceWorker) GetHistoryTrades(symbol string, start, end int64, number int) {\n\ttrades, err := b.Cli.NewAggTradesService().\n\t\tSymbol(symbol).StartTime(start).EndTime(end).\n\t\tDo(context.Background())\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n\tvar sum int = 0\n\tvar qul float64 = 0.\n\tvar allQul float64 = 0.\n\tfor _, t := range trades {\n\t\ti, _ := strconv.ParseFloat(t.Quantity, 64)\n\t\tallQul += i\n\t\tif t.IsBuyerMaker {\n\t\t\tsum++\n\t\t\tqul += i\n\t\t}\n\n\t}\n\n\tfmt.Println(float64(float64(sum)/float64(len(trades)))*100, float64(float64(qul)/float64(allQul))*100)\n\t// err = json.Unmarshal(jsonBlob, &rankings)\n\t// if err != nil {\n\t// \t// nozzle.printError(\"opening config file\", err.Error())\n\t// }\n\torders, err := json.Marshal(trades)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\t//fmt.Println(string(orders))\n\t// rankingsJson, _ := json.Marshal(rankings)\n\terr = ioutil.WriteFile(fmt.Sprintf(\"%d.json\", number), orders, 0644)\n\t// fmt.Printf(\"%+v\", rankings)\n}", "title": "" }, { "docid": "2a6ff541de401d6bd8e78386966c0b34", "score": "0.44704977", "text": "func (p *RestPresence) History(params *PaginateParams) (*PaginatedResult, error) {\n\tpath := \"/channels/\" + p.channel.uriName + \"/presence/history\"\n\treturn newPaginatedResult(presMsgType, path, params, query(p.client.get), p.logger())\n}", "title": "" }, { "docid": "b12c7c7eb939a1eab6a0b67af8b94799", "score": "0.4467258", "text": "func (o *OKEX) GetHistoricCandles(pair currency.Pair, a asset.Item, start, end time.Time, interval time.Duration) (kline.Item, error) {\n\treturn kline.Item{}, common.ErrFunctionNotSupported\n}", "title": "" }, { "docid": "5190850ff582e9c75af54c0cab2f2c30", "score": "0.4463177", "text": "func (f *ExtensionStoreGetByIDFunc) History() []ExtensionStoreGetByIDFuncCall {\n\tf.mutex.Lock()\n\thistory := make([]ExtensionStoreGetByIDFuncCall, len(f.history))\n\tcopy(history, f.history)\n\tf.mutex.Unlock()\n\n\treturn history\n}", "title": "" }, { "docid": "0719becf704a62e35d9baac3c0651a95", "score": "0.44610882", "text": "func (h *HUOBI) GetHistoricalInsuranceData(ctx context.Context, code currency.Pair, pageIndex, pageSize int64) (HistoricalInsuranceFundBalance, error) {\n\tvar resp HistoricalInsuranceFundBalance\n\tcodeValue, err := h.FormatSymbol(code, asset.CoinMarginedFutures)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\tparams := url.Values{}\n\tparams.Set(\"contract_code\", codeValue)\n\tif pageIndex != 0 {\n\t\tparams.Set(\"page_index\", strconv.FormatInt(pageIndex, 10))\n\t}\n\tif pageSize != 0 {\n\t\tparams.Set(\"page_size\", strconv.FormatInt(pageIndex, 10))\n\t}\n\tpath := common.EncodeURLValues(huobiInsuranceBalanceHistory, params)\n\treturn resp, h.SendHTTPRequest(ctx, exchange.RestFutures, path, &resp)\n}", "title": "" }, { "docid": "158870e030516ba936935d03119da2ab", "score": "0.44609588", "text": "func GetHistory(s *aklib.DBConfig) ([]*History, error) {\n\tvar hist []*History\n\treturn hist, s.DB.View(func(txn *badger.Txn) error {\n\t\terr := db.Get(txn, nil, &hist, db.HeaderWalletHistory)\n\t\tif err == badger.ErrKeyNotFound {\n\t\t\treturn nil\n\t\t}\n\t\treturn err\n\t})\n}", "title": "" }, { "docid": "8390f0a9ff7a4774dc1896a2a2051d53", "score": "0.44608772", "text": "func (o *EstimateCoinSellAllParams) SetHeight(height *uint64) {\n\to.Height = height\n}", "title": "" }, { "docid": "b34c1265e3639fcdd9ea198805979269", "score": "0.4460625", "text": "func QueryChainHeight(c *gin.Context) {\n\n\t_resp, err := blockchain.GetBCAPI().QueryChainHeight(config.FabricConfig.APIChannel)\n\tif err != nil {\n\t\tc.JSON(200, gin.H{\"errcode\": 1, \"msg\": err.Error()})\n\t}\n\n\tif len(_resp) == 0 {\n\t\tc.JSON(200, gin.H{\"errcode\": 1, \"msg\": \"response is empty\"})\n\t} else {\n\t\tc.String(http.StatusOK, _resp)\n\t}\n}", "title": "" }, { "docid": "1f9a9769da0334b99246648954929368", "score": "0.44535545", "text": "func (t *Track) Height() int {\n\treturn t.height\n}", "title": "" }, { "docid": "4b49072cddeb203b73a846a42e49a4ef", "score": "0.4449916", "text": "func (f *ExtensionStoreGetByUUIDFunc) History() []ExtensionStoreGetByUUIDFuncCall {\n\tf.mutex.Lock()\n\thistory := make([]ExtensionStoreGetByUUIDFuncCall, len(f.history))\n\tcopy(history, f.history)\n\tf.mutex.Unlock()\n\n\treturn history\n}", "title": "" }, { "docid": "08f50c29bb448efbc6c05ed36a464a58", "score": "0.44460908", "text": "func (keeper *PersistentOrderKeeper) GetOrdersAtHeight(ctx sdk.Context, height int64) []*types.Order {\n\tstore := ctx.KVStore(keeper.marketKey)\n\tvar result []*types.Order\n\tstart := myposchain.ConcatKeys(\n\t\tOrderQueueKeyPrefix,\n\t\t[]byte(keeper.symbol),\n\t\t[]byte{0x0},\n\t\tint64ToBigEndianBytes(height),\n\t)\n\tend := myposchain.ConcatKeys(\n\t\tOrderQueueKeyPrefix,\n\t\t[]byte(keeper.symbol),\n\t\t[]byte{0x0},\n\t\tint64ToBigEndianBytes(height+1),\n\t)\n\titer := store.Iterator(start, end)\n\tdefer iter.Close()\n\tfor ; iter.Valid(); iter.Next() {\n\t\tikey := iter.Key()\n\t\torderID := string(ikey[len(end):])\n\t\torder := keeper.getOrder(ctx, orderID)\n\t\tresult = append(result, order)\n\t}\n\treturn result\n}", "title": "" }, { "docid": "f1d8d7073a9272cd7bdb299d7cdd145a", "score": "0.44425192", "text": "func (h *NeutrinoDBStore) HeightFromHash(hash *chainhash.Hash) (uint32, er.R) {\n\tvar height uint32\n\treturn height, walletdb.View(h.Db, func(tx walletdb.ReadTx) er.R {\n\t\tif he, err := h.headerEntryByHash(tx, hash); err != nil {\n\t\t\treturn err\n\t\t} else {\n\t\t\theight = he.Height\n\t\t\treturn nil\n\t\t}\n\t})\n}", "title": "" }, { "docid": "414bfb252c24323de2e8633579711cd5", "score": "0.44370887", "text": "func (n *NodeMetastate) Height() uint64 {\n\treturn n.LedgerHeight\n}", "title": "" }, { "docid": "c7e2fb6ba0ab051c2848bf5b168149e9", "score": "0.4434648", "text": "func (b *Bitmex) GetHistoricCandlesExtended(_ context.Context, _ currency.Pair, _ asset.Item, _ kline.Interval, _, _ time.Time) (*kline.Item, error) {\n\treturn nil, common.ErrFunctionNotSupported\n}", "title": "" }, { "docid": "0839b803eb5faf2bf083b9ac8a62f1fd", "score": "0.44332036", "text": "func (it *pushdownSeriesIterator) AtHistogram() (int64, *histogram.Histogram) {\n\tpanic(\"not implemented\")\n}", "title": "" }, { "docid": "2a2dc1058067b28bd62dc013bf20e2d1", "score": "0.44322538", "text": "func (t *SlaData) getSlaDataHistory(stub shim.ChaincodeStubInterface, args []string) pb.Response {\r\n\tvar key string // uniqueId\r\n\tvar err error\r\n\r\n\tif len(args) != 1 {\r\n\t\treturn shim.Error(\"Incorrect number of arguments. Expecting uniqeId to query\")\r\n\t}\r\n\r\n\tkey = args[0]\r\n\r\n\t// Get the state from the ledger\r\n\tAvalbytes, err := stub.GetHistoryForKey(key)\r\n\tif err != nil {\r\n\t\tjsonResp := \"{\\\"Error\\\":\\\"Failed to get state for \" + key + \"\\\"}\"\r\n\t\treturn shim.Error(jsonResp)\r\n\t}\r\n\r\n\tif Avalbytes == nil {\r\n\t\tjsonResp := \"{\\\"Error\\\":\\\"no data for \" + key + \"\\\"}\"\r\n\t\treturn shim.Error(jsonResp)\r\n\t}\r\n\tdefer Avalbytes.Close()\r\n\r\n\t// buffer is a JSON array containing historic values for the marble\r\n\tvar buffer bytes.Buffer\r\n\tbuffer.WriteString(\"[\")\r\n\r\n\tbArrayMemberAlreadyWritten := false\r\n\tfor Avalbytes.HasNext() {\r\n\t\tresponse, err := Avalbytes.Next()\r\n\t\tif err != nil {\r\n\t\t\treturn shim.Error(err.Error())\r\n\t\t}\r\n\t\t// Add a comma before array members, suppress it for the first array member\r\n\t\tif bArrayMemberAlreadyWritten == true {\r\n\t\t\tbuffer.WriteString(\",\")\r\n\t\t}\r\n\t\tbuffer.WriteString(\"{\\\"TxId\\\":\")\r\n\t\tbuffer.WriteString(\"\\\"\")\r\n\t\tbuffer.WriteString(response.TxId)\r\n\t\tbuffer.WriteString(\"\\\"\")\r\n\r\n\t\tbuffer.WriteString(\", \\\"Value\\\":\")\r\n\r\n\t\tbuffer.WriteString(string(response.Value))\r\n\r\n\t\tbuffer.WriteString(\", \\\"Timestamp\\\":\")\r\n\t\tbuffer.WriteString(\"\\\"\")\r\n\t\tbuffer.WriteString(time.Unix(response.Timestamp.Seconds, int64(response.Timestamp.Nanos)).String())\r\n\t\tbuffer.WriteString(\"\\\"\")\r\n\r\n\t\tbuffer.WriteString(\"}\")\r\n\t\tbArrayMemberAlreadyWritten = true\r\n\t}\r\n\tbuffer.WriteString(\"]\")\r\n\r\n\tfmt.Printf(\"- getSlaDataHistory returning:\\n%s\\n\", buffer.String())\r\n\r\n\treturn shim.Success(buffer.Bytes())\r\n}", "title": "" } ]
fbeaeca1e66bfaa2b2be349b31486671
Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.
[ { "docid": "3ccbb8f9ff072a7764ac809521952511", "score": "0.0", "text": "func (o PrometheusSpecVolumesSecretOutput) DefaultMode() pulumi.IntPtrOutput {\n\treturn o.ApplyT(func(v PrometheusSpecVolumesSecret) *int { return v.DefaultMode }).(pulumi.IntPtrOutput)\n}", "title": "" } ]
[ { "docid": "b6bf65b8e2ce3ca6fa55d5c573103b1a", "score": "0.73905414", "text": "func (fi fileInfo) Mode() os.FileMode { return 0777 }", "title": "" }, { "docid": "ed1f09f21944ff63a5940e0f0ef8d217", "score": "0.6787447", "text": "func (r *Root) Mode() os.FileMode { return os.ModeDir }", "title": "" }, { "docid": "2b6ded9ac48517985c8a5fac0c74baf7", "score": "0.67868555", "text": "func (r *Root) Mode() fs.FileMode { return fs.ModeDir }", "title": "" }, { "docid": "6350c049e608db4080e4e31dfd5518d7", "score": "0.6722667", "text": "func toFileMode(mode uint32) os.FileMode {\n\tvar fm = os.FileMode(mode & 0777)\n\tswitch mode & syscall.S_IFMT {\n\tcase syscall.S_IFBLK:\n\t\tfm |= os.ModeDevice\n\tcase syscall.S_IFCHR:\n\t\tfm |= os.ModeDevice | os.ModeCharDevice\n\tcase syscall.S_IFDIR:\n\t\tfm |= os.ModeDir\n\tcase syscall.S_IFIFO:\n\t\tfm |= os.ModeNamedPipe\n\tcase syscall.S_IFLNK:\n\t\tfm |= os.ModeSymlink\n\tcase syscall.S_IFREG:\n\t\t// nothing to do\n\tcase syscall.S_IFSOCK:\n\t\tfm |= os.ModeSocket\n\t}\n\tif mode&syscall.S_ISGID != 0 {\n\t\tfm |= os.ModeSetgid\n\t}\n\tif mode&syscall.S_ISUID != 0 {\n\t\tfm |= os.ModeSetuid\n\t}\n\tif mode&syscall.S_ISVTX != 0 {\n\t\tfm |= os.ModeSticky\n\t}\n\treturn fm\n}", "title": "" }, { "docid": "6f0593afe05f2c6d8fc228b95b4697bc", "score": "0.66712755", "text": "func (rk *KeyInfo) Mode() os.FileMode {\n\tif rk.IsDir() {\n\t\treturn os.ModeDir\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "8b7fc6f0a53bcdba9562c61946f7ed9d", "score": "0.66394395", "text": "func (fi fileInfo) Mode() os.FileMode { panic(\"not implemented\") }", "title": "" }, { "docid": "b4b8c22921f72c1feaabd5959d0b39ac", "score": "0.660619", "text": "func fileMode(unixMode uint32) os.FileMode {\n\tmode := os.FileMode(unixMode & 0777)\n\tswitch unixMode & unix.S_IFMT {\n\tcase unix.S_IFREG:\n\t// nothing\n\tcase unix.S_IFDIR:\n\t\tmode |= os.ModeDir\n\tcase unix.S_IFCHR:\n\t\tmode |= os.ModeCharDevice | os.ModeDevice\n\tcase unix.S_IFBLK:\n\t\tmode |= os.ModeDevice\n\tcase unix.S_IFIFO:\n\t\tmode |= os.ModeNamedPipe\n\tcase unix.S_IFLNK:\n\t\tmode |= os.ModeSymlink\n\tcase unix.S_IFSOCK:\n\t\tmode |= os.ModeSocket\n\tdefault:\n\t\t// no idea\n\t\tmode |= os.ModeDevice\n\t}\n\tif unixMode&unix.S_ISUID != 0 {\n\t\tmode |= os.ModeSetuid\n\t}\n\tif unixMode&unix.S_ISGID != 0 {\n\t\tmode |= os.ModeSetgid\n\t}\n\tif unixMode&unix.S_ISVTX != 0 {\n\t\tmode |= os.ModeSticky\n\t}\n\t// Not handled:\n\t// os.ModeAppend\n\t// os.ModeExclusive\n\t// os.ModeTemporary\n\treturn mode\n}", "title": "" }, { "docid": "e2d74dbc8ffe00ec5b3d6a380cf03afc", "score": "0.65638715", "text": "func (f *FileInfo) Mode() os.FileMode {\n\tvar m os.FileMode\n\n\tif f.IsDir() {\n\t\tm |= os.ModeDir\n\t}\n\n\treturn m\n}", "title": "" }, { "docid": "8ce49a22cfbb956e3180991ba7fcbaef", "score": "0.6559688", "text": "func OsMode(mode Mode) os.FileMode {\n\tvar osmode os.FileMode\n\tif mode&Dir == Dir {\n\t\tosmode |= os.ModeDir\n\t}\n\n\tif mode&Append == Append {\n\t\tosmode |= os.ModeAppend\n\t}\n\n\tif mode&Excl == Excl {\n\t\tosmode |= os.ModeExclusive\n\t}\n\n\tif mode&Tmp == Tmp {\n\t\tosmode |= os.ModeTemporary\n\t}\n\n\tif mode&Symlink == Symlink {\n\t\tosmode |= os.ModeSymlink\n\t}\n\n\tif mode&Device == Device {\n\t\tosmode |= os.ModeDevice\n\t}\n\n\tif mode&NamedPipe == NamedPipe {\n\t\tosmode |= os.ModeNamedPipe\n\t}\n\n\tif mode&Socket == Socket {\n\t\tosmode |= os.ModeSocket\n\t}\n\n\tif mode&SetGid == SetGid {\n\t\tosmode |= os.ModeSetgid\n\t}\n\n\tif mode&SetUid == SetUid {\n\t\tosmode |= os.ModeSetuid\n\t}\n\n\tosmode |= os.FileMode(mode & 0777)\n\n\treturn os.FileMode(osmode)\n}", "title": "" }, { "docid": "85bc0da036a74ee6927ab472c6d20e1d", "score": "0.652525", "text": "func (i *dummyFileInfo) Mode() os.FileMode {\n\tif i.isDir {\n\t\treturn os.ModeDir\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "5e6c8632653c001f9c0a779b1a9ed500", "score": "0.6275001", "text": "func getFileMode(filename string) os.FileMode {\n\tfi, _ := os.Stat(filepath.Dir(filename))\n\tfmode := os.FileMode(0644)\n\tif isModeSetgid(fi) {\n\t\tfmode = os.FileMode(0664)\n\t}\n\n\treturn fmode\n}", "title": "" }, { "docid": "da71b978d9113cadf81f3b2a0084d3ba", "score": "0.6248574", "text": "func (a FileStat) FileMode() os.FileMode {\n\treturn os.FileMode(a.Mode)\n}", "title": "" }, { "docid": "a0f41f83d3bdd840e94cbda69fa7d0a4", "score": "0.62126285", "text": "func (fb FileBase) FixMode(subPath string) error {\n\tmode := 0640\n\tif fb.GroupWritable {\n\t\tmode = mode | 0020\n\t}\n\treturn fb.SetMode(subPath, os.FileMode(mode))\n}", "title": "" }, { "docid": "2801ca6365cf6d5ea9dba55609486ecf", "score": "0.61677986", "text": "func (v Volume) FileMode() (os.FileMode, error) {\n\tif v.Mode == \"\" {\n\t\treturn 0, trace.BadParameter(\"volume mode is not specified\")\n\t}\n\tmode, err := strconv.ParseInt(v.Mode, 8, 32)\n\tif err != nil {\n\t\treturn 0, trace.BadParameter(\"volume mode %q is not in valid format, expected '0755'\", v.Mode)\n\t}\n\treturn os.FileMode(mode), nil\n}", "title": "" }, { "docid": "1a84ebedbf921c07d01aeb75273e5d09", "score": "0.61490947", "text": "func unixCreateMode(osMode os.FileMode) uint32 {\n\tmode := uint32(osMode & 0777)\n\tif osMode & os.ModeSetuid != 0 {\n\t\tmode |= unix.S_ISUID\n\t}\n\tif osMode & os.ModeSetgid != 0 {\n\t\tmode |= unix.S_ISGID\n\t}\n\tif osMode & os.ModeSticky != 0 {\n\t\tmode |= unix.S_ISVTX\n\t}\n\treturn mode\n}", "title": "" }, { "docid": "f2c1fe7d13db5c4d265aa3c2e6affe3a", "score": "0.61444694", "text": "func (a *attr) Mode() os.FileMode { return a.mode }", "title": "" }, { "docid": "24476721bfcd2bab2ced420bfe1030e6", "score": "0.6094003", "text": "func FileMode(mode os.FileMode) Option {\n\treturn func(o *options) {\n\t\to.filemode = mode\n\t}\n}", "title": "" }, { "docid": "0a165567a88e8e63c6d07f3f4bbca2cc", "score": "0.6083648", "text": "func WithMode(dirMode, fileMode os.FileMode) Option {\n\treturn option{\n\t\tcache: func(c *Cache) error {\n\t\t\tc.dirMode, c.fileMode = dirMode, fileMode\n\t\t\treturn nil\n\t\t},\n\t}\n}", "title": "" }, { "docid": "0e3fab8f5723d63bbaee5d373c4faaea", "score": "0.6066331", "text": "func WithMode(mode os.FileMode) Option {\n\treturn func(c *config) {\n\t\tc.mode = mode\n\t}\n}", "title": "" }, { "docid": "d32c43f466ab4c79cdfe6ed889f72e6c", "score": "0.6047925", "text": "func (a *File) Mode() os.FileMode {\n\tif strings.HasSuffix(a.name, \"stdin\") {\n\t\treturn 0200\n\t}\n\treturn 0400\n}", "title": "" }, { "docid": "dfaa2ed8027e86dba60c824fd16ac22a", "score": "0.6028577", "text": "func permsToFileMode(perms os.FileMode) (mode os.FileMode) {\n\tmode = perms &^ 07000\n\n\tif perms&StickyBit > 0 {\n\t\tmode |= os.ModeSticky\n\t}\n\tif perms&SetgidBit > 0 {\n\t\tmode |= os.ModeSetgid\n\t}\n\tif perms&SetuidBit > 0 {\n\t\tmode |= os.ModeSetuid\n\t}\n\n\treturn mode\n}", "title": "" }, { "docid": "e28ca216d3427bafbaf66881f7284911", "score": "0.60268253", "text": "func (g GoPath) FileMode() os.FileMode {\n\tif info := g.FileInfo(); info != nil {\n\t\treturn info.Mode()\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "c9cabe7bc8f37dffde18575b299d4b54", "score": "0.59821695", "text": "func (fa *FileAttrs) Mode() fs.FileMode {\n\treturn fa.fsMode\n}", "title": "" }, { "docid": "16623780976fb774b41df52154696e50", "score": "0.5960558", "text": "func (i *Item) Mode() os.FileMode {\n\tif i.IsDir() {\n\t\treturn os.ModeDir\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "e9cdef6744af25adc8dbb76b68b16944", "score": "0.5869998", "text": "func (entry DirEntry) Mode() os.FileMode {\n\treturn mapMode(C.mode_t(entry.cStat.st_mode))\n}", "title": "" }, { "docid": "75b4b0e8a99db2d5edef02a224ef9f08", "score": "0.5841317", "text": "func (f SubFolder) Mode() os.FileMode {\n\tvar mode os.FileInfo\n\treturn mode.Mode()\n}", "title": "" }, { "docid": "1d37cb2c7ccd1a95c68822b51c37675c", "score": "0.58346766", "text": "func WithDefaultDirMode(mode os.FileMode) Modifier {\n\treturn func(o *options) {\n\t\to.dirmode = mode\n\t}\n}", "title": "" }, { "docid": "ace0b8f56164dce19aad725d15ecd3b6", "score": "0.58315206", "text": "func (p Path) OpenWithPermissions(mode string, perms os.FileMode) (*os.File, error) {\n\tif p.IsDir() {\n\t\treturn nil, fmt.Errorf(\"Cannot open %s because it is a directory.\", p)\n\t}\n\n\tflag := os.O_RDONLY // default to read mode\n\n\tif strings.Contains(mode, \"r\") && strings.Contains(mode, \"w\") {\n\t\tflag = os.O_RDWR\n\t} else if strings.Contains(mode, \"r\") {\n\t\tflag = os.O_RDONLY\n\t} else if strings.Contains(mode, \"w\") {\n\t\tflag = os.O_WRONLY\n\t}\n\n\tif strings.Contains(mode, \"+\") {\n\t\tflag |= os.O_APPEND\n\t}\n\n\tif !p.Exists() {\n\t\tflag |= os.O_CREATE\n\t}\n\n\treturn os.OpenFile(string(p), flag, perms)\n}", "title": "" }, { "docid": "a12b037cb41dfdee29f24c46b852126d", "score": "0.5816344", "text": "func getDirMode(path string) os.FileMode {\n\tdirmode := os.FileMode(0755)\n\tfor {\n\t\tfi, err := os.Stat(path)\n\t\tif os.IsExist(err) {\n\t\t\tif isModeSetgid(fi) {\n\t\t\t\tdirmode = os.FileMode(0775)\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tif path == \".\" || path == string(os.PathSeparator) {\n\t\t\tbreak\n\t\t} else {\n\t\t\tpath = filepath.Dir(path)\n\t\t}\n\t}\n\n\treturn dirmode\n}", "title": "" }, { "docid": "475cef2ca2d2039c6ae9cd63f302cb33", "score": "0.5798206", "text": "func parseFileMode(remoteDirectoryInfo *agaveproto.RemoteFileInfo) os.FileMode {\n\tpemLen := len(remoteDirectoryInfo.Mode)\n\tvar stringPermissions string\n\tvar fMode uint32 = 0\n\tif pemLen > 9 {\n\t\tstringPermissions = remoteDirectoryInfo.Mode[pemLen-9 : pemLen-1]\n\n\t\tfor i, pemChar := range stringPermissions {\n\t\t\tif pemChar != '-' {\n\t\t\t\tfMode += 1 << (9 - i)\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfMode = 0755\n\t}\n\treturn os.FileMode(fMode)\n}", "title": "" }, { "docid": "3061be809aa94ca2351f88bbf356f1e5", "score": "0.5783347", "text": "func (t *Apps) setFileMode() error {\n\tif t.Mode == \"\" {\n\t\tif !util.IsFileExist(t.Dest) {\n\t\t\tt.FileMode = 0644\n\t\t} else {\n\t\t\tfi, err := os.Stat(t.Dest)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tt.FileMode = fi.Mode()\n\t\t}\n\t} else {\n\t\tmode, err := strconv.ParseUint(t.Mode, 0, 32)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tt.FileMode = os.FileMode(mode)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "03295029f119ddbf09a3bca68913bc64", "score": "0.577689", "text": "func unixMode(osMode os.FileMode) uint32 {\n\tmode := uint32(osMode & 0777)\n\tswitch osMode & os.ModeType {\n\tcase 0:\n\t\tmode |= unix.S_IFREG\n\tcase os.ModeDir:\n\t\tmode |= unix.S_IFDIR\n\tcase os.ModeDevice | os.ModeCharDevice:\n\t\tmode |= unix.S_IFCHR\n\tcase os.ModeDevice:\n\t\tmode |= unix.S_IFBLK\n\tcase os.ModeNamedPipe:\n\t\tmode |= unix.S_IFIFO\n\tcase os.ModeSymlink:\n\t\tmode |= unix.S_IFLNK\n\tcase os.ModeSocket:\n\t\tmode |= unix.S_IFSOCK\n\tdefault:\n\t\t// no idea\n\t\tmode |= unix.S_IFBLK\n\t}\n\tif osMode & os.ModeSetuid != 0 {\n\t\tmode |= unix.S_ISUID\n\t}\n\tif osMode & os.ModeSetgid != 0 {\n\t\tmode |= unix.S_ISGID\n\t}\n\tif osMode & os.ModeSticky != 0 {\n\t\tmode |= unix.S_ISVTX\n\t}\n\treturn mode\n}", "title": "" }, { "docid": "672d92d714a5bbd155e6df00ddde95cf", "score": "0.5770067", "text": "func Fopen(filePath, mode *byte) *File {\n\tvar file *os.File\n\tvar err error\n\n\tsFilePath := CStringToString(filePath)\n\tvar fileExists bool\n\tvar info os.FileInfo\n\tinfo, err = os.Stat(sFilePath)\n\tif info != nil || !os.IsNotExist(err) {\n\t\tfileExists = true\n\t}\n\n\tm := CStringToString(mode)\n\t// no-overwrite flag\n\tif strings.Contains(m, \"x\") {\n\t\tm = strings.Replace(m, \"x\", \"\", -1)\n\t\tif strings.Contains(m, \"w\") && fileExists {\n\t\t\t// only applies when writing to a file\n\t\t\tsetCurrentErrno(EEXIST)\n\t\t\treturn nil\n\t\t}\n\t}\n\t// binary flag\n\tif strings.Contains(m, \"b\") {\n\t\tm = strings.Replace(m, \"b\", \"\", -1)\n\t\t// no other action needed, we are always using binary mode\n\t}\n\tvar flags int32\n\tswitch m {\n\tcase \"r\":\n\t\tflags |= io_NO_WRITES\n\t\tfile, err = os.OpenFile(sFilePath, os.O_RDONLY, 0655)\n\tcase \"r+\":\n\t\tfile, err = os.OpenFile(sFilePath, os.O_RDWR, 0655)\n\tcase \"a\":\n\t\tflags |= io_NO_READS\n\t\tfile, err = os.OpenFile(sFilePath, os.O_WRONLY|os.O_APPEND, 0655)\n\tcase \"a+\":\n\t\tfile, err = os.OpenFile(sFilePath, os.O_RDWR|os.O_APPEND, 0655)\n\tcase \"w\":\n\t\tfile, err = os.OpenFile(sFilePath, os.O_RDWR|os.O_CREATE, 0655)\n\t\tif err == nil && fileExists {\n\t\t\terr = file.Truncate(0)\n\t\t}\n\tcase \"w+\":\n\t\tfile, err = os.OpenFile(sFilePath, os.O_RDWR|os.O_CREATE, 0655)\n\t\tif err == nil && fileExists {\n\t\t\terr = file.Truncate(0)\n\t\t}\n\tdefault:\n\t\tpanic(fmt.Sprintf(\"unsupported file mode: %s\", mode))\n\t}\n\n\tif err != nil {\n\t\tsetFopenErrno(err)\n\t\treturn nil\n\t}\n\n\tnf := NewFile(file)\n\tnf._flags |= flags\n\treturn nf\n}", "title": "" }, { "docid": "3d789db209671e137b7d144d701d7e1d", "score": "0.57542515", "text": "func (f *File) Mode() os.FileMode {\n\treturn f.attr.Mode\n}", "title": "" }, { "docid": "61b83d369b94ce0fc9e767f753a56562", "score": "0.57506824", "text": "func (fi *FileInfo) Mode() os.FileMode {\n\treturn fi.FileMode\n}", "title": "" }, { "docid": "7ed8d9822cf54697bd64bce96f5b8775", "score": "0.5747245", "text": "func (sm SkyfileSubfileMetadata) Mode() os.FileMode {\n\treturn sm.FileMode\n}", "title": "" }, { "docid": "723b40008ce874b871595b079412737f", "score": "0.5721789", "text": "func (fi fileInfo) Mode() fs.FileMode {\n\treturn fi.md\n}", "title": "" }, { "docid": "68054c63aff2717622f58d4650398ae0", "score": "0.57020724", "text": "func (fst *fStat) Mode() os.FileMode {\n\treturn fst.mode\n}", "title": "" }, { "docid": "e38db195fbb5a6b507219448e7077911", "score": "0.5696424", "text": "func WithDirMode(mode os.FileMode) Option {\n\treturn func(c *config) {\n\t\tc.dirMode = mode\n\t}\n}", "title": "" }, { "docid": "99b9c72ae73537cb25ef3db06d19f243", "score": "0.56791836", "text": "func Mode(src string) (mode os.FileMode) {\n\tif info, err := Lstat(src); err == nil {\n\t\tmode = info.Mode()\n\t}\n\treturn\n}", "title": "" }, { "docid": "79b154fdba1e94727602cad1e7000e03", "score": "0.56757474", "text": "func (p Path) Open(mode string) (*os.File, error) {\n\treturn p.OpenWithPermissions(mode, 0755)\n}", "title": "" }, { "docid": "832f797df196f70f852f7cdbfa8f81a3", "score": "0.5648498", "text": "func (fb *FileBase) SetMode(subPath string, mode os.FileMode) error {\n\tnpath, err := fb.FullPath(subPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn os.Chmod(npath, mode)\n}", "title": "" }, { "docid": "dea730c5fdd95a619c7e9dab270570c1", "score": "0.56477207", "text": "func (fwp FileWithMode) Create(dir string) error {\n\tpath := filepath.Join(dir, fwp.Path)\n\tif fwp.Mode&os.ModeDir != 0 {\n\t\treturn os.Mkdir(path, fwp.Mode&os.ModePerm)\n\t}\n\tf, err := os.Create(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer f.Close()\n\t_, err = f.WriteString(fwp.Contents)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn f.Chmod(fwp.Mode & os.ModePerm)\n}", "title": "" }, { "docid": "8d75b939bff158de7053b0ec5b6ddc22", "score": "0.56437194", "text": "func ModeToOs(m *fs.Metadata) os.FileMode {\n\tmode := os.FileMode(0)\n\tif m.Type == fs.Type_Dir {\n\t\tmode |= os.ModeDir\n\t}\n\tif m.Type == fs.Type_Symlink {\n\t\tmode |= os.ModeSymlink\n\t}\n\tif m.Type == fs.Type_NamedPipe {\n\t\tmode |= os.ModeNamedPipe\n\t}\n\tif m.Type == fs.Type_Socket {\n\t\tmode |= os.ModeSocket\n\t}\n\tif m.Type == fs.Type_Device {\n\t\tmode |= os.ModeDevice\n\t}\n\tif m.Type == fs.Type_CharDevice {\n\t\tmode |= os.ModeCharDevice\n\t}\n\tmode |= (os.FileMode(m.Perms) & os.ModePerm)\n\tif m.Perms&fs.Perms_Setuid != 0 {\n\t\tmode |= os.ModeSetuid\n\t}\n\tif m.Perms&fs.Perms_Setgid != 0 {\n\t\tmode |= os.ModeSetgid\n\t}\n\tif m.Perms&fs.Perms_Sticky != 0 {\n\t\tmode |= os.ModeSticky\n\t}\n\treturn mode\n}", "title": "" }, { "docid": "f40909d2b9bae5810b8b5f70af65b034", "score": "0.5627026", "text": "func NeinMode(osmode os.FileMode) Mode {\n\tvar mode Mode\n\n\tif osmode&os.ModeDir == os.ModeDir {\n\t\tmode |= Dir\n\t}\n\n\tif osmode&os.ModeAppend == os.ModeAppend {\n\t\tmode |= Append\n\t}\n\n\tif osmode&os.ModeExclusive == os.ModeExclusive {\n\t\tmode |= Excl\n\t}\n\n\tif osmode%os.ModeTemporary == os.ModeTemporary {\n\t\tmode |= Tmp\n\t}\n\n\tif osmode&os.ModeSymlink == os.ModeSymlink {\n\t\tmode |= Symlink\n\t}\n\n\tif osmode&os.ModeDevice == os.ModeDevice {\n\t\tmode |= Device\n\t}\n\n\tif osmode&os.ModeNamedPipe == os.ModeNamedPipe {\n\t\tmode |= NamedPipe\n\t}\n\n\tif osmode&os.ModeSocket == os.ModeSocket {\n\t\tmode |= Socket\n\t}\n\n\tif osmode&os.ModeSetgid == os.ModeSetgid {\n\t\tmode |= SetGid\n\t}\n\n\tif osmode&os.ModeSetuid == os.ModeSetuid {\n\t\tmode |= SetUid\n\t}\n\n\tmode |= Mode(uint32(osmode) & 0777)\n\n\treturn mode\n}", "title": "" }, { "docid": "b7426deedfd4f59ff0102dfb9bdddcee", "score": "0.5626776", "text": "func (osp *PermsStruct) GetFileMode(perm os.FileMode) os.FileMode {\n\treturn os.ModePerm & perm\n}", "title": "" }, { "docid": "7f03f7330c151c1442ee7b83471ea3a2", "score": "0.5617711", "text": "func (f *FileInfo) Mode() os.FileMode {\n\treturn f.mode\n}", "title": "" }, { "docid": "710e275a3de2bf9b1a1353b746bbcf59", "score": "0.5589749", "text": "func Mode(filename string) (os.FileMode, error) {\n\tif fi, err := GetFileInfo(filename); err != nil {\n\t\treturn 0, err\n\t} else {\n\t\treturn fi.Mode(), nil\n\t}\n}", "title": "" }, { "docid": "1398cdb8bb92b14882076b92e6b3893d", "score": "0.5584493", "text": "func X_setmode(t *TLS, fd, mode int32) int32 {\n\n\t_, ok := fdToFile(fd)\n\tif !ok {\n\t\tt.setErrno(errno.EBADF)\n\t\treturn -1\n\t}\n\n\t// we're always in binary mode.\n\t// at least for now.\n\n\tif mode == fcntl.O_BINARY {\n\t\treturn fcntl.O_BINARY\n\t} else {\n\t\tt.setErrno(errno.EINVAL)\n\t\treturn -1\n\t}\n}", "title": "" }, { "docid": "7564b149b938d0c4cf6212a595ba6572", "score": "0.5573335", "text": "func (f *File) Mode() os.FileMode {\n\treturn f.mode\n}", "title": "" }, { "docid": "b7c0a5ea68ec825608eb37b4dbe20f4b", "score": "0.55680555", "text": "func (fi *FileInfo) Mode() os.FileMode {\n\treturn fi.SaveMode\n}", "title": "" }, { "docid": "d20a72869484e851e653b17708f820b4", "score": "0.55560094", "text": "func SetMode(p string, m os.FileMode) error {\n\tif err := os.Chmod(p, m); err != nil {\n\t\treturn &ChmodError{\n\t\t\tErr: err,\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8aec25173c6aad3266299c120ccaff68", "score": "0.55514836", "text": "func open(path string, flag int, mode os.FileMode) (*os.File, error) {\n\tdir, err := dir()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tpath = filepath.Join(dir, path)\n\n\terr = os.MkdirAll(filepath.Dir(path), 0750)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn os.OpenFile(path, flag, mode)\n}", "title": "" }, { "docid": "b793e6d7894aac2441b571a722a25726", "score": "0.5539717", "text": "func Chmod(path string, mode os.FileMode, opts ...*opt.Opt) (err error) {\n\trecurse := getRecurseOpt(opts)\n\tonlyDirs := getOnlyDirsOpt(opts)\n\tonlyFiles := getOnlyFilesOpt(opts)\n\n\t// Path expansion\n\tif path, err = Abs(path); err != nil {\n\t\treturn\n\t}\n\n\t// Handle globbing\n\tvar sources []string\n\tif sources, err = filepath.Glob(path); err != nil {\n\t\terr = errors.Wrapf(err, \"failed to get glob for %s\", path)\n\t\treturn\n\t}\n\n\t// Fail if no sources were found\n\tif len(sources) == 0 {\n\t\terr = errors.Errorf(\"failed to get any sources for %s\", path)\n\t\treturn\n\t}\n\n\t// Execute the chmod for all sources\n\tfor _, source := range sources {\n\n\t\t// Only check if dir if we are required to\n\t\tisDir := false\n\t\tif onlyDirs || onlyFiles || recurse {\n\t\t\tisDir = IsDir(source)\n\t\t}\n\n\t\t// Only get old mode if we have to\n\t\tvar oldMode os.FileMode\n\t\tif recurse {\n\t\t\toldMode = Mode(source)\n\t\t}\n\n\t\t// We have to be careful of the order of applying permissions we'll get into a\n\t\t// scenario where we are revoking read/execute on a dir before we get to the\n\t\t// bottom of the stack. Like wise when adding permissions we have to\n\t\t// do it on the way in or we won't be able to read to get there.\n\t\tif (!onlyDirs && !onlyFiles) || (onlyDirs && isDir) || (onlyFiles && !isDir) {\n\n\t\t\t// Chmod on the way in if not recursing or recursing and adding permissions\n\t\t\tif !recurse || !isDir || (recurse && !revokingMode(oldMode, mode)) {\n\t\t\t\tif err = os.Chmod(source, mode); err != nil {\n\t\t\t\t\terr = errors.Wrapf(err, \"failed to add permissions with chmod %s\", path)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Handle recursion only one dir at a time as permissions need set first\n\t\t// incase we are adding read/execute permissions as we go.\n\t\tif recurse && isDir {\n\t\t\tfor _, path := range Paths(source) {\n\t\t\t\tif err = Chmod(path, mode, opts...); err != nil {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Chmod on the way out if recursing and revoking permissions\n\t\tif (!onlyDirs && !onlyFiles) || (onlyDirs && isDir) || (onlyFiles && !isDir) {\n\t\t\tif recurse && isDir && revokingMode(oldMode, mode) {\n\t\t\t\tif err = os.Chmod(source, mode); err != nil {\n\t\t\t\t\terr = errors.Wrapf(err, \"failed to revoke permissions with chmod %s\", path)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "63d0fcf42ae29bed03d7fc37e7c56780", "score": "0.5524619", "text": "func (a *accessControl) relevantFileModeForPath(p gopath.GoPath) os.FileMode {\n\tif a.hasErr() || p.HasErr() {\n\t\treturn 0\n\t}\n\tvar pStat = p.Stat()\n\tif !pStat.IsExists() {\n\t\t// HINT: Inspect permissions of containing directory\n\t\tpStat = p.Dir().Stat()\n\t}\n\ta.setErr(pStat.Err())\n\treturn pStat.FileMode()\n}", "title": "" }, { "docid": "4882d7568932619cceb252fccb487a99", "score": "0.552018", "text": "func (f MockFileInfo) Mode() os.FileMode { return f.MockMode }", "title": "" }, { "docid": "1803645e07683b76a09c6c98a16ab718", "score": "0.55146205", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\r\n\treturn fi.mode\r\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" }, { "docid": "6c7105b5139db8a940eb01d14c808221", "score": "0.5509932", "text": "func (fi bindataFileInfo) Mode() os.FileMode {\n\treturn fi.mode\n}", "title": "" } ]
2b772cb8826bc351588dc0fc438d1175
RetrieveGoalsByNames searching by ids. Returns ErrGoalNotFound if none of the goals are found.
[ { "docid": "73479170f3fd819915e9ce369775fd44", "score": "0.7427479", "text": "func (s *Goal) RetrieveGoalsByNames(names []string) (res []goal.Goal, e error) {\n\tvar queryParams []interface{}\n\tfor _, elem := range names {\n\t\tqueryParams = append(queryParams, elem)\n\t}\n\n\tfilter := s.Client.Query().CreateMultipleValueFilter(\"NAME\", len(queryParams))\n\n\tgoalSelectQuery := s.Client.Query().Read(CommunitygoaltrackerSchema, GoalTable, filter)\n\tgoalSelectQuery = s.Client.DB().Rebind(goalSelectQuery)\n\n\tvar dbRes []GoalDTO\n\tif err := s.Client.DB().Select(&dbRes, goalSelectQuery, queryParams...); err == sql.ErrNoRows {\n\t\treturn nil, nil\n\t} else if err != nil {\n\t\treturn nil, err\n\t}\n\n\tres = make([]goal.Goal, len(dbRes))\n\tfor i, g := range dbRes {\n\t\tif res[i], e = GoalPersistenceToDomain(g); e != nil {\n\t\t\treturn nil, e\n\t\t}\n\t}\n\tif len(res) == 0 {\n\t\treturn nil, goal.ErrGoalNotFound\n\t}\n\n\treturn res, nil\n}", "title": "" } ]
[ { "docid": "a27fcb4c49e068a7b44251f7d3d23163", "score": "0.6651846", "text": "func (s *Goal) RetrieveGoalsByIDs(ids []int64) (res []goal.Goal, e error) {\n\tvar queryParams []interface{}\n\tfor _, elem := range ids {\n\t\tqueryParams = append(queryParams, elem)\n\t}\n\n\tfilter := s.Client.Query().CreateMultipleValueFilter(\"ID\", len(queryParams))\n\n\tgoalSelectQuery := s.Client.Query().Read(CommunitygoaltrackerSchema, GoalTable, filter)\n\tgoalSelectQuery = s.Client.DB().Rebind(goalSelectQuery)\n\n\tvar dbRes []GoalDTO\n\tif err := s.Client.DB().Select(&dbRes, goalSelectQuery, queryParams...); err == sql.ErrNoRows {\n\t\treturn nil, nil\n\t} else if err != nil {\n\t\treturn nil, err\n\t}\n\n\tres = make([]goal.Goal, len(dbRes))\n\tfor i, g := range dbRes {\n\t\tif res[i], e = GoalPersistenceToDomain(g); e != nil {\n\t\t\treturn nil, e\n\t\t}\n\t}\n\tif len(res) == 0 {\n\t\treturn nil, goal.ErrGoalNotFound\n\t}\n\n\treturn res, nil\n}", "title": "" }, { "docid": "197f1398fa1a6a22d6db18c638cebadb", "score": "0.48956266", "text": "func (h *Handler) GetGoals(c echo.Context) error {\n\tgoals, err := model.GetGoals(h.db)\n\tif err != nil {\n\t\treturn errInternalServer(err)\n\t}\n\n\treturn c.JSON(http.StatusOK, goals)\n}", "title": "" }, { "docid": "c3d2fb0af3815bbbb0acdb8fb74bbb02", "score": "0.48328328", "text": "func (s *Goal) RetrieveGoalByName(name string) (res goal.Goal, e error) {\n\tfilter := \"NAME=?\"\n\tqueryParam := name\n\n\tgoalSelectQuery := s.Client.Query().Read(CommunitygoaltrackerSchema, GoalTable, filter)\n\tgoalSelectQuery = s.Client.DB().Rebind(goalSelectQuery)\n\n\tdbRes := &GoalDTO{}\n\te = s.Client.DB().Get(dbRes, goalSelectQuery, queryParam)\n\tif e == sql.ErrNoRows {\n\t\treturn res, goal.ErrGoalNotFound\n\t}\n\n\treturn GoalPersistenceToDomain(*dbRes)\n\n}", "title": "" }, { "docid": "54149774e0018217d945ad6a87a8445d", "score": "0.47754195", "text": "func (s *Goal) UpdateGoals(gg []goal.Goal) (e error) {\n\t// TODO\n\tsearchKey := \"ID\"\n\n\tgoalPersistenceModel := &GoalDTO{}\n\tgoalUpdateQuery := s.Client.Query().UpdateMultiple(goalPersistenceModel, CommunitygoaltrackerSchema, GoalTable, searchKey, len(gg))\n\tgoalUpdateQuery = s.Client.DB().Rebind(goalUpdateQuery)\n\n\tmodels := make([]interface{}, len(gg))\n\tfor i, g := range gg {\n\t\tmodels[i] = GoalDomainToPersistence(g)\n\t}\n\tqueryParams := s.Client.Query().MultipleModelValues(models)\n\n\tgoalPersistenceModels := make([]*GoalDTO, len(gg))\n\tfor i, g := range gg {\n\t\tgoalPersistenceModels[i] = GoalDomainToPersistence(g)\n\t}\n\te = s.Client.DB().Get(goalPersistenceModels, goalUpdateQuery, queryParams...)\n\n\tif e == sql.ErrNoRows {\n\t\treturn goal.ErrGoalNotFound\n\t}\n\n\treturn e\n}", "title": "" }, { "docid": "88000c8a9fc9a6971f0f223a07dd2de3", "score": "0.4738151", "text": "func (c HTTPClient) GetByIDs(ids ...string) ([]byte, error) {\n\treq, err := c.newReqWithToken(http.MethodPatch, \"/expenses/\"+strings.Join(ids, \",\"), nil)\n\tif err != nil {\n\t\treturn []byte{}, err\n\t}\n\treturn c.apiCall(req, http.StatusNoContent)\n}", "title": "" }, { "docid": "f66f213c026f314f9a266b7a39483df5", "score": "0.4711194", "text": "func (s deploymentService) GetByIDs(ids []string) ([]*Deployment, error) {\n\tif len(ids) == 0 {\n\t\treturn []*Deployment{}, nil\n\t}\n\n\tpath, err := getByIDsPath(s, ids)\n\tif err != nil {\n\t\treturn []*Deployment{}, err\n\t}\n\n\treturn s.getPagedResponse(path)\n}", "title": "" }, { "docid": "325315aed2c910913976d5d5c730146b", "score": "0.46787143", "text": "func getPersons(cx appengine.Context, ids []string) ([]Person, error) {\n\tconn := pool.Get(cx)\n\tdefer conn.Close()\n\tfor _, id := range ids {\n\t\tconn.Send(\"HGET\", \"HT:\"+id, \"dn\")\n\t}\n\tconn.Flush()\n\n\tvar pl []Person\n\tfor _, id := range ids {\n\t\tn, err := redisx.String(conn.Receive())\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"getPersons: receive name: %v\", err)\n\t\t}\n\t\tpl = append(pl, Person{Kind: \"abelana#follower\", PersonID: id, Name: n})\n\t}\n\treturn pl, nil\n}", "title": "" }, { "docid": "e7722619369dac9769c10606e5a50b9f", "score": "0.46220356", "text": "func (h *Handle) GetShowByAllNames(name string) (*Show, int64, error) {\n\tglog.Infof(\"Trying to match provider result %s\", name)\n\n\tglog.Infof(\"Trying to find an exact match in the database for %s\", name)\n\tdbshow, err := h.GetShowByName(name)\n\tif err == nil {\n\t\tglog.Infof(\"Matched name %s to show %s\", name, dbshow.Name)\n\t\treturn dbshow, -1, nil\n\t}\n\tglog.Infof(\"Couldn't find show with exact name %s in database.\", name)\n\n\tdbshow, season, err := h.GetShowFromNameException(name)\n\tif err == nil {\n\t\tglog.Infof(\"Matched provider result %s to show %s\", name, dbshow.Name)\n\t\treturn dbshow, season, nil\n\t}\n\tglog.Infof(\"Couldn't find a match scene name %s\", name)\n\n\treturn nil, -1, fmt.Errorf(\"Couldn't find a match for show %s\", name)\n}", "title": "" }, { "docid": "be4a66a74f96b528f085cdd6c147b7cb", "score": "0.45995247", "text": "func (m *ItemItemsItemWorkbookWorksheetsWorkbookWorksheetItemRequestBuilder) NamesById(id string)(*ItemItemsItemWorkbookWorksheetsItemNamesWorkbookNamedItemItemRequestBuilder) {\n urlTplParams := make(map[string]string)\n for idx, item := range m.pathParameters {\n urlTplParams[idx] = item\n }\n if id != \"\" {\n urlTplParams[\"workbookNamedItem%2Did\"] = id\n }\n return NewItemItemsItemWorkbookWorksheetsItemNamesWorkbookNamedItemItemRequestBuilderInternal(urlTplParams, m.requestAdapter)\n}", "title": "" }, { "docid": "db2a654209449a7c15e47dec88788094", "score": "0.443845", "text": "func (ms *MobileService) FindByNames(names []string, serviceCruder mobile.ServiceCruder) ([]*mobile.Service, error) {\n\tsvc, err := serviceCruder.List(filterServices(names))\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"Attempting to discover mobile services.\")\n\t}\n\treturn svc, nil\n}", "title": "" }, { "docid": "da6b8da0b88beb1f6ff9b7c293a0e4d8", "score": "0.44169152", "text": "func (r *Repository) GetShippersByName(name string) ([]*Shipper, error) {\n\toutput, err := r.dynamoDBClient.Query(&dynamodb.QueryInput{\n\t\tTableName: aws.String(r.tableName),\n\t\tIndexName: aws.String(\"gsi_1\"),\n\t\tKeyConditionExpression: aws.String(\"sk=:sk\"),\n\t\tExpressionAttributeValues: map[string]*dynamodb.AttributeValue{\n\t\t\t\":sk\": {\n\t\t\t\tS: aws.String(name),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to query orders from dynamodb: %v\", err)\n\t}\n\n\tvar shippers []*Shipper\n\n\tfor _, item := range output.Items {\n\t\trecord := &DynamoDBShipper{}\n\t\terr = dynamodbattribute.UnmarshalMap(item, record)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error unmarshalling record from DynamoDB: %v\", err)\n\t\t}\n\n\t\tshipper := Shipper(*record)\n\t\tshippers = append(shippers, &shipper)\n\t}\n\n\treturn shippers, nil\n}", "title": "" }, { "docid": "800d6475a9d4582b5eb0846c71560270", "score": "0.44078264", "text": "func (n *NullPersister) AppealsByChallengeIDs(challengeIDs []int) ([]*model.Appeal, error) {\n\treturn []*model.Appeal{}, nil\n}", "title": "" }, { "docid": "525a86d73331e5a4745d4c9818567735", "score": "0.43398517", "text": "func SearchAttempts(goal *itunes.Track) []string {\n\n\tnormName := strings.ToLower(goal.Name)\n\tnormArtist := strings.ToLower(goal.Artist)\n\tnormAlbum := strings.ToLower(goal.Album)\n\n\tqueries := []string{\n\t\tfmt.Sprintf(`\"%s\"`, normName),\n\t\tfmt.Sprintf(`\"%s\" \"%s\"`, normName, normArtist),\n\t\tfmt.Sprintf(`track:\"%s\"`, normName),\n\t\tfmt.Sprintf(`track:\"%s\" artist:\"%s\"`, normName, normArtist),\n\t}\n\n\tcleanName := normName\n\tcleanArtist := normArtist\n\tcleanAlbum := normAlbum\n\tfor r, options := range cleanReplacements {\n\n\t\tfor _, option := range options {\n\n\t\t\tcleanName = option.ReplaceAllString(cleanName, r)\n\t\t\tcleanArtist = option.ReplaceAllString(cleanArtist, r)\n\t\t\tcleanAlbum = option.ReplaceAllString(cleanAlbum, r)\n\n\t\t}\n\n\t}\n\n\tqueries = append(\n\t\tqueries, fmt.Sprintf(`track:\"%s\"`, cleanName))\n\tqueries = append(\n\t\tqueries, fmt.Sprintf(`track:\"%s\" artist:\"%s\"`, cleanName, cleanArtist))\n\n\tsimpleName := cleanName\n\tsimpleArtist := cleanArtist\n\tsimpleAlbum := cleanAlbum\n\tfor r, options := range simpleReplacements {\n\n\t\tfor _, option := range options {\n\n\t\t\tsimpleName = option.ReplaceAllString(simpleName, r)\n\t\t\tsimpleArtist = option.ReplaceAllString(simpleArtist, r)\n\t\t\tsimpleAlbum = option.ReplaceAllString(simpleAlbum, r)\n\n\t\t}\n\n\t}\n\n\tqueries = append(\n\t\tqueries, fmt.Sprintf(`track:\"%s\"`, simpleName))\n\tqueries = append(\n\t\tqueries, fmt.Sprintf(`track:\"%s\" artist:\"%s\"`, simpleName, simpleArtist))\n\n\tqueries = append(\n\t\tqueries, fmt.Sprintf(`\"%s\"`, cleanName))\n\tqueries = append(\n\t\tqueries, fmt.Sprintf(`\"%s\" \"%s\"`, cleanName, cleanArtist))\n\tqueries = append(\n\t\tqueries, fmt.Sprintf(`\"%s\"`, simpleName))\n\tqueries = append(\n\t\tqueries, fmt.Sprintf(`\"%s\" \"%s\"`, simpleName, simpleArtist))\n\n\tqueries = append(\n\t\tqueries, fmt.Sprintf(`track:\"%s\" artist:\"%s\" album:\"%s\"`, normName, normArtist, normAlbum))\n\tqueries = append(\n\t\tqueries, fmt.Sprintf(`track:\"%s\" artist:\"%s\" album:\"%s\"`, cleanName, cleanArtist, cleanAlbum))\n\tqueries = append(\n\t\tqueries, fmt.Sprintf(`track:\"%s\" artist:\"%s\" album:\"%s\"`, simpleName, simpleArtist, simpleAlbum))\n\n\tqueries = append(\n\t\tqueries, fmt.Sprintf(`\"%s\" \"%s\" \"%s\"`, normName, normArtist, normAlbum))\n\tqueries = append(\n\t\tqueries, fmt.Sprintf(`\"%s\" \"%s\" \"%s\"`, cleanName, cleanArtist, cleanAlbum))\n\tqueries = append(\n\t\tqueries, fmt.Sprintf(`\"%s\" \"%s\" \"%s\"`, simpleName, simpleArtist, simpleAlbum))\n\n\t// sort out duplicates\n\tvar ret []string\n\tfor _, q := range queries {\n\t\tif !StringInSlice(q, ret) {\n\t\t\tret = append(ret, q)\n\t\t}\n\t}\n\n\treturn ret\n\n}", "title": "" }, { "docid": "045c41a17424e29a3c8ddc3a3ebce0ec", "score": "0.43387705", "text": "func (p *PostgresPersister) AppealsByChallengeIDs(challengeIDs []int) ([]*model.Appeal, error) {\n\tappealTableName := p.GetTableName(postgres.AppealTableBaseName)\n\treturn p.appealsByChallengeIDsInTableInOrder(challengeIDs, appealTableName)\n}", "title": "" }, { "docid": "57ea6baf3f653d4f74bc98df31301686", "score": "0.43104577", "text": "func SelectMultipleByID(ids string) string {\n\tidsStr := strings.Split(ids, \",\")\n\tresult := []Repo{}\n\n\tfor _, id := range idsStr {\n\t\tidInt, err := utils.StrToInt(id)\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\t\trepo := new(Repo)\n\t\terr = DB.Model(repo).\n\t\t\tColumn(\"id\", \"name\", \"full_name\", \"htmlurl\", \"stargazers_count\", \"forks_count\", \"description\").\n\t\t\tWhere(\"id = ?\", id).\n\t\t\tOrder(\"stargazers_count DESC NULLS LAST\").\n\t\t\tSelect()\n\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\n\t\trepo.Modules = queryModules(idInt, 1)\n\t\tresult = append(result, *repo)\n\t}\n\n\tdbResponse := DBResponse{\n\t\tCount: len(result),\n\t\tItems: result,\n\t}\n\n\tj, _ := json.MarshalIndent(dbResponse, \"\", \" \")\n\n\treturn string(j)\n}", "title": "" }, { "docid": "4accc499725acc3725dd5077940c98fe", "score": "0.4302862", "text": "func (l *Locations) FindByIDs(ids []int) error {\n\tids = domain.UniquifyIntSlice(ids)\n\treturn DB.Where(\"id in (?)\", ids).All(l)\n}", "title": "" }, { "docid": "b3754fb853b9cc7ef5a6c8f9efa67ec8", "score": "0.4284751", "text": "func (s *Goal) RetrieveGoalByID(id int64) (res goal.Goal, e error) {\n\tfilter := \"ID=?\"\n\tqueryParam := id\n\n\tgoalSelectQuery := s.Client.Query().Read(CommunitygoaltrackerSchema, GoalTable, filter)\n\tgoalSelectQuery = s.Client.DB().Rebind(goalSelectQuery)\n\n\tdbRes := &GoalDTO{}\n\te = s.Client.DB().Get(dbRes, goalSelectQuery, queryParam)\n\tif e == sql.ErrNoRows {\n\t\treturn res, goal.ErrGoalNotFound\n\t}\n\n\treturn GoalPersistenceToDomain(*dbRes)\n\n}", "title": "" }, { "docid": "181ff7456e2bb249f24e81f13649f8a4", "score": "0.42588097", "text": "func (s *Store) ByNames(apiOp *types.APIRequest, schema *types.APISchema, names sets.String) (*unstructured.UnstructuredList, []types.Warning, error) {\n\tif apiOp.Namespace == \"*\" {\n\t\t// This happens when you grant namespaced objects with \"get\" by name in a clusterrolebinding. We will treat\n\t\t// this as an invalid situation instead of listing all objects in the cluster and filtering by name.\n\t\treturn nil, nil, nil\n\t}\n\tbuffer := WarningBuffer{}\n\tadminClient, err := s.clientGetter.TableAdminClient(apiOp, schema, apiOp.Namespace, &buffer)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tobjs, err := s.list(apiOp, schema, adminClient)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar filtered []unstructured.Unstructured\n\tfor _, obj := range objs.Items {\n\t\tif names.Has(obj.GetName()) {\n\t\t\tfiltered = append(filtered, obj)\n\t\t}\n\t}\n\n\tobjs.Items = filtered\n\treturn objs, buffer, nil\n}", "title": "" }, { "docid": "6a73201d8673e62e8f6fd18199fb853d", "score": "0.42341778", "text": "func (w *dbWrapper) GetMealsForOrderID(id int64) ([]orderMeal, error) {\n\t// define space for result set\n var meals []orderMeal\n\n // run query and handle error\n if err := w.db.Conn.\n Model(&meals).\n Where(\"order_id = ?\", id).\n Select(); err != nil {\n return nil, err\n } else {\n return meals, nil\n }\n}", "title": "" }, { "docid": "d6417bdc25245394b60fce6f435c7f3d", "score": "0.4164307", "text": "func (f *Finder) WithNames(names []string) *Finder { return f.IncludeName(names...) }", "title": "" }, { "docid": "e5c826837595411c1d1e843602bab1ba", "score": "0.41297707", "text": "func (h *Handler) GetGoal(c echo.Context) error {\n\tid := c.Param(\"id\")\n\tif err := h.validator.Var(id, \"required\"); err != nil {\n\t\treturn errBadRequest(err)\n\t}\n\n\tgoal, err := model.GetGoal(h.db, id)\n\tif err != nil {\n\t\treturn errInternalServer(err)\n\t}\n\n\treturn c.JSON(http.StatusOK, goal)\n}", "title": "" }, { "docid": "2ead45ff919436657e2531cfc3259697", "score": "0.4074179", "text": "func (f *ApplicationFetcher) getByName(name string) ([]fetcherResultSet, error) {\n\tcol, _, err := f.client.Application.GetApplications(\n\t\tWithDisabledDryRunContext(f.client),\n\t\t&c8y.ApplicationOptions{\n\t\t\tPaginationOptions: *c8y.NewPaginationOptions(2000),\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tpattern, err := regexp.Compile(\"^\" + regexp.QuoteMeta(name) + \"$\")\n\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"invalid regex\")\n\t}\n\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"Could not fetch by id\")\n\t}\n\n\tresults := make([]fetcherResultSet, 0)\n\n\tfor i, app := range col.Applications {\n\t\tif pattern.MatchString(app.Name) {\n\t\t\tresults = append(results, fetcherResultSet{\n\t\t\t\tID: app.ID,\n\t\t\t\tName: app.Name,\n\t\t\t\tValue: col.Items[i],\n\t\t\t})\n\t\t}\n\n\t}\n\n\treturn results, nil\n}", "title": "" }, { "docid": "65a0511c1ea13ae391f020416362c0ba", "score": "0.40720508", "text": "func (g GitHub) findIssuesWithString(id string) ([]string, error) {\n\tquery := fmt.Sprintf(\"repo:%s %s\", g.Repo, id)\n\topts := &github.SearchOptions{\n\t\tSort: \"date\",\n\t\tOrder: \"desc\",\n\t\tListOptions: github.ListOptions{Page: 1, PerPage: 1},\n\t}\n\tresult, _, err := g.Client.Search.Issues(context.Background(), query, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, issue := range result.Issues {\n\t\treturn []string{*issue.URL}, nil\n\t}\n\n\treturn nil, nil\n}", "title": "" }, { "docid": "d36f4f937f42e351a769e2da7111e59f", "score": "0.4068298", "text": "func FindAllRecipesByName(Name string) ([]RecipeWithDocID, error) {\n\tctx := context.Background()\n\tclient := SetFirestoreClient()\n\t// 必ずこの関数の最後でCLOSEするようにする\n\tdefer client.Close()\n\n\tvar recipes []RecipeWithDocID\n\titer := client.Collection(recipesCollectionName).Where(\"RecipeName\", \"==\", Name).Documents(ctx)\n\t//iter := client.Collection(recipesCollectionName).OrderBy(\"RecipeName\", firestore.Desc).StartAt(Name).EndAt(Name + \"\\uf8ff\").Documents(ctx)\n\tfor {\n\t\tdoc, err := iter.Next()\n\t\tif err == iterator.Done {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"Failed to iterate: %v\", err)\n\t\t\treturn nil, err\n\t\t}\n\t\tif !doc.Exists() {\n\t\t\treturn nil, nil\n\t\t}\n\n\t\trecipe := RecipeWithDocID{\n\t\t\tDocID: doc.Ref.ID,\n\t\t\tRecipe: Recipe{\n\t\t\t\tUserID: doc.Data()[\"UserID\"].(string),\n\t\t\t\tRecipeName: doc.Data()[\"RecipeName\"].(string),\n\t\t\t\tPictureURL: doc.Data()[\"PictureURL\"].(string),\n\t\t\t\tTime: doc.Data()[\"Time\"].(string),\n\t\t\t\tLikes: doc.Data()[\"Likes\"].(string),\n\t\t\t\tDislikes: doc.Data()[\"Dislikes\"].(string),\n\t\t\t\tPrices: doc.Data()[\"Prices\"].(string),\n\t\t\t\tServings: doc.Data()[\"Servings\"].(string),\n\t\t\t\tIsVisible: doc.Data()[\"IsVisible\"].(bool),\n\t\t\t\tOwnerComment: doc.Data()[\"OwnerComment\"].(string),\n\t\t\t\tIngredients: doc.Data()[\"Ingredients\"].([]interface{}),\n\t\t\t\t// Ingredients: doc.Data()[\"Ingredients\"].([]Material{\n\t\t\t\t// \tName:doc.Data()[\"Ingredients\"][\"Name\"],\n\t\t\t\t// \tAmount:doc.Data()[\"Ingredients\"][\"Amount\"],\n\t\t\t\t// \tUnit:doc.Data()[\"Ingredients\"][\"Unit\"],\n\t\t\t\t// }),\n\t\t\t\tSteps: doc.Data()[\"Steps\"].([]interface{}),\n\t\t\t},\n\t\t}\n\t\trecipes = append(recipes, recipe)\n\t}\n\n\treturn recipes, nil\n}", "title": "" }, { "docid": "73a37e004192ca50423fc2040873d06c", "score": "0.40517303", "text": "func (o *GetDealsParams) WithDealIds(DealIds []int64) *GetDealsParams {\n\to.DealIds = DealIds\n\treturn o\n}", "title": "" }, { "docid": "4416c0d43596c2db2a5a83ea65339389", "score": "0.40346706", "text": "func (a *App) getNames(w http.ResponseWriter, r *http.Request) {\n\tcount, _ := strconv.Atoi(r.FormValue(\"count\"))\n\tstart, _ := strconv.Atoi(r.FormValue(\"start\"))\n\n\tif count > 100 || count < 1 {\n\t\tcount = 100\n\t}\n\tif start < 0 {\n\t\tstart = 0\n\t}\n\n\tnames, err := getNames(a.DB, start, count)\n\tif err != nil {\n\t\trespondWithError(w, http.StatusInternalServerError, err.Error())\n\t\treturn\n\t}\n\n\trespondWithJSON(w, http.StatusOK, names)\n}", "title": "" }, { "docid": "0ac94bb30470756cdd4458d69c22fd9a", "score": "0.40126708", "text": "func (s deploymentService) GetByName(name string) ([]*Deployment, error) {\n\tpath, err := getByNamePath(s, name)\n\tif err != nil {\n\t\treturn []*Deployment{}, err\n\t}\n\n\treturn s.getPagedResponse(path)\n}", "title": "" }, { "docid": "a12a5ad971598edd857b2b5f87972d29", "score": "0.4002226", "text": "func HospitalsNotFound() error {\n\treturn status.Error(codes.NotFound, \"no hospitals found\")\n}", "title": "" }, { "docid": "0148e2bfdbe5d0301be18bd5afe30e47", "score": "0.40006334", "text": "func (_Installments *InstallmentsCaller) GetInstallments(opts *bind.CallOpts, id [32]byte) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _Installments.contract.Call(opts, out, \"getInstallments\", id)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "c46393ac4192bee4d5e170845df68f6f", "score": "0.39934835", "text": "func ByIds(ids []string) []Variant {\n\tvar found []Variant\n\n\tfor _, id := range ids {\n\t\tif variant, ok := variants[id]; ok {\n\t\t\tfound = append(found, variant)\n\t\t}\n\t}\n\n\treturn found\n}", "title": "" }, { "docid": "152bf94e43969c0a063863ac4e538258", "score": "0.39823917", "text": "func (p ProjectSubHandler) Get(res http.ResponseWriter, req *http.Request) {\n\tdefer req.Body.Close()\n\tqueries := req.URL.Query()\n\tdoneChan := make(chan bool)\n\tif len(queries[\"name\"]) > 0 {\n\t\tstore.Find(queries[\"name\"][0], func(dbRes []byte, err error) {\n\t\t\tif err != nil {\n\t\t\t\tp.Error.handle500(res, req, err)\n\t\t\t\tdoneChan <- true\n\t\t\t} else {\n\t\t\t\tres.WriteHeader(http.StatusOK)\n\t\t\t\tres.Write(dbRes)\n\t\t\t\tdoneChan <- true\n\t\t\t}\n\t\t})\n\t} else {\n\t\tgo func() {\n\t\t\tres.WriteHeader(http.StatusBadRequest)\n\t\t\tres.Write(([]byte)(\"Bad Request\"))\n\t\t\tdoneChan <- true\n\t\t}()\n\t}\n\t_ = <-doneChan\n}", "title": "" }, { "docid": "ef2d9053d924c85b3fc9d3cf16208503", "score": "0.3969061", "text": "func (a *MojangAPI) BulkGetId(names []string) ([]*entity.ProfileId, error) {\n if len(names) > 100 {\n return nil, errors.New(\"cannot request more than 100 names\")\n }\n\n payload, err := json.Marshal(names)\n if err != nil {\n return nil, err\n }\n\n res, err := a.execute(\"POST\", \"https://api.mojang.com/profiles/minecraft\", bytes.NewBuffer(payload))\n if err != nil {\n return nil, err\n }\n\n if res.StatusCode == 204 { // TODO: verify whether this case actually occurs\n return make([]*entity.ProfileId, 0), nil\n }\n\n defer res.Body.Close()\n return entity.ReadProfileIdArray(res.Body)\n}", "title": "" }, { "docid": "73b31349638e8f7187cfae75ae4a0947", "score": "0.39498568", "text": "func (p *presence) locate(ids []string) (map[string][]string, error) {\n\tconn := p.redis.Pool.Get()\n\tdefer conn.Close()\n\n\tlocations := make(map[string][]string)\n\n\tif err := conn.Send(\"MULTI\"); err != nil {\n\t\treturn locations, err\n\t}\n\n\tfor _, id := range ids {\n\t\tif err := conn.Send(\"GET\", clientPrefix+id); err != nil {\n\t\t\treturn locations, err\n\t\t}\n\t}\n\n\tresult, err := redis.Strings(conn.Do(\"EXEC\"))\n\n\tif err != nil {\n\t\treturn locations, err\n\t}\n\n\tfor i, location := range result {\n\t\tlocations[location] = append(locations[location], ids[i])\n\t}\n\n\treturn locations, nil\n}", "title": "" }, { "docid": "bbb49b0d7c49f1f959d6ca29b1fda51a", "score": "0.39461523", "text": "func ByNames(p ClientGenerator, names []string, cfg *Config, clusterName string) ([]Source, error) {\n\tsources := []Source{}\n\tfor _, name := range names {\n\t\tsource, err := BuildWithConfig(name, p, cfg, clusterName)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tsources = append(sources, source)\n\t}\n\n\treturn sources, nil\n}", "title": "" }, { "docid": "4b4bfb2b195b463dc535c03aa9c10f19", "score": "0.39403355", "text": "func ByIds(ids []string) db.Q {\n\treturn db.Query(bson.M{IdKey: bson.M{\"$in\": ids}})\n}", "title": "" }, { "docid": "7cc43838c2c27b49de2421092a6f5db0", "score": "0.39226723", "text": "func ResolveIdentifiers(api *ScalewayAPI, needles []string, out chan ScalewayResolvedIdentifier) {\n\t// first attempt, only lookup from the cache\n\tvar unresolved []string\n\tfor _, needle := range needles {\n\t\tidents, err := api.Cache.LookUpIdentifiers(needle)\n\t\tif err != nil {\n\t\t\tapi.Logger.Fatalf(\"%s\", err)\n\t\t}\n\t\tif len(idents) == 0 {\n\t\t\tunresolved = append(unresolved, needle)\n\t\t} else {\n\t\t\tout <- ScalewayResolvedIdentifier{\n\t\t\t\tIdentifiers: idents,\n\t\t\t\tNeedle: needle,\n\t\t\t}\n\t\t}\n\t}\n\t// fill the cache by fetching from the API and resolve missing identifiers\n\tif len(unresolved) > 0 {\n\t\t// compute identifierType:\n\t\t// if identifierType is the same for every unresolved needle,\n\t\t// we use it directly, else, we choose IdentifierUnknown to\n\t\t// fulfill every types of cache\n\t\tidentifierType, _ := parseNeedle(unresolved[0])\n\t\tfor _, needle := range unresolved {\n\t\t\tnewIdentifierType, _ := parseNeedle(needle)\n\t\t\tif identifierType != newIdentifierType {\n\t\t\t\tidentifierType = IdentifierUnknown\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\t// fill all the cache\n\t\tfillIdentifierCache(api, identifierType)\n\n\t\t// lookup again in the cache\n\t\tfor _, needle := range unresolved {\n\t\t\tidents, err := api.Cache.LookUpIdentifiers(needle)\n\t\t\tif err != nil {\n\t\t\t\tapi.Logger.Fatalf(\"%s\", err)\n\t\t\t}\n\t\t\tout <- ScalewayResolvedIdentifier{\n\t\t\t\tIdentifiers: idents,\n\t\t\t\tNeedle: needle,\n\t\t\t}\n\t\t}\n\t}\n\n\tclose(out)\n}", "title": "" }, { "docid": "5ac6dfcca11b07bf19233e30ced5d47c", "score": "0.39214143", "text": "func GetByName(name string) []User {\n\tvar users []User\n\tcore.GetDB().Where(\"name LIKE ?\", \"%\"+name+\"%\").Find(&users)\n\treturn users\n}", "title": "" }, { "docid": "afe245f140ccc830b918fde65f58b248", "score": "0.39208138", "text": "func (ac *AuthController) GetAuthsByAuthName(w http.ResponseWriter, r *http.Request) {\n\n\tvars := mux.Vars(r)\n\tsearchValue := vars[\"auth_name\"]\n\tif searchValue == \"\" {\n\t\trespondWithError(w, http.StatusBadRequest, \"missing search criteria\")\n\t\treturn\n\t}\n\n\top, predicate, err := buildStringQueryComponents(searchValue)\n\tif err != nil {\n\t\trespondWithError(w, http.StatusBadRequest, fmt.Sprintf(`{\"GetAuthByAuthName\": \"%s\"}`, err))\n\t\treturn\n\t}\n\n\t// build base Href; common for each selected row\n\turlString, err := buildHrefStringFromSimpleQueryReq(r, true)\n\tif err != nil {\n\t\trespondWithError(w, http.StatusBadRequest, fmt.Sprintf(`{\"GetAuthsByAuthName\": \"%s\"}`, err))\n\t\treturn\n\t}\n\n\tauths := ac.as.GetAuthsByAuthName(op, predicate)\n\tif auths != nil {\n\n\t\t// add the base Href/{id}\n\t\tfor i, b := range auths {\n\t\t\tauths[i].Href = urlString + strconv.FormatUint(uint64(b.ID), 10)\n\t\t}\n\t\trespondWithJSON(w, http.StatusOK, auths)\n\t\treturn\n\t}\n\trespondWithJSON(w, http.StatusOK, \"[]\")\n}", "title": "" }, { "docid": "c1c020006560e5500a69594fc68b869e", "score": "0.3919012", "text": "func (p *Project) FilterByNames(ctx context.Context, qs orm.QuerySeter, key string, value interface{}) orm.QuerySeter {\n\tquery, ok := value.(*NamesQuery)\n\tif !ok {\n\t\treturn qs\n\t}\n\n\tif len(query.Names) == 0 {\n\t\treturn qs\n\t}\n\n\tvar names []string\n\tfor _, v := range query.Names {\n\t\tnames = append(names, `'`+v+`'`)\n\t}\n\tsubQuery := fmt.Sprintf(\"SELECT project_id FROM project where name IN (%s)\", strings.Join(names, \",\"))\n\n\tif query.WithPublic {\n\t\tsubQuery = fmt.Sprintf(\"(%s) UNION (SELECT project_id FROM project_metadata WHERE name = 'public' AND value = 'true')\", subQuery)\n\t}\n\n\treturn qs.FilterRaw(\"project_id\", fmt.Sprintf(\"IN (%s)\", subQuery))\n}", "title": "" }, { "docid": "090a9d2393c7af3afbaec7e37a56c1d9", "score": "0.39130718", "text": "func (r *LiensService) Get(nameid string) *LiensGetCall {\n\tc := &LiensGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.nameid = nameid\n\treturn c\n}", "title": "" }, { "docid": "b293deb29444adcc5dc04630e9734e48", "score": "0.39079335", "text": "func (c *client) SelectNames(names []string, message string, selectAll bool, help string) ([]string, error) {\n\tvar answer []string\n\tif len(names) == 0 {\n\t\treturn answer, fmt.Errorf(\"No names to choose from\")\n\t}\n\tsort.Strings(names)\n\n\tprompt := &survey.MultiSelect{\n\t\tMessage: message,\n\t\tOptions: names,\n\t\tHelp: help,\n\t}\n\tif selectAll {\n\t\tprompt.Default = names\n\t}\n\tsurveyOpts := survey.WithStdio(c.in, c.out, c.err)\n\terr := survey.AskOne(prompt, &answer, nil, surveyOpts)\n\treturn answer, err\n}", "title": "" }, { "docid": "29a9d7bb1e17392e0e6657afc5f6cd96", "score": "0.390464", "text": "func (db *DbAdopterRepo) FindByID(id int) (domain.Adopter, error) {\n\tvar adopter domain.Adopter\n\n\tq := fmt.Sprintf(\"SELECT name FROM adopters WHERE id = %d\", id)\n\n\trow, err := db.dbHandler.Query(q)\n\tif err != nil {\n\t\treturn adopter, fmt.Errorf(\"can't find adopter with id %d:\\n\\t%v\", id, err)\n\t}\n\tdefer row.Close()\n\n\tvar name string\n\terr = row.Scan(&name)\n\tif err != nil {\n\t\treturn adopter, fmt.Errorf(\"can't find adopter with id %d:\\n\\t%v\", id, err)\n\t}\n\n\tadopter.ID = id\n\tadopter.Name = name\n\n\treturn adopter, nil\n}", "title": "" }, { "docid": "b216db2e3b71ed5466944a6af0c2e75d", "score": "0.39022622", "text": "func (h Halls) Take(id uint) (*Hall, error) {\n\tfor _, hall := range h {\n\t\tif hall.ID == id {\n\t\t\treturn &hall, nil\n\t\t}\n\t}\n\n\treturn &Hall{}, fmt.Errorf(\"no hall found for '%v'\", id)\n}", "title": "" }, { "docid": "3ca8b096f4b1a254f44b243cbfbde536", "score": "0.38885784", "text": "func Find(names []string, src string) string {\n\tif len(src) == 0 {\n\t\treturn \"\"\n\t}\n\n\tminDistance := -1\n\tmatchMap := make(map[int][]string)\n\n\tfor _, name := range names {\n\t\tdist := distanceForStrings(name, src)\n\t\tif dist >= DistanceSkipped {\n\t\t\tcontinue\n\t\t}\n\n\t\tif minDistance == -1 || dist < minDistance {\n\t\t\tminDistance = dist\n\t\t}\n\n\t\tmatchMap[dist] = append(matchMap[dist], name)\n\t}\n\n\tif len(matchMap) == 0 {\n\t\treturn \"\"\n\t}\n\n\treturn fmt.Sprintf(\", maybe you mean %s?\",\n\t\tstrings.Join(matchMap[minDistance], \" or \"))\n}", "title": "" }, { "docid": "5d1d34040326d5761736b720b1d80be8", "score": "0.38523808", "text": "func getUserByID(w http.ResponseWriter, r *http.Request) {\n\tlog.Println(r.URL)\n\n\tidRequested := mux.Vars(r)[\"id\"]\n\n\tfor _, v := range allPeople {\n\t\tif v.id == idRequested {\n\t\t\tfmt.Fprintf(w, \"User found:\\n\\tName: %v %v\\n\\tID: %v\\n\", v.firstName, v.lastName, v.id)\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Fprintf(w, \"User id %v not found\\n\", idRequested)\n}", "title": "" }, { "docid": "9c1bfe08594b8192553ab8d4f03babd3", "score": "0.3840427", "text": "func (env *Env) getUsersByID(userIDs []string) ([]directory.User, error) {\n\tusers, err := env.UserRepo.FindUsers(userIDs)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn users, nil\n}", "title": "" }, { "docid": "224889e3295b2e3f29880082f23c51fa", "score": "0.3840423", "text": "func (_Deals *DealsCaller) GetDeals(opts *bind.CallOpts, addr common.Address) ([]*big.Int, error) {\n\tvar (\n\t\tret0 = new([]*big.Int)\n\t)\n\tout := ret0\n\terr := _Deals.contract.Call(opts, out, \"GetDeals\", addr)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "ee94e02de331f13bf67ba18d9918d784", "score": "0.38296032", "text": "func (j *Journey) GetJourneybyName(name string) (re *[]Journey, err error) {\n\t//sql := fmt.Sprintf(\"SELECT * FROM %s WHERE city = '%s' order by favorite desc\", j.TableName(), name)\n\tsql := fmt.Sprintf(\"SELECT * FROM %s WHERE city = '%s' order by favorite asc\", j.TableName(), name)\n\tlog.Printf(\"%v\", sql)\n\tif re, err = querybySql(sql); err != nil {\n\t\tlog.Printf(\"query Journey by name error:%v\", err)\n\t\treturn nil, err\n\t}\n\n\treturn re, nil\n}", "title": "" }, { "docid": "b950087d5faad65da3c4c640e37c14cc", "score": "0.38258314", "text": "func LookupMultiple(names []string) ([]Source, error) {\n\tsources := []Source{}\n\n\tfor _, name := range names {\n\t\tsource := Lookup(name)\n\t\tif source == nil {\n\t\t\treturn nil, fmt.Errorf(\"%s source could not be identified\", name)\n\t\t}\n\t\tsources = append(sources, source)\n\t}\n\n\treturn sources, nil\n}", "title": "" }, { "docid": "e9e302f448b9379cc426f64f34dcd23e", "score": "0.381307", "text": "func (s *BaseStep) ResolveIDs(stepMap map[string]Step) error {\n\tif s.NextID != \"\" {\n\t\tvar ok bool\n\t\ts.Next, ok = stepMap[s.NextID]\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"StepID %s not found in workflow\", s.NextID)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "44633434c462f7ede2043403b6f7cf0f", "score": "0.38084722", "text": "func getFood(w http.ResponseWriter, r *http.Request) {\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tparams := mux.Vars(r) //getting params for food\n\n\t//loop through to find id\n\tfor _, item := range foods {\n\t\tif item.ID == params[\"id\"] {\n\t\t\tjson.NewEncoder(w).Encode(item)\n\t\t\treturn\n\t\t}\n\t}\n\tjson.NewEncoder(w).Encode(&Food{})\n}", "title": "" }, { "docid": "cfb8d6a8287abef8e0485f3901224f4f", "score": "0.38007987", "text": "func Alliances(mods ...qm.QueryMod) allianceQuery {\n\tmods = append(mods, qm.From(\"`alliances`\"))\n\treturn allianceQuery{NewQuery(mods...)}\n}", "title": "" }, { "docid": "d747856f3761a599c5811cbcbbad4f45", "score": "0.37989825", "text": "func (db *IGoalDBImpl) GetVisibleIGoals(deptIDs []string, dutyIDs []string, userIDs []string) (*VisibleIGoals, error) {\n\tconn, err := grpc.Dial(db.connectionStr, grpc.WithInsecure())\n\tif err != nil {\n\t\tlog.Fatal(\"While trying to dial dgraph gRPC\")\n\t}\n\tdefer conn.Close()\n\n\tdc := api.NewDgraphClient(conn)\n\tdg := dgo.NewDgraphClient(dc)\n\n\tvar deptXIDs = \"\"\n\tvar dutyXIDs = \"\"\n\tvar userXIDs = \"\"\n\tif len(deptIDs) > 0 {\n\t\tdeptXIDs = strings.Join(deptIDs, \" \")\n\t}\n\tif len(dutyIDs) > 0 {\n\t\tdutyXIDs = strings.Join(dutyIDs, \" \")\n\t}\n\tif len(userIDs) > 0 {\n\t\tuserXIDs = strings.Join(userIDs, \" \")\n\t}\n\n\tvariables := make(map[string]string)\n\tvariables[\"$dept_xid\"] = deptXIDs\n\tvariables[\"$duty_xid\"] = dutyXIDs\n\tvariables[\"$user_xid\"] = userXIDs\n\n\tconst q = `query Visible_igoals($dept_xid: string, $duty_xid: string, $user_xid: string){\n\t\tvar(func: anyofterms(dept_xid, $dept_xid)) {\n\t\t\tdept_uids as uid\n\t\t}\n\t\n\t\tvar(func: anyofterms(duty_xid, $duty_xid)) {\n\t\t\tduty_uids as uid\n\t\t}\n\t\n\t\tvar(func: anyofterms(user_xid, $user_xid)) {\n\t\t\tuser_uids as uid\n\t\t}\n\t\n\t\tvar(func: uid(dept_uids, duty_uids, user_uids)) @recurse(depth: 10, loop: true) {\n\t\t\tigoal_uid as igoal_xid\n\t\t\tparticipator {\n\t\t\t\tigoal_xid\n\t\t\t\tparent {\n\t\t\t\t\tigoal_xid\n\t\t\t\t}\n\t\t\t}\n\t\t\tmanager {\n\t\t\t\tigoal_xid\n\t\t\t\tparent {\n\t\t\t\t\tigoal_xid\n\t\t\t\t}\n\t\t\t}\n\t\t\towner {\n\t\t\t\tigoal_xid\n\t\t\t}\n\t\t\tparent {\n\t\t\t\tigoal_xid\n\t\t\t}\n\t\t}\n\t\n\t\tvisible_igoals(func: uid(igoal_uid), orderasc: updated_at) {\n\t\t\tigoal_id: igoal_xid\n\t\t\tname\n\t\t\tcreated_at\n\t\t\tstate\n\t\t\ttag: tag_of {\n\t\t\t\ttag_id: tag_xid\n\t\t\t\tname\n\t\t\t}\n\t\t\tcreator: ~owner {\n\t\t\t\tuser_id: user_xid\n\t\t\t}\n\t\t}\n\t}`\n\n\tctx := context.Background()\n\tresp, err := dg.NewTxn().QueryWithVars(ctx, q, variables)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t\treturn nil, err\n\t}\n\tfmt.Println(string(resp.GetJson()))\n\n\tvar r VisibleIGoals\n\terr = json.Unmarshal(resp.GetJson(), &r)\n\n\treturn &r, err\n}", "title": "" }, { "docid": "e1887cdd5f860eea353845a295cce23b", "score": "0.37987664", "text": "func (bc backendClient) QueryDeals(addrStr, product, side string, start, end, page, perPage int) (deals []types.Deal, err error) {\n\tperPageNum, err := params.CheckQueryOrdersParams(addrStr, product, side, start, end, page, perPage)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tdealsParams := params.NewQueryDealsParams(addrStr, product, int64(start), int64(end), page, perPageNum, side)\n\tjsonBytes, err := bc.GetCodec().MarshalJSON(dealsParams)\n\tif err != nil {\n\t\treturn deals, utils.ErrMarshalJSON(err.Error())\n\t}\n\n\tres, err := bc.Query(types.DealsPath, jsonBytes)\n\tif err != nil {\n\t\treturn deals, utils.ErrClientQuery(err.Error())\n\t}\n\n\tif err = utils.UnmarshalListResponse(res, &deals); err != nil {\n\t\treturn deals, utils.ErrUnmarshalJSON(err.Error())\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "c92455c45a74cf07c73290c89ae2ad51", "score": "0.37953442", "text": "func getUserNames(count int, userIds []string, slackClient *slack.Client) []string {\n\tuserNames := make([]string, count)\n\tvar wg sync.WaitGroup\n\twg.Add(count)\n\tfor idx, userId := range userIds {\n\t\ti, id := idx, userId\n\t\tgo func() {\n\t\t\tdetails := GetUserDetails(id, slackClient)\n\t\t\tuserNames[i] = details.Name\n\t\t\twg.Done()\n\t\t}()\n\t}\n\twg.Wait()\n\treturn userNames\n}", "title": "" }, { "docid": "77b70db624f2f442173c532a567af3d2", "score": "0.3789266", "text": "func ResolveNamed(factory Factory, namedInstances map[string][]interface{}) error {\n\tfor name, instances := range namedInstances {\n\t\tfor _, instance := range instances {\n\t\t\tif err := factory.ResolveNamed(instance, name); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d2dbeb40a5cf02b4160d3a562910cbca", "score": "0.3784644", "text": "func (o *GetDeploymentsUsingGETParams) SetIds(ids []strfmt.UUID) {\n\to.Ids = ids\n}", "title": "" }, { "docid": "73f787b6a823b2892e4373624416f720", "score": "0.37613297", "text": "func GetUsersByName(ctx context.Context, username string, groupID int64) (users []User, err error) {\n\tclient, err := firestore.NewClient(ctx, projectID)\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer client.Close()\n\n\tusers = []User{}\n\titer := client.Collection(\"users\").Where(\"name_insensitive\", \"==\", strings.ToLower(username)).Where(\"groupids\", \"array-contains\", groupID).Documents(ctx)\n\tfor {\n\t\tdoc, err := iter.Next()\n\t\tif err == iterator.Done {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tu := User{}\n\t\tif err = doc.DataTo(&u); err != nil {\n\t\t\tlogger.Warn().Err(err).Msg(\"GetUsersByName\")\n\t\t\tcontinue\n\t\t}\n\t\tu.Path = fmt.Sprintf(\"users/%d\", u.ID)\n\t\tusers = append(users, u)\n\t}\n\treturn users, nil\n}", "title": "" }, { "docid": "4e75f26c25a5a95fbeed23ba4720b167", "score": "0.37588313", "text": "func names_match(\np int32,/* points to the proposed match */\nid[]rune,\nt int32/* desired ilk */)bool{\nif len(name_dir[p].name)!=len(id){\nreturn false\n}\nif name_dir[p].ilk!=t&&!(t==normal&&name_dir[p].ilk> zero){\nreturn false\n}\nreturn compare_runes(id,name_dir[p].name)==0\n}", "title": "" }, { "docid": "2a20b9e59693e265d02729388d04a9ca", "score": "0.37557736", "text": "func wowapi(ids []string) (TMorphItems, error) {\n\tvar tmorphItems TMorphItems\n\tidslen := len(ids)\n\terrChan := make(chan error)\n\tdoneChan := make(chan bool, idslen)\n\n\tfor _, id := range ids {\n\t\tgo func(id string) {\n\t\t\tdefer func() {\n\t\t\t\tdoneChan <- true\n\t\t\t}()\n\n\t\t\tcontextUrl := \"\"\n\n\t\tREDO:\n\t\t\t// FIXME: using US api, ignoring user's location\n\t\t\tu, err := neturl.Parse(\"https://us.api.battle.net/wow/item/\" + id + contextUrl)\n\t\t\tif err != nil {\n\t\t\t\terrChan <- err\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tresp, err := apicall(u)\n\t\t\tif err != nil {\n\t\t\t\terrChan <- err\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tdata, err := ioutil.ReadAll(resp.Body)\n\t\t\tif err != nil {\n\t\t\t\terrChan <- err\n\t\t\t\treturn\n\t\t\t}\n\t\t\tresp.Body.Close()\n\n\t\t\tvar datam map[string]interface{}\n\t\t\terr = json.Unmarshal(data, &datam)\n\t\t\tif err != nil {\n\t\t\t\terrChan <- err\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif _, ok := datam[\"inventoryType\"]; !ok {\n\t\t\t\tif contexts, ok := datam[\"availableContexts\"]; ok {\n\t\t\t\t\tctxs := contexts.([]interface{})\n\t\t\t\t\tcontextUrl = \"/\" + ctxs[0].(string)\n\t\t\t\t\tgoto REDO\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tslot := int(to.Int64(datam[\"inventoryType\"]))\n\t\t\tif v, ok := slotMap[slot]; ok {\n\t\t\t\tslot = v\n\t\t\t}\n\t\t\tif canDisplaySlot(slot) {\n\t\t\t\ttmorphItems = append(tmorphItems, &TMorphItem{\n\t\t\t\t\tType: \"item\",\n\t\t\t\t\tArgs: []int{slot, int(to.Int64(id))},\n\t\t\t\t})\n\t\t\t}\n\t\t}(id)\n\t}\n\n\tcount := 0\n\tfor count < idslen {\n\t\tselect {\n\t\tcase err := <-errChan:\n\t\t\treturn nil, merry.Wrap(err)\n\t\tcase <-doneChan:\n\t\t\tcount++\n\t\t\tif count >= idslen {\n\t\t\t\treturn tmorphItems, nil\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil, nil\n}", "title": "" }, { "docid": "8b9d8f3f3ce6fd90175b8f94f3c015aa", "score": "0.37494642", "text": "func (r *Repo) FindByUserIdAndName(ctx context.Context, UserID uint, Name string) (*entity.Site, error) {\n\tvar sqlstr = sqlstr + `\n\t\tWHERE user_id = $1\n\t\t AND name = $2`\n\tvar m SiteModel\n\tif err := r.DB.QueryRowContext(\n\t\tctx,\n\t\tsqlstr,\n\t\tUserID,\n\t\tName,\n\t).Scan(\n\t\t&m.ID,\n\t\t&m.UserID,\n\t\t&m.Name,\n\t\t&m.URL,\n\t\t&m.RequestTimeout,\n\t\t&m.ResponseStatus,\n\t\t&m.Description,\n\t\t&m.CreatedAt,\n\t); err != nil {\n\t\tif err == sql.ErrNoRows {\n\t\t\tlog.Print(\"ErrNoRows in FindByUserIdAndURL\")\n\t\t\treturn nil, nil\n\t\t}\n\t\treturn nil, err\n\t}\n\te := ConvertIntoSiteEntity(m)\n\treturn &e, nil\n}", "title": "" }, { "docid": "436e32e3527dc700575f41d5add1c3c5", "score": "0.37436736", "text": "func (r *OrganizationsReportsService) Get(name string) *OrganizationsReportsGetCall {\n\tc := &OrganizationsReportsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.name = name\n\treturn c\n}", "title": "" }, { "docid": "a7b059e705862b89ae1a49ffa95ba153", "score": "0.37337098", "text": "func (r *WorkbookWorksheetNamesCollectionRequest) Get(ctx context.Context) ([]WorkbookNamedItem, error) {\n\tvar query string\n\tif r.query != nil {\n\t\tquery = \"?\" + r.query.Encode()\n\t}\n\treturn r.Paging(ctx, \"GET\", query, nil)\n}", "title": "" }, { "docid": "c02889a74a6bd48e60aa533b9ddb1337", "score": "0.37194777", "text": "func (c *pipelineClient) GetByName(ctx context.Context, name string) (*types.GitDeploy, error) {\n\tvar queryStruct struct {\n\t\tSpace struct {\n\t\t\tGitDeploys []struct {\n\t\t\t\tId graphql.String\n\t\t\t\tName graphql.String\n\t\t\t\tStatus graphql.String\n\t\t\t}\n\t\t} `graphql:\"space(id: $id)\"`\n\t}\n\tvariables := map[string]interface{}{\n\t\t\"id\": graphql.String(Context().Namespace),\n\t}\n\terr := query(ctx, &queryStruct, variables, c.client)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, gitDeploy := range queryStruct.Space.GitDeploys {\n\t\tif string(gitDeploy.Name) == name {\n\t\t\treturn &types.GitDeploy{\n\t\t\t\tID: string(gitDeploy.Id),\n\t\t\t\tName: string(gitDeploy.Name),\n\t\t\t\tStatus: string(gitDeploy.Status),\n\t\t\t}, nil\n\t\t}\n\t}\n\treturn nil, oktetoErrors.ErrNotFound\n}", "title": "" }, { "docid": "ecfc004ca1aa1d8ab1788a98770b6d28", "score": "0.3719136", "text": "func (pp PreparedPortals) Get(name string) (*PreparedPortal, bool) {\n\tportal, ok := pp.portals[name]\n\treturn portal, ok\n}", "title": "" }, { "docid": "9462d84c631a97eea943a15f59a2da2d", "score": "0.37122056", "text": "func FindAssignment(identifier string, all bool, opts ...canvas.Option) (*canvas.Assignment, error) {\n\tvar (\n\t\twg sync.WaitGroup\n\t\tdone = make(chan struct{}, 1) // just make sure it never blocks\n\t\tch = make(chan *canvas.Assignment)\n\t\tidLower = strings.ToLower(identifier)\n\t)\n\t// stop all the goroutines when the function stops\n\tdefer close(done)\n\n\tcourses, err := GetCourses(all)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tid, err := strconv.Atoi(identifier)\n\tif err != nil {\n\t\tid = -1\n\t}\n\n\twg.Add(len(courses))\n\tgo func() {\n\t\t// close all the channels when the courses\n\t\t// loop is finished\n\t\twg.Wait()\n\t\tclose(ch)\n\t}()\n\tgo func() {\n\t\tfor _, c := range courses {\n\t\t\tgo func(c *canvas.Course) {\n\t\t\t\tdefer wg.Done()\n\t\t\t\tif c.AccessRestrictedByDate {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tassignments := c.Assignments(\n\t\t\t\t\tcanvas.Opt(\"search_term\", identifier),\n\t\t\t\t\tcanvas.Opt(\"order_by\", \"name\"),\n\t\t\t\t\tcanvas.Opt(\"all_dates\", all),\n\t\t\t\t)\n\t\t\t\tfor {\n\t\t\t\t\tselect {\n\t\t\t\t\tcase <-done:\n\t\t\t\t\t\treturn\n\t\t\t\t\tcase as := <-assignments:\n\t\t\t\t\t\tif as == nil {\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif as.Name == identifier {\n\t\t\t\t\t\t\tch <- as\n\t\t\t\t\t\t} else if strings.ToLower(as.Name) == idLower {\n\t\t\t\t\t\t\tch <- as\n\t\t\t\t\t\t} else if as.QuizID == id { // be carfull here, if there is no quiz it will be 0\n\t\t\t\t\t\t\tch <- as\n\t\t\t\t\t\t} else if strings.HasPrefix(as.Name, identifier) {\n\t\t\t\t\t\t\tch <- as\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}(c)\n\n\t\t\t// remember we set `id` to -1 if identifier was not an int\n\t\t\tif id > 0 {\n\t\t\t\tass, err := c.Assignment(id)\n\t\t\t\tif err == nil {\n\t\t\t\t\tch <- ass\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}()\n\n\tselect {\n\tcase a := <-ch:\n\t\tif a == nil {\n\t\t\t// if its nil then the channel is closed\n\t\t\treturn nil, errAssignmentNotFound\n\t\t}\n\t\treturn a, nil\n\t}\n}", "title": "" }, { "docid": "9f4e8910513b2eb0173b9ebbd5eb3181", "score": "0.37057117", "text": "func (a *API) GetByName(title string, reply *Item) error {\n\tvar getItem Item\n\n\tfor _, val := range database {\n\t\tif val.Title == title {\n\t\t\tgetItem = val\n\t\t}\n\t}\n\t*reply = getItem\n\treturn nil\n}", "title": "" }, { "docid": "730f73278fda83d5f02f67819e7ce6b2", "score": "0.37006372", "text": "func testByIDs(t *testing.T) {\n\tcases := []struct {\n\t\targ []int // payment IDs\n\t\twantCount int // number of results\n\t\twantSum float64 // sum of invoice amounts\n\t}{\n\t\t{[]int{1}, 1, 110.11},\n\t\t{[]int{1, 2}, 2, 330.33},\n\t\t{[]int{1, 2, 3, 4}, 2, 330.33}, // 3 and 4 don't exist\n\t}\n\n\tfor _, c := range cases {\n\t\txi, err := invoice.ByIDs(ds, c.arg)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"invoice.ByIDs(%v) err = %s\", c.arg, err)\n\t\t}\n\t\tgotCount := len(xi)\n\t\tif gotCount != c.wantCount {\n\t\t\tt.Errorf(\"invoice.ByIDs(%v) count = %d, want %d\", c.arg, gotCount, c.wantCount)\n\t\t}\n\t\tvar gotSum float64\n\t\tfor _, i := range xi {\n\t\t\tgotSum += i.Amount\n\t\t}\n\t\tif gotSum != c.wantSum {\n\t\t\tt.Errorf(\"invoice.ByIDs(%v) sum amounts = %v, want %v\", c.arg, gotSum, c.wantSum)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4dfb8fbb12ec5681fc61087cc1d106ce", "score": "0.37001172", "text": "func (m TargetNameMap) CompleteNames(in []string, errs *errors.AggregatedError) (out []string) {\n\tfor _, name := range in {\n\t\tcompleted, err := m.CompleteName(name)\n\t\tif errs.Add(err) {\n\t\t\tcontinue\n\t\t}\n\t\tout = append(out, completed...)\n\t}\n\treturn\n}", "title": "" }, { "docid": "8d20be747f331c3ed7df5fcd24d99174", "score": "0.3696656", "text": "func (d MongoProvider) GetRoads(id string) ([]Road, error) {\n filter := bson.M{\"$or\": []bson.M{{\"a\": id}, {\"b\": id}}}\n ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)\n cur, err := roadsColl.Find(ctx, filter)\n if err != nil {\n return []Road{}, err\n }\n\n var roads []Road\n if err = cur.All(ctx, &roads); err != nil {\n return []Road{}, err\n }\n\n return roads, nil\n}", "title": "" }, { "docid": "a2e526ee676087eeab9f1c64d1964745", "score": "0.3693105", "text": "func NewGetAlliancesAllianceIDNotFound() *GetAlliancesAllianceIDNotFound {\n\treturn &GetAlliancesAllianceIDNotFound{}\n}", "title": "" }, { "docid": "9196b9647bce80baf7380f5489e5887a", "score": "0.36913273", "text": "func GetDeals(c *gin.Context) {\n\tvar deal []Models.Deal\n\terr := Models.GetAllDeals(&deal)\n\tif err != nil {\n\t\tc.AbortWithStatus(http.StatusNotFound)\n\t} else {\n\t\tc.JSON(http.StatusOK, deal)\n\t}\n}", "title": "" }, { "docid": "37a4f2f61b259665c5367d3a79895935", "score": "0.36910686", "text": "func IDS(mapGame []string, positions []Position) {\n\tplayerPos := positions[0]\n\tgoalPos := append(positions[:0], positions[1:]...)\n\texecuteIDS(playerPos, mapGame, goalPos)\n}", "title": "" }, { "docid": "31cca6690123a201a0b7baeed093ee60", "score": "0.3689565", "text": "func (s *Shades) ByName() []*Shade {\n\tm := s.Map()\n\tnames := make([]string, 0, len(m))\n\tshades := make([]*Shade, 0, len(m))\n\tfor name := range m {\n\t\tnames = append(names, name)\n\t}\n\tsort.Strings(names)\n\tfor _, name := range names {\n\t\tshades = append(shades, m[name])\n\t}\n\treturn shades\n}", "title": "" }, { "docid": "803acd6d0b09a03f9d61027ede8413c5", "score": "0.36839533", "text": "func (d *TenDatabase) GetRelationshipByIDs(ids []string) []*model.Relationship {\n\tvar relationships []*model.Relationship\n\tcursor, err := d.DB.Collection(\"mitre_attack\").\n\t\tFind(context.Background(), bson.D{{\n\t\t\tKey: \"id\",\n\t\t\tValue: bson.D{{\n\t\t\t\tKey: \"$in\",\n\t\t\t\tValue: ids,\n\t\t\t}},\n\t\t}})\n\tif err != nil {\n\t\treturn nil\n\t}\n\tdefer cursor.Close(context.Background())\n\n\tfor cursor.Next(context.Background()) {\n\t\trelationship := &model.Relationship{}\n\t\tif err := cursor.Decode(relationship); err != nil {\n\t\t\treturn nil\n\t\t}\n\t\trelationships = append(relationships, relationship)\n\t}\n\n\treturn relationships\n}", "title": "" }, { "docid": "c817803b2429a203ddc40521a27a6030", "score": "0.36819002", "text": "func ByName(name string, set []Deity) (Deity, error) {\n\tfor _, d := range set {\n\t\tif d.Name == name {\n\t\t\treturn d, nil\n\t\t}\n\t}\n\n\terr := fmt.Errorf(\"Deity with name \" + name + \" is not present in set\")\n\n\treturn Deity{}, err\n}", "title": "" }, { "docid": "566bc0e808b93e2768965c00ce85bcd3", "score": "0.3681535", "text": "func (namingService *NamingService) Lookup(name string) (interface{}, error) {\n\tnames := namingService.repository.List()\n\tfor _, value := range names {\n\t\tif value.name == name {\n\t\t\treturn value.proxy, nil\n\t\t}\n\t}\n\n\treturn nil, &NamingRecordNotFoundErr{name}\n}", "title": "" }, { "docid": "09f03965f1db45c9b8c925ff22d62575", "score": "0.36799142", "text": "func (self *Project) AllByName(ctx context.Context) ([]Project, error) {\n\tlog.Println(\"Finding project by name \", self.Name)\n\tvar projects []Project\n\n\tkeys, err := datastore.NewQuery(ProjectKind).Filter(\"name =\", self.Name).GetAll(ctx, &projects)\n\tif err != nil {\n\t\treturn projects, err\n\t}\n\tfor i, key := range keys {\n\t\tprojects[i].Key = key.IntID()\n\t}\n\treturn projects, nil\n}", "title": "" }, { "docid": "8c0b6ff0829b1139b587c4a4c92ee511", "score": "0.3679341", "text": "func (a *account) ByIDs(ctx context.Context, req *[]int64) (*[]*models.Account, error) {\n\treturn nil, nil\n}", "title": "" }, { "docid": "5bef3fe5d225da7abc1e7e822bbe9304", "score": "0.36759686", "text": "func Lookup(identifier string, rels []string) (*jrd.JRD, error) {\n\treturn DefaultClient.Lookup(identifier, rels)\n}", "title": "" }, { "docid": "76f1adf34b07503f2fbd094d82d224b1", "score": "0.36637345", "text": "func (o *EntityScreeningHitAnalysis) GetNamesOk() (*MatchSummaryCode, bool) {\n\tif o == nil || o.Names == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Names, true\n}", "title": "" }, { "docid": "ac2b799f2cd03ba3fbcabb3df3b77269", "score": "0.36628747", "text": "func (handler *RelationsHandler) Get(w http.ResponseWriter, r *http.Request, params map[string]string) (interface{}, error) {\n\n\t// be cautious\n\tuserID := string(params[\"user_id\"])\n\n\t// check user\n\tuser, _ := model.GetUserByID(userID)\n\tif user == nil {\n\t\treturn nil, NewRestfulError(errors.New(\"can not find user\"), http.StatusNotFound, \"can not find user\")\n\t}\n\n\trelations, err := model.GetRelationsByUserID(userID)\n\tif err != nil {\n\t\treturn nil, NewRestfulError(err, http.StatusInternalServerError, \"find relation wrong\")\n\t}\n\n\tresults := make([]*RelationResult, 0)\n\tfor _, rel := range relations {\n\t\tresult := handler.buildRelation(&rel)\n\t\tresults = append(results, result)\n\t}\n\n\treturn results, nil\n}", "title": "" }, { "docid": "c64eb79f48c1f9fa30bb6a7e0259f57e", "score": "0.36608183", "text": "func (sc *subcommandContext) findIDs(inputs []string) ([]uuid.UUID, error) {\n\tuuids, names := splitUuids(inputs)\n\n\tfor _, name := range names {\n\t\tfilter := cfapi.NewTunnelFilter()\n\t\tfilter.NoDeleted()\n\t\tfilter.ByName(name)\n\n\t\ttunnels, err := sc.list(filter)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif len(tunnels) != 1 {\n\t\t\treturn nil, fmt.Errorf(\"there should only be 1 non-deleted Tunnel named %s\", name)\n\t\t}\n\n\t\tuuids = append(uuids, tunnels[0].ID)\n\t}\n\n\treturn uuids, nil\n}", "title": "" }, { "docid": "56f6f56e0c344e6a738510b5cdc3becd", "score": "0.365858", "text": "func GetBookings(userName string, db gorm.DB) []models.Booking {\n\tvar bookings []models.Booking\n\terr := db.Where(\"user_name = ? \", userName).Find(&bookings).Error\n\tif errors.Is(err, gorm.ErrRecordNotFound) {\n\t\tfmt.Println(\"There is no Gp\")\n\t\treturn nil\n\t} else {\n\t\treturn bookings\n\t}\n}", "title": "" }, { "docid": "73ed84c9eda84c976e155525c10c315a", "score": "0.36574355", "text": "func NewGoalsParams() *GoalsParams {\n\tvar (\n\t\tuserDefault = string(\"current\")\n\t)\n\treturn &GoalsParams{\n\t\tUser: userDefault,\n\n\t\ttimeout: cr.DefaultTimeout,\n\t}\n}", "title": "" }, { "docid": "81f9d8a5a158fa41f57bbd36e23c41e7", "score": "0.36567125", "text": "func (dao *repositoryDAO) QueryByName(db *mongo.Database, nameList []string) ([]*models.Repository, error) {\n\tvar queryList *bson.Array\n\n\tfor _, name := range nameList {\n\t\tqueryList.Append(bson.VC.String(name))\n\t}\n\n\treturn dao.query(db, 0, 0, bson.NewDocument(\n\t\tbson.EC.SubDocumentFromElements(\"name\",\n\t\t\tbson.EC.Array(\"$in\", queryList),\n\t\t),\n\t))\n}", "title": "" }, { "docid": "990218cfbba9691eb82306ce50925314", "score": "0.364666", "text": "func GetRandomNames(path string, opt *Options) ([]string, error) {\n\tif opt.Max > 100 {\n\t\topt.Max = 100\n\t} else if opt.Max < 0 {\n\t\topt.Max = 0\n\t}\n\tif opt.Number <= 0 {\n\t\topt.Number = 1\n\t}\n\n\tfile, err := getFile(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer file.Close()\n\n\tdata := []*name{}\n\tscanner := bufio.NewScanner(file)\n\tfor scanner.Scan() {\n\t\tn := getNameStruct(scanner.Text())\n\t\tdata = append(data, n)\n\t}\n\n\tif err := scanner.Err(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tnames := getRandomNames(data, opt)\n\treturn names, nil\n}", "title": "" }, { "docid": "c3a4828b65379dffb2d8221e6b3c10c8", "score": "0.36465627", "text": "func NewWishlistsByIDGetNotFound() *WishlistsByIDGetNotFound {\n\treturn &WishlistsByIDGetNotFound{}\n}", "title": "" }, { "docid": "295903d1872448ce993db3824c32390d", "score": "0.3644772", "text": "func FindByName(tins []*TypeInfo, name string) (ret *TypeInfo, okay bool) {\n\tfor _, t := range tins {\n\t\tif t.Name == name {\n\t\t\tret, okay = t, true\n\t\t\tbreak\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "13dd75bdd77518fbfc2901abdfc9af9b", "score": "0.36424726", "text": "func (m *MockTriggersRepo) GetAllDefinitionsNamesAndIDs() ([]entities.TriggerDefinition, error) {\n\tret := m.ctrl.Call(m, \"GetAllDefinitionsNamesAndIDs\")\n\tret0, _ := ret[0].([]entities.TriggerDefinition)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "0c22c617771c4caefbb39ad93285ad18", "score": "0.3633956", "text": "func (store SQLStore) GetRestaurantsByNameMatch(restName string) ([]*Restaurant, error) {\n\toutput := []*Restaurant{}\n\tinq := `select RestaurantID, RestaurantName, RestaurantAddress, RestaurantCity, \n\tRestaurantState, RestaurantZip, RestaurantImg, RestaurantURL\n\tfrom Restaurants\n\twhere RestaurantName like '%' + @RN + '%'`\n\trows, err := store.db.QueryContext(context.Background(), inq, sql.Named(\"RN\", restName))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer rows.Close()\n\tfor rows.Next() {\n\t\tthisRestaurant := &Restaurant{}\n\t\tif err := rows.Scan(&thisRestaurant.ID, &thisRestaurant.Name, &thisRestaurant.Address, &thisRestaurant.City,\n\t\t\t&thisRestaurant.State, &thisRestaurant.Zip, &thisRestaurant.Img, &thisRestaurant.Url); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t//future consideration: GIS capabilities\n\t\tthisRestaurant.Menu, err = store.GetRestaurantMenu(thisRestaurant.ID)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\toutput = append(output, thisRestaurant)\n\t}\n\tif err = rows.Err(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn output, nil\n}", "title": "" }, { "docid": "04f4093666da5db3517497332a4bdb4d", "score": "0.3633793", "text": "func IndexByIDAndName(mapping *[]v2vv1alpha1.ResourceMappingItem) (mapByID map[string]v2vv1alpha1.ResourceMappingItem, mapByName map[string]v2vv1alpha1.ResourceMappingItem) {\n\tmapByID = make(map[string]v2vv1alpha1.ResourceMappingItem)\n\tmapByName = make(map[string]v2vv1alpha1.ResourceMappingItem)\n\tfor _, item := range *mapping {\n\t\tif item.Source.ID != nil {\n\t\t\tmapByID[*item.Source.ID] = item\n\t\t}\n\t\tif item.Source.Name != nil {\n\t\t\tmapByName[*item.Source.Name] = item\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "381240fe03b2b8f2c80ada013635001a", "score": "0.36337188", "text": "func (c *NametitleClient) Get(ctx context.Context, id int) (*Nametitle, error) {\n\treturn c.Query().Where(nametitle.ID(id)).Only(ctx)\n}", "title": "" }, { "docid": "d111f7ec482d4e47e01998bf20d9ead4", "score": "0.36308688", "text": "func (o *GetDeploymentsUsingGETParams) WithIds(ids []strfmt.UUID) *GetDeploymentsUsingGETParams {\n\to.SetIds(ids)\n\treturn o\n}", "title": "" }, { "docid": "c5267098b6294a61bce14d005e864f18", "score": "0.36249915", "text": "func Resolve(rolls ...*Roll) {\n\n\tfmt.Println(\"Opposed Roll Resolution\")\n\n\tvar results []Match\n\n\t// Initialize map to count actions\n\tvar actors map[string]int\n\tvar actions map[string][]string\n\n\tfor _, r := range rolls {\n\n\t\tname := r.Actor.Name\n\n\t\t// Declarations\n\n\t\t// Sort by r.Actor.Sense\n\n\t\t// Track number of actions per actor\n\t\tactors[name] = r.NumActions\n\n\t\t// Declare actions for each action taken\n\n\tChooseAction:\n\t\tfor actors[r.Actor.Name] > 0 {\n\t\t\tfmt.Printf(\"Declare action %d of %d for %s.\",\n\t\t\t\tactors[r.Actor.Name],\n\t\t\t\tr.NumActions,\n\t\t\t\tr.Actor.Name)\n\n\t\t\tanswer := UserQuery(`\n\t\t\t1: Attack\n\t\t\t2: Defend\n\t\t\t3: Useful\n\n\t\t\tChoice: `)\n\n\t\t\tif answer == \"\" {\n\t\t\t\tfmt.Println(\"Exiting\")\n\t\t\t\tbreak ChooseAction\n\t\t\t}\n\n\t\t\tswitch answer {\n\t\t\tcase \"1\":\n\t\t\t\tactions[name] = append(actions[name], \"attack\")\n\t\t\t\tactors[name]--\n\t\t\tcase \"2\":\n\t\t\t\tactions[name] = append(actions[name], \"defend\")\n\t\t\t\tactors[name]--\n\t\t\tcase \"3\":\n\t\t\t\tactions[name] = append(actions[name], \"useful\")\n\t\t\t\tactors[name]--\n\t\t\tdefault:\n\t\t\t\tfmt.Println(\"Not a valid option. Please choose again\")\n\t\t\t}\n\t\t}\n\n\t\tfmt.Printf(\"Actor: %s, Action: %s, GoFirst: %d, Spray: %d, Wiggle Dice: %dwd\\n\",\n\t\t\tr.Actor.Name,\n\t\t\tr.Action,\n\t\t\tr.DiePool.GoFirst,\n\t\t\tr.DiePool.Spray,\n\t\t\tr.Wiggles,\n\t\t)\n\n\t\tfor _, m := range r.Matches {\n\t\t\tresults = append(results, m)\n\t\t}\n\t\tsort.Sort(ByWidthHeight(results))\n\t}\n\n\t//for _, m := range results {\n\t// In initiative order, let actors allocate their Matches\n\t// Attack = wound opponent and knock a die from their highest matche\n\t// Defend = gobble attacks against the actor\n\t// Useful = do something else\n}", "title": "" }, { "docid": "b0bec9a6ca94b6f211622ae5b4bbb5ab", "score": "0.36231482", "text": "func (db *GuerateamDB) Get(id string, c chan Result) {\n\tdefer close(c)\n\n\tresult := Result{}\n\titem, ok := guerateamItems[id]\n\tif ok {\n\t\tresult.Result = item\n\t\tresult.Err = nil\n\t} else {\n\t\tresult.Err = errors.New(\"No result\")\n\t}\n\n\tc <- result\n}", "title": "" }, { "docid": "5ad6ada164ff29f63abd488f693dbc34", "score": "0.36217335", "text": "func readGroupsWhereName(db *sql.DB, name string) []Group {\n\tstmt, err := db.Prepare(\"select id, name from groups where name=?\")\n\tif err != nil {\n\t\tlog.Println(err)\n\t}\n\tdefer stmt.Close()\n\n\trows, err := stmt.Query(name)\n\tif err != nil {\n\t\tlog.Println(err)\n\t}\n\tdefer rows.Close()\n\n\tvar groups []Group\n\tfor rows.Next() {\n\t\tvar group Group\n\t\tif err = rows.Scan(&group.ID, &group.Name); err != nil {\n\t\t\tlog.Println(err)\n\t\t}\n\t\tgroups = append(groups, group)\n\t}\n\treturn groups\n}", "title": "" }, { "docid": "98aefe5636b983761ed0c4d44a97b05e", "score": "0.36210006", "text": "func (s *BoltTranslateStore) TranslateIDs(ids []uint64) ([]string, error) {\n\tif len(ids) == 0 {\n\t\treturn nil, nil\n\t}\n\n\ttx, err := s.db.Begin(false)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer func() { _ = tx.Rollback() }()\n\n\tbucket := tx.Bucket(bucketIDs)\n\n\tkeys := make([]string, len(ids))\n\tfor i, id := range ids {\n\t\tkeys[i] = findKeyByID(bucket, id)\n\t}\n\treturn keys, nil\n}", "title": "" }, { "docid": "57ecfc0d19a795f29fc9b12807ac7287", "score": "0.36176193", "text": "func FindJokeByIDHandler(w http.ResponseWriter, r *http.Request) {\n\tparams := mux.Vars(r)\n\tjokeID := params[\"id\"]\n\n\t// but i guess we cant even get here if it's blank in the url (from handlefunc)\n\tif jokeID = strings.TrimSpace(jokeID); jokeID == \"\" {\n\t\thttp.Error(w, \"Provided jokeID is blank or whitespace!\", http.StatusNotFound)\n\t\treturn\n\t}\n\n\tfmt.Println(\"Looking for joke in database...\")\n\n\tresponseObject, err := Broker.BrokerConstructor().FindJokeByID(jokeID)\n\n\tif err != nil {\n\t\tfmt.Println(err.Error())\n\t\tloadMessageInIndexHTML(w, \"Failed to find joke!\")\n\t\t// fmt.Print(w, \"Failed to find joke!\")\n\t\treturn\n\t}\n\n\tdadJoke := responseObject.Joke\n\n\t// fmt.Fprint(w, \"DB find by ID successful!\\n\")\n\t// fmt.Fprint(w, \"Joke ID (for debugging): \"+jokeID+\"\\n\")\n\t// fmt.Fprint(w, \"Dad joke: \"+dadJoke)\n\n\tfmt.Println(\"DB find by ID successful!\")\n\tfmt.Println(\"Joke ID (for debugging): \" + jokeID)\n\tloadMessageInIndexHTML(w, \"Dad joke: \"+dadJoke)\n\n}", "title": "" }, { "docid": "e1a3df3cea80be46927dd439db1682c3", "score": "0.36164814", "text": "func (v Stories) GetByID(params StoriesGetByIDParams) (StoriesGetByIDResponse, error) {\n\tr, err := v.API.Request(\"stories.getById\", params)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar resp StoriesGetByIDResponse\n\tif params.Extended {\n\t\tvar tmp StoriesGetByIDResponseExtended\n\t\terr = json.Unmarshal(r, &tmp)\n\t\tresp = &tmp\n\t} else {\n\t\tvar tmp StoriesGetByIDResponseNormal\n\t\terr = json.Unmarshal(r, &tmp)\n\t\tresp = &tmp\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn resp, nil\n}", "title": "" } ]
9171b2b5c55e196dc7f9ac894d91900a
UnmarshalJSON implements the json.Unmarshaller interface for type ServiceProperties.
[ { "docid": "17b44f1cf5013a4a88430557f63b60f0", "score": "0.8307017", "text": "func (s *ServiceProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &s.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" } ]
[ { "docid": "d8a4eeadc0ab72bbe617b454cf8ec067", "score": "0.8263332", "text": "func (s *ServiceProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"logAnalyticsWorkspaceProperties\":\n\t\t\terr = unpopulate(val, \"LogAnalyticsWorkspaceProperties\", &s.LogAnalyticsWorkspaceProperties)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"peeringServiceLocation\":\n\t\t\terr = unpopulate(val, \"PeeringServiceLocation\", &s.PeeringServiceLocation)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"peeringServiceProvider\":\n\t\t\terr = unpopulate(val, \"PeeringServiceProvider\", &s.PeeringServiceProvider)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"providerBackupPeeringLocation\":\n\t\t\terr = unpopulate(val, \"ProviderBackupPeeringLocation\", &s.ProviderBackupPeeringLocation)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"providerPrimaryPeeringLocation\":\n\t\t\terr = unpopulate(val, \"ProviderPrimaryPeeringLocation\", &s.ProviderPrimaryPeeringLocation)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &s.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "927314a3a0f346661175c7e235284499", "score": "0.79718554", "text": "func (p *Properties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", p, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"serviceSpecification\":\n\t\t\terr = unpopulate(val, \"ServiceSpecification\", &p.ServiceSpecification)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", p, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "25772de825ea111bd60dd756178c4f07", "score": "0.7752435", "text": "func (s *ServiceEndpointPropertiesFormat) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"locations\":\n\t\t\terr = unpopulate(val, \"Locations\", &s.Locations)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &s.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"service\":\n\t\t\terr = unpopulate(val, \"Service\", &s.Service)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "12ab0bb6f7613d992dcc7d1834ccf561", "score": "0.7731771", "text": "func (s *ServiceProviderProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"peeringLocations\":\n\t\t\terr = unpopulate(val, \"PeeringLocations\", &s.PeeringLocations)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"serviceProviderName\":\n\t\t\terr = unpopulate(val, \"ServiceProviderName\", &s.ServiceProviderName)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "04419584f19851a1000bd314e3f6897f", "score": "0.7724845", "text": "func (s *ServiceProviderProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"devPortalUrl\":\n\t\t\terr = unpopulate(val, \"DevPortalURL\", &s.DevPortalURL)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"displayName\":\n\t\t\terr = unpopulate(val, \"DisplayName\", &s.DisplayName)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"id\":\n\t\t\terr = unpopulate(val, \"ID\", &s.ID)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"iconUrl\":\n\t\t\terr = unpopulate(val, \"IconURL\", &s.IconURL)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"parameters\":\n\t\t\terr = unpopulate(val, \"Parameters\", &s.Parameters)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"serviceProviderName\":\n\t\t\terr = unpopulate(val, \"ServiceProviderName\", &s.ServiceProviderName)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0cb34b988beb82f54cc3eeedf49343a6", "score": "0.76849705", "text": "func (d *DeviceServiceProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", d, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"adminDomainName\":\n\t\t\terr = unpopulate(val, \"AdminDomainName\", &d.AdminDomainName)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"billingDomainName\":\n\t\t\terr = unpopulate(val, \"BillingDomainName\", &d.BillingDomainName)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"notes\":\n\t\t\terr = unpopulate(val, \"Notes\", &d.Notes)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"quantity\":\n\t\t\terr = unpopulate(val, \"Quantity\", &d.Quantity)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"startDate\":\n\t\t\terr = unpopulateTimeRFC3339(val, \"StartDate\", &d.StartDate)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", d, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "23166f55474338a02a3fcca2ca3fa452", "score": "0.7499167", "text": "func (s *ServiceLocationProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"azureRegion\":\n\t\t\terr = unpopulate(val, \"AzureRegion\", &s.AzureRegion)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"country\":\n\t\t\terr = unpopulate(val, \"Country\", &s.Country)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"state\":\n\t\t\terr = unpopulate(val, \"State\", &s.State)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "03ad5f3d4f0525b53ceba3e66f28894d", "score": "0.7395955", "text": "func (o *OperationProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", o, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"serviceSpecification\":\n\t\t\terr = unpopulate(val, \"ServiceSpecification\", &o.ServiceSpecification)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", o, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d3a3d38f8dbc2a76b8c37eff39b59761", "score": "0.73264134", "text": "func (m *MediaServiceProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", m, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"encryption\":\n\t\t\terr = unpopulate(val, \"Encryption\", &m.Encryption)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"keyDelivery\":\n\t\t\terr = unpopulate(val, \"KeyDelivery\", &m.KeyDelivery)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"mediaServiceId\":\n\t\t\terr = unpopulate(val, \"MediaServiceID\", &m.MediaServiceID)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"privateEndpointConnections\":\n\t\t\terr = unpopulate(val, \"PrivateEndpointConnections\", &m.PrivateEndpointConnections)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &m.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"publicNetworkAccess\":\n\t\t\terr = unpopulate(val, \"PublicNetworkAccess\", &m.PublicNetworkAccess)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"storageAccounts\":\n\t\t\terr = unpopulate(val, \"StorageAccounts\", &m.StorageAccounts)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"storageAuthentication\":\n\t\t\terr = unpopulate(val, \"StorageAuthentication\", &m.StorageAuthentication)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", m, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b944c8a292fcbe9551c6846c1037c521", "score": "0.7318518", "text": "func (s *ServiceProvider) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"properties\":\n\t\t\terr = unpopulate(val, \"Properties\", &s.Properties)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3be381efed56bbdec38c7132cf9e6ef4", "score": "0.73018456", "text": "func (s *ServiceUpdate) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"properties\":\n\t\t\terr = unpopulate(val, \"Properties\", &s.Properties)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8b5f4d6533bb9df6e563ca5bf7bedf90", "score": "0.7287338", "text": "func (s *ServiceRegionProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"name\":\n\t\t\terr = unpopulate(val, \"Name\", &s.Name)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"primaryRegionProperties\":\n\t\t\terr = unpopulate(val, \"PrimaryRegionProperties\", &s.PrimaryRegionProperties)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1a721ba1c76b062dc729d0f57884d3cb", "score": "0.7253072", "text": "func (p *Properties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", p, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"direct\":\n\t\t\terr = unpopulate(val, \"Direct\", &p.Direct)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"exchange\":\n\t\t\terr = unpopulate(val, \"Exchange\", &p.Exchange)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"peeringLocation\":\n\t\t\terr = unpopulate(val, \"PeeringLocation\", &p.PeeringLocation)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &p.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", p, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "19f923b7d569c65da49f9677e987bf69", "score": "0.72530705", "text": "func (s *Service) UnmarshalJSON(body []byte) error {\n\tvar m map[string]*json.RawMessage\n\terr := json.Unmarshal(body, &m)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor k, v := range m {\n\t\tswitch k {\n\t\tcase \"sku\":\n\t\t\tif v != nil {\n\t\t\t\tvar sku ServiceSku\n\t\t\t\terr = json.Unmarshal(*v, &sku)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\ts.Sku = &sku\n\t\t\t}\n\t\tcase \"properties\":\n\t\t\tif v != nil {\n\t\t\t\tvar serviceProperties ServiceProperties\n\t\t\t\terr = json.Unmarshal(*v, &serviceProperties)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\ts.ServiceProperties = &serviceProperties\n\t\t\t}\n\t\tcase \"location\":\n\t\t\tif v != nil {\n\t\t\t\tvar location string\n\t\t\t\terr = json.Unmarshal(*v, &location)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\ts.Location = &location\n\t\t\t}\n\t\tcase \"tags\":\n\t\t\tif v != nil {\n\t\t\t\tvar tags map[string]*string\n\t\t\t\terr = json.Unmarshal(*v, &tags)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\ts.Tags = tags\n\t\t\t}\n\t\tcase \"name\":\n\t\t\tif v != nil {\n\t\t\t\tvar name string\n\t\t\t\terr = json.Unmarshal(*v, &name)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\ts.Name = &name\n\t\t\t}\n\t\tcase \"id\":\n\t\t\tif v != nil {\n\t\t\t\tvar ID string\n\t\t\t\terr = json.Unmarshal(*v, &ID)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\ts.ID = &ID\n\t\t\t}\n\t\tcase \"type\":\n\t\t\tif v != nil {\n\t\t\t\tvar typeVar string\n\t\t\t\terr = json.Unmarshal(*v, &typeVar)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\ts.Type = &typeVar\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "5ee262f8adc710291fac1a671564a490", "score": "0.7250631", "text": "func (s *ServiceEndpointPolicyPropertiesFormat) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"contextualServiceEndpointPolicies\":\n\t\t\terr = unpopulate(val, \"ContextualServiceEndpointPolicies\", &s.ContextualServiceEndpointPolicies)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &s.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"resourceGuid\":\n\t\t\terr = unpopulate(val, \"ResourceGUID\", &s.ResourceGUID)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"serviceAlias\":\n\t\t\terr = unpopulate(val, \"ServiceAlias\", &s.ServiceAlias)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"serviceEndpointPolicyDefinitions\":\n\t\t\terr = unpopulate(val, \"ServiceEndpointPolicyDefinitions\", &s.ServiceEndpointPolicyDefinitions)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"subnets\":\n\t\t\terr = unpopulate(val, \"Subnets\", &s.Subnets)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "231bf891068b01bc3dc08fdce41fe702", "score": "0.7247562", "text": "func (s *ServiceTagInformationPropertiesFormat) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"addressPrefixes\":\n\t\t\terr = unpopulate(val, \"AddressPrefixes\", &s.AddressPrefixes)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"changeNumber\":\n\t\t\terr = unpopulate(val, \"ChangeNumber\", &s.ChangeNumber)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"region\":\n\t\t\terr = unpopulate(val, \"Region\", &s.Region)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"state\":\n\t\t\terr = unpopulate(val, \"State\", &s.State)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"systemService\":\n\t\t\terr = unpopulate(val, \"SystemService\", &s.SystemService)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "432f23169f9fc6ccc67a8deb87695869", "score": "0.7177609", "text": "func (p *Properties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", p, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"createdTime\":\n\t\t\terr = unpopulateTimeRFC3339(val, \"CreatedTime\", &p.CreatedTime)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"hostName\":\n\t\t\terr = unpopulate(val, \"HostName\", &p.HostName)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"lastUpdatedTime\":\n\t\t\terr = unpopulateTimeRFC3339(val, \"LastUpdatedTime\", &p.LastUpdatedTime)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"privateEndpointConnections\":\n\t\t\terr = unpopulate(val, \"PrivateEndpointConnections\", &p.PrivateEndpointConnections)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &p.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"publicNetworkAccess\":\n\t\t\terr = unpopulate(val, \"PublicNetworkAccess\", &p.PublicNetworkAccess)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", p, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6fb9c74e49e409553e03d57897dbeeab", "score": "0.71700764", "text": "func (o *OperationPropertiesFormat) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", o, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"serviceSpecification\":\n\t\t\terr = unpopulate(val, \"ServiceSpecification\", &o.ServiceSpecification)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", o, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fba73f7413d47a77b7061c780173e424", "score": "0.7153935", "text": "func (e *EndpointProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", e, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &e.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"resourceId\":\n\t\t\terr = unpopulate(val, \"ResourceID\", &e.ResourceID)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"type\":\n\t\t\terr = unpopulate(val, \"Type\", &e.Type)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", e, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4f16122a100a744fd09e84805ac75b1b", "score": "0.70727843", "text": "func (s *ServiceEndpointPolicyDefinitionPropertiesFormat) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"description\":\n\t\t\terr = unpopulate(val, \"Description\", &s.Description)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &s.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"service\":\n\t\t\terr = unpopulate(val, \"Service\", &s.Service)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"serviceResources\":\n\t\t\terr = unpopulate(val, \"ServiceResources\", &s.ServiceResources)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2dfd84248db32b3193461076a1b514b6", "score": "0.7063428", "text": "func (e *ExpressRouteCircuitServiceProviderProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", e, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"bandwidthInMbps\":\n\t\t\terr = unpopulate(val, \"BandwidthInMbps\", &e.BandwidthInMbps)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"peeringLocation\":\n\t\t\terr = unpopulate(val, \"PeeringLocation\", &e.PeeringLocation)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"serviceProviderName\":\n\t\t\terr = unpopulate(val, \"ServiceProviderName\", &e.ServiceProviderName)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", e, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "61370ec9ebe1bcf2d04f8b19468c41ac", "score": "0.7058915", "text": "func (s *ServicePrefixProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"errorMessage\":\n\t\t\terr = unpopulate(val, \"ErrorMessage\", &s.ErrorMessage)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"events\":\n\t\t\terr = unpopulate(val, \"Events\", &s.Events)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"learnedType\":\n\t\t\terr = unpopulate(val, \"LearnedType\", &s.LearnedType)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"peeringServicePrefixKey\":\n\t\t\terr = unpopulate(val, \"PeeringServicePrefixKey\", &s.PeeringServicePrefixKey)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"prefix\":\n\t\t\terr = unpopulate(val, \"Prefix\", &s.Prefix)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"prefixValidationState\":\n\t\t\terr = unpopulate(val, \"PrefixValidationState\", &s.PrefixValidationState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &s.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e6c8165cf3895a743aaf2f85aa1f5124", "score": "0.70413274", "text": "func (p *PrivateLinkServiceProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", p, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"alias\":\n\t\t\terr = unpopulate(val, \"Alias\", &p.Alias)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"autoApproval\":\n\t\t\terr = unpopulate(val, \"AutoApproval\", &p.AutoApproval)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"enableProxyProtocol\":\n\t\t\terr = unpopulate(val, \"EnableProxyProtocol\", &p.EnableProxyProtocol)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"fqdns\":\n\t\t\terr = unpopulate(val, \"Fqdns\", &p.Fqdns)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"ipConfigurations\":\n\t\t\terr = unpopulate(val, \"IPConfigurations\", &p.IPConfigurations)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"loadBalancerFrontendIpConfigurations\":\n\t\t\terr = unpopulate(val, \"LoadBalancerFrontendIPConfigurations\", &p.LoadBalancerFrontendIPConfigurations)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"networkInterfaces\":\n\t\t\terr = unpopulate(val, \"NetworkInterfaces\", &p.NetworkInterfaces)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"privateEndpointConnections\":\n\t\t\terr = unpopulate(val, \"PrivateEndpointConnections\", &p.PrivateEndpointConnections)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &p.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"visibility\":\n\t\t\terr = unpopulate(val, \"Visibility\", &p.Visibility)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", p, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0cf554fbd29032ca2f953fcc060ef00a", "score": "0.7034199", "text": "func (p *Properties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", p, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"authorizationPolicies\":\n\t\t\terr = unpopulate(val, \"AuthorizationPolicies\", &p.AuthorizationPolicies)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"cloudToDevice\":\n\t\t\terr = unpopulate(val, \"CloudToDevice\", &p.CloudToDevice)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"comments\":\n\t\t\terr = unpopulate(val, \"Comments\", &p.Comments)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"deviceStreams\":\n\t\t\terr = unpopulate(val, \"DeviceStreams\", &p.DeviceStreams)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"enableFileUploadNotifications\":\n\t\t\terr = unpopulate(val, \"EnableFileUploadNotifications\", &p.EnableFileUploadNotifications)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"eventHubEndpoints\":\n\t\t\terr = unpopulate(val, \"EventHubEndpoints\", &p.EventHubEndpoints)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"features\":\n\t\t\terr = unpopulate(val, \"Features\", &p.Features)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"hostName\":\n\t\t\terr = unpopulate(val, \"HostName\", &p.HostName)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"ipFilterRules\":\n\t\t\terr = unpopulate(val, \"IPFilterRules\", &p.IPFilterRules)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"locations\":\n\t\t\terr = unpopulate(val, \"Locations\", &p.Locations)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"messagingEndpoints\":\n\t\t\terr = unpopulate(val, \"MessagingEndpoints\", &p.MessagingEndpoints)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &p.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"routing\":\n\t\t\terr = unpopulate(val, \"Routing\", &p.Routing)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"state\":\n\t\t\terr = unpopulate(val, \"State\", &p.State)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"storageEndpoints\":\n\t\t\terr = unpopulate(val, \"StorageEndpoints\", &p.StorageEndpoints)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", p, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b12c4e259cab8721f36914bc53fe01d3", "score": "0.70336914", "text": "func (s *Service) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"id\":\n\t\t\terr = unpopulate(val, \"ID\", &s.ID)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"location\":\n\t\t\terr = unpopulate(val, \"Location\", &s.Location)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"name\":\n\t\t\terr = unpopulate(val, \"Name\", &s.Name)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"properties\":\n\t\t\terr = unpopulate(val, \"Properties\", &s.Properties)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"sku\":\n\t\t\terr = unpopulate(val, \"SKU\", &s.SKU)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"tags\":\n\t\t\terr = unpopulate(val, \"Tags\", &s.Tags)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"type\":\n\t\t\terr = unpopulate(val, \"Type\", &s.Type)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d98ee30d4302909a3ba97ef4d7aea71e", "score": "0.69958365", "text": "func (f *FeatureProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", f, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"state\":\n\t\t\terr = unpopulate(val, \"State\", &f.State)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", f, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "129a8a4835c77ad829021bdb883ecee8", "score": "0.69892037", "text": "func (s *StorageEndpointProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"connectionString\":\n\t\t\terr = unpopulate(val, \"ConnectionString\", &s.ConnectionString)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"containerName\":\n\t\t\terr = unpopulate(val, \"ContainerName\", &s.ContainerName)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"sasTtlAsIso8601\":\n\t\t\terr = unpopulate(val, \"SasTTLAsIso8601\", &s.SasTTLAsIso8601)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6fc48b9d14f004e4739447ae99628969", "score": "0.69499916", "text": "func (s *Service) UnmarshalJSON(body []byte) error {\n\tvar m map[string]*json.RawMessage\n\terr := json.Unmarshal(body, &m)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor k, v := range m {\n\t\tswitch k {\n\t\tcase \"etag\":\n\t\t\tif v != nil {\n\t\t\t\tvar etag string\n\t\t\t\terr = json.Unmarshal(*v, &etag)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\ts.Etag = &etag\n\t\t\t}\n\t\tcase \"kind\":\n\t\t\tif v != nil {\n\t\t\t\tvar kind string\n\t\t\t\terr = json.Unmarshal(*v, &kind)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\ts.Kind = &kind\n\t\t\t}\n\t\tcase \"properties\":\n\t\t\tif v != nil {\n\t\t\t\tvar serviceProperties ServiceProperties\n\t\t\t\terr = json.Unmarshal(*v, &serviceProperties)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\ts.ServiceProperties = &serviceProperties\n\t\t\t}\n\t\tcase \"sku\":\n\t\t\tif v != nil {\n\t\t\t\tvar sku ServiceSku\n\t\t\t\terr = json.Unmarshal(*v, &sku)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\ts.Sku = &sku\n\t\t\t}\n\t\tcase \"tags\":\n\t\t\tif v != nil {\n\t\t\t\tvar tags map[string]*string\n\t\t\t\terr = json.Unmarshal(*v, &tags)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\ts.Tags = tags\n\t\t\t}\n\t\tcase \"location\":\n\t\t\tif v != nil {\n\t\t\t\tvar location string\n\t\t\t\terr = json.Unmarshal(*v, &location)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\ts.Location = &location\n\t\t\t}\n\t\tcase \"id\":\n\t\t\tif v != nil {\n\t\t\t\tvar ID string\n\t\t\t\terr = json.Unmarshal(*v, &ID)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\ts.ID = &ID\n\t\t\t}\n\t\tcase \"name\":\n\t\t\tif v != nil {\n\t\t\t\tvar name string\n\t\t\t\terr = json.Unmarshal(*v, &name)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\ts.Name = &name\n\t\t\t}\n\t\tcase \"type\":\n\t\t\tif v != nil {\n\t\t\t\tvar typeVar string\n\t\t\t\terr = json.Unmarshal(*v, &typeVar)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\ts.Type = &typeVar\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "4f7405451eb579a5a5126928f861d237", "score": "0.69490737", "text": "func (p *Properties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", p, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"appliedScopeType\":\n\t\t\terr = unpopulate(val, \"AppliedScopeType\", &p.AppliedScopeType)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"appliedScopes\":\n\t\t\terr = unpopulate(val, \"AppliedScopes\", &p.AppliedScopes)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"archived\":\n\t\t\terr = unpopulate(val, \"Archived\", &p.Archived)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"benefitStartTime\":\n\t\t\terr = unpopulateTimeRFC3339(val, \"BenefitStartTime\", &p.BenefitStartTime)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"billingPlan\":\n\t\t\terr = unpopulate(val, \"BillingPlan\", &p.BillingPlan)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"billingScopeId\":\n\t\t\terr = unpopulate(val, \"BillingScopeID\", &p.BillingScopeID)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"capabilities\":\n\t\t\terr = unpopulate(val, \"Capabilities\", &p.Capabilities)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"displayName\":\n\t\t\terr = unpopulate(val, \"DisplayName\", &p.DisplayName)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"displayProvisioningState\":\n\t\t\terr = unpopulate(val, \"DisplayProvisioningState\", &p.DisplayProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"effectiveDateTime\":\n\t\t\terr = unpopulateTimeRFC3339(val, \"EffectiveDateTime\", &p.EffectiveDateTime)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"expiryDate\":\n\t\t\terr = unpopulateDateType(val, \"ExpiryDate\", &p.ExpiryDate)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"extendedStatusInfo\":\n\t\t\terr = unpopulate(val, \"ExtendedStatusInfo\", &p.ExtendedStatusInfo)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"instanceFlexibility\":\n\t\t\terr = unpopulate(val, \"InstanceFlexibility\", &p.InstanceFlexibility)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"lastUpdatedDateTime\":\n\t\t\terr = unpopulateTimeRFC3339(val, \"LastUpdatedDateTime\", &p.LastUpdatedDateTime)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"mergeProperties\":\n\t\t\terr = unpopulate(val, \"MergeProperties\", &p.MergeProperties)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &p.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningSubState\":\n\t\t\terr = unpopulate(val, \"ProvisioningSubState\", &p.ProvisioningSubState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"purchaseDate\":\n\t\t\terr = unpopulateDateType(val, \"PurchaseDate\", &p.PurchaseDate)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"quantity\":\n\t\t\terr = unpopulate(val, \"Quantity\", &p.Quantity)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"renew\":\n\t\t\terr = unpopulate(val, \"Renew\", &p.Renew)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"renewDestination\":\n\t\t\terr = unpopulate(val, \"RenewDestination\", &p.RenewDestination)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"renewProperties\":\n\t\t\terr = unpopulate(val, \"RenewProperties\", &p.RenewProperties)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"renewSource\":\n\t\t\terr = unpopulate(val, \"RenewSource\", &p.RenewSource)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"reservedResourceType\":\n\t\t\terr = unpopulate(val, \"ReservedResourceType\", &p.ReservedResourceType)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"skuDescription\":\n\t\t\terr = unpopulate(val, \"SKUDescription\", &p.SKUDescription)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"splitProperties\":\n\t\t\terr = unpopulate(val, \"SplitProperties\", &p.SplitProperties)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"term\":\n\t\t\terr = unpopulate(val, \"Term\", &p.Term)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"userFriendlyAppliedScopeType\":\n\t\t\terr = unpopulate(val, \"UserFriendlyAppliedScopeType\", &p.UserFriendlyAppliedScopeType)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"userFriendlyRenewState\":\n\t\t\terr = unpopulate(val, \"UserFriendlyRenewState\", &p.UserFriendlyRenewState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"utilization\":\n\t\t\terr = unpopulate(val, \"Utilization\", &p.Utilization)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", p, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7128706bb46873f60889e4e19f929fd5", "score": "0.69479996", "text": "func (e *ExpressRouteServiceProviderPropertiesFormat) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", e, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"bandwidthsOffered\":\n\t\t\terr = unpopulate(val, \"BandwidthsOffered\", &e.BandwidthsOffered)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"peeringLocations\":\n\t\t\terr = unpopulate(val, \"PeeringLocations\", &e.PeeringLocations)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &e.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", e, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f5914a297de03c8e8e9753c69cb69037", "score": "0.69290763", "text": "func (s *ServiceDelegationPropertiesFormat) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"actions\":\n\t\t\terr = unpopulate(val, \"Actions\", &s.Actions)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &s.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"serviceName\":\n\t\t\terr = unpopulate(val, \"ServiceName\", &s.ServiceName)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a9449e537d23cc26c8dd2cc444d8eb92", "score": "0.68993473", "text": "func (m *MessagingEndpointProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", m, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"lockDurationAsIso8601\":\n\t\t\terr = unpopulate(val, \"LockDurationAsIso8601\", &m.LockDurationAsIso8601)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"maxDeliveryCount\":\n\t\t\terr = unpopulate(val, \"MaxDeliveryCount\", &m.MaxDeliveryCount)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"ttlAsIso8601\":\n\t\t\terr = unpopulate(val, \"TTLAsIso8601\", &m.TTLAsIso8601)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", m, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "42725bb9c6e558bd336c044c8713888a", "score": "0.6845983", "text": "func (s *Service) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"id\":\n\t\t\terr = unpopulate(val, \"ID\", &s.ID)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"identity\":\n\t\t\terr = unpopulate(val, \"Identity\", &s.Identity)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"location\":\n\t\t\terr = unpopulate(val, \"Location\", &s.Location)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"name\":\n\t\t\terr = unpopulate(val, \"Name\", &s.Name)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"properties\":\n\t\t\terr = unpopulate(val, \"Properties\", &s.Properties)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"systemData\":\n\t\t\terr = unpopulate(val, \"SystemData\", &s.SystemData)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"tags\":\n\t\t\terr = unpopulate(val, \"Tags\", &s.Tags)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"type\":\n\t\t\terr = unpopulate(val, \"Type\", &s.Type)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c9bdab233d3aba255d25f73696c212e6", "score": "0.68155855", "text": "func (s *SAPCentralServerProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"enqueueReplicationServerProperties\":\n\t\t\terr = unpopulate(val, \"EnqueueReplicationServerProperties\", &s.EnqueueReplicationServerProperties)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"enqueueServerProperties\":\n\t\t\terr = unpopulate(val, \"EnqueueServerProperties\", &s.EnqueueServerProperties)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"errors\":\n\t\t\terr = unpopulate(val, \"Errors\", &s.Errors)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"gatewayServerProperties\":\n\t\t\terr = unpopulate(val, \"GatewayServerProperties\", &s.GatewayServerProperties)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"health\":\n\t\t\terr = unpopulate(val, \"Health\", &s.Health)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"instanceNo\":\n\t\t\terr = unpopulate(val, \"InstanceNo\", &s.InstanceNo)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"kernelPatch\":\n\t\t\terr = unpopulate(val, \"KernelPatch\", &s.KernelPatch)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"kernelVersion\":\n\t\t\terr = unpopulate(val, \"KernelVersion\", &s.KernelVersion)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"loadBalancerDetails\":\n\t\t\terr = unpopulate(val, \"LoadBalancerDetails\", &s.LoadBalancerDetails)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"messageServerProperties\":\n\t\t\terr = unpopulate(val, \"MessageServerProperties\", &s.MessageServerProperties)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &s.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"status\":\n\t\t\terr = unpopulate(val, \"Status\", &s.Status)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"subnet\":\n\t\t\terr = unpopulate(val, \"Subnet\", &s.Subnet)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"vmDetails\":\n\t\t\terr = unpopulate(val, \"VMDetails\", &s.VMDetails)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ac055d9fc2616e33c2827fb2c28e1880", "score": "0.68092525", "text": "func (g *GatewayServerProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", g, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"health\":\n\t\t\terr = unpopulate(val, \"Health\", &g.Health)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"port\":\n\t\t\terr = unpopulate(val, \"Port\", &g.Port)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", g, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5af866fabb7476d3e918b03abd410e54", "score": "0.6808842", "text": "func (k *KeyVaultProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", k, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"identityClientId\":\n\t\t\terr = unpopulate(val, \"IdentityClientID\", &k.IdentityClientID)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"keyName\":\n\t\t\terr = unpopulate(val, \"KeyName\", &k.KeyName)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"keyVaultUri\":\n\t\t\terr = unpopulate(val, \"KeyVaultURI\", &k.KeyVaultURI)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"keyVersion\":\n\t\t\terr = unpopulate(val, \"KeyVersion\", &k.KeyVersion)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", k, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "49c10f36f5b9d58a3bd9af389f829f1a", "score": "0.67975104", "text": "func (a *AADProfileProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", a, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"serverId\":\n\t\t\terr = unpopulate(val, \"ServerID\", &a.ServerID)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"tenantId\":\n\t\t\terr = unpopulate(val, \"TenantID\", &a.TenantID)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", a, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f9f15469c42f2ba9b601cfecf82bf3b6", "score": "0.6755297", "text": "func (e *EndpointResourceProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", e, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"authenticationType\":\n\t\t\terr = unpopulate(val, \"AuthenticationType\", &e.AuthenticationType)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"createdTime\":\n\t\t\terr = unpopulateTimeRFC3339(val, \"CreatedTime\", &e.CreatedTime)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"deadLetterSecret\":\n\t\t\terr = unpopulate(val, \"DeadLetterSecret\", &e.DeadLetterSecret)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"deadLetterUri\":\n\t\t\terr = unpopulate(val, \"DeadLetterURI\", &e.DeadLetterURI)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"endpointType\":\n\t\t\terr = unpopulate(val, \"EndpointType\", &e.EndpointType)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &e.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", e, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "97f970e5e3f5c4ba0a739e7a26cc0280", "score": "0.6753281", "text": "func (d *DelegationProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", d, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &d.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"serviceName\":\n\t\t\terr = unpopulate(val, \"ServiceName\", &d.ServiceName)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", d, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6a37284547ce2782205eaf4825e9b05b", "score": "0.6750162", "text": "func (m *MessageServerProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", m, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"httpPort\":\n\t\t\terr = unpopulate(val, \"HTTPPort\", &m.HTTPPort)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"httpsPort\":\n\t\t\terr = unpopulate(val, \"HTTPSPort\", &m.HTTPSPort)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"health\":\n\t\t\terr = unpopulate(val, \"Health\", &m.Health)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"hostname\":\n\t\t\terr = unpopulate(val, \"Hostname\", &m.Hostname)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"ipAddress\":\n\t\t\terr = unpopulate(val, \"IPAddress\", &m.IPAddress)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"internalMsPort\":\n\t\t\terr = unpopulate(val, \"InternalMsPort\", &m.InternalMsPort)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"msPort\":\n\t\t\terr = unpopulate(val, \"MSPort\", &m.MSPort)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", m, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "08b2f98e96e7c271c81abd691aaed06b", "score": "0.6737967", "text": "func (u *UserProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn err\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"createdDate\":\n\t\t\terr = unpopulateTimeRFC3339(val, &u.CreatedDate)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"identity\":\n\t\t\terr = unpopulate(val, &u.Identity)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, &u.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"secretStore\":\n\t\t\terr = unpopulate(val, &u.SecretStore)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"uniqueIdentifier\":\n\t\t\terr = unpopulate(val, &u.UniqueIdentifier)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b87b3d67c9fefbca4236983d2f926342", "score": "0.6722696", "text": "func (s *SAPVirtualInstanceProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"configuration\":\n\t\t\ts.Configuration, err = unmarshalSAPConfigurationClassification(val)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"environment\":\n\t\t\terr = unpopulate(val, \"Environment\", &s.Environment)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"errors\":\n\t\t\terr = unpopulate(val, \"Errors\", &s.Errors)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"health\":\n\t\t\terr = unpopulate(val, \"Health\", &s.Health)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"managedResourceGroupConfiguration\":\n\t\t\terr = unpopulate(val, \"ManagedResourceGroupConfiguration\", &s.ManagedResourceGroupConfiguration)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &s.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"sapProduct\":\n\t\t\terr = unpopulate(val, \"SapProduct\", &s.SapProduct)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"state\":\n\t\t\terr = unpopulate(val, \"State\", &s.State)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"status\":\n\t\t\terr = unpopulate(val, \"Status\", &s.Status)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c212abdde776aeb490383912abf6afae", "score": "0.6708085", "text": "func (s *SAPApplicationServerProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"errors\":\n\t\t\terr = unpopulate(val, \"Errors\", &s.Errors)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"gatewayPort\":\n\t\t\terr = unpopulate(val, \"GatewayPort\", &s.GatewayPort)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"health\":\n\t\t\terr = unpopulate(val, \"Health\", &s.Health)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"hostname\":\n\t\t\terr = unpopulate(val, \"Hostname\", &s.Hostname)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"ipAddress\":\n\t\t\terr = unpopulate(val, \"IPAddress\", &s.IPAddress)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"icmHttpPort\":\n\t\t\terr = unpopulate(val, \"IcmHTTPPort\", &s.IcmHTTPPort)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"icmHttpsPort\":\n\t\t\terr = unpopulate(val, \"IcmHTTPSPort\", &s.IcmHTTPSPort)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"instanceNo\":\n\t\t\terr = unpopulate(val, \"InstanceNo\", &s.InstanceNo)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"kernelPatch\":\n\t\t\terr = unpopulate(val, \"KernelPatch\", &s.KernelPatch)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"kernelVersion\":\n\t\t\terr = unpopulate(val, \"KernelVersion\", &s.KernelVersion)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"loadBalancerDetails\":\n\t\t\terr = unpopulate(val, \"LoadBalancerDetails\", &s.LoadBalancerDetails)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &s.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"status\":\n\t\t\terr = unpopulate(val, \"Status\", &s.Status)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"subnet\":\n\t\t\terr = unpopulate(val, \"Subnet\", &s.Subnet)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"vmDetails\":\n\t\t\terr = unpopulate(val, \"VMDetails\", &s.VMDetails)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "81d3fb18bf8c803d2f545f07dcc976d7", "score": "0.6696335", "text": "func (r *RoutingServiceBusTopicEndpointProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", r, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"connectionString\":\n\t\t\terr = unpopulate(val, \"ConnectionString\", &r.ConnectionString)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"name\":\n\t\t\terr = unpopulate(val, \"Name\", &r.Name)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"resourceGroup\":\n\t\t\terr = unpopulate(val, \"ResourceGroup\", &r.ResourceGroup)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"subscriptionId\":\n\t\t\terr = unpopulate(val, \"SubscriptionID\", &r.SubscriptionID)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", r, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9856570577bb61201a9d25f75ea63713", "score": "0.66937387", "text": "func (sp *ServicePrefix) UnmarshalJSON(body []byte) error {\n\tvar m map[string]*json.RawMessage\n\terr := json.Unmarshal(body, &m)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor k, v := range m {\n\t\tswitch k {\n\t\tcase \"properties\":\n\t\t\tif v != nil {\n\t\t\t\tvar servicePrefixProperties ServicePrefixProperties\n\t\t\t\terr = json.Unmarshal(*v, &servicePrefixProperties)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsp.ServicePrefixProperties = &servicePrefixProperties\n\t\t\t}\n\t\tcase \"name\":\n\t\t\tif v != nil {\n\t\t\t\tvar name string\n\t\t\t\terr = json.Unmarshal(*v, &name)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsp.Name = &name\n\t\t\t}\n\t\tcase \"id\":\n\t\t\tif v != nil {\n\t\t\t\tvar ID string\n\t\t\t\terr = json.Unmarshal(*v, &ID)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsp.ID = &ID\n\t\t\t}\n\t\tcase \"type\":\n\t\t\tif v != nil {\n\t\t\t\tvar typeVar string\n\t\t\t\terr = json.Unmarshal(*v, &typeVar)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsp.Type = &typeVar\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "2bb16a5dbda70d90976c84acf5e8cdcd", "score": "0.6681638", "text": "func (w *WatcherPropertiesFormat) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", w, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &w.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", w, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "74d98e60409f98aad5a41294cbd9e7b8", "score": "0.6680089", "text": "func (i *IngressProfileProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", i, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"aadProfile\":\n\t\t\terr = unpopulate(val, \"AADProfile\", &i.AADProfile)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"hostname\":\n\t\t\terr = unpopulate(val, \"Hostname\", &i.Hostname)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", i, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "767e9de4748d55939e48e954065a6ca1", "score": "0.6679679", "text": "func (sl *ServiceLocation) UnmarshalJSON(body []byte) error {\n\tvar m map[string]*json.RawMessage\n\terr := json.Unmarshal(body, &m)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor k, v := range m {\n\t\tswitch k {\n\t\tcase \"properties\":\n\t\t\tif v != nil {\n\t\t\t\tvar serviceLocationProperties ServiceLocationProperties\n\t\t\t\terr = json.Unmarshal(*v, &serviceLocationProperties)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsl.ServiceLocationProperties = &serviceLocationProperties\n\t\t\t}\n\t\tcase \"name\":\n\t\t\tif v != nil {\n\t\t\t\tvar name string\n\t\t\t\terr = json.Unmarshal(*v, &name)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsl.Name = &name\n\t\t\t}\n\t\tcase \"id\":\n\t\t\tif v != nil {\n\t\t\t\tvar ID string\n\t\t\t\terr = json.Unmarshal(*v, &ID)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsl.ID = &ID\n\t\t\t}\n\t\tcase \"type\":\n\t\t\tif v != nil {\n\t\t\t\tvar typeVar string\n\t\t\t\terr = json.Unmarshal(*v, &typeVar)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsl.Type = &typeVar\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "680adf11dee2e21e465fe8fae3170b7c", "score": "0.6674283", "text": "func (o *OperationPropertiesFormatServiceSpecification) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", o, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"logSpecifications\":\n\t\t\terr = unpopulate(val, \"LogSpecifications\", &o.LogSpecifications)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"metricSpecifications\":\n\t\t\terr = unpopulate(val, \"MetricSpecifications\", &o.MetricSpecifications)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", o, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4ce1f7d2f26f633432ef1090abb1dd6e", "score": "0.66727453", "text": "func (a *APIProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", a, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"aadClientId\":\n\t\t\terr = unpopulate(val, \"AADClientID\", &a.AADClientID)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"aadTenantId\":\n\t\t\terr = unpopulate(val, \"AADTenantID\", &a.AADTenantID)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"eventHubConnectionString\":\n\t\t\terr = unpopulate(val, \"EventHubConnectionString\", &a.EventHubConnectionString)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"qnaAzureSearchEndpointId\":\n\t\t\terr = unpopulate(val, \"QnaAzureSearchEndpointID\", &a.QnaAzureSearchEndpointID)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"qnaAzureSearchEndpointKey\":\n\t\t\terr = unpopulate(val, \"QnaAzureSearchEndpointKey\", &a.QnaAzureSearchEndpointKey)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"qnaRuntimeEndpoint\":\n\t\t\terr = unpopulate(val, \"QnaRuntimeEndpoint\", &a.QnaRuntimeEndpoint)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"statisticsEnabled\":\n\t\t\terr = unpopulate(val, \"StatisticsEnabled\", &a.StatisticsEnabled)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"storageAccountConnectionString\":\n\t\t\terr = unpopulate(val, \"StorageAccountConnectionString\", &a.StorageAccountConnectionString)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"superUser\":\n\t\t\terr = unpopulate(val, \"SuperUser\", &a.SuperUser)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"websiteName\":\n\t\t\terr = unpopulate(val, \"WebsiteName\", &a.WebsiteName)\n\t\t\tdelete(rawMsg, key)\n\t\tdefault:\n\t\t\tif a.AdditionalProperties == nil {\n\t\t\t\ta.AdditionalProperties = map[string]interface{}{}\n\t\t\t}\n\t\t\tif val != nil {\n\t\t\t\tvar aux interface{}\n\t\t\t\terr = json.Unmarshal(val, &aux)\n\t\t\t\ta.AdditionalProperties[key] = aux\n\t\t\t}\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", a, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a39d314a65c353a8d58613cee2069dc0", "score": "0.66727453", "text": "func (a *APIProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", a, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"aadClientId\":\n\t\t\terr = unpopulate(val, \"AADClientID\", &a.AADClientID)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"aadTenantId\":\n\t\t\terr = unpopulate(val, \"AADTenantID\", &a.AADTenantID)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"eventHubConnectionString\":\n\t\t\terr = unpopulate(val, \"EventHubConnectionString\", &a.EventHubConnectionString)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"qnaAzureSearchEndpointId\":\n\t\t\terr = unpopulate(val, \"QnaAzureSearchEndpointID\", &a.QnaAzureSearchEndpointID)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"qnaAzureSearchEndpointKey\":\n\t\t\terr = unpopulate(val, \"QnaAzureSearchEndpointKey\", &a.QnaAzureSearchEndpointKey)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"qnaRuntimeEndpoint\":\n\t\t\terr = unpopulate(val, \"QnaRuntimeEndpoint\", &a.QnaRuntimeEndpoint)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"statisticsEnabled\":\n\t\t\terr = unpopulate(val, \"StatisticsEnabled\", &a.StatisticsEnabled)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"storageAccountConnectionString\":\n\t\t\terr = unpopulate(val, \"StorageAccountConnectionString\", &a.StorageAccountConnectionString)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"superUser\":\n\t\t\terr = unpopulate(val, \"SuperUser\", &a.SuperUser)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"websiteName\":\n\t\t\terr = unpopulate(val, \"WebsiteName\", &a.WebsiteName)\n\t\t\tdelete(rawMsg, key)\n\t\tdefault:\n\t\t\tif a.AdditionalProperties == nil {\n\t\t\t\ta.AdditionalProperties = map[string]any{}\n\t\t\t}\n\t\t\tif val != nil {\n\t\t\t\tvar aux any\n\t\t\t\terr = json.Unmarshal(val, &aux)\n\t\t\t\ta.AdditionalProperties[key] = aux\n\t\t\t}\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", a, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ebe012d422c9745ee1881bafe51009ce", "score": "0.6644362", "text": "func (h *HeatMapProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn err\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"endTime\":\n\t\t\terr = unpopulateTimeRFC3339(val, &h.EndTime)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"endpoints\":\n\t\t\terr = unpopulate(val, &h.Endpoints)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"startTime\":\n\t\t\terr = unpopulateTimeRFC3339(val, &h.StartTime)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"trafficFlows\":\n\t\t\terr = unpopulate(val, &h.TrafficFlows)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e3aa6f3321582aa409c71a34933bba0a", "score": "0.66327894", "text": "func (a *AccountProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", a, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"apiProperties\":\n\t\t\terr = unpopulate(val, \"APIProperties\", &a.APIProperties)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"abusePenalty\":\n\t\t\terr = unpopulate(val, \"AbusePenalty\", &a.AbusePenalty)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"allowedFqdnList\":\n\t\t\terr = unpopulate(val, \"AllowedFqdnList\", &a.AllowedFqdnList)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"callRateLimit\":\n\t\t\terr = unpopulate(val, \"CallRateLimit\", &a.CallRateLimit)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"capabilities\":\n\t\t\terr = unpopulate(val, \"Capabilities\", &a.Capabilities)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"commitmentPlanAssociations\":\n\t\t\terr = unpopulate(val, \"CommitmentPlanAssociations\", &a.CommitmentPlanAssociations)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"customSubDomainName\":\n\t\t\terr = unpopulate(val, \"CustomSubDomainName\", &a.CustomSubDomainName)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"dateCreated\":\n\t\t\terr = unpopulate(val, \"DateCreated\", &a.DateCreated)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"deletionDate\":\n\t\t\terr = unpopulate(val, \"DeletionDate\", &a.DeletionDate)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"disableLocalAuth\":\n\t\t\terr = unpopulate(val, \"DisableLocalAuth\", &a.DisableLocalAuth)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"dynamicThrottlingEnabled\":\n\t\t\terr = unpopulate(val, \"DynamicThrottlingEnabled\", &a.DynamicThrottlingEnabled)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"encryption\":\n\t\t\terr = unpopulate(val, \"Encryption\", &a.Encryption)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"endpoint\":\n\t\t\terr = unpopulate(val, \"Endpoint\", &a.Endpoint)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"endpoints\":\n\t\t\terr = unpopulate(val, \"Endpoints\", &a.Endpoints)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"internalId\":\n\t\t\terr = unpopulate(val, \"InternalID\", &a.InternalID)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"isMigrated\":\n\t\t\terr = unpopulate(val, \"IsMigrated\", &a.IsMigrated)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"locations\":\n\t\t\terr = unpopulate(val, \"Locations\", &a.Locations)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"migrationToken\":\n\t\t\terr = unpopulate(val, \"MigrationToken\", &a.MigrationToken)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"networkAcls\":\n\t\t\terr = unpopulate(val, \"NetworkACLs\", &a.NetworkACLs)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"privateEndpointConnections\":\n\t\t\terr = unpopulate(val, \"PrivateEndpointConnections\", &a.PrivateEndpointConnections)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &a.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"publicNetworkAccess\":\n\t\t\terr = unpopulate(val, \"PublicNetworkAccess\", &a.PublicNetworkAccess)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"quotaLimit\":\n\t\t\terr = unpopulate(val, \"QuotaLimit\", &a.QuotaLimit)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"restore\":\n\t\t\terr = unpopulate(val, \"Restore\", &a.Restore)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"restrictOutboundNetworkAccess\":\n\t\t\terr = unpopulate(val, \"RestrictOutboundNetworkAccess\", &a.RestrictOutboundNetworkAccess)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"skuChangeInfo\":\n\t\t\terr = unpopulate(val, \"SKUChangeInfo\", &a.SKUChangeInfo)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"scheduledPurgeDate\":\n\t\t\terr = unpopulate(val, \"ScheduledPurgeDate\", &a.ScheduledPurgeDate)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"userOwnedStorage\":\n\t\t\terr = unpopulate(val, \"UserOwnedStorage\", &a.UserOwnedStorage)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", a, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c9196d792fc8fe58a7f0ef0004be15c0", "score": "0.6627478", "text": "func (sp *ServiceProvider) UnmarshalJSON(body []byte) error {\n\tvar m map[string]*json.RawMessage\n\terr := json.Unmarshal(body, &m)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor k, v := range m {\n\t\tswitch k {\n\t\tcase \"properties\":\n\t\t\tif v != nil {\n\t\t\t\tvar serviceProviderProperties ServiceProviderProperties\n\t\t\t\terr = json.Unmarshal(*v, &serviceProviderProperties)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsp.ServiceProviderProperties = &serviceProviderProperties\n\t\t\t}\n\t\tcase \"name\":\n\t\t\tif v != nil {\n\t\t\t\tvar name string\n\t\t\t\terr = json.Unmarshal(*v, &name)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsp.Name = &name\n\t\t\t}\n\t\tcase \"id\":\n\t\t\tif v != nil {\n\t\t\t\tvar ID string\n\t\t\t\terr = json.Unmarshal(*v, &ID)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsp.ID = &ID\n\t\t\t}\n\t\tcase \"type\":\n\t\t\tif v != nil {\n\t\t\t\tvar typeVar string\n\t\t\t\terr = json.Unmarshal(*v, &typeVar)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsp.Type = &typeVar\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "24a5e2083dd04e1bace332860552bd79", "score": "0.66102076", "text": "func (s *SolutionPropertiesList) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"value\":\n\t\t\terr = unpopulate(val, \"Value\", &s.Value)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "02f0dac476a63aa77aedaabe417e04b1", "score": "0.6601656", "text": "func (p *ProfilePropertiesFormat) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", p, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"containerNetworkInterfaceConfigurations\":\n\t\t\terr = unpopulate(val, \"ContainerNetworkInterfaceConfigurations\", &p.ContainerNetworkInterfaceConfigurations)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"containerNetworkInterfaces\":\n\t\t\terr = unpopulate(val, \"ContainerNetworkInterfaces\", &p.ContainerNetworkInterfaces)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &p.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"resourceGuid\":\n\t\t\terr = unpopulate(val, \"ResourceGUID\", &p.ResourceGUID)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", p, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "796f3cdcb413d0eec890f77910027591", "score": "0.65733933", "text": "func UnmarshalServiceEndpointsAsProperty(m map[string]interface{}, propertyName string) (result *ServiceEndpoints, err error) {\n\tv, foundIt := m[propertyName]\n\tif foundIt && v != nil {\n\t\tobjMap, ok := v.(map[string]interface{})\n\t\tif !ok {\n\t\t\terr = fmt.Errorf(\"map property '%s' should be a map containing an instance of 'ServiceEndpoints'\", propertyName)\n\t\t\treturn\n\t\t}\n\t\tresult, err = UnmarshalServiceEndpoints(objMap)\n\t}\n\treturn\n}", "title": "" }, { "docid": "4c68de2cd6e491ed3c3d0e721ba330c5", "score": "0.65726763", "text": "func (e *ExportProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn err\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"definition\":\n\t\t\terr = unpopulate(val, &e.Definition)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"deliveryInfo\":\n\t\t\terr = unpopulate(val, &e.DeliveryInfo)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"format\":\n\t\t\terr = unpopulate(val, &e.Format)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"nextRunTimeEstimate\":\n\t\t\terr = unpopulateTimeRFC3339(val, &e.NextRunTimeEstimate)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"partitionData\":\n\t\t\terr = unpopulate(val, &e.PartitionData)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"runHistory\":\n\t\t\terr = unpopulate(val, &e.RunHistory)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"schedule\":\n\t\t\terr = unpopulate(val, &e.Schedule)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "41ab4b454875a783246e045f3afada77", "score": "0.65672386", "text": "func (t *TableResponseProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", t, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"odata.editLink\":\n\t\t\terr = unpopulate(val, \"ODataEditLink\", &t.ODataEditLink)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"odata.id\":\n\t\t\terr = unpopulate(val, \"ODataID\", &t.ODataID)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"odata.type\":\n\t\t\terr = unpopulate(val, \"ODataType\", &t.ODataType)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"TableName\":\n\t\t\terr = unpopulate(val, \"TableName\", &t.TableName)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", t, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b612c613edf9c799cc60b2d97f88169e", "score": "0.6566361", "text": "func (s *ServiceAssociationLinkPropertiesFormat) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"allowDelete\":\n\t\t\terr = unpopulate(val, \"AllowDelete\", &s.AllowDelete)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"link\":\n\t\t\terr = unpopulate(val, \"Link\", &s.Link)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"linkedResourceType\":\n\t\t\terr = unpopulate(val, \"LinkedResourceType\", &s.LinkedResourceType)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"locations\":\n\t\t\terr = unpopulate(val, \"Locations\", &s.Locations)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &s.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "77985763050b5a3046f7c8970d85efdb", "score": "0.6557374", "text": "func (l *LocationProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", l, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"azureRegion\":\n\t\t\terr = unpopulate(val, \"AzureRegion\", &l.AzureRegion)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"country\":\n\t\t\terr = unpopulate(val, \"Country\", &l.Country)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"direct\":\n\t\t\terr = unpopulate(val, \"Direct\", &l.Direct)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"exchange\":\n\t\t\terr = unpopulate(val, \"Exchange\", &l.Exchange)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"peeringLocation\":\n\t\t\terr = unpopulate(val, \"PeeringLocation\", &l.PeeringLocation)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", l, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "52156ec24961ed0069fea5d167331e44", "score": "0.65569776", "text": "func (s *SecretProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"secretResources\":\n\t\t\terr = unpopulate(val, \"SecretResources\", &s.SecretResources)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2b8a9435bf41754db613da3fdc99d99f", "score": "0.6554804", "text": "func (v *VirtualApplianceSiteProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", v, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"addressPrefix\":\n\t\t\terr = unpopulate(val, \"AddressPrefix\", &v.AddressPrefix)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"o365Policy\":\n\t\t\terr = unpopulate(val, \"O365Policy\", &v.O365Policy)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &v.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", v, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a0e1faf63b8316eff0f45fa52a921841", "score": "0.65428084", "text": "func (r *RouteProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", r, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"condition\":\n\t\t\terr = unpopulate(val, \"Condition\", &r.Condition)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"endpointNames\":\n\t\t\terr = unpopulate(val, \"EndpointNames\", &r.EndpointNames)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"isEnabled\":\n\t\t\terr = unpopulate(val, \"IsEnabled\", &r.IsEnabled)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"name\":\n\t\t\terr = unpopulate(val, \"Name\", &r.Name)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"source\":\n\t\t\terr = unpopulate(val, \"Source\", &r.Source)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", r, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e6385fa2ed5e9c5f748ac724b4201569", "score": "0.6541514", "text": "func (a *LabelUpdate_Properties) UnmarshalJSON(b []byte) error {\n\tobject := make(map[string]json.RawMessage)\n\terr := json.Unmarshal(b, &object)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif len(object) != 0 {\n\t\ta.AdditionalProperties = make(map[string]string)\n\t\tfor fieldName, fieldBuf := range object {\n\t\t\tvar fieldVal string\n\t\t\terr := json.Unmarshal(fieldBuf, &fieldVal)\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrap(err, fmt.Sprintf(\"error unmarshaling field %s\", fieldName))\n\t\t\t}\n\t\t\ta.AdditionalProperties[fieldName] = fieldVal\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7965174c647fdff30e347c9ea556644c", "score": "0.65345603", "text": "func (a *AccountProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", a, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"accountId\":\n\t\t\terr = unpopulate(val, \"AccountID\", &a.AccountID)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"computePolicies\":\n\t\t\terr = unpopulate(val, \"ComputePolicies\", &a.ComputePolicies)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"creationTime\":\n\t\t\terr = unpopulateTimeRFC3339(val, \"CreationTime\", &a.CreationTime)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"currentTier\":\n\t\t\terr = unpopulate(val, \"CurrentTier\", &a.CurrentTier)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"dataLakeStoreAccounts\":\n\t\t\terr = unpopulate(val, \"DataLakeStoreAccounts\", &a.DataLakeStoreAccounts)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"debugDataAccessLevel\":\n\t\t\terr = unpopulate(val, \"DebugDataAccessLevel\", &a.DebugDataAccessLevel)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"defaultDataLakeStoreAccount\":\n\t\t\terr = unpopulate(val, \"DefaultDataLakeStoreAccount\", &a.DefaultDataLakeStoreAccount)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"defaultDataLakeStoreAccountType\":\n\t\t\terr = unpopulate(val, \"DefaultDataLakeStoreAccountType\", &a.DefaultDataLakeStoreAccountType)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"endpoint\":\n\t\t\terr = unpopulate(val, \"Endpoint\", &a.Endpoint)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"firewallAllowAzureIps\":\n\t\t\terr = unpopulate(val, \"FirewallAllowAzureIPs\", &a.FirewallAllowAzureIPs)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"firewallRules\":\n\t\t\terr = unpopulate(val, \"FirewallRules\", &a.FirewallRules)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"firewallState\":\n\t\t\terr = unpopulate(val, \"FirewallState\", &a.FirewallState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"hiveMetastores\":\n\t\t\terr = unpopulate(val, \"HiveMetastores\", &a.HiveMetastores)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"lastModifiedTime\":\n\t\t\terr = unpopulateTimeRFC3339(val, \"LastModifiedTime\", &a.LastModifiedTime)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"maxActiveJobCountPerUser\":\n\t\t\terr = unpopulate(val, \"MaxActiveJobCountPerUser\", &a.MaxActiveJobCountPerUser)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"maxDegreeOfParallelism\":\n\t\t\terr = unpopulate(val, \"MaxDegreeOfParallelism\", &a.MaxDegreeOfParallelism)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"maxDegreeOfParallelismPerJob\":\n\t\t\terr = unpopulate(val, \"MaxDegreeOfParallelismPerJob\", &a.MaxDegreeOfParallelismPerJob)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"maxJobCount\":\n\t\t\terr = unpopulate(val, \"MaxJobCount\", &a.MaxJobCount)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"maxJobRunningTimeInMin\":\n\t\t\terr = unpopulate(val, \"MaxJobRunningTimeInMin\", &a.MaxJobRunningTimeInMin)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"maxQueuedJobCountPerUser\":\n\t\t\terr = unpopulate(val, \"MaxQueuedJobCountPerUser\", &a.MaxQueuedJobCountPerUser)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"minPriorityPerJob\":\n\t\t\terr = unpopulate(val, \"MinPriorityPerJob\", &a.MinPriorityPerJob)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"newTier\":\n\t\t\terr = unpopulate(val, \"NewTier\", &a.NewTier)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &a.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"publicDataLakeStoreAccounts\":\n\t\t\terr = unpopulate(val, \"PublicDataLakeStoreAccounts\", &a.PublicDataLakeStoreAccounts)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"queryStoreRetention\":\n\t\t\terr = unpopulate(val, \"QueryStoreRetention\", &a.QueryStoreRetention)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"state\":\n\t\t\terr = unpopulate(val, \"State\", &a.State)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"storageAccounts\":\n\t\t\terr = unpopulate(val, \"StorageAccounts\", &a.StorageAccounts)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"systemMaxDegreeOfParallelism\":\n\t\t\terr = unpopulate(val, \"SystemMaxDegreeOfParallelism\", &a.SystemMaxDegreeOfParallelism)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"systemMaxJobCount\":\n\t\t\terr = unpopulate(val, \"SystemMaxJobCount\", &a.SystemMaxJobCount)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"virtualNetworkRules\":\n\t\t\terr = unpopulate(val, \"VirtualNetworkRules\", &a.VirtualNetworkRules)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", a, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "51c41ab34c1b7d2c0b750e4645decf0f", "score": "0.6534271", "text": "func (p *PolicyProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn err\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"createdDate\":\n\t\t\terr = unpopulateTimeRFC3339(val, &p.CreatedDate)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"description\":\n\t\t\terr = unpopulate(val, &p.Description)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"evaluatorType\":\n\t\t\terr = unpopulate(val, &p.EvaluatorType)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"factData\":\n\t\t\terr = unpopulate(val, &p.FactData)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"factName\":\n\t\t\terr = unpopulate(val, &p.FactName)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, &p.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"status\":\n\t\t\terr = unpopulate(val, &p.Status)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"threshold\":\n\t\t\terr = unpopulate(val, &p.Threshold)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"uniqueIdentifier\":\n\t\t\terr = unpopulate(val, &p.UniqueIdentifier)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6af6203f8d9c7049988469e811b94486", "score": "0.6530133", "text": "func (e *EnrichmentProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", e, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"endpointNames\":\n\t\t\terr = unpopulate(val, \"EndpointNames\", &e.EndpointNames)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"key\":\n\t\t\terr = unpopulate(val, \"Key\", &e.Key)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"value\":\n\t\t\terr = unpopulate(val, \"Value\", &e.Value)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", e, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a879f1d8375a9c1bc594c4cddbaf23ce", "score": "0.6517717", "text": "func (e *EnqueueServerProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", e, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"health\":\n\t\t\terr = unpopulate(val, \"Health\", &e.Health)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"hostname\":\n\t\t\terr = unpopulate(val, \"Hostname\", &e.Hostname)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"ipAddress\":\n\t\t\terr = unpopulate(val, \"IPAddress\", &e.IPAddress)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"port\":\n\t\t\terr = unpopulate(val, \"Port\", &e.Port)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", e, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "11ca851f36cfba095eece0bb0aa3a9f1", "score": "0.6516145", "text": "func (k *KeyVaultProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", k, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"currentKeyIdentifier\":\n\t\t\terr = unpopulate(val, \"CurrentKeyIdentifier\", &k.CurrentKeyIdentifier)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"keyIdentifier\":\n\t\t\terr = unpopulate(val, \"KeyIdentifier\", &k.KeyIdentifier)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", k, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d9838a7d8fdc1f1c3c898f71d072ccc0", "score": "0.6510234", "text": "func (s *ServiceLocation) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"id\":\n\t\t\terr = unpopulate(val, \"ID\", &s.ID)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"name\":\n\t\t\terr = unpopulate(val, \"Name\", &s.Name)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"properties\":\n\t\t\terr = unpopulate(val, \"Properties\", &s.Properties)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"type\":\n\t\t\terr = unpopulate(val, \"Type\", &s.Type)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3888aeebb3cd7e0ccbd59e7f95f69af3", "score": "0.6502557", "text": "func (w *WnsCredentialProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", w, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"packageSid\":\n\t\t\terr = unpopulate(val, \"PackageSid\", &w.PackageSid)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"secretKey\":\n\t\t\terr = unpopulate(val, \"SecretKey\", &w.SecretKey)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"windowsLiveEndpoint\":\n\t\t\terr = unpopulate(val, \"WindowsLiveEndpoint\", &w.WindowsLiveEndpoint)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", w, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "219555105d947b6d6eb8e77db402dd10", "score": "0.6499636", "text": "func (t *TransformProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", t, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"created\":\n\t\t\terr = unpopulateTimeRFC3339(val, \"Created\", &t.Created)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"description\":\n\t\t\terr = unpopulate(val, \"Description\", &t.Description)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"lastModified\":\n\t\t\terr = unpopulateTimeRFC3339(val, \"LastModified\", &t.LastModified)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"outputs\":\n\t\t\terr = unpopulate(val, \"Outputs\", &t.Outputs)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", t, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d1750f1f5ec210fbddcdc0571f380d0b", "score": "0.64906126", "text": "func (s *StreamingEndpointProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"accessControl\":\n\t\t\terr = unpopulate(val, \"AccessControl\", &s.AccessControl)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"availabilitySetName\":\n\t\t\terr = unpopulate(val, \"AvailabilitySetName\", &s.AvailabilitySetName)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"cdnEnabled\":\n\t\t\terr = unpopulate(val, \"CdnEnabled\", &s.CdnEnabled)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"cdnProfile\":\n\t\t\terr = unpopulate(val, \"CdnProfile\", &s.CdnProfile)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"cdnProvider\":\n\t\t\terr = unpopulate(val, \"CdnProvider\", &s.CdnProvider)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"created\":\n\t\t\terr = unpopulateTimeRFC3339(val, \"Created\", &s.Created)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"crossSiteAccessPolicies\":\n\t\t\terr = unpopulate(val, \"CrossSiteAccessPolicies\", &s.CrossSiteAccessPolicies)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"customHostNames\":\n\t\t\terr = unpopulate(val, \"CustomHostNames\", &s.CustomHostNames)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"description\":\n\t\t\terr = unpopulate(val, \"Description\", &s.Description)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"freeTrialEndTime\":\n\t\t\terr = unpopulateTimeRFC3339(val, \"FreeTrialEndTime\", &s.FreeTrialEndTime)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"hostName\":\n\t\t\terr = unpopulate(val, \"HostName\", &s.HostName)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"lastModified\":\n\t\t\terr = unpopulateTimeRFC3339(val, \"LastModified\", &s.LastModified)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"maxCacheAge\":\n\t\t\terr = unpopulate(val, \"MaxCacheAge\", &s.MaxCacheAge)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &s.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"resourceState\":\n\t\t\terr = unpopulate(val, \"ResourceState\", &s.ResourceState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"scaleUnits\":\n\t\t\terr = unpopulate(val, \"ScaleUnits\", &s.ScaleUnits)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "797d4c28963a29c3733e2f9c66bb0743", "score": "0.6489533", "text": "func (t *TableProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", t, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"TableName\":\n\t\t\terr = unpopulate(val, \"TableName\", &t.TableName)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", t, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fbd27e7bd6a917234e63a4b7153308d0", "score": "0.64888126", "text": "func (d *DeploymentProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", d, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"callRateLimit\":\n\t\t\terr = unpopulate(val, \"CallRateLimit\", &d.CallRateLimit)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"capabilities\":\n\t\t\terr = unpopulate(val, \"Capabilities\", &d.Capabilities)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"model\":\n\t\t\terr = unpopulate(val, \"Model\", &d.Model)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &d.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"raiPolicyName\":\n\t\t\terr = unpopulate(val, \"RaiPolicyName\", &d.RaiPolicyName)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"rateLimits\":\n\t\t\terr = unpopulate(val, \"RateLimits\", &d.RateLimits)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"scaleSettings\":\n\t\t\terr = unpopulate(val, \"ScaleSettings\", &d.ScaleSettings)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"versionUpgradeOption\":\n\t\t\terr = unpopulate(val, \"VersionUpgradeOption\", &d.VersionUpgradeOption)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", d, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e2b0dc1e317adaddd5bb820779837645", "score": "0.6481573", "text": "func (a *AccountProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", a, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"accountId\":\n\t\t\terr = unpopulate(val, \"AccountID\", &a.AccountID)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"creationTime\":\n\t\t\terr = unpopulateTimeRFC3339(val, \"CreationTime\", &a.CreationTime)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"currentTier\":\n\t\t\terr = unpopulate(val, \"CurrentTier\", &a.CurrentTier)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"defaultGroup\":\n\t\t\terr = unpopulate(val, \"DefaultGroup\", &a.DefaultGroup)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"encryptionConfig\":\n\t\t\terr = unpopulate(val, \"EncryptionConfig\", &a.EncryptionConfig)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"encryptionProvisioningState\":\n\t\t\terr = unpopulate(val, \"EncryptionProvisioningState\", &a.EncryptionProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"encryptionState\":\n\t\t\terr = unpopulate(val, \"EncryptionState\", &a.EncryptionState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"endpoint\":\n\t\t\terr = unpopulate(val, \"Endpoint\", &a.Endpoint)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"firewallAllowAzureIps\":\n\t\t\terr = unpopulate(val, \"FirewallAllowAzureIPs\", &a.FirewallAllowAzureIPs)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"firewallRules\":\n\t\t\terr = unpopulate(val, \"FirewallRules\", &a.FirewallRules)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"firewallState\":\n\t\t\terr = unpopulate(val, \"FirewallState\", &a.FirewallState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"lastModifiedTime\":\n\t\t\terr = unpopulateTimeRFC3339(val, \"LastModifiedTime\", &a.LastModifiedTime)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"newTier\":\n\t\t\terr = unpopulate(val, \"NewTier\", &a.NewTier)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &a.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"state\":\n\t\t\terr = unpopulate(val, \"State\", &a.State)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"trustedIdProviderState\":\n\t\t\terr = unpopulate(val, \"TrustedIDProviderState\", &a.TrustedIDProviderState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"trustedIdProviders\":\n\t\t\terr = unpopulate(val, \"TrustedIDProviders\", &a.TrustedIDProviders)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"virtualNetworkRules\":\n\t\t\terr = unpopulate(val, \"VirtualNetworkRules\", &a.VirtualNetworkRules)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", a, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "192c598d3a22462520150aa52ed1e39e", "score": "0.64803314", "text": "func (r *RoutePropertiesFormat) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", r, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"addressPrefix\":\n\t\t\terr = unpopulate(val, \"AddressPrefix\", &r.AddressPrefix)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"hasBgpOverride\":\n\t\t\terr = unpopulate(val, \"HasBgpOverride\", &r.HasBgpOverride)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"nextHopIpAddress\":\n\t\t\terr = unpopulate(val, \"NextHopIPAddress\", &r.NextHopIPAddress)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"nextHopType\":\n\t\t\terr = unpopulate(val, \"NextHopType\", &r.NextHopType)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &r.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", r, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "99c4644afd515ca630ffbf968c0ef47f", "score": "0.6479407", "text": "func (p *PartnerManagedResourceProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", p, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"id\":\n\t\t\terr = unpopulate(val, \"ID\", &p.ID)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"internalLoadBalancerId\":\n\t\t\terr = unpopulate(val, \"InternalLoadBalancerID\", &p.InternalLoadBalancerID)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"standardLoadBalancerId\":\n\t\t\terr = unpopulate(val, \"StandardLoadBalancerID\", &p.StandardLoadBalancerID)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", p, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5d05cb4d970a0b727bad739d51ec4251", "score": "0.64736426", "text": "func (s *SyncSetProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"resources\":\n\t\t\terr = unpopulate(val, \"Resources\", &s.Resources)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d8a95b2899d135c7b8b5a08c05ecb717", "score": "0.6471729", "text": "func (p *PrivateLinkServiceConnectionProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", p, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"groupIds\":\n\t\t\terr = unpopulate(val, \"GroupIDs\", &p.GroupIDs)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"privateLinkServiceConnectionState\":\n\t\t\terr = unpopulate(val, \"PrivateLinkServiceConnectionState\", &p.PrivateLinkServiceConnectionState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"privateLinkServiceId\":\n\t\t\terr = unpopulate(val, \"PrivateLinkServiceID\", &p.PrivateLinkServiceID)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &p.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"requestMessage\":\n\t\t\terr = unpopulate(val, \"RequestMessage\", &p.RequestMessage)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", p, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "31772b118a38474b6b29dbf07d078e6b", "score": "0.6471092", "text": "func (t *TrustedIDProviderProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", t, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"idProvider\":\n\t\t\terr = unpopulate(val, \"IDProvider\", &t.IDProvider)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", t, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b19c32de25d254d4ceb651aee8ae7527", "score": "0.6470142", "text": "func (m *ManagerProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", m, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"description\":\n\t\t\terr = unpopulate(val, \"Description\", &m.Description)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"networkManagerScopeAccesses\":\n\t\t\terr = unpopulate(val, \"NetworkManagerScopeAccesses\", &m.NetworkManagerScopeAccesses)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"networkManagerScopes\":\n\t\t\terr = unpopulate(val, \"NetworkManagerScopes\", &m.NetworkManagerScopes)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &m.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"resourceGuid\":\n\t\t\terr = unpopulate(val, \"ResourceGUID\", &m.ResourceGUID)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", m, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3e5efd2e354ae30a22ef74291e27ece4", "score": "0.6469272", "text": "func (c *ConfigurationStoreProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn err\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"creationDate\":\n\t\t\terr = unpopulateTimeRFC3339(val, &c.CreationDate)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"disableLocalAuth\":\n\t\t\terr = unpopulate(val, &c.DisableLocalAuth)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"encryption\":\n\t\t\terr = unpopulate(val, &c.Encryption)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"endpoint\":\n\t\t\terr = unpopulate(val, &c.Endpoint)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"privateEndpointConnections\":\n\t\t\terr = unpopulate(val, &c.PrivateEndpointConnections)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, &c.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"publicNetworkAccess\":\n\t\t\terr = unpopulate(val, &c.PublicNetworkAccess)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5a837c8993f6f939059a77f786098500", "score": "0.64596117", "text": "func (n *NamespaceProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", n, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"createdAt\":\n\t\t\terr = unpopulateTimeRFC3339(val, \"CreatedAt\", &n.CreatedAt)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"critical\":\n\t\t\terr = unpopulate(val, \"Critical\", &n.Critical)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"dataCenter\":\n\t\t\terr = unpopulate(val, \"DataCenter\", &n.DataCenter)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"enabled\":\n\t\t\terr = unpopulate(val, \"Enabled\", &n.Enabled)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"metricId\":\n\t\t\terr = unpopulate(val, \"MetricID\", &n.MetricID)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"name\":\n\t\t\terr = unpopulate(val, \"Name\", &n.Name)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"namespaceType\":\n\t\t\terr = unpopulate(val, \"NamespaceType\", &n.NamespaceType)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &n.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"region\":\n\t\t\terr = unpopulate(val, \"Region\", &n.Region)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"scaleUnit\":\n\t\t\terr = unpopulate(val, \"ScaleUnit\", &n.ScaleUnit)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"serviceBusEndpoint\":\n\t\t\terr = unpopulate(val, \"ServiceBusEndpoint\", &n.ServiceBusEndpoint)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"status\":\n\t\t\terr = unpopulate(val, \"Status\", &n.Status)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"subscriptionId\":\n\t\t\terr = unpopulate(val, \"SubscriptionID\", &n.SubscriptionID)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"updatedAt\":\n\t\t\terr = unpopulateTimeRFC3339(val, \"UpdatedAt\", &n.UpdatedAt)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", n, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b77d7685ecb9a575e02240d1c60daf4c", "score": "0.64513767", "text": "func (r *RouteMapProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", r, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"associatedInboundConnections\":\n\t\t\terr = unpopulate(val, \"AssociatedInboundConnections\", &r.AssociatedInboundConnections)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"associatedOutboundConnections\":\n\t\t\terr = unpopulate(val, \"AssociatedOutboundConnections\", &r.AssociatedOutboundConnections)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &r.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"rules\":\n\t\t\terr = unpopulate(val, \"Rules\", &r.Rules)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", r, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "68e634c2ade4d5fbea9df24385c8e9c0", "score": "0.6438833", "text": "func (v *VirtualApplianceSKUProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", v, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"bundledScaleUnit\":\n\t\t\terr = unpopulate(val, \"BundledScaleUnit\", &v.BundledScaleUnit)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"marketPlaceVersion\":\n\t\t\terr = unpopulate(val, \"MarketPlaceVersion\", &v.MarketPlaceVersion)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"vendor\":\n\t\t\terr = unpopulate(val, \"Vendor\", &v.Vendor)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", v, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f062f10f2a0d2171d3dd95269723cfd6", "score": "0.6433372", "text": "func (a *MapVariableProperties_Values) UnmarshalJSON(b []byte) error {\n\tobject := make(map[string]json.RawMessage)\n\terr := json.Unmarshal(b, &object)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif len(object) != 0 {\n\t\ta.AdditionalProperties = make(map[string]string)\n\t\tfor fieldName, fieldBuf := range object {\n\t\t\tvar fieldVal string\n\t\t\terr := json.Unmarshal(fieldBuf, &fieldVal)\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrap(err, fmt.Sprintf(\"error unmarshaling field %s\", fieldName))\n\t\t\t}\n\t\t\ta.AdditionalProperties[fieldName] = fieldVal\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cf0012edef10b8971efb997375f99a01", "score": "0.64327776", "text": "func (p *PrivateEndpointProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", p, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"applicationSecurityGroups\":\n\t\t\terr = unpopulate(val, \"ApplicationSecurityGroups\", &p.ApplicationSecurityGroups)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"customDnsConfigs\":\n\t\t\terr = unpopulate(val, \"CustomDNSConfigs\", &p.CustomDNSConfigs)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"customNetworkInterfaceName\":\n\t\t\terr = unpopulate(val, \"CustomNetworkInterfaceName\", &p.CustomNetworkInterfaceName)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"ipConfigurations\":\n\t\t\terr = unpopulate(val, \"IPConfigurations\", &p.IPConfigurations)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"manualPrivateLinkServiceConnections\":\n\t\t\terr = unpopulate(val, \"ManualPrivateLinkServiceConnections\", &p.ManualPrivateLinkServiceConnections)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"networkInterfaces\":\n\t\t\terr = unpopulate(val, \"NetworkInterfaces\", &p.NetworkInterfaces)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"privateLinkServiceConnections\":\n\t\t\terr = unpopulate(val, \"PrivateLinkServiceConnections\", &p.PrivateLinkServiceConnections)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &p.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"subnet\":\n\t\t\terr = unpopulate(val, \"Subnet\", &p.Subnet)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", p, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "246ac475c62ae0aa9b9d753eb4fb29ae", "score": "0.6431457", "text": "func (t *TestLineProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", t, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"phoneNumber\":\n\t\t\terr = unpopulate(val, \"PhoneNumber\", &t.PhoneNumber)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"provisioningState\":\n\t\t\terr = unpopulate(val, \"ProvisioningState\", &t.ProvisioningState)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"purpose\":\n\t\t\terr = unpopulate(val, \"Purpose\", &t.Purpose)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", t, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cced19bcbb440ee564a1a23ccb523518", "score": "0.6427842", "text": "func (s *ServicePrincipalProfile) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"clientId\":\n\t\t\terr = unpopulate(val, \"ClientID\", &s.ClientID)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"clientSecret\":\n\t\t\terr = unpopulate(val, \"ClientSecret\", &s.ClientSecret)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e3634557741c4a218554968bbeb25afc", "score": "0.6415582", "text": "func (s *ServiceProvider) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"id\":\n\t\t\terr = unpopulate(val, \"ID\", &s.ID)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"name\":\n\t\t\terr = unpopulate(val, \"Name\", &s.Name)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"properties\":\n\t\t\terr = unpopulate(val, \"Properties\", &s.Properties)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"type\":\n\t\t\terr = unpopulate(val, \"Type\", &s.Type)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "415760a77e25c24ce47e4a7b33dfdbce", "score": "0.6410657", "text": "func (p *ProviderSpecificProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", p, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"providerType\":\n\t\t\terr = unpopulate(val, \"ProviderType\", &p.ProviderType)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", p, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1bd39eb0fbc85c33d262f01cdcc9c7a2", "score": "0.64006335", "text": "func (ls *LinkedService) UnmarshalJSON(body []byte) error {\n\tvar m map[string]*json.RawMessage\n\terr := json.Unmarshal(body, &m)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor k, v := range m {\n\t\tswitch k {\n\t\tcase \"properties\":\n\t\t\tif v != nil {\n\t\t\t\tvar linkedServiceProperties LinkedServiceProperties\n\t\t\t\terr = json.Unmarshal(*v, &linkedServiceProperties)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tls.LinkedServiceProperties = &linkedServiceProperties\n\t\t\t}\n\t\tcase \"tags\":\n\t\t\tif v != nil {\n\t\t\t\tvar tags map[string]*string\n\t\t\t\terr = json.Unmarshal(*v, &tags)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tls.Tags = tags\n\t\t\t}\n\t\tcase \"id\":\n\t\t\tif v != nil {\n\t\t\t\tvar ID string\n\t\t\t\terr = json.Unmarshal(*v, &ID)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tls.ID = &ID\n\t\t\t}\n\t\tcase \"name\":\n\t\t\tif v != nil {\n\t\t\t\tvar name string\n\t\t\t\terr = json.Unmarshal(*v, &name)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tls.Name = &name\n\t\t\t}\n\t\tcase \"type\":\n\t\t\tif v != nil {\n\t\t\t\tvar typeVar string\n\t\t\t\terr = json.Unmarshal(*v, &typeVar)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tls.Type = &typeVar\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "05a7e8c8172b0785f5f3eba7d4b5fbab", "score": "0.63991886", "text": "func (d *DataTransferDetailsValidationResponseProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", d, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"error\":\n\t\t\terr = unpopulate(val, \"Error\", &d.Error)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"status\":\n\t\t\terr = unpopulate(val, \"Status\", &d.Status)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"validationType\":\n\t\t\terr = unpopulate(val, \"ValidationType\", &d.ValidationType)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", d, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "89c1a387828d6ea5f858fcf613c0c699", "score": "0.6396993", "text": "func (a *AppProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", a, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"applicationId\":\n\t\t\terr = unpopulate(val, \"ApplicationID\", &a.ApplicationID)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"displayName\":\n\t\t\terr = unpopulate(val, \"DisplayName\", &a.DisplayName)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"state\":\n\t\t\terr = unpopulate(val, \"State\", &a.State)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"subdomain\":\n\t\t\terr = unpopulate(val, \"Subdomain\", &a.Subdomain)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"template\":\n\t\t\terr = unpopulate(val, \"Template\", &a.Template)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", a, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "521d177892367be56d666c5ea3998b7e", "score": "0.6391421", "text": "func (c *CloudToDeviceProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", c, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"defaultTtlAsIso8601\":\n\t\t\terr = unpopulate(val, \"DefaultTTLAsIso8601\", &c.DefaultTTLAsIso8601)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"feedback\":\n\t\t\terr = unpopulate(val, \"Feedback\", &c.Feedback)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"maxDeliveryCount\":\n\t\t\terr = unpopulate(val, \"MaxDeliveryCount\", &c.MaxDeliveryCount)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", c, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e1cf36f6595e1676e6b55c72812714e5", "score": "0.6387527", "text": "func (a *Label_Properties) UnmarshalJSON(b []byte) error {\n\tobject := make(map[string]json.RawMessage)\n\terr := json.Unmarshal(b, &object)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif len(object) != 0 {\n\t\ta.AdditionalProperties = make(map[string]string)\n\t\tfor fieldName, fieldBuf := range object {\n\t\t\tvar fieldVal string\n\t\t\terr := json.Unmarshal(fieldBuf, &fieldVal)\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrap(err, fmt.Sprintf(\"error unmarshaling field %s\", fieldName))\n\t\t\t}\n\t\t\ta.AdditionalProperties[fieldName] = fieldVal\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "bb4cdaf9fbf3ed7a59fb0b131c8ee7e2", "score": "0.6386937", "text": "func (a *ArmTemplateProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn err\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"contents\":\n\t\t\terr = unpopulate(val, &a.Contents)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"createdDate\":\n\t\t\terr = unpopulateTimeRFC3339(val, &a.CreatedDate)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"description\":\n\t\t\terr = unpopulate(val, &a.Description)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"displayName\":\n\t\t\terr = unpopulate(val, &a.DisplayName)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"enabled\":\n\t\t\terr = unpopulate(val, &a.Enabled)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"icon\":\n\t\t\terr = unpopulate(val, &a.Icon)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"parametersValueFilesInfo\":\n\t\t\terr = unpopulate(val, &a.ParametersValueFilesInfo)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"publisher\":\n\t\t\terr = unpopulate(val, &a.Publisher)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0e350e08bc8e6c47ca80e9b554ba1731", "score": "0.63819456", "text": "func (t *TrafficAnalyticsProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", t, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"networkWatcherFlowAnalyticsConfiguration\":\n\t\t\terr = unpopulate(val, \"NetworkWatcherFlowAnalyticsConfiguration\", &t.NetworkWatcherFlowAnalyticsConfiguration)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", t, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" } ]
573d20021762732ed4dacc5c0a90fd57
List: List all default supported Idp configurations for an Identity Toolkit project. parent: The parent resource name, for example, "projects/myawesomeproject".
[ { "docid": "a901bbeb6727cff79e283b32e5856cf2", "score": "0.7041688", "text": "func (r *ProjectsDefaultSupportedIdpConfigsService) List(parent string) *ProjectsDefaultSupportedIdpConfigsListCall {\n\tc := &ProjectsDefaultSupportedIdpConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.parent = parent\n\treturn c\n}", "title": "" } ]
[ { "docid": "5b863b8ca6304e23a11f2cdc31fa89f8", "score": "0.70502055", "text": "func (r *ProjectsTenantsDefaultSupportedIdpConfigsService) List(parent string) *ProjectsTenantsDefaultSupportedIdpConfigsListCall {\n\tc := &ProjectsTenantsDefaultSupportedIdpConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.parent = parent\n\treturn c\n}", "title": "" }, { "docid": "afb432a2bf564567d8f31487ceef2d34", "score": "0.6132938", "text": "func (r *ProjectsTenantsOauthIdpConfigsService) List(parent string) *ProjectsTenantsOauthIdpConfigsListCall {\n\tc := &ProjectsTenantsOauthIdpConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.parent = parent\n\treturn c\n}", "title": "" }, { "docid": "05bcc092aec1a8d74346100e6adac695", "score": "0.6103424", "text": "func (r *ProjectsOauthIdpConfigsService) List(parent string) *ProjectsOauthIdpConfigsListCall {\n\tc := &ProjectsOauthIdpConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.parent = parent\n\treturn c\n}", "title": "" }, { "docid": "41664ec16127fc03cb3a24e968d1ba1f", "score": "0.5672561", "text": "func (r *ProjectsInstanceConfigsService) List(parent string) *ProjectsInstanceConfigsListCall {\n\tc := &ProjectsInstanceConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.parent = parent\n\treturn c\n}", "title": "" }, { "docid": "cbf01c71f0058afafc6daa72ea094048", "score": "0.5575805", "text": "func (r *ProjectsTenantsInboundSamlConfigsService) List(parent string) *ProjectsTenantsInboundSamlConfigsListCall {\n\tc := &ProjectsTenantsInboundSamlConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.parent = parent\n\treturn c\n}", "title": "" }, { "docid": "19b8dc9eacd70c3c987dd80d98a8bc2c", "score": "0.5524026", "text": "func (r *ProjectsConfigsService) List(parent string) *ProjectsConfigsListCall {\n\tc := &ProjectsConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.parent = parent\n\treturn c\n}", "title": "" }, { "docid": "6ec2b787bb7e8fcfcae654a2e3539b16", "score": "0.5357828", "text": "func (r *ProjectsInboundSamlConfigsService) List(parent string) *ProjectsInboundSamlConfigsListCall {\n\tc := &ProjectsInboundSamlConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.parent = parent\n\treturn c\n}", "title": "" }, { "docid": "96c2be9b0f165350a5001a014e7bc014", "score": "0.530362", "text": "func (r *ProjectsTenantsService) List(parent string) *ProjectsTenantsListCall {\n\tc := &ProjectsTenantsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.parent = parent\n\treturn c\n}", "title": "" }, { "docid": "e6f1204b7c981cbdeea5b142a15edfad", "score": "0.5042082", "text": "func List() {\n\tgcpproject := \"angelic-bond-246708\"\n\tansiblejson := GetGcpAnsibleMap(gcpproject)\n\tjsonstring, _ := json.Marshal(ansiblejson)\n\tfmt.Println(string(jsonstring))\n}", "title": "" }, { "docid": "6aff706b03e4d6edc0be83035d7eafda", "score": "0.49761662", "text": "func (r *DefaultSupportedIdpsService) List() *DefaultSupportedIdpsListCall {\n\tc := &DefaultSupportedIdpsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\treturn c\n}", "title": "" }, { "docid": "df3e1fa90693d80a83319690a6f41a4d", "score": "0.49489793", "text": "func (r *ProjectsInstancesService) List(parent string) *ProjectsInstancesListCall {\n\tc := &ProjectsInstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.parent = parent\n\treturn c\n}", "title": "" }, { "docid": "2f53c68df6b56ca0bbd53dde0e607d76", "score": "0.4932661", "text": "func (r *ProjectsConfigsWaitersService) List(parent string) *ProjectsConfigsWaitersListCall {\n\tc := &ProjectsConfigsWaitersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.parent = parent\n\treturn c\n}", "title": "" }, { "docid": "c7be5261d0b5ffc3dbf7ea1694b272b2", "score": "0.48887536", "text": "func (r *ProjectsLocationsChannelConnectionsService) List(parent string) *ProjectsLocationsChannelConnectionsListCall {\n\tc := &ProjectsLocationsChannelConnectionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.parent = parent\n\treturn c\n}", "title": "" }, { "docid": "649977f4294b2e89f52a34c90f4c4997", "score": "0.487588", "text": "func (r *WideipNaptrResource) ListAll() (*WideipNaptrConfigList, error) {\n\tvar list WideipNaptrConfigList\n\tif err := r.c.ReadQuery(BasePath+WideipNaptrEndpoint, &list); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &list, nil\n}", "title": "" }, { "docid": "5e6a8c2dc6ff18faacbac85b715651c4", "score": "0.48170927", "text": "func List(c *cli.Context) error {\n\treturn config.List()\n}", "title": "" }, { "docid": "2e1e5d563260a3f8426065a26559826d", "score": "0.47326386", "text": "func (cl *Client) List(typ string) ([]model.Config, error) {\n\t_, exists := cl.descriptor.GetByType(typ)\n\tif !exists {\n\t\treturn nil, fmt.Errorf(\"missing type %q\", typ)\n\t}\n\n\tlist := &ConfigList{}\n\terrs := cl.dynamic.Get().\n\t\tNamespace(cl.namespace).\n\t\tResource(IstioKind + \"s\").\n\t\tDo().Into(list)\n\n\tout := make([]model.Config, 0)\n\tfor _, item := range list.Items {\n\t\tconfig, err := cl.convertConfig(&item)\n\t\tif typ == config.Type {\n\t\t\tif err != nil {\n\t\t\t\terrs = multierror.Append(errs, err)\n\t\t\t} else {\n\t\t\t\tout = append(out, config)\n\t\t\t}\n\t\t}\n\t}\n\treturn out, errs\n}", "title": "" }, { "docid": "c406354ecef0a9e2ad6d79c7e4ae134c", "score": "0.47290307", "text": "func (r *ProjectsDefaultSupportedIdpConfigsService) Create(parent string, googlecloudidentitytoolkitadminv2defaultsupportedidpconfig *GoogleCloudIdentitytoolkitAdminV2DefaultSupportedIdpConfig) *ProjectsDefaultSupportedIdpConfigsCreateCall {\n\tc := &ProjectsDefaultSupportedIdpConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.parent = parent\n\tc.googlecloudidentitytoolkitadminv2defaultsupportedidpconfig = googlecloudidentitytoolkitadminv2defaultsupportedidpconfig\n\treturn c\n}", "title": "" }, { "docid": "0a457156601a9222b351923274005a70", "score": "0.46910155", "text": "func (r *DNSResource) ListAll() (*DNSConfigList, error) {\n\tvar list DNSConfigList\n\tif err := r.c.ReadQuery(BasePath+DNSEndpoint, &list); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &list, nil\n}", "title": "" }, { "docid": "dcf61efd828dad6a2b870fceb0c24ac3", "score": "0.46861428", "text": "func (client *TenantConfigurationsClient) listCreateRequest(ctx context.Context, options *TenantConfigurationsClientListOptions) (*policy.Request, error) {\n\turlPath := \"/providers/Microsoft.Portal/tenantConfigurations\"\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2020-09-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "title": "" }, { "docid": "1ece7af9e8b9bc8534df9bc8ad853b17", "score": "0.46711043", "text": "func (repo *InMemoryProviderSettingsRepository) List(ctx context.Context, ownerID account.ID) ([]*ProviderSettings, error) {\n\tvar settings []*ProviderSettings\n\trepo.providerSettings.Range(func(k, v interface{}) bool {\n\t\tsetting := v.(*ProviderSettings)\n\t\tif setting.AccountID != ownerID {\n\t\t\treturn true\n\t\t}\n\n\t\tsettings = append(settings, setting)\n\n\t\treturn true\n\t})\n\n\treturn settings, nil\n}", "title": "" }, { "docid": "a2756018a165dee4f61d4a74a775c386", "score": "0.46696702", "text": "func (r *ProjectsLocationsChannelsService) List(parent string) *ProjectsLocationsChannelsListCall {\n\tc := &ProjectsLocationsChannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.parent = parent\n\treturn c\n}", "title": "" }, { "docid": "14e9f221bf96c783830e72bd37805fa0", "score": "0.46636045", "text": "func (r *PFManDeviceResource) ListAll() (*PFManDeviceConfigList, error) {\n\tvar list PFManDeviceConfigList\n\tif err := r.c.ReadQuery(BasePath+PFManDeviceEndpoint, &list); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &list, nil\n}", "title": "" }, { "docid": "85c9268acb91fc87d5940c67dd1dfeaa", "score": "0.46512762", "text": "func (c *ProjectsTenantsDefaultSupportedIdpConfigsListCall) Context(ctx context.Context) *ProjectsTenantsDefaultSupportedIdpConfigsListCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "fc505d2cb20ce8840b3492dee4df1c3a", "score": "0.46507838", "text": "func (r *ProjectsLocationsRegistriesDevicesService) List(parent string) *ProjectsLocationsRegistriesDevicesListCall {\n\tc := &ProjectsLocationsRegistriesDevicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.parent = parent\n\treturn c\n}", "title": "" }, { "docid": "f73a98e0a64469cfb84efcd78cfc8609", "score": "0.4622613", "text": "func (r *ProjectsTenantsDefaultSupportedIdpConfigsService) Create(parent string, googlecloudidentitytoolkitadminv2defaultsupportedidpconfig *GoogleCloudIdentitytoolkitAdminV2DefaultSupportedIdpConfig) *ProjectsTenantsDefaultSupportedIdpConfigsCreateCall {\n\tc := &ProjectsTenantsDefaultSupportedIdpConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.parent = parent\n\tc.googlecloudidentitytoolkitadminv2defaultsupportedidpconfig = googlecloudidentitytoolkitadminv2defaultsupportedidpconfig\n\treturn c\n}", "title": "" }, { "docid": "7e1bc07966e97fb872ddd67606e64ac9", "score": "0.462201", "text": "func (client *ProvidersClient) listDefaultCreateRequest(ctx context.Context, options *ProvidersClientListDefaultOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/providers/Microsoft.Attestation/defaultProviders\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2020-10-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "title": "" }, { "docid": "c214d47bbf44974b9a7eb9a567cfc852", "score": "0.46184933", "text": "func (s *KPIService) List(ctx context.Context, opt *Options) (*KPI, *Response, error) {\n\tu, err := addOptions(fmt.Sprintf(\"kpis/v1/%s.json\", s.client.AppID), opt)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tfmt.Println(u)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tkpis := &KPI{}\n\n\tresp, err := s.client.Do(ctx, req, kpis)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn kpis, resp, nil\n}", "title": "" }, { "docid": "8da27746716985785173d4a79810d03a", "score": "0.46174327", "text": "func (r *ProjectsAgentIntentsService) List(parent string) *ProjectsAgentIntentsListCall {\n\tc := &ProjectsAgentIntentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.parent = parent\n\treturn c\n}", "title": "" }, { "docid": "9b414b235bf2228914300c4541ffc930", "score": "0.46160823", "text": "func (r *DOSProfileResource) ListAll() (*DOSProfileConfigList, error) {\n\tvar list DOSProfileConfigList\n\tif err := r.c.ReadQuery(BasePath+DOSProfileEndpoint, &list); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &list, nil\n}", "title": "" }, { "docid": "661160e033cb4b4a0ca91f4b55e350c7", "score": "0.46148354", "text": "func (r *ProjectsLocationsProvidersService) List(parent string) *ProjectsLocationsProvidersListCall {\n\tc := &ProjectsLocationsProvidersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.parent = parent\n\treturn c\n}", "title": "" }, { "docid": "bb26533ea163c5f2d27729978be75d2d", "score": "0.45998865", "text": "func ListConfig(config *config.Config) error {\n\terr := source.From(\"ini\", config)\n\tfmt.Println(config.String())\n\treturn err\n}", "title": "" }, { "docid": "57c965c75d83c2e070e2af001eea5780", "score": "0.45949298", "text": "func ipamConfigCRD() *apiextensions.CustomResourceDefinition {\n\treturn &apiextensions.CustomResourceDefinition{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: \"ipamconfigs.crd.projectcalico.org\",\n\t\t},\n\t\tSpec: apiextensions.CustomResourceDefinitionSpec{\n\t\t\tScope: apiextensions.ClusterScoped,\n\t\t\tGroup: \"crd.projectcalico.org\",\n\t\t\tVersions: []apiextensions.CustomResourceDefinitionVersion{\n\t\t\t\t{\n\t\t\t\t\tName: \"v1\",\n\t\t\t\t\tServed: true,\n\t\t\t\t\tStorage: true,\n\t\t\t\t},\n\t\t\t},\n\t\t\tNames: apiextensions.CustomResourceDefinitionNames{\n\t\t\t\tKind: \"IPAMConfig\",\n\t\t\t\tPlural: \"ipamconfigs\",\n\t\t\t\tSingular: \"ipamconfig\",\n\t\t\t},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "4740c69f009c8ea87300168e75edbef4", "score": "0.4591019", "text": "func (c *ProjectsTenantsDefaultSupportedIdpConfigsCreateCall) IdpId(idpId string) *ProjectsTenantsDefaultSupportedIdpConfigsCreateCall {\n\tc.urlParams_.Set(\"idpId\", idpId)\n\treturn c\n}", "title": "" }, { "docid": "a9fcb5035e07aee92ea1fc06bf3212bb", "score": "0.45842746", "text": "func (r *PoolNAPTRResource) ListAll() (*PoolNAPTRConfigList, error) {\n\tvar list PoolNAPTRConfigList\n\tif err := r.c.ReadQuery(BasePath+PoolNAPTREndpoint, &list); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &list, nil\n}", "title": "" }, { "docid": "13f2dc2417b78d397f3aab9e52f56727", "score": "0.45823243", "text": "func (r *ICallPublisherResource) ListAll() (*ICallPublisherConfigList, error) {\n\tvar list ICallPublisherConfigList\n\tif err := r.c.ReadQuery(BasePath+ICallPublisherEndpoint, &list); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &list, nil\n}", "title": "" }, { "docid": "2a2e3c4624fe2cb084373214b83bfde5", "score": "0.4553942", "text": "func (c *ProjectsDefaultSupportedIdpConfigsCreateCall) IdpId(idpId string) *ProjectsDefaultSupportedIdpConfigsCreateCall {\n\tc.urlParams_.Set(\"idpId\", idpId)\n\treturn c\n}", "title": "" }, { "docid": "cf9461c5a2371240a6dc1631fa0413f0", "score": "0.45505285", "text": "func (c *ProjectsTenantsDefaultSupportedIdpConfigsGetCall) Fields(s ...googleapi.Field) *ProjectsTenantsDefaultSupportedIdpConfigsGetCall {\n\tc.urlParams_.Set(\"fields\", googleapi.CombineFields(s))\n\treturn c\n}", "title": "" }, { "docid": "0319565f3d145ec2d1a0f52249dd1ccb", "score": "0.45428705", "text": "func defaultCVRList() cvrListFn {\n\treturn cvr.KubeClient().List\n}", "title": "" }, { "docid": "f12273f9115e27629e10476257985861", "score": "0.45416668", "text": "func (s *Service) ConfigurationsList() *ConfigurationsListOp {\n\treturn &ConfigurationsListOp{\n\t\tCredential: s.credential,\n\t\tMethod: \"GET\",\n\t\tPath: \"connect\",\n\t\tAccept: \"application/json\",\n\t\tQueryOpts: make(url.Values),\n\t\tVersion: esign.APIv21,\n\t}\n}", "title": "" }, { "docid": "98bddaf3a4041a8ffba273b1a529afd8", "score": "0.45393735", "text": "func (r *ProjectsLocationsWorkstationClustersWorkstationConfigsService) List(parent string) *ProjectsLocationsWorkstationClustersWorkstationConfigsListCall {\n\tc := &ProjectsLocationsWorkstationClustersWorkstationConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.parent = parent\n\treturn c\n}", "title": "" }, { "docid": "9ea693a655eb80732153338e4c82d314", "score": "0.45320538", "text": "func (r *DOSProfileApplicationResource) ListAll() (*DOSProfileApplicationConfigList, error) {\n\tvar list DOSProfileApplicationConfigList\n\tif err := r.c.ReadQuery(BasePath+DOSProfileApplicationEndpoint, &list); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &list, nil\n}", "title": "" }, { "docid": "09f6826e722eb83528898f79ea01640e", "score": "0.45213324", "text": "func (c *ProjectsTenantsDefaultSupportedIdpConfigsListCall) Fields(s ...googleapi.Field) *ProjectsTenantsDefaultSupportedIdpConfigsListCall {\n\tc.urlParams_.Set(\"fields\", googleapi.CombineFields(s))\n\treturn c\n}", "title": "" }, { "docid": "14c65476010fce9594a3108b6d95c6f2", "score": "0.45212105", "text": "func (r *ICallScriptResource) ListAll() (*ICallScriptConfigList, error) {\n\tvar list ICallScriptConfigList\n\tif err := r.c.ReadQuery(BasePath+ICallScriptEndpoint, &list); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &list, nil\n}", "title": "" }, { "docid": "0b9295a1495fe5d3527a69eb85fc1435", "score": "0.4491623", "text": "func (f *eniIPFactory) ListResource() (map[string]types.NetworkResource, error) {\n\treturn nil, nil\n}", "title": "" }, { "docid": "a58d1fe4e6d60edf19e375f2801b532f", "score": "0.448052", "text": "func (iwc IWConfig) InfoList() ([]IWConfigInfo, error) {\n\tlogger.Debug(\"IWConfig: Getting wifi information\")\n\n\tcmd := exec.Command(\"iwconfig\")\n\tlogger.Debug(\"Command Start: %v\", cmd.Args)\n\tout, err := cmd.CombinedOutput()\n\tif err != nil {\n\t\tlogger.Error(\"Command Error: %v : %v\", err, limitText(out))\n\t\treturn nil, err\n\t}\n\tresults, err := iwc.parseInfo(string(out))\n\n\treturn results, err\n}", "title": "" }, { "docid": "71e2893ed99c2f367607cf4038a7c8bf", "score": "0.44803655", "text": "func (r *ClockResource) ListAll() (*ClockConfigList, error) {\n\tvar list ClockConfigList\n\tif err := r.c.ReadQuery(BasePath+ClockEndpoint, &list); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &list, nil\n}", "title": "" }, { "docid": "0bdba056edea0fd2b6d084f54d5af543", "score": "0.44749507", "text": "func (client *WorkloadNetworksClient) listDhcpCreateRequest(ctx context.Context, resourceGroupName string, privateCloudName string, options *WorkloadNetworksClientListDhcpOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif privateCloudName == \"\" {\n\t\treturn nil, errors.New(\"parameter privateCloudName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{privateCloudName}\", url.PathEscape(privateCloudName))\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2023-03-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "title": "" }, { "docid": "7cd2dfa836322aa0a7dae5ff7ff33e00", "score": "0.44680372", "text": "func (r *ScriptdResource) ListAll() (*ScriptdConfigList, error) {\n\tvar list ScriptdConfigList\n\tif err := r.c.ReadQuery(BasePath+ScriptdEndpoint, &list); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &list, nil\n}", "title": "" }, { "docid": "68b1d1ec37bc4510c5450c0aa1457449", "score": "0.44589695", "text": "func (c *ProjectsTenantsDefaultSupportedIdpConfigsGetCall) Context(ctx context.Context) *ProjectsTenantsDefaultSupportedIdpConfigsGetCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "56a8732b0264d3c404f750bf1651f4ae", "score": "0.4454518", "text": "func ExampleConfigurationsClient_List() {\n\tcred, err := azidentity.NewDefaultAzureCredential(nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to obtain a credential: %v\", err)\n\t}\n\tctx := context.Background()\n\tclient, err := armhdinsight.NewConfigurationsClient(\"subid\", cred, nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to create client: %v\", err)\n\t}\n\tres, err := client.List(ctx,\n\t\t\"rg1\",\n\t\t\"cluster1\",\n\t\tnil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to finish the request: %v\", err)\n\t}\n\t// TODO: use response item\n\t_ = res\n}", "title": "" }, { "docid": "a90ca905e5dbf3b144b07923e2a729c5", "score": "0.44494253", "text": "func (r *ProjectsLocationsService) List(parent string) *ProjectsLocationsListCall {\n\tc := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.parent = parent\n\treturn c\n}", "title": "" }, { "docid": "148f3ab7280495826450f96d15e133b0", "score": "0.44394615", "text": "func ExampleAttachedNetworksClient_NewListByProjectPager() {\n\tcred, err := azidentity.NewDefaultAzureCredential(nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to obtain a credential: %v\", err)\n\t}\n\tctx := context.Background()\n\tclientFactory, err := armdevcenter.NewClientFactory(\"<subscription-id>\", cred, nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to create client: %v\", err)\n\t}\n\tpager := clientFactory.NewAttachedNetworksClient().NewListByProjectPager(\"rg1\", \"DevProject\", &armdevcenter.AttachedNetworksClientListByProjectOptions{Top: nil})\n\tfor pager.More() {\n\t\tpage, err := pager.NextPage(ctx)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"failed to advance page: %v\", err)\n\t\t}\n\t\tfor _, v := range page.Value {\n\t\t\t// You could use page here. We use blank identifier for just demo purposes.\n\t\t\t_ = v\n\t\t}\n\t\t// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.\n\t\t// page.AttachedNetworkListResult = armdevcenter.AttachedNetworkListResult{\n\t\t// \tValue: []*armdevcenter.AttachedNetworkConnection{\n\t\t// \t\t{\n\t\t// \t\t\tName: to.Ptr(\"netmap1\"),\n\t\t// \t\t\tType: to.Ptr(\"Microsoft.DevCenter/projects/attachedNetworks\"),\n\t\t// \t\t\tID: to.Ptr(\"/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/rg1/providers/Microsoft.DevCenter/projects/DevProject/attachednetworks/netmap1\"),\n\t\t// \t\t\tSystemData: &armdevcenter.SystemData{\n\t\t// \t\t\t\tCreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, \"2020-11-18T18:24:24.818Z\"); return t}()),\n\t\t// \t\t\t\tCreatedBy: to.Ptr(\"User1\"),\n\t\t// \t\t\t\tCreatedByType: to.Ptr(armdevcenter.CreatedByTypeApplication),\n\t\t// \t\t\t\tLastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, \"2020-11-18T18:24:24.818Z\"); return t}()),\n\t\t// \t\t\t\tLastModifiedBy: to.Ptr(\"User1\"),\n\t\t// \t\t\t\tLastModifiedByType: to.Ptr(armdevcenter.CreatedByTypeApplication),\n\t\t// \t\t\t},\n\t\t// \t\t\tProperties: &armdevcenter.AttachedNetworkConnectionProperties{\n\t\t// \t\t\t\tHealthCheckStatus: to.Ptr(armdevcenter.HealthCheckStatus(\"Healthy\")),\n\t\t// \t\t\t\tNetworkConnectionID: to.Ptr(\"/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/rg1/providers/Microsoft.DevCenter/NetworkConnections/network-uswest3\"),\n\t\t// \t\t\t\tNetworkConnectionLocation: to.Ptr(\"centralus\"),\n\t\t// \t\t\t\tProvisioningState: to.Ptr(armdevcenter.ProvisioningStateSucceeded),\n\t\t// \t\t\t},\n\t\t// \t\t},\n\t\t// \t\t{\n\t\t// \t\t\tName: to.Ptr(\"netmap2\"),\n\t\t// \t\t\tType: to.Ptr(\"Microsoft.DevCenter/projects/attachedNetworks\"),\n\t\t// \t\t\tID: to.Ptr(\"/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/rg1/providers/Microsoft.DevCenter/projects/DevProject/attachednetworks/netmap2\"),\n\t\t// \t\t\tSystemData: &armdevcenter.SystemData{\n\t\t// \t\t\t\tCreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, \"2020-11-18T18:24:24.818Z\"); return t}()),\n\t\t// \t\t\t\tCreatedBy: to.Ptr(\"User1\"),\n\t\t// \t\t\t\tCreatedByType: to.Ptr(armdevcenter.CreatedByTypeUser),\n\t\t// \t\t\t\tLastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, \"2020-11-18T18:24:24.818Z\"); return t}()),\n\t\t// \t\t\t\tLastModifiedBy: to.Ptr(\"User1\"),\n\t\t// \t\t\t\tLastModifiedByType: to.Ptr(armdevcenter.CreatedByTypeUser),\n\t\t// \t\t\t},\n\t\t// \t\t\tProperties: &armdevcenter.AttachedNetworkConnectionProperties{\n\t\t// \t\t\t\tHealthCheckStatus: to.Ptr(armdevcenter.HealthCheckStatus(\"Healthy\")),\n\t\t// \t\t\t\tNetworkConnectionID: to.Ptr(\"/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/rg1/providers/Microsoft.DevCenter/NetworkConnections/network-uswest3\"),\n\t\t// \t\t\t\tNetworkConnectionLocation: to.Ptr(\"centralus\"),\n\t\t// \t\t\t\tProvisioningState: to.Ptr(armdevcenter.ProvisioningStateSucceeded),\n\t\t// \t\t\t},\n\t\t// \t}},\n\t\t// }\n\t}\n}", "title": "" }, { "docid": "5bc2a5af99894cbf6a1e2e3f121fb742", "score": "0.4431125", "text": "func (client WorkloadNetworksClient) ListDhcpPreparer(ctx context.Context, resourceGroupName string, privateCloudName string) (*http.Request, error) {\n\tpathParameters := map[string]interface{}{\n\t\t\"privateCloudName\": autorest.Encode(\"path\", privateCloudName),\n\t\t\"resourceGroupName\": autorest.Encode(\"path\", resourceGroupName),\n\t\t\"subscriptionId\": autorest.Encode(\"path\", client.SubscriptionID),\n\t}\n\n\tconst APIVersion = \"2021-06-01\"\n\tqueryParameters := map[string]interface{}{\n\t\t\"api-version\": APIVersion,\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsGet(),\n\t\tautorest.WithBaseURL(client.BaseURI),\n\t\tautorest.WithPathParameters(\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations\", pathParameters),\n\t\tautorest.WithQueryParameters(queryParameters))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}", "title": "" }, { "docid": "ba4927e3dcf7906f52e622a2781b2bf0", "score": "0.4424135", "text": "func (r *ProjectsInstancesDatabasesService) List(parent string) *ProjectsInstancesDatabasesListCall {\n\tc := &ProjectsInstancesDatabasesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.parent = parent\n\treturn c\n}", "title": "" }, { "docid": "30f523526153b117f3c5a7c8d08eb6a5", "score": "0.44210336", "text": "func (*ListProjectsReq) Descriptor() ([]byte, []int) {\n\treturn file_external_iam_v2_request_policy_proto_rawDescGZIP(), []int{18}\n}", "title": "" }, { "docid": "fccf68c1ae7041ffbbc587513c7b4600", "score": "0.43966118", "text": "func (*ListProjectsRequest) Descriptor() ([]byte, []int) {\n\treturn edgelq_devices_proto_v1alpha_project_service_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "7abd1005b7d4f76b1f3df596e18e6897", "score": "0.4394092", "text": "func (r *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsService) List(parent string) *ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsListCall {\n\tc := &ProjectsLocationsWorkstationClustersWorkstationConfigsWorkstationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.parent = parent\n\treturn c\n}", "title": "" }, { "docid": "64775b46fcf5556261e3f3285ea7701c", "score": "0.43935", "text": "func (r *PoolResource) ListAll() (*PoolConfigList, error) {\n\tvar list PoolConfigList\n\tif err := r.c.ReadQuery(BasePath+PoolEndpoint, &list); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &list, nil\n}", "title": "" }, { "docid": "62334fc1105e25ffcf17f97a8d31d429", "score": "0.43912634", "text": "func (c *ProjectsDefaultSupportedIdpConfigsListCall) Context(ctx context.Context) *ProjectsDefaultSupportedIdpConfigsListCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "1051ed1313cc94057c479980e21c87be", "score": "0.43881014", "text": "func (r *ProjectsCompaniesService) List(parent string) *ProjectsCompaniesListCall {\n\tc := &ProjectsCompaniesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.parent = parent\n\treturn c\n}", "title": "" }, { "docid": "eb989840172a87f944825b54a3860e97", "score": "0.43873212", "text": "func (r *ProjectsConfigsVariablesService) List(parent string) *ProjectsConfigsVariablesListCall {\n\tc := &ProjectsConfigsVariablesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.parent = parent\n\treturn c\n}", "title": "" }, { "docid": "5724272abaf1b676cf9752e302628fe1", "score": "0.43811524", "text": "func (c *ProjectController) List(ctx *app.ListProjectContext) error {\n\t// ProjectController_List: start_implement\n\n\t// Put your logic here\n\tprojects, err := persist.DBConn.FindAllProjects()\n\tif err != nil {\n\t\tgoalogrus.Entry(ctx).Errorf(\"While querying all projects: %q\", err)\n\t\tres := app.OctorunnerProjectCollection{}\n\t\treturn ctx.OK(res)\n\t}\n\n\tprojectCollection := make(app.OctorunnerProjectCollection, len(*projects))\n\tfor i, project := range *projects {\n\t\tprojectCollection[i] = &app.OctorunnerProject{\n\t\t\tID: int(project.ID),\n\t\t\tName: project.Name,\n\t\t\tOwner: project.Owner,\n\t\t}\n\t}\n\n\treturn ctx.OK(projectCollection)\n\t// ProjectController_List: end_implement\n}", "title": "" }, { "docid": "7c955690946a60d73fb2657664bf9df8", "score": "0.43652245", "text": "func (cl *Client) List(typ, namespace string) ([]Config, error) {\n\ts, ok := knownTypes[typ]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"unrecognized type %q\", typ)\n\t}\n\trc, ok := cl.clientset[apiVersion(&s.schema)]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"unrecognized apiVersion %v\", s.schema)\n\t}\n\tschema, exists := rc.descriptor.GetByType(typ)\n\tif !exists {\n\t\treturn nil, fmt.Errorf(\"missing type %q\", typ)\n\t}\n\n\tlist := knownTypes[schema.Type].collection.DeepCopyObject().(IstioObjectList)\n\terrs := rc.dynamic.Get().\n\t\tNamespace(namespace).\n\t\tResource(ResourceName(schema.Plural)).\n\t\tDo().Into(list)\n\n\tout := make([]Config, 0)\n\tfor _, item := range list.GetItems() {\n\t\tobj, err := ConvertObject(schema, item, cl.domainSuffix)\n\t\tif err != nil {\n\t\t\terrs = multierror.Append(errs, err)\n\t\t} else {\n\t\t\tout = append(out, *obj)\n\t\t}\n\t}\n\treturn out, errs\n}", "title": "" }, { "docid": "0a2d5d15920685c0a535745c748c5c27", "score": "0.43518505", "text": "func CloudProviderConfigIni(infraID string, p *vspheretypes.Platform) (string, error) {\n\tbuf := new(bytes.Buffer)\n\n\tfmt.Fprintln(buf, \"[Global]\")\n\tprintIfNotEmpty(buf, \"secret-name\", \"vsphere-creds\")\n\tprintIfNotEmpty(buf, \"secret-namespace\", \"kube-system\")\n\tprintIfNotEmpty(buf, \"insecure-flag\", \"1\")\n\tfmt.Fprintln(buf, \"\")\n\n\tfor _, vcenter := range p.VCenters {\n\t\tfmt.Fprintf(buf, \"[VirtualCenter %q]\\n\", vcenter.Server)\n\t\tif vcenter.Port != 0 {\n\t\t\tprintIfNotEmpty(buf, \"port\", fmt.Sprintf(\"%d\", vcenter.Port))\n\t\t\tfmt.Fprintln(buf, \"\")\n\t\t}\n\t\tdatacenters := make([]string, 0, len(vcenter.Datacenters))\n\t\tdatacenters = append(datacenters, vcenter.Datacenters...)\n\t\tfor _, failureDomain := range p.FailureDomains {\n\t\t\tif failureDomain.Server == vcenter.Server {\n\t\t\t\tfailureDomainDatacenter := failureDomain.Topology.Datacenter\n\t\t\t\texists := false\n\t\t\t\tfor _, existingDatacenter := range datacenters {\n\t\t\t\t\tif failureDomainDatacenter == existingDatacenter {\n\t\t\t\t\t\texists = true\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif !exists {\n\t\t\t\t\tdatacenters = append(datacenters, failureDomainDatacenter)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tprintIfNotEmpty(buf, \"datacenters\", strings.Join(datacenters, \",\"))\n\t}\n\tfmt.Fprintln(buf, \"\")\n\n\tfmt.Fprintln(buf, \"[Workspace]\")\n\tprintIfNotEmpty(buf, \"server\", p.FailureDomains[0].Server)\n\tprintIfNotEmpty(buf, \"datacenter\", p.FailureDomains[0].Topology.Datacenter)\n\tprintIfNotEmpty(buf, \"default-datastore\", p.FailureDomains[0].Topology.Datastore)\n\n\tfolderPath := fmt.Sprintf(\"/%s/vm/%s\", p.FailureDomains[0].Topology.Datacenter, infraID)\n\tif p.FailureDomains[0].Topology.Folder != \"\" {\n\t\tfolderPath = p.FailureDomains[0].Topology.Folder\n\t}\n\tprintIfNotEmpty(buf, \"folder\", folderPath)\n\tprintIfNotEmpty(buf, \"resourcepool-path\", p.FailureDomains[0].Topology.ResourcePool)\n\tfmt.Fprintln(buf, \"\")\n\n\tif len(p.FailureDomains) > 1 {\n\t\tfmt.Fprintln(buf, \"[Labels]\")\n\t\tprintIfNotEmpty(buf, \"region\", regionTagCategory)\n\t\tprintIfNotEmpty(buf, \"zone\", zoneTagCategory)\n\t}\n\n\treturn buf.String(), nil\n}", "title": "" }, { "docid": "e715a4336c69c2af9676d2e1d5eed7d4", "score": "0.43508556", "text": "func (r *OrganizationsGcpUserAccessBindingsService) List(parent string) *OrganizationsGcpUserAccessBindingsListCall {\n\tc := &OrganizationsGcpUserAccessBindingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.parent = parent\n\treturn c\n}", "title": "" }, { "docid": "02616a74716a09947eb36463c68b9a73", "score": "0.4348883", "text": "func (t *TaskList) currentList() Project {\n\treturn t.Projects[t.CurrentProject]\n}", "title": "" }, { "docid": "165add1b27827bfd67133cfefbc4d1e4", "score": "0.43351498", "text": "func (*ApplicableConfig_Project) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_cv_internal_changelist_storage_proto_rawDescGZIP(), []int{5, 0}\n}", "title": "" }, { "docid": "2cbe17f19a748d02e86f6e0eadc67d6b", "score": "0.4331352", "text": "func (r *ProjectsLocationsRegistriesService) List(parent string) *ProjectsLocationsRegistriesListCall {\n\tc := &ProjectsLocationsRegistriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.parent = parent\n\treturn c\n}", "title": "" }, { "docid": "58dd1a74c47f50dbfe46010bc7ffad0f", "score": "0.4319553", "text": "func (s *ProjectServiceOp) List(opts *ListOptions) (projects []Project, resp *Response, err error) {\n\tapiPathQuery := opts.WithQuery(projectBasePath)\n\n\tfor {\n\t\tsubset := new(projectsRoot)\n\n\t\tresp, err = s.client.DoRequest(\"GET\", apiPathQuery, nil, subset)\n\t\tif err != nil {\n\t\t\treturn nil, resp, err\n\t\t}\n\n\t\tprojects = append(projects, subset.Projects...)\n\n\t\tif apiPathQuery = nextPage(subset.Meta, opts); apiPathQuery != \"\" {\n\t\t\tcontinue\n\t\t}\n\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "59baf053ebd742ad58e8e6192e926cb0", "score": "0.43074727", "text": "func ExampleConfigurationsClient_NewListPager() {\n\tcred, err := azidentity.NewDefaultAzureCredential(nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to obtain a credential: %v\", err)\n\t}\n\tctx := context.Background()\n\tclientFactory, err := armmaintenance.NewClientFactory(\"<subscription-id>\", cred, nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to create client: %v\", err)\n\t}\n\tpager := clientFactory.NewConfigurationsClient().NewListPager(nil)\n\tfor pager.More() {\n\t\tpage, err := pager.NextPage(ctx)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"failed to advance page: %v\", err)\n\t\t}\n\t\tfor _, v := range page.Value {\n\t\t\t// You could use page here. We use blank identifier for just demo purposes.\n\t\t\t_ = v\n\t\t}\n\t\t// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.\n\t\t// page.ListMaintenanceConfigurationsResult = armmaintenance.ListMaintenanceConfigurationsResult{\n\t\t// \tValue: []*armmaintenance.Configuration{\n\t\t// \t\t{\n\t\t// \t\t\tName: to.Ptr(\"configuration1\"),\n\t\t// \t\t\tID: to.Ptr(\"/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1\"),\n\t\t// \t\t\tLocation: to.Ptr(\"westus2\"),\n\t\t// \t\t\tProperties: &armmaintenance.ConfigurationProperties{\n\t\t// \t\t\t\tMaintenanceScope: to.Ptr(armmaintenance.MaintenanceScopeOSImage),\n\t\t// \t\t\t\tMaintenanceWindow: &armmaintenance.Window{\n\t\t// \t\t\t\t\tDuration: to.Ptr(\"05:00\"),\n\t\t// \t\t\t\t\tExpirationDateTime: to.Ptr(\"9999-12-31 00:00\"),\n\t\t// \t\t\t\t\tRecurEvery: to.Ptr(\"Week Saturday,Sunday\"),\n\t\t// \t\t\t\t\tStartDateTime: to.Ptr(\"2020-04-30 08:00\"),\n\t\t// \t\t\t\t\tTimeZone: to.Ptr(\"Pacific Standard Time\"),\n\t\t// \t\t\t\t},\n\t\t// \t\t\t\tNamespace: to.Ptr(\"Microsoft.Maintenance\"),\n\t\t// \t\t\t\tVisibility: to.Ptr(armmaintenance.VisibilityCustom),\n\t\t// \t\t\t},\n\t\t// \t}},\n\t\t// }\n\t}\n}", "title": "" }, { "docid": "69c4bb680274c027c6ab5c6fe5169efb", "score": "0.43030125", "text": "func (c *ProjectsDefaultSupportedIdpConfigsGetCall) Fields(s ...googleapi.Field) *ProjectsDefaultSupportedIdpConfigsGetCall {\n\tc.urlParams_.Set(\"fields\", googleapi.CombineFields(s))\n\treturn c\n}", "title": "" }, { "docid": "e88af192dfdf8f13ebd7beb7a6ff7cfe", "score": "0.43023685", "text": "func (c *Config) GetProjectNameList() []string {\n\treturn c.globalConfig.GetProjectNameList()\n}", "title": "" }, { "docid": "6737b76989ff04f59254876fe1d6d861", "score": "0.42910314", "text": "func (c *Dg) ShowList() ([]string, error) {\n c.con.LogQuery(\"(show) list of device groups\")\n path := c.xpath(nil)\n return c.con.EntryListUsing(c.con.Show, path[:len(path) - 1])\n}", "title": "" }, { "docid": "c5553f3be34fd996f9212e0a947d1081", "score": "0.42908263", "text": "func (in *IstioConfigService) GetIstioConfigList(criteria IstioConfigCriteria) (models.IstioConfigList, error) {\n\tif criteria.Namespace == \"\" {\n\t\treturn models.IstioConfigList{}, errors.New(\"GetIstioConfigList needs a non empty Namespace\")\n\t}\n\tistioConfigList := models.IstioConfigList{\n\t\tNamespace: models.Namespace{Name: criteria.Namespace},\n\t\tGateways: models.Gateways{},\n\t\tVirtualServices: models.VirtualServices{},\n\t\tDestinationRules: models.DestinationRules{},\n\t\tServiceEntries: models.ServiceEntries{},\n\t\tRules: models.IstioRules{},\n\t\tQuotaSpecs: models.QuotaSpecs{},\n\t\tQuotaSpecBindings: models.QuotaSpecBindings{},\n\t}\n\tvar gg, vs, dr, se, qs, qb []kubernetes.IstioObject\n\tvar mr *kubernetes.IstioRules\n\tvar ggErr, vsErr, drErr, seErr, mrErr, qsErr, qbErr error\n\tvar wg sync.WaitGroup\n\twg.Add(7)\n\n\tgo func() {\n\t\tdefer wg.Done()\n\t\tif criteria.IncludeGateways {\n\t\t\tif gg, ggErr = in.k8s.GetGateways(criteria.Namespace); ggErr == nil {\n\t\t\t\t(&istioConfigList.Gateways).Parse(gg)\n\t\t\t}\n\t\t}\n\t}()\n\n\tgo func() {\n\t\tdefer wg.Done()\n\t\tif criteria.IncludeVirtualServices {\n\t\t\tif vs, vsErr = in.k8s.GetVirtualServices(criteria.Namespace, \"\"); vsErr == nil {\n\t\t\t\t(&istioConfigList.VirtualServices).Parse(vs)\n\t\t\t}\n\t\t}\n\t}()\n\n\tgo func() {\n\t\tdefer wg.Done()\n\t\tif criteria.IncludeDestinationRules {\n\t\t\tif dr, drErr = in.k8s.GetDestinationRules(criteria.Namespace, \"\"); drErr == nil {\n\t\t\t\t(&istioConfigList.DestinationRules).Parse(dr)\n\t\t\t}\n\t\t}\n\t}()\n\n\tgo func() {\n\t\tdefer wg.Done()\n\t\tif criteria.IncludeServiceEntries {\n\t\t\tif se, seErr = in.k8s.GetServiceEntries(criteria.Namespace); seErr == nil {\n\t\t\t\t(&istioConfigList.ServiceEntries).Parse(se)\n\t\t\t}\n\t\t}\n\t}()\n\n\tgo func() {\n\t\tdefer wg.Done()\n\t\tif criteria.IncludeRules {\n\t\t\tif mr, mrErr = in.k8s.GetIstioRules(criteria.Namespace); mrErr == nil {\n\t\t\t\tistioConfigList.Rules = models.CastIstioRulesCollection(mr)\n\t\t\t}\n\t\t}\n\t}()\n\n\tgo func() {\n\t\tdefer wg.Done()\n\t\tif criteria.IncludeQuotaSpecs {\n\t\t\tif qs, qsErr = in.k8s.GetQuotaSpecs(criteria.Namespace); qsErr == nil {\n\t\t\t\t(&istioConfigList.QuotaSpecs).Parse(qs)\n\t\t\t}\n\t\t}\n\t}()\n\n\tgo func() {\n\t\tdefer wg.Done()\n\t\tif criteria.IncludeQuotaSpecBindings {\n\t\t\tif qb, qbErr = in.k8s.GetQuotaSpecBindings(criteria.Namespace); qbErr == nil {\n\t\t\t\t(&istioConfigList.QuotaSpecBindings).Parse(qb)\n\t\t\t}\n\t\t}\n\t}()\n\n\twg.Wait()\n\n\tfor _, genErr := range []error{ggErr, vsErr, drErr, seErr, mrErr, qsErr, qbErr} {\n\t\tif genErr != nil {\n\t\t\treturn models.IstioConfigList{}, genErr\n\t\t}\n\t}\n\n\treturn istioConfigList, nil\n}", "title": "" }, { "docid": "2f08f3dfd0d0ed3e5c57ff065db6cd82", "score": "0.42757386", "text": "func (r *BotDefenseResource) ListAll() (*BotDefenseConfigList, error) {\n\tvar list BotDefenseConfigList\n\tif err := r.c.ReadQuery(BasePath+BotDefenseEndpoint, &list); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &list, nil\n}", "title": "" }, { "docid": "52064272aa36cabb0be0f021e1294cc8", "score": "0.4271168", "text": "func (c *Security) ShowList(vsys, base string) ([]string, error) {\n c.con.LogQuery(\"(show) list of security policies\")\n path := c.xpath(vsys, base, nil)\n return c.con.EntryListUsing(c.con.Show, path[:len(path) - 1])\n}", "title": "" }, { "docid": "a40fb177d3823ada2535bba2dc46e740", "score": "0.42705855", "text": "func (b *ListBuilder) APIList() (*corev1.PersistentVolumeClaimList, error) {\n\tl, err := b.List()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn l.ToAPIList(), nil\n}", "title": "" }, { "docid": "f54cc3bfd2d2ea77c5d103fd3f500935", "score": "0.42597264", "text": "func instancesIPConfig(ipb *configpb.Instances) *rdspb.IPConfig {\n\tipTypeMap := map[string]rdspb.IPConfig_IPType{\n\t\t\"PRIVATE\": rdspb.IPConfig_DEFAULT,\n\t\t\"PUBLIC\": rdspb.IPConfig_PUBLIC,\n\t\t\"ALIAS\": rdspb.IPConfig_ALIAS,\n\t}\n\n\treturn &rdspb.IPConfig{\n\t\tNicIndex: proto.Int32(ipb.GetNetworkInterface().GetIndex()),\n\t\tIpType: ipTypeMap[ipb.GetNetworkInterface().GetIpType().String()].Enum(),\n\t}\n}", "title": "" }, { "docid": "7c109e0bfdd75f2cd995a08e3fd192cb", "score": "0.42573684", "text": "func List(ctx context.Context, svc iaas.Service, terraform bool) ([]*abstract.Network, fail.Error) {\n\tif ctx == nil {\n\t\treturn nil, fail.InvalidParameterCannotBeNilError(\"ctx\")\n\t}\n\tif svc == nil {\n\t\treturn nil, fail.InvalidParameterCannotBeNilError(\"svc\")\n\t}\n\n\tif terraform {\n\t\tvar list []*abstract.Network\n\t\tclul, err := operations.ListTerraformNetworks(ctx, svc)\n\t\tif err != nil {\n\t\t\treturn nil, fail.ConvertError(err)\n\t\t}\n\n\t\tfor _, v := range clul {\n\t\t\tmk := abstract.Network{\n\t\t\t\tName: v.Name,\n\t\t\t\tTags: v.Tags,\n\t\t\t\tID: v.Identity,\n\t\t\t\tCIDR: v.CIDR,\n\t\t\t}\n\t\t\tlist = append(list, &mk)\n\t\t}\n\n\t\treturn list, nil\n\t}\n\n\trn, xerr := New(svc, terraform)\n\tif xerr != nil {\n\t\treturn nil, xerr\n\t}\n\n\tvar list []*abstract.Network\n\n\twithDefaultNetwork, err := svc.HasDefaultNetwork(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Default network has no metadata, so we need to \"simulate\" them.\n\tif withDefaultNetwork {\n\t\tvar an *abstract.Network\n\t\tan, xerr = svc.GetDefaultNetwork(ctx)\n\t\tif xerr != nil {\n\t\t\treturn nil, xerr\n\t\t}\n\t\tlist = append(list, an)\n\t}\n\n\t// Recovers the list with metadata and add them to the list\n\txerr = rn.Browse(ctx, func(an *abstract.Network) fail.Error {\n\t\tlist = append(list, an)\n\t\treturn nil\n\t})\n\n\tif xerr != nil {\n\t\treturn nil, xerr\n\t}\n\n\treturn list, nil\n}", "title": "" }, { "docid": "1f7a6e58453f1164b8caaf7d06feb049", "score": "0.42563462", "text": "func (m *_PubSubConfigurationDataType) InitializeParent(parent ExtensionObjectDefinition) {}", "title": "" }, { "docid": "caf66f04fc81121df4ee6e7710ae7884", "score": "0.4252514", "text": "func (s *VolthaServerSimulator) ListDevicePmConfigs(ctx context.Context, in *common.ID) (*voltha.PmConfigs, error) {\n\treturn nil, errors.New(\"UnImplemented\")\n}", "title": "" }, { "docid": "dbc9c54408a73ba45350769094acb9e6", "score": "0.4251599", "text": "func (c *ProjectsDefaultSupportedIdpConfigsGetCall) Context(ctx context.Context) *ProjectsDefaultSupportedIdpConfigsGetCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "323b6e8f9854f35ca2b9f4c919cd81de", "score": "0.4248565", "text": "func (c *Controller) List(kind string, ns string) ([]*model.Config, error) {\n\tif _, ok := c.kinds[kind]; !ok {\n\t\treturn nil, fmt.Errorf(\"Missing kind %q\", kind)\n\t}\n\n\t// TODO: use indexed cache\n\tvar out []*model.Config\n\tvar errs error\n\tfor _, data := range c.kinds[kind].informer.GetStore().List() {\n\t\tconfig := data.(*Config)\n\t\tif ns == \"\" || config.Metadata.Namespace == ns {\n\t\t\telt, err := kubeToModel(kind, c.client.mapping[kind], data.(*Config))\n\t\t\tif err != nil {\n\t\t\t\terrs = multierror.Append(errs, err)\n\t\t\t} else {\n\t\t\t\tout = append(out, elt)\n\t\t\t}\n\t\t}\n\t}\n\treturn out, errs\n}", "title": "" }, { "docid": "b594cdd95f9d5a0dd8480660669f1acc", "score": "0.42458048", "text": "func (i *ProjectIPServiceOp) List(projectID string) ([]IPAddressReservation, *Response, error) {\n\tpath := fmt.Sprintf(\"%s/%s%s\", projectBasePath, projectID, ipBasePath)\n\treservations := new(struct {\n\t\tReservations []IPAddressReservation `json:\"ip_addresses\"`\n\t})\n\n\tresp, err := i.client.DoRequest(\"GET\", path, nil, reservations)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\treturn reservations.Reservations, resp, nil\n}", "title": "" }, { "docid": "b7dfffae0ca3f3cd29b9ba1da2d604d7", "score": "0.42456186", "text": "func (r *LTCFGInstanceResource) ListAll() (*LTCFGInstanceConfigList, error) {\n\tvar list LTCFGInstanceConfigList\n\tif err := r.c.ReadQuery(BasePath+LTCFGInstanceEndpoint, &list); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &list, nil\n}", "title": "" }, { "docid": "ca79e813f703871d4f70395796b1b120", "score": "0.4230377", "text": "func (c *priorityLevelConfigurationsClusterInterface) List(ctx context.Context, opts metav1.ListOptions) (*flowcontrolv1beta2.PriorityLevelConfigurationList, error) {\n\treturn c.clientCache.ClusterOrDie(logicalcluster.Wildcard).PriorityLevelConfigurations().List(ctx, opts)\n}", "title": "" }, { "docid": "2b4e802f07a1442b4fc1e49551df4281", "score": "0.42261967", "text": "func List(client *gophercloud.ServiceClient, projectID string) pagination.Pager {\n\tu := listURL(client, projectID)\n\treturn pagination.NewPager(client, u, func(r pagination.PageResult) pagination.Page {\n\t\treturn EndpointPage{pagination.LinkedPageBase{PageResult: r}}\n\t})\n}", "title": "" }, { "docid": "b3eea3d963eb2ed29eb926c086560d98", "score": "0.42246053", "text": "func (o *GetPolymersListCodeParentFidParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "a3c43586ff68f218ac45f5351d70d30f", "score": "0.4224361", "text": "func (r ApiGetNiatelemetryFabricPodProfileListRequest) Expand(expand string) ApiGetNiatelemetryFabricPodProfileListRequest {\n\tr.expand = &expand\n\treturn r\n}", "title": "" }, { "docid": "e60e9be589e418f013f1a5b8f18099e7", "score": "0.42075545", "text": "func (r *ECMConfigResource) ListAll() (*ECMConfigConfigList, error) {\n\tvar list ECMConfigConfigList\n\tif err := r.c.ReadQuery(BasePath+ECMConfigEndpoint, &list); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &list, nil\n}", "title": "" }, { "docid": "504c297eebd51933842ac5169a503763", "score": "0.42063597", "text": "func (sec Security) IPIntelligenceFeedList() *IPIntelligenceFeedListResource {\n\treturn &sec.iPIntelligenceFeedList\n}", "title": "" }, { "docid": "a504d475bd2d90edf40a3e7306407888", "score": "0.42017522", "text": "func (s *BackupConfigsServiceOp) List(ctx context.Context, groupID string, opts *ListOptions) (*BackupConfigs, *Response, error) {\n\tif groupID == \"\" {\n\t\treturn nil, nil, atlas.NewArgError(\"groupID\", \"must be set\")\n\t}\n\n\tbasePath := fmt.Sprintf(backupConfigsBasePath, groupID)\n\tpath, err := setQueryParams(basePath, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.Client.NewRequest(ctx, http.MethodGet, path, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\troot := new(BackupConfigs)\n\tresp, err := s.Client.Do(ctx, req, root)\n\n\treturn root, resp, err\n}", "title": "" }, { "docid": "9cdba7c1f53dfe87129bcf05aabf9b47", "score": "0.41951913", "text": "func (c *gitConfig) List() (string, error) {\n\treturn simpleExec(nil, \"git\", \"config\", \"-l\")\n}", "title": "" }, { "docid": "7266c352686d408451a8d6905be8aba2", "score": "0.41914266", "text": "func (c *ProjectsDefaultSupportedIdpConfigsListCall) Fields(s ...googleapi.Field) *ProjectsDefaultSupportedIdpConfigsListCall {\n\tc.urlParams_.Set(\"fields\", googleapi.CombineFields(s))\n\treturn c\n}", "title": "" }, { "docid": "a83dc7c1ff66b2ea9fbe10fbc11d8763", "score": "0.41893452", "text": "func List(path string) error {\n\tvar err error\n\tvar abs, dest string\n\n\tabs, err = filepath.Abs(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdest, err = StripRoot(abs)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpath = C(dest)\n\tcfgs, err := pathToFiles(path)\n\tif err != nil && !os.IsNotExist(err) {\n\t\tfmt.Fprintf(os.Stderr, \"Could not show %s: %s\\n\", path, err.Error())\n\t} else if err != nil {\n\t\treturn nil\n\t}\n\n\tfor _, cfg := range cfgs {\n\t\tfmt.Println(X(cfg))\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "679e14729c2491d933d0eaf9506b8977", "score": "0.4186296", "text": "func RunProjectResourcesList(c *CmdConfig) error {\n\terr := ensureOneArg(c)\n\tif err != nil {\n\t\treturn err\n\t}\n\tid := c.Args[0]\n\n\tps := c.Projects()\n\tlist, err := ps.ListResources(id)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn c.Display(&displayers.ProjectResource{ProjectResources: list})\n}", "title": "" }, { "docid": "4db732aa7bfb1b0fd48ec5e8675443f7", "score": "0.41852713", "text": "func (r *SysResource) ListAll() (*SysConfigList, error) {\n\tvar list SysConfigList\n\tif err := r.c.ReadQuery(BasePath+SysEndpoint, &list); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &list, nil\n}", "title": "" }, { "docid": "d1b79b35e5b143cc902a642240bdc299", "score": "0.4171547", "text": "func (r ApiGetNiatelemetryPodCommPoliciesListRequest) Expand(expand string) ApiGetNiatelemetryPodCommPoliciesListRequest {\n\tr.expand = &expand\n\treturn r\n}", "title": "" }, { "docid": "3838cf8d2cda2117ddd23f42786c1ee7", "score": "0.41624457", "text": "func (client ReportConfigClient) List(ctx context.Context) (result ReportConfigListResult, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/ReportConfigClient.List\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response.Response != nil {\n\t\t\t\tsc = result.Response.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\treq, err := client.ListPreparer(ctx)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"costmanagement.ReportConfigClient\", \"List\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.ListSender(req)\n\tif err != nil {\n\t\tresult.Response = autorest.Response{Response: resp}\n\t\terr = autorest.NewErrorWithError(err, \"costmanagement.ReportConfigClient\", \"List\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.ListResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"costmanagement.ReportConfigClient\", \"List\", resp, \"Failure responding to request\")\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "1d1b168a093cdb84e3062c44d3da5a70", "score": "0.4156141", "text": "func ResourceIPAccessList() *schema.Resource {\n\ts := common.StructToSchema(ipAccessListUpdateRequest{}, func(s map[string]*schema.Schema) map[string]*schema.Schema {\n\t\t// nolint\n\t\ts[\"list_type\"].ValidateFunc = validation.StringInSlice([]string{\"ALLOW\", \"BLOCK\"}, false)\n\t\ts[\"ip_addresses\"].Elem = &schema.Schema{\n\t\t\tType: schema.TypeString,\n\t\t\tValidateFunc: validation.Any(validation.IsIPv4Address, validation.IsCIDR),\n\t\t}\n\t\treturn s\n\t})\n\treturn common.Resource{\n\t\tSchema: s,\n\t\tCreate: func(ctx context.Context, d *schema.ResourceData, c *common.DatabricksClient) error {\n\t\t\tvar iacl createIPAccessListRequest\n\t\t\tcommon.DataToStructPointer(d, s, &iacl)\n\t\t\tstatus, err := NewIPAccessListsAPI(ctx, c).Create(iacl)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\td.SetId(status.ListID)\n\t\t\treturn nil\n\t\t},\n\t\tRead: func(ctx context.Context, d *schema.ResourceData, c *common.DatabricksClient) error {\n\t\t\tstatus, err := NewIPAccessListsAPI(ctx, c).Read(d.Id())\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tcommon.StructToData(status, s, d)\n\t\t\treturn nil\n\t\t},\n\t\tUpdate: func(ctx context.Context, d *schema.ResourceData, c *common.DatabricksClient) error {\n\t\t\tvar iacl ipAccessListUpdateRequest\n\t\t\tcommon.DataToStructPointer(d, s, &iacl)\n\t\t\treturn NewIPAccessListsAPI(ctx, c).Update(d.Id(), iacl)\n\t\t},\n\t\tDelete: func(ctx context.Context, d *schema.ResourceData, c *common.DatabricksClient) error {\n\t\t\treturn NewIPAccessListsAPI(ctx, c).Delete(d.Id())\n\t\t},\n\t}.ToResource()\n}", "title": "" } ]
1d4239c4d68e5b5f3f6568f0ba7b9cf3
ParseCode attempts to convert a string to a Code
[ { "docid": "4cbe32ad7646fd8aae163425e03bf7a0", "score": "0.7672765", "text": "func ParseCode(name string) (Code, error) {\n\tif x, ok := _CodeValue[name]; ok {\n\t\treturn Code(x), nil\n\t}\n\treturn Code(0), fmt.Errorf(\"%s is not a valid Code\", name)\n}", "title": "" } ]
[ { "docid": "780f3ab3d1cb9dc2ffaacf79685263f2", "score": "0.643763", "text": "func NewCode(c string) Code {\n\treturn storage.ValidateCode(c)\n}", "title": "" }, { "docid": "6417d4f214c8d2aa2ab432185d2dcdcc", "score": "0.6427852", "text": "func MakeCode(s string) Code {\n\treturn Code{code: s}\n}", "title": "" }, { "docid": "d8e526802bb2b6b73e9382ce84920604", "score": "0.61354077", "text": "func NewCode(codeRep CodeStr) Code {\n\tcode := Code{codeStr: codeRep}\n\tif err := code.checkCodePath(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn code\n}", "title": "" }, { "docid": "8c6ac312ec534c51df10731c6eb9cc1c", "score": "0.6071989", "text": "func Code(cname string) codes.Code {\n\tswitch cname {\n\tcase \"NOT_IMPLEMENTED\":\n\t\treturn codes.Unimplemented\n\tcase \"CREATED\":\n\t\treturn Created\n\tcase \"UPDATED\":\n\t\treturn Updated\n\tcase \"DELETED\":\n\t\treturn Deleted\n\tcase \"LONG_RUNNING_OP\":\n\t\treturn LongRunning\n\tcase \"PARTIAL_CONTENT\":\n\t\treturn PartialContent\n\tdefault:\n\t\tvar c codes.Code\n\t\tif cc, ok := code.Code_value[cname]; !ok {\n\t\t\tc = codes.Unknown\n\t\t} else {\n\t\t\tc = codes.Code(cc)\n\t\t}\n\t\treturn c\n\t}\n}", "title": "" }, { "docid": "eb62efb08fd620e9785f119e16973c51", "score": "0.6021631", "text": "func Code(s string) string {\n\treturn fmt.Sprintf(\"`%s`\", s)\n}", "title": "" }, { "docid": "285ac4c89b03bfda10a9834bf2e09ba9", "score": "0.59408087", "text": "func (ctx *Context) Parse(code string) (*Parser, error) {\n\tp := &Parser{ctx: ctx}\n\n\tccode := C.CString(code)\n\tdefer C.free(unsafe.Pointer(ccode))\n\n\tparser := C.my_parse(p.ctx.mrb, p.ctx.ctx, ccode)\n\tdefer C.mrb_parser_free(parser)\n\n\tif parser.nerr > 0 {\n\t\tline := int(parser.error_buffer[0].lineno)\n\t\tmsg := C.GoString(parser.error_buffer[0].message)\n\t\treturn nil, &ParseError{Line: line, Message: msg}\n\t}\n\n\tp.proc = C.mrb_generate_code(p.ctx.mrb, parser)\n\treturn p, nil\n}", "title": "" }, { "docid": "f2795917e0018015165ee3c7ea7bf83e", "score": "0.5893363", "text": "func LoadCode (filename string) (code CodeMap) {\n fh, err := os.Open(filename)\n if err != nil {\n fmt.Println(err)\n }\n dec := gob.NewDecoder(fh)\n err = dec.Decode(&code)\n if err != nil {\n fmt.Println(err)\n }\n return\n}", "title": "" }, { "docid": "3da863fb9ed7bb248a2718d802aaa1eb", "score": "0.5891245", "text": "func NewCode(code []byte) *Code {\n\treturn &Code{\n\t\tBytecode: code,\n\t\tOpcodeBitset: opcodeBitset(code),\n\t}\n}", "title": "" }, { "docid": "a6f4d30fa5ac792cc90887d6541bb847", "score": "0.58872586", "text": "func NewCode() *Code {\n\treturn &Code{}\n}", "title": "" }, { "docid": "fec9840319efc306276e1c6dc2c44849", "score": "0.5782475", "text": "func (p *Parser) ParseCodeBlock() *ast.CodeBlock {\n\t// Rule can fail - might need to rollback\n\toldPos := p.p.Pos()\n\n\t// ### RULE_NAME ###\n\truleNameTok := p.p.MatchTokenOrRollback(pgtoken.RULE_NAME, oldPos)\n\tif ruleNameTok == nil {\n\t\treturn nil\n\t}\n\n\t// ### TYPE? ###\n\ttypeTok := p.p.TryMatchToken(pgtoken.TYPE)\n\n\t// ### CODE_BLOCK ###\n\tcodeBlockTok := p.p.MatchTokenOrRollback(pgtoken.CODE_BLOCK, oldPos)\n\tif codeBlockTok == nil {\n\t\treturn nil\n\t}\n\n\treturn ast.NewCodeBlock(ruleNameTok.Data, typeTok, codeBlockTok.Data)\n}", "title": "" }, { "docid": "4d8488130f3c6b575f8bb21bdf837021", "score": "0.57709324", "text": "func IntCode(input string) int {\n\tmemory := strings.Split(input, \",\")\n\tinstructions := make([]int, len(memory))\n\tfor i := range instructions {\n\t\tinstructions[i], _ = strconv.Atoi(memory[i])\n\t}\n\tinstructions = processInstructions(instructions)\n\treturn instructions[0]\n}", "title": "" }, { "docid": "48ed3f61ce4e0999df77c40768018e20", "score": "0.5751604", "text": "func ParseTransferCode(token string) *TransferCode {\n\treturn &TransferCode{proxyToken: *parseProxyToken(token)}\n}", "title": "" }, { "docid": "f50d2ed6b0e6387478961f62a1576ba3", "score": "0.57474715", "text": "func (t *token) Code() code {\n\tif t == nil {\n\t\treturn tEOF\n\t}\n\treturn t.code\n}", "title": "" }, { "docid": "872670f987c6f025fad2101102aa7f5e", "score": "0.57429075", "text": "func ParseKeyCode(value string) (KeyCode, error) {\n\tif value == \"\" {\n\t\treturn KeyCode(0), nil\n\t}\n\tcode, ok := ecodes[value]\n\tif !ok {\n\t\treturn KeyCode(code), fmt.Errorf(\"Code %s not found\", value)\n\t}\n\treturn KeyCode(code), nil\n}", "title": "" }, { "docid": "e3a901adde867454a1d2240699329b6c", "score": "0.56957334", "text": "func FromCode(code string) Card {\n\tcodeSlice := strings.Split(code, \"\")\n\n\tvar (\n\t\tvalue string\n\t\tsuit string\n\t)\n\n\tswitch codeSlice[0] {\n\tcase \"A\":\n\t\tvalue = \"ACE\"\n\tcase \"J\":\n\t\tvalue = \"JACK\"\n\tcase \"Q\":\n\t\tvalue = \"QUEEN\"\n\tcase \"K\":\n\t\tvalue = \"KING\"\n\tdefault:\n\t\tvalue = codeSlice[0]\n\t}\n\n\tswitch codeSlice[1] {\n\tcase \"H\":\n\t\tsuit = hearts\n\tcase \"D\":\n\t\tsuit = diamonds\n\tcase \"C\":\n\t\tsuit = clubs\n\tdefault:\n\t\tsuit = spades\n\t}\n\n\treturn Card{\n\t\tValue: value,\n\t\tSuit: suit,\n\t\tCode: code,\n\t}\n}", "title": "" }, { "docid": "7a61ab0f970cc380bf4f3abea37921bc", "score": "0.56421846", "text": "func RunCode(text string) (val interface{}, err error) {\n var code eval.Code\n code, err = World.Compile(fset, text)\n if err != nil {\n return nil, err\n }\n val, err = code.Run()\n return\n}", "title": "" }, { "docid": "6bfd6cbe76eae176c2063fc66861505f", "score": "0.5630985", "text": "func (ec *executionContext) unmarshalInputCode(ctx context.Context, obj interface{}) (model.Code, error) {\n\tvar it model.Code\n\tvar asMap = obj.(map[string]interface{})\n\n\tfor k, v := range asMap {\n\t\tswitch k {\n\t\tcase \"code\":\n\t\t\tvar err error\n\t\t\tit.Code, err = ec.unmarshalNString2string(ctx, v)\n\t\t\tif err != nil {\n\t\t\t\treturn it, err\n\t\t\t}\n\t\tcase \"unit\":\n\t\t\tvar err error\n\t\t\tit.Unit, err = ec.unmarshalNInt2int(ctx, v)\n\t\t\tif err != nil {\n\t\t\t\treturn it, err\n\t\t\t}\n\t\tcase \"description\":\n\t\t\tvar err error\n\t\t\tit.Description, err = ec.unmarshalNString2string(ctx, v)\n\t\t\tif err != nil {\n\t\t\t\treturn it, err\n\t\t\t}\n\t\tcase \"dos\":\n\t\t\tvar err error\n\t\t\tit.Dos, err = ec.unmarshalOString2ᚖstring(ctx, v)\n\t\t\tif err != nil {\n\t\t\t\treturn it, err\n\t\t\t}\n\t\t}\n\t}\n\n\treturn it, nil\n}", "title": "" }, { "docid": "c943aaa71b582503a47d29b6abd00f2f", "score": "0.56016886", "text": "func Parse(str string) (Currency, error) {\n\tif len(str) != 3 {\n\t\treturn \"\", errors.New(\"invalid currency code length\")\n\t}\n\tstr = strings.ToUpper(str)\n\tparsed := Currency(str)\n\tfor _, currency := range knownCurrencies {\n\t\tif parsed == currency {\n\t\t\treturn currency, nil\n\t\t}\n\t}\n\treturn \"\", errors.New(\"unkown currency code\")\n}", "title": "" }, { "docid": "102874be8ea1441e7fc8909afb507046", "score": "0.5595226", "text": "func Load(s string, d int) (c Code) {\n l := utf8.RuneCountInString(s)\n c = Code{l, d, make([]int, l)}\n rn := strings.Split(s, \"\")\n for x := range rn {\n i, _ := strconv.ParseInt(rn[x], 16, 0)\n c.c[x] = int(i)\n }\n return\n}", "title": "" }, { "docid": "c9e02d86873e7120d8de980d187cd36e", "score": "0.5593234", "text": "func (v *Vue) CodeString() string {\n\treturn ScriptStart + string(v.Code) + ScriptEnd\n}", "title": "" }, { "docid": "d6c258f306914d3c48858488d829a822", "score": "0.55716753", "text": "func ParseOpCode(codes []string) (parsedCode []int) {\n\tfmt.Println(\"opCodeParse: under construction\")\n\treturn []int{1, 2, 3, 4}\n}", "title": "" }, { "docid": "6ccf4c3dbce9ef6d3fb545b039856345", "score": "0.5569096", "text": "func NewCodeBlock(s string) *Code {\n\treturn &Code{\n\t\tbase: newBase(typeCodeBlock, nil),\n\t\tConfig: CodeConfig{\n\t\t\tCode: s,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "cd1376ea0ebafa45aefbead62449f09c", "score": "0.5543893", "text": "func ParseProgramCode(program string) []int {\n\tstrCommands := strings.Split(program, \",\")\n\tcommands := make([]int, len(strCommands))\n\tfor idx, val := range strCommands {\n\t\tcommands[idx], _ = strconv.Atoi(val)\n\t}\n\treturn commands\n}", "title": "" }, { "docid": "995656d61bfdb2db02f3dafbb3ff2c5e", "score": "0.55059516", "text": "func New() *Code {\n\treturn &Code{}\n}", "title": "" }, { "docid": "7b33f4335312cef8424bd0ae48e8a5e7", "score": "0.5496974", "text": "func FromCodon(in string) (string, error) {\n\tprotein, ok := translation[in]\n\tif ok {\n\t\tif protein == \"STOP\" {\n\t\t\treturn \"\", STOP\n\t\t}\n\t\treturn protein, nil\n\n\t}\n\treturn \"\", ErrInvalidBase\n}", "title": "" }, { "docid": "bb523db99db1cffbe60343ca0a6e5e33", "score": "0.5496712", "text": "func NewAssetCode(aType AssetType, value interface{}) (result AssetCode, err error) {\n\tresult.Type = aType\n\tswitch AssetType(aType) {\n\tcase AssetTypeAssetTypeCreditAlphanum4:\n\t\ttv, ok := value.(AssetCode4)\n\t\tif !ok {\n\t\t\terr = fmt.Errorf(\"invalid value, must be AssetCode4\")\n\t\t\treturn\n\t\t}\n\t\tresult.AssetCode4 = &tv\n\tcase AssetTypeAssetTypeCreditAlphanum12:\n\t\ttv, ok := value.(AssetCode12)\n\t\tif !ok {\n\t\t\terr = fmt.Errorf(\"invalid value, must be AssetCode12\")\n\t\t\treturn\n\t\t}\n\t\tresult.AssetCode12 = &tv\n\t}\n\treturn\n}", "title": "" }, { "docid": "86277dc4da6edaef215ae7c4a873fc50", "score": "0.548299", "text": "func (o ScanRunErrorTraceResponseOutput) Code() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ScanRunErrorTraceResponse) string { return v.Code }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "a79aff91b395b24ef4f362c2ee0547ef", "score": "0.54643524", "text": "func Code(s string) string {\n\treturn fmt.Sprintf(\"\\x1b[%dm\", code[s])\n}", "title": "" }, { "docid": "66711b547ac9d598624caec1914dcb31", "score": "0.5453241", "text": "func ParseTestCodes(str string) (TestCodes, error) {\n\ttestCodes := TestCodes{}\n\terrs := \"\"\n\ttestCodeStrings := strings.Split(str, \",\")\n\tfor _, testCodeString := range testCodeStrings {\n\t\ttestCodeString = strings.TrimSpace(testCodeString)\n\t\tif testCode, ok := getTestCode(testCodeString); ok {\n\t\t\ttestCodes = append(testCodes, testCode)\n\t\t} else {\n\t\t\terrs += testCodeString + \", \"\n\t\t}\n\t}\n\tif len(errs) > 0 {\n\t\treturn testCodes, errors.New(\"Unrecognised test codes: \" + errs[:len(errs)-2])\n\t}\n\treturn testCodes, nil\n}", "title": "" }, { "docid": "c243fb31569babec96985ec0298b8215", "score": "0.5439341", "text": "func GengouCodeFromString(s string) GengouCode {\n\treturn idMap[s]\n}", "title": "" }, { "docid": "5aef67a39bdb192e211a03e80608c2f3", "score": "0.54328275", "text": "func formatCode(v string) *protocol.MarkedString {\n\tif v == \"\" {\n\t\treturn nil\n\t}\n\n\tms := protocol.NewMarkedString(v, languageGo)\n\treturn &ms\n}", "title": "" }, { "docid": "09fa985508770618d950c4c348ab0a08", "score": "0.5401363", "text": "func (o ScanRunErrorTraceResponsePtrOutput) Code() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *ScanRunErrorTraceResponse) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.Code\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "6a769f1d690995325a5b037cd68ec177", "score": "0.5395459", "text": "func (o FunctionOutput) Code() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *Function) pulumi.StringPtrOutput { return v.Code }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "02e0f2758e97e69263becd4707da1048", "score": "0.53757674", "text": "func (o ScanRunWarningTraceResponseOutput) Code() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ScanRunWarningTraceResponse) string { return v.Code }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "0457d33044e07422bc0d62d4b8cc2261", "score": "0.53477746", "text": "func Decode(payload []byte, vfs ...ValidatorFunc) (*Code, error) {\n\tl := len(payload)\n\tif l < crcLen {\n\t\treturn nil, NewInvalidFormat(\"mpm: too short payload\")\n\t}\n\n\tif string(payload[:payloadFormatIndicatorLen]) != payloadFormatIndicator {\n\t\treturn nil, NewInvalidFormat(fmt.Sprintf(\"mpm: first %d bytes should be match %s\", payloadFormatIndicatorLen, payloadFormatIndicator))\n\t}\n\n\tif string(payload[l-crcLen:l-crcValueLen]) != crcIDLengthRepr {\n\t\treturn nil, NewInvalidFormat(fmt.Sprintf(\"mpm: last %d bytes should be represents CRC. got %s\", crcLen, string(payload[l-crcLen:])))\n\t}\n\n\tcrc := crc16.ChecksumCCITTFalse([]byte(string(payload[:l-crcValueLen])))\n\tif got, _ := strconv.ParseUint(string(payload[l-crcValueLen:l]), 16, 64); uint16(got) != crc {\n\t\treturn nil, NewInvalidCRC(crc, uint16(got))\n\t}\n\n\tvar c Code\n\ttranslatorFunc := chainTagLengthTranslators(\n\t\tmerchantAccountInformation,\n\t\tunreservedTemplates,\n\t)\n\tif err := tlv.NewDecoder(bytes.NewReader(payload), tagName, MaxSize, tagLength, lenLength, translatorFunc).Decode(&c); err != nil {\n\t\tswitch e := err.(type) {\n\t\tcase *tlv.MalformedPayloadError:\n\t\t\treturn nil, NewInvalidFormat(fmt.Sprintf(\"mpm: %s\", e.Error()))\n\t\t}\n\t\treturn nil, err\n\t}\n\n\tvfs = append(\n\t\tvfs,\n\t\tvalidateMerchantName,\n\t\tvalidateMerchantCity,\n\t\tvalidateMerchantInformation,\n\t\tvalidateUnreservedTemplates,\n\t)\n\tfor _, f := range vfs {\n\t\tif err := f(&c); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn &c, nil\n}", "title": "" }, { "docid": "e40042961a05324eba47177ed183fd28", "score": "0.53440523", "text": "func Parse(s string) ([]int, error) {\n\tcodes := strings.Split(s, \",\")\n\tprogram := make([]int, len(codes))\n\tfor i, code := range codes {\n\t\tcodeInt, err := strconv.Atoi(code)\n\t\tif err != nil {\n\t\t\treturn nil, errors.New(\"invalid program\")\n\t\t}\n\t\tprogram[i] = codeInt\n\t}\n\n\tif len(program) < instructionSize && program[0] != opcodeHalt {\n\t\treturn nil, errors.New(\"invalid program\")\n\t}\n\n\treturn program, nil\n}", "title": "" }, { "docid": "80ac10f13f3c387f01a186225afc588d", "score": "0.5323888", "text": "func ToCode(err error) Code {\n\tif val, ok := errors.TagValueIn(tagKey, err); ok {\n\t\treturn val.(tagValue).code\n\t}\n\tdeadline := errors.Any(err, func(err error) bool {\n\t\treturn err == context.DeadlineExceeded || err == context.Canceled\n\t})\n\tif deadline {\n\t\treturn Timeout\n\t}\n\treturn Unknown\n}", "title": "" }, { "docid": "6eb03deccea2bbfa853e2a37ec365e91", "score": "0.53144443", "text": "func parse(input string) *ast.Program {\n\tl := lexer.New(input)\n\tp := parser.New(l)\n\n\treturn p.ParseProgram()\n}", "title": "" }, { "docid": "79406e51924e76b86a931d24206cc359", "score": "0.53101134", "text": "func parseCoding(s string) (coding string, qvalue float64) {\n\tqvalue = defaultQValue\n\n\tp := strings.IndexRune(s, ';')\n\tif p != -1 {\n\t\tif part := strings.Replace(s[p+1:], \" \", \"\", -1); strings.HasPrefix(part, \"q=\") {\n\t\t\tqvalue, _ = strconv.ParseFloat(part[2:], 64)\n\t\t\tif qvalue < 0.0 || math.IsNaN(qvalue) {\n\t\t\t\tqvalue = 0.0\n\t\t\t} else if qvalue > 1.0 {\n\t\t\t\tqvalue = 1.0\n\t\t\t}\n\t\t}\n\t} else {\n\t\tp = len(s)\n\t}\n\tcoding = strings.ToLower(strings.TrimSpace(s[:p]))\n\treturn\n}", "title": "" }, { "docid": "6718abfdb5a19808aede6044506bd176", "score": "0.53079516", "text": "func FromJson(b []byte) (Code, error) {\n\tvar c code\n\terr := json.Unmarshal(b, &c)\n\treturn Code{\n\t\tdata: c,\n\t}, err\n}", "title": "" }, { "docid": "9d4f93e4e1c777130a94021ab7bacb2f", "score": "0.53030574", "text": "func ParseString(s string) *Program {\n\treturn Parse(bytes.NewBufferString(s))\n}", "title": "" }, { "docid": "cbc87ff1534147e03860ea5020369c73", "score": "0.5302147", "text": "func parseResponseCode(s *spec.Swagger, op *spec.Operation, capOpID string) string {\n\tvar buf bytes.Buffer\n\n\tbuf.WriteString(\"\\tswitch resp.StatusCode {\\n\")\n\n\tfor _, statusCode := range swagger.SortedStatusCodeKeys(op.Responses.StatusCodeResponses) {\n\t\tstatusCodeDecoder, err := writeStatusCodeDecoder(s, op, statusCode)\n\t\tif err != nil {\n\t\t\t// TODO: move this up???\n\t\t\tpanic(fmt.Errorf(\"error parsing response code: %s\", err))\n\t\t}\n\t\tbuf.WriteString(statusCodeDecoder)\n\t}\n\n\tsuccessReturn := buildSuccessReturn(s, op)\n\n\t// TODO: at some point should encapsulate this behind an interface on the operation\n\terrorType, _ := swagger.OutputType(s, op, 500)\n\tbuf.WriteString(fmt.Sprintf(`\n\tdefault:\n\t\treturn %s&%s{Message: \"Unknown response\"}\n\t}\n}\n\n`, successReturn, errorType))\n\n\treturn buf.String()\n}", "title": "" }, { "docid": "51d3fde280ab429ef85ea404e77d9f33", "score": "0.52932495", "text": "func (file *File) Code(addr Address) []byte {\n\tif len(file.Sections) > 0 {\n\t\tcode, ok := locateCode(addr, file.Sections)\n\t\tif ok {\n\t\t\treturn code\n\t\t}\n\t}\n\tpanic(fmt.Errorf(\"unable to locate code at address %v\", addr))\n}", "title": "" }, { "docid": "eaeaa83e05931a913199d239f4859060", "score": "0.52519774", "text": "func returnCode(code string) {\n\tvar codeInt, _ = strconv.Atoi(code)\n\tfmt.Println(\"Code returned: \" + strconv.Itoa(codeInt))\n\tfreeCodes = append(freeCodes, uint16(codeInt))\n}", "title": "" }, { "docid": "731cb97de28f0c5bef8f77fed4075fd1", "score": "0.5237366", "text": "func (b *ErrorBuilder) Code(value string) *ErrorBuilder {\n\tb.code = value\n\tb.bitmap_ |= 8\n\treturn b\n}", "title": "" }, { "docid": "92af6131e21cda98989f5f12d067326a", "score": "0.5233845", "text": "func (ctx *Context) ExecuteCode(in *lex.InputStream, scope *RootScope) Result {\n\tl := lex.NewLexer(in)\n\tp := syntax.NewParser(l)\n\t// start\n\tblock, err := p.Parse()\n\tif err != nil {\n\t\treturn Result{true, nil, err}\n\t}\n\t// init scope\n\tscope.Init(l)\n\n\t// construct root (program) node\n\tprogram := syntax.NewProgramNode(block)\n\n\t// eval program\n\tif err := evalProgram(ctx, scope, program); err != nil {\n\t\twrapError(ctx, scope, err)\n\t\treturn Result{true, nil, err}\n\t}\n\treturn Result{false, scope.GetLastValue(), nil}\n}", "title": "" }, { "docid": "4116b4fafeb6d57e55bc0fc619e6da2c", "score": "0.5233225", "text": "func (o ScanConfigErrorResponseOutput) Code() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ScanConfigErrorResponse) string { return v.Code }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "a653a1b10ace94e59f5dde38d8bb573b", "score": "0.5228692", "text": "func parseCoding(s string) (coding string, qvalue float64, err error) {\n\t// Avoid splitting if we can...\n\tif len(s) == 0 {\n\t\treturn \"\", 0, errEmptyEncoding\n\t}\n\tif !strings.ContainsRune(s, ';') {\n\t\tcoding = strings.ToLower(strings.TrimSpace(s))\n\t\tif coding == \"\" {\n\t\t\terr = errEmptyEncoding\n\t\t}\n\t\treturn coding, DefaultQValue, err\n\t}\n\tfor n, part := range strings.Split(s, \";\") {\n\t\tpart = strings.TrimSpace(part)\n\t\tqvalue = DefaultQValue\n\n\t\tif n == 0 {\n\t\t\tcoding = strings.ToLower(part)\n\t\t} else if strings.HasPrefix(part, \"q=\") {\n\t\t\tqvalue, err = strconv.ParseFloat(strings.TrimPrefix(part, \"q=\"), 64)\n\n\t\t\tif qvalue < 0.0 {\n\t\t\t\tqvalue = 0.0\n\t\t\t} else if qvalue > 1.0 {\n\t\t\t\tqvalue = 1.0\n\t\t\t}\n\t\t}\n\t}\n\n\tif coding == \"\" {\n\t\terr = errEmptyEncoding\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "cbc82ae24d841f49563e909baab07079", "score": "0.5223065", "text": "func (o *AutocompleteCurrency) GetCodeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Code, true\n}", "title": "" }, { "docid": "ab82317108ba248e08044d48af122e5f", "score": "0.5199363", "text": "func (m *modelImpl) NewCode() string {\n\tc := crypto.NewXID()\n\tcode := openid.NewCode(c)\n\tm.code.Put(c, code)\n\treturn c\n}", "title": "" }, { "docid": "afe6464fe2b1411a7ef2fcd9764cc664", "score": "0.5198751", "text": "func (p *parser) typeFromCode(ch rune) nodeType {\n\tswitch ch {\n\tcase 'b':\n\t\tif p.useOptionE() {\n\t\t\treturn ntECMABoundary\n\t\t}\n\t\treturn ntBoundary\n\tcase 'B':\n\t\tif p.useOptionE() {\n\t\t\treturn ntNonECMABoundary\n\t\t}\n\t\treturn ntNonboundary\n\tcase 'A':\n\t\treturn ntBeginning\n\tcase 'G':\n\t\treturn ntStart\n\tcase 'Z':\n\t\treturn ntEndZ\n\tcase 'z':\n\t\treturn ntEnd\n\tdefault:\n\t\treturn ntNothing\n\t}\n}", "title": "" }, { "docid": "3cc56b17ec8142ac92c56a7ac09b02bc", "score": "0.5194189", "text": "func (s *InvalidChannelARN) Code() string {\n\treturn \"InvalidChannelARN\"\n}", "title": "" }, { "docid": "6f03b9382fc00b806e8dee5028aff418", "score": "0.51904845", "text": "func Code(err error) codes.Code {\n\tif err == nil {\n\t\treturn codes.OK\n\t}\n\n\tcode := status.Code(err)\n\tif code != codes.Unknown {\n\t\treturn code\n\t}\n\n\terrMsg, ok := err.(*errmsg.ErrMsg)\n\tif ok {\n\t\tcode, exists := status2code[errMsg.Status]\n\t\tif exists {\n\t\t\treturn code\n\t\t}\n\t}\n\n\treturn codes.Unknown\n}", "title": "" }, { "docid": "18c31e6525838e82aee31c6007dd394a", "score": "0.51839596", "text": "func (s *InvalidInput) Code() string {\n\treturn \"InvalidInput\"\n}", "title": "" }, { "docid": "ecb0e63fa05e07b6123f679d31101afe", "score": "0.5177013", "text": "func Code(err error) int {\n\tif err == nil {\n\t\treturn CodeOk\n\t}\n\tc := CodeErr{}\n\tif errors.As(err, &c) {\n\t\treturn c.code\n\t} else {\n\t\treturn CodeUnknown\n\t}\n}", "title": "" }, { "docid": "9f756159a75e81c84cb56cfd1d48cefb", "score": "0.5170512", "text": "func FromBytes(b []byte) (Code, error) {\n\tvar c code\n\tfz, err := gzip.NewReader(bytes.NewReader(b))\n\tif err != nil {\n\t\treturn Code{}, err\n\t}\n\tdec := gob.NewDecoder(fz)\n\terr = dec.Decode(&c)\n\tfz.Close()\n\treturn Code{\n\t\tdata: c,\n\t}, err\n}", "title": "" }, { "docid": "2fd6d312c06dc6b17044007cb512ab20", "score": "0.514421", "text": "func (o ConnectionErrorResponseOutput) Code() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v ConnectionErrorResponse) *string { return v.Code }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "f21abc8ff5552c8d04fc898ea6005dda", "score": "0.5144153", "text": "func (o ScanConfigErrorResponsePtrOutput) Code() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *ScanConfigErrorResponse) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.Code\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "2f899b29091bfb60218900e21d68d884", "score": "0.51251715", "text": "func (ce *CallExpr) CodeStr() string {\n\tvar sb strings.Builder\n\tsb.WriteString(\"(\")\n\tfor i, e := range ce.Exprs {\n\t\tif i > 0 {\n\t\t\tsb.WriteString(\" \")\n\t\t}\n\t\tsb.WriteString(e.CodeStr())\n\t}\n\tsb.WriteString(\")\\n\")\n\treturn sb.String()\n}", "title": "" }, { "docid": "b8e33039ab0e4faab9e0d5368c8da8fd", "score": "0.5122089", "text": "func (obj *script) Code() string {\n\treturn obj.code\n}", "title": "" }, { "docid": "af383b388c67a0d6f02b8bbe3fd87969", "score": "0.5117106", "text": "func (c *CallbackGenerateTokenCall) Code(code string) *CallbackGenerateTokenCall {\n\tc.urlParams_.Set(\"code\", code)\n\treturn c\n}", "title": "" }, { "docid": "1469fcdc2a96f77664c37d92547915f4", "score": "0.5116922", "text": "func (m *impl) Parse(inp string) Value {\n\tvar (\n\t\ttmp string\n\t\tkey Type\n\t\tret *methodType\n\t)\n\n\ttmp = strings.ToUpper(inp)\n\tfor key = range maps {\n\t\tif maps[key] == tmp {\n\t\t\tret = &methodType{key}\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn ret\n}", "title": "" }, { "docid": "04a978786315d9f96b66ff5333f90c02", "score": "0.5112504", "text": "func checkCode(code string) (match bool) {\n\tre := regexp.MustCompile(`([a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9]-[a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9]-[a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9]-[a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9])`)\n\tmatch = re.MatchString(code)\n\tif match == false {\n\t\tfmt.Printf(\"The following code is formatted wrong: %v\\n\", code)\n\t}\n\treturn\n}", "title": "" }, { "docid": "58946bf217135c098820882e3914c5c8", "score": "0.51117206", "text": "func (e *ETH) GetCode(a string) ([]byte, error) {\n\tvar s string\n\terr := e.MakeRequest(&s, ETHGetCode, a, \"latest\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ts = strings.TrimPrefix(s, \"0x\")\n\treturn hex.DecodeString(s)\n}", "title": "" }, { "docid": "e01c2ee43e8bcb2cdeb128d8a8b8b8ac", "score": "0.51090455", "text": "func Parse(in string) (*bytes.Buffer, error) {\n\tbuf := []byte{}\n\tfor _, token := range strings.Fields(in) {\n\t\top, ok := ops.Default.GetCode(token)\n\t\tif ok {\n\t\t\tbuf = append(buf, byte(op))\n\t\t} else {\n\t\t\tstr, err := hex.DecodeString(token)\n\t\t\tif err != nil {\n\t\t\t\treturn new(bytes.Buffer), err\n\t\t\t}\n\t\t\tif len(str) > 75 {\n\t\t\t\treturn new(bytes.Buffer), fmt.Errorf(\"data token too large\")\n\t\t\t}\n\t\t\tbuf = append(buf, byte(uint(len(str))))\n\t\t\tbuf = append(buf, str...)\n\t\t}\n\t}\n\treturn bytes.NewBuffer(buf), nil\n}", "title": "" }, { "docid": "2940fbf9734542d64e7baee38ccd55c4", "score": "0.5100081", "text": "func formatCode(lang string, text []byte) (formattedCode []byte, ok bool) {\n\tswitch lang {\n\tcase \"Go\", \"go\":\n\t\tgofmt, err := format.Source(text)\n\t\tif err != nil {\n\t\t\treturn nil, false\n\t\t}\n\t\treturn gofmt, true\n\tdefault:\n\t\treturn nil, false\n\t}\n}", "title": "" }, { "docid": "93a74bd8a928400d3217dfe48ab8556e", "score": "0.50960237", "text": "func ParseString(s string) string {\n\tstr, ok := unquote(s)\n\tif !ok {\n\t\tErrorf(\"invalid string syntax\")\n\t}\n\tif !utf8.ValidString(str) {\n\t\tErrorf(\"invalid code points in string\")\n\t}\n\treturn str\n}", "title": "" }, { "docid": "2c05a15acaf012a8548c6eb22eb02a4e", "score": "0.5089995", "text": "func ParseString(code string) *SuperFlat {\n\tsf := &SuperFlat{}\n\tsf.parseString(code)\n\treturn sf\n}", "title": "" }, { "docid": "e18ba05d693a8b762f6ff1d89e8596cd", "score": "0.5083286", "text": "func RunString(code string) interpreter.Node {\n\tvars := make(map[string]interpreter.Node, 0)\n\tsetupVars(&vars, os.Args[0])\n\n\treturn interpreter.Run(parser.Parse(lexer.LexString(code)), &vars)\n}", "title": "" }, { "docid": "eecc9e54bd3207f933fe9c2e584a26c4", "score": "0.5049589", "text": "func ParseVerifier(str string) Verifier {\n\treturn Verifier(str[0])\n}", "title": "" }, { "docid": "fc24d796af181325c8704e52f02137e0", "score": "0.5049307", "text": "func NewCODECodec() Codec {\n\treturn &CODECodec{}\n}", "title": "" }, { "docid": "fd078179772fdde4f54ed35e50da1088", "score": "0.5048315", "text": "func NewCode(params *trakt.BasicParams) (*trakt.DeviceCode, error) {\n\treturn getC().NewCode(params)\n}", "title": "" }, { "docid": "4745df1415017c35687e5762da28bd82", "score": "0.50434214", "text": "func Compile(text string) string {\n\tvar result string\n\tvar bf brainfuckResource\n\tvar code codeInfomation\n\tvar compiled compiled\n\tcompiled.result = \"\"\n\tresoucrceInit(&bf)\n\tinfomationInit(&code, text)\n\tfor code.head < code.length {\n\n\t\tswitch code.splitCode[code.head] {\n\t\tcase \"+\":\n\t\t\tinc(&bf)\n\t\tcase \"-\":\n\t\t\tdec(&bf)\n\t\tcase \"[\":\n\t\t\tbegin(&bf, &code)\n\t\tcase \"]\":\n\t\t\tend(&bf, &code)\n\t\tcase \".\":\n\t\t\tputchar(&bf, &compiled)\n\t\tcase \",\":\n\t\t\tgetchar(&bf)\n\t\tcase \">\":\n\t\t\tfore(&bf, &code)\n\t\tcase \"<\":\n\t\t\tback(&bf, &code)\n\t\tdefault:\n\t\t}\n\t\tcode.head++\n\n\t\tif code.errorStatus != 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\tif code.errorStatus == 0 {\n\t\tresult = compiled.result\n\t} else {\n\t\tresult = code.errorMsg\n\t}\n\treturn result\n}", "title": "" }, { "docid": "0b714c906a833ab832c15c6c4cf2a8aa", "score": "0.5033072", "text": "func parseScript(script []byte) ([]parsedOpcode, error) {\n\treturn parseScriptTemplate(script, &opcodeArray)\n}", "title": "" }, { "docid": "a9bd2358c8acbd350d0eb9a2586d4671", "score": "0.502501", "text": "func (fc *FunctionCode) GetCode() []byte {\n\treturn fc.Code\n}", "title": "" }, { "docid": "a9bd2358c8acbd350d0eb9a2586d4671", "score": "0.502501", "text": "func (fc *FunctionCode) GetCode() []byte {\n\treturn fc.Code\n}", "title": "" }, { "docid": "c787eca36c0aebee3b39b0e05a75194e", "score": "0.50214124", "text": "func (s *InvalidContinuationTokenException) Code() string {\n\treturn \"InvalidContinuationTokenException\"\n}", "title": "" }, { "docid": "04b92fd854e0b64c3c89a699dcde9f09", "score": "0.5007928", "text": "func (obj *node) CodeFromName(name string) string {\n\tcodes := obj.CodesFromName(name)\n\tif len(codes) <= 0 {\n\t\treturn \"\"\n\t}\n\n\treturn codes[0]\n}", "title": "" }, { "docid": "490c5464aaf248dee82c4027fc192894", "score": "0.4995295", "text": "func (o AssessmentStatusPtrOutput) Code() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *AssessmentStatus) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.Code\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "027184a9f6d0df314de3affb16cba86d", "score": "0.49930298", "text": "func Compile(str string) (*string, error) {\n\treturn nil, nil\n}", "title": "" }, { "docid": "bdb5c4ffc6e4ab48a82c3b1f5a1c8f8d", "score": "0.49920842", "text": "func parseCodepoint(codepointText string) ([]byte, error) {\n\ti, err := strconv.ParseInt(codepointText, 16, 32)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tr := rune(i)\n\tif !validCodepoint(r) {\n\t\treturn nil, fmt.Errorf(\"%s is not a valid unicode code point\", codepointText)\n\t}\n\treturn []byte(string([]rune{r})), nil\n}", "title": "" }, { "docid": "d6721fb873bf94625970188c2e64d52f", "score": "0.49912044", "text": "func (o *GetExecutionByNameAndIndexUsingGETOK) IsCode(code int) bool {\n\treturn code == 200\n}", "title": "" }, { "docid": "dd56b9406b00819fcbad21aa8b9410e2", "score": "0.4983823", "text": "func (o *Error) Code() string {\n\tif o != nil && o.bitmap_&8 != 0 {\n\t\treturn o.code\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "95351a638206d58bda5dc8efa1505b27", "score": "0.49837998", "text": "func (o *SpansWarning) GetCodeOk() (*string, bool) {\n\tif o == nil || o.Code == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Code, true\n}", "title": "" }, { "docid": "83200f98d698ff470dce0712fd6efd68", "score": "0.49794647", "text": "func (trans *TranscoderAdapter) Transcode(s string) string {\n\tif trans.fileType == \"react\" {\n\t\treturn (&ReactTranscode{}).Write(s)\n\t}\n\n\tif trans.fileType == \"vue\" {\n\t\treturn (&VueTranscode{}).Convert(s)\n\t}\n\n\tif trans.fileType == \"angular\" {\n\t\treturn (&AngularTranscode{}).Interprete(s)\n\t}\n\n\treturn \"Unrecognized fileType \" + s\n}", "title": "" }, { "docid": "0f6f6d0a0da67005ebe5c531fa0a5ca1", "score": "0.4979382", "text": "func (o AssessmentStatusOutput) Code() pulumi.StringOutput {\n\treturn o.ApplyT(func(v AssessmentStatus) string { return v.Code }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "f3f87c8f2945e974187336f97bed3879", "score": "0.49771413", "text": "func Code(r *http.Request) *ResponseCode {\n\tq := r.URL.Query()\n\tcode := new(ResponseCode)\n\tcode.Code = q.Get(\"code\")\n\tcode.RealmID = q.Get(\"realmId\")\n\tcode.State = q.Get(\"state\")\n\treturn code\n}", "title": "" }, { "docid": "3845f9f4622d610b88e87f3857410573", "score": "0.4972873", "text": "func (s *InvalidTypeException) Code() string {\n\treturn \"InvalidTypeException\"\n}", "title": "" }, { "docid": "8521ca07579c8693a19a6f33bb708867", "score": "0.49726966", "text": "func (e *Error) Code() string {\n\tif e != nil && e.bitmap_&8 != 0 {\n\t\treturn e.code\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "b6621ba483157f8bed39444d4780527d", "score": "0.495904", "text": "func (parser *Parser) Parse(input string) (bool, int, interface{}) {\n return parser.invoke(&State{0, 0, parser.debug, nil, nil}, []rune(input))\n}", "title": "" }, { "docid": "05239ed2da40feee33164ff6fc9fb288", "score": "0.49575692", "text": "func ParseExitCode(err error) int {\n\tif err == nil {\n\t\treturn 0\n\t}\n\n\tvar eerr ExitCodeable\n\tif errors.As(err, &eerr) {\n\t\treturn eerr.ExitCode()\n\t}\n\n\treturn 1\n}", "title": "" }, { "docid": "46b390b91b0981f104a96d9ff1daa6da", "score": "0.49546313", "text": "func (s *InvalidReplacementTypeException) Code() string {\n\treturn \"InvalidReplacementTypeException\"\n}", "title": "" }, { "docid": "1e3ad2f6a0389f1cef10e4ef12a1caac", "score": "0.4954092", "text": "func ParseScript(script string) (Script, error) {\n\tif len(script) != 4 {\n\t\treturn 0, fmt.Errorf(\"invalid script string: %s\", script)\n\t}\n\treturn Script(binary.BigEndian.Uint32([]byte(script))), nil\n}", "title": "" }, { "docid": "2be6bdb4cdb552a4b18a5830579b9624", "score": "0.4949853", "text": "func (ip *InferredProto) Code() string {\n\tvar imports []string\n\tbody := \"\"\n\tfor _, col := range ip.columns {\n\t\tbody += fmt.Sprintf(\"%s\\n\", col.protoFieldCode())\n\t\timports = append(imports, col.columnType.protoImports()...)\n\t}\n\n\treturn fmt.Sprintf(`syntax = \"proto3\";\n\npackage %s;\n\n%s\n\nmessage %s {\n%s\n}`, ip.packageName, strings.Join(imports, \"\\n\"), ip.messageName, body)\n}", "title": "" }, { "docid": "5a6741f8bfb22c97918a5de49318f644", "score": "0.49487156", "text": "func newCodeElem(tok token.Token, node ast.Node) (codeElem, error) {\n\tvar b strings.Builder\n\terr := format.Node(&b, token.NewFileSet(), node)\n\tif err != nil {\n\t\treturn codeElem{}, err\n\t}\n\treturn codeElem{tok, b.String()}, nil\n}", "title": "" }, { "docid": "ddd7b7303e73e488733c86f46a68fa72", "score": "0.49475887", "text": "func (nl Option) Code() string {\n\tif c, ok := newlineCodeMap[nl]; ok {\n\t\treturn c\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "0e20b36a13dea64f99999d4f426734db", "score": "0.49458024", "text": "func parseCIGAR(cigarString string) (CIGAR, error) {\n\t// for now, must contain only S, H, or M\n\t///disallow := map[string]int{\"I\":1, \"D\":1, \"N\":1, \"P\":1, \"=\":1, \"X\":1,}\n\tcigar := CIGAR{}\n\tlastIndex := 0\n\tfor i, c := range cigarString {\n\t\tif c > 57 {\n\t\t\t//if _, ok := disallow[string(c)]; ok {\n\t\t\t\t// it's a disallowed code, return error\n\t\t\t//\treturn CIGAR{}, fmt.Errorf(\"Found unsupported code in CIGAR string.\")\n\t\t\t//}\n\t\t// Process the allowed CIGAR code\n\t\tval, err := strconv.Atoi(cigarString[lastIndex:i])\n\t\tif err != nil {\n\t\t\treturn CIGAR{}, fmt.Errorf(\"Error parsing CIGAR string.\")\n\t\t}\n\t\tcigar.Add(val, string(c))\n\t\tlastIndex = i + 1\n\t\t}\n\t}\n\t/*for _, cig := range cigar {\n\t\tfmt.Println(cig)\n\t}*/\n\treturn cigar, nil\n}", "title": "" }, { "docid": "8b7a336f2dbe5be43081c8420e0e052b", "score": "0.4943213", "text": "func (le *LetExpr) CodeStr() string {\n\treturn fmt.Sprintf(\"(let %s %s)\", le.Ident.Val, le.Value.CodeStr())\n}", "title": "" }, { "docid": "d2ff4517788a451c85dab2332a4e4615", "score": "0.49312556", "text": "func FormatCode(code string) ([]byte, error) {\n\topts := &imports.Options{\n\t\tTabIndent: true,\n\t\tTabWidth: 2,\n\t\tFragment: true,\n\t\tComments: true,\n\t}\n\treturn imports.Process(\"\", []byte(code), opts)\n}", "title": "" }, { "docid": "477993833c68cf6d3860c78b58d111cd", "score": "0.49281433", "text": "func (e *Kraken) GetCode(symbol string) string {\n\tsymbol = strings.ToUpper(symbol)\n\tif val, ok := symbolMap[symbol]; ok {\n\t\treturn val\n\t}\n\treturn symbol\n}", "title": "" } ]
ec0e75138c3179bc3534c00c8cc9e574
WithMarketID adds the marketID to the describe market users params
[ { "docid": "66d8a9f9ebde43159d7598ef3abf8494", "score": "0.680655", "text": "func (o *DescribeMarketUsersParams) WithMarketID(marketID []string) *DescribeMarketUsersParams {\n\to.SetMarketID(marketID)\n\treturn o\n}", "title": "" } ]
[ { "docid": "485b6da8f9f83d9cef314aeeb064855e", "score": "0.66441584", "text": "func (o *DescribeMarketUsersParams) SetMarketID(marketID []string) {\n\to.MarketID = marketID\n}", "title": "" }, { "docid": "38dd8439ecee45bd5df2bb509251e065", "score": "0.6029996", "text": "func (o *DescribeMarketUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.Limit != nil {\n\n\t\t// query param limit\n\t\tvar qrLimit int64\n\t\tif o.Limit != nil {\n\t\t\tqrLimit = *o.Limit\n\t\t}\n\t\tqLimit := swag.FormatInt64(qrLimit)\n\t\tif qLimit != \"\" {\n\t\t\tif err := r.SetQueryParam(\"limit\", qLimit); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tvaluesMarketID := o.MarketID\n\n\tjoinedMarketID := swag.JoinByFormat(valuesMarketID, \"multi\")\n\t// query array param market_id\n\tif err := r.SetQueryParam(\"market_id\", joinedMarketID...); err != nil {\n\t\treturn err\n\t}\n\n\tif o.Offset != nil {\n\n\t\t// query param offset\n\t\tvar qrOffset int64\n\t\tif o.Offset != nil {\n\t\t\tqrOffset = *o.Offset\n\t\t}\n\t\tqOffset := swag.FormatInt64(qrOffset)\n\t\tif qOffset != \"\" {\n\t\t\tif err := r.SetQueryParam(\"offset\", qOffset); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tvaluesOwner := o.Owner\n\n\tjoinedOwner := swag.JoinByFormat(valuesOwner, \"multi\")\n\t// query array param owner\n\tif err := r.SetQueryParam(\"owner\", joinedOwner...); err != nil {\n\t\treturn err\n\t}\n\n\tif o.Reverse != nil {\n\n\t\t// query param reverse\n\t\tvar qrReverse bool\n\t\tif o.Reverse != nil {\n\t\t\tqrReverse = *o.Reverse\n\t\t}\n\t\tqReverse := swag.FormatBool(qrReverse)\n\t\tif qReverse != \"\" {\n\t\t\tif err := r.SetQueryParam(\"reverse\", qReverse); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.SearchWord != nil {\n\n\t\t// query param search_word\n\t\tvar qrSearchWord string\n\t\tif o.SearchWord != nil {\n\t\t\tqrSearchWord = *o.SearchWord\n\t\t}\n\t\tqSearchWord := qrSearchWord\n\t\tif qSearchWord != \"\" {\n\t\t\tif err := r.SetQueryParam(\"search_word\", qSearchWord); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.SortKey != nil {\n\n\t\t// query param sort_key\n\t\tvar qrSortKey string\n\t\tif o.SortKey != nil {\n\t\t\tqrSortKey = *o.SortKey\n\t\t}\n\t\tqSortKey := qrSortKey\n\t\tif qSortKey != \"\" {\n\t\t\tif err := r.SetQueryParam(\"sort_key\", qSortKey); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tvaluesUserID := o.UserID\n\n\tjoinedUserID := swag.JoinByFormat(valuesUserID, \"multi\")\n\t// query array param user_id\n\tif err := r.SetQueryParam(\"user_id\", joinedUserID...); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c5a712ea4a9b90bb8599cffb6693011b", "score": "0.5961309", "text": "func NewDescribeMarketUsersParams() *DescribeMarketUsersParams {\n\tvar ()\n\treturn &DescribeMarketUsersParams{\n\n\t\ttimeout: cr.DefaultTimeout,\n\t}\n}", "title": "" }, { "docid": "e217aedbdfe0e019bc0197090b6c64ce", "score": "0.5937066", "text": "func (o *DescribeMarketUsersParams) WithContext(ctx context.Context) *DescribeMarketUsersParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "4a0beb0559775a4e1a11fc8fa70621a7", "score": "0.5616989", "text": "func (mhc *MarketHoursCreate) SetMarketInfoID(id int) *MarketHoursCreate {\n\tmhc.mutation.SetMarketInfoID(id)\n\treturn mhc\n}", "title": "" }, { "docid": "0387ee91f9114e547f3b980c84d04530", "score": "0.5356596", "text": "func (o *DescribeMarketUsersParams) WithUserID(userID []string) *DescribeMarketUsersParams {\n\to.SetUserID(userID)\n\treturn o\n}", "title": "" }, { "docid": "8456ee63623088854b4b2df9f13123b7", "score": "0.53264093", "text": "func NewDescribeMarketUsersParamsWithTimeout(timeout time.Duration) *DescribeMarketUsersParams {\n\tvar ()\n\treturn &DescribeMarketUsersParams{\n\n\t\ttimeout: timeout,\n\t}\n}", "title": "" }, { "docid": "6963c3c0b66aefe62f55f242f0d6fcfd", "score": "0.52827984", "text": "func (o *DescribeMarketUsersParams) WithTimeout(timeout time.Duration) *DescribeMarketUsersParams {\n\to.SetTimeout(timeout)\n\treturn o\n}", "title": "" }, { "docid": "ed3d20f3b81c250eff768e6e48d7be94", "score": "0.5120867", "text": "func (o *DescribeMarketUsersParams) WithLimit(limit *int64) *DescribeMarketUsersParams {\n\to.SetLimit(limit)\n\treturn o\n}", "title": "" }, { "docid": "cdca280b0396629f7bf52248680b2b68", "score": "0.5106199", "text": "func (k Keeper) AppendMarket(\n\tctx sdk.Context,\n\tmarket types.Market,\n) uint64 {\n\t// Create the market\n\tcount := k.GetMarketCount(ctx)\n\n\t// Set the ID of the appended value\n\tmarket.Id = count\n\n\tstore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.MarketKey))\n\tappendedValue := k.cdc.MustMarshalBinaryBare(&market)\n\tstore.Set(GetMarketIDBytes(market.Id), appendedValue)\n\n\t// Update market count\n\tk.SetMarketCount(ctx, count+1)\n\n\treturn count\n}", "title": "" }, { "docid": "5e2fb007301d44306d2b30e14caba875", "score": "0.5084975", "text": "func (k Keeper) SetMarketInfo(ctx sdk.Context, name string, moneymarket MoneyMarket) {\n\tif moneymarket.Owner.Empty() {\n\t\treturn\n\t}\n\tfmt.Println(moneymarket)\n\tstore := ctx.KVStore(k.storeKey)\n\tstore.Set([]byte(name), k.cdc.MustMarshalBinaryBare(moneymarket))\n}", "title": "" }, { "docid": "617cda01a590f0f7ca7fab2e730851ff", "score": "0.50545216", "text": "func NewDescribeMarketUsersParamsWithHTTPClient(client *http.Client) *DescribeMarketUsersParams {\n\tvar ()\n\treturn &DescribeMarketUsersParams{\n\t\tHTTPClient: client,\n\t}\n}", "title": "" }, { "docid": "afab56d3c019d577ec0b98f96e26497b", "score": "0.49454147", "text": "func TestKeeper_SetGetMarket(t *testing.T) {\n\ttApp := app.NewTestApp()\n\tctx := tApp.NewContext(true, tmprototypes.Header{})\n\tkeeper := tApp.GetPriceFeedKeeper()\n\n\tmp := types.Params{\n\t\tMarkets: []types.Market{\n\t\t\t{MarketID: \"tstusd\", BaseAsset: \"tst\", QuoteAsset: \"usd\", Oracles: []sdk.AccAddress{}, Active: true},\n\t\t},\n\t}\n\tkeeper.SetParams(ctx, mp)\n\tmarkets := keeper.GetMarkets(ctx)\n\trequire.Equal(t, len(markets), 1)\n\trequire.Equal(t, markets[0].MarketID, \"tstusd\")\n\n\t_, found := keeper.GetMarket(ctx, \"tstusd\")\n\trequire.True(t, found, \"market should be found\")\n\n\t_, found = keeper.GetMarket(ctx, \"invalidmarket\")\n\trequire.False(t, found, \"invalidmarket should not be found\")\n\n\tmp = types.Params{\n\t\tMarkets: []types.Market{\n\t\t\t{MarketID: \"tstusd\", BaseAsset: \"tst\", QuoteAsset: \"usd\", Oracles: []sdk.AccAddress{}, Active: true},\n\t\t\t{MarketID: \"tst2usd\", BaseAsset: \"tst2\", QuoteAsset: \"usd\", Oracles: []sdk.AccAddress{}, Active: true},\n\t\t},\n\t}\n\tkeeper.SetParams(ctx, mp)\n\tmarkets = keeper.GetMarkets(ctx)\n\trequire.Equal(t, len(markets), 2)\n\trequire.Equal(t, markets[0].MarketID, \"tstusd\")\n\trequire.Equal(t, markets[1].MarketID, \"tst2usd\")\n\n\t_, found = keeper.GetMarket(ctx, \"nan\")\n\trequire.Equal(t, found, false)\n}", "title": "" }, { "docid": "55e1f8233e84ce69a05bcd5efbf7ceee", "score": "0.49372122", "text": "func (o *DescribeMarketUsersParams) WithSortKey(sortKey *string) *DescribeMarketUsersParams {\n\to.SetSortKey(sortKey)\n\treturn o\n}", "title": "" }, { "docid": "e79dc28d4babbf2bacdc97b02de58fe1", "score": "0.4827198", "text": "func (op *ListOp) UserID(val string) *ListOp {\n\tif op != nil {\n\t\top.QueryOpts.Set(\"user_id\", val)\n\t}\n\treturn op\n}", "title": "" }, { "docid": "bf4f3d22b85dbe0fbaeeffe2d715a689", "score": "0.4754352", "text": "func (k Keeper) SetMarket(ctx sdk.Context, market types.Market) {\n\tstore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.MarketKey))\n\tb := k.cdc.MustMarshalBinaryBare(&market)\n\tstore.Set(GetMarketIDBytes(market.Id), b)\n}", "title": "" }, { "docid": "65f866963cdd5cb0b828219bee6839aa", "score": "0.4610824", "text": "func (k Keeper) HasMarket(ctx sdk.Context, id uint64) bool {\n\tstore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.MarketKey))\n\treturn store.Has(GetMarketIDBytes(id))\n}", "title": "" }, { "docid": "c439ce5294695b3299bfd9ee304428ea", "score": "0.46079487", "text": "func (n *GRPCNode) MarketByID(req *api.MarketByIDRequest) (response *api.MarketByIDResponse, err error) {\n\tmsg := \"gRPC call failed: MarketByID: %w\"\n\tif n == nil {\n\t\terr = fmt.Errorf(msg, e.ErrNil)\n\t\treturn\n\t}\n\n\tc := api.NewTradingDataServiceClient(n.conn)\n\tctx, cancel := context.WithTimeout(context.Background(), n.callTimeout)\n\tdefer cancel()\n\tresponse, err = c.MarketByID(ctx, req)\n\tif err != nil {\n\t\terr = fmt.Errorf(msg, apigrpc.ErrorDetail(err))\n\t}\n\treturn\n}", "title": "" }, { "docid": "c74da448a5a078f7debd8d11d9e3cac3", "score": "0.45899844", "text": "func (op *BulkSendGetBulkSendBatchesOp) UserID(val string) *BulkSendGetBulkSendBatchesOp {\n\tif op != nil {\n\t\top.QueryOpts.Set(\"user_id\", val)\n\t}\n\treturn op\n}", "title": "" }, { "docid": "48c40eb92cde62a59002b4a30b1164e7", "score": "0.45724258", "text": "func (o *DescribeMarketUsersParams) WithSearchWord(searchWord *string) *DescribeMarketUsersParams {\n\to.SetSearchWord(searchWord)\n\treturn o\n}", "title": "" }, { "docid": "0821c097b6660232c6cb9d80795ad142", "score": "0.456773", "text": "func (o *Order) Market(exec boil.Executor, mods ...qm.QueryMod) marketQuery {\n\tqueryMods := []qm.QueryMod{\n\t\tqm.Where(\"id=?\", o.MarketID),\n\t}\n\n\tqueryMods = append(queryMods, mods...)\n\n\tquery := Markets(exec, queryMods...)\n\tqueries.SetFrom(query.Query, \"\\\"market\\\"\")\n\n\treturn query\n}", "title": "" }, { "docid": "b5103f99020ee008e38210f3edbd6239", "score": "0.45545217", "text": "func GetMarketByID(ID string) (domain.Market, error) {\n\tlist := GetMarketList()\n\tfor idx, _ := range list {\n\t\tif(list[idx].ID == ID){\n\t\t\treturn list[idx],nil\n\t\t}\n\t}\n\treturn domain.Market{}, errors.New(\"NOT_FOUND\")\n}", "title": "" }, { "docid": "7d75db24f21003bc1c2a1cda0e6898f1", "score": "0.45425013", "text": "func GetCoinMarketData(c *gin.Context) {\n\tq := c.Request.URL.Query()\n\n\tif len(q[\"id\"]) <= 0 {\n\t\terrors.ErrRequiredParam(c.Writer, http.StatusBadRequest, \"'id' is not present\")\n\t\treturn\n\t}\n\n\tid := q[\"id\"][0]\n\n\tdata, err := s.client.GetCoinMarketData(id)\n\tif err != nil {\n\t\ts.l.Printf(\"failed to fetch coin market data: %s\\n\", err)\n\t}\n\n\tmarketData := &models.Market{\n\t\tName: data.Name,\n\t\tSymbol: data.Symbol,\n\t\tCurrentPrice: decimal.NewFromFloat(data.MarketData.CurrentPrice.Usd).StringFixedBank(2),\n\t\tCurrency: \"usd\",\n\t\tMarketCapRank: data.MarketCapRank,\n\t\tMarketCap: decimal.NewFromFloat(data.MarketData.MarketCap.Usd).StringFixedBank(0),\n\t\tPercentChange1H: decimal.NewFromFloat(data.MarketData.PriceChangePercentage1HInCurrency.Usd).StringFixedBank(2),\n\t\tPercentChange24H: decimal.NewFromFloat(data.MarketData.PriceChangePercentage24HInCurrency.Usd).StringFixedBank(2),\n\t\tPercentChange7D: decimal.NewFromFloat(data.MarketData.PriceChangePercentage7DInCurrency.Usd).StringFixedBank(2),\n\t\tTotalVolume: decimal.NewFromFloat(data.MarketData.TotalVolume.Usd).StringFixedBank(0),\n\t\tTotalSupply: decimal.NewFromFloat(data.MarketData.TotalSupply).StringFixedBank(0),\n\t\tCirculatingSupply: decimal.NewFromFloat(data.MarketData.CirculatingSupply).StringFixedBank(0),\n\t\tLastUpdated: data.MarketData.LastUpdated,\n\t}\n\n\tmodels.Respond(c.Writer, marketData)\n\treturn\n}", "title": "" }, { "docid": "d87f00c592414d45a8387345c777caf2", "score": "0.45361066", "text": "func WithEngineID(id int) Option {\n\treturn func(e *Engine) {\n\t\te.engineID = &id\n\t\te.defaultMetricLabels[\"engine_id\"] = fmt.Sprint(*e.engineID)\n\t}\n}", "title": "" }, { "docid": "d87f00c592414d45a8387345c777caf2", "score": "0.45361066", "text": "func WithEngineID(id int) Option {\n\treturn func(e *Engine) {\n\t\te.engineID = &id\n\t\te.defaultMetricLabels[\"engine_id\"] = fmt.Sprint(*e.engineID)\n\t}\n}", "title": "" }, { "docid": "97021f104c366f210ba271805d7805d4", "score": "0.45252934", "text": "func (mhc *MarketHoursCreate) SetMarketInfo(m *MarketInfo) *MarketHoursCreate {\n\treturn mhc.SetMarketInfoID(m.ID)\n}", "title": "" }, { "docid": "622cf33f41d13ff743c0e9e8f1b2d8fa", "score": "0.45204774", "text": "func (mh *MarketHours) QueryMarketInfo() *MarketInfoQuery {\n\treturn (&MarketHoursClient{config: mh.config}).QueryMarketInfo(mh)\n}", "title": "" }, { "docid": "dd78db84ede0eec06f04743a5f35fb6c", "score": "0.45074314", "text": "func (n *GRPCNode) MarketDataByID(req *api.MarketDataByIDRequest) (response *api.MarketDataByIDResponse, err error) {\n\tmsg := \"gRPC call failed: MarketDataByID: %w\"\n\tif n == nil {\n\t\terr = fmt.Errorf(msg, e.ErrNil)\n\t\treturn\n\t}\n\n\tc := api.NewTradingDataServiceClient(n.conn)\n\tctx, cancel := context.WithTimeout(context.Background(), n.callTimeout)\n\tdefer cancel()\n\tresponse, err = c.MarketDataByID(ctx, req)\n\tif err != nil {\n\t\terr = fmt.Errorf(msg, apigrpc.ErrorDetail(err))\n\t}\n\treturn\n}", "title": "" }, { "docid": "b21ea588b4161f25842921e362b8b2c0", "score": "0.44649088", "text": "func (b *Bittrex) SellMarket(market string, quantity float64) (uuid string, err error) {\n\tr, err := b.client.do(\"GET\", \"market/sellmarket?market=\"+market+\"&quantity=\"+strconv.FormatFloat(quantity, 'f', 8, 64), \"\", true)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar response jsonResponse\n\tif err = json.Unmarshal(r, &response); err != nil {\n\t\treturn\n\t}\n\tif err = handleErr(response); err != nil {\n\t\treturn\n\t}\n\tvar u Uuid\n\terr = json.Unmarshal(response.Result, &u)\n\tuuid = u.Id\n\treturn\n}", "title": "" }, { "docid": "5d019f6236f4fd74570c1270de134212", "score": "0.44353247", "text": "func WithEntityID(value string) Param {\n\treturn func(sp *ServiceProvider) error {\n\t\tsp.sp.EntityID = value\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "1aaa1d73519b756a6e698b3b561bf221", "score": "0.44123852", "text": "func TeamUserIDContext(next http.Handler) http.Handler {\n\treturn http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) {\n\t\tuserID := chi.URLParam(request, \"teamUserId\")\n\t\tif userID == \"\" {\n\t\t\trender.Render(writer, request, api.ErrorInvalidRequest(fmt.Errorf(\"userId must be set\"))) //nolint:errcheck\n\t\t\treturn\n\t\t}\n\t\tctx := context.WithValue(request.Context(), teamUserIDKey, userID)\n\t\tnext.ServeHTTP(writer, request.WithContext(ctx))\n\t})\n}", "title": "" }, { "docid": "948ab6257c4113a3b59cbb16e083272e", "score": "0.44048443", "text": "func (m *Market) marketName() string {\n\treturn marketName(m.BaseID, m.QuoteID)\n}", "title": "" }, { "docid": "c816e737ef028ad431ac0e4557f66b6f", "score": "0.4386383", "text": "func (o *DescribeMarketUsersParams) WithOffset(offset *int64) *DescribeMarketUsersParams {\n\to.SetOffset(offset)\n\treturn o\n}", "title": "" }, { "docid": "37db7298988348bce4f4c282730ae27e", "score": "0.43783772", "text": "func UpdateMarket(ID string, it domain.Market) domain.Market{\n\tlist := GetMarketList()\n\tfor idx, _ := range list {\n\t\tif(list[idx].ID == ID){\n\t\t\tlist[idx] = it\n\t\t\tlist[idx].ID = ID\n\t\t\tlist[idx].UpdatedAt = time.Now()\n\t\t\twriteMarket(list)\n\t\t\treturn list[idx]\n\t\t}\n\t}\n\treturn it\n}", "title": "" }, { "docid": "a1906633143dbfc185a28ab5f1d0b41c", "score": "0.435344", "text": "func (ctx Context) SetUserID(r *http.Request, val string) {\n\t*r = *r.WithContext(context.WithValue(r.Context(), keyUserID, val))\n}", "title": "" }, { "docid": "f477c26690fb2441025cfeda9cef50df", "score": "0.43508637", "text": "func SetUserID(ctx context.Context, id string) context.Context {\n\treturn context.WithValue(ctx, userIdCtxKey, id)\n}", "title": "" }, { "docid": "8da2682179539cdf51a1c16f552641a0", "score": "0.4341843", "text": "func QueryMarkets() {\n\tm := &Market{}\n\tbody := iex.Query(\"/market\")\n\terr := json.Unmarshal(body, &m)\n\n\tif err != nil {\n\t\terrors.Error(\"Failed to unmarshal\", err)\n\t}\n\n\tt := table.NewWriter()\n\tt.SetOutputMirror(os.Stdout)\n\tt.AppendHeader(table.Row{\n\t\t\"Mic\",\n\t\t\"Tape ID\",\n\t\t\"Venue Name\",\n\t\t\"Volume\",\n\t\t\"Tape A\",\n\t\t\"Tape B\",\n\t\t\"Tape C\",\n\t\t\"Market Percent\",\n\t\t\"Last Updated\",\n\t})\n\n\tfor _, market := range *m {\n\t\tt.AppendRow(table.Row{\n\t\t\tmarket.Mic,\n\t\t\tutils.ReplaceEmptyValue(market.TapeID),\n\t\t\tmarket.VenueName,\n\t\t\thumanize.Comma(market.Volume),\n\t\t\thumanize.Comma(market.TapeA),\n\t\t\thumanize.Comma(market.TapeB),\n\t\t\thumanize.Comma(market.TapeC),\n\t\t\tfmt.Sprintf(\"%.3f\", market.MarketPercent),\n\t\t\tutils.UNIXToHumanReadable(market.LastUpdated),\n\t\t})\n\t}\n\n\tt.SetAlign([]text.Align{\n\t\ttext.AlignLeft,\n\t\ttext.AlignLeft,\n\t\ttext.AlignLeft,\n\t\ttext.AlignRight,\n\t\ttext.AlignRight,\n\t\ttext.AlignRight,\n\t\ttext.AlignRight,\n\t\ttext.AlignRight,\n\t\ttext.AlignLeft,\n\t})\n\n\tt.SetAllowedColumnLengths([]int{40, 40, 40, 40, 40, 40, 40, 40})\n\tt.SetStyle(table.StyleColoredCyanWhiteOnBlack)\n\n\tt.Render()\n}", "title": "" }, { "docid": "488298994f0706edfb96fc020bb602dd", "score": "0.43386456", "text": "func (k Keeper) GetMarket(ctx sdk.Context, id uint64) types.Market {\n\tstore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.MarketKey))\n\tvar market types.Market\n\tk.cdc.MustUnmarshalBinaryBare(store.Get(GetMarketIDBytes(id)), &market)\n\treturn market\n}", "title": "" }, { "docid": "68145ea65e2b8e713eb1822990975a63", "score": "0.43299603", "text": "func (k Keeper) RemoveMarket(ctx sdk.Context, id uint64) {\n\tstore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.MarketKey))\n\tstore.Delete(GetMarketIDBytes(id))\n}", "title": "" }, { "docid": "109d6f395967823b47829210ebdf7e06", "score": "0.4321907", "text": "func GetUserByID(w http.ResponseWriter, r *http.Request, params denco.Params) {\n\t// some actual stuff should happen in here\n}", "title": "" }, { "docid": "67a90c0c1c4692490a3c46c8ccb49a45", "score": "0.4316708", "text": "func (o *DescribeMarketUsersParams) WithOwner(owner []string) *DescribeMarketUsersParams {\n\to.SetOwner(owner)\n\treturn o\n}", "title": "" }, { "docid": "cd978fa4ed3771f67bf2101c4c0cc833", "score": "0.4304946", "text": "func NewMarket(id dnTypes.ID, baseAsset, quoteAsset string) Market {\n\treturn Market{\n\t\tID: id,\n\t\tBaseAssetDenom: baseAsset,\n\t\tQuoteAssetDenom: quoteAsset,\n\t}\n}", "title": "" }, { "docid": "35cc20b33a6832a7b03df76c9a008f4a", "score": "0.43048716", "text": "func SaveMarket(it domain.Market) domain.Market {\n\tlist := GetMarketList()\n\tit.ID = str.NewUUID()\n\tit.CreatedAt = time.Now()\n\tlist = append(list, it)\n\twriteMarket(list)\n\treturn it\n}", "title": "" }, { "docid": "33b186a8157192cc776c64ac44e9c7fa", "score": "0.43046722", "text": "func WithUserID(userID string, l log.Logger) log.Logger {\n\t// See note in WithContext.\n\treturn log.With(l, \"org_id\", userID)\n}", "title": "" }, { "docid": "d8f731d8bb59474ad89a1782872f23ab", "score": "0.42972165", "text": "func (k Keeper) SetMarketOwner(ctx sdk.Context, name string, symbol string, owner sdk.AccAddress, tokenName string, collateralToken string) {\n\tfmt.Println(name)\n\tmoneymarket := k.GetMarketInfo(ctx, name)\n\tmoneymarket.Owner = owner\n\tmoneymarket.Name = name\n\tmoneymarket.Symbol = symbol\n\tmoneymarket.TokenName = tokenName\n\tmoneymarket.CollateralToken = collateralToken\n\tk.SetMarketInfo(ctx, name, moneymarket)\n}", "title": "" }, { "docid": "838fab98850c7ab36b69522470b8f9fb", "score": "0.4292373", "text": "func WithExternalID(id string) option {\n\treturn func(p *provider) {\n\t\tp.externalID = id\n\t}\n}", "title": "" }, { "docid": "c8bdcff3d451f5454977475a7a02cd19", "score": "0.42879725", "text": "func withUserID(id string) userOption {\n\treturn func(m *UserMutation) {\n\t\tvar (\n\t\t\terr error\n\t\t\tonce sync.Once\n\t\t\tvalue *User\n\t\t)\n\t\tm.oldValue = func(ctx context.Context) (*User, error) {\n\t\t\tonce.Do(func() {\n\t\t\t\tif m.done {\n\t\t\t\t\terr = fmt.Errorf(\"querying old values post mutation is not allowed\")\n\t\t\t\t} else {\n\t\t\t\t\tvalue, err = m.Client().User.Get(ctx, id)\n\t\t\t\t}\n\t\t\t})\n\t\t\treturn value, err\n\t\t}\n\t\tm.id = &id\n\t}\n}", "title": "" }, { "docid": "d10c5685684ae754ba34e8f60a9fd1eb", "score": "0.42675287", "text": "func (o *DescribeMarketUsersParams) WithReverse(reverse *bool) *DescribeMarketUsersParams {\n\to.SetReverse(reverse)\n\treturn o\n}", "title": "" }, { "docid": "db7c81d433dd1568cd99268ffda2b17d", "score": "0.42575714", "text": "func withUserID(id int) userOption {\n\treturn func(m *UserMutation) {\n\t\tvar (\n\t\t\terr error\n\t\t\tonce sync.Once\n\t\t\tvalue *User\n\t\t)\n\t\tm.oldValue = func(ctx context.Context) (*User, error) {\n\t\t\tonce.Do(func() {\n\t\t\t\tif m.done {\n\t\t\t\t\terr = fmt.Errorf(\"querying old values post mutation is not allowed\")\n\t\t\t\t} else {\n\t\t\t\t\tvalue, err = m.Client().User.Get(ctx, id)\n\t\t\t\t}\n\t\t\t})\n\t\t\treturn value, err\n\t\t}\n\t\tm.id = &id\n\t}\n}", "title": "" }, { "docid": "db7c81d433dd1568cd99268ffda2b17d", "score": "0.42575714", "text": "func withUserID(id int) userOption {\n\treturn func(m *UserMutation) {\n\t\tvar (\n\t\t\terr error\n\t\t\tonce sync.Once\n\t\t\tvalue *User\n\t\t)\n\t\tm.oldValue = func(ctx context.Context) (*User, error) {\n\t\t\tonce.Do(func() {\n\t\t\t\tif m.done {\n\t\t\t\t\terr = fmt.Errorf(\"querying old values post mutation is not allowed\")\n\t\t\t\t} else {\n\t\t\t\t\tvalue, err = m.Client().User.Get(ctx, id)\n\t\t\t\t}\n\t\t\t})\n\t\t\treturn value, err\n\t\t}\n\t\tm.id = &id\n\t}\n}", "title": "" }, { "docid": "db7c81d433dd1568cd99268ffda2b17d", "score": "0.42575714", "text": "func withUserID(id int) userOption {\n\treturn func(m *UserMutation) {\n\t\tvar (\n\t\t\terr error\n\t\t\tonce sync.Once\n\t\t\tvalue *User\n\t\t)\n\t\tm.oldValue = func(ctx context.Context) (*User, error) {\n\t\t\tonce.Do(func() {\n\t\t\t\tif m.done {\n\t\t\t\t\terr = fmt.Errorf(\"querying old values post mutation is not allowed\")\n\t\t\t\t} else {\n\t\t\t\t\tvalue, err = m.Client().User.Get(ctx, id)\n\t\t\t\t}\n\t\t\t})\n\t\t\treturn value, err\n\t\t}\n\t\tm.id = &id\n\t}\n}", "title": "" }, { "docid": "db7c81d433dd1568cd99268ffda2b17d", "score": "0.42575714", "text": "func withUserID(id int) userOption {\n\treturn func(m *UserMutation) {\n\t\tvar (\n\t\t\terr error\n\t\t\tonce sync.Once\n\t\t\tvalue *User\n\t\t)\n\t\tm.oldValue = func(ctx context.Context) (*User, error) {\n\t\t\tonce.Do(func() {\n\t\t\t\tif m.done {\n\t\t\t\t\terr = fmt.Errorf(\"querying old values post mutation is not allowed\")\n\t\t\t\t} else {\n\t\t\t\t\tvalue, err = m.Client().User.Get(ctx, id)\n\t\t\t\t}\n\t\t\t})\n\t\t\treturn value, err\n\t\t}\n\t\tm.id = &id\n\t}\n}", "title": "" }, { "docid": "db7c81d433dd1568cd99268ffda2b17d", "score": "0.42575714", "text": "func withUserID(id int) userOption {\n\treturn func(m *UserMutation) {\n\t\tvar (\n\t\t\terr error\n\t\t\tonce sync.Once\n\t\t\tvalue *User\n\t\t)\n\t\tm.oldValue = func(ctx context.Context) (*User, error) {\n\t\t\tonce.Do(func() {\n\t\t\t\tif m.done {\n\t\t\t\t\terr = fmt.Errorf(\"querying old values post mutation is not allowed\")\n\t\t\t\t} else {\n\t\t\t\t\tvalue, err = m.Client().User.Get(ctx, id)\n\t\t\t\t}\n\t\t\t})\n\t\t\treturn value, err\n\t\t}\n\t\tm.id = &id\n\t}\n}", "title": "" }, { "docid": "db7c81d433dd1568cd99268ffda2b17d", "score": "0.42575714", "text": "func withUserID(id int) userOption {\n\treturn func(m *UserMutation) {\n\t\tvar (\n\t\t\terr error\n\t\t\tonce sync.Once\n\t\t\tvalue *User\n\t\t)\n\t\tm.oldValue = func(ctx context.Context) (*User, error) {\n\t\t\tonce.Do(func() {\n\t\t\t\tif m.done {\n\t\t\t\t\terr = fmt.Errorf(\"querying old values post mutation is not allowed\")\n\t\t\t\t} else {\n\t\t\t\t\tvalue, err = m.Client().User.Get(ctx, id)\n\t\t\t\t}\n\t\t\t})\n\t\t\treturn value, err\n\t\t}\n\t\tm.id = &id\n\t}\n}", "title": "" }, { "docid": "db7c81d433dd1568cd99268ffda2b17d", "score": "0.42575714", "text": "func withUserID(id int) userOption {\n\treturn func(m *UserMutation) {\n\t\tvar (\n\t\t\terr error\n\t\t\tonce sync.Once\n\t\t\tvalue *User\n\t\t)\n\t\tm.oldValue = func(ctx context.Context) (*User, error) {\n\t\t\tonce.Do(func() {\n\t\t\t\tif m.done {\n\t\t\t\t\terr = fmt.Errorf(\"querying old values post mutation is not allowed\")\n\t\t\t\t} else {\n\t\t\t\t\tvalue, err = m.Client().User.Get(ctx, id)\n\t\t\t\t}\n\t\t\t})\n\t\t\treturn value, err\n\t\t}\n\t\tm.id = &id\n\t}\n}", "title": "" }, { "docid": "75876c9751dfcb21ca7f60a9537844f2", "score": "0.42554677", "text": "func (o *DescribeMarketUsersParams) WithHTTPClient(client *http.Client) *DescribeMarketUsersParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "610688759b5e9a78edda66bd170229fb", "score": "0.42527565", "text": "func (o *DescribeMarketUsersParams) SetContext(ctx context.Context) {\n\to.Context = ctx\n}", "title": "" }, { "docid": "1dde6a913bb5fd979fe26dc788ee2367", "score": "0.42476687", "text": "func withUserID(id int) userOption {\n\treturn func(m *UserMutation) {\n\t\tvar (\n\t\t\terr error\n\t\t\tonce sync.Once\n\t\t\tvalue *User\n\t\t)\n\t\tm.oldValue = func(ctx context.Context) (*User, error) {\n\t\t\tonce.Do(func() {\n\t\t\t\tif m.done {\n\t\t\t\t\terr = errors.New(\"querying old values post mutation is not allowed\")\n\t\t\t\t} else {\n\t\t\t\t\tvalue, err = m.Client().User.Get(ctx, id)\n\t\t\t\t}\n\t\t\t})\n\t\t\treturn value, err\n\t\t}\n\t\tm.id = &id\n\t}\n}", "title": "" }, { "docid": "c6828bf3d300930c887a3082e9fe7700", "score": "0.42457488", "text": "func (k Keeper) SupplyMarketPosition(ctx sdk.Context, Owner sdk.AccAddress, market string, lendTokens sdk.Coins) {\n\tif Owner.Empty() {\n\t\treturn\n\t}\n\tmarketposition := k.GetMarketPosition(ctx, Owner)\n\tmarketposition.Owner = Owner\n\tmarketposition.Market = market\n\tmarketposition.LendTokens = marketposition.LendTokens.Add(lendTokens)\n\tstore := ctx.KVStore(k.storeKey)\n\tstore.Set([]byte(Owner), k.cdc.MustMarshalBinaryBare(marketposition))\n\n\t//set the market\n\tmoneymarket := k.GetMarketInfo(ctx, market)\n\tmoneymarket.TokenSupply = moneymarket.TokenSupply.Add(lendTokens)\n\tinterestRate := calcInterest(moneymarket.TokenBorrows, moneymarket.TokenSupply)\n\tmoneymarket.InterestRate = interestRate\n\tk.SetMarketInfo(ctx, market, moneymarket)\n}", "title": "" }, { "docid": "7b29d6ff6a5ea271e78b2274a1c6747e", "score": "0.42330346", "text": "func (o *Order) SetMarket(exec boil.Executor, insert bool, related *Market) error {\n\tvar err error\n\tif insert {\n\t\tif err = related.Insert(exec); err != nil {\n\t\t\treturn errors.Wrap(err, \"failed to insert into foreign table\")\n\t\t}\n\t}\n\n\tupdateQuery := fmt.Sprintf(\n\t\t\"UPDATE \\\"order\\\" SET %s WHERE %s\",\n\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 1, []string{\"market_id\"}),\n\t\tstrmangle.WhereClause(\"\\\"\", \"\\\"\", 2, orderPrimaryKeyColumns),\n\t)\n\tvalues := []interface{}{related.ID, o.ID}\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, updateQuery)\n\t\tfmt.Fprintln(boil.DebugWriter, values)\n\t}\n\n\tif _, err = exec.Exec(updateQuery, values...); err != nil {\n\t\treturn errors.Wrap(err, \"failed to update local table\")\n\t}\n\n\to.MarketID = related.ID\n\n\tif o.R == nil {\n\t\to.R = &orderR{\n\t\t\tMarket: related,\n\t\t}\n\t} else {\n\t\to.R.Market = related\n\t}\n\n\tif related.R == nil {\n\t\trelated.R = &marketR{\n\t\t\tOrders: OrderSlice{o},\n\t\t}\n\t} else {\n\t\trelated.R.Orders = append(related.R.Orders, o)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "622a7655ea1a185f62d1f11a1fb5093f", "score": "0.41916642", "text": "func NewDescribeMarketUsersParamsWithContext(ctx context.Context) *DescribeMarketUsersParams {\n\tvar ()\n\treturn &DescribeMarketUsersParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "81ae268c614419858b1bc2c85c6ceb70", "score": "0.418796", "text": "func formatMarketName(baseName string, wear AssetWear, isStatTrak bool) string {\n\t// StatTrak™ AK-47 | Case Hardened (Field-Tested)\n\tmarketName := \"\"\n\tif isStatTrak {\n\t\tmarketName = statTrak + \" \"\n\t}\n\n\tmarketName += baseName + \" \" + \"(\" + string(wear) + \")\"\n\treturn marketName\n}", "title": "" }, { "docid": "82eea68cb3e98fb0b3e0b1be7c70fc53", "score": "0.41871694", "text": "func getUser(respWriter http.ResponseWriter, request *http.Request) {\n\trespWriter.Header().Set(\"Content-Type\", \"application/json\")\n\tkeys, ok := request.URL.Query()[\"id\"]\n\tif !ok || len(keys[0]) < 1 {\n\t\tlog.Println(\"Url Param 'id' is missing\")\n\t\treturn\n\t}\n\tid, err := strconv.Atoi(keys[0])\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tuser := getUserFromDb(id)\n\tjson.NewEncoder(respWriter).Encode(user)\n}", "title": "" }, { "docid": "affac68d9e02f9fcae1bcb05b8dd4be2", "score": "0.41800952", "text": "func WithUserID(id int) ClientOption {\n\treturn func(client *Client) {\n\t\tclient.userID = id\n\t\tclient.sling.Set(\"CH-UserID\", strconv.Itoa(client.userID))\n\t}\n}", "title": "" }, { "docid": "7418cf37ea9da59ca1469f2fd43abb25", "score": "0.41733882", "text": "func withUserID(id uuid.UUID) userOption {\n\treturn func(m *UserMutation) {\n\t\tvar (\n\t\t\terr error\n\t\t\tonce sync.Once\n\t\t\tvalue *User\n\t\t)\n\t\tm.oldValue = func(ctx context.Context) (*User, error) {\n\t\t\tonce.Do(func() {\n\t\t\t\tif m.done {\n\t\t\t\t\terr = fmt.Errorf(\"querying old values post mutation is not allowed\")\n\t\t\t\t} else {\n\t\t\t\t\tvalue, err = m.Client().User.Get(ctx, id)\n\t\t\t\t}\n\t\t\t})\n\t\t\treturn value, err\n\t\t}\n\t\tm.id = &id\n\t}\n}", "title": "" }, { "docid": "cfabacd57019de64756b797f3e60fb4e", "score": "0.4160271", "text": "func (k Keeper) SetMarketCount(ctx sdk.Context, count uint64) {\n\tstore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.MarketCountKey))\n\tbyteKey := types.KeyPrefix(types.MarketCountKey)\n\tbz := []byte(strconv.FormatUint(count, 10))\n\tstore.Set(byteKey, bz)\n}", "title": "" }, { "docid": "81af7200ed9dc54717b25abec904712f", "score": "0.4147972", "text": "func GetMarketsKey(id dnTypes.ID) []byte {\n\treturn bytes.Join(\n\t\t[][]byte{\n\t\t\tKeyMarketPrefix,\n\t\t\t[]byte(id.String()),\n\t\t},\n\t\tKeyDelimiter,\n\t)\n}", "title": "" }, { "docid": "0a54c748bcd814ca491cad0954449e4a", "score": "0.41272968", "text": "func (b *Bittrex) BuyMarket(market string, quantity float64) (uuid string, err error) {\n\tr, err := b.client.do(\"GET\", \"market/buymarket?market=\"+market+\"&quantity=\"+strconv.FormatFloat(quantity, 'f', 8, 64), \"\", true)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar response jsonResponse\n\tif err = json.Unmarshal(r, &response); err != nil {\n\t\treturn\n\t}\n\tif err = handleErr(response); err != nil {\n\t\treturn\n\t}\n\tvar u Uuid\n\terr = json.Unmarshal(response.Result, &u)\n\tuuid = u.Id\n\treturn\n}", "title": "" }, { "docid": "0885dc99806397a698886709b359888f", "score": "0.41050428", "text": "func SetUserID(token string, userID string) {\n\ty := connection.Connection.Get()\n\ty.Do(\"SET\", token, userID)\n\tdefer y.Close()\n}", "title": "" }, { "docid": "cd1b9e4a1ee0cf4c43b0f067114e16cf", "score": "0.41028023", "text": "func AppendUserIDToRequest(r *http.Request, uid string) {\n\tr.Header.Add(userHeader, uid)\n}", "title": "" }, { "docid": "3844044d9916b7b07610a3ab8381900b", "score": "0.410091", "text": "func NewShowWalletsContext(ctx context.Context, r *http.Request, service *goa.Service) (*ShowWalletsContext, error) {\n\tvar err error\n\tresp := goa.ContextResponse(ctx)\n\tresp.Service = service\n\treq := goa.ContextRequest(ctx)\n\treq.Request = r\n\trctx := ShowWalletsContext{Context: ctx, ResponseData: resp, RequestData: req}\n\tparamUserID := req.Params[\"userId\"]\n\tif len(paramUserID) > 0 {\n\t\trawUserID := paramUserID[0]\n\t\trctx.UserID = &rawUserID\n\t\tif rctx.UserID != nil {\n\t\t\tif ok := goa.ValidatePattern(`^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$`, *rctx.UserID); !ok {\n\t\t\t\terr = goa.MergeErrors(err, goa.InvalidPatternError(`userId`, *rctx.UserID, `^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$`))\n\t\t\t}\n\t\t}\n\t}\n\treturn &rctx, err\n}", "title": "" }, { "docid": "5f43bb5c2536d7eb62c1bd4edfba2d6a", "score": "0.4077394", "text": "func (m *BookingMutation) SetUsedbyID(id int) {\n\tm.usedby = &id\n}", "title": "" }, { "docid": "4a3a54ff0a79c70b191c360debfd9204", "score": "0.4062607", "text": "func (o *UpdateOfferStockParams) SetOfferID(offerID string) {\n\to.OfferID = offerID\n}", "title": "" }, { "docid": "74a1e02f47e401de3d2879cea484a2ca", "score": "0.40587562", "text": "func Market(exchange, pair string) (DetailedMarket, error) {\n\tvar market DetailedMarket\n\turl := fmt.Sprintf(indexes[\"Market\"], exchange, pair)\n\tres, err := request(url)\n\n\tif res != nil {\n\t\terr = json.Unmarshal(res, &market)\n\t}\n\n\treturn market, err\n}", "title": "" }, { "docid": "9bc8fac3a1f44ab38cd9dd80fa4e17d0", "score": "0.40544057", "text": "func DeleteMarket(ID string) bool {\n\tlist := GetMarketList()\n\tfor idx, _ := range list {\n\t\tif(list[idx].ID == ID){\n\t\t\tlist = append(list[:idx], list[idx+1:]...)\n\t\t\twriteMarket(list)\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "ff74d122a0bcf95e1b0d07db32649c29", "score": "0.40532836", "text": "func withUserOpInfoID(id int) useropinfoOption {\n\treturn func(m *UserOpInfoMutation) {\n\t\tvar (\n\t\t\terr error\n\t\t\tonce sync.Once\n\t\t\tvalue *UserOpInfo\n\t\t)\n\t\tm.oldValue = func(ctx context.Context) (*UserOpInfo, error) {\n\t\t\tonce.Do(func() {\n\t\t\t\tif m.done {\n\t\t\t\t\terr = fmt.Errorf(\"querying old values post mutation is not allowed\")\n\t\t\t\t} else {\n\t\t\t\t\tvalue, err = m.Client().UserOpInfo.Get(ctx, id)\n\t\t\t\t}\n\t\t\t})\n\t\t\treturn value, err\n\t\t}\n\t\tm.id = &id\n\t}\n}", "title": "" }, { "docid": "2a2f8a392bef0511640412294d2aab9c", "score": "0.405078", "text": "func withDUserID(id string) duserOption {\n\treturn func(m *DUserMutation) {\n\t\tvar (\n\t\t\terr error\n\t\t\tonce sync.Once\n\t\t\tvalue *DUser\n\t\t)\n\t\tm.oldValue = func(ctx context.Context) (*DUser, error) {\n\t\t\tonce.Do(func() {\n\t\t\t\tif m.done {\n\t\t\t\t\terr = fmt.Errorf(\"querying old values post mutation is not allowed\")\n\t\t\t\t} else {\n\t\t\t\t\tvalue, err = m.Client().DUser.Get(ctx, id)\n\t\t\t\t}\n\t\t\t})\n\t\t\treturn value, err\n\t\t}\n\t\tm.id = &id\n\t}\n}", "title": "" }, { "docid": "d23561fd638a5828607a8536ec9f00d9", "score": "0.40271062", "text": "func NewMarketWatch(refresh, tokenClientID, tokenSecret string, db *sqlx.DB, redis *redis.Pool) *MarketWatch {\n\t// Get a caching http client\n\tcache := apicache.CreateLimitedHTTPClientCache(redis)\n\n\t// Create our ESI API Client\n\tesiClient := goesi.NewAPIClient(cache, \"EVEData-API-MarketWatch\")\n\n\t// Setup an authenticator for our user tokens\n\tdoAuth := false\n\tif tokenClientID == \"\" || tokenSecret == \"\" || refresh == \"\" {\n\t\tlog.Println(\"Warning: Missing authentication parameters so only regional market will be polled\")\n\t} else {\n\t\tdoAuth = true\n\t}\n\tauth := goesi.NewSSOAuthenticatorV2(cache, tokenClientID, tokenSecret, \"\", []string{})\n\n\t// Setup our token for structures\n\ttok := &oauth2.Token{\n\t\tExpiry: time.Now(),\n\t\tAccessToken: \"\",\n\t\tRefreshToken: refresh,\n\t\tTokenType: \"Bearer\",\n\t}\n\ttoken := auth.TokenSource(tok)\n\n\treturn &MarketWatch{\n\t\t// ESI Client\n\t\tesi: esiClient,\n\n\t\t// database pool\n\t\tdb: db,\n\n\t\t// ESI SSO Handler\n\t\tdoAuth: doAuth,\n\t\ttoken: &token,\n\t\ttokenAuth: auth,\n\n\t\t// SQL channels\n\t\torderChan: make(chan []esi.GetMarketsRegionIdOrders200Ok, 10000),\n\t\tcontractChan: make(chan []FullContract, 10000),\n\t\torderChangeChan: make(chan []OrderChange, 10000),\n\t\tcontractChangeChan: make(chan []ContractChange, 10000),\n\t\torderDeleteChan: make(chan []OrderChange, 10000),\n\t\tcontractDeleteChan: make(chan []ContractChange, 10000),\n\n\t\t// Market Data Map\n\t\tmarket: make(map[int64]*sync.Map),\n\t\tstructures: make(map[int64]*Structure),\n\t\tcontracts: make(map[int64]*sync.Map),\n\t}\n}", "title": "" }, { "docid": "3ade0910b96cb29783526b4175b5060b", "score": "0.40139407", "text": "func (m *IdentityProtectionRequestBuilder) RiskyUsersById(id string)(*RiskyUsersRiskyUserItemRequestBuilder) {\n urlTplParams := make(map[string]string)\n for idx, item := range m.pathParameters {\n urlTplParams[idx] = item\n }\n if id != \"\" {\n urlTplParams[\"riskyUser%2Did\"] = id\n }\n return NewRiskyUsersRiskyUserItemRequestBuilderInternal(urlTplParams, m.requestAdapter)\n}", "title": "" }, { "docid": "11375259d4345561797a85f09a16e8ac", "score": "0.40123788", "text": "func SetChainID(id string) {\n\tchainID = id\n}", "title": "" }, { "docid": "dba7a620e7c7d6cee16d2b7d1c9e27e9", "score": "0.4011548", "text": "func withEmployeeID(id int) employeeOption {\n\treturn func(m *EmployeeMutation) {\n\t\tvar (\n\t\t\terr error\n\t\t\tonce sync.Once\n\t\t\tvalue *Employee\n\t\t)\n\t\tm.oldValue = func(ctx context.Context) (*Employee, error) {\n\t\t\tonce.Do(func() {\n\t\t\t\tif m.done {\n\t\t\t\t\terr = fmt.Errorf(\"querying old values post mutation is not allowed\")\n\t\t\t\t} else {\n\t\t\t\t\tvalue, err = m.Client().Employee.Get(ctx, id)\n\t\t\t\t}\n\t\t\t})\n\t\t\treturn value, err\n\t\t}\n\t\tm.id = &id\n\t}\n}", "title": "" }, { "docid": "3505515139f69f23c02b90f930adcd6a", "score": "0.4009479", "text": "func withUsersID(id int) usersOption {\n\treturn func(m *UsersMutation) {\n\t\tvar (\n\t\t\terr error\n\t\t\tonce sync.Once\n\t\t\tvalue *Users\n\t\t)\n\t\tm.oldValue = func(ctx context.Context) (*Users, error) {\n\t\t\tonce.Do(func() {\n\t\t\t\tif m.done {\n\t\t\t\t\terr = fmt.Errorf(\"querying old values post mutation is not allowed\")\n\t\t\t\t} else {\n\t\t\t\t\tvalue, err = m.Client().Users.Get(ctx, id)\n\t\t\t\t}\n\t\t\t})\n\t\t\treturn value, err\n\t\t}\n\t\tm.id = &id\n\t}\n}", "title": "" }, { "docid": "2da950debc8fb4bafe2fcec9f74fa4d2", "score": "0.39916438", "text": "func (cl *Client) GetMarketSummaryRequest(ctx context.Context, req *GetMarketSummaryRequest) (*GetMarketSummaryResponse, error) {\n\tvar res GetMarketSummaryResponse\n\terr := cl.do(ctx, http.MethodGet, \"/public/marketsummary\", req, &res, false)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &res, nil\n}", "title": "" }, { "docid": "aed67f07570a6d7c62bb2cf7289f5ed6", "score": "0.398957", "text": "func WithOrg(org string) ContextOption {\n\treturn func(o *identityOptions) error {\n\t\to.orgName = org\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "2107d5d570c6f6565e4f7480d213dd04", "score": "0.39878082", "text": "func (o *DescribeMarketUsersParams) SetUserID(userID []string) {\n\to.UserID = userID\n}", "title": "" }, { "docid": "ea459e5b20f3cc0004d5782f22edf6a1", "score": "0.397739", "text": "func withPurposeID(id int) purposeOption {\n\treturn func(m *PurposeMutation) {\n\t\tvar (\n\t\t\terr error\n\t\t\tonce sync.Once\n\t\t\tvalue *Purpose\n\t\t)\n\t\tm.oldValue = func(ctx context.Context) (*Purpose, error) {\n\t\t\tonce.Do(func() {\n\t\t\t\tif m.done {\n\t\t\t\t\terr = fmt.Errorf(\"querying old values post mutation is not allowed\")\n\t\t\t\t} else {\n\t\t\t\t\tvalue, err = m.Client().Purpose.Get(ctx, id)\n\t\t\t\t}\n\t\t\t})\n\t\t\treturn value, err\n\t\t}\n\t\tm.id = &id\n\t}\n}", "title": "" }, { "docid": "a1fe42d79c3b07c7cce5764f90041908", "score": "0.3976156", "text": "func SetDevID(id string) OptFunc {\n\treturn func(c *ebaysdk.Trading) error {\n\t\tc.Config.DevID = id\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "85e75df89059e26e50cef1130a4559d4", "score": "0.39676267", "text": "func withUserOaInfoID(id int) useroainfoOption {\n\treturn func(m *UserOaInfoMutation) {\n\t\tvar (\n\t\t\terr error\n\t\t\tonce sync.Once\n\t\t\tvalue *UserOaInfo\n\t\t)\n\t\tm.oldValue = func(ctx context.Context) (*UserOaInfo, error) {\n\t\t\tonce.Do(func() {\n\t\t\t\tif m.done {\n\t\t\t\t\terr = fmt.Errorf(\"querying old values post mutation is not allowed\")\n\t\t\t\t} else {\n\t\t\t\t\tvalue, err = m.Client().UserOaInfo.Get(ctx, id)\n\t\t\t\t}\n\t\t\t})\n\t\t\treturn value, err\n\t\t}\n\t\tm.id = &id\n\t}\n}", "title": "" }, { "docid": "c71a9f7bfae9b6ddc38610d51bdc8371", "score": "0.39647663", "text": "func (b *Bittrex) GetMarketSummaries(ctx context.Context) ([]MarketSummaryData, error) {\n\tvar resp []MarketSummaryData\n\treturn resp, b.SendHTTPRequest(ctx, exchange.RestSpot, getMarketSummaries, &resp, nil)\n}", "title": "" }, { "docid": "24b3f516e3e9ef558c14c469eb0ad9af", "score": "0.39643443", "text": "func NewGetMarketsStructuresStructureIDForbidden() *GetMarketsStructuresStructureIDForbidden {\n\treturn &GetMarketsStructuresStructureIDForbidden{}\n}", "title": "" }, { "docid": "a03fb21e9e7b2a4bb04b4297ce2059c4", "score": "0.3945091", "text": "func (mhc *MarketHoursCreate) SetNillableMarketInfoID(id *int) *MarketHoursCreate {\n\tif id != nil {\n\t\tmhc = mhc.SetMarketInfoID(*id)\n\t}\n\treturn mhc\n}", "title": "" }, { "docid": "d4aaf65a1474c342668b1544502f3c5a", "score": "0.39437884", "text": "func WalletID(userID int) string {\n\tif userID <= 0 {\n\t\treturn \"\"\n\t}\n\t// warning: changing this template will require renaming the stored wallet files in lbrytv\n\tconst template = \"lbrytv-id.%d.wallet\"\n\treturn fmt.Sprintf(template, userID)\n}", "title": "" }, { "docid": "a0ffd712714dece98982b22da26e4be5", "score": "0.3938423", "text": "func NewMarketDataREST(options ...RestOption) MarketDataREST {\n\tcfg := &restConf{}\n\tfor _, ots := range []RestOption{withRestDefaultLogger, WithRestMarketDataHost, withRestDefaultTimeout, WithRestUserAgent(userAgent)} {\n\t\tots(cfg)\n\t}\n\tfor _, ots := range options {\n\t\tots(cfg)\n\t}\n\treturn &marketDataREST{\n\t\tbaseREST: newBaseREST(cfg),\n\t}\n}", "title": "" }, { "docid": "83b94e8d0540d20785bdd6c8a7ace00e", "score": "0.3938089", "text": "func runUserID(c *cli.Context) error {\n\trepo := repository.New()\n\terr := repo.Open()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Fail to open repository: %w\\n\", err)\n\t}\n\tdefer repo.Close()\n\n\t// parse the user's hex ID\n\tidString := c.Args().Get(0)\n\tid, err := primitive.ObjectIDFromHex(idString)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Fail to convert ID string to ObjectID: %w\\n\", err)\n\t}\n\n\t// list the user by it's ID\n\tuser, err := repo.ReadUserByID(id.Hex())\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Fail to read user %q: %w\\n\", idString, err)\n\t}\n\tprintUser(user)\n\treturn nil\n}", "title": "" }, { "docid": "3e328161a46cc23f821c93b6e1a1928b", "score": "0.39350846", "text": "func (f Factory) WithChainID(chainID string) Factory {\n\tf.chainID = chainID\n\treturn f\n}", "title": "" }, { "docid": "c7061cd86dffc184bdecbeac71ee8fad", "score": "0.3932539", "text": "func (k Keeper) HasMarketOwner(ctx sdk.Context, name string) bool {\n\treturn !k.GetMarketInfo(ctx, name).Owner.Empty()\n}", "title": "" }, { "docid": "1ce0d94efde32a016235e05e9bfcdcee", "score": "0.39310235", "text": "func (m *Market) SetID(id []byte) error {\n\tm.ID = id\n\treturn nil\n}", "title": "" }, { "docid": "84bd289a6f690c17957493fb29c2dd53", "score": "0.39166415", "text": "func (t *Trade) Market() string {\n\treturn t.BaseCurrency + \"-\" + t.MarketCurrency\n}", "title": "" }, { "docid": "64fc5caee77c37edb101d450516400a1", "score": "0.39022318", "text": "func contextWithUserID(ctx context.Context, userID int64) context.Context {\n\tid := strconv.Itoa(int(userID))\n\tmd := metadata.Pairs(\n\t\tmiddleware.UserIDKey, id,\n\t)\n\n\treturn metadata.NewOutgoingContext(ctx, md)\n}", "title": "" }, { "docid": "8d72405528b20af0ddae7e0fd2e85e20", "score": "0.39019272", "text": "func GetCoinMarketChartData(c *gin.Context) {\n\tq := c.Request.URL.Query()\n\n\tif len(q[\"id\"]) <= 0 {\n\t\terrors.ErrRequiredParam(c.Writer, http.StatusBadRequest, \"'id' is not present\")\n\t\treturn\n\t}\n\n\tid := q[\"id\"][0]\n\n\t// Current time and its minus 24 hours\n\tto := time.Now().UTC()\n\tfrom := to.AddDate(0, 0, -1)\n\n\tmarketChartData, err := s.client.GetCoinMarketChartData(id, fmt.Sprintf(\"%d\", from.Unix()), fmt.Sprintf(\"%d\", to.Unix()))\n\tif err != nil {\n\t\ts.l.Printf(\"failed to fetch coin market chart data: %s\\n\", err)\n\t}\n\n\tmodels.Respond(c.Writer, marketChartData)\n\treturn\n}", "title": "" } ]
c8d43e65929deeba72ad4d0e0abfedd7
processSourceRow processes one row from the source for deletion and, if result rows are needed, saves it in the result row container
[ { "docid": "7d79a6bb857d943b343458a85861d316", "score": "0.7969829", "text": "func (d *deleteNode) processSourceRow(params runParams, sourceVals tree.Datums) error {\n\t// Create a set of partial index IDs to not delete from. Indexes should not\n\t// be deleted from when they are partial indexes and the row does not\n\t// satisfy the predicate and therefore do not exist in the partial index.\n\t// This set is passed as a argument to tableDeleter.row below.\n\tvar pm row.PartialIndexUpdateHelper\n\tif n := len(d.run.td.tableDesc().PartialIndexes()); n > 0 {\n\t\toffset := d.run.partialIndexDelValsOffset\n\t\tpartialIndexDelVals := sourceVals[offset : offset+n]\n\n\t\terr := pm.Init(tree.Datums{}, partialIndexDelVals, d.run.td.tableDesc())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Truncate sourceVals so that it no longer includes partial index\n\t\t// predicate values.\n\t\tsourceVals = sourceVals[:d.run.partialIndexDelValsOffset]\n\t}\n\n\t// Queue the deletion in the KV batch.\n\tif err := d.run.td.row(params.ctx, sourceVals, pm, d.run.traceKV); err != nil {\n\t\treturn err\n\t}\n\n\t// If result rows need to be accumulated, do it.\n\tif d.run.td.rows != nil {\n\t\t// The new values can include all columns, the construction of the\n\t\t// values has used execinfra.ScanVisibilityPublicAndNotPublic so the\n\t\t// values may contain additional columns for every newly dropped column\n\t\t// not visible. We do not want them to be available for RETURNING.\n\t\t//\n\t\t// d.run.rows.NumCols() is guaranteed to only contain the requested\n\t\t// public columns.\n\t\tresultValues := make(tree.Datums, d.run.td.rows.NumCols())\n\t\tfor i, retIdx := range d.run.rowIdxToRetIdx {\n\t\t\tif retIdx >= 0 {\n\t\t\t\tresultValues[retIdx] = sourceVals[i]\n\t\t\t}\n\t\t}\n\n\t\tif _, err := d.run.td.rows.AddRow(params.ctx, resultValues); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" } ]
[ { "docid": "8d10e033717520dd0d49cce6f67087ee", "score": "0.71663076", "text": "func (r *insertRun) processSourceRow(params runParams, rowVals tree.Datums) error {\n\tif err := enforceLocalColumnConstraints(rowVals, r.insertCols); err != nil {\n\t\treturn err\n\t}\n\n\t// Create a set of partial index IDs to not write to. Indexes should not be\n\t// written to when they are partial indexes and the row does not satisfy the\n\t// predicate. This set is passed as a parameter to tableInserter.row below.\n\tvar pm row.PartialIndexUpdateHelper\n\tif n := len(r.ti.tableDesc().PartialIndexes()); n > 0 {\n\t\toffset := len(r.insertCols) + r.checkOrds.Len()\n\t\tpartialIndexPutVals := rowVals[offset : offset+n]\n\n\t\terr := pm.Init(partialIndexPutVals, tree.Datums{}, r.ti.tableDesc())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Truncate rowVals so that it no longer includes partial index predicate\n\t\t// values.\n\t\trowVals = rowVals[:len(r.insertCols)+r.checkOrds.Len()]\n\t}\n\n\t// Verify the CHECK constraint results, if any.\n\tif !r.checkOrds.Empty() {\n\t\tcheckVals := rowVals[len(r.insertCols):]\n\t\tif err := checkMutationInput(\n\t\t\tparams.ctx, &params.p.semaCtx, r.ti.tableDesc(), r.checkOrds, checkVals,\n\t\t); err != nil {\n\t\t\treturn err\n\t\t}\n\t\trowVals = rowVals[:len(r.insertCols)]\n\t}\n\n\t// Queue the insert in the KV batch.\n\tif err := r.ti.row(params.ctx, rowVals, pm, r.traceKV); err != nil {\n\t\treturn err\n\t}\n\n\t// If result rows need to be accumulated, do it.\n\tif r.ti.rows != nil {\n\t\tfor i, val := range rowVals {\n\t\t\t// The downstream consumer will want the rows in the order of\n\t\t\t// the table descriptor, not that of insertCols. Reorder them\n\t\t\t// and ignore non-public columns.\n\t\t\tif tabIdx := r.rowIdxToTabColIdx[i]; tabIdx >= 0 {\n\t\t\t\tif retIdx := r.tabColIdxToRetIdx[tabIdx]; retIdx >= 0 {\n\t\t\t\t\tr.resultRowBuffer[retIdx] = val\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif _, err := r.ti.rows.AddRow(params.ctx, r.resultRowBuffer); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "7ed69f2cb32319017c5ca4f7c863fcf2", "score": "0.6387843", "text": "func (h *ProcOutputHelper) ProcessRow(\n\tctx context.Context, row rowenc.EncDatumRow,\n) (_ rowenc.EncDatumRow, moreRowsOK bool, _ error) {\n\tif h.rowIdx >= h.maxRowIdx {\n\t\treturn nil, false, nil\n\t}\n\n\th.rowIdx++\n\tif h.rowIdx <= h.offset {\n\t\t// Suppress row.\n\t\treturn nil, true, nil\n\t}\n\n\tif len(h.renderExprs) > 0 {\n\t\t// Rendering.\n\t\tfor i := range h.renderExprs {\n\t\t\tdatum, err := h.renderExprs[i].Eval(row)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, false, err\n\t\t\t}\n\t\t\th.outputRow[i] = rowenc.DatumToEncDatum(h.OutputTypes[i], datum)\n\t\t}\n\t} else if h.outputCols != nil {\n\t\t// Projection.\n\t\tfor i, col := range h.outputCols {\n\t\t\th.outputRow[i] = row[col]\n\t\t}\n\t} else {\n\t\t// No rendering or projection.\n\t\treturn row, h.rowIdx < h.maxRowIdx, nil\n\t}\n\n\t// If this row satisfies the limit, the caller is told to drain.\n\treturn h.outputRow, h.rowIdx < h.maxRowIdx, nil\n}", "title": "" }, { "docid": "0fc0080dcccbc80b37d100d2ebca497a", "score": "0.6384627", "text": "func (r *rows) handleRow(dest []driver.Value) {\n\trow := r.row\n\tr.row = nil\n\t//set up generic pointers to pull off each row\n\tpointers := make([]*spanner.GenericColumnValue, row.Size())\n\tfor i := 0; i < row.Size(); i++ {\n\t\tpointers[i] = new(spanner.GenericColumnValue)\n\t}\n\t// convert pointers to []interface{}\n\tinterfaces := make([]interface{}, len(pointers))\n\tfor i, v := range pointers {\n\t\tinterfaces[i] = v\n\t}\n\t//read all the columns from the row\n\trow.Columns(interfaces...)\n\tfor i, col := range pointers {\n\t\tdriverVal, err := r.valuer.ConvertGenericCol(col)\n\t\tif err != nil {\n\t\t\t// abort everything ever for this iterator\n\t\t\tr.err = err\n\t\t\treturn\n\t\t}\n\t\t//dest is the same size as columns, so we dont need to append\n\t\tdest[i] = driverVal\n\t}\n}", "title": "" }, { "docid": "42e905f7ad133a98b43e39c46d93d9b1", "score": "0.6112895", "text": "func (s *Sequencer) ProcessRow(r bigtable.Row) bool {\n\tkey, date := getMeta(r[\"meta\"])\n\tif s.currentSequence != nil && s.currentSequence.Key != key {\n\t\ts.output <- s.currentSequence\n\t\ts.currentSequence = nil\n\t}\n\tif s.currentSequence == nil {\n\t\ts.currentSequence = &Sequence{\n\t\t\tKey: key,\n\t\t\tSeq: make(map[time.Time]Datum),\n\t\t}\n\t}\n\ts.currentSequence.Seq[date] = getData(r[\"data\"])\n\treturn true\n}", "title": "" }, { "docid": "f59c13a635dd823ccfa0d825ad089027", "score": "0.5754354", "text": "func (cr *chunkReader) Process(cc *btpb.ReadRowsResponse_CellChunk) (Row, error) {\n\tvar row Row\n\tswitch cr.state {\n\tcase newRow:\n\t\tif err := cr.validateNewRow(cc); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tcr.curRow = make(Row)\n\t\tcr.curKey = cc.RowKey\n\t\tcr.curFam = cc.FamilyName.Value\n\t\tcr.curQual = cc.Qualifier.Value\n\t\tcr.curTS = cc.TimestampMicros\n\t\trow = cr.handleCellValue(cc)\n\n\tcase rowInProgress:\n\t\tif err := cr.validateRowInProgress(cc); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif cc.GetResetRow() {\n\t\t\tcr.resetToNewRow()\n\t\t\treturn nil, nil\n\t\t}\n\n\t\tif cc.FamilyName != nil {\n\t\t\tcr.curFam = cc.FamilyName.Value\n\t\t}\n\t\tif cc.Qualifier != nil {\n\t\t\tcr.curQual = cc.Qualifier.Value\n\t\t}\n\t\tcr.curTS = cc.TimestampMicros\n\t\trow = cr.handleCellValue(cc)\n\n\tcase cellInProgress:\n\t\tif err := cr.validateCellInProgress(cc); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif cc.GetResetRow() {\n\t\t\tcr.resetToNewRow()\n\t\t\treturn nil, nil\n\t\t}\n\t\trow = cr.handleCellValue(cc)\n\t}\n\n\treturn row, nil\n}", "title": "" }, { "docid": "9e06af2c09ce1e4a3577702c2daafd34", "score": "0.5652421", "text": "func (r *resultRow) primarySrcRow() int64 {\n\tval, _ := unpackNextRow(r.srcrows[:])\n\treturn val\n}", "title": "" }, { "docid": "9626e656f8703235751e2478026b6c2f", "score": "0.5638474", "text": "func (t *Table) ProcessRow(w io.Writer, record []string) {\n\ts := t.ColorAllRows() // move to table bg\n\t// Process Records\n\ts += t.ProcessRecord(w, record)\n\t// every nth row\n\ts += t.GetEveryNRow()\n\tif t.currentline == 6 {\n\t\ts += t.GetEveryRow()\n\t}\n\tfmt.Fprint(w, s)\n}", "title": "" }, { "docid": "8524b997bb8e33534f2dda697bb7856f", "score": "0.5610103", "text": "func (pb *ProcessorBase) ProcessRowHelper(row rowenc.EncDatumRow) rowenc.EncDatumRow {\n\toutRow, ok, err := pb.Out.ProcessRow(pb.Ctx, row)\n\tif err != nil {\n\t\tpb.MoveToDraining(err)\n\t\treturn nil\n\t}\n\tif !ok {\n\t\tpb.MoveToDraining(nil /* err */)\n\t}\n\t// Note that outRow might be nil here.\n\t// TODO(yuzefovich): there is a problem with this logging when MetadataTest*\n\t// processors are planned - there is a mismatch between the row and the\n\t// output types (rendering is added to the stage of test processors and the\n\t// actual processors that are inputs to the test ones have an unset post\n\t// processing; I think that we need to set the post processing on the stages\n\t// of processors below the test ones).\n\t//if outRow != nil && log.V(3) && pb.Ctx != nil {\n\t//\tlog.InfofDepth(pb.Ctx, 1, \"pushing row %s\", outRow.String(pb.Out.OutputTypes))\n\t//}\n\treturn outRow\n}", "title": "" }, { "docid": "5f3ceefdd7f3991b5a02bde356dc42af", "score": "0.54746354", "text": "func (s *BaseCSVListener) ExitRow(ctx *RowContext) {}", "title": "" }, { "docid": "d127d01ab41e336dc79d02b58613dbff", "score": "0.5387724", "text": "func Run(ctx context.Context, src RowSource, dst RowReceiver) {\n\tfor {\n\t\trow, meta := src.Next()\n\t\t// Emit the row; stop if no more rows are needed.\n\t\tif row != nil || meta != nil {\n\t\t\tswitch dst.Push(row, meta) {\n\t\t\tcase NeedMoreRows:\n\t\t\t\tcontinue\n\t\t\tcase DrainRequested:\n\t\t\t\tDrainAndForwardMetadata(ctx, src, dst)\n\t\t\t\tdst.ProducerDone()\n\t\t\t\treturn\n\t\t\tcase ConsumerClosed:\n\t\t\t\tsrc.ConsumerClosed()\n\t\t\t\tdst.ProducerDone()\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\t// row == nil && meta == nil: the source has been fully drained.\n\t\tdst.ProducerDone()\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "8f1c00adc0a0819350d02f814fc766c9", "score": "0.5353478", "text": "func process(row Row) {\n\tif row.Error != nil {\n\t\tisError = true\n\t}\n}", "title": "" }, { "docid": "51b228d3f39a9f372f87e5af02fd713a", "score": "0.53382283", "text": "func (s *Sink) UpdateRows(tx *sql.Tx, prev ResolvedLine, next ResolvedLine) error {\n\t// First, gather all the rows to update.\n\tlines, err := FindAllRowsToUpdate(tx, s.sinkTableFullName, prev, next)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif len(lines) == 0 {\n\t\treturn nil\n\t}\n\n\tlog.Printf(\"%s: %s executed %d operations\", s.endpoint, s.sinkTableFullName, len(lines))\n\n\t// TODO: Batch these by 100 rows? Not sure what the max should be.\n\n\tvar upserts []Line\n\tvar deletes []Line\n\n\t// This must happen in reverse order and all keys must be kept track of.\n\t// This way, we can ensure that more recent changes overwrite earlier ones\n\t// without having to perform multiple upserts/deletes to the db.\n\tusedKeys := make(map[string]struct{})\n\tfor i := len(lines) - 1; i >= 0; i-- {\n\t\tline := lines[i]\n\n\t\t// Did we updates this line already? If so, don't perform this update.\n\t\tif _, exist := usedKeys[line.key]; exist {\n\t\t\tcontinue\n\t\t}\n\t\tusedKeys[line.key] = struct{}{}\n\n\t\t// Parse the key into columns\n\t\t// Large numbers are not turned into strings, so the UseNumber option for\n\t\t// the decoder is required.\n\t\tdec := json.NewDecoder(strings.NewReader(line.key))\n\t\tdec.UseNumber()\n\t\tif err := dec.Decode(&(line.Key)); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Is this needed? What if we have 2 primary key columns but the 2nd one\n\t\t// nullable or has a default? Does CDC send it?\n\t\tif len(line.Key) != len(s.primaryKeyColumns) {\n\t\t\treturn fmt.Errorf(\n\t\t\t\t\"table %s has %d primary key columns %v, but only got %d keys %v\",\n\t\t\t\ts.resultTableFullName,\n\t\t\t\tlen(s.primaryKeyColumns),\n\t\t\t\ts.primaryKeyColumns,\n\t\t\t\tlen(line.Key),\n\t\t\t\tline.Key,\n\t\t\t)\n\t\t}\n\n\t\t// Is this a delete?\n\t\tif line.after == \"null\" {\n\t\t\tdeletes = append(deletes, line)\n\t\t} else {\n\t\t\t// This must be an upsert statement.\n\t\t\tupserts = append(upserts, line)\n\t\t}\n\t}\n\n\t// Delete all rows\n\tif err := s.deleteRows(tx, deletes); err != nil {\n\t\treturn err\n\t}\n\n\t// Upsert all rows\n\tif err := s.upsertRows(tx, upserts); err != nil {\n\t\treturn err\n\t}\n\n\t// Delete the rows in the sink table.\n\treturn DeleteSinkTableLines(tx, s.sinkTableFullName, prev, next)\n}", "title": "" }, { "docid": "a405e419c8823a48cb5b0b378aa1c698", "score": "0.53335285", "text": "func scanRow(scanner db.Scanner, dest *core.Stage) error {\n\tdepJSON := types.JSONText{}\n\tlabJSON := types.JSONText{}\n\terr := scanner.Scan(\n\t\t&dest.ID,\n\t\t&dest.RepoID,\n\t\t&dest.BuildID,\n\t\t&dest.Number,\n\t\t&dest.Name,\n\t\t&dest.Kind,\n\t\t&dest.Type,\n\t\t&dest.Status,\n\t\t&dest.Error,\n\t\t&dest.ErrIgnore,\n\t\t&dest.ExitCode,\n\t\t&dest.Limit,\n\t\t&dest.OS,\n\t\t&dest.Arch,\n\t\t&dest.Variant,\n\t\t&dest.Kernel,\n\t\t&dest.Machine,\n\t\t&dest.Started,\n\t\t&dest.Stopped,\n\t\t&dest.Created,\n\t\t&dest.Updated,\n\t\t&dest.Version,\n\t\t&dest.OnSuccess,\n\t\t&dest.OnFailure,\n\t\t&depJSON,\n\t\t&labJSON,\n\t)\n\tjson.Unmarshal(depJSON, &dest.DependsOn)\n\tjson.Unmarshal(labJSON, &dest.Labels)\n\treturn err\n}", "title": "" }, { "docid": "ee186ddc7492bc26fe101426e5788a0e", "score": "0.5322511", "text": "func processRows(rows *sql.Rows, callback ProcessRow) {\n\tdefer rows.Close() //nolint\n\tcolumnNames, err := rows.Columns()\n\tif err != nil {\n\t\tcallback(Row{Error: fmt.Errorf(\"Failed to find column %+v\", err)})\n\t\treturn\n\t}\n\n\tcolCount := len(columnNames)\n\tcolumnValues := make([]interface{}, colCount)\n\tcolumnPtrs := make([]interface{}, colCount)\n\n\tfor rows.Next() {\n\t\tfor i := 0; i < colCount; i++ {\n\t\t\tcolumnPtrs[i] = &columnValues[i]\n\t\t}\n\t\terr = rows.Scan(columnPtrs...)\n\t\tif err != nil {\n\t\t\tcallback(Row{Error: err})\n\t\t\tcontinue\n\t\t}\n\n\t\tcolumns := make([]Column, colCount)\n\t\tfor i := 0; i < colCount; i++ {\n\t\t\tcolumns[i] = Column{Name: columnNames[i], Value: columnValues[i]}\n\t\t}\n\t\tcallback(Row{Columns: columns})\n\t}\n}", "title": "" }, { "docid": "a4d9e0c94a973aab3dad5d21d5d65f8f", "score": "0.53015655", "text": "func scanRow(scanner db.Scanner, dest *core.DataBase) error {\n\treturn scanner.Scan(\n\t\t&dest.ID,\n\t\t&dest.Name,\n\t\t&dest.PID,\n\t\t&dest.Title,\n\t\t&dest.Description,\n\t\t&dest.Created,\n\t\t&dest.Updated,\n\t)\n}", "title": "" }, { "docid": "f9109be96015d3cfc67bbf86e1c1e863", "score": "0.5274996", "text": "func (w *Worker) processResult(ctx context.Context, obj *Object, rh *string, res *TransferResult) {\n\t// log.Println(\"Processing result...\")\n\n\tlog.Printf(\"----->Transferred 1 object %s with status %s\\n\", obj.Key, res.status)\n\tw.db.UpdateItem(ctx, &obj.Key, res)\n\n\tif res.status == \"DONE\" || res.status == \"CANCEL\" {\n\t\tw.sqs.DeleteMessage(ctx, rh)\n\t}\n}", "title": "" }, { "docid": "8443c2530e6debfa7c7f574f03f48d40", "score": "0.51648897", "text": "func (s *Sink) deleteRows(tx *sql.Tx, lines []Line) error {\n\tif len(lines) == 0 {\n\t\treturn nil\n\t}\n\n\tvar chunks [][]Line\n\tfor i := 0; i < len(lines); i += chunkSize {\n\t\tend := i + chunkSize\n\t\tif end > len(lines) {\n\t\t\tend = len(lines)\n\t\t}\n\t\tchunks = append(chunks, lines[i:end])\n\t}\n\n\tfor _, chunk := range chunks {\n\t\t// Build the statement.\n\t\tvar statement strings.Builder\n\t\tfmt.Fprintf(&statement, \"DELETE FROM %s WHERE (\", s.resultTableFullName)\n\t\tfor i, column := range s.primaryKeyColumns {\n\t\t\tif i > 0 {\n\t\t\t\tfmt.Fprint(&statement, \",\")\n\t\t\t}\n\t\t\t// Placeholder index always starts at 1.\n\t\t\tfmt.Fprintf(&statement, \"%s\", column)\n\t\t}\n\t\tfmt.Fprintf(&statement, \") IN (\")\n\t\tvar keys []interface{}\n\t\tfor i, line := range chunk {\n\t\t\tif i > 0 {\n\t\t\t\tfmt.Fprintf(&statement, \",\")\n\t\t\t}\n\t\t\tfmt.Fprintf(&statement, \"(\")\n\t\t\tfor _, key := range line.Key {\n\t\t\t\tkeys = append(keys, key)\n\t\t\t\tfmt.Fprintf(&statement, \"$%d\", len(keys))\n\t\t\t}\n\t\t\tfmt.Fprintf(&statement, \")\")\n\t\t}\n\t\tfmt.Fprintf(&statement, \")\")\n\n\t\t// Upsert the line\n\t\tif _, err := tx.Exec(statement.String(), keys...); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6d067f129044b834eee1678b3030ab1d", "score": "0.51334107", "text": "func processOneLine(db *sql.DB, line string) error {\n\t// Issues a query and examine returned Rows.\n\trows, err := db.Query(line)\n\tif err != nil {\n\t\treturn util.Errorf(\"query error: %s\", err)\n\t}\n\n\tdefer rows.Close()\n\tcols, err := rows.Columns()\n\tif err != nil {\n\t\treturn util.Errorf(\"rows.Columns() error: %s\", err)\n\t}\n\n\tif len(cols) == 0 {\n\t\t// This operation did not return rows, just show success.\n\t\tfmt.Printf(\"OK\\n\")\n\t\treturn nil\n\t}\n\n\ttable := tablewriter.NewWriter(os.Stdout)\n\ttable.SetHeader(cols)\n\n\tvals := make([]interface{}, len(cols))\n\trowStrings := make([]string, len(cols))\n\tfor rows.Next() {\n\t\tfor i := range vals {\n\t\t\tvals[i] = new(sql.NullString)\n\t\t}\n\t\tif err := rows.Scan(vals...); err != nil {\n\t\t\treturn util.Errorf(\"scan error: %s\", err)\n\t\t}\n\t\tfor i, v := range vals {\n\t\t\tnullStr := v.(*sql.NullString)\n\t\t\tif nullStr.Valid {\n\t\t\t\trowStrings[i] = nullStr.String\n\t\t\t} else {\n\t\t\t\trowStrings[i] = \"NULL\"\n\t\t\t}\n\t\t}\n\t\t// tablewriter.Append always returns nil.\n\t\t_ = table.Append(rowStrings)\n\t}\n\n\ttable.Render()\n\n\treturn nil\n}", "title": "" }, { "docid": "808c7cb1179a2021d620fc410db63773", "score": "0.5078694", "text": "func (p *ProcessReader) ReadRow(row []interface{}) ([]interface{}, error) {\n\treturn nil, io.EOF\n}", "title": "" }, { "docid": "6f33a751433a7691e6f2b820f3526b28", "score": "0.5026329", "text": "func genFilteredRow(resultApi *whisk.RetApi, apiPath string, apiVerb string, maxActionNameSize int, maxApiNameSize int) []whisk.ApiFilteredRow {\n\tvar orderInfo whisk.ApiFilteredRow\n\tvar orderInfoArr []whisk.ApiFilteredRow\n\tbaseUrl := strings.TrimSuffix(resultApi.BaseUrl, \"/\")\n\tapiName := resultApi.Swagger.Info.Title\n\tbasePath := resultApi.Swagger.BasePath\n\tif resultApi.Swagger != nil && resultApi.Swagger.Paths != nil {\n\t\tfor path := range resultApi.Swagger.Paths {\n\t\t\twhisk.Debug(whisk.DbgInfo, \"genFilteredRow: comparing api relpath: '%s'\\n\", path)\n\t\t\tif len(apiPath) == 0 || path == apiPath {\n\t\t\t\twhisk.Debug(whisk.DbgInfo, \"genFilteredRow: relpath matches\\n\")\n\t\t\t\tfor op, opv := range resultApi.Swagger.Paths[path].MakeOperationMap() {\n\t\t\t\t\twhisk.Debug(whisk.DbgInfo, \"genFilteredRow: comparing operation: '%s'\\n\", op)\n\t\t\t\t\tif len(apiVerb) == 0 || strings.ToLower(op) == strings.ToLower(apiVerb) {\n\t\t\t\t\t\twhisk.Debug(whisk.DbgInfo, \"genFilteredRow: operation matches: %#v\\n\", opv)\n\t\t\t\t\t\tvar actionName string\n\t\t\t\t\t\tif opv.XOpenWhisk == nil {\n\t\t\t\t\t\t\tactionName = \"\"\n\t\t\t\t\t\t} else if len(opv.XOpenWhisk.Package) > 0 {\n\t\t\t\t\t\t\tactionName = \"/\" + opv.XOpenWhisk.Namespace + \"/\" + opv.XOpenWhisk.Package + \"/\" + opv.XOpenWhisk.ActionName\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tactionName = \"/\" + opv.XOpenWhisk.Namespace + \"/\" + opv.XOpenWhisk.ActionName\n\t\t\t\t\t\t}\n\t\t\t\t\t\torderInfo = AssignRowInfo(actionName[0:min(len(actionName), maxActionNameSize)], op, apiName[0:min(len(apiName), maxApiNameSize)], basePath, path, baseUrl+path)\n\t\t\t\t\t\torderInfo.FmtString = fmtString\n\t\t\t\t\t\twhisk.Debug(whisk.DbgInfo, \"Appening to orderInfoArr: %s\\n\", orderInfo.RelPath)\n\t\t\t\t\t\torderInfoArr = append(orderInfoArr, orderInfo)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn orderInfoArr\n}", "title": "" }, { "docid": "381f36d7c029edf9effdada1e3c10e04", "score": "0.5026265", "text": "func GetScrubResultRows(rows *gosql.Rows) (results []ScrubResult, err error) {\n\tdefer rows.Close()\n\n\tvar unused *string\n\tfor rows.Next() {\n\t\tresult := ScrubResult{}\n\t\tif err := rows.Scan(\n\t\t\t// TODO(joey): In the future, SCRUB will run as a job during execution.\n\t\t\t&unused, /* job_uuid */\n\t\t\t&result.ErrorType,\n\t\t\t&result.Database,\n\t\t\t&result.Table,\n\t\t\t&result.PrimaryKey,\n\t\t\t&result.Timestamp,\n\t\t\t&result.Repaired,\n\t\t\t&result.Details,\n\t\t); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresults = append(results, result)\n\t}\n\n\tif rows.Err() != nil {\n\t\treturn nil, err\n\t}\n\n\treturn results, nil\n}", "title": "" }, { "docid": "381f36d7c029edf9effdada1e3c10e04", "score": "0.5026265", "text": "func GetScrubResultRows(rows *gosql.Rows) (results []ScrubResult, err error) {\n\tdefer rows.Close()\n\n\tvar unused *string\n\tfor rows.Next() {\n\t\tresult := ScrubResult{}\n\t\tif err := rows.Scan(\n\t\t\t// TODO(joey): In the future, SCRUB will run as a job during execution.\n\t\t\t&unused, /* job_uuid */\n\t\t\t&result.ErrorType,\n\t\t\t&result.Database,\n\t\t\t&result.Table,\n\t\t\t&result.PrimaryKey,\n\t\t\t&result.Timestamp,\n\t\t\t&result.Repaired,\n\t\t\t&result.Details,\n\t\t); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresults = append(results, result)\n\t}\n\n\tif rows.Err() != nil {\n\t\treturn nil, err\n\t}\n\n\treturn results, nil\n}", "title": "" }, { "docid": "5f2eded37c289c60abe18ea3c5b29c9e", "score": "0.49581984", "text": "func (s *BaseGherkinListener) ExitRow(ctx *RowContext) { log.Print(\"ExitRow\") }", "title": "" }, { "docid": "ca5ff851e24fd758ef5afb6df07b0ae4", "score": "0.49204326", "text": "func (t *TableCommon) RemoveRecord(ctx sessionctx.Context, h kv.Handle, r []types.Datum) error {\n\ttxn, err := ctx.Txn(true)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmemBuffer := txn.GetMemBuffer()\n\tsh := memBuffer.Staging()\n\tdefer memBuffer.Cleanup(sh)\n\n\tlogutil.BgLogger().Debug(\"RemoveRecord\",\n\t\tzap.Stringer(\"key\", t.RecordKey(h)))\n\terr = t.removeRowData(ctx, h)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif m := t.Meta(); m.TempTableType != model.TempTableNone {\n\t\tif tmpTable := addTemporaryTable(ctx, m); tmpTable != nil {\n\t\t\tif err := checkTempTableSize(ctx, tmpTable, m); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tdefer handleTempTableSize(tmpTable, txn.Size(), txn)\n\t\t}\n\t}\n\n\t// The table has non-public column and this column is doing the operation of \"modify/change column\".\n\tif len(t.Columns) > len(r) && t.Columns[len(r)].ChangeStateInfo != nil {\n\t\t// The changing column datum derived from related column should be casted here.\n\t\t// Otherwise, the existed changing indexes will not be deleted.\n\t\trelatedColDatum := r[t.Columns[len(r)].ChangeStateInfo.DependencyColumnOffset]\n\t\tvalue, err := table.CastValue(ctx, relatedColDatum, t.Columns[len(r)].ColumnInfo, false, false)\n\t\tif err != nil {\n\t\t\tlogutil.BgLogger().Info(\"remove record cast value failed\", zap.Any(\"col\", t.Columns[len(r)]),\n\t\t\t\tzap.String(\"handle\", h.String()), zap.Any(\"val\", relatedColDatum), zap.Error(err))\n\t\t\treturn err\n\t\t}\n\t\tr = append(r, value)\n\t}\n\terr = t.removeRowIndices(ctx, h, r)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tsessVars := ctx.GetSessionVars()\n\tsc := sessVars.StmtCtx\n\tif err = injectMutationError(t, txn, sh); err != nil {\n\t\treturn err\n\t}\n\tif sessVars.EnableMutationChecker {\n\t\tif err = CheckDataConsistency(txn, sessVars, t, nil, r, memBuffer, sh); err != nil {\n\t\t\treturn errors.Trace(err)\n\t\t}\n\t}\n\tmemBuffer.Release(sh)\n\n\tif shouldWriteBinlog(ctx, t.meta) {\n\t\tcols := t.Cols()\n\t\tcolIDs := make([]int64, 0, len(cols)+1)\n\t\tfor _, col := range cols {\n\t\t\tcolIDs = append(colIDs, col.ID)\n\t\t}\n\t\tvar binlogRow []types.Datum\n\t\tif !t.meta.PKIsHandle && !t.meta.IsCommonHandle {\n\t\t\tcolIDs = append(colIDs, model.ExtraHandleID)\n\t\t\tbinlogRow = make([]types.Datum, 0, len(r)+1)\n\t\t\tbinlogRow = append(binlogRow, r...)\n\t\t\thandleData, err := h.Data()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tbinlogRow = append(binlogRow, handleData...)\n\t\t} else {\n\t\t\tbinlogRow = r\n\t\t}\n\t\terr = t.addDeleteBinlog(ctx, binlogRow, colIDs)\n\t}\n\tif ctx.GetSessionVars().TxnCtx == nil {\n\t\treturn nil\n\t}\n\tcolSize := make(map[int64]int64, len(t.Cols()))\n\tfor id, col := range t.Cols() {\n\t\tsize, err := codec.EstimateValueSize(sc, r[id])\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\t\tcolSize[col.ID] = -int64(size - 1)\n\t}\n\tctx.GetSessionVars().TxnCtx.UpdateDeltaForTable(t.physicalTableID, -1, 1, colSize)\n\treturn err\n}", "title": "" }, { "docid": "784815d1b6654f7e1f4c79a8c32891b6", "score": "0.4907889", "text": "func (s *BaseCSVListener) EnterRow(ctx *RowContext) {}", "title": "" }, { "docid": "aa9b37cb36a56e88e43a0cbfc54901e5", "score": "0.48566297", "text": "func (rs *NoMetadataRowSource) NextRow() (rowenc.EncDatumRow, error) {\n\tfor {\n\t\trow, meta := rs.src.Next()\n\t\tif meta == nil {\n\t\t\treturn row, nil\n\t\t}\n\t\tif meta.Err != nil {\n\t\t\treturn nil, meta.Err\n\t\t}\n\t\t// We forward the metadata and ignore the returned ConsumerStatus. There's\n\t\t// no good way to use that status here; eventually the consumer of this\n\t\t// NoMetadataRowSource will figure out the same status and act on it as soon\n\t\t// as a non-metadata row is received.\n\t\t_ = rs.metadataSink.Push(nil /* row */, meta)\n\t}\n}", "title": "" }, { "docid": "6383e02a442b135fc0d1c526dd746fd2", "score": "0.48452616", "text": "func (tm *TableManager) MatchSource(ctx context.Context, db dbh, rowSource *TableSource) error {\n\tmetricTable := tm.table(rowSource.Name())\n\tvar tagTable *tableState\n\tif tm.TagsAsForeignKeys {\n\t\ttagTable = tm.table(metricTable.name + tm.TagTableSuffix)\n\n\t\tmissingCols, err := tm.EnsureStructure(\n\t\t\tctx,\n\t\t\tdb,\n\t\t\ttagTable,\n\t\t\trowSource.TagTableColumns(),\n\t\t\ttm.TagTableCreateTemplates,\n\t\t\ttm.TagTableAddColumnTemplates,\n\t\t\tmetricTable,\n\t\t\ttagTable,\n\t\t)\n\t\tif err != nil {\n\t\t\tif isTempError(err) {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\ttm.Postgresql.Logger.Errorf(\"Permanent error updating schema for %s: %v\", tagTable.name, err)\n\t\t}\n\n\t\tif len(missingCols) > 0 {\n\t\t\tcolDefs := make([]string, 0, len(missingCols))\n\t\t\tfor _, col := range missingCols {\n\t\t\t\tif err := rowSource.DropColumn(col); err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"metric/table mismatch: Unable to omit field/column from %q: %w\", tagTable.name, err)\n\t\t\t\t}\n\t\t\t\tcolDefs = append(colDefs, col.Name+\" \"+col.Type)\n\t\t\t}\n\t\t\ttm.Logger.Errorf(\"Table %q is missing tag columns (dropping metrics): %s\",\n\t\t\t\ttagTable.name,\n\t\t\t\tstrings.Join(colDefs, \", \"))\n\t\t}\n\t}\n\n\tmissingCols, err := tm.EnsureStructure(\n\t\tctx,\n\t\tdb,\n\t\tmetricTable,\n\t\trowSource.MetricTableColumns(),\n\t\ttm.CreateTemplates,\n\t\ttm.AddColumnTemplates,\n\t\tmetricTable,\n\t\ttagTable,\n\t)\n\tif err != nil {\n\t\tif isTempError(err) {\n\t\t\treturn err\n\t\t}\n\t\ttm.Postgresql.Logger.Errorf(\"Permanent error updating schema for %s: %v\", metricTable.name, err)\n\t}\n\n\tif len(missingCols) > 0 {\n\t\tcolDefs := make([]string, 0, len(missingCols))\n\t\tfor _, col := range missingCols {\n\t\t\tif err := rowSource.DropColumn(col); err != nil {\n\t\t\t\treturn fmt.Errorf(\"metric/table mismatch: Unable to omit field/column from %q: %w\", metricTable.name, err)\n\t\t\t}\n\t\t\tcolDefs = append(colDefs, col.Name+\" \"+col.Type)\n\t\t}\n\t\ttm.Logger.Errorf(\"Table %q is missing columns (omitting fields): %s\",\n\t\t\tmetricTable.name,\n\t\t\tstrings.Join(colDefs, \", \"))\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "4797c2931f21dead4dfe5de5286aa1ec", "score": "0.48382813", "text": "func (s *cloudStorageSink) EmitRow(\n\tctx context.Context, topic TopicDescriptor, key, value []byte, updated hlc.Timestamp,\n) error {\n\tif s.files == nil {\n\t\treturn errors.New(`cannot EmitRow on a closed sink`)\n\t}\n\n\tfile := s.getOrCreateFile(topic)\n\n\toldCap := file.buf.Cap()\n\tif _, err := file.Write(value); err != nil {\n\t\treturn err\n\t}\n\tif _, err := file.Write(s.rowDelimiter); err != nil {\n\t\treturn err\n\t}\n\n\t// Grow buffered memory. It's okay that we do it after the fact\n\t// (and if not, we're in a deeper problem and probably OOMed by now).\n\tif err := s.mem.Grow(ctx, int64(file.buf.Cap()-oldCap)); err != nil {\n\t\treturn err\n\t}\n\n\tif int64(file.buf.Len()) > s.targetMaxFileSize {\n\t\tif err := s.flushTopicVersions(ctx, file.topic, file.schemaID); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cded15950700ebea889edd641821c2c8", "score": "0.48240897", "text": "func (s *BaseSqlBase4GoListener) ExitCurrentRowBound(ctx *CurrentRowBoundContext) {}", "title": "" }, { "docid": "d9f60505a4195f8d43adbb9e9abec1e4", "score": "0.47911692", "text": "func (o *Optimist) handleSourceTables(ctx context.Context, sourceCh <-chan optimism.SourceTables) {\n\tfor {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn\n\t\tcase st, ok := <-sourceCh:\n\t\t\tif !ok {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tupdated := o.tk.Update(st)\n\t\t\to.logger.Info(\"receive source tables\", zap.Stringer(\"source tables\", st),\n\t\t\t\tzap.Bool(\"is deleted\", st.IsDeleted), zap.Bool(\"updated\", updated))\n\t\t}\n\t}\n}", "title": "" }, { "docid": "27d18d0c4f2327c68bfb8653c096dc61", "score": "0.47840822", "text": "func (conn *SQLite) RemoveSource(source_id int64) error {\n\terr := conn.OpenConnection(helper.GetDatabaseFile())\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar cnt int = 0\n\n\tstmt := `SELECT count(*) as cnt FROM source WHERE id = ?`\n\n\trow := conn.db.QueryRow(stmt, source_id)\n\n\terr = row.Scan(&cnt)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif cnt != 0 {\n\t\t_, err = conn.db.Exec(`DELETE FROM source WHERE id=?`, source_id)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfmt.Println(\"Source was removed succesfuly.\")\n\n\t\treturn nil\n\t}\n\n\treturn errors.New(\"Source record with given name could not be found.\")\n}", "title": "" }, { "docid": "578effe5356f82c9555a919d1789d166", "score": "0.4780669", "text": "func (gas *Analyzer) ProcessSource(filename string, source string) error {\n\terr := gas.process(filename, source)\n\tfun := func(f *token.File) bool {\n\t\tgas.Stats.NumLines += f.LineCount()\n\t\treturn true\n\t}\n\tgas.context.FileSet.Iterate(fun)\n\treturn err\n}", "title": "" }, { "docid": "e56958338cc2fc9f80fc7f1945dbe794", "score": "0.4772526", "text": "func ProcessInboundStream(\n\tflowCtx *FlowCtx, stream DistSQL_FlowStreamServer, firstMsg *StreamMessage, dst RowReceiver,\n) error {\n\tctx := flowCtx.Context\n\t// Function which we call when we are done.\n\tfinish := func(err error) error {\n\t\tdst.Close(err)\n\t\tif err != nil {\n\t\t\tif log.V(1) {\n\t\t\t\tlog.Errorf(ctx, \"inbound stream error: %s\", err)\n\t\t\t}\n\t\t\t// TODO(radu): populate response and send error instead\n\t\t\treturn err\n\t\t}\n\t\tif log.V(2) {\n\t\t\tlog.Infof(ctx, \"inbound stream done\")\n\t\t}\n\t\treturn stream.SendAndClose(&SimpleResponse{})\n\t}\n\n\tvar sd StreamDecoder\n\tfor {\n\t\tvar msg *StreamMessage\n\t\tif firstMsg != nil {\n\t\t\tmsg = firstMsg\n\t\t\tfirstMsg = nil\n\t\t} else {\n\t\t\tvar err error\n\t\t\tmsg, err = stream.Recv()\n\t\t\tif err != nil {\n\t\t\t\tif err != io.EOF {\n\t\t\t\t\t// Communication error.\n\t\t\t\t\tdst.Close(err)\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\t// End of the stream.\n\t\t\t\treturn finish(nil)\n\t\t\t}\n\t\t}\n\t\terr := sd.AddMessage(msg)\n\t\tif err != nil {\n\t\t\treturn finish(err)\n\t\t}\n\t\tfor {\n\t\t\trow, err := sd.GetRow(nil)\n\t\t\tif err != nil {\n\t\t\t\treturn finish(err)\n\t\t\t}\n\t\t\tif row == nil {\n\t\t\t\t// No more rows in the last message.\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif log.V(3) {\n\t\t\t\tlog.Infof(ctx, \"inbound stream pushing row %s\\n\", row)\n\t\t\t}\n\t\t\tif !dst.PushRow(row) {\n\t\t\t\t// Rest of rows not needed.\n\t\t\t\treturn finish(nil)\n\t\t\t}\n\t\t}\n\t\tdone, err := sd.IsDone()\n\t\tif done {\n\t\t\treturn finish(err)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0e946bcd1a52bbfd137f2d269609117c", "score": "0.4744658", "text": "func CopyPasteRow(fromRow, toRow []byte, fromStartIdx, toStartIdx, width int) []byte {\n\tfromEndIdx := fromStartIdx + width\n\n\tfor fromStartIdx < fromEndIdx {\n\t\tif IsSetInRow(fromRow, fromStartIdx) {\n\t\t\tSetInRow(toRow, toStartIdx)\n\t\t} else {\n\t\t\tUnsetInRow(toRow, toStartIdx)\n\t\t}\n\t\tfromStartIdx++\n\t\ttoStartIdx++\n\t}\n\treturn toRow\n}", "title": "" }, { "docid": "9aa5e1bb1bd8681d45128e33f806de58", "score": "0.47262216", "text": "func (p *cteProducer) deduplicate(chk *chunk.Chunk,\n\tstorage cteutil.Storage,\n\thashTbl baseHashTable) (chkNoDup *chunk.Chunk, err error) {\n\tnumRows := chk.NumRows()\n\tif numRows == 0 {\n\t\treturn chk, nil\n\t}\n\n\t// 1. Compute hash values for chunk.\n\tchkHashTbl := newConcurrentMapHashTable()\n\tselOri, err := p.computeChunkHash(chk)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// 2. Filter rows duplicated in input chunk.\n\t// This sel is for filtering rows duplicated in cur chk.\n\tselChk := make([]int, 0, numRows)\n\tfor i := 0; i < numRows; i++ {\n\t\tkey := p.hCtx.hashVals[selOri[i]].Sum64()\n\t\trow := chk.GetRow(i)\n\n\t\thasDup, err := p.checkHasDup(key, row, chk, storage, chkHashTbl)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif hasDup {\n\t\t\tcontinue\n\t\t}\n\n\t\tselChk = append(selChk, selOri[i])\n\n\t\trowPtr := chunk.RowPtr{ChkIdx: uint32(0), RowIdx: uint32(i)}\n\t\tchkHashTbl.Put(key, rowPtr)\n\t}\n\tchk.SetSel(selChk)\n\tchkIdx := storage.NumChunks()\n\n\t// 3. Filter rows duplicated in RowContainer.\n\t// This sel is for filtering rows duplicated in cteutil.Storage.\n\tselStorage := make([]int, 0, len(selChk))\n\tfor i := 0; i < len(selChk); i++ {\n\t\tkey := p.hCtx.hashVals[selChk[i]].Sum64()\n\t\trow := chk.GetRow(i)\n\n\t\thasDup, err := p.checkHasDup(key, row, nil, storage, hashTbl)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif hasDup {\n\t\t\tcontinue\n\t\t}\n\n\t\trowIdx := len(selStorage)\n\t\tselStorage = append(selStorage, selChk[i])\n\n\t\trowPtr := chunk.RowPtr{ChkIdx: uint32(chkIdx), RowIdx: uint32(rowIdx)}\n\t\thashTbl.Put(key, rowPtr)\n\t}\n\n\tchk.SetSel(selStorage)\n\treturn chk, nil\n}", "title": "" }, { "docid": "7ce69ec9d824ed890460133a0c09b506", "score": "0.47101408", "text": "func (h *ProcOutputHelper) EmitRow(\n\tctx context.Context, row rowenc.EncDatumRow,\n) (ConsumerStatus, error) {\n\tif h.output == nil {\n\t\tpanic(\"output RowReceiver not initialized for emitting rows\")\n\t}\n\n\toutRow, ok, err := h.ProcessRow(ctx, row)\n\tif err != nil {\n\t\t// The status doesn't matter.\n\t\treturn NeedMoreRows, err\n\t}\n\tif outRow == nil {\n\t\tif ok {\n\t\t\treturn NeedMoreRows, nil\n\t\t}\n\t\treturn DrainRequested, nil\n\t}\n\n\tif log.V(3) {\n\t\tlog.InfofDepth(ctx, 1, \"pushing row %s\", outRow.String(h.OutputTypes))\n\t}\n\tif r := h.output.Push(outRow, nil); r != NeedMoreRows {\n\t\tlog.VEventf(ctx, 1, \"no more rows required. drain requested: %t\",\n\t\t\tr == DrainRequested)\n\t\treturn r, nil\n\t}\n\tif h.rowIdx == h.maxRowIdx {\n\t\tlog.VEventf(ctx, 1, \"hit row limit; asking producer to drain\")\n\t\treturn DrainRequested, nil\n\t}\n\tstatus := NeedMoreRows\n\tif !ok {\n\t\tstatus = DrainRequested\n\t}\n\treturn status, nil\n}", "title": "" }, { "docid": "3be23f72de57ba43133977f84330dfdf", "score": "0.47078884", "text": "func processRawResult(log logrus.FieldLogger, result *fetchResult) *processedResult {\n\n\tmultiActionResults := collateRawResults(log, result)\n\tsingleActionResults := isolateActions(log, multiActionResults)\n\n\treturn &processedResult{result.Invocation, singleActionResults}\n}", "title": "" }, { "docid": "15ec6e5f6dca0eb58035cb4ade2b2c87", "score": "0.47057545", "text": "func processProducerMessage(\n\tctx context.Context,\n\tstream execinfrapb.DistSQL_FlowStreamServer,\n\tdst execinfra.RowReceiver,\n\tsd *StreamDecoder,\n\tdraining *bool,\n\tmsg *execinfrapb.ProducerMessage,\n) processMessageResult {\n\terr := sd.AddMessage(ctx, msg)\n\tif err != nil {\n\t\treturn processMessageResult{\n\t\t\terr: errors.Wrapf(err, \"%s\",\n\t\t\t\t// TODO(knz): Instead of pre-formatting the string here, use\n\t\t\t\t// errors.WithContextTags() here and let the error formatter\n\t\t\t\t// show the tags later.\n\t\t\t\tlog.FormatWithContextTags(ctx, \"decoding error\")),\n\t\t\tconsumerClosed: false,\n\t\t}\n\t}\n\tvar types []*types.T\n\tfor {\n\t\trow, meta, err := sd.GetRow(nil /* rowBuf */)\n\t\tif err != nil {\n\t\t\treturn processMessageResult{err: err, consumerClosed: false}\n\t\t}\n\t\tif row == nil && meta == nil {\n\t\t\t// No more rows in the last message.\n\t\t\treturn processMessageResult{err: nil, consumerClosed: false}\n\t\t}\n\n\t\tif log.V(3) && row != nil {\n\t\t\tif types == nil {\n\t\t\t\ttypes = sd.Types()\n\t\t\t}\n\t\t\tlog.Infof(ctx, \"inbound stream pushing row %s\", row.String(types))\n\t\t}\n\t\tif *draining && meta == nil {\n\t\t\t// Don't forward data rows when we're draining.\n\t\t\tcontinue\n\t\t}\n\t\tswitch dst.Push(row, meta) {\n\t\tcase execinfra.NeedMoreRows:\n\t\t\tcontinue\n\t\tcase execinfra.DrainRequested:\n\t\t\t// The rest of rows are not needed by the consumer. We'll send a drain\n\t\t\t// signal to the producer and expect it to quickly send trailing\n\t\t\t// metadata and close its side of the stream, at which point we also\n\t\t\t// close the consuming side of the stream and call dst.ProducerDone().\n\t\t\tif !*draining {\n\t\t\t\t*draining = true\n\t\t\t\tif err := sendDrainSignalToStreamProducer(ctx, stream); err != nil {\n\t\t\t\t\tlog.Errorf(ctx, \"draining error: %s\", err)\n\t\t\t\t}\n\t\t\t}\n\t\tcase execinfra.ConsumerClosed:\n\t\t\treturn processMessageResult{err: nil, consumerClosed: true}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c0beb112f34f9deec56e11c6d6f18aa5", "score": "0.46801853", "text": "func (s *BaseSqlBase4GoListener) ExitRowConstructor(ctx *RowConstructorContext) {}", "title": "" }, { "docid": "13f5839dd0143ab08f16d64fce90aec2", "score": "0.4676111", "text": "func (n *HTTPOutNode) updateResultWithRow(idx int, row *models.Row) {\n\tn.mu.Lock()\n\tdefer n.mu.Unlock()\n\tif idx >= len(n.result.Series) {\n\t\tn.diag.Error(\"index out of range for row update\",\n\t\t\tfmt.Errorf(\"index %v is larger than number of series %v\", idx, len(n.result.Series)))\n\t\treturn\n\t}\n\tn.result.Series[idx] = row\n}", "title": "" }, { "docid": "47066e24368fc263414d38e6b57b8937", "score": "0.46641862", "text": "func (wm *WorkloadMetricsRow) ProcessResult(hitMap, workloadCPU, workloadMem map[string]gjson.Result) error {\n\thitMetadata := hitMap[\"metadata\"].Map()\n\ttsStr := hitMetadata[\"start_date\"].String()\n\ttimestamp, err := time.Parse(\n\t\ttime.RFC3339Nano,\n\t\ttsStr)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"unable to parse job run timestamp\")\n\t}\n\n\tvar passCount, failCount, passTotalDurationSeconds *int64\n\tvar cpuCount, memCount *int64\n\tvar cpuAvgTotal, cpuMaxTotal, memAvgTotal, memMaxTotal *float64\n\n\tif timestamp.Before(wm.PreviousStart) {\n\t\treturn fmt.Errorf(\"result job %s result %s timestamp %s is before prevPeriodStart %s, should not be present in query, possibly bug\",\n\t\t\thitMetadata[\"upstream_job\"].String(), hitMetadata[\"uuid\"].String(), timestamp.Format(time.RFC3339), wm.PreviousStart.Format(time.RFC3339))\n\t}\n\n\tif timestamp.After(wm.CurrentStart) {\n\t\tpassCount = &wm.CurrentPassCount\n\t\tfailCount = &wm.CurrentFailCount\n\t\tpassTotalDurationSeconds = &wm.CurrentPassTotalDur\n\t\tcpuCount = &wm.CurrentTotalCPUCount\n\t\tmemCount = &wm.CurrentTotalMemCount\n\t\tcpuAvgTotal = &wm.CurrentAvgTotalCPU\n\t\tcpuMaxTotal = &wm.CurrentMaxTotalCPU\n\t\tmemAvgTotal = &wm.CurrentAvgTotalMemBytes\n\t\tmemMaxTotal = &wm.CurrentMaxTotalMemBytes\n\t} else {\n\t\tpassCount = &wm.PreviousPassCount\n\t\tfailCount = &wm.PreviousFailCount\n\t\tpassTotalDurationSeconds = &wm.PreviousPassTotalDur\n\t\tcpuCount = &wm.PreviousTotalCPUCount\n\t\tmemCount = &wm.PreviousTotalMemCount\n\t\tcpuAvgTotal = &wm.PreviousAvgTotalCPU\n\t\tcpuMaxTotal = &wm.PreviousMaxTotalCPU\n\t\tmemAvgTotal = &wm.PreviousAvgTotalMemBytes\n\t\tmemMaxTotal = &wm.PreviousMaxTotalMemBytes\n\t}\n\n\tdurSeconds := hitMetadata[\"job_duration\"].Int()\n\tstatus := hitMetadata[\"job_status\"].String()\n\tswitch status {\n\tcase \"success\":\n\t\t*passCount++\n\t\t*passTotalDurationSeconds += durSeconds // only tracked for successes\n\tcase \"upstream_failed\":\n\t\t*failCount++\n\tcase \"failed\":\n\t\t*failCount++\n\tcase \"default\":\n\t\treturn fmt.Errorf(\"perfscale job %s has unknown job_success field: %s\", hitMetadata[\"uuid\"].String(), status)\n\t}\n\n\t*cpuCount++\n\t*cpuAvgTotal += workloadCPU[\"average\"].Float()\n\t*cpuMaxTotal += workloadCPU[\"max\"].Float()\n\n\t*memCount++\n\t*memAvgTotal = +workloadMem[\"average\"].Float()\n\t*memMaxTotal = +workloadMem[\"max\"].Float()\n\n\treturn nil\n}", "title": "" }, { "docid": "64f66dce286e3dea2b3557d2802aa65c", "score": "0.4657299", "text": "func execAffectingOneRow(stmt *sql.Stmt, args ...interface{}) error {\n\tr, err := stmt.Exec(args...)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not execute statement: %v\", err)\n\t}\n\tif rowsAffected, err := r.RowsAffected(); err != nil {\n\t\treturn fmt.Errorf(\"could not get rows affected: %v\", err)\n\t} else if rowsAffected != 1 {\n\t\treturn fmt.Errorf(\"expected 1 row affected, got %d\", rowsAffected)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "737d43d8419707a4a3a25d3b2d4f3426", "score": "0.464021", "text": "func processInboundStream(\n\tctx context.Context,\n\tstream execinfrapb.DistSQL_FlowStreamServer,\n\tfirstMsg *execinfrapb.ProducerMessage,\n\tdst execinfra.RowReceiver,\n\tf *FlowBase,\n) error {\n\n\terr := processInboundStreamHelper(ctx, stream, firstMsg, dst, f)\n\n\t// err, if set, will also be propagated to the producer\n\t// as the last record that the producer gets.\n\tif err != nil {\n\t\tlog.VEventf(ctx, 1, \"inbound stream error: %s\", err)\n\t\treturn err\n\t}\n\tlog.VEventf(ctx, 1, \"inbound stream done\")\n\t// We are now done. The producer, if it's still around, will receive an EOF\n\t// error over its side of the stream.\n\treturn nil\n}", "title": "" }, { "docid": "c117cce403e0d79cea035b0b783f0009", "score": "0.4638036", "text": "func (ps *ParsedSheet)RemoveColumnFromRowPred(rIdx int, pred func(s string)bool){\n\tfilterNeeded := false\n\tkeepMap := make(map[int]bool)\n\tfor colIdx, rowS := range ps.Original[rIdx]{\n\t\tif pred(rowS){\n\t\t\tfilterNeeded = true\n\t\t\tkeepMap[colIdx] = true\n\t\t}\n\t}\n\tif !filterNeeded{\n\t\treturn\n\t}\n\toriginal, decimal := make([][]string, 0, len(ps.Original)), make([][]string, 0, len(ps.DecimalFormat))\n\tfor rowIdx := range ps.Original{\n\t\toriginalRow, decimalRow := make([]string, 0, len(ps.Original[rowIdx])), make([]string, 0, len(ps.DecimalFormat[rowIdx]))\n\t\tfor colIdx := range ps.Original[rowIdx]{\n\t\t\tif keepMap[colIdx]{\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\toriginalRow = append(originalRow, ps.Original[rowIdx][colIdx])\n\t\t\tdecimalRow = append(decimalRow, ps.DecimalFormat[rowIdx][colIdx])\n\t\t}\n\t\toriginal = append(original, originalRow)\n\t\tdecimal = append(decimal, decimalRow)\n\t}\n\tps.Original = original\n\tps.DecimalFormat = decimal\n}", "title": "" }, { "docid": "1d6ac94c982e298904e86513c7b37e9b", "score": "0.46136644", "text": "func DeleteRow(stub shim.ChaincodeStubInterface, tableName string, args []string) ([]byte, error) {\n patientId := args[0]\n userId := args[1]\n\n var columns []shim.Column\n col1 := shim.Column{Value: &shim.Column_String_{String_: patientId}}\n col2 := shim.Column{Value: &shim.Column_String_{String_: userId}}\n columns = append(columns, col1)\n columns = append(columns, col2)\n\n err := stub.DeleteRow(tableName, columns)\n if err != nil {\n return nil, fmt.Errorf(\"The operation delete row was not successful. Cause: %s\\n\", err)\n }\n\n return nil,nil\n}", "title": "" }, { "docid": "f8c712fe81e0baf52f20464349da4d4e", "score": "0.46070063", "text": "func (mock *PGMock) processDeleteStmt(s *pg.DeleteStmt, q QueryMessage, cluster *Cluster, vschema *Vschema) error {\n\trelation := *s.Relation.Relname\n\tvar whereClauseColumns []string\n\tvar whereClauseValues []string\n\tswitch ss := s.WhereClause.(type) {\n\tcase *pg.A_Expr:\n\t\tfor _, expr := range ss.Name.Items {\n\t\t\tswitch exprElem := expr.(type) {\n\t\t\tcase *pg.String:\n\t\t\t\tif exprElem.Str != \"=\" {\n\t\t\t\t\treturn fmt.Errorf(\"only equal expression is allowed in DELETE statements\")\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tswitch lexpr := ss.Lexpr.(type) {\n\t\tcase *pg.ColumnRef:\n\t\t\tfor _, column := range lexpr.Fields.Items {\n\t\t\t\tswitch columnElem := column.(type) {\n\t\t\t\tcase *pg.String:\n\t\t\t\t\twhereClauseColumns = append(whereClauseColumns, columnElem.Str)\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"left expression of where clause must be a column name\")\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tswitch rexpr := ss.Rexpr.(type) {\n\t\tcase *pg.A_Const:\n\t\t\tswitch rexprConst := rexpr.Val.(type) {\n\t\t\tcase *pg.String:\n\t\t\t\twhereClauseValues = append(whereClauseValues, rexprConst.Str)\n\t\t\tcase *pg.Integer:\n\t\t\t\twhereClauseValues = append(whereClauseValues, fmt.Sprintf(\"%d\", rexprConst.Ival))\n\t\t\tdefault:\n\t\t\t\treturn fmt.Errorf(\"unknown constant type in where clause. String and Integer only\")\n\t\t\t}\n\t\t}\n\tcase *pg.BoolExpr:\n\t\t// 0 = AND, 1 = OR, 2 NOT. See https://doxygen.postgresql.org/primnodes_8h.html#a27f637bf3e2c33cc8e48661a8864c7af\n\t\tif ss.Boolop > 0 {\n\t\t\treturn fmt.Errorf(\"Only AND expression is allowed as a boolean operator in DELETE statements\")\n\t\t}\n\t\tfor _, argItem := range ss.Args.Items {\n\t\t\tswitch arg := argItem.(type) {\n\t\t\tcase *pg.A_Expr:\n\t\t\t\tfor _, expr := range arg.Name.Items {\n\t\t\t\t\tswitch exprElem := expr.(type) {\n\t\t\t\t\tcase *pg.String:\n\t\t\t\t\t\tif exprElem.Str != \"=\" {\n\t\t\t\t\t\t\treturn fmt.Errorf(\"only equal expression is allowed in DELETE statements\")\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tswitch lexpr := arg.Lexpr.(type) {\n\t\t\t\tcase *pg.ColumnRef:\n\t\t\t\t\tfor _, column := range lexpr.Fields.Items {\n\t\t\t\t\t\tswitch columnElem := column.(type) {\n\t\t\t\t\t\tcase *pg.String:\n\t\t\t\t\t\t\twhereClauseColumns = append(whereClauseColumns, columnElem.Str)\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn fmt.Errorf(\"left expression of where clause must be a column name\")\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tswitch rexpr := arg.Rexpr.(type) {\n\t\t\t\tcase *pg.A_Const:\n\t\t\t\t\tswitch rexprConst := rexpr.Val.(type) {\n\t\t\t\t\tcase *pg.String:\n\t\t\t\t\t\twhereClauseValues = append(whereClauseValues, rexprConst.Str)\n\t\t\t\t\tcase *pg.Integer:\n\t\t\t\t\t\twhereClauseValues = append(whereClauseValues, fmt.Sprintf(\"%d\", rexprConst.Ival))\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn fmt.Errorf(\"unknown constant type in where clause. String and Integer only\")\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tdefault:\n\t\treturn fmt.Errorf(\"expecting a list of columns in where clause, found unknown expression\")\n\t}\n\t// build list of indexes of delete stmt columns that match the vschema table primary vindex columns.\n\t// e.g. delete from orders(id, user_id, total_amount, order_date) -> primary vindex for table orders is `id`,\n\t// so the result will be [0].\n\t// Iterate first on table vindex columns, and then on insert stmt columns\n\ttable := vschema.GetTable(relation)\n\tif table == nil {\n\t\treturn fmt.Errorf(\"cannot process delete statement, table %s is not part of the vschema\", relation)\n\t}\n\tvar indexes []int\n\tfor _, pc := range table.GetPrimaryVIndex().Columns {\n\t\tfor i, c := range whereClauseColumns {\n\t\t\tif pc == c {\n\t\t\t\tindexes = append(indexes, i)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t}\n\tif len(indexes) != len(whereClauseColumns) {\n\t\treturn fmt.Errorf(\"cannot execute delete statement without all primary vindex columns being present in the where clause\")\n\t}\n\tmock.logger.Log(\"msg\", fmt.Sprintf(\"relation: %s, columns: %s\", relation, whereClauseColumns))\n\tvar concat string\n\tfor _, val := range indexes {\n\t\twhereClauseValue := whereClauseValues[val]\n\t\tconcat = appendToConcatenate(concat, whereClauseValue)\n\t}\n\ttarget, err := cluster.GetShardForKeyspaceId(concat)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"cannot select destination shard for delete statement: %w\", err)\n\t}\n\tmock.logger.Log(\"msg\", fmt.Sprintf(\"shard selected: %s\\n\", target.Name))\n\tres, err := target.Conn.Exec(context.Background(), q.String)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer res.Close()\n\tresults, err := res.ReadAll()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn mock.FinaliseExecuteSequence(\"DELETE\", results)\n}", "title": "" }, { "docid": "1509e478786ca479269dea810c8d683d", "score": "0.46064273", "text": "func convertSrcRow_Any(fp *FPObject, wc *convertSrcWorkContext, j int) {\n\tvar srcSam16 [4]uint32 // Source RGBA samples (uint16 stored in uint32)\n\tvar k int\n\n\tfor i := 0; i < fp.srcW; i++ {\n\t\t// Read a pixel from the source image, into uint16 samples\n\t\tsrcclr := wc.srcImage.At(fp.srcBounds.Min.X+i, fp.srcBounds.Min.Y+j)\n\t\tsrcSam16[0], srcSam16[1], srcSam16[2], srcSam16[3] = srcclr.RGBA()\n\n\t\tif srcSam16[3] < 65535 {\n\t\t\tfp.srcHasTransparency = true\n\t\t}\n\n\t\t// Identify the slice of samples representing this pixel in the\n\t\t// converted image.\n\t\tdstSam := wc.dst.Pix[j*wc.dst.Stride+4*i : j*wc.dst.Stride+4*i+4]\n\n\t\t// Choose from among several methods of converting the pixel to our\n\t\t// desired format.\n\t\tif srcSam16[3] == 0 {\n\t\t\t// Handle fully-transparent pixels quickly.\n\t\t\t// Color correction is irrelevant here.\n\t\t\t// Nothing to do: the samples will have been initialized to 0.0,\n\t\t\t// which is what we want.\n\t\t} else if fp.inputCCF == nil {\n\t\t\t// No color correction; just convert from uint16(0 ... 65535) to float(0.0 ... 1.0)\n\t\t\tfor k = 0; k < 4; k++ {\n\t\t\t\tdstSam[k] = float32(srcSam16[k]) / 65535.0\n\t\t\t}\n\t\t} else if srcSam16[3] == 65535 {\n\t\t\t// Fast path for fully-opaque pixels.\n\t\t\tif wc.inputLUT_16to32 != nil {\n\t\t\t\t// Convert to linear color, using a lookup table.\n\t\t\t\tfor k = 0; k < 3; k++ {\n\t\t\t\t\tdstSam[k] = wc.inputLUT_16to32[srcSam16[k]]\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Convert to linear color, without a lookup table.\n\t\t\t\tfor k = 0; k < 3; k++ {\n\t\t\t\t\tdstSam[k] = float32(srcSam16[k]) / 65535.0\n\t\t\t\t}\n\t\t\t\tfp.inputCCF(dstSam[0:3])\n\t\t\t}\n\t\t\tdstSam[3] = 1.0\n\t\t} else {\n\t\t\t// Partial transparency, with color correction.\n\t\t\t// Convert to floating point,\n\t\t\t// and to unassociated alpha, so that we can do color conversion.\n\t\t\tdstSam[3] = float32(srcSam16[3]) // Leave at (0...65535) for the next loop\n\t\t\tfor k = 0; k < 3; k++ {\n\t\t\t\tdstSam[k] = float32(srcSam16[k]) / dstSam[3]\n\t\t\t}\n\t\t\tdstSam[3] /= 65535.0\n\n\t\t\t// Convert to linear color.\n\t\t\tfp.inputCCF(dstSam[0:3])\n\n\t\t\t// Convert back to associated alpha.\n\t\t\tfor k = 0; k < 3; k++ {\n\t\t\t\tdstSam[k] *= dstSam[3]\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e670e36f03d41254456b8bb74cfa6de3", "score": "0.457802", "text": "func (fp *FPObject) convertSrc(src image.Image, dst *FPImage) error {\n\tvar i int\n\tvar j int\n\tvar nSamples int\n\tvar wi convertSrcWorkItem\n\n\tif int64(fp.srcW)*int64(fp.srcH) > maxImagePixels {\n\t\treturn errors.New(\"Source image too large to process\")\n\t}\n\n\twc := new(convertSrcWorkContext)\n\twc.dst = dst\n\twc.srcImage = src\n\n\t// Look at the underlying type of fp.srcImage, and prepare a conversion\n\t// strategy.\n\tfp.srcHasColor = true\n\tswitch wc.srcImage.(type) {\n\tcase *image.NRGBA:\n\t\twc.src_AsNRGBA = wc.srcImage.(*image.NRGBA)\n\t\twc.cvtRowFn = convertSrcRow_NRGBA\n\t\twc.inputLUT_8to32 = fp.makeInputLUT_Xto32(256)\n\tcase *image.RGBA:\n\t\twc.src_AsRGBA = wc.srcImage.(*image.RGBA)\n\t\twc.cvtRowFn = convertSrcRow_RGBA\n\t\twc.inputLUT_8to32 = fp.makeInputLUT_Xto32(256)\n\tcase *image.YCbCr:\n\t\twc.src_AsYCbCr = wc.srcImage.(*image.YCbCr)\n\t\twc.cvtRowFn = convertSrcRow_YCbCr\n\t\twc.inputLUT_8to32 = fp.makeInputLUT_Xto32(256)\n\tcase *image.Gray:\n\t\twc.src_AsGray = wc.srcImage.(*image.Gray)\n\t\twc.cvtRowFn = convertSrcRow_Gray\n\t\twc.inputLUT_8to32 = fp.makeInputLUT_Xto32(256)\n\t\tfp.srcHasColor = false\n\tcase *image.Gray16:\n\t\twc.cvtRowFn = convertSrcRow_Any\n\t\twc.inputLUT_16to32 = fp.makeInputLUT_Xto32(65536)\n\t\tfp.srcHasColor = false\n\tdefault:\n\t\twc.cvtRowFn = convertSrcRow_Any\n\t\twc.inputLUT_16to32 = fp.makeInputLUT_Xto32(65536)\n\t}\n\n\tfp.progressMsgf(\"Converting to FPImage format\")\n\n\t// Allocate the pixel array\n\tdst.Rect.Min.X = 0\n\tdst.Rect.Min.Y = 0\n\tdst.Rect.Max.X = fp.srcW\n\tdst.Rect.Max.Y = fp.srcH\n\tdst.Stride = fp.srcW * 4\n\tnSamples = dst.Stride * fp.srcH\n\tdst.Pix = make([]float32, nSamples)\n\n\tworkQueue := make(chan convertSrcWorkItem)\n\n\tfor i = 0; i < fp.numWorkers; i++ {\n\t\tgo fp.convertSrcWorker(wc, workQueue)\n\t}\n\n\t// Each row is a \"work item\". Send each row to a worker.\n\tfor j = 0; j < fp.srcH; j++ {\n\t\twi.j = j\n\t\tworkQueue <- wi\n\t}\n\n\t// Send out a \"stop work\" order. When all workers have received it, we know\n\t// that all the work is done.\n\twi.stopNow = true\n\tfor i = 0; i < fp.numWorkers; i++ {\n\t\tworkQueue <- wi\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "28a97d526c7c0c85d7becb0be566756d", "score": "0.45728678", "text": "func newDistinct(\n\tflowCtx *execinfra.FlowCtx,\n\tprocessorID int32,\n\tspec *execinfrapb.DistinctSpec,\n\tinput execinfra.RowSource,\n\tpost *execinfrapb.PostProcessSpec,\n\toutput execinfra.RowReceiver,\n) (execinfra.RowSourcedProcessor, error) {\n\tif len(spec.DistinctColumns) == 0 {\n\t\treturn nil, errors.AssertionFailedf(\"0 distinct columns specified for distinct processor\")\n\t}\n\n\tnonOrderedCols := make([]uint32, 0, len(spec.DistinctColumns)-len(spec.OrderedColumns))\n\tfor _, col := range spec.DistinctColumns {\n\t\tordered := false\n\t\tfor _, ordCol := range spec.OrderedColumns {\n\t\t\tif col == ordCol {\n\t\t\t\tordered = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !ordered {\n\t\t\tnonOrderedCols = append(nonOrderedCols, col)\n\t\t}\n\t}\n\n\tctx := flowCtx.EvalCtx.Ctx()\n\tmemMonitor := execinfra.NewMonitor(ctx, flowCtx.EvalCtx.Mon, \"distinct-mem\")\n\td := &distinct{\n\t\tinput: input,\n\t\tmemAcc: memMonitor.MakeBoundAccount(),\n\t\ttypes: input.OutputTypes(),\n\t\tnullsAreDistinct: spec.NullsAreDistinct,\n\t\terrorOnDup: spec.ErrorOnDup,\n\t}\n\td.distinctCols.ordered = spec.OrderedColumns\n\td.distinctCols.nonOrdered = nonOrderedCols\n\n\tvar returnProcessor execinfra.RowSourcedProcessor = d\n\tif len(nonOrderedCols) == 0 {\n\t\t// We can use the faster sortedDistinct processor.\n\t\tsd := &sortedDistinct{distinct: d}\n\t\treturnProcessor = sd\n\t}\n\n\tif err := d.Init(\n\t\td, post, d.types, flowCtx, processorID, output, memMonitor, /* memMonitor */\n\t\texecinfra.ProcStateOpts{\n\t\t\tInputsToDrain: []execinfra.RowSource{d.input},\n\t\t\tTrailingMetaCallback: func() []execinfrapb.ProducerMetadata {\n\t\t\t\td.close()\n\t\t\t\treturn nil\n\t\t\t},\n\t\t}); err != nil {\n\t\treturn nil, err\n\t}\n\td.lastGroupKey = d.Out.RowAlloc.AllocRow(len(d.types))\n\td.haveLastGroupKey = false\n\t// If we set up the arena when d is created, the pointer to the memAcc\n\t// will be changed because the sortedDistinct case makes a copy of d.\n\t// So we have to set up the account here.\n\td.arena = stringarena.Make(&d.memAcc)\n\n\tif execinfra.ShouldCollectStats(ctx, flowCtx) {\n\t\td.input = newInputStatCollector(d.input)\n\t\td.ExecStatsForTrace = d.execStatsForTrace\n\t}\n\n\treturn returnProcessor, nil\n}", "title": "" }, { "docid": "697a54c48c094ba3cb29339f94cd24a0", "score": "0.45720127", "text": "func (tr *TableResult) consume(in chan row.Row) {\n\tgo func() {\n\t\tfor {\n\t\t\ttr.mutex.Lock()\n\t\t\tr, ok := <-in\n\t\t\tif ok {\n\t\t\t\ttr.rows = append(tr.rows, r)\n\t\t\t\ttr.length++\n\t\t\t\ttr.mutex.Unlock()\n\t\t\t} else {\n\t\t\t\ttr.done = true\n\t\t\t\ttr.mutex.Unlock()\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "92e40a6f972398e722045124298fc720", "score": "0.4561409", "text": "func SearchResultToRows(sch *entity.Schema, results *schemapb.SearchResultData, t reflect.Type, _ map[string]struct{}) ([]SearchResultByRows, error) {\n\tvar err error\n\toffset := 0\n\t// new will have a pointer, so de-reference first if type is pointer to struct\n\tif t.Kind() == reflect.Ptr {\n\t\tt = t.Elem()\n\t}\n\tsr := make([]SearchResultByRows, 0, results.GetNumQueries())\n\tfieldDataList := results.GetFieldsData()\n\tnameFieldData := make(map[string]*schemapb.FieldData)\n\tfor _, fieldData := range fieldDataList {\n\t\tnameFieldData[fieldData.FieldName] = fieldData\n\t}\n\tids := results.GetIds()\n\tfor i := 0; i < int(results.GetNumQueries()); i++ {\n\t\trc := int(results.GetTopks()[i]) // result entry count for current query\n\t\tentry := SearchResultByRows{\n\t\t\tResultCount: rc,\n\t\t\tRows: make([]entity.Row, 0, rc),\n\t\t\tScores: results.GetScores()[offset:rc],\n\t\t}\n\t\tfor j := 0; j < rc; j++ {\n\t\t\tp := reflect.New(t)\n\t\t\tv := p.Elem()\n\n\t\t\t// extract primary field logic\n\t\t\tfor _, field := range sch.Fields {\n\t\t\t\tf := v.FieldByName(field.Name) // TODO silverxia field may be annotated by tags, which means the field name will not be the same\n\t\t\t\tif !f.IsValid() {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\t// Primary key has different field from search result\n\t\t\t\tif field.PrimaryKey {\n\t\t\t\t\tswitch f.Kind() {\n\t\t\t\t\tcase reflect.Int64:\n\t\t\t\t\t\tintIds := ids.GetIntId()\n\t\t\t\t\t\tif intIds == nil {\n\t\t\t\t\t\t\tentry.Err = fmt.Errorf(\"field %s is int64, but id column is not\", field.Name)\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t\tf.SetInt(intIds.GetData()[offset+j])\n\t\t\t\t\tcase reflect.String:\n\t\t\t\t\t\tstrIds := ids.GetStrId()\n\t\t\t\t\t\tif strIds == nil {\n\t\t\t\t\t\t\tentry.Err = fmt.Errorf(\"field %s is string ,but id column is not\", field.Name)\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t\tf.SetString(strIds.GetData()[offset+j])\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tentry.Err = fmt.Errorf(\"field %s is not valid primary key\", field.Name)\n\t\t\t\t\t}\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\t// fieldDataList\n\t\t\t\tfieldData, has := nameFieldData[field.Name]\n\t\t\t\tif !has || fieldData == nil {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\t// Set field value with offset+j-th item\n\t\t\t\terr = SetFieldValue(field, f, fieldData, offset+j)\n\t\t\t\tif err != nil {\n\t\t\t\t\tentry.Err = err\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tr := p.Interface()\n\t\t\trow, ok := r.(entity.Row)\n\t\t\tif ok {\n\t\t\t\tentry.Rows = append(entry.Rows, row)\n\t\t\t}\n\t\t}\n\t\tsr = append(sr, entry)\n\t\t// set offset after processed one result\n\t\toffset += rc\n\t}\n\treturn sr, nil\n}", "title": "" }, { "docid": "e0d1d1a084cba383d56bd79c18a36d4f", "score": "0.45470008", "text": "func (p *Truncate) RowIter(ctx *sql.Context, _ sql.Row) (sql.RowIter, error) {\n\ttruncatable, err := GetTruncatable(p.Child)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t//TODO: when performance schema summary tables are added, reset the columns to 0/NULL rather than remove rows\n\t//TODO: close all handlers that were opened with \"HANDLER OPEN\"\n\n\tremoved, err := truncatable.Truncate(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, col := range truncatable.Schema() {\n\t\tif col.AutoIncrement {\n\t\t\taiTable, ok := truncatable.(sql.AutoIncrementTable)\n\t\t\tif ok {\n\t\t\t\tsetter := aiTable.AutoIncrementSetter(ctx)\n\t\t\t\terr = setter.SetAutoIncrementValue(ctx, p.incrementAutoIncrementZero(col.Type.Zero()))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\terr = setter.Close(ctx)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\treturn sql.RowsToRowIter(sql.NewRow(sql.NewOkResult(removed))), nil\n}", "title": "" }, { "docid": "2c29d4f0db81c5c1c1480a88525cd73a", "score": "0.454441", "text": "func DrainAndForwardMetadata(ctx context.Context, src RowSource, dst RowReceiver) {\n\tsrc.ConsumerDone()\n\tfor {\n\t\trow, meta := src.Next()\n\t\tif meta == nil {\n\t\t\tif row == nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif row != nil {\n\t\t\tlog.Fatalf(\n\t\t\t\tctx, \"both row data and metadata in the same record. row: %s meta: %+v\",\n\t\t\t\trow.String(src.OutputTypes()), meta,\n\t\t\t)\n\t\t}\n\n\t\tswitch dst.Push(nil /* row */, meta) {\n\t\tcase ConsumerClosed:\n\t\t\tsrc.ConsumerClosed()\n\t\t\treturn\n\t\tcase NeedMoreRows:\n\t\tcase DrainRequested:\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2abfd324e99e780ed3c81150ea8b9020", "score": "0.45427078", "text": "func (e *DistinctExec) Next() (*Row, error) {\n\tif e.checker == nil {\n\t\te.checker = distinct.CreateDistinctChecker()\n\t}\n\tfor {\n\t\trow, err := e.Src.Next()\n\t\tif err != nil {\n\t\t\treturn nil, errors.Trace(err)\n\t\t}\n\t\tif row == nil {\n\t\t\treturn nil, nil\n\t\t}\n\t\tok, err := e.checker.Check(types.DatumsToInterfaces(row.Data))\n\t\tif err != nil {\n\t\t\treturn nil, errors.Trace(err)\n\t\t}\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\treturn row, nil\n\t}\n}", "title": "" }, { "docid": "ab28458f4999f4df3d599b7ddce774ca", "score": "0.454257", "text": "func (c *columnBuilder) RemoveRow() {\n\tlastValueIndex := len(c.values) - 1\n\tlastValueNull := c.values[lastValueIndex] == nil\n\tc.values = c.values[:lastValueIndex]\n\tif !lastValueNull {\n\t\tc.numValidValues--\n\t}\n}", "title": "" }, { "docid": "c48d7d1baf74f6e1a673c5041110c095", "score": "0.45351648", "text": "func (p *Processor) processObject(object map[string]interface{}, alreadyUploadedTables map[string]bool, allowSkip bool) (*BatchHeader, map[string]interface{}, error) {\n\ttableName, err := p.tableNameExtractor.Extract(object)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tif allowSkip && (tableName == \"\" || tableName == \"null\") {\n\t\treturn nil, nil, ErrSkipObject\n\t}\n\n\t//object has been already processed (storage:table pair might be already processed)\n\t_, ok := alreadyUploadedTables[tableName]\n\tif ok {\n\t\treturn &BatchHeader{}, nil, nil\n\t}\n\n\tobjectCopy := maputils.CopyMap(object)\n\n\tp.lookupEnrichmentStep.Execute(objectCopy)\n\n\treturn p.mappingStep.Execute(tableName, objectCopy)\n}", "title": "" }, { "docid": "0ecbe9a3191630e282afabdafa371cf3", "score": "0.45290753", "text": "func (m *RecordfoodMutation) RECORDSOURCECleared() bool {\n\treturn m.cleared_RECORD_SOURCE\n}", "title": "" }, { "docid": "f17060b39174ce7e7015ec415651d97b", "score": "0.45112902", "text": "func (d *deleteNode) BatchedNext(params runParams) (bool, error) {\n\tif d.run.done {\n\t\treturn false, nil\n\t}\n\n\t// Advance one batch. First, clear the last batch.\n\td.run.td.clearLastBatch(params.ctx)\n\t// Now consume/accumulate the rows for this batch.\n\tlastBatch := false\n\tfor {\n\t\tif err := params.p.cancelChecker.Check(); err != nil {\n\t\t\treturn false, err\n\t\t}\n\n\t\t// Advance one individual row.\n\t\tif next, err := d.source.Next(params); !next {\n\t\t\tlastBatch = true\n\t\t\tif err != nil {\n\t\t\t\treturn false, err\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\n\t\t// Process the deletion of the current source row,\n\t\t// potentially accumulating the result row for later.\n\t\tif err := d.processSourceRow(params, d.source.Values()); err != nil {\n\t\t\treturn false, err\n\t\t}\n\n\t\t// Are we done yet with the current batch?\n\t\tif d.run.td.currentBatchSize >= d.run.td.maxBatchSize {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif d.run.td.currentBatchSize > 0 {\n\t\tif !lastBatch {\n\t\t\t// We only run/commit the batch if there were some rows processed\n\t\t\t// in this batch.\n\t\t\tif err := d.run.td.flushAndStartNewBatch(params.ctx); err != nil {\n\t\t\t\treturn false, err\n\t\t\t}\n\t\t}\n\t}\n\n\tif lastBatch {\n\t\tif err := d.run.td.finalize(params.ctx); err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\t// Remember we're done for the next call to BatchedNext().\n\t\td.run.done = true\n\t}\n\n\t// Possibly initiate a run of CREATE STATISTICS.\n\tparams.ExecCfg().StatsRefresher.NotifyMutation(\n\t\td.run.td.tableDesc().GetID(),\n\t\td.run.td.lastBatchSize,\n\t)\n\n\treturn d.run.td.lastBatchSize > 0, nil\n}", "title": "" }, { "docid": "b31bb8226f27f6b5915c3080147089ca", "score": "0.45036936", "text": "func (n *DataSource) process(ctx context.Context, data func(bcr *byteCountReader, ptransformID string) error, timer func(bcr *byteCountReader, ptransformID, timerFamilyID string) error) error {\n\t// The SID contains this instruction's expected data processing transform (this one).\n\telms, err := n.source.OpenElementChan(ctx, n.SID, maps.Keys(n.OnTimerTransforms))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tn.PCol.resetSize() // initialize the size distribution for this bundle.\n\tvar r bytes.Reader\n\n\tvar byteCount int\n\tbcr := byteCountReader{reader: &r, count: &byteCount}\n\n\tsplitPrimaryComplete := map[string]bool{}\n\tfor {\n\t\tvar err error\n\t\tselect {\n\t\tcase e, ok := <-elms:\n\t\t\t// Channel closed, so time to exit\n\t\t\tif !ok {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tif splitPrimaryComplete[e.PtransformID] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif len(e.Data) > 0 {\n\t\t\t\tr.Reset(e.Data)\n\t\t\t\terr = data(&bcr, e.PtransformID)\n\t\t\t}\n\t\t\tif len(e.Timers) > 0 {\n\t\t\t\tr.Reset(e.Timers)\n\t\t\t\terr = timer(&bcr, e.PtransformID, e.TimerFamilyID)\n\t\t\t}\n\n\t\t\tif err == errSplitSuccess {\n\t\t\t\t// Returning splitSuccess means we've split, and aren't consuming the remaining buffer.\n\t\t\t\t// We mark the PTransform done to ignore further data.\n\t\t\t\tsplitPrimaryComplete[e.PtransformID] = true\n\t\t\t} else if err != nil && err != io.EOF {\n\t\t\t\treturn errors.Wrap(err, \"source failed\")\n\t\t\t}\n\t\t\t// io.EOF means the reader successfully drained.\n\t\t\t// We're ready for a new buffer.\n\t\tcase <-ctx.Done():\n\t\t\treturn nil\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c4d900b2697fdd58f0ff4cc77025cfe9", "score": "0.4498802", "text": "func (s RowInboundStreamHandler) Run(\n\tctx context.Context,\n\tstream execinfrapb.DistSQL_FlowStreamServer,\n\tfirstMsg *execinfrapb.ProducerMessage,\n\tf *FlowBase,\n) error {\n\treturn processInboundStream(ctx, stream, firstMsg, s.RowReceiver, f)\n}", "title": "" }, { "docid": "d505a2ce88b789595ed42e3a4de9d272", "score": "0.44898415", "text": "func (m *RecordfoodMutation) ClearRECORDSOURCE() {\n\tm.cleared_RECORD_SOURCE = true\n}", "title": "" }, { "docid": "d1ab56f69aabfe30e96391a606366631", "score": "0.44823727", "text": "func (e *AggregateExec) Next() (*Row, error) {\n\t// In this stage we consider all data from src as a single group.\n\tif !e.executed {\n\t\te.groupMap = make(map[string]bool)\n\t\te.groups = []string{}\n\t\tfor {\n\t\t\thasMore, err := e.innerNext()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.Trace(err)\n\t\t\t}\n\t\t\tif !hasMore {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\te.executed = true\n\t\tif (len(e.groups) == 0) && (len(e.GroupByItems) == 0) {\n\t\t\t// If no groupby and no data, we should add an empty group.\n\t\t\t// For example:\n\t\t\t// \"select count(c) from t;\" should return one row [0]\n\t\t\t// \"select count(c) from t group by c1;\" should return empty result set.\n\t\t\te.groups = append(e.groups, singleGroup)\n\t\t}\n\t}\n\tif e.currentGroupIndex >= len(e.groups) {\n\t\treturn nil, nil\n\t}\n\tgroupKey := e.groups[e.currentGroupIndex]\n\tfor _, af := range e.AggFuncs {\n\t\taf.CurrentGroup = groupKey\n\t}\n\te.currentGroupIndex++\n\treturn &Row{}, nil\n}", "title": "" }, { "docid": "044032502a7a6403ad3c0ecde56db51b", "score": "0.44740614", "text": "func scanRowStep(scanner db.Scanner, stage *core.Stage, step *nullStep) error {\n\tdepJSON := types.JSONText{}\n\tlabJSON := types.JSONText{}\n\terr := scanner.Scan(\n\t\t&stage.ID,\n\t\t&stage.RepoID,\n\t\t&stage.BuildID,\n\t\t&stage.Number,\n\t\t&stage.Name,\n\t\t&stage.Kind,\n\t\t&stage.Type,\n\t\t&stage.Status,\n\t\t&stage.Error,\n\t\t&stage.ErrIgnore,\n\t\t&stage.ExitCode,\n\t\t&stage.Limit,\n\t\t&stage.OS,\n\t\t&stage.Arch,\n\t\t&stage.Variant,\n\t\t&stage.Kernel,\n\t\t&stage.Machine,\n\t\t&stage.Started,\n\t\t&stage.Stopped,\n\t\t&stage.Created,\n\t\t&stage.Updated,\n\t\t&stage.Version,\n\t\t&stage.OnSuccess,\n\t\t&stage.OnFailure,\n\t\t&depJSON,\n\t\t&labJSON,\n\t\t&step.ID,\n\t\t&step.StageID,\n\t\t&step.Number,\n\t\t&step.Name,\n\t\t&step.Status,\n\t\t&step.Error,\n\t\t&step.ErrIgnore,\n\t\t&step.ExitCode,\n\t\t&step.Started,\n\t\t&step.Stopped,\n\t\t&step.Version,\n\t)\n\tjson.Unmarshal(depJSON, &stage.DependsOn)\n\tjson.Unmarshal(labJSON, &stage.Labels)\n\treturn err\n}", "title": "" }, { "docid": "54e564624adec4c00fc87026c350b815", "score": "0.44710463", "text": "func (e *SelectFieldsExec) Next() (*Row, error) {\n\tvar rowKeys []*RowKeyEntry\n\tif e.Src != nil {\n\t\tsrcRow, err := e.Src.Next()\n\t\tif err != nil {\n\t\t\treturn nil, errors.Trace(err)\n\t\t}\n\t\tif srcRow == nil {\n\t\t\treturn nil, nil\n\t\t}\n\t\trowKeys = srcRow.RowKeys\n\t} else {\n\t\t// If Src is nil, only one row should be returned.\n\t\tif e.executed {\n\t\t\treturn nil, nil\n\t\t}\n\t}\n\te.executed = true\n\trow := &Row{\n\t\tRowKeys: rowKeys,\n\t\tData: make([]types.Datum, len(e.ResultFields)),\n\t}\n\tfor i, field := range e.ResultFields {\n\t\tval, err := evaluator.Eval(e.ctx, field.Expr)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Trace(err)\n\t\t}\n\t\trow.Data[i] = types.NewDatum(val)\n\t}\n\treturn row, nil\n}", "title": "" }, { "docid": "bdc069ad699001e8eea852be98d7dc5a", "score": "0.4464097", "text": "func (stmt *Stmt) selectOne(ctx context.Context, db Querier, dest interface{}, rowValue reflect.Value, args []interface{}) (int, error) {\n\texpandedQuery, expandedArgs, err := wherein.Expand(stmt.query, args)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\trows, err := db.QueryContext(ctx, expandedQuery, expandedArgs...)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tdefer rows.Close()\n\toutputs, err := stmt.getOutputs(rows)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tscanValues := make([]interface{}, len(outputs))\n\tvar jsonCells []*jsonCell\n\n\tif !rows.Next() {\n\t\t// no rows returned\n\t\treturn 0, nil\n\t}\n\n\t// at least one row returned\n\trowCount := 1\n\n\tfor i, col := range outputs {\n\t\tcellValue := col.info.Index.ValueRW(rowValue)\n\t\tcellPtr := cellValue.Addr().Interface()\n\t\tif col.JSON() {\n\t\t\tjc := newJSONCell(col.info.Field.Name, cellPtr)\n\t\t\tjsonCells = append(jsonCells, jc)\n\t\t\tscanValues[i] = jc.ScanValue()\n\t\t} else {\n\t\t\tscanValues[i] = newNullCell(col.info.Field.Name, cellValue, cellPtr)\n\t\t}\n\t}\n\terr = rows.Scan(scanValues...)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tfor _, jc := range jsonCells {\n\t\tif err := jc.Unmarshal(); err != nil {\n\t\t\treturn rowCount, err\n\t\t}\n\t}\n\n\t// count any additional rows\n\tfor rows.Next() {\n\t\trowCount++\n\t}\n\n\treturn rowCount, nil\n}", "title": "" }, { "docid": "6ca84851635d3bfced567f6b05dc4296", "score": "0.44622436", "text": "func readRows(src, tgt *dbInfo, dataChan chan []sql.RawBytes, quitChan chan bool, goChan chan bool) {\n\trows, err := src.db.Query(\"select * from \" + addQuotes(src.schema) + \".\" + addQuotes(src.table) + src.where)\n\tdefer rows.Close()\n\tif err != nil {\n\t\tlog.Print(err)\n\t\tos.Exit(11)\n\t}\n\n\tcols, err := rows.Columns()\n\tcheckErr(err)\n\n\t// Need to scan into empty interface since we don't know how many columns a query might return\n\tscanVals := make([]interface{}, len(cols))\n\tvals := make([]sql.RawBytes, len(cols))\n\tfor i := range vals {\n\t\tscanVals[i] = &vals[i]\n\t}\n\n\tfor rows.Next() {\n\t\terr := rows.Scan(scanVals...)\n\t\tcheckErr(err)\n\n\t\tdataChan <- vals\n\n\t\t// Block and wait for writeRows() to signal back it has consumed the data\n\t\t// This is necessary because sql.RawBytes is a memory pointer and when rows.Next()\n\t\t// loops and change the memory address before writeRows can properly process the values\n\t\t<-goChan\n\t}\n\n\terr = rows.Err()\n\tcheckErr(err)\n\n\tclose(dataChan)\n\tquitChan <- true\n}", "title": "" }, { "docid": "baa3889dd53dee58a618b79cea86afe6", "score": "0.44585738", "text": "func receiptsGridRowScan(rows *sql.Rows, q PrReceiptGrid) (PrReceiptGrid, error) {\n\terr := rows.Scan(&q.RCPTID, &q.BID, &q.TCID, &q.PMTID, &q.PmtTypeName, &q.Dt, &q.DocNo, &q.Amount, &q.Payor, &q.ARID, &q.AcctRule, &q.FLAGS, &q.DID)\n\treturn q, err\n}", "title": "" }, { "docid": "ab0afacc19febe81724b4bd97327182d", "score": "0.44572186", "text": "func (s *sqlPrimaryIngester) Process(ctx context.Context, fileName string) error {\n\ts.filesProcessed.Inc(1)\n\tctx, cancel := context.WithTimeout(ctx, 2*time.Minute)\n\tdefer cancel()\n\tctx, span := trace.StartSpan(ctx, \"ingestion_SQLPrimaryBranchProcess\")\n\tdefer span.End()\n\tr, err := s.source.GetReader(ctx, fileName)\n\tif err != nil {\n\t\treturn skerr.Wrap(err)\n\t}\n\tgr, err := processGoldResults(ctx, r)\n\tif err != nil {\n\t\treturn skerr.Wrapf(err, \"could not process file %s from source %s\", fileName, s.source)\n\t}\n\tif len(gr.Results) == 0 {\n\t\tsklog.Infof(\"file %s had no results\", fileName)\n\t\treturn nil\n\t}\n\tspan.AddAttributes(trace.Int64Attribute(\"num_results\", int64(len(gr.Results))))\n\tsklog.Infof(\"Ingesting %d results from file %s\", len(gr.Results), fileName)\n\n\tcommitID, tileID, err := s.getCommitAndTileID(ctx, gr)\n\tif err != nil {\n\t\treturn skerr.Wrapf(err, \"identifying commit id for file %s\", fileName)\n\t}\n\tsourceFileID := md5.Sum([]byte(fileName))\n\n\tif err := s.writeData(ctx, gr, commitID, tileID, sourceFileID[:]); err != nil {\n\t\tsklog.Errorf(\"Error writing data for file %s: %s\", fileName, err)\n\t\treturn ingestion.ErrRetryable\n\t}\n\n\tif err := s.upsertSourceFile(ctx, sourceFileID[:], fileName); err != nil {\n\t\tsklog.Errorf(\"Error writing to SourceFiles for file %s: %s\", fileName, err)\n\t\treturn ingestion.ErrRetryable\n\t}\n\ts.filesSuccess.Inc(1)\n\ts.resultsIngested.Inc(int64(len(gr.Results)))\n\treturn nil\n}", "title": "" }, { "docid": "202872f9c14953b17f75b6e75f2ab29c", "score": "0.44480863", "text": "func convertSrcRow_Gray(fp *FPObject, wc *convertSrcWorkContext, j int) {\n\tfor i := 0; i < fp.srcW; i++ {\n\t\tsrcPix := wc.src_AsGray.Pix[wc.src_AsGray.Stride*j+i]\n\n\t\t// Identify the slice of samples representing this pixel in the\n\t\t// converted image.\n\t\tdstSam := wc.dst.Pix[j*wc.dst.Stride+i*4 : j*wc.dst.Stride+i*4+4]\n\n\t\t// Do color correction, if necessary.\n\t\tif fp.inputCCF != nil && wc.inputLUT_8to32 != nil {\n\t\t\t// Convert to linear color, using a lookup table.\n\t\t\tdstSam[0] = wc.inputLUT_8to32[srcPix]\n\t\t} else {\n\t\t\t// In all other cases, first copy the uncorrected sample to dstSam.\n\t\t\tdstSam[0] = float32(srcPix) / 255.0\n\n\t\t\tif fp.inputCCF != nil {\n\t\t\t\t// Convert to linear color, without a lookup table.\n\t\t\t\tfp.inputCCF(dstSam[0:1])\n\t\t\t}\n\t\t}\n\t\tdstSam[1] = dstSam[0]\n\t\tdstSam[2] = dstSam[0]\n\t\tdstSam[3] = 1.0\n\t}\n}", "title": "" }, { "docid": "69d8fb2dbb8d799b61c707c6a82e69ad", "score": "0.44422525", "text": "func (d *sortedDistinct) Next() (rowenc.EncDatumRow, *execinfrapb.ProducerMetadata) {\n\tfor d.State == execinfra.StateRunning {\n\t\trow, meta := d.input.Next()\n\t\tif meta != nil {\n\t\t\tif meta.Err != nil {\n\t\t\t\td.MoveToDraining(nil /* err */)\n\t\t\t}\n\t\t\treturn nil, meta\n\t\t}\n\t\tif row == nil {\n\t\t\td.MoveToDraining(nil /* err */)\n\t\t\tbreak\n\t\t}\n\t\tmatched, err := d.matchLastGroupKey(row)\n\t\tif err != nil {\n\t\t\td.MoveToDraining(err)\n\t\t\tbreak\n\t\t}\n\t\tif matched {\n\t\t\tif d.errorOnDup != \"\" {\n\t\t\t\t// Row is a duplicate input to an Upsert operation, so raise an error.\n\t\t\t\t// TODO(knz): errorOnDup could be passed via log.Safe() if\n\t\t\t\t// there was a guarantee that it does not contain PII.\n\t\t\t\terr = pgerror.Newf(pgcode.CardinalityViolation, \"%s\", d.errorOnDup)\n\t\t\t\td.MoveToDraining(err)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\td.haveLastGroupKey = true\n\t\tcopy(d.lastGroupKey, row)\n\n\t\tif outRow := d.ProcessRowHelper(row); outRow != nil {\n\t\t\treturn outRow, nil\n\t\t}\n\t}\n\treturn nil, d.DrainHelper()\n}", "title": "" }, { "docid": "a5b7cdf2a2f4c592ccf56c027ddf9cdd", "score": "0.4442152", "text": "func (b *BatchInsertBuilder) Row(row map[string]interface{}) error {\n\tif b.columns == nil {\n\t\tb.columns = make([]string, 0, len(row))\n\t\tb.rows = make([][]interface{}, 0)\n\n\t\tfor column := range row {\n\t\t\tb.columns = append(b.columns, column)\n\t\t}\n\n\t\tsort.Strings(b.columns)\n\t}\n\n\tif len(b.columns) != len(row) {\n\t\treturn errors.Errorf(\"invalid number of columns (expected=%d, actual=%d)\", len(b.columns), len(row))\n\t}\n\n\trowSlice := make([]interface{}, 0, len(b.columns))\n\tfor _, column := range b.columns {\n\t\tval, ok := row[column]\n\t\tif !ok {\n\t\t\treturn errors.Errorf(`column \"%s\" does not exist`, column)\n\t\t}\n\t\trowSlice = append(rowSlice, val)\n\t}\n\n\tb.rows = append(b.rows, rowSlice)\n\n\t// Call Exec when MaxBatchSize is reached.\n\tif len(b.rows) == b.MaxBatchSize {\n\t\treturn b.Exec()\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "e69576d905f0b2a9b831d0d181625e90", "score": "0.4420774", "text": "func (p *partitionImpl) InsertRowData(row []byte, meta []byte, varRowData map[string]interface{}, serializedVarRowData map[string][]byte, pos int) error {\n\tif err := p.CanInsertRowData(row); err != nil {\n\t\treturn err\n\t}\n\trowWidth := p.widestSchema.Size()\n\tnumCols := p.widestSchema.NumColumns()\n\t// shift row data\n\tcopy(p.rows[(pos+1)*rowWidth:], p.rows[pos*rowWidth:p.numRows*rowWidth])\n\t// insert row data\n\tcopy(p.rows[pos*rowWidth:(pos+1)*rowWidth], row)\n\t// shift meta data\n\tcopy(p.rowMeta[(pos+1)*numCols:], p.rowMeta[pos*numCols:p.numRows*numCols])\n\t// insert meta data\n\tcopy(p.rowMeta[pos*numCols:(pos+1)*numCols], meta)\n\t// shift variable length row data\n\tcopy(p.varRowData[pos+1:], p.varRowData[pos:p.numRows])\n\t// insert variable length row data\n\tp.varRowData[pos] = varRowData\n\t// shift serialized variable length row data\n\tcopy(p.serializedVarRowData[pos+1:], p.serializedVarRowData[pos:p.numRows])\n\t// insert serialized variable length row data\n\tp.serializedVarRowData[pos] = serializedVarRowData\n\tp.numRows++\n\treturn nil\n}", "title": "" }, { "docid": "da3dbe432dd4602cab3f0da4f39dc4e4", "score": "0.44095898", "text": "func ScanRow(rows *sql.Rows, dst interface{}) error {\n\tdefer rows.Close()\n\treturn Scan(rows, dst)\n}", "title": "" }, { "docid": "59a72352c02e7c107e85cd504ee67dc2", "score": "0.4408775", "text": "func processLine(input string) (string, error) {\n\tvalueIdx := strings.Index(input, \"value: \")\n\tsourceIdx := strings.Index(input, \"#source \")\n\n\tif valueIdx == -1 || sourceIdx == -1 || valueIdx >= sourceIdx {\n\t\t// not the string we are interested in, skipping\n\t\treturn input, nil\n\t}\n\n\tfilePath := input[sourceIdx+len(\"#source \"):]\n\tfile, err := os.Open(filePath)\n\tif err != nil {\n\t\treturn input, fmt.Errorf(\"can not open file %s: %w\", filePath, err)\n\t}\n\n\tfileBytes, err := ioutil.ReadAll(file)\n\tif err != nil {\n\t\treturn input, fmt.Errorf(\"can not read file: %w\", err)\n\t}\n\n\tvar jsonContent interface{} // anything\n\tif err := json.Unmarshal(fileBytes, &jsonContent); err != nil {\n\t\treturn input, fmt.Errorf(\"can not parse json from file %s: %w\", filePath, err)\n\t}\n\n\tjsonFile, err := json.Marshal(jsonContent)\n\tif err != nil {\n\t\treturn input, fmt.Errorf(\"can not marshal json for value %#v: %w\", jsonContent, err)\n\t}\n\n\toutput := input[:valueIdx] + \"value: \" + string(jsonFile) + \" #source \" + filePath\n\n\treturn output, nil\n}", "title": "" }, { "docid": "75a04e719203d2ed1c2efc07c65ed55c", "score": "0.4401177", "text": "func (p *ProcessReader) PreReadRow() [][]interface{} {\n\treturn p.data\n}", "title": "" }, { "docid": "b494bcc1708ea993d4a8916ffe200e29", "score": "0.44006315", "text": "func (o *cursorOffsetNext) processRecordBatch(\n\tfp *FetchPartition,\n\tbatch *kmsg.RecordBatch,\n\taborter aborter,\n\tdecompressor *decompressor,\n) {\n\tif batch.Magic != 2 {\n\t\tfp.Err = fmt.Errorf(\"unknown batch magic %d\", batch.Magic)\n\t\treturn\n\t}\n\trawRecords := batch.Records\n\tif compression := byte(batch.Attributes & 0x0007); compression != 0 {\n\t\tvar err error\n\t\tif rawRecords, err = decompressor.decompress(rawRecords, compression); err != nil {\n\t\t\tfp.Err = fmt.Errorf(\"unable to decompress batch: %v\", err)\n\t\t\treturn\n\t\t}\n\t}\n\tkrecords, err := kmsg.ReadRecords(int(batch.NumRecords), rawRecords)\n\tif err != nil {\n\t\tfp.Err = fmt.Errorf(\"invalid record batch: %v\", err)\n\t\treturn\n\t}\n\n\tabortBatch := aborter.shouldAbortBatch(batch)\n\tvar lastRecord *Record\n\tfor i := range krecords {\n\t\trecord := recordToRecord(\n\t\t\to.from.topic,\n\t\t\tfp.Partition,\n\t\t\tbatch,\n\t\t\t&krecords[i],\n\t\t)\n\t\tlastRecord = record\n\t\to.maybeKeepRecord(fp, record, abortBatch)\n\t}\n\n\tif abortBatch && lastRecord != nil && lastRecord.Attrs.IsControl() {\n\t\taborter.trackAbortedPID(batch.ProducerID)\n\t}\n}", "title": "" }, { "docid": "5aee05aaf254bd1d1ef6f143c60e9600", "score": "0.43988553", "text": "func (r TxRunner) QueryRow(query string, args ...interface{}) squirrel.RowScanner {\n\treturn r.Tx.QueryRow(query, args...)\n}", "title": "" }, { "docid": "60579b0faae17d08b852841b3a7a0213", "score": "0.43907174", "text": "func Collect(result Result) ([]Row, error) {\n\trows := make([]Row, 0, 30)\n\tfor result.NextRow() {\n\t\trows = append(rows, result.GetRow())\n\t}\n\treturn rows, errors.WithMessage(result.Err(), \"failed to Collect rows\")\n}", "title": "" }, { "docid": "ad75692304f704c1b0b3646524049d18", "score": "0.4388", "text": "func processVolumeWorkResult(ctxPtr interface{}, res worker.WorkResult) error {\n\tctx := ctxPtr.(*volumemgrContext)\n\td := res.Description.(volumeWorkDescription)\n\tif d.create {\n\t\tif !updateVolumeStatus(ctx, d.status.VolumeID) {\n\t\t\t//if it ends up after deleting of status we must do cleanup\n\t\t\tlog.Warnf(\"processVolumeWorkResult: no status for %s after create, will delete\", d.status.VolumeID)\n\t\t\tDeleteWorkCreate(ctx, &d.status)\n\t\t\td.status.FileLocation = d.FileLocation\n\t\t\td.status.SubState = types.VolumeSubStateDeleting\n\t\t\tAddWorkDestroy(ctx, &d.status)\n\t\t}\n\t} else {\n\t\tstatus := ctx.LookupVolumeStatus(d.status.Key())\n\t\tif status == nil {\n\t\t\tlog.Functionf(\"processVolumeWorkResult for %v, VolumeStatus not found\", d.status.Key())\n\t\t\treturn nil\n\t\t}\n\t\tlog.Functionf(\"processVolumeWorkResult for %v, VolumeStatus found\", d.status.Key())\n\t\tupdateVolumeStatusRefCount(ctx, status)\n\t\tmaybeDeleteVolume(ctx, status)\n\t\tmaybeSpaceAvailable(ctx)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f6f59525d8613034ca49f56a84ff1265", "score": "0.43819213", "text": "func (m *CasesEdiscoveryCasesItemLegalHoldsItemUserSourcesUserSourceItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *CasesEdiscoveryCasesItemLegalHoldsItemUserSourcesUserSourceItemRequestBuilderDeleteRequestConfiguration)(error) {\n requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "7e05db39313c85a52d6c278fd36402cf", "score": "0.43781835", "text": "func TransformRow(rows *sql.Rows, model interface{}) error {\n\tmodelType := reflect.TypeOf(model).Elem()\n\tmodelValue := reflect.ValueOf(model)\n\tcolumns, err := rows.Columns()\n\tvalues := make([]interface{}, 0)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, column := range columns {\n\t\tfor i := 0; i < modelType.NumField(); i++ {\n\t\t\tfield := modelType.Field(i)\n\t\t\tdbfield := field.Tag.Get(\"dbfield\")\n\t\t\tif dbfield != column {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvalues = append(values, modelValue.Elem().Field(i).Addr().Interface())\n\t\t}\n\t}\n\tif err = rows.Scan(values...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "dbe413fc74e4017ed1e7e70fe479b66b", "score": "0.4362885", "text": "func (d *distinct) Next() (rowenc.EncDatumRow, *execinfrapb.ProducerMetadata) {\n\tfor d.State == execinfra.StateRunning {\n\t\trow, meta := d.input.Next()\n\t\tif meta != nil {\n\t\t\tif meta.Err != nil {\n\t\t\t\td.MoveToDraining(nil /* err */)\n\t\t\t}\n\t\t\treturn nil, meta\n\t\t}\n\t\tif row == nil {\n\t\t\td.MoveToDraining(nil /* err */)\n\t\t\tbreak\n\t\t}\n\n\t\t// If we are processing DISTINCT(x, y) and the input stream is ordered\n\t\t// by x, we define x to be our group key. Our seen set at any given time\n\t\t// is only the set of all rows with the same group key. The encoding of\n\t\t// the row is the key we use in our 'seen' set.\n\t\tencoding, err := d.encode(d.scratch, row)\n\t\tif err != nil {\n\t\t\td.MoveToDraining(err)\n\t\t\tbreak\n\t\t}\n\t\td.scratch = encoding[:0]\n\n\t\t// The 'seen' set is reset whenever we find consecutive rows differing on the\n\t\t// group key thus avoiding the need to store encodings of all rows.\n\t\tmatched, err := d.matchLastGroupKey(row)\n\t\tif err != nil {\n\t\t\td.MoveToDraining(err)\n\t\t\tbreak\n\t\t}\n\n\t\tif !matched {\n\t\t\t// Since the sorted distinct columns have changed, we know that all the\n\t\t\t// distinct keys in the 'seen' set will never be seen again. This allows\n\t\t\t// us to keep the current arena block and overwrite strings previously\n\t\t\t// allocated on it, which implies that UnsafeReset() is safe to call here.\n\t\t\tcopy(d.lastGroupKey, row)\n\t\t\td.haveLastGroupKey = true\n\t\t\tif err := d.arena.UnsafeReset(d.Ctx); err != nil {\n\t\t\t\td.MoveToDraining(err)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\td.seen = make(map[string]struct{})\n\t\t}\n\n\t\t// Check whether row is distinct.\n\t\tif _, ok := d.seen[string(encoding)]; ok {\n\t\t\tif d.errorOnDup != \"\" {\n\t\t\t\t// Row is a duplicate input to an Upsert operation, so raise\n\t\t\t\t// an error.\n\t\t\t\t//\n\t\t\t\t// TODO(knz): errorOnDup could be passed via log.Safe() if\n\t\t\t\t// there was a guarantee that it does not contain PII. Or\n\t\t\t\t// better yet, the caller would construct an `error` object to\n\t\t\t\t// return here instead of a string.\n\t\t\t\t// See: https://github.com/cockroachdb/cockroach/issues/48166\n\t\t\t\terr = pgerror.Newf(pgcode.CardinalityViolation, \"%s\", d.errorOnDup)\n\t\t\t\td.MoveToDraining(err)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\ts, err := d.arena.AllocBytes(d.Ctx, encoding)\n\t\tif err != nil {\n\t\t\td.MoveToDraining(err)\n\t\t\tbreak\n\t\t}\n\t\td.seen[s] = struct{}{}\n\n\t\tif outRow := d.ProcessRowHelper(row); outRow != nil {\n\t\t\treturn outRow, nil\n\t\t}\n\t}\n\treturn nil, d.DrainHelper()\n}", "title": "" }, { "docid": "8d4f89fbd90380853b85afba90071d05", "score": "0.43621045", "text": "func (e *Engine) mixRelatedRows(tokens []string, tabToSubjugates map[tableID]cachedSubjugateList, rows map[string]*resultRow, config *Config) error {\n\tfor _, row := range rows {\n\t\t// Get the list of subjugates (we cache them the first time we see a new root table)\n\t\tsubs := tabToSubjugates[row.srctab]\n\t\tif subs == nil {\n\t\t\ttable, err := e.getTableFromID(row.srctab)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tdbName, db := config.getDatabaseFromTable(table)\n\t\t\trels := table.subjugateRelations(db)\n\t\t\tfor _, rel := range rels {\n\t\t\t\tforeignTableID, err := e.getTableID(MakeTableName(dbName, rel.relation.ForeignTable), true)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsubs = append(subs, &cachedSubjugate{\n\t\t\t\t\tforeignTableID: foreignTableID,\n\t\t\t\t\trelation: rel.relation,\n\t\t\t\t\tforeignTable: rel.foreignTable,\n\t\t\t\t\tuseInSearchJoin: rel.useInSearchJoin,\n\t\t\t\t})\n\t\t\t}\n\t\t\t//fmt.Printf(\"%v.%v subs: %v\\n\", dbName, table.FriendlyName, subs)\n\t\t\ttabToSubjugates[row.srctab] = subs\n\t\t}\n\n\t\t// overlay the matched tokens of our subjugates into our own result\n\t\t_, vpos := unpackNextRow(row.srcrows[:])\n\t\tfor _, sub := range subs {\n\t\t\tsubRowNum, inc := unpackNextRow(row.srcrows[vpos:])\n\t\t\tvpos += inc\n\t\t\tif !sub.useInSearchJoin {\n\t\t\t\t// As a performance optimization, we don't include this row in our result, because\n\t\t\t\t// this row is related to us OneToOne, but when we visit HIM, then HE will raise\n\t\t\t\t// HIS rank because of his relation to us. This is probably a trivial optimization,\n\t\t\t\t// and I'm not sure it's really worth keeping track of \"useInSearchJoin\", for total\n\t\t\t\t// code size sake.\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t//fmt.Printf(\"Reading sub %v/%v. vpos = %v. subRowNum = %v. len(row.srcrows) = %v\\n\", isub+1, len(subs), vpos, subRowNum, len(row.srcrows))\n\t\t\tsubResultRow := rows[resultRowHashKey(sub.foreignTableID, subRowNum)]\n\t\t\tif subResultRow != nil {\n\t\t\t\t//fmt.Printf(\"Merging related row %v -----------------------\\n\", subRowNum)\n\t\t\t\trow.mergeRelatedIntoSelf(len(tokens), subResultRow)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5e4406dbbe7d25bcd7fa2068027d556e", "score": "0.43599513", "text": "func (u *UpsertBatchBuilder) RemoveRow() {\n\tif u.NumRows > 0 {\n\t\tfor _, column := range u.columns {\n\t\t\tcolumn.RemoveRow()\n\t\t}\n\t\tu.NumRows--\n\t}\n}", "title": "" }, { "docid": "6e355905dac55effa3b9af904dd00571", "score": "0.43590164", "text": "func (n *ExternalProcedure) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error) {\n\t// The function's structure has been verified by the analyzer, so no need to double-check any of it here\n\tfuncVal := reflect.ValueOf(n.Function)\n\tfuncType := funcVal.Type()\n\t// The first parameter is always the context, but it doesn't exist as far as the stored procedures are concerned, so\n\t// we prepend it here\n\tfuncParams := make([]reflect.Value, len(n.Params)+1)\n\tfuncParams[0] = reflect.ValueOf(ctx)\n\n\tfor i := range n.Params {\n\t\tparamDefinition := n.ParamDefinitions[i]\n\t\tvar funcParamType reflect.Type\n\t\tif paramDefinition.Variadic {\n\t\t\tfuncParamType = funcType.In(funcType.NumIn() - 1).Elem()\n\t\t} else {\n\t\t\tfuncParamType = funcType.In(i + 1)\n\t\t}\n\t\t// Grab the passed-in variable and convert it to the type we expect\n\t\texprParamVal, err := n.Params[i].Eval(ctx, nil)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\texprParamVal, _, err = paramDefinition.Type.Convert(exprParamVal)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfuncParams[i+1], err = n.ProcessParam(ctx, funcParamType, exprParamVal)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tout := funcVal.Call(funcParams)\n\n\t// Again, these types are enforced in the analyzer, so it's safe to assume their types here\n\tif err, ok := out[1].Interface().(error); ok { // Only evaluates to true when error is not nil\n\t\treturn nil, err\n\t}\n\tfor i, paramDefinition := range n.ParamDefinitions {\n\t\tif paramDefinition.Direction == ProcedureParamDirection_Inout || paramDefinition.Direction == ProcedureParamDirection_Out {\n\t\t\texprParam := n.Params[i]\n\t\t\tfuncParamVal := funcParams[i+1].Elem().Interface()\n\t\t\terr := exprParam.Set(funcParamVal, exprParam.Type())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t}\n\t// It's not invalid to return a nil RowIter, as having no rows to return is expected of many stored procedures.\n\tif rowIter, ok := out[0].Interface().(sql.RowIter); ok {\n\t\treturn rowIter, nil\n\t}\n\treturn sql.RowsToRowIter(), nil\n}", "title": "" }, { "docid": "102cb2bf4d3d0bae8b41548229200fa8", "score": "0.43557426", "text": "func (tc ExtractorTestCase) Run(t *testing.T) {\n\t// Go through the Rows and update the Extractor\n\terr := Run(tc.stream, tc.extractor, nil, 0)\n\n\t// Check the error\n\tif err == nil {\n\t\tif tc.isErr == true {\n\t\t\tt.Error(\"expected an error, got nil\")\n\t\t\treturn\n\t\t}\n\t} else {\n\t\tif tc.isErr == false {\n\t\t\tt.Errorf(\"expected no error, got %v\", err)\n\t\t\treturn\n\t\t}\n\t\treturn\n\t}\n\n\t// Collect and check the output\n\tb := &strings.Builder{}\n\tsink := NewCSVSink(b)\n\tsink.Write(tc.extractor.Collect())\n\toutput := b.String()\n\tif output != tc.output {\n\t\tt.Errorf(\"got:\\n%swant:\\n%s\", output, tc.output)\n\t}\n\n\t// Check the size\n\tsize := tc.extractor.Size()\n\tif size != tc.size {\n\t\tt.Errorf(\"got: %d, want: %d\\n\", size, tc.size)\n\t}\n}", "title": "" }, { "docid": "23cb7f91e01735b08e9668f394882018", "score": "0.43544325", "text": "func processPlan(plan *Plan, dc DataContext, result chan error) {\n\tif err := plan.Execute(context.Background(), plan.ID()+\"_execute\", dc); err != nil {\n\t\tresult <- errors.Wrap(err, \"Plan.Execute failed\")\n\t}\n\tif err := plan.Down(context.Background()); err != nil {\n\t\tresult <- errors.Wrap(err, \"Plan.Down failed\")\n\t}\n\tresult <- nil\n}", "title": "" }, { "docid": "9d7cb77323e19a5fcafe583dc8ed0178", "score": "0.43527317", "text": "func (r *Row) Scan(dest ...interface{}) error {\n\tif r.err != nil {\n\t\treturn r.err\n\t}\n\n\t// TODO(bradfitz): for now we need to defensively clone all\n\t// []byte that the driver returned (not permitting\n\t// *RawBytes in Rows.Scan), since we're about to close\n\t// the Rows in our defer, when we return from this function.\n\t// the contract with the driver.Next(...) interface is that it\n\t// can return slices into read-only temporary memory that's\n\t// only valid until the next Scan/Close. But the TODO is that\n\t// for a lot of drivers, this copy will be unnecessary. We\n\t// should provide an optional interface for drivers to\n\t// implement to say, \"don't worry, the []bytes that I return\n\t// from Next will not be modified again.\" (for instance, if\n\t// they were obtained from the network anyway) But for now we\n\t// don't care.\n\tdefer r.rows.Close()\n\tfor _, dp := range dest {\n\t\tif _, ok := dp.(*sql.RawBytes); ok {\n\t\t\treturn errors.New(\"sql: RawBytes isn't allowed on Row.Scan\")\n\t\t}\n\t}\n\n\tif !r.rows.Next() {\n\t\tif err := r.rows.Err(); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn sql.ErrNoRows\n\t}\n\terr := r.rows.Scan(dest...)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Make sure the query can be processed to completion with no errors.\n\tif err := r.rows.Close(); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "763119972cab8a9b182e622bfc9ec845", "score": "0.43498617", "text": "func RemoveSource(handle MainloopSourceHandle) {\n\tC.sol_mainloop_del_source(handle.msi.handle)\n\tC.free(unsafe.Pointer(handle.msi.source))\n\tC.free(unsafe.Pointer(handle.msi))\n}", "title": "" }, { "docid": "2b1747b3152f50c302ea09d96abd2fce", "score": "0.43401736", "text": "func (e *FilterExec) Next() (*Row, error) {\n\tfor {\n\t\tsrcRow, err := e.Src.Next()\n\t\tif err != nil {\n\t\t\treturn nil, errors.Trace(err)\n\t\t}\n\t\tif srcRow == nil {\n\t\t\treturn nil, nil\n\t\t}\n\t\tmatch, err := evaluator.EvalBool(e.ctx, e.Condition)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Trace(err)\n\t\t}\n\t\tif match {\n\t\t\treturn srcRow, nil\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9d27877b15699e30a1ca5ebe31dca60d", "score": "0.43392512", "text": "func (p *planner) queryRow(sql string, args ...interface{}) (parser.DTuple, error) {\n\tplan, err := p.query(sql, args...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif err := plan.Start(); err != nil {\n\t\treturn nil, err\n\t}\n\tif next, err := plan.Next(); !next {\n\t\treturn nil, err\n\t}\n\tvalues := plan.Values()\n\tnext, err := plan.Next()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif next {\n\t\treturn nil, errors.Errorf(\"%s: unexpected multiple results\", sql)\n\t}\n\treturn values, nil\n}", "title": "" }, { "docid": "32a916be9b689741de0c76a8622bdd0a", "score": "0.43371794", "text": "func (e *jsonEncoder) Row(tp int, row *[]interface{}, seqno uint64, _ time.Time) ([]byte, error) {\n\tcf := e.convertRowToCommonFormat(tp, row, e.inSchema, seqno, e.filter)\n\treturn e.CommonFormatEncode(cf)\n}", "title": "" }, { "docid": "69284002fd161427c3a5ad5e38682826", "score": "0.43357334", "text": "func (o *SourceType) Delete(exec boil.Executor) error {\n\tif o == nil {\n\t\treturn errors.New(\"mdbmdbmodels: no SourceType provided for delete\")\n\t}\n\n\targs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), sourceTypePrimaryKeyMapping)\n\tsql := \"DELETE FROM \\\"source_types\\\" WHERE \\\"id\\\"=$1\"\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, sql)\n\t\tfmt.Fprintln(boil.DebugWriter, args...)\n\t}\n\n\t_, err := exec.Exec(sql, args...)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"mdbmdbmodels: unable to delete from source_types\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "eb2905698de3da9b161a2e4547099ff9", "score": "0.43277776", "text": "func (e *SortExec) Next() (*Row, error) {\n\tif !e.fetched {\n\t\tfor {\n\t\t\tsrcRow, err := e.Src.Next()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.Trace(err)\n\t\t\t}\n\t\t\tif srcRow == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\torderRow := &orderByRow{\n\t\t\t\trow: srcRow,\n\t\t\t\tkey: make([]interface{}, len(e.ByItems)),\n\t\t\t}\n\t\t\tfor i, byItem := range e.ByItems {\n\t\t\t\torderRow.key[i], err = evaluator.Eval(e.ctx, byItem.Expr)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, errors.Trace(err)\n\t\t\t\t}\n\t\t\t}\n\t\t\te.Rows = append(e.Rows, orderRow)\n\t\t}\n\t\tsort.Sort(e)\n\t\te.fetched = true\n\t}\n\tif e.err != nil {\n\t\treturn nil, errors.Trace(e.err)\n\t}\n\tif e.Idx >= len(e.Rows) {\n\t\treturn nil, nil\n\t}\n\trow := e.Rows[e.Idx].row\n\te.Idx++\n\treturn row, nil\n}", "title": "" }, { "docid": "8cf6f6a3045bb7578e5cf5666fa30583", "score": "0.4326996", "text": "func (ii *InsertInto) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error) {\n\treturn newInsertIter(ctx, ii.Destination, ii.Source, ii.IsReplace, ii.OnDupExprs, ii.Checks, row, ii.Ignore)\n}", "title": "" }, { "docid": "88d3951b87c7c2b7d7f9cf0b60e8bd33", "score": "0.43212587", "text": "func (ru *RecordfoodUpdate) ClearRECORDSOURCE() *RecordfoodUpdate {\n\tru.mutation.ClearRECORDSOURCE()\n\treturn ru\n}", "title": "" }, { "docid": "84aaee19f8a3ae7eab6c66fdda3cea3e", "score": "0.4320703", "text": "func (t *transactor) Map(sql string, args interface{}, rm RowMapper) (err error) {\n\tvar (\n\t\trows *sqlx.Rows\n\t)\n\n\tnsql, nargs, err := t.normalizeSql(sql, args)\n\tif err != nil {\n\t\treturn t.rollback(err)\n\t}\n\n\trows, err = t.tx.Queryx(nsql, nargs...)\n\tif err != nil {\n\t\treturn t.rollback(err)\n\t}\n\n\tdefer func() {\n\t\tif cerr := rows.Close(); err == nil && cerr != nil {\n\t\t\terr = cerr\n\t\t}\n\t}()\n\n\terr = rm(rows)\n\tif err != nil {\n\t\treturn t.rollback(err)\n\t}\n\n\treturn err\n}", "title": "" }, { "docid": "0c8d31aaf26990a84cc52736429c9fa0", "score": "0.43168083", "text": "func ResultStoreColumnReader(client *DownloadClient, reprocess time.Duration) updater.ColumnReader {\n\treturn func(ctx context.Context, log logrus.FieldLogger, tg *configpb.TestGroup, oldCols []updater.InflatedColumn, defaultStop time.Time, receivers chan<- updater.InflatedColumn) error {\n\t\tstop := updateStop(log, tg, time.Now(), oldCols, defaultStop, reprocess)\n\t\tids, err := search(ctx, log, client, tg.GetResultSource().GetResultstoreConfig().GetProject(), stop)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error searching invocations: %v\", err)\n\t\t}\n\t\tinvocationErrors := make(map[string]error)\n\t\tvar results []*fetchResult\n\t\tfor _, id := range ids {\n\t\t\tresult, invErr := client.FetchInvocation(ctx, log, id)\n\t\t\tif invErr != nil {\n\t\t\t\tinvocationErrors[id] = invErr\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tresults = append(results, result)\n\t\t}\n\n\t\tprocessedResults := processRawResults(log, results)\n\n\t\t// Reverse-sort invocations by start time.\n\t\tsort.SliceStable(processedResults, func(i, j int) bool {\n\t\t\treturn processedResults[i].InvocationProto.GetTiming().GetStartTime().GetSeconds() > processedResults[j].InvocationProto.GetTiming().GetStartTime().GetSeconds()\n\t\t})\n\n\t\tfor _, pr := range processedResults {\n\t\t\t// TODO: Make group ID something other than start time.\n\t\t\tinflatedCol := processGroup(tg, pr)\n\t\t\treceivers <- *inflatedCol\n\t\t}\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "057a10cde31c1ef4b8074f6b68c1e116", "score": "0.43143058", "text": "func (d DataSrc) Process() error {\n\n\tif len(*d.data) == 0 {\n\t\treturn ErrNoInts\n\t}\n\tfmt.Println(\"Processing...\")\n\tfor _, i := range *d.data {\n\t\td.C1 <- i\n\t}\n\tringSize := len(*d.data)\n\tgo d.RingBuf(ringSize)\n\t*d.data = make([]int, 0)\n\treturn nil\n}", "title": "" }, { "docid": "18aeccb3c9e7b0cc4aaa9769931b4513", "score": "0.43141213", "text": "func (p *partitionImpl) AppendRowData(row []byte, meta []byte, varData map[string]interface{}, serializedVarRowData map[string][]byte) error {\n\tif err := p.CanInsertRowData(row); err != nil {\n\t\treturn err\n\t}\n\tcopy(p.rows[p.numRows*p.widestSchema.Size():(p.numRows+1)*p.widestSchema.Size()], row)\n\tcopy(p.rowMeta[p.numRows*p.widestSchema.NumColumns():(p.numRows+1)*p.widestSchema.NumColumns()], meta)\n\tp.varRowData[p.numRows] = varData\n\tp.serializedVarRowData[p.numRows] = serializedVarRowData\n\tp.numRows++\n\treturn nil\n}", "title": "" } ]
c95cb654ed379c2db00ba36cd45b3501
Sum return sum of Collect parameter.
[ { "docid": "62cc5e9fafb3a797adface7b1eb1fb26", "score": "0.0", "text": "func (st *SectionStat) Sum() int64 {\n\treturn atomic.LoadInt64(&st.sum)\n}", "title": "" } ]
[ { "docid": "53c50ec2d1d8a6728adde84967afdd3b", "score": "0.79347855", "text": "func (s Sum) Collect() map[string]float64 {\n\treturn map[string]float64{\"sum\": s.sum}\n}", "title": "" }, { "docid": "b11619322ddceb61e965b8cd35b7c129", "score": "0.65249777", "text": "func Sum(cs *frontend.ConstraintSystem, v []frontend.Variable) frontend.Variable {\n\tres := cs.Constant(0)\n\tfor _, x := range v {\n\t\tres = cs.Add(res, x)\n\t}\n\treturn res\n}", "title": "" }, { "docid": "da95d2c2aa322afee6bebcfa3ef388c3", "score": "0.6483058", "text": "func (x Vector) Sum() float64 {\n\ts := 0.0\n\tfor _, v := range x {\n\t\ts += v\n\t}\n\treturn s\n}", "title": "" }, { "docid": "a1a07190f97cfa7cbbc924d3e96b08e1", "score": "0.6385612", "text": "func (v Vector) Sum() float64 {\n\tacc := 0.0\n\tfor _, el := range v {\n\t\tacc += el\n\t}\n\n\treturn acc\n}", "title": "" }, { "docid": "71fa0a0d5b486d1c3062f074a5288163", "score": "0.6320776", "text": "func (c *Aggregator) Sum() (core.Number, error) {\n\treturn c.ckptSum, nil\n}", "title": "" }, { "docid": "cbfabc179063e2e8bd79af84d0127816", "score": "0.62998176", "text": "func (a Vector) Sum() float64 {\n\tvar sum float64\n\tfor i := range a {\n\t\tsum += a[i]\n\t}\n\treturn sum\n}", "title": "" }, { "docid": "751c0f0f359b34de03c09106ccf9bef2", "score": "0.629963", "text": "func (c MapArrayCollection) Sum(key ...string) decimal.Decimal {\n\tvar sum = decimal.New(0, 0)\n\n\tfor i := 0; i < len(c.value); i++ {\n\t\tsum = sum.Add(nd(c.value[i][key[0]]))\n\t}\n\n\treturn sum\n}", "title": "" }, { "docid": "c68f644cf5fcf4cd7355599c0efa035b", "score": "0.6243104", "text": "func (v *Vector) Sum() (sum float64) {\n\tsum = 0.0\n\tfor _, elem := range v.Values {\n\t\tsum += elem\n\t}\n\treturn\n}", "title": "" }, { "docid": "c33b3aff50d83f9c8dade1367c22b02d", "score": "0.6231426", "text": "func (f feature) Sum() uint64 {\n\treturn f.sum\n}", "title": "" }, { "docid": "78267e3b9d945baf39c745176b42eb17", "score": "0.62206495", "text": "func (set NumSet) Sum() (result Num) {\n\tfor v := range set {\n\t\tresult += v\n\t}\n\treturn\n}", "title": "" }, { "docid": "f743bb92733ebf052a920b2ce1448d46", "score": "0.6178312", "text": "func sum(ctx context.Context, vs []int) (int, error) {\n\tsum := 0\n\n\tfor _, v := range vs {\n\t\tsum += v\n\t}\n\n\treturn sum, nil\n}", "title": "" }, { "docid": "792ee25140f1278f17c6f860c698e3cf", "score": "0.6106814", "text": "func (list NumList) Sum() (result Num) {\n\tfor _, v := range list {\n\t\tresult += v\n\t}\n\treturn\n}", "title": "" }, { "docid": "8281d798ed1887413107c6717d8d1016", "score": "0.6098483", "text": "func (s *CalcServerImpl) Sum(ctx context.Context, req *eprotoc.SumReq) (*eprotoc.SumResp, error) {\n\treturn sumInner(ctx, req)\n}", "title": "" }, { "docid": "f2393f07c82ab31618367196329e68cc", "score": "0.6097069", "text": "func Sum() *Aggregation {\n\treturn aggSum\n}", "title": "" }, { "docid": "7c1d1c3ed63ca0be93c9866447641501", "score": "0.6084129", "text": "func Sum(v []float64) (s float64) {\n\tfor _, e := range v {\n\t\ts += e\n\t}\n\treturn\n}", "title": "" }, { "docid": "b3509b4fd3d39a3cbc526af25f18f0cc", "score": "0.6059901", "text": "func (s *SampleSnapshot) Sum() int64 { return SampleSum(s.values) }", "title": "" }, { "docid": "3e879215b230329e7a1d613f3df12cab", "score": "0.6055164", "text": "func (v Scalar) Sum() Scalar {\n\treturn v\n}", "title": "" }, { "docid": "97898d6d68370a028594afca00c10979", "score": "0.6046466", "text": "func (c *Collect) Total() int64 {\n\treturn c.paginateTotal\n}", "title": "" }, { "docid": "c271dad504e17f1fe48ee55a07737a87", "score": "0.6033799", "text": "func (_Pool *PoolTransactor) Collect(opts *bind.TransactOpts, recipient common.Address, tickLower *big.Int, tickUpper *big.Int, amount0Requested *big.Int, amount1Requested *big.Int) (*types.Transaction, error) {\n\treturn _Pool.contract.Transact(opts, \"collect\", recipient, tickLower, tickUpper, amount0Requested, amount1Requested)\n}", "title": "" }, { "docid": "653b5f61c9234aa788ac7a01c77a4519", "score": "0.60149395", "text": "func (*ExampleSvc) Sum(vals [2]int, res *int) error {\n\t*res = vals[0] + vals[1]\n\treturn nil\n}", "title": "" }, { "docid": "bb313dc452158496e7b5c4fe8f53bc1a", "score": "0.5992682", "text": "func Sum(a, b float64, count int) float64 { return a + b }", "title": "" }, { "docid": "f9a176ba8caf509f69e9094dc98c4e24", "score": "0.5981974", "text": "func (td *Concurrent) TotalSum() (s float64) {\n\ttd.Read(func(r Reader) { s = r.TotalSum() })\n\treturn s\n}", "title": "" }, { "docid": "44b72c9ac2fc928d94adbfd335697e50", "score": "0.5975734", "text": "func (s *Statistic) Sum() float64 { return s.sum }", "title": "" }, { "docid": "fc25f1fd3fe3a3a79c4f129d309f19ed", "score": "0.5973666", "text": "func (x RVec) Sum() float64 {\n\tL, U := x.Ix()\n\ts := 0.0\n\tfor i := L; i <= U; i++ {\n\t\ts += x.E(i)\n\t}\n\treturn s\n}", "title": "" }, { "docid": "0b4691289133212136eb8696cdba5fbb", "score": "0.5960873", "text": "func Sum(in []int) int {\n\tres := 0\n\tfor _, r := range in {\n\t\tres += r\n\t}\n\treturn res\n}", "title": "" }, { "docid": "8cdf9945e8e8a3e1a19ca50dc4f7d931", "score": "0.5960161", "text": "func (v *Vec) Sum() (float64, error) {\n\tvar sum C.PetscScalar\n\tperr := C.VecSum(v.v, &sum)\n\tif perr != 0 {\n\t\treturn 0, errors.New(\"Error in sum\")\n\t}\n\treturn float64(sum), nil\n}", "title": "" }, { "docid": "2a611b42794a0dfbf5a92e46992802cf", "score": "0.5949919", "text": "func Sum(v *[]float64) (result float64) {\n\tfor _, v := range *v {\n\t\tresult += v\n\t}\n\n\treturn result\n}", "title": "" }, { "docid": "edb9cadc9e3351e7bd2e33830138500b", "score": "0.5949536", "text": "func (m *Metric) Collect() (a AggregatedMetrics) {\n\tfor n := range m.collect(m.gen()) {\n\t\tvalue := aggregate(n.Value)\n\n\t\tswitch n.Name {\n\t\tcase \"Duration\":\n\t\t\ta.Duration = value\n\t\tcase \"Errors\":\n\t\t\ta.Errors = value\n\t\tcase \"Invocations\":\n\t\t\ta.Invocations = value\n\t\tcase \"Throttles\":\n\t\t\ta.Throttles = value\n\t\t}\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "1d9cd83a1cf37520fc20d10d7ab71e62", "score": "0.5948077", "text": "func Sum(nums []float64) float64 {\n\tvar total float64\n\tfor _, num := range nums {\n\t\ttotal += num\n\t}\n\treturn total\n}", "title": "" }, { "docid": "1a4923c584a1e131b6576b216fc3c3bc", "score": "0.59374684", "text": "func (b *GetBlockedQueryBuilder) Collect(ctx context.Context) ([]Elem, error) {\n\titer := b.Iter()\n\tc, err := iter.Total(ctx)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"get total\")\n\t}\n\n\tr := make([]Elem, 0, c)\n\tfor iter.Next(ctx) {\n\t\tr = append(r, iter.Value())\n\t}\n\n\treturn r, iter.Err()\n}", "title": "" }, { "docid": "93444bf5b2c9da31ed56c7f73c1852bf", "score": "0.5934586", "text": "func (s Ints) Sum() int64 {\n\tvar sum int64\n\tfor _, v := range s {\n\t\tsum += v\n\t}\n\treturn sum\n}", "title": "" }, { "docid": "191452ab3434762c4ccc4874b5e365ba", "score": "0.5923726", "text": "func (v Vec1) Sum() float64 {\n\treturn v[0]\n}", "title": "" }, { "docid": "398c7a0ba7791be4a067a3e511ff45ee", "score": "0.590799", "text": "func (o *ocDistAggregator) Sum() (number.Number, error) {\n\treturn o.sum, nil\n}", "title": "" }, { "docid": "02837f9edc4f9c3629d287ac57419195", "score": "0.59050864", "text": "func Collect(mon StatSource) map[string]float64 {\n\trv := make(map[string]float64)\n\tmon.Stats(func(name string, val float64) {\n\t\trv[name] = val\n\t})\n\treturn rv\n}", "title": "" }, { "docid": "1e301302784747791bc19fe317a3ff28", "score": "0.5897177", "text": "func (d *Data) Sum() (float64, error) { return Sum(*d) }", "title": "" }, { "docid": "2430fd4c51710f4711568588035593f2", "score": "0.5892006", "text": "func Sum(s []int) (sum int) {\n\tfor _, v := range s {\n\t\tsum += v\n\t}\n\treturn\n}", "title": "" }, { "docid": "ab9e6bc6191373ce81b7b7bec3363e27", "score": "0.5886084", "text": "func (m measurementsType) sum() time.Duration {\n\tvar sum time.Duration\n\tfor _, dur := range m {\n\t\tsum += dur\n\t}\n\treturn sum\n}", "title": "" }, { "docid": "bd518eae958379c9ecb673d164ca7373", "score": "0.58476645", "text": "func (s Skew) Collect() map[string]float64 {\n\treturn map[string]float64{\"skew\": (math.Sqrt(s.n) * s.m3) / math.Pow(s.m2, 1.5)}\n}", "title": "" }, { "docid": "f3bdf63f124bb0765981a11dd80679a1", "score": "0.5844702", "text": "func Sum(x []float64) float64 {\n\tsum := float64(0)\n\tfor _, val := range x {\n\t\tsum += val\n\t}\n\treturn sum\n}", "title": "" }, { "docid": "31ae1a5783ac2c6b75ea51ef29986648", "score": "0.5841047", "text": "func (a Float64Data) Sum() float64 {\n\tvar sum float64\n\n\tif len(a) == 0 {\n\t\treturn 0\n\t}\n\n\tsum = 0\n\tfor _, v := range a {\n\t\tsum += v\n\t}\n\treturn sum\n}", "title": "" }, { "docid": "cd2e0f1d1a582f4df42344ba9734c97b", "score": "0.58318233", "text": "func (m Max) Collect() map[string]float64 {\n\treturn map[string]float64{\"max\": m.max}\n}", "title": "" }, { "docid": "92e7f458697945b3199d25c237ca5071", "score": "0.5826282", "text": "func Sum(xi ...int) int {\n\ts := 0\n\tfor _, v := range xi {\n\t\ts += v\n\n\t}\n\treturn s\n}", "title": "" }, { "docid": "ca0656296688682e07ed346e3eaf9ad6", "score": "0.5825844", "text": "func Sum(data []float64) float64 {\n\tsum := 0.0\n\tfor _, d := range data {\n\t\tsum += d\n\t}\n\treturn sum\n}", "title": "" }, { "docid": "cd8dc02101f824140abd54731f1c8043", "score": "0.58217", "text": "func (s *ThingerRPCServer) Sum(params *Z_Thinger_SumParams, results *Z_Thinger_SumResults) error {\n\tr0 := s.impl.Sum(params.P0...)\n\n\tresults.R0 = r0\n\n\treturn nil\n}", "title": "" }, { "docid": "9983f6638cbc3ffa5b4d29df0c408a14", "score": "0.58216256", "text": "func (p *ConsP) Sum() interface{} {\n\tv := reflect.ValueOf(p.car) // Get Value from interface{}\n\tt := reflect.TypeOf(p.car) // Get Type from interface\n\t// Exit condition\n\tif p.cdr == nil {\n\t\treturn v.Interface()\n\t}\n\t// Fetch the method to call\n\tm, _ := t.MethodByName(\"Add\")\n\t// Setup method args\n\targs := make([]reflect.Value, 2)\n\targs[0] = v\n\targs[1] = reflect.ValueOf(p.cdr.Sum())\n\tval := m.Func.Call(args)[0] // Call\n\treturn val.Interface() // Wrap in interface and return\n}", "title": "" }, { "docid": "b865e18ec24b6a71a4369da26c032578", "score": "0.58188444", "text": "func Sum(p []float64) (sum float64) {\n\tfor _, x := range p {\n\t\tsum += x\n\t}\n\treturn\n}", "title": "" }, { "docid": "2ba0a43b9788c7ca4f7a5e3fd3b207e2", "score": "0.58100814", "text": "func (b *GetDialogsQueryBuilder) Collect(ctx context.Context) ([]Elem, error) {\n\titer := b.Iter()\n\tc, err := iter.Total(ctx)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"get total\")\n\t}\n\n\tr := make([]Elem, 0, c)\n\tfor iter.Next(ctx) {\n\t\tr = append(r, iter.Value())\n\t}\n\n\treturn r, iter.Err()\n}", "title": "" }, { "docid": "74ad6bd978981d46c93e630c0b5c7fdd", "score": "0.5797957", "text": "func Sum(xi ...int) int {\n\ts := 0\n\tfor _, v := range xi {\n\t\ts += v\n\t}\n\treturn s\n}", "title": "" }, { "docid": "b06991225fb01af8580008bae2f823bc", "score": "0.5795477", "text": "func Sum(a []int) int {\n\tsum := 0\n\tfor _, b := range a {\n\t\tsum += b\n\t}\n\treturn sum\n}", "title": "" }, { "docid": "a966e9be5df0fc91e0cd60ab04faee2e", "score": "0.5794042", "text": "func Sum(a, b Vec) Vec {\n\treturn Vec{\n\t\ta[0] + b[0],\n\t\ta[1] + b[1],\n\t}\n}", "title": "" }, { "docid": "83fa6b32f66c6c94c0b8510a17fca2af", "score": "0.57706565", "text": "func (stats IOStats) Sum() uint64 {\n\treturn stats.Sent + stats.Recvd\n}", "title": "" }, { "docid": "5dc7776d09f354895ee610592d6c12b9", "score": "0.5763112", "text": "func (*ExampleSvc) SumAll(vals []int, res *int) error {\n\tfor _, v := range vals {\n\t\t*res += v\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e88179611ddbdfd21e083d84b6b6f0ac", "score": "0.57628953", "text": "func Sum(items []int) int {\n\tsum := 0\n\n\tfor _, item := range items {\n\t\tsum += item\n\t}\n\n\treturn sum\n}", "title": "" }, { "docid": "35347eeea60a0c340e31399b5dee04a9", "score": "0.5761075", "text": "func Sum(p int) []Triplet {\n\n}", "title": "" }, { "docid": "39a789a38d08fc5ad533de1598ecfe29", "score": "0.5755915", "text": "func (p *RistrettoPoint) Sum(values []*RistrettoPoint) *RistrettoPoint {\n\tp.Identity()\n\tfor _, v := range values {\n\t\tp.Add(p, v)\n\t}\n\treturn p\n}", "title": "" }, { "docid": "1912f4e595023c7bed7e5d362d26f548", "score": "0.5749512", "text": "func (m *Maglev) Sum(b []byte) []byte {\n\tif len(b) > 0 {\n\t\tm.b.Write(b)\n\t}\n\treturn m.Get(m.b.Bytes())\n}", "title": "" }, { "docid": "0cbb4f651c255dcc8cde6f713881d8d8", "score": "0.57476777", "text": "func SumAll(numberCollections ...[]int) (result []int) {\n\tfor _, numbers := range numberCollections {\n\t\tresult = append(result, Sum(numbers))\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "1a76b4a099effb527433dfee89ea7c75", "score": "0.574672", "text": "func sumOf(list []int) int {\n\tsum := 0\n\tfor _, i := range list {\n\t\tsum += i\n\t}\n\treturn sum\n}", "title": "" }, { "docid": "0b79590fe3a9acdc18fa293a81f77189", "score": "0.5744376", "text": "func Collect(op string, err *error) func() {\n\treturn func() {\n\t\tif !enabled {\n\t\t\treturn\n\t\t}\n\t\tif err == nil || *err == nil {\n\t\t\tstats[succCount].add(op, 1)\n\t\t}\n\t\tstats[totalCount].add(op, 1)\n\t}\n}", "title": "" }, { "docid": "395f5dfe3cb2933db88a2f5d227a3b80", "score": "0.57436466", "text": "func Sum(input []float64) (sum float64) {\n\tfor _, number := range input {\n\t\tsum += number\n\t}\n\treturn\n}", "title": "" }, { "docid": "3d0a67749f66b0a697d521147d33b01e", "score": "0.5739382", "text": "func (_Pool *PoolTransactorSession) Collect(recipient common.Address, tickLower *big.Int, tickUpper *big.Int, amount0Requested *big.Int, amount1Requested *big.Int) (*types.Transaction, error) {\n\treturn _Pool.Contract.Collect(&_Pool.TransactOpts, recipient, tickLower, tickUpper, amount0Requested, amount1Requested)\n}", "title": "" }, { "docid": "42af18d6e9815a0c0ccf991a6796e1f1", "score": "0.57282925", "text": "func (_Pool *PoolSession) Collect(recipient common.Address, tickLower *big.Int, tickUpper *big.Int, amount0Requested *big.Int, amount1Requested *big.Int) (*types.Transaction, error) {\n\treturn _Pool.Contract.Collect(&_Pool.TransactOpts, recipient, tickLower, tickUpper, amount0Requested, amount1Requested)\n}", "title": "" }, { "docid": "846f8b9854a8f65908b2a386d3a87e82", "score": "0.5718831", "text": "func Sum(vals []int) int {\n\n\ts := 0\n\tfor _, v := range vals {\n\t\ts += v\n\t}\n\n\treturn s\n}", "title": "" }, { "docid": "6d053c1be0c572ba41574abf18dac110", "score": "0.57185733", "text": "func ParcialSum(e *Student) int {\n\ttotal := 0\n\tfor _, value := range e.subjects {\n\t\tintGrade := int(value.grade)\n\t\ttotal += value.academicCredits * intGrade\n\t}\n\n\treturn total\n}", "title": "" }, { "docid": "defc9b7cc848f569e4516619da13d985", "score": "0.57085264", "text": "func (s *ExpDecaySample) Sum() int64 {\n\treturn SampleSum(s.Values())\n}", "title": "" }, { "docid": "0afb8f877ef882ebbc13d964654c61b8", "score": "0.5702023", "text": "func sum(d ...float64) float64 {\n\tvar sum float64\n\tfor _, v := range d {\n\t\tsum += v\n\t}\n\treturn sum\n}", "title": "" }, { "docid": "b71fc2f7fc738c3f9cfc1a6e3ea59697", "score": "0.5697545", "text": "func (s *UniformSample) Sum() int64 {\n\ts.mutex.Lock()\n\tdefer s.mutex.Unlock()\n\treturn SampleSum(s.values)\n}", "title": "" }, { "docid": "a705172825188c94494203df3b95ca0c", "score": "0.5695934", "text": "func (p *Pots) Sum() int {\n\tsum := 0\n\tfor k := range p.m {\n\t\tsum += k\n\t}\n\treturn sum\n}", "title": "" }, { "docid": "e178ab8d3e39e44bdc8c499dcd9e3748", "score": "0.5691087", "text": "func Sum(nums ...type T num) T {\n\tresult := T(0)\n\tfor _, x := range nums {\n\t\tresult += x\n\t}\n\treturn result\n}", "title": "" }, { "docid": "23f1439a0f026e7115bc31d225db7f71", "score": "0.56873256", "text": "func sum(xs []Percent) Percent {\n\tvar sum Percent\n\tfor _, x := range xs {\n\t\tsum += x\n\t}\n\treturn sum\n}", "title": "" }, { "docid": "a53b687bfd075d11df3203aab59cedc7", "score": "0.5684218", "text": "func Sum(x ...int) int {\n\tsum := 0\n\tfor _, v := range x {\n\t\tsum += v\n\t}\n\treturn sum\n}", "title": "" }, { "docid": "a5912634449be317973c841d9c9ab563", "score": "0.5681728", "text": "func Sum(a *Node, along ...int) (retVal *Node, err error) {\n\tif a.IsScalar() {\n\t\tretVal = a // or error?\n\t\treturn\n\t}\n\n\tdims := a.Dims()\n\tif len(along) == 0 {\n\t\tswitch {\n\t\tcase a.IsRowVec():\n\t\t\talong = []int{1}\n\t\tcase a.IsColVec(), a.IsVector():\n\t\t\talong = []int{0}\n\t\tdefault:\n\t\t\talong = intRange(0, dims)\n\t\t}\n\t}\n\n\top := newSumOp(along, a.shape, dims)\n\treturn ApplyOp(op, a)\n}", "title": "" }, { "docid": "b42220876a25cff1bb41afe765262caf", "score": "0.5681613", "text": "func (c *Counter) Collect() string {\n\tstr := c.fmt(int(atomic.LoadInt64(&c.total)))\n\tatomic.StoreInt64(&c.total, 0)\n\treturn str\n}", "title": "" }, { "docid": "fc86cd132d754bd8617e7a1c22bc993a", "score": "0.56755376", "text": "func sum(xi ...int) int {\n\ttotal := 0\n\tfor _, v := range xi {\n\t\ttotal += v\n\t}\n\treturn total\n}", "title": "" }, { "docid": "320ebdc1d4fa52204f2b5bfe520f2a4e", "score": "0.56743646", "text": "func Sum(m Matrix) float64 {\n\treturn m.Fold(func(accumulator, val float64, x, y int) float64 {\n\t\treturn accumulator + val\n\t}, 0)\n}", "title": "" }, { "docid": "3f34e95894ce9874b8c803dedf64eb9c", "score": "0.5671758", "text": "func Sum(arr []int) (result int) {\n\tresult = 0\n\tfor _, val := range arr {\n\t\tresult += val\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "545f718624c59391c3278848f25c04b1", "score": "0.5670384", "text": "func (p ints) Sum() int {\n\treturn SumOf(p)\n}", "title": "" }, { "docid": "26b7b6f0576e4dc2291950d1705c0e7f", "score": "0.56612974", "text": "func Sum(s []complex128) complex128 {\n\tvar sum complex128\n\tfor _, v := range s {\n\t\tsum += v\n\t}\n\treturn sum\n}", "title": "" }, { "docid": "3801824217872345860902179977fdfa", "score": "0.5660359", "text": "func _plus(args List, context *Context) Data {\n\targs.RequireArity(2)\n\n\tsum, ok := args.First().(Adder)\n\tif !ok {\n\t\tpanic(\"Operand not supported\")\n\t}\n\n\tfor e := args.Front().Next(); e != nil; e = e.Next() {\n\t\tsum = sum.Plus(e.Value.(Data)).(Adder)\n\t}\n\n\treturn sum.(Data)\n}", "title": "" }, { "docid": "c945de052c9907597d827d28af7ce81d", "score": "0.5654597", "text": "func (NilSample) Sum() int64 { return 0 }", "title": "" }, { "docid": "45b006ad1ef59e3536e4682b532dcf97", "score": "0.5646487", "text": "func Sum(srcs ...source.Source) source.Source {\n\tout := srcs[0]\n\tfor _, src := range srcs[1:] {\n\t\tout = Sum2(out, src)\n\t}\n\treturn out\n}", "title": "" }, { "docid": "927353172f951bcc3c0beb24c81ecb61", "score": "0.5644003", "text": "func Sum(vals []int) int {\n\tvar sum int\n\tfor _, val := range vals {\n\t\tsum += val\n\t}\n\treturn sum\n}", "title": "" }, { "docid": "b9336980a49e89681aa1aed6aad1fa1e", "score": "0.56426007", "text": "func sum(values ...int) int {\n\t// simply means put all the values passed in side a slice\n\tfmt.Println(values)\n\tresult := 0\n\tfor _, v := range values {\n\t\tresult += v\n\n\t}\n\treturn result\n}", "title": "" }, { "docid": "d27cb4563ae97f40e76d2c8fcad8b666", "score": "0.56408983", "text": "func add(args ...int) int {\n total := 0\n for _, v := range args {\n total += v\n }\n return total\n}", "title": "" }, { "docid": "e7c7756f7552c78044200154918764d5", "score": "0.56362385", "text": "func Sum(xs ...uint64) uint64 {\n\tvar i uint64\n\tfor _, x := range xs {\n\t\ti += x\n\t}\n\treturn i\n}", "title": "" }, { "docid": "b38eafecd0f18574b81931b9ccdce9e2", "score": "0.56298655", "text": "func Sum(n ...int) (sum int) {\n\tsum = 0\n\tfor _, val := range n {\n\t\tsum += val\n\t}\n\treturn\n}", "title": "" }, { "docid": "74e9b479307c43cbcbb29badb4d5684e", "score": "0.56283003", "text": "func aggregate(datapoints []*cloudwatch.Datapoint) int {\n\tsum := 0.0\n\n\tfor _, datapoint := range datapoints {\n\t\tsum += *datapoint.Sum\n\t}\n\n\treturn int(sum)\n}", "title": "" }, { "docid": "0df03cd7ca143094dd3d12f47da3ef8b", "score": "0.5623378", "text": "func (m *Metrics) Collect() prometheus.Collector {\n\treturn m.OperationsDuration\n}", "title": "" }, { "docid": "d104bb41b3b270053aee8954e8445a3f", "score": "0.5621342", "text": "func (t transitionMap) sum() int {\n\tsum := 0\n\tfor _, val := range t {\n\t\tsum += val\n\t}\n\treturn sum\n}", "title": "" }, { "docid": "a82c532d110088dc31f40231962d979f", "score": "0.5614738", "text": "func (s Server) Sum(ctx context.Context, req *calculatorpb.SumRequest) (*calculatorpb.SumResponse, error) {\n\tfmt.Printf(\"Sum function was invoked with %v\\n\", req)\n\tnums := req.GetNums()\n\tvar sum int32\n\tfor _, num := range nums {\n\t\tsum += num\n\t}\n\n\tres := &calculatorpb.SumResponse{\n\t\tSumResult: sum,\n\t}\n\treturn res, nil\n}", "title": "" }, { "docid": "3c62103f987b1243a80caf680fd2c980", "score": "0.56144273", "text": "func add(args ...int)int{\n\t\ttotal := 0\n\t\tfor _, v := range args{\n\t\t\ttotal += v\n\t\t}\n\t\treturn total\n}", "title": "" }, { "docid": "4cf1a367cdae98038b2923d7a3d8f2bc", "score": "0.56123024", "text": "func sum(x []int) int {\n\ttotal := 0\n\tfor _, i := range x {\n\t\ttotal += i\n\t}\n\treturn total\n}", "title": "" }, { "docid": "375b3ec6b94a009be22675c76687b472", "score": "0.5610947", "text": "func (s Int64) Sum() int64 {\n\tvar t int64\n\n\tfor _, n := range s {\n\t\tt += n\n\t}\n\n\treturn t\n}", "title": "" }, { "docid": "a09b95803259a6c02e21eb8701453438", "score": "0.56005406", "text": "func (st *SectionStat) Collect(n int64) {\n\tatomic.AddInt64(&st.sum, n)\n\tatomic.AddInt64(&st.cnt, 1)\n\ti := st.sections.Search(n)\n\tif i != -1 {\n\t\tst.sectionCounter[i].collect(n)\n\t}\n}", "title": "" }, { "docid": "17dd3802f1420ea0899b4940ab4c4669", "score": "0.55906314", "text": "func Sum(numbers []int) (result int) {\n\tfor _, n := range numbers {\n\t\tresult += n\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "fa2ab8849b994ded6fa04f8bb1b7f10c", "score": "0.5589256", "text": "func (m *Collector) Collect(b message.Message) error {\n\treturn m.f(b)\n}", "title": "" }, { "docid": "e2a01ca4a4fce9659af672361bcbc090", "score": "0.558896", "text": "func (v Vector3) Sum() float64 {\n\treturn v.X + v.Y + v.Z\n}", "title": "" }, { "docid": "ae1026215bb1e94c881bfb6bbcb07ab6", "score": "0.5583505", "text": "func Sum(i ...int) int {\n\ts := 0\n\tfor _, v := range i {\n\t\ts += v\n\t}\n\treturn s\n}", "title": "" }, { "docid": "60ea90c0b2fcc3ae7ad183ed2eb4e455", "score": "0.55714226", "text": "func (d *digest) Sum(in []byte) []byte {\n\ts := d.Sum64()\n\treturn append(in, byte(s>>56), byte(s>>48), byte(s>>40), byte(s>>32), byte(s>>24), byte(s>>16), byte(s>>8), byte(s))\n}", "title": "" }, { "docid": "c6ccce65d6f8d12717fc06e334529283", "score": "0.5569898", "text": "func Sum(ops ...int) int {\n\tret := 0\n\tfor _, op := range ops {\n\t\tret += op\n\t}\n\t// , strs ...string\n\t// for _, str := range strs {\n\t// \tfmt.Print(str)\n\t// }\n\n\treturn ret\n}", "title": "" }, { "docid": "b58ab431bc9503b2bb149235a2bfa507", "score": "0.55672985", "text": "func aggregate(values []*cloudwatch.Datapoint) int {\n\taggregatedSum := 0.0\n\tfor _, dp := range values {\n\t\taggregatedSum += *dp.Sum\n\t}\n\treturn int(aggregatedSum)\n}", "title": "" } ]
edc607cd04981a584315b3dc4e55c1ea
all returns true iff all of the given label keys and values are set on the change. Label value comparison is done using the specified compFunc. Returns true if the given map of labels is empty.
[ { "docid": "ed75643de8865b3db0f3ff7b4568f0b9", "score": "0.7971625", "text": "func all(ci *ChangeInfo, labels map[string]int, compFunc func(int, int) bool) bool {\n\tfor labelKey, wantValue := range labels {\n\t\tfound := false\n\t\tif labelEntry, ok := ci.Labels[labelKey]; ok {\n\t\t\tfor _, labelDetail := range labelEntry.All {\n\t\t\t\tif compFunc(labelDetail.Value, wantValue) {\n\t\t\t\t\tfound = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif !found {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" } ]
[ { "docid": "1c84185bdbc69dda40496c5613213701", "score": "0.64661974", "text": "func (mm StringAnyMap) Forall(fn func(string, interface{}) bool) bool {\n\tfor k, v := range mm {\n\t\tif !fn(k, v) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "130732022490148df7dcfe7240f1b710", "score": "0.622556", "text": "func (c *Generic) All(fn func(interface{}) bool) bool {\n\tfor i := 0; i < c.items.Len(); i++ {\n\t\tif !fn(c.valueAt(i)) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "d2778de04e684f25cb7031fbefb3b950", "score": "0.6106279", "text": "func (c *Collection) Every(cb Callback) bool {\n\tfor key, value := range c.value {\n\t\tif !cb(key, value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "c7bc317e5b5736946509ac87148f562f", "score": "0.5975924", "text": "func (mm IntStringMap) Forall(p func(int, string) bool) bool {\n\tfor k, v := range mm {\n\t\tif !p(k, v) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "2f5223570b69edb7455c1f9b82df427c", "score": "0.5858142", "text": "func (mm StringAnyMap) ContainsAllKeys(kk ...string) bool {\n\tfor _, k := range kk {\n\t\tif !mm.ContainsKey(k) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "a7249b9f118b12ea637eff57e827bfb0", "score": "0.57772666", "text": "func (l PredicateList) all(c *CStorPool) bool {\n\tfor _, pred := range l {\n\t\tif !pred(c) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "d01f6c00d27aed6cec77b584cd6fea0f", "score": "0.5771323", "text": "func containsAll(current map[string]string, desired map[string]string) bool {\n\tfor key, value := range desired {\n\t\tif current[key] != value {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "3e03213f81f94dc0465ea35f8d424ee3", "score": "0.5701522", "text": "func All(vs []string, f func(string) bool) bool {\n for _, v := range vs {\n if !f(v) {\n return false\n }\n }\n return true\n}", "title": "" }, { "docid": "7ade9e880f74ff9289d0532bc90a0972", "score": "0.5676354", "text": "func (s *HashSet) ContainsAll(values ...interface{}) bool {\n\tfor _, value := range values {\n\t\tif !s.Contains(value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "920412539134e59ec3dbdcb60e904e6f", "score": "0.56345433", "text": "func ForLabels(ctx context.Context, f func(key, value string) bool)", "title": "" }, { "docid": "a2a06a83151447075019b9a6871be606", "score": "0.5603043", "text": "func (h *Histogram) VisitAll(fn func(uint64, uint64) bool) {\n\tfor _, sh := range h.shards {\n\t\tsh.RLock()\n\t}\n\tdefer func() {\n\t\tfor _, sh := range h.shards {\n\t\t\tsh.RUnlock()\n\t\t}\n\t}()\n\tfor _, sh := range h.shards {\n\t\tfor k, v := range sh.counters {\n\t\t\tif !fn(k, v) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "373a34abe0fa8534ae9fd754b6085074", "score": "0.55543494", "text": "func HasLabels(keyValuePair map[string]string) Predicate {\n\treturn func(vol *ZFSVolume) bool {\n\t\tfor key, value := range keyValuePair {\n\t\t\tif !vol.HasLabel(key, value) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}\n}", "title": "" }, { "docid": "0411c2bf8a9be724adc3ca733c41b142", "score": "0.55375385", "text": "func (rcv DifferentTypes) All(fn func(DifferentType) bool) bool {\n\tfor _, v := range rcv {\n\t\tif !fn(v) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "d78afcbad922ed3cdb70a18a9f640d97", "score": "0.5535507", "text": "func allEmpty(in map[rune]int) bool {\n\tif len(in) == 1 && hasEmpty(in) {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "541d9ae05b2b4ac82b4a20deadf8c6c5", "score": "0.5526246", "text": "func (mm IntStringMap) ContainsAllKeys(kk ...int) bool {\n\tfor _, k := range kk {\n\t\tif !mm.ContainsKey(k) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "9f4921390d387a28cf4bedf96cc774ea", "score": "0.55244565", "text": "func (p Parameters) HasAll(keys ...string) bool {\n\tfor _, k := range keys {\n\t\tif _, ok := p[k]; !ok {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "da8711a1f0ef9dd5d744335603d5da3d", "score": "0.5511097", "text": "func (t ComponentType) HasAll(mask ComponentType) bool { return mask != NoType && t&mask == mask }", "title": "" }, { "docid": "08cec55d2ee1dd470c7d6a42adfc66f4", "score": "0.5498788", "text": "func (set UintSet) Forall(p func(uint) bool) bool {\n\tfor v := range set {\n\t\tif !p(v) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "3e1019509d5930d5fa38edf6287b59d1", "score": "0.5494364", "text": "func All(strs []string, f func(string) bool) bool {\n\tfor _, v := range strs {\n\t\tif !f(v) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "954d0f93abaa38827755e62848dfe385", "score": "0.549266", "text": "func AllTrue(collection cty.Value) (cty.Value, error) {\n\treturn AllTrueFunc.Call([]cty.Value{collection})\n}", "title": "" }, { "docid": "344e8443cdc0d21ad3b4357c1e2fc48f", "score": "0.54711676", "text": "func(t *TaskLookupTable) AllComplete() bool{\n\tfor _, tsk := range t.taskmeta {\n\t\tif tsk.State != Completed {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "565269e6a810b3f05cad5d8e1abdd770", "score": "0.5447104", "text": "func ForLabels(ctx context.Context, f func(key, value string) bool) {}", "title": "" }, { "docid": "5b7d0af585c35ac006cd8a6b6906513b", "score": "0.5436196", "text": "func All(funcs ...func(Row) bool) func(Row) bool {\n\treturn func(row Row) bool {\n\t\tfor _, pred := range funcs {\n\t\t\tif !pred(row) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\treturn true\n\t}\n}", "title": "" }, { "docid": "e047ca64f25ce9976c3205f4e34c5c19", "score": "0.5436054", "text": "func All(f ...Func) Func {\n\treturn func(line []byte) bool {\n\t\tfor _, f := range f {\n\t\t\tif !f(line) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\treturn len(f) > 0\n\t}\n}", "title": "" }, { "docid": "c097c835b426cf0d5cf52f35521f2157", "score": "0.541453", "text": "func ContainsAll[T comparable](haystack []T, needles ...T) bool {\n\t// Avoid allocations for a single check.\n\tif len(needles) == 1 {\n\t\tfor _, h := range haystack {\n\t\t\tif h == needles[0] {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\treturn false\n\t}\n\n\tchecks := make(map[T]struct{}, len(needles))\n\tfor _, n := range needles {\n\t\tchecks[n] = struct{}{}\n\t}\n\n\tfor _, h := range haystack {\n\t\t_, ok := checks[h]\n\t\tif ok {\n\t\t\tdelete(checks, h)\n\n\t\t\tif len(checks) == 0 {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "9ae0a51ecb174ab314db940c42dce56d", "score": "0.53946143", "text": "func (r *ExistsResult) All() bool { return r.values.All() }", "title": "" }, { "docid": "3bc289616aae7cc53feda36e81c33598", "score": "0.53792244", "text": "func (s *Set) HasAll(capabs ...Capability) bool {\n\tfor _, capab := range capabs {\n\t\tif !s.Has(capab) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "951d2b07a6ed52183ce0a3ac38f5ac99", "score": "0.5372679", "text": "func (c T0Channel) All(f T0Predicate) bool {\n\tres := make(chan bool, 2)\n\n\tgo func() {\n\t\ti := -1\n\t\tfor v := range c {\n\t\t\ti++\n\t\t\tif !f(i, v) {\n\t\t\t\tres <- false\n\t\t\t}\n\t\t}\n\t\tres <- true\n\t}()\n\treturn <-res\n}", "title": "" }, { "docid": "54e6ddd4455e8eb6341ac5062b84af62", "score": "0.5366471", "text": "func (l predicateList) all(sc *StorageClass) bool {\n\tfor _, pred := range l {\n\t\tif !pred(sc) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "5ef136b2baf7fa646312c542f159eb35", "score": "0.53581613", "text": "func All[S ~[]T, T any](items S, f func(el T) bool) bool {\n\tfor _, el := range items {\n\t\tif !f(el) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "68d2bf531a353eba705415cf18420262", "score": "0.53481317", "text": "func (bl BoolList) All() bool {\n\tfor _, b := range bl {\n\t\tif !b {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "64e307a26574c692f321bc350fd4dbe4", "score": "0.53384984", "text": "func (l predicateList) all(vol *ZFSVolume) bool {\n\tfor _, pred := range l {\n\t\tif !pred(vol) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "20aca94fc9b61915c1379c1c90cc9478", "score": "0.5308803", "text": "func (set Set) ContainsAll(i ...interface{}) bool {\n\tallSet := NewSetFromSlice(i)\n\tif allSet.IsSubset(set) {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "a3470e4a227156e2ee600bebd700c3b2", "score": "0.5281708", "text": "func (set Set) ContainsAll(i ...string) bool {\n\tfor _, v := range i {\n\t\tif !set.Contains(v) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "854748a2c4e559f1ba08810f6b714456", "score": "0.5280785", "text": "func containsAllKeyValues(actualKVs []*v1alpha.KeyValue, requiredKVs []*v1alpha.KeyValue) bool {\n\tfor _, requiredKV := range requiredKVs {\n\t\tactualValue, ok := findInKeyValues(actualKVs, requiredKV.Key)\n\t\tif !ok || actualValue != requiredKV.Value {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "0aa404d5c4a2f8ec5335f107ec0634e6", "score": "0.5269738", "text": "func (k *StringSet) AddAll(is ...string) bool {\n\tif len(is) == 0 {\n\t\treturn false\n\t}\n\tif *k == nil {\n\t\t*k = make(map[string]struct{})\n\t}\n\n\toldLen := len(*k)\n\tfor _, i := range is {\n\t\t(*k)[i] = struct{}{}\n\t}\n\treturn len(*k) > oldLen\n}", "title": "" }, { "docid": "802e1161d068ac1f3cde428b8a8af2c6", "score": "0.5269067", "text": "func (rcv Movies) All(fn func(*Movie) bool) bool {\n\tfor _, v := range rcv {\n\t\tif !fn(v) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "c07023cf45ccb2b88771a405ef8a1da1", "score": "0.5257777", "text": "func (s StringSet) HasAll(items ...string) bool {\n\tfor _, item := range items {\n\t\tif !s.Has(item) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "e408519fe3bb150a06e5c21e4366450b", "score": "0.52488506", "text": "func (f Flag) AreAllSet(opts ...Flag) bool {\n\tfor _, o := range opts {\n\t\tif f&o == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "49eaaa96d860f071dd6a8eeae123224a", "score": "0.52366", "text": "func (l Labels) Equals(arg Labels) bool {\n\tif len(l) != len(arg) {\n\t\treturn false\n\t}\n\tfor k, v := range l {\n\t\tif argVal, ok := arg[k]; !ok || argVal != v {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "8348d82dd7708d3bb7fe70ee58a35b82", "score": "0.5204403", "text": "func All(bools ...bool) bool {\n\tfor _, v := range bools {\n\t\tif v != true {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "cd3bba0670e29ab348d4f631f683c544", "score": "0.51993376", "text": "func (s Set) Any(values ...string) bool {\n\tfor _, v := range values {\n\t\tif _, ok := s[v]; ok {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "168db7d9291b58171bdf724ecc10a57d", "score": "0.5195335", "text": "func (set UintSet) ContainsAll(i ...uint) bool {\n\tfor _, v := range i {\n\t\tif !set.Contains(v) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "0d895cbaf9b01c2130b4af97fd7c3364", "score": "0.51834387", "text": "func All(list []T, filterFunc func(T) bool) bool {\n\treturn Foldl(list, true, func(result, next T) T {\n\t\treturn result.(bool) && filterFunc(next)\n\t}).(bool)\n}", "title": "" }, { "docid": "4b81a74e9f2b6a0278d22e93d10853ff", "score": "0.5151007", "text": "func (s Players) All(f func(Player) bool) bool {\n\tif f == nil {\n\t\treturn false\n\t}\n\tfor _, v := range s {\n\t\tif !f(v) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "8c1e424ce3b8c04edfcbf789043eeabb", "score": "0.5147658", "text": "func checkAllContained(set *Set, t *testing.T, function func() []section.Hasher) {\n\truns := 10\n\tfor i := 0; i < runs; i++ {\n\t\tv := structWithPointer{validity: i}\n\t\tset.data[v.Hash()] = v\n\t}\n\tfuncReturn := function()\n\tif len(funcReturn) != runs {\n\t\tt.Errorf(\"Number of entries do not match. Want=%v, returned by len(function())=%v\", runs, len(funcReturn))\n\t}\n\tcheckMap := make(map[string]bool)\n\tfor i := 0; i < runs; i++ {\n\t\tv := structWithPointer{validity: i}\n\t\tcheckMap[v.Hash()] = false\n\t}\n\tfor _, v := range funcReturn {\n\t\tcheckMap[v.Hash()] = true\n\t}\n\tfor i, v := range checkMap {\n\t\tif !v {\n\t\t\tt.Errorf(\"Not all entries are returned. Entry %s not returned\", i)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6c0a2cb0aa3d5b6ca483849901c6cc66", "score": "0.51238316", "text": "func (o GetTagsFilterOutput) All() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v GetTagsFilter) *bool { return v.All }).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "c7802b4fb4ae8aa8bfe9b90c5b9b5a64", "score": "0.51155", "text": "func allTrue(rec *sam.Record, fs []FilterFunc) bool {\n\tfor _, f := range fs {\n\t\tif !f(rec) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "21bb9d6c1450aa5647854547c016e77c", "score": "0.51139796", "text": "func (s LINQ) All(pred Predicate) bool {\n\tfor i := s.Iterator(); i.Next(); {\n\t\tif !pred(i.Current()) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "50410cb20303c6ddcd2810a23ceb9e4e", "score": "0.51111114", "text": "func (s *OrderedSet) ContainsAll(i ...string) bool {\n\tfor _, item := range i {\n\t\tif !s.Contains(item) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "940bc4798706e2635c686be7adda766f", "score": "0.5107601", "text": "func (m Mark) HasAll(mm Mark) bool {\n\treturn m&mm != mm\n}", "title": "" }, { "docid": "31cabfca0e50fd389a637d7ca23a7b88", "score": "0.5094415", "text": "func (c *Generic) Any(fn func(interface{}) bool) bool {\n\tfor i := 0; i < c.items.Len(); i++ {\n\t\tif fn(c.valueAt(i)) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "bf20ca1450d247294435124ad34f0b32", "score": "0.50770426", "text": "func (c Changes) Contains(keys ...string) bool {\n\tfor _, k := range keys {\n\t\tfor i := range c {\n\t\t\tif c[i].Field == k {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "db49a2c6d65c8760bffacf24920446ad", "score": "0.5059721", "text": "func (slice StringSlice) All(filter StringPredicate) bool {\n\tfor _, s := range slice {\n\t\tif !filter(s) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "773c4e1ef8ef6ed759cc630ae935685f", "score": "0.5053766", "text": "func SyncMapAny(x *sync.Map) (ok bool) {\n\tx.Range(func(key interface{}, value interface{}) bool {\n\t\tok = true\n\t\treturn false\n\t})\n\treturn\n}", "title": "" }, { "docid": "ccd41f81ae130b32eaee32b9677d5cf0", "score": "0.5037157", "text": "func (o GetSpacesBucketsFilterOutput) All() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v GetSpacesBucketsFilter) *bool { return v.All }).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "f8c07e97c224f70c64d74474b4b956ed", "score": "0.5017658", "text": "func MapEach(m reflect.Value, fn func(k, v reflect.Value) bool) bool {\n\tkvs := newKvSlice(m.Len())\n\titer := m.MapRange()\n\tfor iter.Next() {\n\t\tkvs.s = append(kvs.s, kv{key: iter.Key(), value: iter.Value()})\n\t}\n\tsort.Sort(kvs)\n\n\tfor _, kv := range kvs.s {\n\t\tif !fn(kv.key, kv.value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "aaa4bb79c4217dcb049ffa1afa951971", "score": "0.50170684", "text": "func (c *GaugeVecProxy) DeleteAllAboutLabels(labels prometheus.Labels) bool {\n\tif len(labels) == 0 {\n\t\treturn false\n\t}\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\treturn findAndDeleteLabelsInMetricsProxy(c, labels)\n}", "title": "" }, { "docid": "83e07877b3bc5d46678bd412dc91a8ec", "score": "0.50114596", "text": "func (bes BoundEffectSet) Every(callback func(Effect) bool) bool {\n\tok := true\n\tbes.Each(func(e Effect) {\n\t\tif !ok || !callback(e) {\n\t\t\tok = false\n\t\t}\n\t})\n\treturn ok\n}", "title": "" }, { "docid": "98c420ec387e05a4c7759f6f8ed9cec3", "score": "0.4995745", "text": "func (m *HistMap) PrintAll() {\n\tprinthdr := func(key, value interface{}) bool {\n\t\th := value.(*safeHistogram)\n\t\th.Lock()\n\t\tret := m.sprintone(key.(string), h)\n\t\tfmt.Printf(\"%s\", ret)\n\t\th.Unlock()\n\t\treturn true\n\t}\n\tm.histmap.Range(printhdr)\n}", "title": "" }, { "docid": "982c6bff1ceb4c69674263f8bd96a50b", "score": "0.49897614", "text": "func (o LabelOperation) RequiresValues() bool {\n\t// add support for empty value\n\treturn o != RemoveLabelOperation && o != AddLabelOperation\n}", "title": "" }, { "docid": "c11dbf513df2995d6813bab287872955", "score": "0.49894392", "text": "func (es EffectSet) Every(callback func(Effect) bool) bool {\n\tfor e := range es {\n\t\tif !callback(e) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "7b1c72c57eebefe1df23aa733d90fbb3", "score": "0.49608463", "text": "func (o ObservableFoo) All(predicate func(next foo) bool) ObservableBool {\n\tcondition := func(next interface{}) bool {\n\t\treturn predicate(next.(foo))\n\t}\n\treturn o.AsObservable().All(condition)\n}", "title": "" }, { "docid": "0cbc52e6626eb0b18858d61ccaf74e8c", "score": "0.49566117", "text": "func (ko *Koanf) All() map[string]interface{} {\n\treturn maps.Copy(ko.confMapFlat)\n}", "title": "" }, { "docid": "2ff24adb318a1484cc282dd131827219", "score": "0.4955279", "text": "func hasLabel(labels map[string]string, labelName string) bool {\n\tvalue, ok := labels[labelName]\n\treturn ok && len(value) > 0\n}", "title": "" }, { "docid": "33ee37c1ce78bc5d60a5e7aeaf8e0f10", "score": "0.4955149", "text": "func (c *CounterVecProxy) DeleteAllAboutLabels(labels prometheus.Labels) bool {\n\tif len(labels) == 0 {\n\t\treturn false\n\t}\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\treturn findAndDeleteLabelsInMetricsProxy(c, labels)\n}", "title": "" }, { "docid": "bf96d4566ac903e04630841d95490352", "score": "0.49501348", "text": "func (m *Map) Foreach(fn func(key string, value []byte) bool) {\n\tfor i := int32(0); i < m.head.cap; i++ {\n\t\tbkt := m.bucket(i)\n\t\tif bkt.used == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif !fn(bkt.key(), bkt.value(m)) {\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "24d3fe756456473b131b8138b444736c", "score": "0.4945618", "text": "func (l Labels) Contains(arg Labels) bool {\n\tif len(arg) > len(l) {\n\t\treturn false\n\t}\n\tfor k, v := range arg {\n\t\tif argVal, ok := l[k]; !ok || argVal != v {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "0949c99f73b51c62234e28bbba12e634", "score": "0.49342385", "text": "func MapEach(m reflect.Value, fn func(k, v reflect.Value) bool) bool {\n\tks := MapSortedKeys(m)\n\tfor _, vkey := range ks {\n\t\tif !fn(vkey, m.MapIndex(vkey)) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "d835f2dde7399341c81944bf33a296c5", "score": "0.4931957", "text": "func every(slice []string, f func(string) bool) bool {\n\tfor _, s := range slice {\n\t\tif !f(s) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "826153e0fe62ce1e5fde9882e7870f60", "score": "0.4931314", "text": "func containsAll(s1 []vmwaretypes.ManagedObjectReference, s2 []vmwaretypes.ManagedObjectReference) bool {\n\t// put all elements of s1 into a map\n\ts1Map := make(map[vmwaretypes.ManagedObjectReference]bool)\n\tfor _, mor := range s1 {\n\t\ts1Map[mor] = true\n\t}\n\t// verify if all elements of s2 are present in s1Map\n\tfor _, mor := range s2 {\n\t\tif _, found := s1Map[mor]; !found {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "489cd989b059a8f48905d6ef58ba44c5", "score": "0.4930821", "text": "func (o GetRegionsFilterOutput) All() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v GetRegionsFilter) *bool { return v.All }).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "a6d110aaff04145c620ad8404ce6ad30", "score": "0.49239674", "text": "func (m FastIntMap) Empty() bool {\n\treturn m.small == [numWords]uint64{} && len(m.large) == 0\n}", "title": "" }, { "docid": "c0671812a38414ad57cca63b673d3930", "score": "0.49052122", "text": "func (e *engine) All(s string, v interface{}) bool {\n\tif st, ok := e.namespace(s); ok {\n\t\tif bs := st.all(); bs != nil {\n\t\t\tb := bytes.Join(bs, []byte{','})\n\t\t\treturn decode(b, v)\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "ab7d01e010bd8f58bbcb20d2a5105e36", "score": "0.49050853", "text": "func (s String) HasAll(items ...string) bool {\n\tfor _, item := range items {\n\t\tif !s.Has(item) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "9ae90fce752c979e261bcf97feb84411", "score": "0.48808187", "text": "func (o GetImagesFilterOutput) All() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v GetImagesFilter) *bool { return v.All }).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "3685ebe1f31cfd91ba77dbc5e150cf56", "score": "0.48756114", "text": "func ConfigAllLabels(name string, service *kobject.ServiceConfig) map[string]string {\n\tbase := ConfigLabels(name)\n\tif service.DeployLabels != nil {\n\t\tfor k, v := range service.DeployLabels {\n\t\t\tbase[k] = v\n\t\t}\n\t}\n\treturn base\n}", "title": "" }, { "docid": "fb875ab8c0ea1355ec41cb4079d2f5c0", "score": "0.48538056", "text": "func (r *funcReg) Empty() bool {\n\tr.lock.RLock()\n\tempty := len(r.dataDigs)+len(r.dataHashes)+len(r.lookupKeys) == 0\n\tr.lock.RUnlock()\n\treturn empty\n}", "title": "" }, { "docid": "6b2147273099ea9f0e551ad13d2523d6", "score": "0.48340762", "text": "func mapIsEmpty(m frequencyMap) bool {\n\tfor i := 0; i < frequencyMapLen; i++ {\n\t\tif m[i] > 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "ff13630551930f6f9a9ec4d903a5a97b", "score": "0.4830681", "text": "func (o Observable) All(predicate func(next interface{}) bool) ObservableBool {\n\tobservable := func(observe BoolObserver, subscribeOn Scheduler, subscriber Subscriber) {\n\t\tobserver := func(next interface{}, err error, done bool) {\n\t\t\tswitch {\n\t\t\tcase !done:\n\t\t\t\tif !predicate(next) {\n\t\t\t\t\tobserve(false, nil, false)\n\t\t\t\t\tobserve(false, nil, true)\n\t\t\t\t}\n\t\t\tcase err!=nil:\n\t\t\t\tobserve(false, err, true)\n\t\t\tdefault:\n\t\t\t\tobserve(true, nil, false)\n\t\t\t\tobserve(false, nil, true)\n\t\t\t}\n\t\t}\n\t\to(observer, subscribeOn, subscriber)\n\t}\n\treturn observable\n}", "title": "" }, { "docid": "2679844c1225d28237c81ae01514696a", "score": "0.48175073", "text": "func (t *Trie) AddAll(words []string) bool {\n\thasChanged := false\n\tfor _, v := range words {\n\t\tif t.Add(v) {\n\t\t\thasChanged = true\n\t\t}\n\t}\n\n\treturn hasChanged\n}", "title": "" }, { "docid": "1842148714a5f20b8ae70cea7f1ece84", "score": "0.48090136", "text": "func (s *Listing) ContainsAll(targets []*unstructured.Unstructured) bool {\n\tif s.err != nil || len(s.objs) != len(targets) {\n\t\treturn false\n\t}\n\tif len(targets) == 0 && len(s.objs) == len(targets) {\n\t\treturn true\n\t}\n\tfor _, t := range targets {\n\t\tif !s.Contains(t) {\n\t\t\t// return false if any item does not match\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "b4723ba366c45222825bc11d41608be1", "score": "0.48059934", "text": "func Any(f func(string) bool, arr []string) bool {\n\tfor _, i := range arr {\n\t\tif f(i) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "7215ccea5e34cc2435eb7b18524a9d0d", "score": "0.48058474", "text": "func (e ErrorMap) Empty() bool {\n\tfor _, item := range e {\n\t\tif !item.Empty() {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "2bf97cb964c5d56f397e007a6392c0a1", "score": "0.48047897", "text": "func (o GetDropletsFilterOutput) All() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v GetDropletsFilter) *bool { return v.All }).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "464c9128b2a2a1e1b5ef33895a312e9c", "score": "0.4801835", "text": "func SearchLabels(key, value string, labels map[string]string) bool {\n\tif len(labels) == 0 {\n\t\treturn false\n\t}\n\tfor k, v := range labels {\n\t\tif k == key && v == value {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "903bc1d0c9a322577447b6c01b1e20f0", "score": "0.4790638", "text": "func (o LabelOperation) RequiresValues() bool {\n\treturn o != RemoveLabelOperation\n}", "title": "" }, { "docid": "56140746bc9342a8d9bea5098b160c43", "score": "0.47892764", "text": "func (l CUAddressList) Any(f func(CUAddress) bool) bool {\n\tfor _, t := range l {\n\t\tif f(t) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "9ad1f40e9edb5e476ed4337bef990271", "score": "0.4788871", "text": "func (lt *LabelledTuple) Apply(fun func(field interface{}) interface{}) (b bool) {\n\tb = false\n\n\tif lt != nil {\n\t\tb = true\n\t\tfor i := 0; i < lt.Length(); i++ {\n\t\t\tlt.SetFieldAt(i, fun(lt.GetFieldAt(i)))\n\t\t}\n\t}\n\n\treturn b\n}", "title": "" }, { "docid": "e4f7433c3557b96d4cba64a70707cf7d", "score": "0.4788723", "text": "func (s Set) ContainsAny(elts ...string) bool {\n\tfor _, key := range elts {\n\t\tif _, ok := s[key]; ok {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "0679285afd2b9ee107d5eae73b22a2e9", "score": "0.47853485", "text": "func (t *Pot) each(f func(Val) bool) bool {\n\tif t == nil || t.size == 0 {\n\t\treturn false\n\t}\n\tfor _, n := range t.bins {\n\t\tif !n.each(f) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn f(t.pin)\n}", "title": "" }, { "docid": "42b8e15d8054f4bfa6c2ebb64bc06d5d", "score": "0.47840863", "text": "func (r *Replicator) All(key string, f ReplicatedFunc) error {\n\tvar g multierror.Group\n\toffset := r.startingOffset()\n\tfor i := 0; i < r.Replicas; i++ {\n\t\to := offset\n\t\tg.Go(func() error {\n\t\t\treturn f(r.Trie.GetOffset(key, o))\n\t\t})\n\t\toffset += r.increment\n\t}\n\treturn g.Wait().ErrorOrNil()\n}", "title": "" }, { "docid": "bb49e43e73e24e17e4807a886f967939", "score": "0.47805753", "text": "func (o *WorkflowEnumEntryAllOf) HasLabel() bool {\n\tif o != nil && o.Label != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "55ba00630762dfb4925ec17000b85557", "score": "0.47739443", "text": "func (ct *CachedTargets) RangeAllTargets(f func(*Target) bool) {\n\tval := ct.Load()\n\tif val == nil {\n\t\treturn\n\t}\n\tfor _, b := range val.Brokers {\n\t\tfor _, t := range b.Targets {\n\t\t\tif c := f(t); !c {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "47f75eefe01d09c64d4415ccc19121bc", "score": "0.47715122", "text": "func (m *Mask) SetAll(val bool) {\n\tfor i := 0; i < len(m.b); i++ {\n\t\tif val {\n\t\t\tm.b[i] = 0xFF\n\t\t} else {\n\t\t\tm.b[i] = 0x00\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a181144854a070b71d2e04a4284cdb5a", "score": "0.47600317", "text": "func (o GetDomainsFilterOutput) All() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v GetDomainsFilter) *bool { return v.All }).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "1939448e5b7a0604d388dbef302772da", "score": "0.4756395", "text": "func LabelContains(labels []Formula, f Formula) bool {\n\tfor _, l := range labels {\n\t\tif l.Equal(f) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "cf5b713a82f3bc6e70133bdd665d7850", "score": "0.47543034", "text": "func AllPassFunc(fn func(e Entry) bool) []Entry {\n\tvar result []Entry\n\tfor _, e := range AllPass() {\n\t\tif fn(e) {\n\t\t\tresult = append(result, e)\n\t\t}\n\t}\n\treturn result\n}", "title": "" }, { "docid": "77b946ee9c6fb1686bb6e88eea6d6c67", "score": "0.47388434", "text": "func (s *HashSet) ContainsAny(values ...interface{}) bool {\n\tfor _, value := range values {\n\t\tif s.Contains(value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "bf794e5270f775a974fed8aa8b734c1e", "score": "0.47340935", "text": "func (o GetRecordsFilterOutput) All() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v GetRecordsFilter) *bool { return v.All }).(pulumi.BoolPtrOutput)\n}", "title": "" } ]
8cbfa3e99e92a940adcc0998ce903bf8
GetImages return all images on Linode
[ { "docid": "aae527b0e89fc35d1a0829dde2f819f3", "score": "0.8209207", "text": "func (v *Linode) GetImages(ctx *lepton.Context) ([]lepton.CloudImage, error) {\n\ttoken := os.Getenv(\"TOKEN\")\n\tclient := &http.Client{}\n\n\turi := \"https://api.linode.com/v4/images\"\n\n\treq, err := http.NewRequest(\"GET\", uri, nil)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\treq.Header.Set(\"Authorization\", \"Bearer \"+token)\n\n\tres, err := client.Do(req)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\tdefer res.Body.Close()\n\n\tbody, err := io.ReadAll(res.Body)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\n\tilr := &ImageListResponse{}\n\terr = json.Unmarshal(body, &ilr)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\n\tvar images []lepton.CloudImage\n\n\tfor _, img := range ilr.Data {\n\t\tif !img.IsPublic {\n\t\t\timages = append(images, lepton.CloudImage{\n\t\t\t\tID: img.ID,\n\t\t\t\tName: img.Label,\n\t\t\t\tStatus: img.Status,\n\t\t\t\tPath: \"\",\n\t\t\t})\n\t\t}\n\t}\n\n\treturn images, nil\n\n}", "title": "" } ]
[ { "docid": "6d374a151cffa7b559aa52c7e51d0854", "score": "0.7881588", "text": "func GetImages(token string) (images []box.Image) {\n\tlinodeClient := GetClient(token)\n\n\tlinodeImages, err := linodeClient.ListImages(context.Background(), nil)\n\n\tif err != nil {\n\t\tutils.Log.Fatal(err)\n\t}\n\n\tfor _, image := range linodeImages {\n\t\t// Only list custom images\n\t\tif strings.HasPrefix(image.ID, \"private\") {\n\t\t\timages = append(images, box.Image{\n\t\t\t\tID: image.ID,\n\t\t\t\tLabel: image.Label,\n\t\t\t\tCreated: image.Created.String(),\n\t\t\t\tSize: image.Size,\n\t\t\t\tVendor: image.Vendor,\n\t\t\t})\n\t\t}\n\t}\n\treturn images\n}", "title": "" }, { "docid": "62661cfc0b0d110cd37c3e778a84dea0", "score": "0.7750865", "text": "func GetImages(w http.ResponseWriter, r *http.Request) ([]*libimage.Image, error) {\n\tdecoder := r.Context().Value(\"decoder\").(*schema.Decoder)\n\truntime := r.Context().Value(\"runtime\").(*libpod.Runtime)\n\tquery := struct {\n\t\tAll bool\n\t\tDigests bool\n\t\tFilter string // Docker 1.24 compatibility\n\t}{\n\t\t// This is where you can override the golang default value for one of fields\n\t}\n\n\tif err := decoder.Decode(&query, r.URL.Query()); err != nil {\n\t\treturn nil, err\n\t}\n\tif _, found := r.URL.Query()[\"digests\"]; found && query.Digests {\n\t\tUnSupportedParameter(\"digests\")\n\t}\n\n\tfilterList, err := filters.FiltersFromRequest(r)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !IsLibpodRequest(r) && len(query.Filter) > 0 { // Docker 1.24 compatibility\n\t\tfilterList = append(filterList, \"reference=\"+query.Filter)\n\t}\n\n\tif !query.All {\n\t\t// Filter intermediate images unless we want to list *all*.\n\t\t// NOTE: it's a positive filter, so `intermediate=false` means\n\t\t// to display non-intermediate images.\n\t\tfilterList = append(filterList, \"intermediate=false\")\n\t}\n\tlistOptions := &libimage.ListImagesOptions{Filters: filterList}\n\treturn runtime.LibimageRuntime().ListImages(r.Context(), nil, listOptions)\n}", "title": "" }, { "docid": "9662a407cfec421682fbdd074a443595", "score": "0.76580757", "text": "func (api *API) GetImages(c *echo.Context) error {\n\tapp := c.Get(\"app\").(*App)\n\n\timagesCollection, err := app.Mongo.Collection(\"images\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar images []types.MKImage\n\terr = imagesCollection.Find(bson.M{}).\n\t\tSelect(bson.M{\"_id\": 1, \"caption\": 1, \"isForHomePage\": 1}).\n\t\tAll(&images)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tc.JSON(http.StatusOK, images)\n\n\treturn nil\n}", "title": "" }, { "docid": "b87a5561ead437f23fa1ca1dcbaa38f3", "score": "0.7541593", "text": "func GetImages(w http.ResponseWriter, r *http.Request) {\n\ttools.SetHeader(w)\n\tif r.Method != \"GET\" {\n\t\treturn\n\t}\n\tvars := r.URL.Query()\n\ttag := vars[\"tag\"]\n\tname := vars[\"name\"]\n\tif len(tag) == 0 || len(name) == 0 {\n\t\treturn\n\t}\n\t//find the images and return []byte\n\tfilepath := imgpath + `/` + tag[0] + \"/\" + name[0]\n\ttemp, err := ioutil.ReadFile(filepath)\n\tif err != nil {\n\t\ttools.HandleError(\"GetImages readfile error :\", err, 1)\n\t\treturn\n\t}\n\tw.Write(temp)\n\treturn\n}", "title": "" }, { "docid": "cbbe86168fd374f62f437325ea57509f", "score": "0.7463949", "text": "func (h *ActionHelper) GetImages(n *status.Node) ([]string, error) {\n\tswitch h.cri {\n\tcase status.ContainerdRuntime:\n\t\treturn containerd.GetImages(n)\n\tcase status.DockerRuntime:\n\t\treturn docker.GetImages(n)\n\t}\n\treturn nil, errors.Errorf(\"unknown cri: %s\", h.cri)\n}", "title": "" }, { "docid": "e7133e129eb9392d2ca16c79d3834a8c", "score": "0.74551094", "text": "func GetImages(username string, session *r.Session) []string{\n\tvar img ct.Image\n\tvar images []string\n\tdb := os.Getenv(\"DB\")\n\ttable := os.Getenv(\"IMGTABLE\")\n\tcur, _ := r.DB(db).Table(table).GetAllByIndex(\"created_by\", username).Run(session)\n\n\tfor cur.Next(&img) {\n\t\timages = append(images, img.Link)\n\t}\n\treturn images\n}", "title": "" }, { "docid": "0f4862d52fc95f32d86f51662671c4f9", "score": "0.74192023", "text": "func (o *OpenStack) GetImages(ctx *Context) ([]CloudImage, error) {\n\treturn nil, errors.New(\"un-implemented\")\n}", "title": "" }, { "docid": "6a655f0700123387d85df0846bc1dccf", "score": "0.7389314", "text": "func (a *API) getImages(p *Params) ([]amicache.Image, error) {\n\timages := []amicache.Image{}\n\tfilters := []amicache.Filterer{\n\t\tamicache.FilterByImageID(p.images...),\n\t\tamicache.FilterByOwnerID(p.ownerID),\n\t\tamicache.FilterByTags(p.tags),\n\t}\n\n\tif a.cache.CollectLaunchPermissions() {\n\t\tfilters = append(filters, amicache.FilterByLaunchPermission(p.launchPerm))\n\t}\n\n\tfilter := amicache.NewFilter(filters...)\n\n\tfor _, region := range p.regions {\n\t\tmatched, err := a.cache.FilterImages(region, filter)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\timages = append(images, matched...)\n\t}\n\tamicache.SortByState(a.cache.StateTag(), images)\n\treturn images, nil\n}", "title": "" }, { "docid": "22a2d47ffd30694544d060a7cde593c5", "score": "0.7237465", "text": "func ImagesGet(c *cli.Context) {\n\tclient := NewClient(c, DefaultConfig)\n\trawID := c.String(ArgImage)\n\n\tvar err error\n\tvar image *godo.Image\n\tif id, cerr := strconv.Atoi(rawID); cerr == nil {\n\t\timage, _, err = client.Images.GetByID(id)\n\t} else {\n\t\tif len(rawID) > 0 {\n\t\t\timage, _, err = client.Images.GetBySlug(rawID)\n\t\t} else {\n\t\t\terr = fmt.Errorf(\"image identifier is required\")\n\t\t}\n\t}\n\n\tif err != nil {\n\t\tBail(err, \"could not retrieve image\")\n\t\treturn\n\t}\n\n\terr = displayOutput(c, image)\n\tif err != nil {\n\t\tlogrus.WithField(\"err\", err).Fatal(\"could not write output\")\n\t}\n}", "title": "" }, { "docid": "660f2e4855ac1ea754ea40c150fc44d1", "score": "0.71993923", "text": "func GetAllImages(stub shim.ChaincodeStubInterface) ([]Image, error) {\r\n\r\n\timagesIndex, err := GetIndex(stub, ImagesIndexName)\r\n\t\r\n\tif err != nil {\r\n\t\r\n\t\treturn []Image{}, errors.New(\"Could not retrieve ImagesIndex, reason: \" + err.Error())\r\n\t\t\r\n\t}\r\n\r\n\tvar images []Image\r\n\t\r\n\tfor _, imageID := range imagesIndex {\r\n\t\r\n\t\timageAsBytes, err := stub.GetState(imageID)\r\n\t\t\r\n\t\tif err != nil {\r\n\t\t\r\n\t\t\treturn []Image{}, errors.New(\"Could not retrieve image with ID: \" + imageID + \", reason: \" + err.Error())\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\tvar image Image\r\n\t\t\r\n\t\terr = json.Unmarshal(imageAsBytes, &image)\r\n\t\t\r\n\t\tif err != nil {\r\n\t\t\r\n\t\t\treturn []Image{}, errors.New(\"Error while unmarshalling image, reason: \" + err.Error())\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\timages = append(images, image)\r\n\t\t\r\n\t}\r\n\r\n\treturn images, nil\r\n}", "title": "" }, { "docid": "2cfd7b1b7cd468360a963dfd16353038", "score": "0.7179282", "text": "func (p *Provider) GetImages(ctx *lepton.Context) (images []lepton.CloudImage, err error) {\n\timages = []lepton.CloudImage{}\n\n\tif _, err = os.Stat(vdiImagesDir); os.IsNotExist(err) {\n\t\treturn\n\t}\n\n\terr = filepath.Walk(vdiImagesDir, func(hostpath string, info os.FileInfo, err error) error {\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif info.IsDir() {\n\t\t\treturn nil\n\t\t}\n\t\tname := info.Name()\n\n\t\tif len(name) > 4 && strings.Contains(info.Name(), \".vdi\") {\n\t\t\timages = append(images, lepton.CloudImage{\n\t\t\t\tName: strings.Replace(info.Name(), \".vdi\", \"\", 1),\n\t\t\t\tPath: hostpath,\n\t\t\t\tSize: info.Size(),\n\t\t\t\tCreated: info.ModTime(),\n\t\t\t})\n\t\t}\n\t\treturn nil\n\t})\n\n\treturn\n}", "title": "" }, { "docid": "a4a2b16b5940c9c40e5f8d530eef1f3e", "score": "0.7161593", "text": "func (v *Vultr) GetImages(ctx *lepton.Context) ([]lepton.CloudImage, error) {\n\tsnaps, _, _, err := v.Client.Snapshot.List(context.TODO(), &govultr.ListOptions{\n\t\tPerPage: 100,\n\t\tCursor: \"\",\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar images []lepton.CloudImage\n\n\tfor _, snap := range snaps {\n\t\timages = append(images, lepton.CloudImage{\n\t\t\tID: snap.ID,\n\t\t\tName: \"\",\n\t\t\tStatus: snap.Status,\n\t\t\tSize: int64(snap.Size),\n\t\t\tPath: \"\",\n\t\t\tCreated: time.Now(),\n\t\t})\n\t}\n\n\treturn images, nil\n\n}", "title": "" }, { "docid": "dcf65255a76e6ade79f930de5dee815a", "score": "0.71404743", "text": "func GetImages(stub shim.ChaincodeStubInterface) ([]byte, error) {\r\n\r\n\timages, err := GetAllImages(stub)\r\n\t\r\n\tif err != nil {\r\n\t\r\n\t\treturn nil, err\r\n\t\t\r\n\t}\r\n\r\n\treturn json.Marshal( Images {Images: images})\r\n\t\r\n}", "title": "" }, { "docid": "970fa5c3d55724ab880acd56f5c0d3dd", "score": "0.70645666", "text": "func (api ApiHandler) GetAllImages(w http.ResponseWriter, r *http.Request) {\n\n\t//auth-checker\n\tif !api.CheckAuthBearer(w, r) {\n\t\treturn\n\t}\n\treply := getListOfImages()\n\trender.JSON(w, r, reply)\n}", "title": "" }, { "docid": "4655d0b5335556fdf4d8256de51cfa6b", "score": "0.7006003", "text": "func (md *MDocker) ListImages(h *http.Request, request *rpc.ImageRequest, response *rpc.ImageResponse) error {\n\topts := docker.ListImagesOptions{}\n\n\tapiImages, err := md.client.ListImages(opts)\n\tif err != nil {\n\t\treturn err\n\t}\n\timages := make([]*rpc.Image, 0, len(apiImages))\n\tfor _, ai := range apiImages {\n\t\tid, _ := docker.ParseRepositoryTag(ai.RepoTags[0])\n\t\tif uuid.Parse(id) != nil { // Mistify images are uuid repos\n\t\t\timages = append(images, &rpc.Image{\n\t\t\t\tID: id,\n\t\t\t\tType: \"container\",\n\t\t\t\tSize: uint64(ai.Size) / 1024 / 1024,\n\t\t\t})\n\t\t}\n\t}\n\n\tresponse.Images = images\n\treturn nil\n}", "title": "" }, { "docid": "982158a93fc95ed27d707977648bf8ae", "score": "0.7000692", "text": "func (al *Apps) GetImages() []string {\n\tvar il []string\n\tfor _, a := range al.apps {\n\t\til = append(il, a.Image)\n\t}\n\treturn il\n}", "title": "" }, { "docid": "7a5fdad816a4eda68af580b863d4faee", "score": "0.6941819", "text": "func getImages() []string {\n\tfolders := getFolders()\n\tvar images []string\n\tvar file string\n\tmsg(\"Picked Up Images :\")\n\tfor _, folder := range folders {\n\t\tfile = getRandomFile(folder)\n\t\timages = append(images, file)\n\t}\n\n\treturn images\n}", "title": "" }, { "docid": "cbb0810f0b6b1b9423893c27a579c280", "score": "0.6903061", "text": "func (c *Client) GetAllImages() ([]Image, error) {\n\tvar DOResp struct {\n\t\tStatus Status `json:\"status\"`\n\t\tImages []Image `json:\"images\"`\n\t\tMessage string `json:\"message\"`\n\t}\n\n\terr := c.doGet(\"/images\", &DOResp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif DOResp.Status == StatusError {\n\t\treturn nil, fmt.Errorf(\"could not get images: %v\", DOResp.Message)\n\t}\n\n\treturn DOResp.Images, nil\n}", "title": "" }, { "docid": "65a90c214b67e1277f672f482be1ac6a", "score": "0.69004124", "text": "func GetImages(ctx context.Context) ([]models.Image, error) {\n\tkubeConf, configError := ctrl.GetConfig()\n\tif configError != nil {\n\t\tlogrus.Errorf(\"Error fetching KubeConfig: %v\", configError)\n\t\treturn nil, configError\n\t}\n\n\tapi, err := kubernetes.NewForConfig(kubeConf)\n\tif err != nil {\n\t\tlogrus.Errorf(\"Error creating Kubernetes client: %v\", err)\n\t\treturn nil, err\n\t}\n\n\tdynamicClient, err := dynamic.NewForConfig(kubeConf)\n\tif err != nil {\n\t\tlogrus.Errorf(\"Error creating Dynamic client: %v\", err)\n\t\treturn nil, err\n\t}\n\n\tresources, err := restmapper.GetAPIGroupResources(api.Discovery())\n\tif err != nil {\n\t\tlogrus.Errorf(\"Error getting API Group resources: %v\", err)\n\t\treturn nil, err\n\t}\n\trestMapper := restmapper.NewDiscoveryRESTMapper(resources)\n\n\tlistOpts := metav1.ListOptions{}\n\tpods, err := api.CoreV1().Pods(\"\").List(ctx, listOpts)\n\n\tif err != nil {\n\t\tlogrus.Errorf(\"Error fetching Kubernetes pods: %v\", err)\n\t\treturn nil, err\n\t}\n\n\t// TODO: we're deduping by owner, which works in most cases, but might cause us\n\t// to miss certain images. E.g. mid-release, the new pods and the old pods\n\t// will exist under the same owner.\n\tfound := map[string]bool{}\n\timages := []models.Image{}\n\tnamespaceBlacklist := strings.Split(os.Getenv(\"NAMESPACE_BLACKLIST\"), \",\")\n\tfor _, pod := range pods.Items {\n\t\tfoundNamespace := false\n\t\tfor _, namespace := range namespaceBlacklist {\n\t\t\tif pod.ObjectMeta.Namespace == strings.ToLower(namespace) {\n\t\t\t\tfoundNamespace = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif foundNamespace {\n\t\t\tcontinue\n\t\t}\n\t\towner := models.Resource{\n\t\t\tNamespace: pod.ObjectMeta.Namespace,\n\t\t\tKind: \"Pod\",\n\t\t\tName: pod.ObjectMeta.Name,\n\t\t}\n\t\towners := pod.ObjectMeta.OwnerReferences\n\n\t\tfor len(owners) > 0 {\n\t\t\tif len(owners) > 1 {\n\t\t\t\tlogrus.Warnf(\"More than 1 owner found for Namespace: %s Kind: %s Object: %s\", owner.Namespace, owner.Kind, owner.Name)\n\t\t\t}\n\t\t\tfirstOwner := owners[0]\n\t\t\towner.Kind = firstOwner.Kind\n\t\t\towner.Name = firstOwner.Name\n\t\t\tif owner.Kind == \"Node\" {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tfqKind := schema.FromAPIVersionAndKind(firstOwner.APIVersion, firstOwner.Kind)\n\t\t\tmapping, err := restMapper.RESTMapping(fqKind.GroupKind(), fqKind.Version)\n\t\t\tif err != nil {\n\t\t\t\tlogrus.Warnf(\"Error retrieving mapping %s of API %s and Kind %s because of error: %v \", firstOwner.Name, firstOwner.APIVersion, firstOwner.Kind, err)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tgetParents, err := dynamicClient.Resource(mapping.Resource).Namespace(pod.ObjectMeta.Namespace).Get(ctx, firstOwner.Name, metav1.GetOptions{})\n\t\t\tif err != nil {\n\t\t\t\tlogrus.Warnf(\"Error retrieving parent object %s of API %s and Kind %s because of error: %v \", firstOwner.Name, firstOwner.APIVersion, firstOwner.Kind, err)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\towners = getParents.GetOwnerReferences()\n\n\t\t}\n\n\t\tfor _, containerStatus := range pod.Status.ContainerStatuses {\n\t\t\tim := models.Image{\n\t\t\t\tName: containerStatus.Image,\n\t\t\t\tID: strings.TrimPrefix(containerStatus.ImageID, \"docker-pullable://\"),\n\t\t\t\tOwner: models.Resource(owner),\n\t\t\t}\n\t\t\tim.PullRef = im.ID\n\t\t\tif im.PullRef == \"\" || strings.HasPrefix(im.PullRef, \"sha256:\") {\n\t\t\t\tim.PullRef = im.Name\n\t\t\t}\n\t\t\tim.Owner.Container = containerStatus.Name\n\t\t\tkey := im.Owner.Namespace + \"/\" + im.Owner.Kind + \"/\" + im.Owner.Name + \"/\" + im.Owner.Container + \"/\" + im.Name + \"/\" + im.ID\n\t\t\tif _, ok := found[key]; ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfound[key] = true\n\n\t\t\timages = append(images, im)\n\t\t}\n\t}\n\treturn images, nil\n}", "title": "" }, { "docid": "b3b0a143cc61aba8d2b27a98d265ac7b", "score": "0.68923104", "text": "func listImages(w http.ResponseWriter, r *http.Request) {\n\t//List all images available locally\n\thtmlOutput := htmlOutput\n\thtmlOutput += `ID => SIZE(MB) <br>`\n\tfor _, image := range returnImages() {\n\t\thtmlOutput += image.ID[7:20] + \" => \" + strconv.Itoa(int(image.Size)/1024/1024) + \"=> \" + image.Labels[\"org.label-schema.name\"] + \"<br>\"\n\t}\n\thtmlOutput += \"</html>\"\n\tfmt.Fprint(w, htmlOutput)\n}", "title": "" }, { "docid": "104dac53cf920e8466f5b4d084846e60", "score": "0.68907195", "text": "func (s ServiceV2) GetImages(provider *gophercloud.ProviderClient) (map[string]types.Images, error) {\n\timgTypes := map[string]types.Images{\n\t\t\"public\": types.Images{},\n\t\t\"private\": types.Images{},\n\t\t\"shared\": types.Images{},\n\t}\n\n\tclient, err := openstackintel.NewImageService(provider, gophercloud.EndpointOpts{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\timgs, err := images.Get(client).Extract()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, img := range imgs {\n\t\tif imgType, found := imgTypes[img.Visibility]; found {\n\t\t\timgType.Count += 1\n\t\t\timgType.Bytes += img.Size\n\t\t\timgTypes[img.Visibility] = imgType\n\t\t} else {\n\t\t\treturn nil, fmt.Errorf(\"Uknown image visibility type found {%s}\", img.Visibility)\n\t\t}\n\t}\n\n\treturn imgTypes, nil\n}", "title": "" }, { "docid": "bff2770a3376a80afbc6af8140922ffe", "score": "0.6889895", "text": "func (a *ImagesApiService) ListImages(ctx _context.Context, localVarOptionals *ListImagesOpts) ([]AnchoreImage, *_nethttp.Response, error) {\n\tvar (\n\t\tlocalVarHTTPMethod = _nethttp.MethodGet\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarFormFileName string\n\t\tlocalVarFileName string\n\t\tlocalVarFileBytes []byte\n\t\tlocalVarReturnValue []AnchoreImage\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/images\"\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := _neturl.Values{}\n\tlocalVarFormParams := _neturl.Values{}\n\n\tif localVarOptionals != nil && localVarOptionals.History.IsSet() {\n\t\tlocalVarQueryParams.Add(\"history\", parameterToString(localVarOptionals.History.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Fulltag.IsSet() {\n\t\tlocalVarQueryParams.Add(\"fulltag\", parameterToString(localVarOptionals.Fulltag.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.ImageStatus.IsSet() {\n\t\tlocalVarQueryParams.Add(\"image_status\", parameterToString(localVarOptionals.ImageStatus.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.AnalysisStatus.IsSet() {\n\t\tlocalVarQueryParams.Add(\"analysis_status\", parameterToString(localVarOptionals.AnalysisStatus.Value(), \"\"))\n\t}\n\t// to determine the Content-Type header\n\tlocalVarHTTPContentTypes := []string{}\n\n\t// set Content-Type header\n\tlocalVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)\n\tif localVarHTTPContentType != \"\" {\n\t\tlocalVarHeaderParams[\"Content-Type\"] = localVarHTTPContentType\n\t}\n\n\t// to determine the Accept header\n\tlocalVarHTTPHeaderAccepts := []string{\"application/json\"}\n\n\t// set Accept header\n\tlocalVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)\n\tif localVarHTTPHeaderAccept != \"\" {\n\t\tlocalVarHeaderParams[\"Accept\"] = localVarHTTPHeaderAccept\n\t}\n\tif localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() {\n\t\tlocalVarHeaderParams[\"x-anchore-account\"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), \"\")\n\t}\n\tr, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, err\n\t}\n\n\tlocalVarHTTPResponse, err := a.client.callAPI(r)\n\tif err != nil || localVarHTTPResponse == nil {\n\t\treturn localVarReturnValue, localVarHTTPResponse, err\n\t}\n\n\tlocalVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)\n\tlocalVarHTTPResponse.Body.Close()\n\tif err != nil {\n\t\treturn localVarReturnValue, localVarHTTPResponse, err\n\t}\n\n\tif localVarHTTPResponse.StatusCode >= 300 {\n\t\tnewErr := GenericOpenAPIError{\n\t\t\tbody: localVarBody,\n\t\t\terror: localVarHTTPResponse.Status,\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 500 {\n\t\t\tvar v ApiErrorResponse\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t}\n\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t}\n\n\terr = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\tif err != nil {\n\t\tnewErr := GenericOpenAPIError{\n\t\t\tbody: localVarBody,\n\t\t\terror: err.Error(),\n\t\t}\n\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t}\n\n\treturn localVarReturnValue, localVarHTTPResponse, nil\n}", "title": "" }, { "docid": "8e8eaa5e035b957c03677932b9e649bd", "score": "0.6827557", "text": "func (c *Client) GetImages(ctx context.Context, params *GetImagesInput, optFns ...func(*Options)) (*GetImagesOutput, error) {\n\tif params == nil {\n\t\tparams = &GetImagesInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GetImages\", params, optFns, c.addOperationGetImagesMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GetImagesOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}", "title": "" }, { "docid": "2e6f16aa8ccd18c14f9c51e0f20ea54a", "score": "0.6816174", "text": "func (c *Client) ListImages(ctx context.Context, filter ...string) ([]containerd.Image, error) {\n\twrapperCli, err := c.Get(ctx)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get a containerd grpc client: %v\", err)\n\t}\n\n\treturn wrapperCli.client.ListImages(ctx, filter...)\n}", "title": "" }, { "docid": "72032e1d784fcce306ee6bb4c740eafc", "score": "0.68056047", "text": "func (srv *ImageService) List() ([]api.Image, error) {\n\treturn srv.provider.ListImages()\n}", "title": "" }, { "docid": "e0da576b2d63417b46b24afbb3112f4b", "score": "0.6778703", "text": "func (k *kubectl) GetImages() []string {\n\treturn k.images\n}", "title": "" }, { "docid": "60df73f1ded3fcb3a6290e326c587472", "score": "0.6767906", "text": "func ImageList(r shared.RemoteDef) ([]shared.ImageDef, error) {\n\tvar imgs []shared.ImageDef\n\n\tresp, err := Get(r, \"/images\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terr = DecodeJson(resp, &imgs)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn imgs, nil\n}", "title": "" }, { "docid": "8303569d36adf058bde808d5f1a7a956", "score": "0.6753352", "text": "func (daemon *Daemon) ListImages(filterArgs, filter string, all bool) ([]*types.Image, error) {\n\treturn daemon.repositories.Images(filterArgs, filter, all)\n}", "title": "" }, { "docid": "2707a03a9fd16d80706de6bfc735f170", "score": "0.6742718", "text": "func (c *DefaultImagesClient) ListImages(ctx context.Context, organizationID string) ([]v1.Image, error) {\n\tparams := imageclient.GetImagesParams{\n\t\tContext: ctx,\n\t\tXDispatchOrg: c.getOrgID(organizationID),\n\t}\n\tresponse, err := c.client.Image.GetImages(&params, c.auth)\n\tif err != nil {\n\t\treturn nil, listImagesSwaggerError(err)\n\t}\n\timages := []v1.Image{}\n\tfor _, image := range response.Payload {\n\t\timages = append(images, *image)\n\t}\n\treturn images, nil\n}", "title": "" }, { "docid": "ee75ee124c77209af33145385266ae18", "score": "0.6720689", "text": "func GetImages(\n\turl, html, imgClass string, urlHandler func(string) string, config myconfig.Config) (string, []downloader.URL, error) {\n\tvar err error\n\tdoc, err := GetDoc(html)\n\tif err != nil {\n\t\treturn \"\", nil, err\n\t}\n\ttitle := Title(doc)\n\turls := make([]downloader.URL, 0)\n\turlData := downloader.URL{}\n\tdoc.Find(fmt.Sprintf(\"img[class=\\\"%s\\\"]\", imgClass)).Each(\n\t\tfunc(i int, s *goquery.Selection) {\n\t\t\turlData.URL, _ = s.Attr(\"src\")\n\t\t\tif urlHandler != nil {\n\t\t\t\t// Handle URL as needed\n\t\t\t\turlData.URL = urlHandler(urlData.URL)\n\t\t\t}\n\t\t\turlData.Size, err = request.Size(urlData.URL, url, config)\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t_, urlData.Ext, err = utils.GetNameAndExt(urlData.URL, config)\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\turls = append(urls, urlData)\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn \"\", nil, err\n\t}\n\treturn title, urls, nil\n}", "title": "" }, { "docid": "9304012b2419a1d0e0f886c9699cccea", "score": "0.67200226", "text": "func (v *Linode) ListImages(ctx *lepton.Context) error {\n\timages, err := v.GetImages(ctx)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\n\ttable := tablewriter.NewWriter(os.Stdout)\n\ttable.SetHeader([]string{\"ID\", \"Name\", \"Date created\", \"Size\", \"Status\"})\n\ttable.SetHeaderColor(\n\t\ttablewriter.Colors{tablewriter.Bold, tablewriter.FgCyanColor},\n\t\ttablewriter.Colors{tablewriter.Bold, tablewriter.FgCyanColor},\n\t\ttablewriter.Colors{tablewriter.Bold, tablewriter.FgCyanColor},\n\t\ttablewriter.Colors{tablewriter.Bold, tablewriter.FgCyanColor},\n\t\ttablewriter.Colors{tablewriter.Bold, tablewriter.FgCyanColor})\n\ttable.SetRowLine(true)\n\n\tfor _, image := range images {\n\t\tvar row []string\n\t\trow = append(row, image.ID)\n\t\trow = append(row, image.Name)\n\t\trow = append(row, \"\") // image.DateCreated)\n\t\trow = append(row, humanize.Bytes(uint64(image.Size)))\n\t\trow = append(row, image.Status)\n\t\ttable.Append(row)\n\t}\n\n\ttable.Render()\n\n\treturn nil\n}", "title": "" }, { "docid": "ecf0fe66bf2dc128ce047377f830e956", "score": "0.6699608", "text": "func GetImages(e2eRegistryConfig, version string) (map[string]Config, error) {\n\t// Get list of upstream images that match the version\n\treg, err := NewRegistryList(e2eRegistryConfig, version)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"couldn't init Registry List\")\n\t}\n\n\timgs, err := reg.GetImageConfigs()\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"couldn't get images for version\")\n\t}\n\treturn imgs, nil\n}", "title": "" }, { "docid": "ca6f38f2602dcd6bf770418c5a011766", "score": "0.66860735", "text": "func (r *Registry) ListImages(\n\trepoName string,\n\trepo repository.Repository,\n) ([]*Image, error) {\n\t// switch on the auth mechanism to get a token\n\tif r.AWSIntegrationID != 0 {\n\t\treturn r.listECRImages(repoName, repo)\n\t}\n\n\tif r.GCPIntegrationID != 0 {\n\t\treturn r.listGCRImages(repoName, repo)\n\t}\n\n\treturn nil, fmt.Errorf(\"error listing images\")\n}", "title": "" }, { "docid": "d074f139c26d4bf1b4467332572ede62", "score": "0.6649224", "text": "func (self *ImageCollection) Images() []interface{}{\n\tarray00 := self.Object.Get(\"images\")\n\tlength00 := array00.Length()\n\tout00 := make([]interface{}, length00, length00)\n\tfor i00 := 0; i00 < length00; i00++ {\n\t\tout00[i00] = array00.Index(i00)\n\t}\n\treturn out00\n}", "title": "" }, { "docid": "64d9720236463656a187ef8b9368c022", "score": "0.66486746", "text": "func reqGetDockerImages(w http.ResponseWriter, r *http.Request) {\n\t// Update images availables\n\toutput := queryDockerOnHost([]string{\"image\", \"list\"})\n\tparseDockerImages(output)\n\n\t// Send response\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tenableCors(&w)\n\tjson.NewEncoder(w).Encode(images)\n}", "title": "" }, { "docid": "d1d2e72822513a75f2b6bdbf4f388568", "score": "0.6635999", "text": "func doHandleGetImages(w http.ResponseWriter, r *http.Request, params url.Values) {\n\tif r.URL.Path == \"/images\" {\n\t\tserverListImages(configuration.Datadir, w, r)\n\t\treturn\n\t}\n\n\tuuid, file, err := splitImagesUrl(r.URL.Path)\n\tif err != nil {\n\t\tsendResponse(w, InvalidParameter,\n\t\t\tmap[string]interface{}{\n\t\t\t\t\"code\": \"InvalidParameter\",\n\t\t\t\t\"message\": fmt.Sprintf(\"%v\", err),\n\t\t\t})\n\t\treturn\n\t}\n\n\t// check if the resource exists\n\tfilename := configuration.Datadir + \"/\" + uuid\n\t_, err = os.Stat(filename)\n\tif err != nil {\n\t\tsendResponse(w, ResourceNotFound,\n\t\t\tmap[string]interface{}{\n\t\t\t\t\"code\": \"ResourceNotFound\",\n\t\t\t\t\"message\": fmt.Sprintf(\"Failed to locate %s: %v\", filename, err),\n\t\t\t})\n\t\treturn\n\t}\n\n\t// Ok, everything should be OK.. go do it!\n\tif len(file) == 0 {\n\t\tserverGetImage(w, r, params, filename)\n\t\treturn\n\t}\n\n\tif file == \"/icon\" {\n\t\tserverGetImageIcon(w, r, params, filename)\n\t\treturn\n\t}\n\n\tif file == \"/file\" {\n\t\tserverGetImageFile(w, r, params, filename)\n\t\treturn\n\t}\n\n\tsendResponse(w, ResourceNotFound,\n\t\tmap[string]interface{}{\n\t\t\t\"code\": \"ResourceNotFound\",\n\t\t\t\"message\": \"Requested resource does not exist\",\n\t\t})\n}", "title": "" }, { "docid": "1f2e0d4c2554d30ccee6796e89e8fe26", "score": "0.6628115", "text": "func (l *client) ListImages(filter string) ([]*Image, error) {\n\tresponse := []*Image{}\n\n\timglist, err := l.server.GetImages()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to list images: %w\", err)\n\t}\n\n\tfor _, lxdImg := range imglist {\n\t\tlxdImg := lxdImg\n\n\t\tif !l.IsCRI(lxdImg) {\n\t\t\tcontinue\n\t\t}\n\n\t\tif filter != \"\" && filter != lxdImg.Fingerprint {\n\t\t\tcontinue\n\t\t}\n\n\t\tresponse = append(response, toImage(&lxdImg))\n\t}\n\n\treturn response, nil\n}", "title": "" }, { "docid": "06a7f30fe284279b4c2b80bf9a98cd18", "score": "0.66064185", "text": "func (s *ServiceDelegator) Images(ctx context.Context, project string, options ImagesOptions) ([]ImageSummary, error) {\n\treturn s.Delegate.Images(ctx, project, options)\n}", "title": "" }, { "docid": "13e68042e00a108e47ea878886fc7cdb", "score": "0.6605541", "text": "func (a *SitesApiService) SitesIdImagesGet(ctx context.Context, xAuthToken string, id string) ([]ImageOverview, *http.Response, error) {\n\tvar (\n\t\tlocalVarHttpMethod = strings.ToUpper(\"Get\")\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarFileName string\n\t\tlocalVarFileBytes []byte\n\t\tsuccessPayload []ImageOverview\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/sites/{id}/images\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"id\"+\"}\", fmt.Sprintf(\"%v\", id), -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := url.Values{}\n\tlocalVarFormParams := url.Values{}\n\n\t// to determine the Content-Type header\n\tlocalVarHttpContentTypes := []string{}\n\n\t// set Content-Type header\n\tlocalVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)\n\tif localVarHttpContentType != \"\" {\n\t\tlocalVarHeaderParams[\"Content-Type\"] = localVarHttpContentType\n\t}\n\n\t// to determine the Accept header\n\tlocalVarHttpHeaderAccepts := []string{\"application/json\"}\n\n\t// set Accept header\n\tlocalVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)\n\tif localVarHttpHeaderAccept != \"\" {\n\t\tlocalVarHeaderParams[\"Accept\"] = localVarHttpHeaderAccept\n\t}\n\tlocalVarHeaderParams[\"x-auth-token\"] = parameterToString(xAuthToken, \"\")\n\tif ctx != nil {\n\t\t// API Key Authentication\n\t\tif auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {\n\t\t\tvar key string\n\t\t\tif auth.Prefix != \"\" {\n\t\t\t\tkey = auth.Prefix + \" \" + auth.Key\n\t\t\t} else {\n\t\t\t\tkey = auth.Key\n\t\t\t}\n\t\t\tlocalVarHeaderParams[\"x-auth-token\"] = key\n\t\t}\n\t}\n\tr, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)\n\tif err != nil {\n\t\treturn successPayload, nil, err\n\t}\n\n\tlocalVarHttpResponse, err := a.client.callAPI(r)\n\tif err != nil || localVarHttpResponse == nil {\n\t\treturn successPayload, localVarHttpResponse, err\n\t}\n\tdefer localVarHttpResponse.Body.Close()\n\tif localVarHttpResponse.StatusCode >= 300 {\n\t\tbodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)\n\t\treturn successPayload, localVarHttpResponse, reportError(\"Status: %v, Body: %s\", localVarHttpResponse.Status, bodyBytes)\n\t}\n\n\tif err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {\n\t\treturn successPayload, localVarHttpResponse, err\n\t}\n\n\treturn successPayload, localVarHttpResponse, err\n}", "title": "" }, { "docid": "d81d3167e5f5f3a556ed972e64f7dcdf", "score": "0.65982485", "text": "func (c *CriWrapper) ListImages(ctx context.Context, r *runtime.ListImagesRequest) (res *runtime.ListImagesResponse, err error) {\n\tlogrus.Debugf(\"ListImages with filter %+v\", r.GetFilter())\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tlogrus.Errorf(\"failed to list images with filter %+v: %v\", r.GetFilter(), err)\n\t\t} else {\n\t\t\t// NOTE: maybe log detailed image items with higher log level.\n\t\t\tlogrus.Debugf(\"success to list images with filter: %+v\", r.GetFilter())\n\t\t}\n\t}()\n\treturn c.CriManager.ListImages(ctx, r)\n}", "title": "" }, { "docid": "e6e6012291e19875afd5bb87c1c6dfbd", "score": "0.6586075", "text": "func getDockerImages() (images []string) {\n\tcmd := exec.Command(\"docker\", \"images\")\n\treturn wrkutils.CommandColumnNoHeader(0, cmd)\n}", "title": "" }, { "docid": "574572506dbd45d50e7a21975a6bda0b", "score": "0.65823805", "text": "func getImages(registryMetadata config.Registry) ([]*bundle.Spec, error) {\n\tvar specList []*bundle.Spec\n\n\tauthNamespace := \"\"\n\tregistry, err := registries.NewRegistry(registryMetadata.Config, authNamespace)\n\tif err != nil {\n\t\tlog.Error(\"Error from creating a NewRegistry\")\n\t\tlog.Error(err)\n\t\treturn nil, err\n\t}\n\n\tspecs, count, err := registry.LoadSpecs()\n\tif err != nil {\n\t\tlog.Errorf(\"registry: %v was unable to complete bootstrap - %v\",\n\t\t\tregistry.RegistryName(), err)\n\t\treturn nil, err\n\t}\n\tlog.Infof(\"Registry %v has %d valid APBs available from %d images scanned\", registry.RegistryName(), len(specs), count)\n\n\tspecList = append(specList, specs...)\n\treturn specList, nil\n}", "title": "" }, { "docid": "8c01da6bc85a13f5ea4d915cc68581ee", "score": "0.65812904", "text": "func (f *Fetcher) FetchImages(al *apps.Apps) error {\n\treturn al.Walk(func(app *apps.App) error {\n\t\td, err := DistFromImageString(app.Image)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\th, err := f.FetchImage(d, app.Image, app.Asc)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tapp.ImageID = *h\n\t\treturn nil\n\t})\n}", "title": "" }, { "docid": "e6971c1a5999f7aca46257a7a8640ae4", "score": "0.65755314", "text": "func (_Images *ImagesSession) Images(arg0 *big.Int) (string, error) {\n\treturn _Images.Contract.Images(&_Images.CallOpts, arg0)\n}", "title": "" }, { "docid": "63abb81ed90780f5eeea6d29326959bc", "score": "0.65557927", "text": "func GetAllImages(db *sql.DB) ([]Image, error) {\n\tvar images []Image\n\n\trows, err := db.Query(`\n\t\tSELECT id, title, path, created, modified, high_res_id\n\t\tFROM ImageMeta\n\t`)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor rows.Next() {\n\t\tvar image Image\n\t\terr = rows.Scan(&image.ID, &image.Title, &image.Path, &image.Created, &image.Modified, &image.HighResID)\n\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\timages = append(images, image)\n\t}\n\n\treturn images, nil\n}", "title": "" }, { "docid": "e3bf9a3a33456de9254b00a964383825", "score": "0.65551627", "text": "func AllImages() []string {\n\treturn []string{\n\t\tEtcdImage.Name(),\n\t\tToolsImage.Name(),\n\t\tKubernetesImage.Name(),\n\t\tPauseImage.Name(),\n\t\tCoreDNSImage.Name(),\n\t\tUnboundImage.Name(),\n\t\tUnboundExporterImage.Name(),\n\t}\n}", "title": "" }, { "docid": "c8b1b82b9fbde6d3ec3ee33401674ba2", "score": "0.6554989", "text": "func ListImages(c *client.Client) ([]string, error) {\n\timageNames := []string{}\n\tctx := context.Background()\n\timageSummaries, err := c.ImageList(ctx, dockerTypes.ImageListOptions{\n\t\tAll: true,\n\t})\n\tif err != nil {\n\t\treturn imageNames, err\n\t}\n\tfor _, imageSummary := range imageSummaries {\n\t\tif len(imageSummary.RepoTags) > 0 {\n\t\t\trepoTag := imageSummary.RepoTags[0]\n\t\t\timageNames = append(imageNames, repoTag)\n\t\t}\n\t}\n\treturn imageNames, nil\n}", "title": "" }, { "docid": "c5a5180d94fffcc87a9e7fc2ecab2dcf", "score": "0.6535536", "text": "func (s *FraktiManager) ListImages(ctx context.Context, req *kubeapi.ListImagesRequest) (*kubeapi.ListImagesResponse, error) {\n\tglog.V(3).Infof(\"ListImages with request %s\", req.String())\n\n\terrs := []error{}\n\n\t// NOTE: The following steps assume 'imageServiceList' and 'imageMapList' have corresponding order\n\timageServiceList := []runtime.ImageManagerService{s.hyperImageService, s.privilegedImageService}\n\tworkerNum := 2\n\tif s.unikernelImageService != nil {\n\t\timageServiceList = append(imageServiceList, s.unikernelImageService)\n\t\tworkerNum++\n\t}\n\timageMapList := make([]map[string]*kubeapi.Image, workerNum)\n\n\tlistImageFunc := func(i int) {\n\t\timages, err := imageServiceList[i].ListImages(req.GetFilter())\n\t\tif err != nil {\n\t\t\terrs = append(errs, fmt.Errorf(\"ListImage from %s failed: %v\", imageServiceList[i].ServiceName(), err))\n\t\t\treturn\n\t\t}\n\t\timageMapList[i] = make(map[string]*kubeapi.Image, len(images))\n\t\tfor _, image := range images {\n\t\t\timageMapList[i][image.Id] = image\n\t\t}\n\t}\n\n\tworkqueue.Parallelize(workerNum, workerNum, listImageFunc)\n\n\tif len(errs) > 0 {\n\t\tglog.Error(errs[0])\n\t\treturn nil, errs[0]\n\t}\n\n\t// NOTE: we show intersection of image list of hyper and privileged runtime\n\tintersectList := getImageListIntersection(imageMapList[0], imageMapList[1])\n\n\t// if there is different in two sides, print the different if log lever is high enough\n\tif glog.V(5) && len(imageMapList[0]) != len(intersectList) {\n\t\tglog.Infof(\"Image black hole in %s:\\n%v\", imageServiceList[0].ServiceName(), getImageListDifference(imageMapList[0], imageMapList[1]))\n\t\tglog.Infof(\"Image black hole in %s:\\n%v\", imageServiceList[1].ServiceName(), getImageListDifference(imageMapList[1], imageMapList[0]))\n\t}\n\n\t// Append unikernl image list at last\n\t// NOTE: Here we assume all unikernel images never overlap with hyper/docker's image,\n\t// so we just append unikernel images to the list.\n\tif s.unikernelImageService != nil {\n\t\tfor _, v := range imageMapList[2] {\n\t\t\tintersectList = append(intersectList, v)\n\t\t}\n\t}\n\n\treturn &kubeapi.ListImagesResponse{\n\t\tImages: intersectList,\n\t}, nil\n}", "title": "" }, { "docid": "c7926b9ffe89af196d18b10e4d132520", "score": "0.6534112", "text": "func listImages(response http.ResponseWriter, request *http.Request) {\n\tif prov, err := ValidateAssetProvider(response, request); err == nil {\n\t\timages, err := prov.ListImageNames()\n\t\tif err != nil {\n\t\t\tsendErrorResponse(response, http.StatusBadGateway, err)\n\t\t\treturn\n\t\t}\n\t\tsendResponse(images.String(), http.StatusOK, response)\n\t\treturn\n\t} else {\n\t\tsendErrorResponse(response, http.StatusBadGateway, err)\n\t}\n}", "title": "" }, { "docid": "7d0e144dfd5cad5e320e3c0878f23d8b", "score": "0.65313226", "text": "func AllImages() interface{} {\n\tdb := Gdb()\n\timages := []model.Image{}\n\treturn db.Find(&images).Value\n}", "title": "" }, { "docid": "7f55775455b4860a334a1c726f3d30f6", "score": "0.65105236", "text": "func LoadImages(context *common.AppContext, searchTerm, authToken string) ([]string, error) {\n\tcontext.Log.Println(\"Trying to load images from instagram now.\")\n\tserverURI := \"https://api.instagram.com/v1/tags/\" + searchTerm + \"/media/recent/\"\n\n\turi, err := url.Parse(serverURI)\n\tif err != nil {\n\t\treturn nil, errors.New(\"Unable to parse the URL.\")\n\t}\n\tdata := uri.Query()\n\tdata.Set(\"access_token\", authToken)\n\n\turi.RawQuery = data.Encode()\n\n\turlStr := fmt.Sprintf(\"%v\", uri)\n\tcontext.Log.Println(\"The server URI is: \", urlStr)\n\treturn fetchImages(context, urlStr, authToken)\n}", "title": "" }, { "docid": "4c2cf975f99e2b129cad876d65bbb1d6", "score": "0.64868903", "text": "func (c *DefaultImagesClient) ListBaseImages(ctx context.Context, organizationID string) ([]v1.BaseImage, error) {\n\tparams := baseimageclient.GetBaseImagesParams{\n\t\tContext: ctx,\n\t\tXDispatchOrg: c.getOrgID(organizationID),\n\t}\n\tresponse, err := c.client.BaseImage.GetBaseImages(&params, c.auth)\n\tif err != nil {\n\t\treturn nil, listBaseImagesSwaggerError(err)\n\t}\n\timages := []v1.BaseImage{}\n\tfor _, image := range response.Payload {\n\t\timages = append(images, *image)\n\t}\n\treturn images, nil\n}", "title": "" }, { "docid": "a5a2583e4e7076206fc9744adeedc465", "score": "0.64702165", "text": "func ImageList(w http.ResponseWriter, r *http.Request) {\n\timages, err := cli.ImageList(context.Background(), types.ImageListOptions{})\n\tdieIfErr(err)\n\n\trenderJSON(w, images)\n}", "title": "" }, { "docid": "6ffb016e137399f46d26a6c477bc564f", "score": "0.64556885", "text": "func GetAllImages(group, name string) *model.ImageList {\n\tlog.Debug(\"group:\", group, \",name:\", name)\n\n\ttagListURL := util.JoinURL(config.Get().Registry.URL, config.Get().Registry.Version)\n\n\tif group != \"\" {\n\t\ttagListURL = util.JoinURL(tagListURL, group, name, \"tags\", \"list\")\n\t} else {\n\t\ttagListURL = util.JoinURL(tagListURL, name, \"tags\", \"list\")\n\t}\n\tlog.Debug(\"Tag URL:\", tagListURL)\n\tresp, err := http.Get(tagListURL)\n\tif err != nil {\n\t\t// handle error\n\t}\n\tdefer resp.Body.Close()\n\tbody, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\n\t}\n\tvar tagList map[string]interface{}\n\terr = json.Unmarshal(body, &tagList)\n\tif err != nil {\n\t\t//todo\n\t\tlog.Debug(\"Unmarshal error\")\n\t\tlog.Debug(err)\n\n\t}\n\tvar wg sync.WaitGroup\n\ttags := tagList[\"tags\"]\n\twg.Add(len(tags.([]interface{})))\n\tvar images = make(model.ImageList, 0)\n\tfor i, tag := range tags.([]interface{}) {\n\t\tlog.Debug(i)\n\t\tgo func(t string) {\n\t\t\tdetail := GetTag(group, name, t)\n\t\t\timages = append(images, detail)\n\t\t\t//tagsInfo = jsonDetail\n\t\t\t//tagsInfo[\"tag\"] = t\n\t\t\tdefer wg.Done()\n\t\t}(tag.(string))\n\t}\n\twg.Wait()\n\tlog.Debug(\"tasks done\")\n\tlog.Debug(images)\n\tsort.Sort(images)\n\t// json, err := json.Marshal(&tagsInfo)\n\t// if err != nil {\n\t// \t//todo\n\t// }\n\t// fmt.Fprintf(w, string(json))\n\treturn &images\n}", "title": "" }, { "docid": "fdc06a99577d0c3a4307b67394e5caa4", "score": "0.64475703", "text": "func (d *Datastore) GetImages(col string, fp []byte) []string {\n\tvar res []string\n\td.db.View(func(tx *bolt.Tx) error {\n\t\troot := tx.Bucket([]byte(col))\n\n\t\tfpBkt := root.Bucket(fp)\n\t\tfpBkt.ForEach(func(k, v []byte) error {\n\t\t\tif v == nil {\n\t\t\t\tres = append(res, string(k))\n\t\t\t}\n\t\t\treturn nil\n\t\t})\n\t\treturn nil\n\t})\n\treturn res\n}", "title": "" }, { "docid": "df97c249954e8256408bb4ba8acb92be", "score": "0.6413385", "text": "func (_Images *ImagesCallerSession) Images(arg0 *big.Int) (string, error) {\n\treturn _Images.Contract.Images(&_Images.CallOpts, arg0)\n}", "title": "" }, { "docid": "1d11e55fd488c68584cc61ceaaf1afbe", "score": "0.641337", "text": "func (c *Cluster) GetImages() (map[string][]string, error) {\n\timages := make(map[string][]string) // key is fingerprint, value is list of projects\n\terr := c.Transaction(context.TODO(), func(ctx context.Context, tx *ClusterTx) error {\n\t\tstmt := `\n SELECT images.fingerprint, projects.name FROM images\n LEFT JOIN projects ON images.project_id = projects.id\n\t\t`\n\t\trows, err := tx.tx.QueryContext(ctx, stmt)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tvar fingerprint string\n\t\tvar projectName string\n\t\tfor rows.Next() {\n\t\t\terr := rows.Scan(&fingerprint, &projectName)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\timages[fingerprint] = append(images[fingerprint], projectName)\n\t\t}\n\n\t\treturn rows.Err()\n\t})\n\treturn images, err\n}", "title": "" }, { "docid": "3eac3c3f0da9c991affbe737c7a8fa8f", "score": "0.63983214", "text": "func (r *CRIO) ListImages(ListImagesOptions) ([]ListImage, error) {\n\treturn listCRIImages(r.Runner)\n}", "title": "" }, { "docid": "e9f101e62c4b68d9a7d0b1d403503f1e", "score": "0.63925076", "text": "func (k *kustomize) GetImages() []string {\n\treturn k.images\n}", "title": "" }, { "docid": "e9f101e62c4b68d9a7d0b1d403503f1e", "score": "0.63925076", "text": "func (k *kustomize) GetImages() []string {\n\treturn k.images\n}", "title": "" }, { "docid": "fc6957274892a13825896652b43138f1", "score": "0.6389816", "text": "func ListImages(rs io.ReadSeeker, selectedPages []string, conf *pdfcpu.Configuration) ([]string, error) {\n\tif rs == nil {\n\t\treturn nil, errors.New(\"pdfcpu: ListImages: Please provide rs\")\n\t}\n\tif conf == nil {\n\t\tconf = pdfcpu.NewDefaultConfiguration()\n\t\tconf.Cmd = pdfcpu.LISTIMAGES\n\t}\n\tctx, _, _, _, err := readValidateAndOptimize(rs, conf, time.Now())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif err := ctx.EnsurePageCount(); err != nil {\n\t\treturn nil, err\n\t}\n\tpages, err := PagesForPageSelection(ctx.PageCount, selectedPages, true)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ctx.ListImages(pages)\n}", "title": "" }, { "docid": "0b6d3732c2b007922a74472039b58abc", "score": "0.63852865", "text": "func fetchImgs(p *Post) []string {\n\t// TODO: handle error\n\tclient := http.DefaultClient\n\treq, _ := http.NewRequest(\"GET\", p.Href, nil)\n\treq.Header.Set(\"Cookie\", \"over18=1\")\n\n\tres, _ := client.Do(req)\n\tdoc, _ := goquery.NewDocumentFromResponse(res)\n\timgSelector := `#main-content a[href$=\".jpg\"],a[href$=\".png\"],a[href$=\".gif\"]`\n\t//imgURL, _ := doc.Find(imgSelector).Attr(\"href\")\n\tvar imageURLs []string\n\tdoc.Find(\"div.push\").Each(func(i int, push *goquery.Selection) {\n\t\tpush.Remove()\n\t})\n\tdoc.Find(imgSelector).Each(func(i int, s *goquery.Selection) {\n\t\timgLink := s.Text()\n\t\timageURLs = append(imageURLs, imgLink)\n\t})\n\n\treturn imageURLs\n}", "title": "" }, { "docid": "83a3b83792622ee76d029498cf71183b", "score": "0.6364602", "text": "func GetAllImages(image *[]models.Image) (err error) {\n\tif err := configs.DB.Find(image).Error; err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2403588759573112c2c5557b16738c25", "score": "0.63435924", "text": "func GetDesktopprImages(rawurl string, wg *sync.WaitGroup) []Image {\n\tif wg != nil {\n\t\tdefer wg.Done()\n\t}\n\n\tresp := sendRequest(rawurl)\n\tdefer resp.Body.Close()\n\n\tret := DesktopprAPIResponse{}\n\terr := json.NewDecoder(resp.Body).Decode(&ret)\n\tCheck(err)\n\n\t// type conversion for abiding to interface\n\timages := ret.Images\n\tretImage := make([]Image, len(images))\n\tfor i := range images {\n\t\tretImage[i] = images[i]\n\t}\n\n\treturn retImage[:NOOFIMAGES]\n}", "title": "" }, { "docid": "7efecf184c4b39deb5fef4118eaaf793", "score": "0.6341734", "text": "func (a *AlbumService) AllImages(id string) {\n\tpath := fmt.Sprintf(\"/album/%s/images\", id)\n\n\tresp, err := a.client.Get(path, NoOptions)\n\n\tif err != nil {\n\t\trespError(path)\n\t}\n\tdefer resp.Body.Close()\n\n\tprintBytes(resp.Body, a.client)\n\n}", "title": "" }, { "docid": "777ad8fdaefe781419ebc85a4e831287", "score": "0.63315463", "text": "func downloadImages(c *gin.Context) {\n\n\tvar links []models.Profile\n\t_, err := dbMap.Select(&links, \"SELECT id, image FROM profile\")\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Select statement failed -> %v\", err.Error())\n\t}\n\n\tfor _, profile := range links {\n\t\tvar _, err = os.Stat(\"./images/\" + strconv.Itoa(profile.Id) + \".jpeg\")\n\n\t\tif os.IsNotExist(err) {\n\t\t\tfile, err := os.Create(\"./images/\" + strconv.Itoa(profile.Id) + \".jpeg\")\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"Failed to create image -> %v\", err.Error())\n\t\t\t}\n\t\t\tdefer file.Close()\n\n\t\t\tresponse, err := http.Get(profile.Image)\n\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"Unable to get url -> %v\", err.Error())\n\t\t\t}\n\n\t\t\tdefer response.Body.Close()\n\n\t\t\tio.Copy(file, response.Body)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b45c6b179d352e90609b46cc939be164", "score": "0.63268083", "text": "func (im *ImageManager) ListImages() []metaimage.Image {\n\treturn im.metaStore.List()\n}", "title": "" }, { "docid": "e41c72552fc5df764941f4cf6b39db95", "score": "0.6319793", "text": "func FetchImages() []Image {\n\timagesPointers := make([]*Image, 0)\n\tdb := storage.GetDefaultDB()\n\tdb.Fetch(&imagesPointers)\n\timages := make([]Image, len(imagesPointers))\n\tfor i := range imagesPointers {\n\t\timages[i] = *imagesPointers[i]\n\t}\n\treturn images\n}", "title": "" }, { "docid": "900a5b2bb4e8b9411ab8087dc4653175", "score": "0.6310664", "text": "func (_Images *ImagesCaller) Images(opts *bind.CallOpts, arg0 *big.Int) (string, error) {\n\tvar (\n\t\tret0 = new(string)\n\t)\n\tout := ret0\n\terr := _Images.contract.Call(opts, out, \"images\", arg0)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "17ec94e54ae672ab5126ea18b7d51dfb", "score": "0.6297443", "text": "func listImages(ctx context.Context, c core.ComputeClient) []core.Image {\n\trequest := core.ListImagesRequest{\n\t\tCompartmentId: helpers.CompartmentID(),\n\t}\n\n\tr, err := c.ListImages(ctx, request)\n\thelpers.FatalIfError(err)\n\n\treturn r.Items\n}", "title": "" }, { "docid": "fd33f13aee6780014fccfbc67dad06e1", "score": "0.62835735", "text": "func (p *Provider) ListImages(ctx *lepton.Context) error {\n\timages, err := p.GetImages(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ttable := tablewriter.NewWriter(os.Stdout)\n\ttable.SetHeader([]string{\"UUID\", \"Name\", \"Status\", \"Size\", \"CreatedAt\"})\n\ttable.SetHeaderColor(\n\t\ttablewriter.Colors{tablewriter.Bold, tablewriter.FgCyanColor},\n\t\ttablewriter.Colors{tablewriter.Bold, tablewriter.FgCyanColor},\n\t\ttablewriter.Colors{tablewriter.Bold, tablewriter.FgCyanColor},\n\t\ttablewriter.Colors{tablewriter.Bold, tablewriter.FgCyanColor},\n\t\ttablewriter.Colors{tablewriter.Bold, tablewriter.FgCyanColor})\n\ttable.SetRowLine(true)\n\tfor _, i := range images {\n\t\tvar row []string\n\t\trow = append(row, i.ID)\n\t\trow = append(row, i.Name)\n\t\trow = append(row, i.Status)\n\t\trow = append(row, lepton.Bytes2Human(i.Size))\n\t\trow = append(row, lepton.Time2Human(i.Created))\n\t\ttable.Append(row)\n\t}\n\ttable.Render()\n\treturn nil\n}", "title": "" }, { "docid": "96c39025af16efb3bda291d38dc3c59b", "score": "0.6268018", "text": "func ListImages() []types.ImageSummary {\n\timages, err := Client.ImageList(context.Background(), types.ImageListOptions{})\n\tutilities.ReportError(err, \"cannot list images\")\n\treturn images\n}", "title": "" }, { "docid": "71659baf8be30da2c8a845745b0de0a6", "score": "0.62629485", "text": "func (sdk SDKProperties) GetAvailableImages(version string, bucket string) ([]GCSImage, error) {\n\tvar buckets []string\n\tvar images []GCSImage\n\n\tif bucket == \"\" || bucket == defaultBucketName {\n\t\tbuckets = []string{defaultBucketName}\n\t} else {\n\t\tbuckets = []string{bucket, defaultBucketName}\n\t}\n\n\tfor _, b := range buckets {\n\t\turl := fmt.Sprintf(\"gs://%v/development/%v/images*\", b, version)\n\t\targs := []string{\"ls\", url}\n\t\toutput, err := runGSUtil(args)\n\t\tif err != nil {\n\t\t\treturn images, err\n\t\t}\n\t\tfor _, line := range strings.Split(strings.TrimSuffix(string(output), \"\\n\"), \"\\n\") {\n\t\t\tif len(filepath.Base(line)) >= 4 {\n\t\t\t\tbucketVersion := filepath.Base(filepath.Dir(filepath.Dir(line)))\n\t\t\t\tname := filepath.Base(line)[:len(filepath.Base(line))-4]\n\t\t\t\timages = append(images, GCSImage{Bucket: b, Version: bucketVersion, Name: name})\n\t\t\t} else {\n\t\t\t\tlog.Warningf(\"Could not parse image name: %v\", line)\n\t\t\t}\n\t\t}\n\t}\n\treturn images, nil\n}", "title": "" }, { "docid": "bdbbca6d9da537e878863e70e59f2c5c", "score": "0.6240922", "text": "func (a *RestAPIClient) GetBlockImages() ([]model.BlockImage, error) {\n\treturn a.rrc.GetBlockImages()\n}", "title": "" }, { "docid": "b19a57037e6330ba7f3aa5e54a3f0080", "score": "0.6240559", "text": "func (a *ImagesApiService) GetImage(ctx _context.Context, imageDigest string, localVarOptionals *GetImageOpts) ([]AnchoreImage, *_nethttp.Response, error) {\n\tvar (\n\t\tlocalVarHTTPMethod = _nethttp.MethodGet\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarFormFileName string\n\t\tlocalVarFileName string\n\t\tlocalVarFileBytes []byte\n\t\tlocalVarReturnValue []AnchoreImage\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/images/{imageDigest}\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"imageDigest\"+\"}\", _neturl.QueryEscape(parameterToString(imageDigest, \"\")) , -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := _neturl.Values{}\n\tlocalVarFormParams := _neturl.Values{}\n\n\t// to determine the Content-Type header\n\tlocalVarHTTPContentTypes := []string{}\n\n\t// set Content-Type header\n\tlocalVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)\n\tif localVarHTTPContentType != \"\" {\n\t\tlocalVarHeaderParams[\"Content-Type\"] = localVarHTTPContentType\n\t}\n\n\t// to determine the Accept header\n\tlocalVarHTTPHeaderAccepts := []string{\"application/json\"}\n\n\t// set Accept header\n\tlocalVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)\n\tif localVarHTTPHeaderAccept != \"\" {\n\t\tlocalVarHeaderParams[\"Accept\"] = localVarHTTPHeaderAccept\n\t}\n\tif localVarOptionals != nil && localVarOptionals.XAnchoreAccount.IsSet() {\n\t\tlocalVarHeaderParams[\"x-anchore-account\"] = parameterToString(localVarOptionals.XAnchoreAccount.Value(), \"\")\n\t}\n\tr, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, err\n\t}\n\n\tlocalVarHTTPResponse, err := a.client.callAPI(r)\n\tif err != nil || localVarHTTPResponse == nil {\n\t\treturn localVarReturnValue, localVarHTTPResponse, err\n\t}\n\n\tlocalVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)\n\tlocalVarHTTPResponse.Body.Close()\n\tif err != nil {\n\t\treturn localVarReturnValue, localVarHTTPResponse, err\n\t}\n\n\tif localVarHTTPResponse.StatusCode >= 300 {\n\t\tnewErr := GenericOpenAPIError{\n\t\t\tbody: localVarBody,\n\t\t\terror: localVarHTTPResponse.Status,\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 500 {\n\t\t\tvar v ApiErrorResponse\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t}\n\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t}\n\n\terr = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\tif err != nil {\n\t\tnewErr := GenericOpenAPIError{\n\t\t\tbody: localVarBody,\n\t\t\terror: err.Error(),\n\t\t}\n\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t}\n\n\treturn localVarReturnValue, localVarHTTPResponse, nil\n}", "title": "" }, { "docid": "5ff7f28f86675f78cabfb49c284ee7fd", "score": "0.62220556", "text": "func (o *OpenStack) ListImages(ctx *Context) error {\n\n\timageClient, err := openstack.NewImageServiceV2(o.provider, gophercloud.EndpointOpts{\n\t\tRegion: os.Getenv(\"OS_REGION_NAME\"),\n\t})\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\n\tlistOpts := images.ListOpts{}\n\n\tallPages, err := images.List(imageClient, listOpts).AllPages()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tallImages, err := images.ExtractImages(allPages)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\n\ttable := tablewriter.NewWriter(os.Stdout)\n\ttable.SetHeader([]string{\"Name\", \"Status\", \"Created\"})\n\ttable.SetHeaderColor(\n\t\ttablewriter.Colors{tablewriter.Bold, tablewriter.FgCyanColor},\n\t\ttablewriter.Colors{tablewriter.Bold, tablewriter.FgCyanColor},\n\t\ttablewriter.Colors{tablewriter.Bold, tablewriter.FgCyanColor})\n\ttable.SetRowLine(true)\n\n\tfor _, image := range allImages {\n\t\tvar row []string\n\t\trow = append(row, image.Name)\n\t\trow = append(row, fmt.Sprintf(\"%v\", image.Status))\n\t\trow = append(row, time2Human(image.CreatedAt))\n\t\ttable.Append(row)\n\t}\n\n\ttable.Render()\n\n\treturn nil\n}", "title": "" }, { "docid": "ed8ffabbe2fd0a1c95008bb3d4f676c3", "score": "0.62216115", "text": "func ListImages(client pb.ImageServiceClient, image string) (resp *pb.ListImagesResponse, err error) {\n\trequest := &pb.ListImagesRequest{Filter: &pb.ImageFilter{Image: &pb.ImageSpec{Image: image}}}\n\tlogrus.Debugf(\"ListImagesRequest: %v\", request)\n\tresp, err = client.ListImages(context.Background(), request)\n\tlogrus.Debugf(\"ListImagesResponse: %v\", resp)\n\treturn\n}", "title": "" }, { "docid": "09867996454532c96d3eab15acb894b2", "score": "0.62198454", "text": "func GetAllImagesAndSets(r *http.Request, w http.ResponseWriter) Images {\n\tnewImages := Images{}\n\n\timgSetList := GetAllImageSets(r)\n\tfor _, imageSet := range imgSetList.ImgSets {\n\t\timagesOfSingleSet := createImgList(r, w, imageSet.SetName)\n\t\tnewImages.ImgLists = append(newImages.ImgLists, imagesOfSingleSet)\n\t}\n\n\treturn newImages\n}", "title": "" }, { "docid": "2a295fc26247ebe47217f1c1121ef527", "score": "0.6217721", "text": "func listImages(deployment string) []models.Image {\n\tdefer utils.TimeTrack(time.Now(), listImages)\n\n\tvar images []models.Image\n\tbucket := DB.From(deployment)\n\tlog.WithFields(log.Fields{\n\t\t\"deployment\": deployment,\n\t}).Info(\"Fetching inventory Images for the deployment\")\n\terr := bucket.All(&images)\n\tif err != nil {\n\t\tlog.Error(err)\n\t}\n\treturn images\n}", "title": "" }, { "docid": "4f504fc9b840a55cc3585a80f51b5c6f", "score": "0.6197884", "text": "func Images(tag string, name string)[]byte{\n\tvar img_path string = \"/home/ubuntu/DockerWorkPlace/Golang/source/images/\"\n\tfilepath := img_path + tag + name\n\ttemp,err := ioutil.ReadFile(filepath)\n\tif err != nil {\n\t\tfmt.Println(\"Images() err: \", err)\n\t}\n\treturn temp\n}", "title": "" }, { "docid": "d74bd6cf9a8482ca379a028ef459e14c", "score": "0.619782", "text": "func ListImages(token string) {\n\timages := GetImages(token)\n\tfor _, image := range images {\n\t\tfmt.Printf(\"%-18v %-48v %-6v %-29v %-15v\\n\", image.ID, image.Label, image.Size, image.Created, image.Vendor)\n\t}\n}", "title": "" }, { "docid": "5b5f67bd3d2718c6f5b0a00fa61838b6", "score": "0.6194997", "text": "func getListOfImages() ListImage {\n\t//get a copy :-)\n\tvar all ListImage\n\timages := pImageHistory\n\t//iterate\n\tfor _, row := range images {\n\t\tif row.Status == StatusComplete {\n\t\t\tfor _, rec := range row.URLS {\n\t\t\t\tif rec.ImgurID != \"\" {\n\t\t\t\t\tall.Uploaded = append(all.Uploaded, rec.ImgurLink)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn all\n}", "title": "" }, { "docid": "2d6ce89844b55d3ba80eeaaba4f4daf0", "score": "0.6184431", "text": "func (i *imageCache) get() []container.Image {\n\ti.Lock()\n\tdefer i.Unlock()\n\treturn i.images\n}", "title": "" }, { "docid": "3b53a493a2bf75f7196ea8ecaa08cae3", "score": "0.61759555", "text": "func (s *Store) DownloadAllSourceImages(fiddleRoot string) error {\n\tctx := context.Background()\n\tq := &storage.Query{\n\t\tPrefix: fmt.Sprintf(\"source/\"),\n\t}\n\tif err := os.MkdirAll(filepath.Join(fiddleRoot, \"images\"), 0755); err != nil {\n\t\treturn fmt.Errorf(\"Failed to create images directory: %s\", err)\n\t}\n\tit := s.bucket.Objects(ctx, q)\n\tfor obj, err := it.Next(); err != iterator.Done; obj, err = it.Next() {\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Failed to retrieve image list: %s\", err)\n\t\t}\n\t\tfilename := strings.Split(obj.Name, \"/\")[1]\n\t\tdstFullPath := filepath.Join(fiddleRoot, \"images\", filename)\n\t\tif err := downloadSingleSourceImage(ctx, s.bucket, obj.Name, dstFullPath); err != nil {\n\t\t\tsklog.Errorf(\"Failed to download image %q: %s\", obj.Name, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "02ef6dff4d5653307411839581cb93ba", "score": "0.61726624", "text": "func (s *Service) All(w http.ResponseWriter, r *http.Request) {\n\tdata, statusCode := func() ([]byte, int) {\n\t\tctx := r.Context()\n\t\timages, err := s.repo.All(ctx)\n\t\tif err != nil {\n\t\t\treturn []byte(fmt.Sprintf(\"error getting images from db: %v\", err)),\n\t\t\t\thttp.StatusInternalServerError\n\t\t}\n\t\tres, err := json.Marshal(images)\n\t\tif err != nil {\n\t\t\treturn []byte(fmt.Sprintf(\"error during marshaling images: %v\", err)),\n\t\t\t\thttp.StatusInternalServerError\n\t\t}\n\t\treturn res, http.StatusOK\n\t}()\n\tresponse(w, data, statusCode)\n}", "title": "" }, { "docid": "25bc90c2cbe0681298596b4fd07c4c41", "score": "0.6170998", "text": "func ListImages(ctx context.Context, opts *FilterOptions) ([]types.ImageSummary, error) {\n\tcli, err := client.NewEnvClient()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfilter, err := opts.Build()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn cli.ImageList(ctx, filter)\n}", "title": "" }, { "docid": "ac701f647041795c98d292df6e30b5ed", "score": "0.61705804", "text": "func (e EC2Connector) getImg(filter []*ec2.Filter) (map[string][]image_local, error) {\n\n\tself := \"self\"\n\n\tinput := ec2.DescribeImagesInput{Owners: []*string{&self}, Filters: filter}\n\n\timage_map := make(map[string][]image_local)\n\n\tif iresult, ierror := e.ec2connect.DescribeImages(&input); ierror != nil {\n\t\treturn image_map, ierror\n\t} else {\n\n\t\tfor _, image_entry := range iresult.Images {\n\n\t\t\timg_type := strings.Split(*image_entry.Name, \"_\")[0]\n\n\t\t\ttstamp, terror := time.Parse(time.RFC3339, *image_entry.CreationDate)\n\n\t\t\tif terror != nil {\n\t\t\t\treturn image_map, terror\n\t\t\t} else {\n\t\t\t\timage_map[img_type] = append(image_map[img_type], image_local{image: image_entry, timestamp: tstamp })\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\treturn image_map, nil\n}", "title": "" }, { "docid": "355a8a409450da46606c3c6d97d96eea", "score": "0.6169777", "text": "func ListImages() {\n\tvar regConfigs []config.Registry\n\tvar newRegConfigs []config.Registry\n\n\terr := config.Registries.UnmarshalKey(\"Registries\", &regConfigs)\n\tif err != nil {\n\t\tlog.Error(\"Error unmarshalling config: \", err)\n\t\treturn\n\t}\n\n\tfor _, regConfig := range regConfigs {\n\t\tif len(regConfig.Specs) > 0 && Refresh == false {\n\t\t\tfmt.Printf(\"Found specs already in registry: [%s]\\n\", regConfig.Config.Name)\n\t\t\tnewRegConfigs = append(newRegConfigs, regConfig)\n\t\t\tcontinue\n\t\t}\n\t\tfmt.Printf(\"Getting specs for registry: [%s]\\n\", regConfig.Config.Name)\n\t\tspecs, err := getImages(regConfig)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"Error getting images - %v\", err)\n\t\t\tcontinue\n\t\t}\n\n\t\tregConfig.Specs = specs\n\t\tnewRegConfigs = append(newRegConfigs, regConfig)\n\t}\n\tprintRegConfigSpecs(newRegConfigs)\n\n\terr = config.UpdateCachedRegistries(config.Registries, newRegConfigs)\n\tif err != nil {\n\t\tlog.Errorf(\"Error updating cache - %v\", err)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "592c17ccd1a9813c2e9f8bf04f24d52a", "score": "0.61580646", "text": "func listImages(w http.ResponseWriter, r *http.Request) {\n\timages, err := db.List()\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t}\n\tdata, _ := json.Marshal(images)\n\tw.Write(data)\n}", "title": "" }, { "docid": "4a220f1afef92c1d6adb2966d94b0ccd", "score": "0.61488694", "text": "func getImages(w http.ResponseWriter, req *http.Request) {\n\t\n\tr,_:=json.Marshal(savedMosaics)\n\tw.Header().Set(\"Content-Type\", \"application/json; charset=UTF-8\")\n\tw.Write([]byte(r))\n}", "title": "" }, { "docid": "a803ed858bb96574ab026f0b1a817e8a", "score": "0.6125586", "text": "func (cli *TkeClient) GetTKEClusterImages() ([]*Images, error) {\n\tif cli == nil {\n\t\treturn nil, cloudprovider.ErrServerIsNil\n\t}\n\n\treq := tke.NewDescribeImagesRequest()\n\n\t// tke DescribeImages\n\tresp, err := cli.tke.DescribeImages(req)\n\tif err != nil {\n\t\tblog.Errorf(\"GetTKEClusterImages client DescribeImages failed: %v\", err)\n\t\treturn nil, err\n\t}\n\n\t// check response\n\tresponse := resp.Response\n\tif response == nil {\n\t\tblog.Errorf(\"GetTKEClusterImages client DescribeImages but lost response information\")\n\t\treturn nil, cloudprovider.ErrCloudLostResponse\n\t}\n\t//check response data\n\tblog.Infof(\"RequestId[%s] tke client DescribeImages response successful\", *response.RequestId)\n\n\tif *response.TotalCount == 0 || len(response.ImageInstanceSet) == 0 {\n\t\treturn nil, fmt.Errorf(\"GetTKEClusterImages client DescribeImages response data empty\")\n\t}\n\n\timages := make([]*Images, 0)\n\tfor i := range response.ImageInstanceSet {\n\t\timages = append(images, &Images{\n\t\t\tOsName: *response.ImageInstanceSet[i].OsName,\n\t\t\tImageID: *response.ImageInstanceSet[i].ImageId,\n\t\t})\n\t}\n\n\treturn images, nil\n}", "title": "" }, { "docid": "d2da5a217896f2af782d602c79ea965f", "score": "0.6125194", "text": "func ImagesListApplication(c *cli.Context) {\n\tclient := NewClient(c, DefaultConfig)\n\topts := LoadOpts(c)\n\n\tf := func(opt *godo.ListOptions) ([]interface{}, *godo.Response, error) {\n\t\tlist, resp, err := client.Images.ListApplication(opt)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\n\t\tsi := make([]interface{}, len(list))\n\t\tfor i := range list {\n\t\t\tsi[i] = list[i]\n\t\t}\n\n\t\treturn si, resp, err\n\t}\n\n\tsi, err := PaginateResp(f, opts)\n\tif err != nil {\n\t\tlogrus.WithField(\"err\", err).Fatal(\"could not list application images\")\n\t}\n\n\tlist := make([]godo.Image, len(si))\n\tfor i := range si {\n\t\tlist[i] = si[i].(godo.Image)\n\t}\n\n\terr = displayOutput(c, list)\n\tif err != nil {\n\t\tlogrus.WithField(\"err\", err).Fatal(\"could not write output\")\n\t}\n}", "title": "" }, { "docid": "771c5a185c05df5d0c99d2524d6671ab", "score": "0.6119431", "text": "func (s *CloudAPIHTTPSuite) TestListImages(c *gc.C) {\n\tvar expected []cloudapi.Image\n\n\tresp, err := s.sendRequest(\"GET\", path.Join(testUserAccount, \"images\"), nil, nil)\n\tc.Assert(err, gc.IsNil)\n\tc.Assert(resp.StatusCode, gc.Equals, http.StatusOK)\n\tassertJSON(c, resp, &expected)\n\tc.Assert(len(expected), gc.Equals, 6)\n}", "title": "" }, { "docid": "100811fb29bcff47360e9e7f645f4cb2", "score": "0.6114573", "text": "func GetUnsplashImages(rawurl string, wg *sync.WaitGroup) []Image {\n\tif wg != nil {\n\t\tdefer wg.Done()\n\t}\n\n\tresp := sendRequest(rawurl)\n\tdefer resp.Body.Close()\n\n\tret := [NOOFIMAGES]UnsplashImage{}\n\terr := json.NewDecoder(resp.Body).Decode(&ret)\n\tCheck(err)\n\n\t// type conversion for abiding to interface\n\tretImage := make([]Image, len(ret))\n\tfor i := range ret {\n\t\tretImage[i] = ret[i]\n\t}\n\n\treturn retImage\n}", "title": "" }, { "docid": "7527988c0c27ca71108a248775030f62", "score": "0.6108942", "text": "func GetAll(w http.ResponseWriter, r *http.Request) {\n\tvar count int64\n\tvar images []models.Image\n\tresult := imageFilters(r, db.DB)\n\tpagination := common.GetPagination(r)\n\taccount, err := common.GetAccount(r)\n\tif err != nil {\n\t\tlog.Info(err)\n\t\terr := errors.NewBadRequest(err.Error())\n\t\tw.WriteHeader(err.Status)\n\t\tjson.NewEncoder(w).Encode(&err)\n\t\treturn\n\t}\n\tcountResult := imageFilters(r, db.DB.Model(&models.Image{})).Where(\"images.account = ?\", account).Count(&count)\n\tif countResult.Error != nil {\n\t\tcountErr := errors.NewInternalServerError()\n\t\tlog.Error(countErr)\n\t\tw.WriteHeader(countErr.Status)\n\t\tjson.NewEncoder(w).Encode(&countErr)\n\t\treturn\n\t}\n\tresult = result.Limit(pagination.Limit).Offset(pagination.Offset).Where(\"images.account = ?\", account).Joins(\"Commit\").Joins(\"Installer\").Find(&images)\n\tif result.Error != nil {\n\t\tlog.Error(err)\n\t\terr := errors.NewInternalServerError()\n\t\tw.WriteHeader(err.Status)\n\t\tjson.NewEncoder(w).Encode(&err)\n\t\treturn\n\t}\n\tjson.NewEncoder(w).Encode(map[string]interface{}{\"data\": &images, \"count\": count})\n}", "title": "" }, { "docid": "c91417a4c5fa4f2639b34990c5a6c116", "score": "0.61037964", "text": "func ReadImages(filename string) ([]string, error) {\n\tfile, err := os.Open(filename)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer file.Close()\n\tfilebytes, err := ioutil.ReadAll(file)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn ReadLines(filebytes), nil\n}", "title": "" }, { "docid": "17bcee33efd926ad3d3366b4cfc6a454", "score": "0.609442", "text": "func (c *LetsCloud) LocationImages(name string) ([]domains.Image, error) {\n\treq, err := c.requester.NewRequest(http.MethodGet, baseURL+fmt.Sprintf(\"/locations/%s/images\", name), nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tb, err := c.requester.SendRequest(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar out domains.GetLocationImagesResponse\n\n\terr = processResponse(b, &out)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif !out.Success {\n\t\treturn nil, errors.New(out.Message)\n\t}\n\n\treturn out.Data, nil\n}", "title": "" }, { "docid": "406a64e39940f18bb5b48a0767dfa0b1", "score": "0.60768795", "text": "func imageList() []string {\n\tfileList, _ := ioutil.ReadDir(PathToClient + \"/splashes/\")\n\tfiles := make([]string, 0)\n\tfor _, file := range fileList {\n\t\tif file.IsDir() {\n\t\t\tfiles = append(files, file.Name())\n\t\t}\n\t}\n\treturn files\n}", "title": "" }, { "docid": "54a82783902f8d28a3e95a66205219b7", "score": "0.6069794", "text": "func ImagesListUser(c *cli.Context) {\n\tclient := NewClient(c, DefaultConfig)\n\topts := LoadOpts(c)\n\n\tf := func(opt *godo.ListOptions) ([]interface{}, *godo.Response, error) {\n\t\tlist, resp, err := client.Images.ListUser(opt)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\n\t\tsi := make([]interface{}, len(list))\n\t\tfor i := range list {\n\t\t\tsi[i] = list[i]\n\t\t}\n\n\t\treturn si, resp, err\n\t}\n\n\tsi, err := PaginateResp(f, opts)\n\tif err != nil {\n\t\tlogrus.WithField(\"err\", err).Fatal(\"could not list user images\")\n\t}\n\n\tlist := make([]godo.Image, len(si))\n\tfor i := range si {\n\t\tlist[i] = si[i].(godo.Image)\n\t}\n\n\terr = displayOutput(c, list)\n\tif err != nil {\n\t\tlogrus.WithField(\"err\", err).Fatal(\"could not write output\")\n\t}\n}", "title": "" }, { "docid": "24b851adb045187a3d13f0336dbade0a", "score": "0.60668415", "text": "func (gis *GenericImageService) ListGenericImages() (genericImages []*types.GenericImage, err error) {\n\tlog.Debug(\"ListGenericImages\")\n\n\tdata, status, err := gis.concertoService.Get(APIPathCloudGenericImages)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err = utils.CheckStandardStatus(status, data); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err = json.Unmarshal(data, &genericImages); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn genericImages, nil\n}", "title": "" } ]
c9be5849a41bb880f34552e043709a66
BatchRunTestCasesOperation returns a new BatchRunTestCasesOperation from a given name. The name must be that of a previously created BatchRunTestCasesOperation, possibly from a different process.
[ { "docid": "edb392d295a1ec55cf4977d173d2932f", "score": "0.72075903", "text": "func (c *testCasesRESTClient) BatchRunTestCasesOperation(name string) *BatchRunTestCasesOperation {\n\toverride := fmt.Sprintf(\"/v3/%s\", name)\n\treturn &BatchRunTestCasesOperation{\n\t\tlro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),\n\t\tpollPath: override,\n\t}\n}", "title": "" } ]
[ { "docid": "bebb223170a823b13cda731c3c145048", "score": "0.6969072", "text": "func (c *testCasesGRPCClient) BatchRunTestCasesOperation(name string) *BatchRunTestCasesOperation {\n\treturn &BatchRunTestCasesOperation{\n\t\tlro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),\n\t}\n}", "title": "" }, { "docid": "babc0d2f226b678cddeced0ebb5e15e2", "score": "0.6356218", "text": "func (c *TestCasesClient) BatchRunTestCasesOperation(name string) *BatchRunTestCasesOperation {\n\treturn c.internalClient.BatchRunTestCasesOperation(name)\n}", "title": "" }, { "docid": "a1fe982ff1e889fe073161a502de5c6d", "score": "0.57900363", "text": "func (op *BatchRunTestCasesOperation) Name() string {\n\treturn op.lro.Name()\n}", "title": "" }, { "docid": "79b4515cf3ab607a7835cacfb60dd2d2", "score": "0.5405615", "text": "func (c *testCasesGRPCClient) RunTestCaseOperation(name string) *RunTestCaseOperation {\n\treturn &RunTestCaseOperation{\n\t\tlro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),\n\t}\n}", "title": "" }, { "docid": "6e32cb6a19213c1bfbe5641cdb6b0c95", "score": "0.5371362", "text": "func (c *testCasesGRPCClient) ExportTestCasesOperation(name string) *ExportTestCasesOperation {\n\treturn &ExportTestCasesOperation{\n\t\tlro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),\n\t}\n}", "title": "" }, { "docid": "79920ca4a997ad3cd3802cd881b2e528", "score": "0.53389835", "text": "func (c *testCasesRESTClient) BatchRunTestCases(ctx context.Context, req *cxpb.BatchRunTestCasesRequest, opts ...gax.CallOption) (*BatchRunTestCasesOperation, error) {\n\tm := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}\n\tjsonReq, err := m.Marshal(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tbaseUrl, err := url.Parse(c.endpoint)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbaseUrl.Path += fmt.Sprintf(\"/v3/%v/testCases:batchRun\", req.GetParent())\n\n\tparams := url.Values{}\n\tparams.Add(\"$alt\", \"json;enum-encoding=int\")\n\n\tbaseUrl.RawQuery = params.Encode()\n\n\t// Build HTTP headers from client and context metadata.\n\thds := []string{\"x-goog-request-params\", fmt.Sprintf(\"%s=%v\", \"parent\", url.QueryEscape(req.GetParent()))}\n\n\thds = append(c.xGoogHeaders, hds...)\n\thds = append(hds, \"Content-Type\", \"application/json\")\n\theaders := gax.BuildHeaders(ctx, hds...)\n\tunm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}\n\tresp := &longrunningpb.Operation{}\n\te := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {\n\t\tif settings.Path != \"\" {\n\t\t\tbaseUrl.Path = settings.Path\n\t\t}\n\t\thttpReq, err := http.NewRequest(\"POST\", baseUrl.String(), bytes.NewReader(jsonReq))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\thttpReq = httpReq.WithContext(ctx)\n\t\thttpReq.Header = headers\n\n\t\thttpRsp, err := c.httpClient.Do(httpReq)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer httpRsp.Body.Close()\n\n\t\tif err = googleapi.CheckResponse(httpRsp); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tbuf, err := io.ReadAll(httpRsp.Body)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif err := unm.Unmarshal(buf, resp); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\treturn nil\n\t}, opts...)\n\tif e != nil {\n\t\treturn nil, e\n\t}\n\n\toverride := fmt.Sprintf(\"/v3/%s\", resp.GetName())\n\treturn &BatchRunTestCasesOperation{\n\t\tlro: longrunning.InternalNewOperation(*c.LROClient, resp),\n\t\tpollPath: override,\n\t}, nil\n}", "title": "" }, { "docid": "135dbbf71d0ed48e7c42afec99845701", "score": "0.51929104", "text": "func (c *testCasesRESTClient) RunTestCaseOperation(name string) *RunTestCaseOperation {\n\toverride := fmt.Sprintf(\"/v3/%s\", name)\n\treturn &RunTestCaseOperation{\n\t\tlro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),\n\t\tpollPath: override,\n\t}\n}", "title": "" }, { "docid": "12083d3c60563042d473acbd1d12d749", "score": "0.51791686", "text": "func (c *testCasesRESTClient) ExportTestCasesOperation(name string) *ExportTestCasesOperation {\n\toverride := fmt.Sprintf(\"/v3/%s\", name)\n\treturn &ExportTestCasesOperation{\n\t\tlro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),\n\t\tpollPath: override,\n\t}\n}", "title": "" }, { "docid": "db18a5c955e374a4932c88f101d484ef", "score": "0.5117138", "text": "func (c *testCasesGRPCClient) ImportTestCasesOperation(name string) *ImportTestCasesOperation {\n\treturn &ImportTestCasesOperation{\n\t\tlro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),\n\t}\n}", "title": "" }, { "docid": "a21746f1f002530b903471728d3796c1", "score": "0.50743556", "text": "func (op *RunTestCaseOperation) Name() string {\n\treturn op.lro.Name()\n}", "title": "" }, { "docid": "fbd430e83a8cc6c327d9dd8eefe57165", "score": "0.501911", "text": "func (c *TestCasesClient) RunTestCaseOperation(name string) *RunTestCaseOperation {\n\treturn c.internalClient.RunTestCaseOperation(name)\n}", "title": "" }, { "docid": "69476ba39505259b360f036e9070c21f", "score": "0.48509383", "text": "func (c *TestCasesClient) ExportTestCasesOperation(name string) *ExportTestCasesOperation {\n\treturn c.internalClient.ExportTestCasesOperation(name)\n}", "title": "" }, { "docid": "db037bc200d956349c4f7c5ed303c53f", "score": "0.48430592", "text": "func (c *testCasesRESTClient) ImportTestCasesOperation(name string) *ImportTestCasesOperation {\n\toverride := fmt.Sprintf(\"/v3/%s\", name)\n\treturn &ImportTestCasesOperation{\n\t\tlro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),\n\t\tpollPath: override,\n\t}\n}", "title": "" }, { "docid": "065f0569f8686903e4f3566422b11cb3", "score": "0.47587386", "text": "func (sc Subcmds) RunWithName(name string, args []string) error {\n\t// nested subcmds is not so deep. it would be enough for 8.\n\tnc := len(args) + 1\n\tif nc > 8 {\n\t\tnc = 8\n\t}\n\tcmds := make([]string, 0, len(args)+1)\n\tif name != \"\" {\n\t\tcmds = append(cmds, name)\n\t}\n\treturn sc.run(cmds, args)\n}", "title": "" }, { "docid": "ffd504b079576f11a92b9d14a970713b", "score": "0.46932626", "text": "func (op *ExportTestCasesOperation) Name() string {\n\treturn op.lro.Name()\n}", "title": "" }, { "docid": "900b2bfc5c6ea94d8e09017db7616572", "score": "0.46403664", "text": "func (c *TestCasesClient) ImportTestCasesOperation(name string) *ImportTestCasesOperation {\n\treturn c.internalClient.ImportTestCasesOperation(name)\n}", "title": "" }, { "docid": "c667482a3eff4f3402c2589db5f5b71f", "score": "0.46358082", "text": "func (op *ImportTestCasesOperation) Name() string {\n\treturn op.lro.Name()\n}", "title": "" }, { "docid": "f2f49c3bddccd935d6503a3de8069854", "score": "0.4557748", "text": "func (c *TestCasesClient) BatchRunTestCases(ctx context.Context, req *cxpb.BatchRunTestCasesRequest, opts ...gax.CallOption) (*BatchRunTestCasesOperation, error) {\n\treturn c.internalClient.BatchRunTestCases(ctx, req, opts...)\n}", "title": "" }, { "docid": "b9d059cddd29be3b63a26529bc74597d", "score": "0.45220044", "text": "func NewBatchRunner(t mockConstructorTestingTNewBatchRunner) *BatchRunner {\n\tmock := &BatchRunner{}\n\tmock.Mock.Test(t)\n\n\tt.Cleanup(func() { mock.AssertExpectations(t) })\n\n\treturn mock\n}", "title": "" }, { "docid": "b2803d0d81f762a1a67a8fa904739f6c", "score": "0.44746456", "text": "func newBatch(t *testing.T, ts []types.Type, proc *process.Process, rows int64) *batch.Batch {\n\treturn testutil.NewBatch(ts, false, int(rows), proc.Mp())\n}", "title": "" }, { "docid": "d87cc35da21c8775723f82a2280a7c14", "score": "0.44677764", "text": "func NewWriteBatch(cfName string, operation uint, key, value []byte, typ string) *WriteBatch {\n\treturn &WriteBatch{\n\t\tCfName: cfName,\n\t\tOperation: operation,\n\t\tKey: key,\n\t\tValue: value,\n\t\tTyp: typ,\n\t}\n}", "title": "" }, { "docid": "89f57e00cfdcbceab92f65d47dd2df2c", "score": "0.44251767", "text": "func (c *testCasesRESTClient) BatchDeleteTestCases(ctx context.Context, req *cxpb.BatchDeleteTestCasesRequest, opts ...gax.CallOption) error {\n\tm := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}\n\tjsonReq, err := m.Marshal(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tbaseUrl, err := url.Parse(c.endpoint)\n\tif err != nil {\n\t\treturn err\n\t}\n\tbaseUrl.Path += fmt.Sprintf(\"/v3/%v/testCases:batchDelete\", req.GetParent())\n\n\tparams := url.Values{}\n\tparams.Add(\"$alt\", \"json;enum-encoding=int\")\n\n\tbaseUrl.RawQuery = params.Encode()\n\n\t// Build HTTP headers from client and context metadata.\n\thds := []string{\"x-goog-request-params\", fmt.Sprintf(\"%s=%v\", \"parent\", url.QueryEscape(req.GetParent()))}\n\n\thds = append(c.xGoogHeaders, hds...)\n\thds = append(hds, \"Content-Type\", \"application/json\")\n\theaders := gax.BuildHeaders(ctx, hds...)\n\treturn gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {\n\t\tif settings.Path != \"\" {\n\t\t\tbaseUrl.Path = settings.Path\n\t\t}\n\t\thttpReq, err := http.NewRequest(\"POST\", baseUrl.String(), bytes.NewReader(jsonReq))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\thttpReq = httpReq.WithContext(ctx)\n\t\thttpReq.Header = headers\n\n\t\thttpRsp, err := c.httpClient.Do(httpReq)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer httpRsp.Body.Close()\n\n\t\t// Returns nil if there is no error, otherwise wraps\n\t\t// the response code and body into a non-nil error\n\t\treturn googleapi.CheckResponse(httpRsp)\n\t}, opts...)\n}", "title": "" }, { "docid": "c3c755c4d094d4260030d3b96204416d", "score": "0.43800855", "text": "func RunNamed(parentCtx context.Context, name string, routine func(context.Context), opts ...Option) (cancel context.CancelFunc) {\n\to := options{}\n\tfor _, opt := range opts {\n\t\topt(&o)\n\t}\n\n\tif o.keepRunningOneInstance {\n\t\troutine = (&routineThatKeepsRunningOneInstance{\n\t\t\tName: name,\n\t\t\tRoutine: routine,\n\t\t}).Run\n\t}\n\n\treturn Run(parentCtx, routine)\n}", "title": "" }, { "docid": "027bc8558c19e36488133524b406b427", "score": "0.4340871", "text": "func (sdr *Seedr) CreateCustomBatch(traitName string, n int, override Trait) *TraitInstances {\n\tt := sdr.getPublicTrait(traitName)\n\treturn t.create(override, n)\n}", "title": "" }, { "docid": "909c4a9e1f3b85562f3200e496f06199", "score": "0.4339445", "text": "func NewTrain(requestID RequestID, stepID int) WorkloadOperation {\n\treturn WorkloadOperation{\n\t\tRequestID: requestID,\n\t\tKind: RunStep,\n\t\tStepID: stepID,\n\t}\n}", "title": "" }, { "docid": "733a5a5b45fa071a4618cf1e629c794e", "score": "0.43305376", "text": "func RunBatch(\n\tctx context.Context,\n\tcfg *config.Config,\n\tbatch *batches.Batch,\n\toptions *RunBatchOptions,\n\tk8sClient *k8s.K8s,\n) error {\n\tdefer func() {\n\t\tif err := options.Reporter.Finalize(); err != nil {\n\t\t\tcfg.Logger().Error(logDomain, \"cannot finalize report: %v\", err)\n\t\t}\n\t}()\n\n\tcompleted := make(map[string]chan struct{})\n\tcompletionStatus := make(map[string]completionStatus)\n\tvar completionMut sync.RWMutex\n\tfor _, cmd := range batch.Commands {\n\t\tcompletionStatus[cmd.Name] = pending\n\t\tcompleted[cmd.Name] = make(chan struct{})\n\t}\n\n\tbatchID := petname.Generate(2, \"-\")\n\trunner := &runner{\n\t\tcfg: cfg,\n\t\tk8sClient: k8sClient,\n\t\toptions: options,\n\t\tpipelines: make(map[string]*pipeline),\n\t\ttrans: make(map[string]*env.Transformer),\n\t\tsharedEnv: []string{\n\t\t\t\"BATCH_ID=\" + batchID,\n\t\t},\n\t\tbatchID: batchID,\n\t}\n\tdefer runner.clean()\n\n\t{\n\t\tvar g errgroup.Group\n\t\tvar mut sync.Mutex\n\t\tfor _, batchPipeline := range batch.Pipelines {\n\t\t\tbatchPipeline := batchPipeline\n\t\t\tg.Go(func() error {\n\t\t\t\tp, err := pipelines.Read(cfg, batchPipeline.Path)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tmut.Lock()\n\t\t\t\tdefer mut.Unlock()\n\t\t\t\trunner.pipelines[batchPipeline.Name] = &pipeline{\n\t\t\t\t\tbatchPipeline: batchPipeline,\n\t\t\t\t\tpipeline: p,\n\t\t\t\t\tstackHolder: newStackHolder(),\n\t\t\t\t}\n\t\t\t\treturn nil\n\t\t\t})\n\t\t}\n\t\tif err := g.Wait(); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tcfg.Logger().Info(\n\t\tlogDomain,\n\t\t\"%d pipelines, %d commands -- parallelism: %d\",\n\t\tlen(runner.pipelines),\n\t\tlen(batch.Commands),\n\t\toptions.Parallelism)\n\n\tcmdSema := semaphore.NewWeighted(int64(options.Parallelism))\n\n\tg, gctx := errgroup.WithContext(ctx)\n\tfor _, cmd := range batch.Commands {\n\t\tcmd := cmd\n\t\tg.Go(func() error {\n\t\t\tfor _, dep := range cmd.DependsOn {\n\t\t\t\tcompletionMut.RLock()\n\t\t\t\tstatus, ok := completionStatus[dep]\n\t\t\t\tcompletionMut.RUnlock()\n\t\t\t\tif !ok || status == skipped {\n\t\t\t\t\tcompletionMut.Lock()\n\t\t\t\t\tcompletionStatus[cmd.Name] = skipped\n\t\t\t\t\tcompletionMut.Unlock()\n\t\t\t\t\tclose(completed[cmd.Name])\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t\tselect {\n\t\t\t\tcase <-gctx.Done():\n\t\t\t\t\treturn gctx.Err()\n\t\t\t\tcase <-completed[dep]:\n\t\t\t\t\tcompletionMut.RLock()\n\t\t\t\t\tstatus := completionStatus[dep]\n\t\t\t\t\tcompletionMut.RUnlock()\n\t\t\t\t\tif status == skipped {\n\t\t\t\t\t\tcompletionMut.Lock()\n\t\t\t\t\t\tcompletionStatus[cmd.Name] = skipped\n\t\t\t\t\t\tcompletionMut.Unlock()\n\t\t\t\t\t\tclose(completed[cmd.Name])\n\t\t\t\t\t\treturn nil\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif err := cmdSema.Acquire(gctx, 1); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tdefer cmdSema.Release(1)\n\n\t\t\trunner.cfg.Logger().Info(logDomain, \"command %s: start\", cmd.Name)\n\n\t\t\tif err := runner.execCommand(gctx, cfg, &cmd, k8sClient); err != nil {\n\t\t\t\treturn fmt.Errorf(\"command %s: %s\", cmd.Name, err)\n\t\t\t}\n\n\t\t\tcompletionMut.Lock()\n\t\t\tcompletionStatus[cmd.Name] = success\n\t\t\tcompletionMut.Unlock()\n\t\t\tclose(completed[cmd.Name])\n\n\t\t\trunner.cfg.Logger().Info(logDomain, \"command %s: success\", cmd.Name)\n\n\t\t\treturn nil\n\t\t})\n\t}\n\tif err := g.Wait(); err != nil {\n\t\treturn err\n\t}\n\tif len(runner.errored) > 0 {\n\t\tif runner.options.Advisory {\n\t\t\trunner.cfg.Logger().Warning(\n\t\t\t\tlogDomain,\n\t\t\t\t\"The following commands errored: %s\",\n\t\t\t\tstrings.Join(runner.errored, \" \"),\n\t\t\t)\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"The following commands errored: %s\", strings.Join(runner.errored, \" \"))\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5e3ce2d87c7d11410c2da885f26bd3cd", "score": "0.43289676", "text": "func Run(\n\tt *testing.T,\n\ttestname string,\n\ttimeout time.Duration,\n\tlocation string,\n\ttestfunc Test,\n) {\n\t//FIXME: We could remove testname on Go 1.8\n\tt.Run(testname, func(t *testing.T) {\n\t\tt.Parallel()\n\t\tctx, cancel := context.WithTimeout(context.Background(), timeout)\n\t\tdefer cancel()\n\n\t\tlogger, teardown := testlog.New(t, testname)\n\t\tdefer teardown()\n\n\t\tsession := NewSession(t)\n\t\tresgroup := NewUniqueName(testname)\n\t\tresources := NewResourceGroup(ctx, t, session, logger)\n\t\tdefer func() {\n\t\t\t// We cant use an expired context when cleaning up state from Azure.\n\t\t\tconst resourceCleanupTimeout = 30 * time.Second\n\t\t\tctx, cancel := context.WithTimeout(context.Background(), resourceCleanupTimeout)\n\t\t\tdefer cancel()\n\t\t\tresources := NewResourceGroup(ctx, t, session, logger)\n\t\t\tresources.Delete(t, resgroup)\n\t\t}()\n\n\t\tlogger.Printf(\"fixture: setting up resgroup %q at %q\", resgroup, location)\n\t\tresources.Create(t, resgroup, location)\n\t\tresources.AssertExists(t, resgroup)\n\t\tlogger.Printf(\"fixture: created resgroup %q with success\", resgroup)\n\n\t\tlogger.Println(\"fixture: calling test function\")\n\t\ttestfunc(t, F{\n\t\t\tCtx: ctx,\n\t\t\tName: testname,\n\t\t\tResGroupName: resgroup,\n\t\t\tSession: session,\n\t\t\tLocation: location,\n\t\t\tLogger: logger,\n\t\t\tShell: nash.New(ctx, t, logger, session.Env()),\n\t\t\tRetrier: retrier.New(ctx, t, logger),\n\t\t})\n\t\tlogger.Printf(\"fixture: finished, failed=%t\", t.Failed())\n\t})\n}", "title": "" }, { "docid": "dd1e67ceb0cb27b8725e5706a08be92b", "score": "0.4304184", "text": "func (c *testCasesRESTClient) RunTestCase(ctx context.Context, req *cxpb.RunTestCaseRequest, opts ...gax.CallOption) (*RunTestCaseOperation, error) {\n\tm := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}\n\tjsonReq, err := m.Marshal(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tbaseUrl, err := url.Parse(c.endpoint)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbaseUrl.Path += fmt.Sprintf(\"/v3/%v:run\", req.GetName())\n\n\tparams := url.Values{}\n\tparams.Add(\"$alt\", \"json;enum-encoding=int\")\n\n\tbaseUrl.RawQuery = params.Encode()\n\n\t// Build HTTP headers from client and context metadata.\n\thds := []string{\"x-goog-request-params\", fmt.Sprintf(\"%s=%v\", \"name\", url.QueryEscape(req.GetName()))}\n\n\thds = append(c.xGoogHeaders, hds...)\n\thds = append(hds, \"Content-Type\", \"application/json\")\n\theaders := gax.BuildHeaders(ctx, hds...)\n\tunm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}\n\tresp := &longrunningpb.Operation{}\n\te := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {\n\t\tif settings.Path != \"\" {\n\t\t\tbaseUrl.Path = settings.Path\n\t\t}\n\t\thttpReq, err := http.NewRequest(\"POST\", baseUrl.String(), bytes.NewReader(jsonReq))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\thttpReq = httpReq.WithContext(ctx)\n\t\thttpReq.Header = headers\n\n\t\thttpRsp, err := c.httpClient.Do(httpReq)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer httpRsp.Body.Close()\n\n\t\tif err = googleapi.CheckResponse(httpRsp); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tbuf, err := io.ReadAll(httpRsp.Body)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif err := unm.Unmarshal(buf, resp); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\treturn nil\n\t}, opts...)\n\tif e != nil {\n\t\treturn nil, e\n\t}\n\n\toverride := fmt.Sprintf(\"/v3/%s\", resp.GetName())\n\treturn &RunTestCaseOperation{\n\t\tlro: longrunning.InternalNewOperation(*c.LROClient, resp),\n\t\tpollPath: override,\n\t}, nil\n}", "title": "" }, { "docid": "c55b31c2f3056e80dcb069b5254160c1", "score": "0.4290311", "text": "func NewBatcher() *BatchRunner {\n\tb := &BatchRunner{\n\t\trequests: make(chan *batchedOp, 100),\n\t\tclosed: make(chan struct{}),\n\n\t\tdoneChannelSize: 1,\n\n\t\ttBatchStart: make(chan struct{}),\n\t\ttBatchWait: make(chan struct{}),\n\t}\n\tb.closeFixtureChannels()\n\treturn b\n}", "title": "" }, { "docid": "b6bfe3ed619625a26ad64b9fc60c02ef", "score": "0.4256788", "text": "func (c *translationRESTClient) BatchTranslateTextOperation(name string) *BatchTranslateTextOperation {\n\toverride := fmt.Sprintf(\"/v3/%s\", name)\n\treturn &BatchTranslateTextOperation{\n\t\tlro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),\n\t\tpollPath: override,\n\t}\n}", "title": "" }, { "docid": "9a62449f9ba7b24e4f3a47eb9b46421c", "score": "0.42362654", "text": "func (sdr *Seedr) CreateBatch(traitName string, n int) *TraitInstances {\n\tt := sdr.getPublicTrait(traitName)\n\treturn t.create(nil, n)\n}", "title": "" }, { "docid": "65b9db39d597ab21337509407a3dd2d6", "score": "0.42340228", "text": "func NewBatchRequest() BatchRequest {\n\treturn &batchRequest{}\n}", "title": "" }, { "docid": "b05ba1f8f0564f390d1c049d86309e7e", "score": "0.42257506", "text": "func NewWorkload(namespace, name string) *workloadv1alpha1.Workload {\n\tpodLabels := map[string]string{\"app\": \"nginx\"}\n\n\treturn &workloadv1alpha1.Workload{\n\t\tTypeMeta: metav1.TypeMeta{\n\t\t\tAPIVersion: \"workload.example.io/v1alpha1\",\n\t\t\tKind: \"Workload\",\n\t\t},\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tNamespace: namespace,\n\t\t\tName: name,\n\t\t},\n\t\tSpec: workloadv1alpha1.WorkloadSpec{\n\t\t\tReplicas: pointer.Int32(3),\n\t\t\tTemplate: corev1.PodTemplateSpec{\n\t\t\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\t\t\tLabels: podLabels,\n\t\t\t\t},\n\t\t\t\tSpec: corev1.PodSpec{\n\t\t\t\t\tContainers: []corev1.Container{{\n\t\t\t\t\t\tName: \"nginx\",\n\t\t\t\t\t\tImage: \"nginx:1.19.0\",\n\t\t\t\t\t}},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "6ad4b7e8b36119e59ccb0e28ba31bf95", "score": "0.42112222", "text": "func (s *scenario) Run(w io.Writer) []restify.TestResult {\n\tio.WriteString(w, fmt.Sprintf(\n\t\t\"Start running test scenario: name=%s, env=%s, desc=%s, cases=%d\\r\\n\",\n\t\ts.name, s.environment, s.description, len(s.cases)))\n\n\ttestResults := []restify.TestResult{}\n\thttpClient := http.Client{}\n\tfor i, tc := range s.cases {\n\t\tio.WriteString(w, fmt.Sprintf(\n\t\t\t\"%d. Test case: name=%s desc=%s onfail=%s\\r\\n\",\n\t\t\t(i+1), tc.Name, tc.Description, tc.Pipeline.OnFailure))\n\n\t\ttr := restify.NewTestResult(s, i)\n\n\t\t//Parse any cache needed\n\t\ttc.Request.Parse(s.cache)\n\t\ttc.Expect.Parse(s.cache)\n\t\tpayload, _ := json.Marshal(tc.Request.Payload)\n\n\t\t//Setup HTTP request\n\t\treq, err := http.NewRequest(tc.Request.Method, tc.Request.URL, bytes.NewBuffer(payload))\n\t\tif err != nil && tc.Pipeline.OnFailure == onfailure.Exit {\n\t\t\tmsg := fmt.Sprintf(\"%d. Failed to create request: %s\\r\\n\", (i + 1), err.Error())\n\t\t\tio.WriteString(w, msg)\n\n\t\t\ttr.Message = msg\n\t\t\ttestResults = append(testResults, tr)\n\n\t\t\treturn testResults\n\t\t} else if err != nil {\n\t\t\tmsg := fmt.Sprintf(\"%d. Failed to create request: %s\\r\\n\", (i + 1), err.Error())\n\t\t\tio.WriteString(w, msg)\n\n\t\t\ttr.Message = msg\n\t\t\ttestResults = append(testResults, tr)\n\n\t\t\tcontinue\n\t\t}\n\n\t\t//Add headers to request\n\t\tfor key, head := range tc.Request.Headers {\n\t\t\treq.Header.Add(key, head)\n\t\t}\n\n\t\t//trace HTTP\n\t\tvar start, connect, dns, tlsHandshake time.Time\n\t\ttrace := &httptrace.ClientTrace{\n\t\t\tDNSStart: func(dsi httptrace.DNSStartInfo) { dns = time.Now() },\n\t\t\tDNSDone: func(ddi httptrace.DNSDoneInfo) {\n\t\t\t\ttr.TimingDNS = time.Since(dns)\n\t\t\t},\n\n\t\t\tTLSHandshakeStart: func() { tlsHandshake = time.Now() },\n\t\t\tTLSHandshakeDone: func(cs tls.ConnectionState, err error) {\n\t\t\t\ttr.TimingHandshake = time.Since(tlsHandshake)\n\t\t\t},\n\n\t\t\tConnectStart: func(network, addr string) { connect = time.Now() },\n\t\t\tConnectDone: func(network, addr string, err error) {\n\t\t\t\ttr.TimingConnected = time.Since(connect)\n\t\t\t},\n\n\t\t\tGotFirstResponseByte: func() {\n\t\t\t\ttr.TimingFirstByte = time.Since(start)\n\t\t\t},\n\t\t}\n\t\treq = req.WithContext(httptrace.WithClientTrace(req.Context(), trace))\n\n\t\t//Initiate HTTP request\n\t\tstart = time.Now()\n\t\tres, err := httpClient.Do(req)\n\t\ttr.TimingTotal = time.Since(start)\n\t\tif err != nil && tc.Pipeline.OnFailure == onfailure.Exit {\n\t\t\tmsg := fmt.Sprintf(\"%d. Failed to execute request: %s\\r\\n\", (i + 1), err.Error())\n\t\t\tio.WriteString(w, msg)\n\n\t\t\ttr.Message = msg\n\t\t\ttestResults = append(testResults, tr)\n\n\t\t\treturn testResults\n\t\t} else if err != nil {\n\t\t\tmsg := fmt.Sprintf(\"%d. Failed to execute request: %s\\r\\n\", (i + 1), err.Error())\n\t\t\tio.WriteString(w, msg)\n\n\t\t\ttr.Message = msg\n\t\t\ttestResults = append(testResults, tr)\n\t\t\tcontinue\n\t\t}\n\n\t\ttr.ResponseCode = res.StatusCode\n\t\ttr.ResponseSize = res.ContentLength\n\n\t\t//Assert response body first so we print the response JSON before anything else\n\t\tbody, err := ioutil.ReadAll(res.Body)\n\t\tres.Body.Close()\n\t\tif err != nil && tc.Pipeline.OnFailure == onfailure.Exit {\n\t\t\tmsg := fmt.Sprintf(\"%d. Failed to get response body: %s\\r\\n\", (i + 1), err.Error())\n\t\t\tio.WriteString(w, msg)\n\n\t\t\ttr.Message = msg\n\t\t\ttestResults = append(testResults, tr)\n\n\t\t\treturn testResults\n\t\t} else if err != nil {\n\t\t\tmsg := fmt.Sprintf(\"%d. Failed to get response body: %s\\r\\n\", (i + 1), err.Error())\n\t\t\tio.WriteString(w, msg)\n\n\t\t\ttr.Message = msg\n\t\t\ttestResults = append(testResults, tr)\n\n\t\t\tcontinue\n\t\t} else {\n\t\t\tio.WriteString(w, fmt.Sprintf(\"%d. Got response body: %s\\r\\n\", (i+1), string(body)))\n\t\t}\n\n\t\t//Assert status code\n\t\tif res.StatusCode != tc.Expect.StatusCode && tc.Pipeline.OnFailure == onfailure.Exit {\n\t\t\tmsg := fmt.Sprintf(\n\t\t\t\t\"%d. Expectation failed. Expect status: %d, got: %d\\r\\n\",\n\t\t\t\t(i + 1), tc.Expect.StatusCode, res.StatusCode)\n\t\t\tio.WriteString(w, msg)\n\n\t\t\ttr.Message = msg\n\t\t\ttestResults = append(testResults, tr)\n\n\t\t\treturn testResults\n\t\t} else if res.StatusCode != tc.Expect.StatusCode {\n\t\t\tmsg := fmt.Sprintf(\n\t\t\t\t\"%d. Expectation failed. Expect status: %d, got: %d\\r\\n\",\n\t\t\t\t(i + 1), tc.Expect.StatusCode, res.StatusCode)\n\t\t\tio.WriteString(w, msg)\n\n\t\t\ttr.Message = msg\n\t\t\ttestResults = append(testResults, tr)\n\n\t\t\tcontinue\n\t\t}\n\n\t\t//evaluate every rule\n\t\tvalid := true\n\t\tinvalidMsg := \"\"\n\t\tfor ri, rule := range tc.Expect.Evaluate {\n\t\t\teval, err := valuator.NewValuator(rule.Prop, rule.Operator, rule.Value, rule.Description)\n\t\t\tif err != nil && tc.Pipeline.OnFailure == onfailure.Exit {\n\t\t\t\tmsg := fmt.Sprintf(\"%d.%d. Failed to get evaluator: %s\\r\\n\", (i + 1), (ri + 1), err.Error())\n\t\t\t\tio.WriteString(w, msg)\n\n\t\t\t\ttr.Message = msg\n\t\t\t\ttestResults = append(testResults, tr)\n\t\t\t\treturn testResults\n\t\t\t} else if err != nil {\n\t\t\t\tmsg := fmt.Sprintf(\"%d.%d. Failed to get evaluator: %s\\r\\n\", (i + 1), (ri + 1), err.Error())\n\t\t\t\tio.WriteString(w, msg)\n\n\t\t\t\ttr.Message = msg\n\t\t\t\ttestResults = append(testResults, tr)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tobj := make(map[string]interface{})\n\t\t\t{ //parse response body into map and take the evaluation object\n\t\t\t\tif rule.Object == \"\" {\n\t\t\t\t\terr = json.Unmarshal(body, &obj)\n\t\t\t\t} else {\n\t\t\t\t\tpaths := strings.Split(rule.Object, \".\")\n\t\t\t\t\tval, _, _, _ := jsonparser.Get(body, paths...)\n\t\t\t\t\terr = json.Unmarshal(val, &obj)\n\t\t\t\t}\n\n\t\t\t\tif err != nil && tc.Pipeline.OnFailure == onfailure.Exit {\n\t\t\t\t\tmsg := fmt.Sprintf(\"%d. Failed to parse response body into map: %s\\r\\n\", (i + 1), err.Error())\n\t\t\t\t\tio.WriteString(w, msg)\n\n\t\t\t\t\ttr.Message = msg\n\t\t\t\t\ttestResults = append(testResults, tr)\n\t\t\t\t\treturn testResults\n\t\t\t\t} else if err != nil {\n\t\t\t\t\tmsg := fmt.Sprintf(\"%d. Failed to parse response body into map: %s\\r\\n\", (i + 1), err.Error())\n\t\t\t\t\tio.WriteString(w, msg)\n\n\t\t\t\t\ttr.Message = msg\n\t\t\t\t\ttestResults = append(testResults, tr)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvalid = eval.Evaluate(obj)\n\t\t\tif !valid {\n\t\t\t\tinvalidMsg = fmt.Sprintf(\"%d.%d. Expectation failed against rule=%+v\\r\\n\", (i + 1), (ri + 1), rule)\n\t\t\t\tio.WriteString(w, invalidMsg)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif !valid && tc.Pipeline.OnFailure == onfailure.Exit {\n\t\t\ttr.Message = invalidMsg\n\t\t\ttestResults = append(testResults, tr)\n\t\t\treturn testResults\n\t\t}\n\n\t\t//cache if needed\n\t\tif tc.Pipeline.Cache {\n\t\t\ts.cache[tc.Pipeline.CacheAs] = body\n\t\t}\n\n\t\tmsg := fmt.Sprintf(\"%d. Success\\r\\n\", (i + 1))\n\t\tio.WriteString(w, msg)\n\n\t\ttr.Message = msg\n\t\ttestResults = append(testResults, tr)\n\t}\n\n\treturn testResults\n}", "title": "" }, { "docid": "e26d26df2a47df25e4eeb50398e47108", "score": "0.4183564", "text": "func (s *Span) SetOperationName(operationName string) opentracing.Span {\n\tfmt.Fprintln(os.Stderr, \"stackdriver does not support SetOperationName\")\n\treturn s\n}", "title": "" }, { "docid": "0fd36edeec9b274066d2506cada69048", "score": "0.4183214", "text": "func (m *Chaos) Run(operation string, args []string) error {\n\tfor _, test := range m.testCases {\n\t\tname := test.GetName()\n\t\tif name == operation {\n\t\t\treturn test.Run(args)\n\t\t}\n\t}\n\treturn errors.New(\"invalid operation\")\n}", "title": "" }, { "docid": "9683a2c7913675850fd40833f3fb4def", "score": "0.4176329", "text": "func (c *translationGRPCClient) BatchTranslateTextOperation(name string) *BatchTranslateTextOperation {\n\treturn &BatchTranslateTextOperation{\n\t\tlro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),\n\t}\n}", "title": "" }, { "docid": "4f0be8840a03870699f50e470fd63982", "score": "0.41693756", "text": "func NewBatch(typ BatchType) *Batch {\n\treturn &Batch{\n\t\tType: typ,\n\t\tmetrics: &queryMetrics{m: make(map[string]*hostMetrics)},\n\t\tspec: &NonSpeculativeExecution{},\n\t}\n}", "title": "" }, { "docid": "423de64bdf7714601e574f850992f019", "score": "0.4157442", "text": "func (s *mockStore) Batch(operations []storage.Operation) error {\n\tpanic(\"implement me\")\n}", "title": "" }, { "docid": "74c85c0304f424ce1bbb8d7fdad790cc", "score": "0.41373143", "text": "func (c *Client) ServiceBatchOperate(args *api.ServiceBatchOperateArgs) (*api.ServiceBatchOperateResult, error) {\n\tif args == nil {\n\t\treturn nil, fmt.Errorf(\"please set argments\")\n\t}\n\n\tif args.Action != \"start\" && args.Action != \"stop\" {\n\t\treturn nil, fmt.Errorf(\"action is start|stop, please check\")\n\t}\n\n\tresult := &api.ServiceBatchOperateResult{}\n\treq := &api.PostHttpReq{Url: api.GetBachServiceOperateURI(), Result: result, Body: args}\n\terr := api.Put(c, req)\n\n\treturn result, err\n}", "title": "" }, { "docid": "4f270ff66cd0f703bd1091eaa623471d", "score": "0.41266555", "text": "func (sdr *Seedr) BuildCustomBatch(traitName string, n int, override Trait) *TraitInstances {\n\tt := sdr.getPublicTrait(traitName)\n\treturn t.build(override, n)\n}", "title": "" }, { "docid": "118ee2897f91c3db89a024ae681d223e", "score": "0.41253364", "text": "func GetRunByName(dbConn *sql.DB, modelId int, name string) (*RunRow, error) {\r\n\treturn getRunRow(dbConn,\r\n\t\t\"SELECT\"+\r\n\t\t\t\" H.run_id, H.model_id, H.run_name, H.sub_count,\"+\r\n\t\t\t\" H.sub_started, H.sub_completed, H.create_dt, H.status,\"+\r\n\t\t\t\" H.update_dt, H.run_digest, H.value_digest, H.run_stamp\"+\r\n\t\t\t\" FROM run_lst H\"+\r\n\t\t\t\" WHERE H.run_id = \"+\r\n\t\t\t\" (\"+\r\n\t\t\t\" SELECT MIN(M.run_id) FROM run_lst M\"+\r\n\t\t\t\" WHERE M.model_id = \"+strconv.Itoa(modelId)+\r\n\t\t\t\" AND M.run_name = \"+ToQuoted(name)+\r\n\t\t\t\")\")\r\n}", "title": "" }, { "docid": "a230d99914b2cc7300a1ab2e510b78d8", "score": "0.41221273", "text": "func (s *scenario) Run(w io.Writer) restify.ScenarioResult {\n\tio.WriteString(w, fmt.Sprintf(\n\t\t\"Start running test scenario: name=%s, env=%s, desc=%s, cases=%d\\r\\n\",\n\t\ts.name, s.environment, s.description, len(s.cases)))\n\n\ttestResults := []restify.TestResult{}\n\thttpClient := http.Client{}\n\nloop:\n\tfor i, tc := range s.cases {\n\t\tio.WriteString(w, fmt.Sprintf(\n\t\t\t\"%d. Test case: name=%s desc=%s onfail=%s delay=%s\\r\\n\",\n\t\t\t(i+1), tc.Name, tc.Description, tc.Pipeline.OnFailure, tc.Pipeline.Delay))\n\n\t\ttr := restify.NewTestResult(s, i)\n\n\t\t//Parse any cache needed\n\t\ttc.Request.Parse(s.cache)\n\t\t// tc.Expect.Parse(s.cache)\n\t\tpayload, _ := json.Marshal(tc.Request.Payload)\n\n\t\t//Setup HTTP request\n\t\treq, err := http.NewRequest(tc.Request.Method, tc.Request.URL, bytes.NewBuffer(payload))\n\t\tif err != nil && tc.Pipeline.OnFailure == onfailure.Exit {\n\t\t\tmsg := fmt.Sprintf(\"%d. Failed to create request: %s\\r\\n\", (i + 1), err.Error())\n\t\t\tio.WriteString(w, msg)\n\n\t\t\ttr.Message = msg\n\t\t\ttestResults = append(testResults, tr)\n\n\t\t\treturn testResults\n\t\t} else if err != nil {\n\t\t\tmsg := fmt.Sprintf(\"%d. Failed to create request: %s\\r\\n\", (i + 1), err.Error())\n\t\t\tio.WriteString(w, msg)\n\n\t\t\ttr.Success = true\n\t\t\ttr.Message = msg\n\t\t\ttestResults = append(testResults, tr)\n\n\t\t\tcontinue loop\n\t\t}\n\n\t\t//Add headers to request\n\t\tfor key, head := range tc.Request.Headers {\n\t\t\treq.Header.Add(key, head)\n\t\t}\n\n\t\t//trace HTTP\n\t\tvar start, connect, dns, tlsHandshake time.Time\n\t\ttrace := &httptrace.ClientTrace{\n\t\t\tDNSStart: func(dsi httptrace.DNSStartInfo) { dns = time.Now() },\n\t\t\tDNSDone: func(ddi httptrace.DNSDoneInfo) {\n\t\t\t\ttr.TimingDNS = time.Since(dns)\n\t\t\t},\n\n\t\t\tTLSHandshakeStart: func() { tlsHandshake = time.Now() },\n\t\t\tTLSHandshakeDone: func(cs tls.ConnectionState, err error) {\n\t\t\t\ttr.TimingHandshake = time.Since(tlsHandshake)\n\t\t\t},\n\n\t\t\tConnectStart: func(network, addr string) { connect = time.Now() },\n\t\t\tConnectDone: func(network, addr string, err error) {\n\t\t\t\ttr.TimingConnected = time.Since(connect)\n\t\t\t},\n\n\t\t\tGotFirstResponseByte: func() {\n\t\t\t\ttr.TimingFirstByte = time.Since(start)\n\t\t\t},\n\t\t}\n\t\treq = req.WithContext(httptrace.WithClientTrace(req.Context(), trace))\n\n\t\t//Initiate HTTP request\n\t\tstart = time.Now()\n\t\tres, err := httpClient.Do(req)\n\t\ttr.TimingTotal = time.Since(start)\n\t\tif err != nil && tc.Pipeline.OnFailure == onfailure.Exit {\n\t\t\tmsg := fmt.Sprintf(\"%d. Failed to execute request: %s\\r\\n\", (i + 1), err.Error())\n\t\t\tio.WriteString(w, msg)\n\n\t\t\ttr.Message = msg\n\t\t\ttestResults = append(testResults, tr)\n\n\t\t\treturn testResults\n\t\t} else if err != nil {\n\t\t\tmsg := fmt.Sprintf(\"%d. Failed to execute request: %s\\r\\n\", (i + 1), err.Error())\n\t\t\tio.WriteString(w, msg)\n\n\t\t\ttr.Success = true\n\t\t\ttr.Message = msg\n\t\t\ttestResults = append(testResults, tr)\n\t\t\tcontinue loop\n\t\t}\n\n\t\ttr.ResponseCode = res.StatusCode\n\t\ttr.ResponseSize = res.ContentLength\n\n\t\t//Assert response body first so we print the response JSON before anything else\n\t\tbody, err := ioutil.ReadAll(res.Body)\n\t\tres.Body.Close()\n\t\tif err != nil && tc.Pipeline.OnFailure == onfailure.Exit {\n\t\t\tmsg := fmt.Sprintf(\"%d. Failed to get response body: %s\\r\\n\", (i + 1), err.Error())\n\t\t\tio.WriteString(w, msg)\n\n\t\t\ttr.Message = msg\n\t\t\ttestResults = append(testResults, tr)\n\n\t\t\treturn testResults\n\t\t} else if err != nil {\n\t\t\tmsg := fmt.Sprintf(\"%d. Failed to get response body: %s\\r\\n\", (i + 1), err.Error())\n\t\t\tio.WriteString(w, msg)\n\n\t\t\ttr.Success = true\n\t\t\ttr.Message = msg\n\t\t\ttestResults = append(testResults, tr)\n\n\t\t\tcontinue loop\n\t\t} else {\n\t\t\tio.WriteString(w, fmt.Sprintf(\"%d. Got response body: %s\\r\\n\", (i+1), string(body)))\n\t\t}\n\n\t\t//Assert status code\n\t\tif res.StatusCode != tc.Expect.StatusCode && tc.Pipeline.OnFailure == onfailure.Exit {\n\t\t\tmsg := fmt.Sprintf(\n\t\t\t\t\"%d. Expectation failed. Expect status: %d, got: %d\\r\\n\",\n\t\t\t\t(i + 1), tc.Expect.StatusCode, res.StatusCode)\n\t\t\tio.WriteString(w, msg)\n\n\t\t\ttr.Message = msg\n\t\t\ttestResults = append(testResults, tr)\n\n\t\t\treturn testResults\n\t\t} else if res.StatusCode != tc.Expect.StatusCode {\n\t\t\tmsg := fmt.Sprintf(\n\t\t\t\t\"%d. Expectation failed. Expect status: %d, got: %d\\r\\n\",\n\t\t\t\t(i + 1), tc.Expect.StatusCode, res.StatusCode)\n\t\t\tio.WriteString(w, msg)\n\n\t\t\ttr.Success = true\n\t\t\ttr.Message = msg\n\t\t\ttestResults = append(testResults, tr)\n\n\t\t\tcontinue loop\n\t\t}\n\n\t\t// Evaluate every rule\n\t\tpair := make(map[string]interface{})\n\t\tjson.Unmarshal(body, &pair) //\tconvert []byte to map[string]interface{}\n\n\t\tfor k, v := range s.cache { //\tadd all cache to pair\n\t\t\tvar cache map[string]interface{}\n\t\t\tjson.Unmarshal(v, &cache)\n\t\t\tpair[k] = cache\n\t\t}\n\n\t\tfor _, expr := range tc.Expect.Evaluate { //\tforeach rule in evaluate\n\t\t\tisValid := expr.IsTrue(pair)\n\t\t\tif !isValid && tc.Pipeline.OnFailure == onfailure.Exit {\n\t\t\t\tmsg := fmt.Sprintf(\"%d. Expression Failed : Status %t\\r\\n\", (i + 1), isValid)\n\t\t\t\tio.WriteString(w, msg)\n\n\t\t\t\ttr.Message = msg\n\t\t\t\ttestResults = append(testResults, tr)\n\n\t\t\t\treturn testResults\n\t\t\t} else if !isValid {\n\t\t\t\tmsg := fmt.Sprintf(\"%d. Expression Failed : Status %t\\r\\n\", (i + 1), isValid)\n\t\t\t\tio.WriteString(w, msg)\n\n\t\t\t\ttr.Success = true\n\t\t\t\ttr.Message = msg\n\t\t\t\ttestResults = append(testResults, tr)\n\n\t\t\t\tcontinue loop\n\t\t\t} else {\n\t\t\t\tmsg := fmt.Sprintf(\"%d. Expression Success: Status %t\\r\\n\", (i + 1), isValid)\n\t\t\t\tio.WriteString(w, msg)\n\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\t//cache if needed\n\t\tif tc.Pipeline.Cache {\n\t\t\ts.cache[tc.Pipeline.CacheAs] = body\n\t\t}\n\n\t\tmsg := fmt.Sprintf(\"%d. Success\\r\\n\", (i + 1))\n\t\tio.WriteString(w, msg)\n\n\t\ttr.Success = true\n\t\ttr.Message = msg\n\t\ttestResults = append(testResults, tr)\n\n\t\ttc.Pipeline.Delay = restify.Delay(strings.TrimSpace(string(tc.Pipeline.Delay)))\n\t\tif !tc.Pipeline.Delay.IsZero() {\n\t\t\tdelay, _ := time.ParseDuration(string(tc.Pipeline.Delay))\n\t\t\ttime.Sleep(delay)\n\t\t}\n\t}\n\n\treturn restify.ScenarioResult(testResults)\n}", "title": "" }, { "docid": "e478a57e374f043968db1b144a32cb3f", "score": "0.4100873", "text": "func NewWorkload(name, iconName string) *Workload {\n\tw := &Workload{\n\t\tIconName: iconName,\n\t\tName: name,\n\t\tSegmentCounter: make(map[component.NodeStatus][]PodWithMetric),\n\t\tmu: &sync.Mutex{},\n\t}\n\n\treturn w\n}", "title": "" }, { "docid": "e950b00e719e6a661fbc281cab06a752", "score": "0.4099774", "text": "func (sdr *Seedr) BuildBatch(traitName string, n int) *TraitInstances {\n\tt := sdr.getPublicTrait(traitName)\n\treturn t.build(nil, n)\n}", "title": "" }, { "docid": "4d9eb52415aea1d09480318a89053c58", "score": "0.4094943", "text": "func (c *TestCasesClient) BatchDeleteTestCases(ctx context.Context, req *cxpb.BatchDeleteTestCasesRequest, opts ...gax.CallOption) error {\n\treturn c.internalClient.BatchDeleteTestCases(ctx, req, opts...)\n}", "title": "" }, { "docid": "f55d53ee30afee15e666a1dfc15f2ec3", "score": "0.407589", "text": "func NewValidate(requestID RequestID, stepID int) WorkloadOperation {\n\treturn WorkloadOperation{\n\t\tRequestID: requestID,\n\t\tKind: ComputeValidationMetrics,\n\t\tStepID: stepID,\n\t}\n}", "title": "" }, { "docid": "370b26f4346f1ae7bfbe2f5a718c7199", "score": "0.40675205", "text": "func DefineBatch(d *datadriven.TestData, b *pebble.Batch) error {\n\tfor _, line := range strings.Split(d.Input, \"\\n\") {\n\t\tparts := strings.Fields(line)\n\t\tif len(parts) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif parts[1] == `<nil>` {\n\t\t\tparts[1] = \"\"\n\t\t}\n\t\tvar err error\n\t\tswitch parts[0] {\n\t\tcase \"set\":\n\t\t\tif len(parts) != 3 {\n\t\t\t\treturn errors.Errorf(\"%s expects 2 arguments\", parts[0])\n\t\t\t}\n\t\t\terr = b.Set([]byte(parts[1]), []byte(parts[2]), nil)\n\t\tcase \"del\":\n\t\t\tif len(parts) != 2 {\n\t\t\t\treturn errors.Errorf(\"%s expects 1 argument\", parts[0])\n\t\t\t}\n\t\t\terr = b.Delete([]byte(parts[1]), nil)\n\t\tcase \"singledel\":\n\t\t\tif len(parts) != 2 {\n\t\t\t\treturn errors.Errorf(\"%s expects 1 argument\", parts[0])\n\t\t\t}\n\t\t\terr = b.SingleDelete([]byte(parts[1]), nil)\n\t\tcase \"del-range\":\n\t\t\tif len(parts) != 3 {\n\t\t\t\treturn errors.Errorf(\"%s expects 2 arguments\", parts[0])\n\t\t\t}\n\t\t\terr = b.DeleteRange([]byte(parts[1]), []byte(parts[2]), nil)\n\t\tcase \"merge\":\n\t\t\tif len(parts) != 3 {\n\t\t\t\treturn errors.Errorf(\"%s expects 2 arguments\", parts[0])\n\t\t\t}\n\t\t\terr = b.Merge([]byte(parts[1]), []byte(parts[2]), nil)\n\t\tcase \"range-key-set\":\n\t\t\tif len(parts) != 5 {\n\t\t\t\treturn errors.Errorf(\"%s expects 4 arguments\", parts[0])\n\t\t\t}\n\t\t\terr = b.RangeKeySet(\n\t\t\t\t[]byte(parts[1]),\n\t\t\t\t[]byte(parts[2]),\n\t\t\t\t[]byte(parts[3]),\n\t\t\t\t[]byte(parts[4]),\n\t\t\t\tnil)\n\t\tcase \"range-key-unset\":\n\t\t\tif len(parts) != 4 {\n\t\t\t\treturn errors.Errorf(\"%s expects 3 arguments\", parts[0])\n\t\t\t}\n\t\t\terr = b.RangeKeyUnset(\n\t\t\t\t[]byte(parts[1]),\n\t\t\t\t[]byte(parts[2]),\n\t\t\t\t[]byte(parts[3]),\n\t\t\t\tnil)\n\t\tcase \"range-key-del\":\n\t\t\tif len(parts) != 3 {\n\t\t\t\treturn errors.Errorf(\"%s expects 2 arguments\", parts[0])\n\t\t\t}\n\t\t\terr = b.RangeKeyDelete(\n\t\t\t\t[]byte(parts[1]),\n\t\t\t\t[]byte(parts[2]),\n\t\t\t\tnil)\n\t\tdefault:\n\t\t\treturn errors.Errorf(\"unknown op: %s\", parts[0])\n\t\t}\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9a2683695709529805eab99bafdb5f1e", "score": "0.40599766", "text": "func NewBatch(idLabelName model.LabelName, id uint64) *Batch {\n\tb := &Batch{\n\t\tstreams: make(map[string]*Stream),\n\t\tcreatedAt: time.Now(),\n\t\tid: id,\n\t\tidLabelName: idLabelName,\n\t}\n\n\treturn b\n}", "title": "" }, { "docid": "9d96c094567ad905b3462583a21c0e10", "score": "0.40592343", "text": "func (m *collection) NewBatch(totalOps, totalKeyValBytes int) (\n\tBatch, error) {\n\tif m.isClosed() {\n\t\treturn nil, ErrClosed\n\t}\n\n\tatomic.AddUint64(&m.stats.TotNewBatch, 1)\n\tatomic.AddUint64(&m.stats.TotNewBatchTotalOps, uint64(totalOps))\n\tatomic.AddUint64(&m.stats.TotNewBatchTotalKeyValBytes, uint64(totalKeyValBytes))\n\n\treturn newSegment(totalOps, totalKeyValBytes)\n}", "title": "" }, { "docid": "c61ab094fe94ca1a656224fd0cd1518a", "score": "0.40418044", "text": "func WriteBatchFrom(data []byte) *WriteBatch {\n\treturn &WriteBatch{}\n}", "title": "" }, { "docid": "2ff4a19a8ddb1b7e2ef4528cf678fdc0", "score": "0.40296915", "text": "func (c *Client) PostBatch(batchRequest *PostBatchRequest) (*Batch, error) {\n\treq, err := c.NewRequest(\"POST\", \"/batches\", batchRequest)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"creating request\")\n\t}\n\n\tvar batch Batch\n\tif err := c.Do(req, &batch); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &batch, nil\n}", "title": "" }, { "docid": "ecb7340a30c664a459c63821b2497c4e", "score": "0.40284446", "text": "func GetTaskRunByName(dbConn *sql.DB, taskId int, name string) (*TaskRunRow, error) {\r\n\treturn getTaskRunRow(dbConn,\r\n\t\t\"SELECT R.task_run_id, R.task_id, R.run_name, R.sub_count, R.create_dt, R.status, R.update_dt, R.run_stamp\"+\r\n\t\t\t\" FROM task_run_lst R\"+\r\n\t\t\t\" WHERE R.task_run_id =\"+\r\n\t\t\t\" (\"+\r\n\t\t\t\" SELECT MIN(M.task_run_id) FROM task_run_lst M\"+\r\n\t\t\t\" WHERE M.task_id = \"+strconv.Itoa(taskId)+\r\n\t\t\t\" AND M.run_name = \"+ToQuoted(name)+\r\n\t\t\t\")\")\r\n}", "title": "" }, { "docid": "c1bff384d326fbd9ac3331373ab1910b", "score": "0.4026784", "text": "func (c *controllerImpl) Run(name string) (constants.Statistics, []int, bool) {\n\tIDs, savedToDb, stats := c.runSet(fmt.Sprintf(\"^%s$\", name))\n\n\tif len(stats) == 0 {\n\t\t// TODO: Add logic for when no matching test cases are found\n\t\treturn constants.Statistics{}, []int{}, false\n\t}\n\n\treturn stats[0], IDs, savedToDb\n}", "title": "" }, { "docid": "a82f34eaeb0ebd5af54da2b3522c4266", "score": "0.40145877", "text": "func NewBatch() *Batch {\n\treturn &Batch{\n\t\tq: queue.New(),\n\t}\n}", "title": "" }, { "docid": "4c072d5a1502fe22acece0809101f45b", "score": "0.39995718", "text": "func (c *restClient) CreateGroupOperation(name string) *CreateGroupOperation {\n\toverride := fmt.Sprintf(\"/v1/%s\", name)\n\treturn &CreateGroupOperation{\n\t\tlro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),\n\t\tpollPath: override,\n\t}\n}", "title": "" }, { "docid": "d38783cf9cd19c008c04cfd5ce3813dc", "score": "0.39825746", "text": "func NewBatchRunnerForTest() *BatchRunner {\n\treturn &BatchRunner{\n\t\trequests: make(chan *batchedOp),\n\t\tclosed: make(chan struct{}),\n\n\t\tdoneChannelSize: 0,\n\n\t\ttBatchStart: make(chan struct{}),\n\t\ttBatchWait: make(chan struct{}),\n\t}\n}", "title": "" }, { "docid": "ef58b187eb8220919d7ac0ffc1080bf5", "score": "0.3966101", "text": "func Run(name string, arg ...string) (string, int, error) {\n\treturn RunContext(context.Background(), name, arg...)\n}", "title": "" }, { "docid": "051401fd0917928a41f21901815d807a", "score": "0.39660588", "text": "func (pf *Runner) Run(name string, test Test) {\n\tfor _, c := range pf.matrix.scenarios() {\n\t\tc := c\n\t\tpf.t.Run(c.String()+\"/\"+name, func(t *testing.T) {\n\t\t\tpf.recordTestStarted(t)\n\t\t\tpf.parent.wg.Add(1)\n\t\t\tt.Parallel()\n\t\t\tf := new(Fixture)\n\t\t\tdefer func() {\n\t\t\t\t// TODO: Make timeout configurable.\n\t\t\t\ttimeout := 10 * time.Second\n\t\t\t\tdefer pf.parent.wg.Done()\n\t\t\t\tvar teardownErr error\n\t\t\t\tselect {\n\t\t\t\tcase <-time.After(timeout):\n\t\t\t\t\trtLog(\"[ERROR:%s] Teardown took longer than %s\", t.Name(), timeout)\n\t\t\t\t\tteardownErr = fmt.Errorf(\"teardown timed out after %s\", timeout)\n\t\t\t\tcase <-func() <-chan struct{} {\n\t\t\t\t\tc := make(chan struct{})\n\t\t\t\t\tgo func() {\n\t\t\t\t\t\tif *f != nil {\n\t\t\t\t\t\t\tteardownErr = <-(*f).Teardown(t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclose(c)\n\t\t\t\t\t}()\n\t\t\t\t\treturn c\n\t\t\t\t}():\n\t\t\t\t}\n\t\t\t\tif teardownErr != nil {\n\t\t\t\t\tt.Errorf(\"[TEARDOWN FAILED]: %s\", teardownErr)\n\t\t\t\t}\n\t\t\t\tpf.recordTestStatus(t)\n\t\t\t}()\n\t\t\t*f = pf.parent.fixtureFactory(t, c)\n\t\t\ttest(t, Context{Scenario: c, F: *f})\n\t\t})\n\t}\n}", "title": "" }, { "docid": "bacded63392331f621fe1c88c6e43ea0", "score": "0.3964179", "text": "func (T *Task) Run(TotalThreads int, storageconfig StorageConfig) {\n\tif TotalThreads == 0 {\n\t\tTotalThreads = 10\n\t}\n\n\tT.Start = time.Now()\n\tT.Name += \"_\" + T.Start.Format(time.RFC3339)\n\tfmt.Printf(\"Project Name: %s\\n\", T.Project)\n\tfmt.Printf(\"Scan Name: %s\\n\", T.Name)\n\tvar mutex = &sync.Mutex{}\n\tvar wg sync.WaitGroup\n\tfor i := range T.TestCases {\n\t\tfor j := 0; j < TotalThreads; j++ {\n\t\t\twg.Add(1)\n\t\t\tmutex.Lock()\n\t\t\tgo func(i int) {\n\t\t\t\tdefer wg.Done()\n\t\t\t\ttestcase := &(T.TestCases[i])\n\t\t\t\thttpclient := http.Client{\n\t\t\t\t\tTimeout: time.Duration(120 * time.Second),\n\t\t\t\t}\n\n\t\t\t\ttestcase.Request.Request.Close = true\n\t\t\t\tresp, err := httpclient.Do(testcase.Request.Request)\n\t\t\t\tif err != nil {\n\t\t\t\t\tfmt.Printf(\"Task.Run httpclient error: %s\\n\", err)\n\t\t\t\t} else {\n\t\t\t\t\thttpres, err := NewHTTPResponse(resp)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tfmt.Printf(\"Task.Run NewHTTPResponse error: %s\\n\", err)\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttestcase.Response = httpres\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttestcase.Status = \"Done\"\n\t\t\t}(i)\n\t\t\tmutex.Unlock()\n\t\t}\n\t\twg.Wait()\n\t}\n\tT.End = time.Now()\n\tserializedTask := T.serialize()\n\n\tif storageconfig.UseMongoDB {\n\t\terr := ResultsToMongoDB(storageconfig.MongoDBURI, serializedTask)\n\t\tif err != nil {\n\t\t\tlog.Printf(\"Run ResultsToMongoDB error: %s\\n\", err)\n\t\t}\n\t}\n\n\tif storageconfig.UseFile {\n\t\terr := ResultsToFile(storageconfig.FileURI, serializedTask)\n\t\tif err != nil {\n\t\t\tlog.Printf(\"Run ResultsToFile error: %s\\n\", err)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "10ffb7ee2086c5ce537660648237ea89", "score": "0.39340857", "text": "func NewTaskName(name string) TaskName { return TaskName{value: name} }", "title": "" }, { "docid": "6759849c6ea5a7a7c88cfe1bd563df1a", "score": "0.39293954", "text": "func NewBatch(cfg Config) *Batch {\n\tb := &Batch{\n\t\tmaxItems: cfg.maxItems,\n\t\tmaxAge: cfg.maxAge,\n\t\tage: time.Now().Unix() + 10000,\n\t\tincompleteBatch: make([]interface{}, 0, cfg.maxItems+1),\n\t\titems: make(chan interface{}, cfg.maxItems*cfg.consumers),\n\t\tcompleteBatch: make(chan []interface{}, cfg.maxItems*cfg.consumers),\n\t}\n\tgo batchBuilder(b)\n\treturn b\n}", "title": "" }, { "docid": "02bf0980542a54691bb844a646601b4b", "score": "0.39265198", "text": "func (a *WorkloadsApiService) CreateWorkload(ctx _context.Context, stackId string) apiCreateWorkloadRequest {\n\treturn apiCreateWorkloadRequest{\n\t\tapiService: a,\n\t\tctx: ctx,\n\t\tstackId: stackId,\n\t}\n}", "title": "" }, { "docid": "121cdb79ddf0ce36b30b2dd4898c2a7f", "score": "0.39244828", "text": "func (c *DeleteCommand) constructInputBatch() (*fastly.BatchDeleteTokensInput, error) {\n\tvar (\n\t\terr error\n\t\tfile io.Reader\n\t\tinput fastly.BatchDeleteTokensInput\n\t\tpath string\n\t\ttokens []*fastly.BatchToken\n\t)\n\n\tif path, err = filepath.Abs(c.file); err == nil {\n\t\tif _, err = os.Stat(path); err == nil {\n\t\t\t// gosec flagged this:\n\t\t\t// G304 (CWE-22): Potential file inclusion via variable\n\t\t\t// Disabling as we trust the source of the path variable.\n\t\t\t/* #nosec */\n\t\t\tif file, err = os.Open(path); err == nil {\n\t\t\t\tscanner := bufio.NewScanner(file)\n\t\t\t\tfor scanner.Scan() {\n\t\t\t\t\ttokens = append(tokens, &fastly.BatchToken{ID: scanner.Text()})\n\t\t\t\t}\n\t\t\t\terr = scanner.Err()\n\t\t\t}\n\t\t}\n\t}\n\n\tinput.Tokens = tokens\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &input, nil\n}", "title": "" }, { "docid": "7a42ad71660f98ae99258a6f3b2279be", "score": "0.39150122", "text": "func (w *Workload) Run(kubeClient kubernetes.Interface) error {\n\t// initialize a new testing tool for this mysql workload.\n\ttestingTool, err := w.TestingTool()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor i := 1; i <= w.Frequency; i++ {\n\t\tfor _, testingCase := range testingTool.GetTestingCaseSet() {\n\t\t\t// running a testing case.\n\t\t\tglog.V(1).Infof(\"Repeat %d: Running the testing case %q of %s\", i, testingCase.Name, w.GetName())\n\t\t\terr := testingTool.Run(kubeClient, testingCase)\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrapf(err, \"Failed to create the resouces belong to testing case %q of %s\", testingCase.Name, w.GetName())\n\t\t\t}\n\n\t\t\t// get the testing results of the testing case.\n\t\t\tglog.V(4).Infof(\"Repeat %d: Starting fetch the testing results of the testing case %q\", i, testingCase.Name)\n\t\t\terr = testingTool.GetTestingResults(kubeClient)\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrapf(err, \"Failed to gets the testing results of the testing case %s\", testingCase.Name)\n\t\t\t}\n\n\t\t\t// clean up all the resouces created by the testing case.\n\t\t\tglog.V(4).Infof(\"Repeat %d: Cleaning up all the resouces created by the testing case %q\", i, testingCase.Name)\n\t\t\terr = testingTool.Cleanup(kubeClient)\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrapf(err, \"Failed to cleanup the resouces created by the testing case %s\", testingCase.Name)\n\t\t\t}\n\n\t\t\t// sleep some seconds between testing cases.\n\t\t\tglog.V(4).Infof(\"Repeat %d: Sleeping %v and starting next testing case.\", i, testingTool.GetSteps())\n\t\t\ttime.Sleep(testingTool.GetSteps())\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e769bf47fed87e90bd52f669ef9f167b", "score": "0.39029837", "text": "func (op *CreateGroupOperation) Name() string {\n\treturn op.lro.Name()\n}", "title": "" }, { "docid": "a3f319f5e5aaa8dcb0f96b198ce288f1", "score": "0.3897303", "text": "func Group(name string, ops ...Operation) *Ops {\n\tres := &Ops{name, []Operation{}}\n\tfor _, op := range ops {\n\t\tif op != nil {\n\t\t\tres.Ops = append(res.Ops, op)\n\t\t}\n\t}\n\treturn res\n}", "title": "" }, { "docid": "975035d6e1ee92321989fa226f6ccd9c", "score": "0.3885274", "text": "func (c *translationGRPCClient) BatchTranslateDocumentOperation(name string) *BatchTranslateDocumentOperation {\n\treturn &BatchTranslateDocumentOperation{\n\t\tlro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),\n\t}\n}", "title": "" }, { "docid": "7f8df6efe82add8b889f3f1d598c3c96", "score": "0.38808265", "text": "func (op *CancelCutoverJobOperation) Name() string {\n\treturn op.lro.Name()\n}", "title": "" }, { "docid": "4d8420d924fa7e508a59c37821c93455", "score": "0.38805476", "text": "func CreateCategoryBatchRequest(token, locationID string, reqObj *CreateCategoryReqObject) (*BatchRequest, string) {\n\tv := new(Category)\n\treturn newBatchRequest(\"POST\", fmt.Sprintf(\"/v1/%s/categories\", locationID), token, reqObj, v)\n}", "title": "" }, { "docid": "4f5d37d9fccee0afdca80c16c032a8a6", "score": "0.38752416", "text": "func (op *BatchTranslateTextOperation) Name() string {\n\treturn op.lro.Name()\n}", "title": "" }, { "docid": "1a0957368b7de42544e852871db1776b", "score": "0.38676077", "text": "func (c *translationRESTClient) BatchTranslateDocumentOperation(name string) *BatchTranslateDocumentOperation {\n\toverride := fmt.Sprintf(\"/v3/%s\", name)\n\treturn &BatchTranslateDocumentOperation{\n\t\tlro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),\n\t\tpollPath: override,\n\t}\n}", "title": "" }, { "docid": "21cb0ef93a0eee59e306e38b905e01f0", "score": "0.38523003", "text": "func (workload *DefaultWorkload) PrepareBatch() []string {\n\toperations := make([]string, 0, 100)\n\trandOperations := make([]string, 100, 100)\n\tfor i := 0; i < workload.Config.CreatePercentage; i++ {\n\t\toperations = append(operations, \"c\")\n\t}\n\tfor i := 0; i < workload.Config.ReadPercentage; i++ {\n\t\toperations = append(operations, \"r\")\n\t}\n\tfor i := 0; i < workload.Config.UpdatePercentage; i++ {\n\t\toperations = append(operations, \"u\")\n\t}\n\tfor i := 0; i < workload.Config.DeletePercentage; i++ {\n\t\toperations = append(operations, \"d\")\n\t}\n\tfor i := 0; i < workload.Config.QueryPercentage; i++ {\n\t\toperations = append(operations, \"q\")\n\t}\n\tif len(operations) != 100 {\n\t\tlog.Fatal(\"Wrong workload configuration: sum of percentages is not equal 100\")\n\t}\n\tfor i, randI := range rand.Perm(100) {\n\t\trandOperations[i] = operations[randI]\n\t}\n\treturn randOperations\n}", "title": "" }, { "docid": "cd01eb04c322e85f1894e6273a290757", "score": "0.38505396", "text": "func (this *TestFramework) getTestCaseByName(name string) TestCase {\n\ttestCaseId := \"\"\n\tfor id, n := range this.testCaseNameMap {\n\t\tif n == name {\n\t\t\ttestCaseId = id\n\t\t\tbreak\n\t\t}\n\t}\n\tif testCaseId == \"\" {\n\t\treturn nil\n\t}\n\treturn this.testCasesMap[testCaseId]\n}", "title": "" }, { "docid": "386e410e92a103e10270bb35585ad3d6", "score": "0.3849805", "text": "func (u API) Batch() API {\n\tu.u.Path = path.Join(u.u.Path, types.BatchStr)\n\treturn u\n}", "title": "" }, { "docid": "4854e1101c3c30ededa85b41541e7979", "score": "0.3848963", "text": "func (c *Client) TestCaseCreate(organization string, testCaseName string, fileName string, data io.Reader) (bool, string, error) {\n\t// TODO how to pass options here?\n\t// defining a struct maybe, but where?\n\t// finally: add options here\n\textraParams := url.Values{}\n\textraParams.Add(\"test_case[name]\", testCaseName)\n\n\treq, err := fileUploadRequest(c.APIEndpoint+\"/organisations/\"+organization+\"/test_cases\", \"POST\", extraParams, \"test_case[javascript_definition]\", fileName, \"application/javascript\", data)\n\tif err != nil {\n\t\treturn false, \"\", err\n\t}\n\n\tresponse, err := c.doRequestRaw(req)\n\tif err != nil {\n\t\treturn false, \"\", err\n\t}\n\tdefer response.Body.Close()\n\n\tbody, err := ioutil.ReadAll(response.Body)\n\tif err != nil {\n\t\treturn false, \"\", err\n\t}\n\n\tdefer close(response.Body)\n\n\tif response.StatusCode != 200 {\n\t\treturn false, string(body), nil\n\t}\n\n\treturn true, string(body), nil\n}", "title": "" }, { "docid": "adaf756c69a5cf542e975425d6f8007f", "score": "0.38410535", "text": "func NewWriteBatch() *WriteBatch {\n\treturn &WriteBatch{}\n}", "title": "" }, { "docid": "aaf6ca4bc8e8f2707ff8a864863b48ee", "score": "0.38296747", "text": "func (op *BatchRunTestCasesOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*cxpb.BatchRunTestCasesResponse, error) {\n\topts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)\n\tvar resp cxpb.BatchRunTestCasesResponse\n\tif err := op.lro.Poll(ctx, &resp, opts...); err != nil {\n\t\treturn nil, err\n\t}\n\tif !op.Done() {\n\t\treturn nil, nil\n\t}\n\treturn &resp, nil\n}", "title": "" }, { "docid": "31394f6cb6438d6b5bd4ef905bf477f4", "score": "0.38276", "text": "func NewBatch(b storage.Batch, spans *SpanSet) storage.Batch {\n\treturn &spanSetBatch{\n\t\tReadWriter: makeSpanSetReadWriter(b, spans),\n\t\tb: b,\n\t\tspans: spans,\n\t\tspansOnly: true,\n\t}\n}", "title": "" }, { "docid": "592142c4a0712a409a3d4bb88151b91a", "score": "0.38251114", "text": "func (d *Failstore) Batch(ctx context.Context) (ds.Batch, error) {\n\tif err := d.errfunc(\"batch\"); err != nil {\n\t\treturn nil, err\n\t}\n\n\tb, err := d.child.(ds.Batching).Batch(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &FailBatch{\n\t\tcb: b,\n\t\tdstore: d,\n\t}, nil\n}", "title": "" }, { "docid": "4794f62d6131068f08b68fa63500a8b4", "score": "0.38228884", "text": "func (op *DeleteGroupOperation) Name() string {\n\treturn op.lro.Name()\n}", "title": "" }, { "docid": "21e67b4fe0bfd99b584ff91d98b7cbfe", "score": "0.38222057", "text": "func (m *SpanMock) SetOperationName(p string) (r opentracing.Span) {\n\tatomic.AddUint64(&m.SetOperationNamePreCounter, 1)\n\tdefer atomic.AddUint64(&m.SetOperationNameCounter, 1)\n\n\tif m.SetOperationNameMock.mockExpectations != nil {\n\t\ttestify_assert.Equal(m.t, *m.SetOperationNameMock.mockExpectations, SpanMockSetOperationNameParams{p},\n\t\t\t\"Span.SetOperationName got unexpected parameters\")\n\n\t\tif m.SetOperationNameFunc == nil {\n\n\t\t\tm.t.Fatal(\"No results are set for the SpanMock.SetOperationName\")\n\n\t\t\treturn\n\t\t}\n\t}\n\n\tif m.SetOperationNameFunc == nil {\n\t\tm.t.Fatal(\"Unexpected call to SpanMock.SetOperationName\")\n\t\treturn\n\t}\n\n\treturn m.SetOperationNameFunc(p)\n}", "title": "" }, { "docid": "2fd630ec319c9f229d5c108e3c42815d", "score": "0.38151613", "text": "func newBatchAction(id int64, aType ActionType) *Action {\n\tvar a = newAction()\n\ta.ObjectType = actionObjectTypeBatch\n\ta.ActionType = string(aType)\n\ta.ObjectID = id\n\n\treturn a\n}", "title": "" }, { "docid": "44bba366f9a7edddc57a7efeaabb8122", "score": "0.38145697", "text": "func (r apiCreateWorkloadRequest) Execute() (V1CreateWorkloadResponse, *_nethttp.Response, error) {\n\tvar (\n\t\tlocalVarHTTPMethod = _nethttp.MethodPost\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarFormFileName string\n\t\tlocalVarFileName string\n\t\tlocalVarFileBytes []byte\n\t\tlocalVarReturnValue V1CreateWorkloadResponse\n\t)\n\n\tlocalBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, \"WorkloadsApiService.CreateWorkload\")\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}\n\t}\n\n\tlocalVarPath := localBasePath + \"/workload/v1/stacks/{stack_id}/workloads\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"stack_id\"+\"}\", _neturl.QueryEscape(parameterToString(r.stackId, \"\")) , -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := _neturl.Values{}\n\tlocalVarFormParams := _neturl.Values{}\n\t\n\t\n\tif r.v1CreateWorkloadRequest == nil {\n\t\treturn localVarReturnValue, nil, reportError(\"v1CreateWorkloadRequest is required and must be specified\")\n\t}\n\n\t// to determine the Content-Type header\n\tlocalVarHTTPContentTypes := []string{\"application/json\"}\n\n\t// set Content-Type header\n\tlocalVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)\n\tif localVarHTTPContentType != \"\" {\n\t\tlocalVarHeaderParams[\"Content-Type\"] = localVarHTTPContentType\n\t}\n\n\t// to determine the Accept header\n\tlocalVarHTTPHeaderAccepts := []string{\"application/json\"}\n\n\t// set Accept header\n\tlocalVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)\n\tif localVarHTTPHeaderAccept != \"\" {\n\t\tlocalVarHeaderParams[\"Accept\"] = localVarHTTPHeaderAccept\n\t}\n\t// body params\n\tlocalVarPostBody = r.v1CreateWorkloadRequest\n\treq, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, err\n\t}\n\n\tlocalVarHTTPResponse, err := r.apiService.client.callAPI(req)\n\tif err != nil || localVarHTTPResponse == nil {\n\t\treturn localVarReturnValue, localVarHTTPResponse, err\n\t}\n\n\tlocalVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)\n\tlocalVarHTTPResponse.Body.Close()\n\tif err != nil {\n\t\treturn localVarReturnValue, localVarHTTPResponse, err\n\t}\n\n\tif localVarHTTPResponse.StatusCode >= 300 {\n\t\tnewErr := GenericOpenAPIError{\n\t\t\tbody: localVarBody,\n\t\t\terror: localVarHTTPResponse.Status,\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 401 {\n\t\t\tvar v StackpathapiStatus\n\t\t\terr = r.apiService.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 500 {\n\t\t\tvar v StackpathapiStatus\n\t\t\terr = r.apiService.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t}\n\t\t\tvar v StackpathapiStatus\n\t\t\terr = r.apiService.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t}\n\n\terr = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\tif err != nil {\n\t\tnewErr := GenericOpenAPIError{\n\t\t\tbody: localVarBody,\n\t\t\terror: err.Error(),\n\t\t}\n\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t}\n\n\treturn localVarReturnValue, localVarHTTPResponse, nil\n}", "title": "" }, { "docid": "dd913c77b4b00671df3880759fbd224d", "score": "0.38092077", "text": "func RunConsulBenchWorkload(deploymentName string, namespace string) (*v1.Deployment, error) {\n\tvar replicas int32 = 1\n\tbenchmarkName := deploymentName + \"-bench\"\n\tdeploymentSpec := &v1.Deployment{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: benchmarkName,\n\t\t\tNamespace: namespace,\n\t\t},\n\t\tSpec: v1.DeploymentSpec{\n\t\t\tReplicas: &replicas,\n\t\t\tSelector: &metav1.LabelSelector{\n\t\t\t\tMatchLabels: map[string]string{\"app\": benchmarkName},\n\t\t\t},\n\t\t\tTemplate: corev1.PodTemplateSpec{\n\t\t\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\t\t\tLabels: map[string]string{\"app\": benchmarkName},\n\t\t\t\t},\n\t\t\t\tSpec: corev1.PodSpec{\n\t\t\t\t\tContainers: []corev1.Container{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: \"consul-agent\",\n\t\t\t\t\t\t\tImage: consulAgentImage,\n\t\t\t\t\t\t\tImagePullPolicy: corev1.PullAlways,\n\t\t\t\t\t\t\tEnv: []corev1.EnvVar{\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tName: \"AGENT_TOKEN\",\n\t\t\t\t\t\t\t\t\tValueFrom: &corev1.EnvVarSource{\n\t\t\t\t\t\t\t\t\t\tSecretKeyRef: &corev1.SecretKeySelector{\n\t\t\t\t\t\t\t\t\t\t\tLocalObjectReference: corev1.LocalObjectReference{\n\t\t\t\t\t\t\t\t\t\t\t\tName: deploymentName + \"-creds\",\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\tKey: \"master_token\",\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tName: \"PDS_CLUSTER\",\n\t\t\t\t\t\t\t\t\tValue: deploymentName,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tName: \"PDS_NS\",\n\t\t\t\t\t\t\t\t\tValue: namespace,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: \"consul-kv-workload\",\n\t\t\t\t\t\t\tImage: consulAgentImage,\n\t\t\t\t\t\t\tImagePullPolicy: corev1.PullAlways,\n\t\t\t\t\t\t\tCommand: []string{\"/bin/kv-workload.sh\"},\n\t\t\t\t\t\t\tEnv: []corev1.EnvVar{\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tName: \"AGENT_TOKEN\",\n\t\t\t\t\t\t\t\t\tValueFrom: &corev1.EnvVarSource{\n\t\t\t\t\t\t\t\t\t\tSecretKeyRef: &corev1.SecretKeySelector{\n\t\t\t\t\t\t\t\t\t\t\tLocalObjectReference: corev1.LocalObjectReference{\n\t\t\t\t\t\t\t\t\t\t\t\tName: deploymentName + \"-creds\",\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\tKey: \"master_token\",\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: \"consul-bench\",\n\t\t\t\t\t\t\tImage: consulBenchImage,\n\t\t\t\t\t\t\tImagePullPolicy: corev1.PullAlways,\n\t\t\t\t\t\t\tEnv: []corev1.EnvVar{\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tName: \"CONSUL_HTTP_TOKEN\",\n\t\t\t\t\t\t\t\t\tValueFrom: &corev1.EnvVarSource{\n\t\t\t\t\t\t\t\t\t\tSecretKeyRef: &corev1.SecretKeySelector{\n\t\t\t\t\t\t\t\t\t\t\tLocalObjectReference: corev1.LocalObjectReference{\n\t\t\t\t\t\t\t\t\t\t\t\tName: deploymentName + \"-creds\",\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\tKey: \"master_token\",\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tName: \"SERVICE_NAME\",\n\t\t\t\t\t\t\t\t\tValueFrom: &corev1.EnvVarSource{\n\t\t\t\t\t\t\t\t\t\tFieldRef: &corev1.ObjectFieldSelector{\n\t\t\t\t\t\t\t\t\t\t\tFieldPath: \"metadata.name\",\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tName: \"SERVICE_INSTANCES\",\n\t\t\t\t\t\t\t\t\tValue: \"10\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tName: \"SERVICE_FLAP_SECONDS\",\n\t\t\t\t\t\t\t\t\tValue: \"10\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tName: \"SERVICE_WATCHERS\",\n\t\t\t\t\t\t\t\t\tValue: \"10\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\tlog.InfoD(\"Going to Trigger Consul Bench Workload for the Deployment\")\n\tdeployment, err := k8sApps.CreateDeployment(deploymentSpec, metav1.CreateOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\terr = k8sApps.ValidateDeployment(deployment, timeOut, timeInterval)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Sleeping for 1 minute to let the Workload run\n\ttime.Sleep(1 * time.Minute)\n\n\treturn deployment, nil\n}", "title": "" }, { "docid": "04cbea4d9ba8018e5150a285119b8513", "score": "0.38091263", "text": "func (m *Main) newFeaturebaseBatch(cfg pilosabatch.Config, tbl *dax.Table, fields []*pilosacore.FieldInfo) (pilosabatch.RecordBatch, error) {\n\topts := []pilosabatch.BatchOption{\n\t\tpilosabatch.OptLogger(m.log),\n\t\tpilosabatch.OptCacheMaxAge(m.CacheLength),\n\t\tpilosabatch.OptSplitBatchMode(m.ExpSplitBatchMode),\n\t\tpilosabatch.OptMaxStaleness(cfg.MaxStaleness),\n\t\tpilosabatch.OptKeyTranslateBatchSize(m.KeyTranslateBatchSize),\n\t\tpilosabatch.OptUseShardTransactionalEndpoint(m.UseShardTransactionalEndpoint),\n\t}\n\tvar importer pilosacore.Importer\n\tif m.useController() {\n\t\timporter = m.NewImporterFn()\n\t} else {\n\t\tsapi := pilosaclient.NewSchemaAPI(m.client)\n\t\timporter = pilosaclient.NewImporter(m.client, sapi)\n\t}\n\topts = append(opts, pilosabatch.OptImporter(importer))\n\n\treturn pilosabatch.NewBatch(importer, cfg.Size, tbl, fields, opts...)\n}", "title": "" }, { "docid": "68cca846b8e59efb0f467232b3b062f0", "score": "0.3808709", "text": "func (s *Span) SetOperationName(operationName string) opentracing.Span {\n\tdupe := s.clone()\n\tdupe.operationName = operationName\n\treturn dupe\n}", "title": "" }, { "docid": "7cbacc1b90c516eb9cd460cb5bf6801f", "score": "0.38079506", "text": "func (r *ProjectsLocationsQueuesTasksService) Run(name string, runtaskrequest *RunTaskRequest) *ProjectsLocationsQueuesTasksRunCall {\n\tc := &ProjectsLocationsQueuesTasksRunCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.name = name\n\tc.runtaskrequest = runtaskrequest\n\treturn c\n}", "title": "" }, { "docid": "784aa0a0f8e02fb51d6ce972d78bfc4b", "score": "0.38051546", "text": "func (c *restClient) CreateClusterOperation(name string) *CreateClusterOperation {\n\toverride := fmt.Sprintf(\"/v1/%s\", name)\n\treturn &CreateClusterOperation{\n\t\tlro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),\n\t\tpollPath: override,\n\t}\n}", "title": "" }, { "docid": "83b3d379892dc63d7afef6d8e4943749", "score": "0.38036546", "text": "func (pf *Runner) RunScenario(name string, test ScenarioTest) {\n\tfor _, c := range pf.matrix.scenarios() {\n\t\tc := c\n\t\tpf.t.Run(c.String()+\"/\"+name, func(t *testing.T) {\n\t\t\tpf.recordTestStarted(t)\n\t\t\tpf.parent.wg.Add(1)\n\t\t\tlf := newLateFixture()\n\t\t\tdefer func() {\n\t\t\t\ttimeout := 10 * time.Second\n\t\t\t\tdefer pf.parent.wg.Done()\n\t\t\t\tpf.recordTestStatus(t)\n\t\t\t\tselect {\n\t\t\t\tcase <-time.After(10 * time.Second):\n\t\t\t\t\trtLog(\"ERROR: Teardown took longer than %s\", timeout)\n\t\t\t\tcase <-func() <-chan struct{} {\n\t\t\t\t\tc := make(chan struct{})\n\t\t\t\t\tgo func() {\n\t\t\t\t\t\t<-lf.created\n\t\t\t\t\t\tif lf.f != nil {\n\t\t\t\t\t\t\tlf.f.Teardown(t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclose(c)\n\t\t\t\t\t}()\n\t\t\t\t\treturn c\n\t\t\t\t}():\n\t\t\t\t}\n\t\t\t}()\n\t\t\tt.Parallel()\n\t\t\ttest(t, c, lf)\n\t\t})\n\t}\n}", "title": "" }, { "docid": "5f2ecbd8984f9219f02c3e63f91e0346", "score": "0.38033766", "text": "func (op *CreateCutoverJobOperation) Name() string {\n\treturn op.lro.Name()\n}", "title": "" }, { "docid": "2684bd678a3755b8eee10decfaba04ed", "score": "0.3784562", "text": "func NewBatcher(name string, logger *zap.Logger, sender consumer.TraceConsumer, opts ...Option) consumer.TraceConsumer {\n\t// Init with defaults\n\tb := &batcher{\n\t\tname: name,\n\t\tsender: sender,\n\t\tlogger: logger,\n\n\t\tremoveAfterCycles: defaultRemoveAfterCycles,\n\t\tsendBatchSize: defaultSendBatchSize,\n\t\tnumTickers: defaultNumTickers,\n\t\ttickTime: defaultTickTime,\n\t\ttimeout: defaultTimeout,\n\t}\n\n\t// Override with options\n\tfor _, opt := range opts {\n\t\topt(b)\n\t}\n\n\t// start tickers after options loaded in\n\tb.tickers = newStartedBucketTickersForBatch(b)\n\treturn b\n}", "title": "" }, { "docid": "5e57169a39d647f069309e479aa1c177", "score": "0.37830415", "text": "func NewBatchCreateRequestWithoutParam() *BatchCreateRequest {\n\n return &BatchCreateRequest{\n JDCloudRequest: core.JDCloudRequest{\n URL: \"/domain:batchCreate\",\n Method: \"POST\",\n Header: nil,\n Version: \"v1\",\n },\n }\n}", "title": "" }, { "docid": "da574ebeba71ee764aba274e7ee84467", "score": "0.37825254", "text": "func (txn *Txn) NewBatch() *Batch {\n\treturn &Batch{txn: txn}\n}", "title": "" }, { "docid": "da574ebeba71ee764aba274e7ee84467", "score": "0.37825254", "text": "func (txn *Txn) NewBatch() *Batch {\n\treturn &Batch{txn: txn}\n}", "title": "" }, { "docid": "3002e5ef48cba028e759f0c1795125de", "score": "0.37760693", "text": "func NewBatch(bch datastore.Batch, options ...Option) *Batch {\n\topts := Options{}\n\topts.Apply(options...)\n\treturn &Batch{bch: bch, options: opts}\n}", "title": "" }, { "docid": "fa763e1eef37a56b3f1e8f6dfc54a044", "score": "0.37706813", "text": "func (m *MockINode) RunOperation(arg0, arg1, arg2, arg3 string, arg4, arg5, arg6, arg7, arg8 int64, arg9 []byte) (OperationGroup, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"RunOperation\", arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)\n\tret0, _ := ret[0].(OperationGroup)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "18edb50e3cb9f553d552359dd2bfd6a5", "score": "0.37603244", "text": "func New(cmd Cmd, mf monitoring.MetricFactory) *Operation {\n\tif mf == nil {\n\t\tmf = monitoring.InertMetricFactory{}\n\t}\n\n\tonce.Do(func() { createMetrics(mf) })\n\n\treturn &Operation{cmd: cmd, mf: mf}\n}", "title": "" }, { "docid": "ff7c6606137409716f00b58387b8825c", "score": "0.37583286", "text": "func (r *Client) NewBatch(queue string) (*Batch, error) {\n\tif queue == \"\" {\n\t\treturn nil, errors.New(\"invalid queue name\")\n\t}\n\n\treturn &Batch{\n\t\tqueue: queue,\n\t\tredisClient: r.redisClient,\n\t\tnamespace: r.namespace,\n\t}, nil\n}", "title": "" }, { "docid": "761e059161e4b1085462fb4760d87aa2", "score": "0.37445825", "text": "func NewWorkloadClassifier(ctx *pulumi.Context,\n\tname string, args *WorkloadClassifierArgs, opts ...pulumi.ResourceOption) (*WorkloadClassifier, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.DatabaseName == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'DatabaseName'\")\n\t}\n\tif args.MemberName == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'MemberName'\")\n\t}\n\tif args.ResourceGroupName == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'ResourceGroupName'\")\n\t}\n\tif args.ServerName == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'ServerName'\")\n\t}\n\tif args.WorkloadGroupName == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'WorkloadGroupName'\")\n\t}\n\taliases := pulumi.Aliases([]pulumi.Alias{\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:sql:WorkloadClassifier\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-native:sql/v20190601preview:WorkloadClassifier\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:sql/v20190601preview:WorkloadClassifier\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-native:sql/v20200202preview:WorkloadClassifier\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:sql/v20200202preview:WorkloadClassifier\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-native:sql/v20200801preview:WorkloadClassifier\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:sql/v20200801preview:WorkloadClassifier\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-native:sql/v20201101preview:WorkloadClassifier\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:sql/v20201101preview:WorkloadClassifier\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-native:sql/v20210201preview:WorkloadClassifier\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:sql/v20210201preview:WorkloadClassifier\"),\n\t\t},\n\t})\n\topts = append(opts, aliases)\n\tvar resource WorkloadClassifier\n\terr := ctx.RegisterResource(\"azure-native:sql:WorkloadClassifier\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" } ]
e95bdb841db5a49eb726413e58c7e661
ConvertToARM converts from a Kubernetes CRD object to an ARM object
[ { "docid": "883d6ebb3f8631f6d29e328bf69756ce", "score": "0.0", "text": "func (parameters *HttpVersionMatchConditionParameters) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif parameters == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &HttpVersionMatchConditionParameters_ARM{}\n\n\t// Set property \"MatchValues\":\n\tfor _, item := range parameters.MatchValues {\n\t\tresult.MatchValues = append(result.MatchValues, item)\n\t}\n\n\t// Set property \"NegateCondition\":\n\tif parameters.NegateCondition != nil {\n\t\tnegateCondition := *parameters.NegateCondition\n\t\tresult.NegateCondition = &negateCondition\n\t}\n\n\t// Set property \"Operator\":\n\tif parameters.Operator != nil {\n\t\toperator := *parameters.Operator\n\t\tresult.Operator = &operator\n\t}\n\n\t// Set property \"Transforms\":\n\tfor _, item := range parameters.Transforms {\n\t\tresult.Transforms = append(result.Transforms, item)\n\t}\n\n\t// Set property \"TypeName\":\n\tif parameters.TypeName != nil {\n\t\ttypeName := *parameters.TypeName\n\t\tresult.TypeName = &typeName\n\t}\n\treturn result, nil\n}", "title": "" } ]
[ { "docid": "0c8facf5ffba437ea7b58840088ebce6", "score": "0.7358517", "text": "func (capping *WorkspaceCapping) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif capping == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &WorkspaceCapping_ARM{}\n\n\t// Set property \"DailyQuotaGb\":\n\tif capping.DailyQuotaGb != nil {\n\t\tdailyQuotaGb := *capping.DailyQuotaGb\n\t\tresult.DailyQuotaGb = &dailyQuotaGb\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "af483b57d37dbc56b661870a77b195be", "score": "0.7263981", "text": "func (reference *ResourceReference) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif reference == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &ResourceReference_ARM{}\n\n\t// Set property \"Id\":\n\tif reference.Reference != nil {\n\t\treferenceARMID, err := resolved.ResolvedReferences.Lookup(*reference.Reference)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treference1 := referenceARMID\n\t\tresult.Id = &reference1\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "af483b57d37dbc56b661870a77b195be", "score": "0.7263981", "text": "func (reference *ResourceReference) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif reference == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &ResourceReference_ARM{}\n\n\t// Set property \"Id\":\n\tif reference.Reference != nil {\n\t\treferenceARMID, err := resolved.ResolvedReferences.Lookup(*reference.Reference)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treference1 := referenceARMID\n\t\tresult.Id = &reference1\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "d82bb5bd58a8c795d7137ee79e5790ae", "score": "0.71338516", "text": "func (namespace *Namespace_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif namespace == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &Namespace_Spec_ARM{}\n\n\t// Set property \"Identity\":\n\tif namespace.Identity != nil {\n\t\tidentity_ARM, err := (*namespace.Identity).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tidentity := *identity_ARM.(*Identity_ARM)\n\t\tresult.Identity = &identity\n\t}\n\n\t// Set property \"Location\":\n\tif namespace.Location != nil {\n\t\tlocation := *namespace.Location\n\t\tresult.Location = &location\n\t}\n\n\t// Set property \"Name\":\n\tresult.Name = resolved.Name\n\n\t// Set property \"Properties\":\n\tif namespace.AlternateName != nil ||\n\t\tnamespace.ClusterArmReference != nil ||\n\t\tnamespace.DisableLocalAuth != nil ||\n\t\tnamespace.Encryption != nil ||\n\t\tnamespace.IsAutoInflateEnabled != nil ||\n\t\tnamespace.KafkaEnabled != nil ||\n\t\tnamespace.MaximumThroughputUnits != nil ||\n\t\tnamespace.ZoneRedundant != nil {\n\t\tresult.Properties = &Namespace_Properties_Spec_ARM{}\n\t}\n\tif namespace.AlternateName != nil {\n\t\talternateName := *namespace.AlternateName\n\t\tresult.Properties.AlternateName = &alternateName\n\t}\n\tif namespace.ClusterArmReference != nil {\n\t\tclusterArmIdARMID, err := resolved.ResolvedReferences.Lookup(*namespace.ClusterArmReference)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tclusterArmId := clusterArmIdARMID\n\t\tresult.Properties.ClusterArmId = &clusterArmId\n\t}\n\tif namespace.DisableLocalAuth != nil {\n\t\tdisableLocalAuth := *namespace.DisableLocalAuth\n\t\tresult.Properties.DisableLocalAuth = &disableLocalAuth\n\t}\n\tif namespace.Encryption != nil {\n\t\tencryption_ARM, err := (*namespace.Encryption).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tencryption := *encryption_ARM.(*Encryption_ARM)\n\t\tresult.Properties.Encryption = &encryption\n\t}\n\tif namespace.IsAutoInflateEnabled != nil {\n\t\tisAutoInflateEnabled := *namespace.IsAutoInflateEnabled\n\t\tresult.Properties.IsAutoInflateEnabled = &isAutoInflateEnabled\n\t}\n\tif namespace.KafkaEnabled != nil {\n\t\tkafkaEnabled := *namespace.KafkaEnabled\n\t\tresult.Properties.KafkaEnabled = &kafkaEnabled\n\t}\n\tif namespace.MaximumThroughputUnits != nil {\n\t\tmaximumThroughputUnits := *namespace.MaximumThroughputUnits\n\t\tresult.Properties.MaximumThroughputUnits = &maximumThroughputUnits\n\t}\n\tif namespace.ZoneRedundant != nil {\n\t\tzoneRedundant := *namespace.ZoneRedundant\n\t\tresult.Properties.ZoneRedundant = &zoneRedundant\n\t}\n\n\t// Set property \"Sku\":\n\tif namespace.Sku != nil {\n\t\tsku_ARM, err := (*namespace.Sku).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tsku := *sku_ARM.(*Sku_ARM)\n\t\tresult.Sku = &sku\n\t}\n\n\t// Set property \"Tags\":\n\tif namespace.Tags != nil {\n\t\tresult.Tags = make(map[string]string, len(namespace.Tags))\n\t\tfor key, value := range namespace.Tags {\n\t\t\tresult.Tags[key] = value\n\t\t}\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "0793fa1ba138daf76d5f768fef46dbfd", "score": "0.71171707", "text": "func (record *CnameRecord) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif record == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &CnameRecord_ARM{}\n\n\t// Set property \"Cname\":\n\tif record.Cname != nil {\n\t\tcname := *record.Cname\n\t\tresult.Cname = &cname\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "9fe37dd53d3c55dd0d456714bc09e106", "score": "0.70260483", "text": "func (resource *MongoDBDatabaseResource) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif resource == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &MongoDBDatabaseResource_ARM{}\n\n\t// Set property \"Id\":\n\tif resource.Id != nil {\n\t\tid := *resource.Id\n\t\tresult.Id = &id\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "260aeeefda6a0c83433d0631102367c7", "score": "0.6966601", "text": "func (rule *LoadBalancers_InboundNatRule_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif rule == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &LoadBalancers_InboundNatRule_Spec_ARM{}\n\n\t// Set property \"Name\":\n\tresult.Name = resolved.Name\n\n\t// Set property \"Properties\":\n\tif rule.BackendPort != nil ||\n\t\trule.EnableFloatingIP != nil ||\n\t\trule.EnableTcpReset != nil ||\n\t\trule.FrontendIPConfiguration != nil ||\n\t\trule.FrontendPort != nil ||\n\t\trule.IdleTimeoutInMinutes != nil ||\n\t\trule.Protocol != nil {\n\t\tresult.Properties = &InboundNatRulePropertiesFormat_ARM{}\n\t}\n\tif rule.BackendPort != nil {\n\t\tbackendPort := *rule.BackendPort\n\t\tresult.Properties.BackendPort = &backendPort\n\t}\n\tif rule.EnableFloatingIP != nil {\n\t\tenableFloatingIP := *rule.EnableFloatingIP\n\t\tresult.Properties.EnableFloatingIP = &enableFloatingIP\n\t}\n\tif rule.EnableTcpReset != nil {\n\t\tenableTcpReset := *rule.EnableTcpReset\n\t\tresult.Properties.EnableTcpReset = &enableTcpReset\n\t}\n\tif rule.FrontendIPConfiguration != nil {\n\t\tfrontendIPConfiguration_ARM, err := (*rule.FrontendIPConfiguration).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfrontendIPConfiguration := *frontendIPConfiguration_ARM.(*SubResource_ARM)\n\t\tresult.Properties.FrontendIPConfiguration = &frontendIPConfiguration\n\t}\n\tif rule.FrontendPort != nil {\n\t\tfrontendPort := *rule.FrontendPort\n\t\tresult.Properties.FrontendPort = &frontendPort\n\t}\n\tif rule.IdleTimeoutInMinutes != nil {\n\t\tidleTimeoutInMinutes := *rule.IdleTimeoutInMinutes\n\t\tresult.Properties.IdleTimeoutInMinutes = &idleTimeoutInMinutes\n\t}\n\tif rule.Protocol != nil {\n\t\tprotocol := *rule.Protocol\n\t\tresult.Properties.Protocol = &protocol\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "dbeeee73ea3113dd534923e9ef529164", "score": "0.692525", "text": "func (policy *ScaleInPolicy) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif policy == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &ScaleInPolicy_ARM{}\n\n\t// Set property \"ForceDeletion\":\n\tif policy.ForceDeletion != nil {\n\t\tforceDeletion := *policy.ForceDeletion\n\t\tresult.ForceDeletion = &forceDeletion\n\t}\n\n\t// Set property \"Rules\":\n\tfor _, item := range policy.Rules {\n\t\tresult.Rules = append(result.Rules, item)\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "513cae2b997c07752dec87e3a0082fc2", "score": "0.6894562", "text": "func (record *TxtRecord) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif record == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &TxtRecord_ARM{}\n\n\t// Set property \"Value\":\n\tfor _, item := range record.Value {\n\t\tresult.Value = append(result.Value, item)\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "a277ba9351585323d6ddf9c8f4c19ccc", "score": "0.6882172", "text": "func (schema *ManagementPolicySchema) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif schema == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &ManagementPolicySchema_ARM{}\n\n\t// Set property \"Rules\":\n\tfor _, item := range schema.Rules {\n\t\titem_ARM, err := item.ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult.Rules = append(result.Rules, *item_ARM.(*ManagementPolicyRule_ARM))\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "4bc138b54755b25f6c67d5ef26b8a270", "score": "0.6879431", "text": "func (zone *DnsZone_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif zone == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &DnsZone_Spec_ARM{}\n\n\t// Set property \"Location\":\n\tif zone.Location != nil {\n\t\tlocation := *zone.Location\n\t\tresult.Location = &location\n\t}\n\n\t// Set property \"Name\":\n\tresult.Name = resolved.Name\n\n\t// Set property \"Properties\":\n\tif zone.RegistrationVirtualNetworks != nil ||\n\t\tzone.ResolutionVirtualNetworks != nil ||\n\t\tzone.ZoneType != nil {\n\t\tresult.Properties = &ZoneProperties_ARM{}\n\t}\n\tfor _, item := range zone.RegistrationVirtualNetworks {\n\t\titem_ARM, err := item.ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult.Properties.RegistrationVirtualNetworks = append(result.Properties.RegistrationVirtualNetworks, *item_ARM.(*SubResource_ARM))\n\t}\n\tfor _, item := range zone.ResolutionVirtualNetworks {\n\t\titem_ARM, err := item.ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult.Properties.ResolutionVirtualNetworks = append(result.Properties.ResolutionVirtualNetworks, *item_ARM.(*SubResource_ARM))\n\t}\n\tif zone.ZoneType != nil {\n\t\tzoneType := *zone.ZoneType\n\t\tresult.Properties.ZoneType = &zoneType\n\t}\n\n\t// Set property \"Tags\":\n\tif zone.Tags != nil {\n\t\tresult.Tags = make(map[string]string, len(zone.Tags))\n\t\tfor key, value := range zone.Tags {\n\t\t\tresult.Tags[key] = value\n\t\t}\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "419985aa17cd00eef88491c0d3cace6f", "score": "0.6852237", "text": "func (record *MxRecord) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif record == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &MxRecord_ARM{}\n\n\t// Set property \"Exchange\":\n\tif record.Exchange != nil {\n\t\texchange := *record.Exchange\n\t\tresult.Exchange = &exchange\n\t}\n\n\t// Set property \"Preference\":\n\tif record.Preference != nil {\n\t\tpreference := *record.Preference\n\t\tresult.Preference = &preference\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "fc6af5152798d72ce0c0065d7b05bf90", "score": "0.6844951", "text": "func (ipTag *VirtualMachineScaleSetIpTag) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif ipTag == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &VirtualMachineScaleSetIpTag_ARM{}\n\n\t// Set property \"IpTagType\":\n\tif ipTag.IpTagType != nil {\n\t\tipTagType := *ipTag.IpTagType\n\t\tresult.IpTagType = &ipTagType\n\t}\n\n\t// Set property \"Tag\":\n\tif ipTag.Tag != nil {\n\t\ttag := *ipTag.Tag\n\t\tresult.Tag = &tag\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "ab2f66aeaae4282642473649b9e492c3", "score": "0.6825246", "text": "func (configuration *Servers_Configuration_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif configuration == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &Servers_Configuration_Spec_ARM{}\n\n\t// Set property \"Name\":\n\tresult.Name = resolved.Name\n\n\t// Set property \"Properties\":\n\tif configuration.Source != nil || configuration.Value != nil {\n\t\tresult.Properties = &ConfigurationProperties_ARM{}\n\t}\n\tif configuration.Source != nil {\n\t\tsource := *configuration.Source\n\t\tresult.Properties.Source = &source\n\t}\n\tif configuration.Value != nil {\n\t\tvalue := *configuration.Value\n\t\tresult.Properties.Value = &value\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "c6e65c011d56c2e041b9c7ba6d7f05c5", "score": "0.6818172", "text": "func (disk *VirtualMachineScaleSetOSDisk) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif disk == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &VirtualMachineScaleSetOSDisk_ARM{}\n\n\t// Set property \"Caching\":\n\tif disk.Caching != nil {\n\t\tcaching := *disk.Caching\n\t\tresult.Caching = &caching\n\t}\n\n\t// Set property \"CreateOption\":\n\tif disk.CreateOption != nil {\n\t\tcreateOption := *disk.CreateOption\n\t\tresult.CreateOption = &createOption\n\t}\n\n\t// Set property \"DeleteOption\":\n\tif disk.DeleteOption != nil {\n\t\tdeleteOption := *disk.DeleteOption\n\t\tresult.DeleteOption = &deleteOption\n\t}\n\n\t// Set property \"DiffDiskSettings\":\n\tif disk.DiffDiskSettings != nil {\n\t\tdiffDiskSettings_ARM, err := (*disk.DiffDiskSettings).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdiffDiskSettings := *diffDiskSettings_ARM.(*DiffDiskSettings_ARM)\n\t\tresult.DiffDiskSettings = &diffDiskSettings\n\t}\n\n\t// Set property \"DiskSizeGB\":\n\tif disk.DiskSizeGB != nil {\n\t\tdiskSizeGB := *disk.DiskSizeGB\n\t\tresult.DiskSizeGB = &diskSizeGB\n\t}\n\n\t// Set property \"Image\":\n\tif disk.Image != nil {\n\t\timage_ARM, err := (*disk.Image).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\timage := *image_ARM.(*VirtualHardDisk_ARM)\n\t\tresult.Image = &image\n\t}\n\n\t// Set property \"ManagedDisk\":\n\tif disk.ManagedDisk != nil {\n\t\tmanagedDisk_ARM, err := (*disk.ManagedDisk).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tmanagedDisk := *managedDisk_ARM.(*VirtualMachineScaleSetManagedDiskParameters_ARM)\n\t\tresult.ManagedDisk = &managedDisk\n\t}\n\n\t// Set property \"Name\":\n\tif disk.Name != nil {\n\t\tname := *disk.Name\n\t\tresult.Name = &name\n\t}\n\n\t// Set property \"OsType\":\n\tif disk.OsType != nil {\n\t\tosType := *disk.OsType\n\t\tresult.OsType = &osType\n\t}\n\n\t// Set property \"VhdContainers\":\n\tfor _, item := range disk.VhdContainers {\n\t\tresult.VhdContainers = append(result.VhdContainers, item)\n\t}\n\n\t// Set property \"WriteAcceleratorEnabled\":\n\tif disk.WriteAcceleratorEnabled != nil {\n\t\twriteAcceleratorEnabled := *disk.WriteAcceleratorEnabled\n\t\tresult.WriteAcceleratorEnabled = &writeAcceleratorEnabled\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "2b6023b4e2492f321a6b1ca77430d109", "score": "0.6805952", "text": "func (workspace *Workspace_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif workspace == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &Workspace_Spec_ARM{}\n\n\t// Set property \"Identity\":\n\tif workspace.Identity != nil {\n\t\tidentity_ARM, err := (*workspace.Identity).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tidentity := *identity_ARM.(*ManagedIdentity_ARM)\n\t\tresult.Identity = &identity\n\t}\n\n\t// Set property \"Location\":\n\tif workspace.Location != nil {\n\t\tlocation := *workspace.Location\n\t\tresult.Location = &location\n\t}\n\n\t// Set property \"Name\":\n\tresult.Name = resolved.Name\n\n\t// Set property \"Properties\":\n\tif workspace.AzureADOnlyAuthentication != nil ||\n\t\tworkspace.CspWorkspaceAdminProperties != nil ||\n\t\tworkspace.DefaultDataLakeStorage != nil ||\n\t\tworkspace.Encryption != nil ||\n\t\tworkspace.ManagedResourceGroupName != nil ||\n\t\tworkspace.ManagedVirtualNetwork != nil ||\n\t\tworkspace.ManagedVirtualNetworkSettings != nil ||\n\t\tworkspace.PublicNetworkAccess != nil ||\n\t\tworkspace.PurviewConfiguration != nil ||\n\t\tworkspace.SqlAdministratorLogin != nil ||\n\t\tworkspace.SqlAdministratorLoginPassword != nil ||\n\t\tworkspace.TrustedServiceBypassEnabled != nil ||\n\t\tworkspace.VirtualNetworkProfile != nil ||\n\t\tworkspace.WorkspaceRepositoryConfiguration != nil {\n\t\tresult.Properties = &WorkspaceProperties_ARM{}\n\t}\n\tif workspace.AzureADOnlyAuthentication != nil {\n\t\tazureADOnlyAuthentication := *workspace.AzureADOnlyAuthentication\n\t\tresult.Properties.AzureADOnlyAuthentication = &azureADOnlyAuthentication\n\t}\n\tif workspace.CspWorkspaceAdminProperties != nil {\n\t\tcspWorkspaceAdminProperties_ARM, err := (*workspace.CspWorkspaceAdminProperties).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcspWorkspaceAdminProperties := *cspWorkspaceAdminProperties_ARM.(*CspWorkspaceAdminProperties_ARM)\n\t\tresult.Properties.CspWorkspaceAdminProperties = &cspWorkspaceAdminProperties\n\t}\n\tif workspace.DefaultDataLakeStorage != nil {\n\t\tdefaultDataLakeStorage_ARM, err := (*workspace.DefaultDataLakeStorage).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdefaultDataLakeStorage := *defaultDataLakeStorage_ARM.(*DataLakeStorageAccountDetails_ARM)\n\t\tresult.Properties.DefaultDataLakeStorage = &defaultDataLakeStorage\n\t}\n\tif workspace.Encryption != nil {\n\t\tencryption_ARM, err := (*workspace.Encryption).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tencryption := *encryption_ARM.(*EncryptionDetails_ARM)\n\t\tresult.Properties.Encryption = &encryption\n\t}\n\tif workspace.ManagedResourceGroupName != nil {\n\t\tmanagedResourceGroupName := *workspace.ManagedResourceGroupName\n\t\tresult.Properties.ManagedResourceGroupName = &managedResourceGroupName\n\t}\n\tif workspace.ManagedVirtualNetwork != nil {\n\t\tmanagedVirtualNetwork := *workspace.ManagedVirtualNetwork\n\t\tresult.Properties.ManagedVirtualNetwork = &managedVirtualNetwork\n\t}\n\tif workspace.ManagedVirtualNetworkSettings != nil {\n\t\tmanagedVirtualNetworkSettings_ARM, err := (*workspace.ManagedVirtualNetworkSettings).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tmanagedVirtualNetworkSettings := *managedVirtualNetworkSettings_ARM.(*ManagedVirtualNetworkSettings_ARM)\n\t\tresult.Properties.ManagedVirtualNetworkSettings = &managedVirtualNetworkSettings\n\t}\n\tif workspace.PublicNetworkAccess != nil {\n\t\tpublicNetworkAccess := *workspace.PublicNetworkAccess\n\t\tresult.Properties.PublicNetworkAccess = &publicNetworkAccess\n\t}\n\tif workspace.PurviewConfiguration != nil {\n\t\tpurviewConfiguration_ARM, err := (*workspace.PurviewConfiguration).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tpurviewConfiguration := *purviewConfiguration_ARM.(*PurviewConfiguration_ARM)\n\t\tresult.Properties.PurviewConfiguration = &purviewConfiguration\n\t}\n\tif workspace.SqlAdministratorLogin != nil {\n\t\tsqlAdministratorLogin := *workspace.SqlAdministratorLogin\n\t\tresult.Properties.SqlAdministratorLogin = &sqlAdministratorLogin\n\t}\n\tif workspace.SqlAdministratorLoginPassword != nil {\n\t\tsqlAdministratorLoginPasswordSecret, err := resolved.ResolvedSecrets.Lookup(*workspace.SqlAdministratorLoginPassword)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"looking up secret for property SqlAdministratorLoginPassword\")\n\t\t}\n\t\tsqlAdministratorLoginPassword := sqlAdministratorLoginPasswordSecret\n\t\tresult.Properties.SqlAdministratorLoginPassword = &sqlAdministratorLoginPassword\n\t}\n\tif workspace.TrustedServiceBypassEnabled != nil {\n\t\ttrustedServiceBypassEnabled := *workspace.TrustedServiceBypassEnabled\n\t\tresult.Properties.TrustedServiceBypassEnabled = &trustedServiceBypassEnabled\n\t}\n\tif workspace.VirtualNetworkProfile != nil {\n\t\tvirtualNetworkProfile_ARM, err := (*workspace.VirtualNetworkProfile).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tvirtualNetworkProfile := *virtualNetworkProfile_ARM.(*VirtualNetworkProfile_ARM)\n\t\tresult.Properties.VirtualNetworkProfile = &virtualNetworkProfile\n\t}\n\tif workspace.WorkspaceRepositoryConfiguration != nil {\n\t\tworkspaceRepositoryConfiguration_ARM, err := (*workspace.WorkspaceRepositoryConfiguration).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tworkspaceRepositoryConfiguration := *workspaceRepositoryConfiguration_ARM.(*WorkspaceRepositoryConfiguration_ARM)\n\t\tresult.Properties.WorkspaceRepositoryConfiguration = &workspaceRepositoryConfiguration\n\t}\n\n\t// Set property \"Tags\":\n\tif workspace.Tags != nil {\n\t\tresult.Tags = make(map[string]string, len(workspace.Tags))\n\t\tfor key, value := range workspace.Tags {\n\t\t\tresult.Tags[key] = value\n\t\t}\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "3a1e5152ce53ed0968e485f6734d046d", "score": "0.6802113", "text": "func (reference *ApiEntityReference) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif reference == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &ApiEntityReference_ARM{}\n\n\t// Set property \"Id\":\n\tif reference.Reference != nil {\n\t\treferenceARMID, err := resolved.ResolvedReferences.Lookup(*reference.Reference)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treference1 := referenceARMID\n\t\tresult.Id = &reference1\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "cd5d4853b1f32de1a5ee159f2ee19e8e", "score": "0.6798952", "text": "func (snapshot *Snapshot_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif snapshot == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &Snapshot_Spec_ARM{}\n\n\t// Set property \"ExtendedLocation\":\n\tif snapshot.ExtendedLocation != nil {\n\t\textendedLocation_ARM, err := (*snapshot.ExtendedLocation).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\textendedLocation := *extendedLocation_ARM.(*ExtendedLocation_ARM)\n\t\tresult.ExtendedLocation = &extendedLocation\n\t}\n\n\t// Set property \"Location\":\n\tif snapshot.Location != nil {\n\t\tlocation := *snapshot.Location\n\t\tresult.Location = &location\n\t}\n\n\t// Set property \"Name\":\n\tresult.Name = resolved.Name\n\n\t// Set property \"Properties\":\n\tif snapshot.CreationData != nil ||\n\t\tsnapshot.DiskAccessReference != nil ||\n\t\tsnapshot.DiskSizeGB != nil ||\n\t\tsnapshot.DiskState != nil ||\n\t\tsnapshot.Encryption != nil ||\n\t\tsnapshot.EncryptionSettingsCollection != nil ||\n\t\tsnapshot.HyperVGeneration != nil ||\n\t\tsnapshot.Incremental != nil ||\n\t\tsnapshot.NetworkAccessPolicy != nil ||\n\t\tsnapshot.OsType != nil ||\n\t\tsnapshot.PurchasePlan != nil {\n\t\tresult.Properties = &SnapshotProperties_ARM{}\n\t}\n\tif snapshot.CreationData != nil {\n\t\tcreationData_ARM, err := (*snapshot.CreationData).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcreationData := *creationData_ARM.(*CreationData_ARM)\n\t\tresult.Properties.CreationData = &creationData\n\t}\n\tif snapshot.DiskAccessReference != nil {\n\t\tdiskAccessIdARMID, err := resolved.ResolvedReferences.Lookup(*snapshot.DiskAccessReference)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdiskAccessId := diskAccessIdARMID\n\t\tresult.Properties.DiskAccessId = &diskAccessId\n\t}\n\tif snapshot.DiskSizeGB != nil {\n\t\tdiskSizeGB := *snapshot.DiskSizeGB\n\t\tresult.Properties.DiskSizeGB = &diskSizeGB\n\t}\n\tif snapshot.DiskState != nil {\n\t\tdiskState := *snapshot.DiskState\n\t\tresult.Properties.DiskState = &diskState\n\t}\n\tif snapshot.Encryption != nil {\n\t\tencryption_ARM, err := (*snapshot.Encryption).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tencryption := *encryption_ARM.(*Encryption_ARM)\n\t\tresult.Properties.Encryption = &encryption\n\t}\n\tif snapshot.EncryptionSettingsCollection != nil {\n\t\tencryptionSettingsCollection_ARM, err := (*snapshot.EncryptionSettingsCollection).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tencryptionSettingsCollection := *encryptionSettingsCollection_ARM.(*EncryptionSettingsCollection_ARM)\n\t\tresult.Properties.EncryptionSettingsCollection = &encryptionSettingsCollection\n\t}\n\tif snapshot.HyperVGeneration != nil {\n\t\thyperVGeneration := *snapshot.HyperVGeneration\n\t\tresult.Properties.HyperVGeneration = &hyperVGeneration\n\t}\n\tif snapshot.Incremental != nil {\n\t\tincremental := *snapshot.Incremental\n\t\tresult.Properties.Incremental = &incremental\n\t}\n\tif snapshot.NetworkAccessPolicy != nil {\n\t\tnetworkAccessPolicy := *snapshot.NetworkAccessPolicy\n\t\tresult.Properties.NetworkAccessPolicy = &networkAccessPolicy\n\t}\n\tif snapshot.OsType != nil {\n\t\tosType := *snapshot.OsType\n\t\tresult.Properties.OsType = &osType\n\t}\n\tif snapshot.PurchasePlan != nil {\n\t\tpurchasePlan_ARM, err := (*snapshot.PurchasePlan).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tpurchasePlan := *purchasePlan_ARM.(*PurchasePlan_ARM)\n\t\tresult.Properties.PurchasePlan = &purchasePlan\n\t}\n\n\t// Set property \"Sku\":\n\tif snapshot.Sku != nil {\n\t\tsku_ARM, err := (*snapshot.Sku).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tsku := *sku_ARM.(*SnapshotSku_ARM)\n\t\tresult.Sku = &sku\n\t}\n\n\t// Set property \"Tags\":\n\tif snapshot.Tags != nil {\n\t\tresult.Tags = make(map[string]string, len(snapshot.Tags))\n\t\tfor key, value := range snapshot.Tags {\n\t\t\tresult.Tags[key] = value\n\t\t}\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "c2f361f1450348a8eda0d0c71fde5d54", "score": "0.67884076", "text": "func (workspace *Workspace_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif workspace == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &Workspace_Spec_ARM{}\n\n\t// Set property \"Etag\":\n\tif workspace.Etag != nil {\n\t\tetag := *workspace.Etag\n\t\tresult.Etag = &etag\n\t}\n\n\t// Set property \"Location\":\n\tif workspace.Location != nil {\n\t\tlocation := *workspace.Location\n\t\tresult.Location = &location\n\t}\n\n\t// Set property \"Name\":\n\tresult.Name = resolved.Name\n\n\t// Set property \"Properties\":\n\tif workspace.Features != nil ||\n\t\tworkspace.ForceCmkForQuery != nil ||\n\t\tworkspace.ProvisioningState != nil ||\n\t\tworkspace.PublicNetworkAccessForIngestion != nil ||\n\t\tworkspace.PublicNetworkAccessForQuery != nil ||\n\t\tworkspace.RetentionInDays != nil ||\n\t\tworkspace.Sku != nil ||\n\t\tworkspace.WorkspaceCapping != nil {\n\t\tresult.Properties = &WorkspaceProperties_ARM{}\n\t}\n\tif workspace.Features != nil {\n\t\tfeatures_ARM, err := (*workspace.Features).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfeatures := *features_ARM.(*WorkspaceFeatures_ARM)\n\t\tresult.Properties.Features = &features\n\t}\n\tif workspace.ForceCmkForQuery != nil {\n\t\tforceCmkForQuery := *workspace.ForceCmkForQuery\n\t\tresult.Properties.ForceCmkForQuery = &forceCmkForQuery\n\t}\n\tif workspace.ProvisioningState != nil {\n\t\tprovisioningState := *workspace.ProvisioningState\n\t\tresult.Properties.ProvisioningState = &provisioningState\n\t}\n\tif workspace.PublicNetworkAccessForIngestion != nil {\n\t\tpublicNetworkAccessForIngestion := *workspace.PublicNetworkAccessForIngestion\n\t\tresult.Properties.PublicNetworkAccessForIngestion = &publicNetworkAccessForIngestion\n\t}\n\tif workspace.PublicNetworkAccessForQuery != nil {\n\t\tpublicNetworkAccessForQuery := *workspace.PublicNetworkAccessForQuery\n\t\tresult.Properties.PublicNetworkAccessForQuery = &publicNetworkAccessForQuery\n\t}\n\tif workspace.RetentionInDays != nil {\n\t\tretentionInDays := *workspace.RetentionInDays\n\t\tresult.Properties.RetentionInDays = &retentionInDays\n\t}\n\tif workspace.Sku != nil {\n\t\tsku_ARM, err := (*workspace.Sku).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tsku := *sku_ARM.(*WorkspaceSku_ARM)\n\t\tresult.Properties.Sku = &sku\n\t}\n\tif workspace.WorkspaceCapping != nil {\n\t\tworkspaceCapping_ARM, err := (*workspace.WorkspaceCapping).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tworkspaceCapping := *workspaceCapping_ARM.(*WorkspaceCapping_ARM)\n\t\tresult.Properties.WorkspaceCapping = &workspaceCapping\n\t}\n\n\t// Set property \"Tags\":\n\tif workspace.Tags != nil {\n\t\tresult.Tags = make(map[string]string, len(workspace.Tags))\n\t\tfor key, value := range workspace.Tags {\n\t\t\tresult.Tags[key] = value\n\t\t}\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "033a02d9471fb1d8a33215349a5fc4ee", "score": "0.67707264", "text": "func (resource *SubResource) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif resource == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &SubResource_ARM{}\n\n\t// Set property \"Id\":\n\tif resource.Reference != nil {\n\t\treferenceARMID, err := resolved.ResolvedReferences.Lookup(*resource.Reference)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treference := referenceARMID\n\t\tresult.Id = &reference\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "033a02d9471fb1d8a33215349a5fc4ee", "score": "0.67707264", "text": "func (resource *SubResource) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif resource == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &SubResource_ARM{}\n\n\t// Set property \"Id\":\n\tif resource.Reference != nil {\n\t\treferenceARMID, err := resolved.ResolvedReferences.Lookup(*resource.Reference)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treference := referenceARMID\n\t\tresult.Id = &reference\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "cce086911e9ab1dd33deafd3c111e287", "score": "0.6759869", "text": "func (shot *ManagementPolicySnapShot) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif shot == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &ManagementPolicySnapShot_ARM{}\n\n\t// Set property \"Delete\":\n\tif shot.Delete != nil {\n\t\tdelete_ARM, err := (*shot.Delete).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdelete := *delete_ARM.(*DateAfterCreation_ARM)\n\t\tresult.Delete = &delete\n\t}\n\n\t// Set property \"TierToArchive\":\n\tif shot.TierToArchive != nil {\n\t\ttierToArchive_ARM, err := (*shot.TierToArchive).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\ttierToArchive := *tierToArchive_ARM.(*DateAfterCreation_ARM)\n\t\tresult.TierToArchive = &tierToArchive\n\t}\n\n\t// Set property \"TierToCool\":\n\tif shot.TierToCool != nil {\n\t\ttierToCool_ARM, err := (*shot.TierToCool).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\ttierToCool := *tierToCool_ARM.(*DateAfterCreation_ARM)\n\t\tresult.TierToCool = &tierToCool\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "0cdad2d8c0b27bc4eb3b7861ab425e30", "score": "0.67519313", "text": "func (filter *TagFilter) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif filter == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &TagFilter_ARM{}\n\n\t// Set property \"Name\":\n\tif filter.Name != nil {\n\t\tname := *filter.Name\n\t\tresult.Name = &name\n\t}\n\n\t// Set property \"Op\":\n\tif filter.Op != nil {\n\t\top := *filter.Op\n\t\tresult.Op = &op\n\t}\n\n\t// Set property \"Value\":\n\tif filter.Value != nil {\n\t\tvalue := *filter.Value\n\t\tresult.Value = &value\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "903d16b8555f8ad64914ccdcc66c76d7", "score": "0.6749218", "text": "func (record *ARecord) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif record == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &ARecord_ARM{}\n\n\t// Set property \"Ipv4Address\":\n\tif record.Ipv4Address != nil {\n\t\tipv4Address := *record.Ipv4Address\n\t\tresult.Ipv4Address = &ipv4Address\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "a3c849992a2a18e5488750e5f934a8d5", "score": "0.67435604", "text": "func (workspaceSku *WorkspaceSku) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif workspaceSku == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &WorkspaceSku_ARM{}\n\n\t// Set property \"CapacityReservationLevel\":\n\tif workspaceSku.CapacityReservationLevel != nil {\n\t\tcapacityReservationLevel := *workspaceSku.CapacityReservationLevel\n\t\tresult.CapacityReservationLevel = &capacityReservationLevel\n\t}\n\n\t// Set property \"Name\":\n\tif workspaceSku.Name != nil {\n\t\tname := *workspaceSku.Name\n\t\tresult.Name = &name\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "b1dd05ee9c91825a02186dfbcc174295", "score": "0.6734721", "text": "func (policy *StorageAccounts_ManagementPolicy_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif policy == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &StorageAccounts_ManagementPolicy_Spec_ARM{}\n\n\t// Set property \"Name\":\n\tresult.Name = resolved.Name\n\n\t// Set property \"Properties\":\n\tif policy.Policy != nil {\n\t\tresult.Properties = &ManagementPolicyProperties_ARM{}\n\t}\n\tif policy.Policy != nil {\n\t\tpolicy_ARM, err := (*policy.Policy).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tpolicy1 := *policy_ARM.(*ManagementPolicySchema_ARM)\n\t\tresult.Properties.Policy = &policy1\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "29be646941bd1f854771164f52d7ca96", "score": "0.6706634", "text": "func (rule *ManagementPolicyRule) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif rule == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &ManagementPolicyRule_ARM{}\n\n\t// Set property \"Definition\":\n\tif rule.Definition != nil {\n\t\tdefinition_ARM, err := (*rule.Definition).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdefinition := *definition_ARM.(*ManagementPolicyDefinition_ARM)\n\t\tresult.Definition = &definition\n\t}\n\n\t// Set property \"Enabled\":\n\tif rule.Enabled != nil {\n\t\tenabled := *rule.Enabled\n\t\tresult.Enabled = &enabled\n\t}\n\n\t// Set property \"Name\":\n\tif rule.Name != nil {\n\t\tname := *rule.Name\n\t\tresult.Name = &name\n\t}\n\n\t// Set property \"Type\":\n\tif rule.Type != nil {\n\t\ttypeVar := *rule.Type\n\t\tresult.Type = &typeVar\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "33bb893a099adc55cd6179ee34906183", "score": "0.67036945", "text": "func (details *EncryptionDetails) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif details == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &EncryptionDetails_ARM{}\n\n\t// Set property \"Cmk\":\n\tif details.Cmk != nil {\n\t\tcmk_ARM, err := (*details.Cmk).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcmk := *cmk_ARM.(*CustomerManagedKeyDetails_ARM)\n\t\tresult.Cmk = &cmk\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "095a4dd0cdbc21cdeb1298d1e06b9767", "score": "0.66950345", "text": "func (blob *ManagementPolicyBaseBlob) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif blob == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &ManagementPolicyBaseBlob_ARM{}\n\n\t// Set property \"Delete\":\n\tif blob.Delete != nil {\n\t\tdelete_ARM, err := (*blob.Delete).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdelete := *delete_ARM.(*DateAfterModification_ARM)\n\t\tresult.Delete = &delete\n\t}\n\n\t// Set property \"EnableAutoTierToHotFromCool\":\n\tif blob.EnableAutoTierToHotFromCool != nil {\n\t\tenableAutoTierToHotFromCool := *blob.EnableAutoTierToHotFromCool\n\t\tresult.EnableAutoTierToHotFromCool = &enableAutoTierToHotFromCool\n\t}\n\n\t// Set property \"TierToArchive\":\n\tif blob.TierToArchive != nil {\n\t\ttierToArchive_ARM, err := (*blob.TierToArchive).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\ttierToArchive := *tierToArchive_ARM.(*DateAfterModification_ARM)\n\t\tresult.TierToArchive = &tierToArchive\n\t}\n\n\t// Set property \"TierToCool\":\n\tif blob.TierToCool != nil {\n\t\ttierToCool_ARM, err := (*blob.TierToCool).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\ttierToCool := *tierToCool_ARM.(*DateAfterModification_ARM)\n\t\tresult.TierToCool = &tierToCool\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "37a03b43a8c60c173dcc0bba73e2762f", "score": "0.667704", "text": "func (pool *ManagedClusters_AgentPool_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif pool == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &ManagedClusters_AgentPool_Spec_ARM{}\n\n\t// Set property \"Name\":\n\tresult.Name = resolved.Name\n\n\t// Set property \"Properties\":\n\tif pool.AvailabilityZones != nil ||\n\t\tpool.Count != nil ||\n\t\tpool.EnableAutoScaling != nil ||\n\t\tpool.EnableEncryptionAtHost != nil ||\n\t\tpool.EnableFIPS != nil ||\n\t\tpool.EnableNodePublicIP != nil ||\n\t\tpool.EnableUltraSSD != nil ||\n\t\tpool.GpuInstanceProfile != nil ||\n\t\tpool.KubeletConfig != nil ||\n\t\tpool.KubeletDiskType != nil ||\n\t\tpool.LinuxOSConfig != nil ||\n\t\tpool.MaxCount != nil ||\n\t\tpool.MaxPods != nil ||\n\t\tpool.MinCount != nil ||\n\t\tpool.Mode != nil ||\n\t\tpool.NodeLabels != nil ||\n\t\tpool.NodePublicIPPrefixIDReference != nil ||\n\t\tpool.NodeTaints != nil ||\n\t\tpool.OrchestratorVersion != nil ||\n\t\tpool.OsDiskSizeGB != nil ||\n\t\tpool.OsDiskType != nil ||\n\t\tpool.OsSKU != nil ||\n\t\tpool.OsType != nil ||\n\t\tpool.PodSubnetIDReference != nil ||\n\t\tpool.ProximityPlacementGroupID != nil ||\n\t\tpool.ScaleSetEvictionPolicy != nil ||\n\t\tpool.ScaleSetPriority != nil ||\n\t\tpool.SpotMaxPrice != nil ||\n\t\tpool.Tags != nil ||\n\t\tpool.Type != nil ||\n\t\tpool.UpgradeSettings != nil ||\n\t\tpool.VmSize != nil ||\n\t\tpool.VnetSubnetIDReference != nil {\n\t\tresult.Properties = &ManagedClusterAgentPoolProfileProperties_ARM{}\n\t}\n\tfor _, item := range pool.AvailabilityZones {\n\t\tresult.Properties.AvailabilityZones = append(result.Properties.AvailabilityZones, item)\n\t}\n\tif pool.Count != nil {\n\t\tcount := *pool.Count\n\t\tresult.Properties.Count = &count\n\t}\n\tif pool.EnableAutoScaling != nil {\n\t\tenableAutoScaling := *pool.EnableAutoScaling\n\t\tresult.Properties.EnableAutoScaling = &enableAutoScaling\n\t}\n\tif pool.EnableEncryptionAtHost != nil {\n\t\tenableEncryptionAtHost := *pool.EnableEncryptionAtHost\n\t\tresult.Properties.EnableEncryptionAtHost = &enableEncryptionAtHost\n\t}\n\tif pool.EnableFIPS != nil {\n\t\tenableFIPS := *pool.EnableFIPS\n\t\tresult.Properties.EnableFIPS = &enableFIPS\n\t}\n\tif pool.EnableNodePublicIP != nil {\n\t\tenableNodePublicIP := *pool.EnableNodePublicIP\n\t\tresult.Properties.EnableNodePublicIP = &enableNodePublicIP\n\t}\n\tif pool.EnableUltraSSD != nil {\n\t\tenableUltraSSD := *pool.EnableUltraSSD\n\t\tresult.Properties.EnableUltraSSD = &enableUltraSSD\n\t}\n\tif pool.GpuInstanceProfile != nil {\n\t\tgpuInstanceProfile := *pool.GpuInstanceProfile\n\t\tresult.Properties.GpuInstanceProfile = &gpuInstanceProfile\n\t}\n\tif pool.KubeletConfig != nil {\n\t\tkubeletConfig_ARM, err := (*pool.KubeletConfig).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tkubeletConfig := *kubeletConfig_ARM.(*KubeletConfig_ARM)\n\t\tresult.Properties.KubeletConfig = &kubeletConfig\n\t}\n\tif pool.KubeletDiskType != nil {\n\t\tkubeletDiskType := *pool.KubeletDiskType\n\t\tresult.Properties.KubeletDiskType = &kubeletDiskType\n\t}\n\tif pool.LinuxOSConfig != nil {\n\t\tlinuxOSConfig_ARM, err := (*pool.LinuxOSConfig).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tlinuxOSConfig := *linuxOSConfig_ARM.(*LinuxOSConfig_ARM)\n\t\tresult.Properties.LinuxOSConfig = &linuxOSConfig\n\t}\n\tif pool.MaxCount != nil {\n\t\tmaxCount := *pool.MaxCount\n\t\tresult.Properties.MaxCount = &maxCount\n\t}\n\tif pool.MaxPods != nil {\n\t\tmaxPods := *pool.MaxPods\n\t\tresult.Properties.MaxPods = &maxPods\n\t}\n\tif pool.MinCount != nil {\n\t\tminCount := *pool.MinCount\n\t\tresult.Properties.MinCount = &minCount\n\t}\n\tif pool.Mode != nil {\n\t\tmode := *pool.Mode\n\t\tresult.Properties.Mode = &mode\n\t}\n\tif pool.NodeLabels != nil {\n\t\tresult.Properties.NodeLabels = make(map[string]string, len(pool.NodeLabels))\n\t\tfor key, value := range pool.NodeLabels {\n\t\t\tresult.Properties.NodeLabels[key] = value\n\t\t}\n\t}\n\tif pool.NodePublicIPPrefixIDReference != nil {\n\t\tnodePublicIPPrefixIDARMID, err := resolved.ResolvedReferences.Lookup(*pool.NodePublicIPPrefixIDReference)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnodePublicIPPrefixID := nodePublicIPPrefixIDARMID\n\t\tresult.Properties.NodePublicIPPrefixID = &nodePublicIPPrefixID\n\t}\n\tfor _, item := range pool.NodeTaints {\n\t\tresult.Properties.NodeTaints = append(result.Properties.NodeTaints, item)\n\t}\n\tif pool.OrchestratorVersion != nil {\n\t\torchestratorVersion := *pool.OrchestratorVersion\n\t\tresult.Properties.OrchestratorVersion = &orchestratorVersion\n\t}\n\tif pool.OsDiskSizeGB != nil {\n\t\tosDiskSizeGB := *pool.OsDiskSizeGB\n\t\tresult.Properties.OsDiskSizeGB = &osDiskSizeGB\n\t}\n\tif pool.OsDiskType != nil {\n\t\tosDiskType := *pool.OsDiskType\n\t\tresult.Properties.OsDiskType = &osDiskType\n\t}\n\tif pool.OsSKU != nil {\n\t\tosSKU := *pool.OsSKU\n\t\tresult.Properties.OsSKU = &osSKU\n\t}\n\tif pool.OsType != nil {\n\t\tosType := *pool.OsType\n\t\tresult.Properties.OsType = &osType\n\t}\n\tif pool.PodSubnetIDReference != nil {\n\t\tpodSubnetIDARMID, err := resolved.ResolvedReferences.Lookup(*pool.PodSubnetIDReference)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tpodSubnetID := podSubnetIDARMID\n\t\tresult.Properties.PodSubnetID = &podSubnetID\n\t}\n\tif pool.ProximityPlacementGroupID != nil {\n\t\tproximityPlacementGroupID := *pool.ProximityPlacementGroupID\n\t\tresult.Properties.ProximityPlacementGroupID = &proximityPlacementGroupID\n\t}\n\tif pool.ScaleSetEvictionPolicy != nil {\n\t\tscaleSetEvictionPolicy := *pool.ScaleSetEvictionPolicy\n\t\tresult.Properties.ScaleSetEvictionPolicy = &scaleSetEvictionPolicy\n\t}\n\tif pool.ScaleSetPriority != nil {\n\t\tscaleSetPriority := *pool.ScaleSetPriority\n\t\tresult.Properties.ScaleSetPriority = &scaleSetPriority\n\t}\n\tif pool.SpotMaxPrice != nil {\n\t\tspotMaxPrice := *pool.SpotMaxPrice\n\t\tresult.Properties.SpotMaxPrice = &spotMaxPrice\n\t}\n\tif pool.Tags != nil {\n\t\tresult.Properties.Tags = make(map[string]string, len(pool.Tags))\n\t\tfor key, value := range pool.Tags {\n\t\t\tresult.Properties.Tags[key] = value\n\t\t}\n\t}\n\tif pool.Type != nil {\n\t\ttypeVar := *pool.Type\n\t\tresult.Properties.Type = &typeVar\n\t}\n\tif pool.UpgradeSettings != nil {\n\t\tupgradeSettings_ARM, err := (*pool.UpgradeSettings).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tupgradeSettings := *upgradeSettings_ARM.(*AgentPoolUpgradeSettings_ARM)\n\t\tresult.Properties.UpgradeSettings = &upgradeSettings\n\t}\n\tif pool.VmSize != nil {\n\t\tvmSize := *pool.VmSize\n\t\tresult.Properties.VmSize = &vmSize\n\t}\n\tif pool.VnetSubnetIDReference != nil {\n\t\tvnetSubnetIDARMID, err := resolved.ResolvedReferences.Lookup(*pool.VnetSubnetIDReference)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tvnetSubnetID := vnetSubnetIDARMID\n\t\tresult.Properties.VnetSubnetID = &vnetSubnetID\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "80541f1611e24df503238bd3d1b90fac", "score": "0.6674448", "text": "func (sku *Sku) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif sku == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &Sku_ARM{}\n\n\t// Set property \"Capacity\":\n\tif sku.Capacity != nil {\n\t\tcapacity := *sku.Capacity\n\t\tresult.Capacity = &capacity\n\t}\n\n\t// Set property \"Name\":\n\tif sku.Name != nil {\n\t\tname := *sku.Name\n\t\tresult.Name = &name\n\t}\n\n\t// Set property \"Tier\":\n\tif sku.Tier != nil {\n\t\ttier := *sku.Tier\n\t\tresult.Tier = &tier\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "80541f1611e24df503238bd3d1b90fac", "score": "0.6674448", "text": "func (sku *Sku) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif sku == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &Sku_ARM{}\n\n\t// Set property \"Capacity\":\n\tif sku.Capacity != nil {\n\t\tcapacity := *sku.Capacity\n\t\tresult.Capacity = &capacity\n\t}\n\n\t// Set property \"Name\":\n\tif sku.Name != nil {\n\t\tname := *sku.Name\n\t\tresult.Name = &name\n\t}\n\n\t// Set property \"Tier\":\n\tif sku.Tier != nil {\n\t\ttier := *sku.Tier\n\t\tresult.Tier = &tier\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "9d36c73260e1313e6d5d738b048ad6a9", "score": "0.6672098", "text": "func (aaaa *PrivateDnsZones_AAAA_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif aaaa == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &PrivateDnsZones_AAAA_Spec_ARM{}\n\n\t// Set property \"Etag\":\n\tif aaaa.Etag != nil {\n\t\tetag := *aaaa.Etag\n\t\tresult.Etag = &etag\n\t}\n\n\t// Set property \"Name\":\n\tresult.Name = resolved.Name\n\n\t// Set property \"Properties\":\n\tif aaaa.ARecords != nil ||\n\t\taaaa.AaaaRecords != nil ||\n\t\taaaa.CnameRecord != nil ||\n\t\taaaa.Metadata != nil ||\n\t\taaaa.MxRecords != nil ||\n\t\taaaa.PtrRecords != nil ||\n\t\taaaa.SoaRecord != nil ||\n\t\taaaa.SrvRecords != nil ||\n\t\taaaa.Ttl != nil ||\n\t\taaaa.TxtRecords != nil {\n\t\tresult.Properties = &RecordSetProperties_ARM{}\n\t}\n\tfor _, item := range aaaa.ARecords {\n\t\titem_ARM, err := item.ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult.Properties.ARecords = append(result.Properties.ARecords, *item_ARM.(*ARecord_ARM))\n\t}\n\tfor _, item := range aaaa.AaaaRecords {\n\t\titem_ARM, err := item.ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult.Properties.AaaaRecords = append(result.Properties.AaaaRecords, *item_ARM.(*AaaaRecord_ARM))\n\t}\n\tif aaaa.CnameRecord != nil {\n\t\tcnameRecord_ARM, err := (*aaaa.CnameRecord).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcnameRecord := *cnameRecord_ARM.(*CnameRecord_ARM)\n\t\tresult.Properties.CnameRecord = &cnameRecord\n\t}\n\tif aaaa.Metadata != nil {\n\t\tresult.Properties.Metadata = make(map[string]string, len(aaaa.Metadata))\n\t\tfor key, value := range aaaa.Metadata {\n\t\t\tresult.Properties.Metadata[key] = value\n\t\t}\n\t}\n\tfor _, item := range aaaa.MxRecords {\n\t\titem_ARM, err := item.ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult.Properties.MxRecords = append(result.Properties.MxRecords, *item_ARM.(*MxRecord_ARM))\n\t}\n\tfor _, item := range aaaa.PtrRecords {\n\t\titem_ARM, err := item.ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult.Properties.PtrRecords = append(result.Properties.PtrRecords, *item_ARM.(*PtrRecord_ARM))\n\t}\n\tif aaaa.SoaRecord != nil {\n\t\tsoaRecord_ARM, err := (*aaaa.SoaRecord).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tsoaRecord := *soaRecord_ARM.(*SoaRecord_ARM)\n\t\tresult.Properties.SoaRecord = &soaRecord\n\t}\n\tfor _, item := range aaaa.SrvRecords {\n\t\titem_ARM, err := item.ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult.Properties.SrvRecords = append(result.Properties.SrvRecords, *item_ARM.(*SrvRecord_ARM))\n\t}\n\tif aaaa.Ttl != nil {\n\t\tttl := *aaaa.Ttl\n\t\tresult.Properties.Ttl = &ttl\n\t}\n\tfor _, item := range aaaa.TxtRecords {\n\t\titem_ARM, err := item.ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult.Properties.TxtRecords = append(result.Properties.TxtRecords, *item_ARM.(*TxtRecord_ARM))\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "a373782d6a89822a0a7bdb4db7b4c958", "score": "0.66660744", "text": "func (configuration *PurviewConfiguration) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif configuration == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &PurviewConfiguration_ARM{}\n\n\t// Set property \"PurviewResourceId\":\n\tif configuration.PurviewResourceReference != nil {\n\t\tpurviewResourceReferenceARMID, err := resolved.ResolvedReferences.Lookup(*configuration.PurviewResourceReference)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tpurviewResourceReference := purviewResourceReferenceARMID\n\t\tresult.PurviewResourceId = &purviewResourceReference\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "24ddbbfa76b104d8b041f039260e56a7", "score": "0.66444427", "text": "func (record *SrvRecord) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif record == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &SrvRecord_ARM{}\n\n\t// Set property \"Port\":\n\tif record.Port != nil {\n\t\tport := *record.Port\n\t\tresult.Port = &port\n\t}\n\n\t// Set property \"Priority\":\n\tif record.Priority != nil {\n\t\tpriority := *record.Priority\n\t\tresult.Priority = &priority\n\t}\n\n\t// Set property \"Target\":\n\tif record.Target != nil {\n\t\ttarget := *record.Target\n\t\tresult.Target = &target\n\t}\n\n\t// Set property \"Weight\":\n\tif record.Weight != nil {\n\t\tweight := *record.Weight\n\t\tresult.Weight = &weight\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "cf9385094f72cd5e5b11fc2b47d71ca8", "score": "0.66325325", "text": "func (configuration *VirtualMachineScaleSetNetworkConfiguration) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif configuration == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &VirtualMachineScaleSetNetworkConfiguration_ARM{}\n\n\t// Set property \"Id\":\n\tif configuration.Reference != nil {\n\t\treferenceARMID, err := resolved.ResolvedReferences.Lookup(*configuration.Reference)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treference := referenceARMID\n\t\tresult.Id = &reference\n\t}\n\n\t// Set property \"Name\":\n\tif configuration.Name != nil {\n\t\tname := *configuration.Name\n\t\tresult.Name = &name\n\t}\n\n\t// Set property \"Properties\":\n\tif configuration.DeleteOption != nil ||\n\t\tconfiguration.DnsSettings != nil ||\n\t\tconfiguration.EnableAcceleratedNetworking != nil ||\n\t\tconfiguration.EnableFpga != nil ||\n\t\tconfiguration.EnableIPForwarding != nil ||\n\t\tconfiguration.IpConfigurations != nil ||\n\t\tconfiguration.NetworkSecurityGroup != nil ||\n\t\tconfiguration.Primary != nil {\n\t\tresult.Properties = &VirtualMachineScaleSetNetworkConfigurationProperties_ARM{}\n\t}\n\tif configuration.DeleteOption != nil {\n\t\tdeleteOption := *configuration.DeleteOption\n\t\tresult.Properties.DeleteOption = &deleteOption\n\t}\n\tif configuration.DnsSettings != nil {\n\t\tdnsSettings_ARM, err := (*configuration.DnsSettings).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdnsSettings := *dnsSettings_ARM.(*VirtualMachineScaleSetNetworkConfigurationDnsSettings_ARM)\n\t\tresult.Properties.DnsSettings = &dnsSettings\n\t}\n\tif configuration.EnableAcceleratedNetworking != nil {\n\t\tenableAcceleratedNetworking := *configuration.EnableAcceleratedNetworking\n\t\tresult.Properties.EnableAcceleratedNetworking = &enableAcceleratedNetworking\n\t}\n\tif configuration.EnableFpga != nil {\n\t\tenableFpga := *configuration.EnableFpga\n\t\tresult.Properties.EnableFpga = &enableFpga\n\t}\n\tif configuration.EnableIPForwarding != nil {\n\t\tenableIPForwarding := *configuration.EnableIPForwarding\n\t\tresult.Properties.EnableIPForwarding = &enableIPForwarding\n\t}\n\tfor _, item := range configuration.IpConfigurations {\n\t\titem_ARM, err := item.ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult.Properties.IpConfigurations = append(result.Properties.IpConfigurations, *item_ARM.(*VirtualMachineScaleSetIPConfiguration_ARM))\n\t}\n\tif configuration.NetworkSecurityGroup != nil {\n\t\tnetworkSecurityGroup_ARM, err := (*configuration.NetworkSecurityGroup).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnetworkSecurityGroup := *networkSecurityGroup_ARM.(*SubResource_ARM)\n\t\tresult.Properties.NetworkSecurityGroup = &networkSecurityGroup\n\t}\n\tif configuration.Primary != nil {\n\t\tprimary := *configuration.Primary\n\t\tresult.Properties.Primary = &primary\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "4f9c99e45ba0dd1828f5ee0f7e080149", "score": "0.6632285", "text": "func (version *ManagementPolicyVersion) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif version == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &ManagementPolicyVersion_ARM{}\n\n\t// Set property \"Delete\":\n\tif version.Delete != nil {\n\t\tdelete_ARM, err := (*version.Delete).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdelete := *delete_ARM.(*DateAfterCreation_ARM)\n\t\tresult.Delete = &delete\n\t}\n\n\t// Set property \"TierToArchive\":\n\tif version.TierToArchive != nil {\n\t\ttierToArchive_ARM, err := (*version.TierToArchive).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\ttierToArchive := *tierToArchive_ARM.(*DateAfterCreation_ARM)\n\t\tresult.TierToArchive = &tierToArchive\n\t}\n\n\t// Set property \"TierToCool\":\n\tif version.TierToCool != nil {\n\t\ttierToCool_ARM, err := (*version.TierToCool).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\ttierToCool := *tierToCool_ARM.(*DateAfterCreation_ARM)\n\t\tresult.TierToCool = &tierToCool\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "12fc30f51746104a2b855bc761cdfe82", "score": "0.663136", "text": "func (record *AaaaRecord) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif record == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &AaaaRecord_ARM{}\n\n\t// Set property \"Ipv6Address\":\n\tif record.Ipv6Address != nil {\n\t\tipv6Address := *record.Ipv6Address\n\t\tresult.Ipv6Address = &ipv6Address\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "94efc618a718cb3e87398a7de1eeed51", "score": "0.6626346", "text": "func (settings *AutoscaleSettings) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif settings == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &AutoscaleSettings_ARM{}\n\n\t// Set property \"MaxThroughput\":\n\tif settings.MaxThroughput != nil {\n\t\tmaxThroughput := *settings.MaxThroughput\n\t\tresult.MaxThroughput = &maxThroughput\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "71d3519b02f9f63301b0a528d4e05053", "score": "0.66162324", "text": "func (snapshotSku *SnapshotSku) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif snapshotSku == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &SnapshotSku_ARM{}\n\n\t// Set property \"Name\":\n\tif snapshotSku.Name != nil {\n\t\tname := *snapshotSku.Name\n\t\tresult.Name = &name\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "ea16aebff45aa8858654a0f89ef0b7c2", "score": "0.66141135", "text": "func (profile *VirtualNetworkProfile) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif profile == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &VirtualNetworkProfile_ARM{}\n\n\t// Set property \"ComputeSubnetId\":\n\tif profile.ComputeSubnetId != nil {\n\t\tcomputeSubnetId := *profile.ComputeSubnetId\n\t\tresult.ComputeSubnetId = &computeSubnetId\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "ce65ff361f89db9d1d1d211349c132dc", "score": "0.66087294", "text": "func (binding *ManagedClusters_TrustedAccessRoleBinding_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif binding == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &ManagedClusters_TrustedAccessRoleBinding_Spec_ARM{}\n\n\t// Set property \"Name\":\n\tresult.Name = resolved.Name\n\n\t// Set property \"Properties\":\n\tif binding.Roles != nil || binding.SourceResourceReference != nil {\n\t\tresult.Properties = &TrustedAccessRoleBindingProperties_ARM{}\n\t}\n\tfor _, item := range binding.Roles {\n\t\tresult.Properties.Roles = append(result.Properties.Roles, item)\n\t}\n\tif binding.SourceResourceReference != nil {\n\t\tsourceResourceIdARMID, err := resolved.ResolvedReferences.Lookup(*binding.SourceResourceReference)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tsourceResourceId := sourceResourceIdARMID\n\t\tresult.Properties.SourceResourceId = &sourceResourceId\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "beb35f68fa55bc881ea12dde54b09445", "score": "0.6599723", "text": "func (group *DeepCreatedOriginGroup) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif group == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &DeepCreatedOriginGroup_ARM{}\n\n\t// Set property \"Name\":\n\tif group.Name != nil {\n\t\tname := *group.Name\n\t\tresult.Name = &name\n\t}\n\n\t// Set property \"Properties\":\n\tif group.HealthProbeSettings != nil ||\n\t\tgroup.Origins != nil ||\n\t\tgroup.ResponseBasedOriginErrorDetectionSettings != nil ||\n\t\tgroup.TrafficRestorationTimeToHealedOrNewEndpointsInMinutes != nil {\n\t\tresult.Properties = &DeepCreatedOriginGroupProperties_ARM{}\n\t}\n\tif group.HealthProbeSettings != nil {\n\t\thealthProbeSettings_ARM, err := (*group.HealthProbeSettings).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\thealthProbeSettings := *healthProbeSettings_ARM.(*HealthProbeParameters_ARM)\n\t\tresult.Properties.HealthProbeSettings = &healthProbeSettings\n\t}\n\tfor _, item := range group.Origins {\n\t\titem_ARM, err := item.ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult.Properties.Origins = append(result.Properties.Origins, *item_ARM.(*ResourceReference_ARM))\n\t}\n\tif group.ResponseBasedOriginErrorDetectionSettings != nil {\n\t\tresponseBasedOriginErrorDetectionSettings_ARM, err := (*group.ResponseBasedOriginErrorDetectionSettings).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresponseBasedOriginErrorDetectionSettings := *responseBasedOriginErrorDetectionSettings_ARM.(*ResponseBasedOriginErrorDetectionParameters_ARM)\n\t\tresult.Properties.ResponseBasedOriginErrorDetectionSettings = &responseBasedOriginErrorDetectionSettings\n\t}\n\tif group.TrafficRestorationTimeToHealedOrNewEndpointsInMinutes != nil {\n\t\ttrafficRestorationTimeToHealedOrNewEndpointsInMinutes := *group.TrafficRestorationTimeToHealedOrNewEndpointsInMinutes\n\t\tresult.Properties.TrafficRestorationTimeToHealedOrNewEndpointsInMinutes = &trafficRestorationTimeToHealedOrNewEndpointsInMinutes\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "beb35f68fa55bc881ea12dde54b09445", "score": "0.6599723", "text": "func (group *DeepCreatedOriginGroup) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif group == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &DeepCreatedOriginGroup_ARM{}\n\n\t// Set property \"Name\":\n\tif group.Name != nil {\n\t\tname := *group.Name\n\t\tresult.Name = &name\n\t}\n\n\t// Set property \"Properties\":\n\tif group.HealthProbeSettings != nil ||\n\t\tgroup.Origins != nil ||\n\t\tgroup.ResponseBasedOriginErrorDetectionSettings != nil ||\n\t\tgroup.TrafficRestorationTimeToHealedOrNewEndpointsInMinutes != nil {\n\t\tresult.Properties = &DeepCreatedOriginGroupProperties_ARM{}\n\t}\n\tif group.HealthProbeSettings != nil {\n\t\thealthProbeSettings_ARM, err := (*group.HealthProbeSettings).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\thealthProbeSettings := *healthProbeSettings_ARM.(*HealthProbeParameters_ARM)\n\t\tresult.Properties.HealthProbeSettings = &healthProbeSettings\n\t}\n\tfor _, item := range group.Origins {\n\t\titem_ARM, err := item.ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult.Properties.Origins = append(result.Properties.Origins, *item_ARM.(*ResourceReference_ARM))\n\t}\n\tif group.ResponseBasedOriginErrorDetectionSettings != nil {\n\t\tresponseBasedOriginErrorDetectionSettings_ARM, err := (*group.ResponseBasedOriginErrorDetectionSettings).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresponseBasedOriginErrorDetectionSettings := *responseBasedOriginErrorDetectionSettings_ARM.(*ResponseBasedOriginErrorDetectionParameters_ARM)\n\t\tresult.Properties.ResponseBasedOriginErrorDetectionSettings = &responseBasedOriginErrorDetectionSettings\n\t}\n\tif group.TrafficRestorationTimeToHealedOrNewEndpointsInMinutes != nil {\n\t\ttrafficRestorationTimeToHealedOrNewEndpointsInMinutes := *group.TrafficRestorationTimeToHealedOrNewEndpointsInMinutes\n\t\tresult.Properties.TrafficRestorationTimeToHealedOrNewEndpointsInMinutes = &trafficRestorationTimeToHealedOrNewEndpointsInMinutes\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "0ab6c0904fc3e8f6d2e0955e9fcc95d5", "score": "0.659167", "text": "func (identity *VirtualMachineScaleSetIdentity) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif identity == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &VirtualMachineScaleSetIdentity_ARM{}\n\n\t// Set property \"Type\":\n\tif identity.Type != nil {\n\t\ttypeVar := *identity.Type\n\t\tresult.Type = &typeVar\n\t}\n\n\t// Set property \"UserAssignedIdentities\":\n\tresult.UserAssignedIdentities = make(map[string]UserAssignedIdentityDetails_ARM, len(identity.UserAssignedIdentities))\n\tfor _, ident := range identity.UserAssignedIdentities {\n\t\tidentARMID, err := resolved.ResolvedReferences.Lookup(ident.Reference)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tkey := identARMID\n\t\tresult.UserAssignedIdentities[key] = UserAssignedIdentityDetails_ARM{}\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "5681bb6f860a591d4aa3abd0a1355954", "score": "0.65831584", "text": "func (encryption *Encryption) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif encryption == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &Encryption_ARM{}\n\n\t// Set property \"KeySource\":\n\tif encryption.KeySource != nil {\n\t\tkeySource := *encryption.KeySource\n\t\tresult.KeySource = &keySource\n\t}\n\n\t// Set property \"KeyVaultProperties\":\n\tfor _, item := range encryption.KeyVaultProperties {\n\t\titem_ARM, err := item.ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult.KeyVaultProperties = append(result.KeyVaultProperties, *item_ARM.(*KeyVaultProperties_ARM))\n\t}\n\n\t// Set property \"RequireInfrastructureEncryption\":\n\tif encryption.RequireInfrastructureEncryption != nil {\n\t\trequireInfrastructureEncryption := *encryption.RequireInfrastructureEncryption\n\t\tresult.RequireInfrastructureEncryption = &requireInfrastructureEncryption\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "10786bcf4d8c4e6342a1ba15c4be21bc", "score": "0.6582989", "text": "func (scaleSet *VirtualMachineScaleSet_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif scaleSet == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &VirtualMachineScaleSet_Spec_ARM{}\n\n\t// Set property \"ExtendedLocation\":\n\tif scaleSet.ExtendedLocation != nil {\n\t\textendedLocation_ARM, err := (*scaleSet.ExtendedLocation).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\textendedLocation := *extendedLocation_ARM.(*ExtendedLocation_ARM)\n\t\tresult.ExtendedLocation = &extendedLocation\n\t}\n\n\t// Set property \"Identity\":\n\tif scaleSet.Identity != nil {\n\t\tidentity_ARM, err := (*scaleSet.Identity).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tidentity := *identity_ARM.(*VirtualMachineScaleSetIdentity_ARM)\n\t\tresult.Identity = &identity\n\t}\n\n\t// Set property \"Location\":\n\tif scaleSet.Location != nil {\n\t\tlocation := *scaleSet.Location\n\t\tresult.Location = &location\n\t}\n\n\t// Set property \"Name\":\n\tresult.Name = resolved.Name\n\n\t// Set property \"Plan\":\n\tif scaleSet.Plan != nil {\n\t\tplan_ARM, err := (*scaleSet.Plan).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tplan := *plan_ARM.(*Plan_ARM)\n\t\tresult.Plan = &plan\n\t}\n\n\t// Set property \"Properties\":\n\tif scaleSet.AdditionalCapabilities != nil ||\n\t\tscaleSet.AutomaticRepairsPolicy != nil ||\n\t\tscaleSet.DoNotRunExtensionsOnOverprovisionedVMs != nil ||\n\t\tscaleSet.HostGroup != nil ||\n\t\tscaleSet.OrchestrationMode != nil ||\n\t\tscaleSet.Overprovision != nil ||\n\t\tscaleSet.PlatformFaultDomainCount != nil ||\n\t\tscaleSet.ProximityPlacementGroup != nil ||\n\t\tscaleSet.ScaleInPolicy != nil ||\n\t\tscaleSet.SinglePlacementGroup != nil ||\n\t\tscaleSet.SpotRestorePolicy != nil ||\n\t\tscaleSet.UpgradePolicy != nil ||\n\t\tscaleSet.VirtualMachineProfile != nil ||\n\t\tscaleSet.ZoneBalance != nil {\n\t\tresult.Properties = &VirtualMachineScaleSetProperties_ARM{}\n\t}\n\tif scaleSet.AdditionalCapabilities != nil {\n\t\tadditionalCapabilities_ARM, err := (*scaleSet.AdditionalCapabilities).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tadditionalCapabilities := *additionalCapabilities_ARM.(*AdditionalCapabilities_ARM)\n\t\tresult.Properties.AdditionalCapabilities = &additionalCapabilities\n\t}\n\tif scaleSet.AutomaticRepairsPolicy != nil {\n\t\tautomaticRepairsPolicy_ARM, err := (*scaleSet.AutomaticRepairsPolicy).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tautomaticRepairsPolicy := *automaticRepairsPolicy_ARM.(*AutomaticRepairsPolicy_ARM)\n\t\tresult.Properties.AutomaticRepairsPolicy = &automaticRepairsPolicy\n\t}\n\tif scaleSet.DoNotRunExtensionsOnOverprovisionedVMs != nil {\n\t\tdoNotRunExtensionsOnOverprovisionedVMs := *scaleSet.DoNotRunExtensionsOnOverprovisionedVMs\n\t\tresult.Properties.DoNotRunExtensionsOnOverprovisionedVMs = &doNotRunExtensionsOnOverprovisionedVMs\n\t}\n\tif scaleSet.HostGroup != nil {\n\t\thostGroup_ARM, err := (*scaleSet.HostGroup).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\thostGroup := *hostGroup_ARM.(*SubResource_ARM)\n\t\tresult.Properties.HostGroup = &hostGroup\n\t}\n\tif scaleSet.OrchestrationMode != nil {\n\t\torchestrationMode := *scaleSet.OrchestrationMode\n\t\tresult.Properties.OrchestrationMode = &orchestrationMode\n\t}\n\tif scaleSet.Overprovision != nil {\n\t\toverprovision := *scaleSet.Overprovision\n\t\tresult.Properties.Overprovision = &overprovision\n\t}\n\tif scaleSet.PlatformFaultDomainCount != nil {\n\t\tplatformFaultDomainCount := *scaleSet.PlatformFaultDomainCount\n\t\tresult.Properties.PlatformFaultDomainCount = &platformFaultDomainCount\n\t}\n\tif scaleSet.ProximityPlacementGroup != nil {\n\t\tproximityPlacementGroup_ARM, err := (*scaleSet.ProximityPlacementGroup).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tproximityPlacementGroup := *proximityPlacementGroup_ARM.(*SubResource_ARM)\n\t\tresult.Properties.ProximityPlacementGroup = &proximityPlacementGroup\n\t}\n\tif scaleSet.ScaleInPolicy != nil {\n\t\tscaleInPolicy_ARM, err := (*scaleSet.ScaleInPolicy).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tscaleInPolicy := *scaleInPolicy_ARM.(*ScaleInPolicy_ARM)\n\t\tresult.Properties.ScaleInPolicy = &scaleInPolicy\n\t}\n\tif scaleSet.SinglePlacementGroup != nil {\n\t\tsinglePlacementGroup := *scaleSet.SinglePlacementGroup\n\t\tresult.Properties.SinglePlacementGroup = &singlePlacementGroup\n\t}\n\tif scaleSet.SpotRestorePolicy != nil {\n\t\tspotRestorePolicy_ARM, err := (*scaleSet.SpotRestorePolicy).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tspotRestorePolicy := *spotRestorePolicy_ARM.(*SpotRestorePolicy_ARM)\n\t\tresult.Properties.SpotRestorePolicy = &spotRestorePolicy\n\t}\n\tif scaleSet.UpgradePolicy != nil {\n\t\tupgradePolicy_ARM, err := (*scaleSet.UpgradePolicy).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tupgradePolicy := *upgradePolicy_ARM.(*UpgradePolicy_ARM)\n\t\tresult.Properties.UpgradePolicy = &upgradePolicy\n\t}\n\tif scaleSet.VirtualMachineProfile != nil {\n\t\tvirtualMachineProfile_ARM, err := (*scaleSet.VirtualMachineProfile).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tvirtualMachineProfile := *virtualMachineProfile_ARM.(*VirtualMachineScaleSetVMProfile_ARM)\n\t\tresult.Properties.VirtualMachineProfile = &virtualMachineProfile\n\t}\n\tif scaleSet.ZoneBalance != nil {\n\t\tzoneBalance := *scaleSet.ZoneBalance\n\t\tresult.Properties.ZoneBalance = &zoneBalance\n\t}\n\n\t// Set property \"Sku\":\n\tif scaleSet.Sku != nil {\n\t\tsku_ARM, err := (*scaleSet.Sku).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tsku := *sku_ARM.(*Sku_ARM)\n\t\tresult.Sku = &sku\n\t}\n\n\t// Set property \"Tags\":\n\tif scaleSet.Tags != nil {\n\t\tresult.Tags = make(map[string]string, len(scaleSet.Tags))\n\t\tfor key, value := range scaleSet.Tags {\n\t\t\tresult.Tags[key] = value\n\t\t}\n\t}\n\n\t// Set property \"Zones\":\n\tfor _, item := range scaleSet.Zones {\n\t\tresult.Zones = append(result.Zones, item)\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "765ff846f4bac1dc8fe69bbc777e5dce", "score": "0.6575824", "text": "func (record *PtrRecord) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif record == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &PtrRecord_ARM{}\n\n\t// Set property \"Ptrdname\":\n\tif record.Ptrdname != nil {\n\t\tptrdname := *record.Ptrdname\n\t\tresult.Ptrdname = &ptrdname\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "667d0d294159277c801effaa691af214", "score": "0.65530914", "text": "func (configuration *CacheConfiguration) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif configuration == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &CacheConfiguration_ARM{}\n\n\t// Set property \"CacheBehavior\":\n\tif configuration.CacheBehavior != nil {\n\t\tcacheBehavior := *configuration.CacheBehavior\n\t\tresult.CacheBehavior = &cacheBehavior\n\t}\n\n\t// Set property \"CacheDuration\":\n\tif configuration.CacheDuration != nil {\n\t\tcacheDuration := *configuration.CacheDuration\n\t\tresult.CacheDuration = &cacheDuration\n\t}\n\n\t// Set property \"IsCompressionEnabled\":\n\tif configuration.IsCompressionEnabled != nil {\n\t\tisCompressionEnabled := *configuration.IsCompressionEnabled\n\t\tresult.IsCompressionEnabled = &isCompressionEnabled\n\t}\n\n\t// Set property \"QueryParameters\":\n\tif configuration.QueryParameters != nil {\n\t\tqueryParameters := *configuration.QueryParameters\n\t\tresult.QueryParameters = &queryParameters\n\t}\n\n\t// Set property \"QueryStringCachingBehavior\":\n\tif configuration.QueryStringCachingBehavior != nil {\n\t\tqueryStringCachingBehavior := *configuration.QueryStringCachingBehavior\n\t\tresult.QueryStringCachingBehavior = &queryStringCachingBehavior\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "667d0d294159277c801effaa691af214", "score": "0.65530914", "text": "func (configuration *CacheConfiguration) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif configuration == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &CacheConfiguration_ARM{}\n\n\t// Set property \"CacheBehavior\":\n\tif configuration.CacheBehavior != nil {\n\t\tcacheBehavior := *configuration.CacheBehavior\n\t\tresult.CacheBehavior = &cacheBehavior\n\t}\n\n\t// Set property \"CacheDuration\":\n\tif configuration.CacheDuration != nil {\n\t\tcacheDuration := *configuration.CacheDuration\n\t\tresult.CacheDuration = &cacheDuration\n\t}\n\n\t// Set property \"IsCompressionEnabled\":\n\tif configuration.IsCompressionEnabled != nil {\n\t\tisCompressionEnabled := *configuration.IsCompressionEnabled\n\t\tresult.IsCompressionEnabled = &isCompressionEnabled\n\t}\n\n\t// Set property \"QueryParameters\":\n\tif configuration.QueryParameters != nil {\n\t\tqueryParameters := *configuration.QueryParameters\n\t\tresult.QueryParameters = &queryParameters\n\t}\n\n\t// Set property \"QueryStringCachingBehavior\":\n\tif configuration.QueryStringCachingBehavior != nil {\n\t\tqueryStringCachingBehavior := *configuration.QueryStringCachingBehavior\n\t\tresult.QueryStringCachingBehavior = &queryStringCachingBehavior\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "7a3b66411bd5ef6a50160c37bcb5db3b", "score": "0.6533077", "text": "func (details *WorkspaceKeyDetails) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif details == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &WorkspaceKeyDetails_ARM{}\n\n\t// Set property \"KeyVaultUrl\":\n\tif details.KeyVaultUrl != nil {\n\t\tkeyVaultUrl := *details.KeyVaultUrl\n\t\tresult.KeyVaultUrl = &keyVaultUrl\n\t}\n\n\t// Set property \"Name\":\n\tif details.Name != nil {\n\t\tname := *details.Name\n\t\tresult.Name = &name\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "f2211c7e8c175879a5e68764e537bda4", "score": "0.65290153", "text": "func (profile *VirtualMachineScaleSetStorageProfile) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif profile == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &VirtualMachineScaleSetStorageProfile_ARM{}\n\n\t// Set property \"DataDisks\":\n\tfor _, item := range profile.DataDisks {\n\t\titem_ARM, err := item.ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult.DataDisks = append(result.DataDisks, *item_ARM.(*VirtualMachineScaleSetDataDisk_ARM))\n\t}\n\n\t// Set property \"ImageReference\":\n\tif profile.ImageReference != nil {\n\t\timageReference_ARM, err := (*profile.ImageReference).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\timageReference := *imageReference_ARM.(*ImageReference_ARM)\n\t\tresult.ImageReference = &imageReference\n\t}\n\n\t// Set property \"OsDisk\":\n\tif profile.OsDisk != nil {\n\t\tosDisk_ARM, err := (*profile.OsDisk).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tosDisk := *osDisk_ARM.(*VirtualMachineScaleSetOSDisk_ARM)\n\t\tresult.OsDisk = &osDisk\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "94915aab7478cd8001f79666f83e0060", "score": "0.65283227", "text": "func (definition *ManagementPolicyDefinition) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif definition == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &ManagementPolicyDefinition_ARM{}\n\n\t// Set property \"Actions\":\n\tif definition.Actions != nil {\n\t\tactions_ARM, err := (*definition.Actions).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tactions := *actions_ARM.(*ManagementPolicyAction_ARM)\n\t\tresult.Actions = &actions\n\t}\n\n\t// Set property \"Filters\":\n\tif definition.Filters != nil {\n\t\tfilters_ARM, err := (*definition.Filters).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfilters := *filters_ARM.(*ManagementPolicyFilter_ARM)\n\t\tresult.Filters = &filters\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "acc85fac8554c9460d3e1e4192b2b5ac", "score": "0.6514301", "text": "func (action *UrlRewriteAction) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif action == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &UrlRewriteAction_ARM{}\n\n\t// Set property \"Name\":\n\tif action.Name != nil {\n\t\tresult.Name = *action.Name\n\t}\n\n\t// Set property \"Parameters\":\n\tif action.Parameters != nil {\n\t\tparameters_ARM, err := (*action.Parameters).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tparameters := *parameters_ARM.(*UrlRewriteActionParameters_ARM)\n\t\tresult.Parameters = &parameters\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "acc85fac8554c9460d3e1e4192b2b5ac", "score": "0.6514301", "text": "func (action *UrlRewriteAction) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif action == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &UrlRewriteAction_ARM{}\n\n\t// Set property \"Name\":\n\tif action.Name != nil {\n\t\tresult.Name = *action.Name\n\t}\n\n\t// Set property \"Parameters\":\n\tif action.Parameters != nil {\n\t\tparameters_ARM, err := (*action.Parameters).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tparameters := *parameters_ARM.(*UrlRewriteActionParameters_ARM)\n\t\tresult.Parameters = &parameters\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "eb469b2d196a9d38604f221d01eaa659", "score": "0.65127563", "text": "func (condition *DeliveryRuleRequestSchemeCondition) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif condition == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &DeliveryRuleRequestSchemeCondition_ARM{}\n\n\t// Set property \"Name\":\n\tif condition.Name != nil {\n\t\tresult.Name = *condition.Name\n\t}\n\n\t// Set property \"Parameters\":\n\tif condition.Parameters != nil {\n\t\tparameters_ARM, err := (*condition.Parameters).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tparameters := *parameters_ARM.(*RequestSchemeMatchConditionParameters_ARM)\n\t\tresult.Parameters = &parameters\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "eb469b2d196a9d38604f221d01eaa659", "score": "0.65127563", "text": "func (condition *DeliveryRuleRequestSchemeCondition) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif condition == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &DeliveryRuleRequestSchemeCondition_ARM{}\n\n\t// Set property \"Name\":\n\tif condition.Name != nil {\n\t\tresult.Name = *condition.Name\n\t}\n\n\t// Set property \"Parameters\":\n\tif condition.Parameters != nil {\n\t\tparameters_ARM, err := (*condition.Parameters).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tparameters := *parameters_ARM.(*RequestSchemeMatchConditionParameters_ARM)\n\t\tresult.Parameters = &parameters\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "c61082f6d0bf8d8c3e3565e6769ba81d", "score": "0.65045166", "text": "func (database *FlexibleServers_Database_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif database == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &FlexibleServers_Database_Spec_ARM{}\n\n\t// Set property \"Name\":\n\tresult.Name = resolved.Name\n\n\t// Set property \"Properties\":\n\tif database.Charset != nil || database.Collation != nil {\n\t\tresult.Properties = &DatabaseProperties_ARM{}\n\t}\n\tif database.Charset != nil {\n\t\tcharset := *database.Charset\n\t\tresult.Properties.Charset = &charset\n\t}\n\tif database.Collation != nil {\n\t\tcollation := *database.Collation\n\t\tresult.Properties.Collation = &collation\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "be90f1489d53e820ec6579bf5f2b3b50", "score": "0.6502579", "text": "func (identity *Identity) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif identity == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &Identity_ARM{}\n\n\t// Set property \"Type\":\n\tif identity.Type != nil {\n\t\ttypeVar := *identity.Type\n\t\tresult.Type = &typeVar\n\t}\n\n\t// Set property \"UserAssignedIdentities\":\n\tresult.UserAssignedIdentities = make(map[string]UserAssignedIdentityDetails_ARM, len(identity.UserAssignedIdentities))\n\tfor _, ident := range identity.UserAssignedIdentities {\n\t\tidentARMID, err := resolved.ResolvedReferences.Lookup(ident.Reference)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tkey := identARMID\n\t\tresult.UserAssignedIdentities[key] = UserAssignedIdentityDetails_ARM{}\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "79a82e3f34280b47d8534008be1c29fd", "score": "0.6499381", "text": "func (resource *SqlStoredProcedureResource) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif resource == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &SqlStoredProcedureResource_ARM{}\n\n\t// Set property \"Body\":\n\tif resource.Body != nil {\n\t\tbody := *resource.Body\n\t\tresult.Body = &body\n\t}\n\n\t// Set property \"Id\":\n\tif resource.Id != nil {\n\t\tid := *resource.Id\n\t\tresult.Id = &id\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "51c1266dd2b83341f3e748c8bcd605de", "score": "0.6493364", "text": "func (route *RouteTables_Route_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif route == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &RouteTables_Route_Spec_ARM{}\n\n\t// Set property \"Name\":\n\tresult.Name = resolved.Name\n\n\t// Set property \"Properties\":\n\tif route.AddressPrefix != nil ||\n\t\troute.HasBgpOverride != nil ||\n\t\troute.NextHopIpAddress != nil ||\n\t\troute.NextHopType != nil {\n\t\tresult.Properties = &RoutePropertiesFormat_ARM{}\n\t}\n\tif route.AddressPrefix != nil {\n\t\taddressPrefix := *route.AddressPrefix\n\t\tresult.Properties.AddressPrefix = &addressPrefix\n\t}\n\tif route.HasBgpOverride != nil {\n\t\thasBgpOverride := *route.HasBgpOverride\n\t\tresult.Properties.HasBgpOverride = &hasBgpOverride\n\t}\n\tif route.NextHopIpAddress != nil {\n\t\tnextHopIpAddress := *route.NextHopIpAddress\n\t\tresult.Properties.NextHopIpAddress = &nextHopIpAddress\n\t}\n\tif route.NextHopType != nil {\n\t\tnextHopType := *route.NextHopType\n\t\tresult.Properties.NextHopType = &nextHopType\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "b2791f41401918cb4b7618c35383b31f", "score": "0.64907813", "text": "func (identity *ManagedIdentity) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif identity == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &ManagedIdentity_ARM{}\n\n\t// Set property \"Type\":\n\tif identity.Type != nil {\n\t\ttypeVar := *identity.Type\n\t\tresult.Type = &typeVar\n\t}\n\n\t// Set property \"UserAssignedIdentities\":\n\tresult.UserAssignedIdentities = make(map[string]UserAssignedIdentityDetails_ARM, len(identity.UserAssignedIdentities))\n\tfor _, ident := range identity.UserAssignedIdentities {\n\t\tidentARMID, err := resolved.ResolvedReferences.Lookup(ident.Reference)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tkey := identARMID\n\t\tresult.UserAssignedIdentities[key] = UserAssignedIdentityDetails_ARM{}\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "075ec148a26c13375f815f1638beeb18", "score": "0.648716", "text": "func (group *NetworkSecurityGroup_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif group == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &NetworkSecurityGroup_Spec_ARM{}\n\n\t// Set property \"Location\":\n\tif group.Location != nil {\n\t\tlocation := *group.Location\n\t\tresult.Location = &location\n\t}\n\n\t// Set property \"Name\":\n\tresult.Name = resolved.Name\n\n\t// no assignment for property \"Properties\"\n\n\t// Set property \"Tags\":\n\tif group.Tags != nil {\n\t\tresult.Tags = make(map[string]string, len(group.Tags))\n\t\tfor key, value := range group.Tags {\n\t\t\tresult.Tags[key] = value\n\t\t}\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "d999f597614dd7cd60ae8b27c466bbd8", "score": "0.64801013", "text": "func (filter *ManagementPolicyFilter) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif filter == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &ManagementPolicyFilter_ARM{}\n\n\t// Set property \"BlobIndexMatch\":\n\tfor _, item := range filter.BlobIndexMatch {\n\t\titem_ARM, err := item.ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult.BlobIndexMatch = append(result.BlobIndexMatch, *item_ARM.(*TagFilter_ARM))\n\t}\n\n\t// Set property \"BlobTypes\":\n\tfor _, item := range filter.BlobTypes {\n\t\tresult.BlobTypes = append(result.BlobTypes, item)\n\t}\n\n\t// Set property \"PrefixMatch\":\n\tfor _, item := range filter.PrefixMatch {\n\t\tresult.PrefixMatch = append(result.PrefixMatch, item)\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "2cae32fbd3d9e679fe526aad62ddffc6", "score": "0.64788586", "text": "func (endpoint *Profiles_Endpoint_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif endpoint == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &Profiles_Endpoint_Spec_ARM{}\n\n\t// Set property \"Location\":\n\tif endpoint.Location != nil {\n\t\tlocation := *endpoint.Location\n\t\tresult.Location = &location\n\t}\n\n\t// Set property \"Name\":\n\tresult.Name = resolved.Name\n\n\t// Set property \"Properties\":\n\tif endpoint.ContentTypesToCompress != nil ||\n\t\tendpoint.DefaultOriginGroup != nil ||\n\t\tendpoint.DeliveryPolicy != nil ||\n\t\tendpoint.GeoFilters != nil ||\n\t\tendpoint.IsCompressionEnabled != nil ||\n\t\tendpoint.IsHttpAllowed != nil ||\n\t\tendpoint.IsHttpsAllowed != nil ||\n\t\tendpoint.OptimizationType != nil ||\n\t\tendpoint.OriginGroups != nil ||\n\t\tendpoint.OriginHostHeader != nil ||\n\t\tendpoint.OriginPath != nil ||\n\t\tendpoint.Origins != nil ||\n\t\tendpoint.ProbePath != nil ||\n\t\tendpoint.QueryStringCachingBehavior != nil ||\n\t\tendpoint.UrlSigningKeys != nil ||\n\t\tendpoint.WebApplicationFirewallPolicyLink != nil {\n\t\tresult.Properties = &EndpointProperties_ARM{}\n\t}\n\tfor _, item := range endpoint.ContentTypesToCompress {\n\t\tresult.Properties.ContentTypesToCompress = append(result.Properties.ContentTypesToCompress, item)\n\t}\n\tif endpoint.DefaultOriginGroup != nil {\n\t\tdefaultOriginGroup_ARM, err := (*endpoint.DefaultOriginGroup).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdefaultOriginGroup := *defaultOriginGroup_ARM.(*ResourceReference_ARM)\n\t\tresult.Properties.DefaultOriginGroup = &defaultOriginGroup\n\t}\n\tif endpoint.DeliveryPolicy != nil {\n\t\tdeliveryPolicy_ARM, err := (*endpoint.DeliveryPolicy).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdeliveryPolicy := *deliveryPolicy_ARM.(*EndpointProperties_DeliveryPolicy_ARM)\n\t\tresult.Properties.DeliveryPolicy = &deliveryPolicy\n\t}\n\tfor _, item := range endpoint.GeoFilters {\n\t\titem_ARM, err := item.ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult.Properties.GeoFilters = append(result.Properties.GeoFilters, *item_ARM.(*GeoFilter_ARM))\n\t}\n\tif endpoint.IsCompressionEnabled != nil {\n\t\tisCompressionEnabled := *endpoint.IsCompressionEnabled\n\t\tresult.Properties.IsCompressionEnabled = &isCompressionEnabled\n\t}\n\tif endpoint.IsHttpAllowed != nil {\n\t\tisHttpAllowed := *endpoint.IsHttpAllowed\n\t\tresult.Properties.IsHttpAllowed = &isHttpAllowed\n\t}\n\tif endpoint.IsHttpsAllowed != nil {\n\t\tisHttpsAllowed := *endpoint.IsHttpsAllowed\n\t\tresult.Properties.IsHttpsAllowed = &isHttpsAllowed\n\t}\n\tif endpoint.OptimizationType != nil {\n\t\toptimizationType := *endpoint.OptimizationType\n\t\tresult.Properties.OptimizationType = &optimizationType\n\t}\n\tfor _, item := range endpoint.OriginGroups {\n\t\titem_ARM, err := item.ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult.Properties.OriginGroups = append(result.Properties.OriginGroups, *item_ARM.(*DeepCreatedOriginGroup_ARM))\n\t}\n\tif endpoint.OriginHostHeader != nil {\n\t\toriginHostHeader := *endpoint.OriginHostHeader\n\t\tresult.Properties.OriginHostHeader = &originHostHeader\n\t}\n\tif endpoint.OriginPath != nil {\n\t\toriginPath := *endpoint.OriginPath\n\t\tresult.Properties.OriginPath = &originPath\n\t}\n\tfor _, item := range endpoint.Origins {\n\t\titem_ARM, err := item.ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult.Properties.Origins = append(result.Properties.Origins, *item_ARM.(*DeepCreatedOrigin_ARM))\n\t}\n\tif endpoint.ProbePath != nil {\n\t\tprobePath := *endpoint.ProbePath\n\t\tresult.Properties.ProbePath = &probePath\n\t}\n\tif endpoint.QueryStringCachingBehavior != nil {\n\t\tqueryStringCachingBehavior := *endpoint.QueryStringCachingBehavior\n\t\tresult.Properties.QueryStringCachingBehavior = &queryStringCachingBehavior\n\t}\n\tfor _, item := range endpoint.UrlSigningKeys {\n\t\titem_ARM, err := item.ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult.Properties.UrlSigningKeys = append(result.Properties.UrlSigningKeys, *item_ARM.(*UrlSigningKey_ARM))\n\t}\n\tif endpoint.WebApplicationFirewallPolicyLink != nil {\n\t\twebApplicationFirewallPolicyLink_ARM, err := (*endpoint.WebApplicationFirewallPolicyLink).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\twebApplicationFirewallPolicyLink := *webApplicationFirewallPolicyLink_ARM.(*EndpointProperties_WebApplicationFirewallPolicyLink_ARM)\n\t\tresult.Properties.WebApplicationFirewallPolicyLink = &webApplicationFirewallPolicyLink\n\t}\n\n\t// Set property \"Tags\":\n\tif endpoint.Tags != nil {\n\t\tresult.Tags = make(map[string]string, len(endpoint.Tags))\n\t\tfor key, value := range endpoint.Tags {\n\t\t\tresult.Tags[key] = value\n\t\t}\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "2cae32fbd3d9e679fe526aad62ddffc6", "score": "0.64788586", "text": "func (endpoint *Profiles_Endpoint_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif endpoint == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &Profiles_Endpoint_Spec_ARM{}\n\n\t// Set property \"Location\":\n\tif endpoint.Location != nil {\n\t\tlocation := *endpoint.Location\n\t\tresult.Location = &location\n\t}\n\n\t// Set property \"Name\":\n\tresult.Name = resolved.Name\n\n\t// Set property \"Properties\":\n\tif endpoint.ContentTypesToCompress != nil ||\n\t\tendpoint.DefaultOriginGroup != nil ||\n\t\tendpoint.DeliveryPolicy != nil ||\n\t\tendpoint.GeoFilters != nil ||\n\t\tendpoint.IsCompressionEnabled != nil ||\n\t\tendpoint.IsHttpAllowed != nil ||\n\t\tendpoint.IsHttpsAllowed != nil ||\n\t\tendpoint.OptimizationType != nil ||\n\t\tendpoint.OriginGroups != nil ||\n\t\tendpoint.OriginHostHeader != nil ||\n\t\tendpoint.OriginPath != nil ||\n\t\tendpoint.Origins != nil ||\n\t\tendpoint.ProbePath != nil ||\n\t\tendpoint.QueryStringCachingBehavior != nil ||\n\t\tendpoint.UrlSigningKeys != nil ||\n\t\tendpoint.WebApplicationFirewallPolicyLink != nil {\n\t\tresult.Properties = &EndpointProperties_ARM{}\n\t}\n\tfor _, item := range endpoint.ContentTypesToCompress {\n\t\tresult.Properties.ContentTypesToCompress = append(result.Properties.ContentTypesToCompress, item)\n\t}\n\tif endpoint.DefaultOriginGroup != nil {\n\t\tdefaultOriginGroup_ARM, err := (*endpoint.DefaultOriginGroup).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdefaultOriginGroup := *defaultOriginGroup_ARM.(*ResourceReference_ARM)\n\t\tresult.Properties.DefaultOriginGroup = &defaultOriginGroup\n\t}\n\tif endpoint.DeliveryPolicy != nil {\n\t\tdeliveryPolicy_ARM, err := (*endpoint.DeliveryPolicy).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdeliveryPolicy := *deliveryPolicy_ARM.(*EndpointProperties_DeliveryPolicy_ARM)\n\t\tresult.Properties.DeliveryPolicy = &deliveryPolicy\n\t}\n\tfor _, item := range endpoint.GeoFilters {\n\t\titem_ARM, err := item.ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult.Properties.GeoFilters = append(result.Properties.GeoFilters, *item_ARM.(*GeoFilter_ARM))\n\t}\n\tif endpoint.IsCompressionEnabled != nil {\n\t\tisCompressionEnabled := *endpoint.IsCompressionEnabled\n\t\tresult.Properties.IsCompressionEnabled = &isCompressionEnabled\n\t}\n\tif endpoint.IsHttpAllowed != nil {\n\t\tisHttpAllowed := *endpoint.IsHttpAllowed\n\t\tresult.Properties.IsHttpAllowed = &isHttpAllowed\n\t}\n\tif endpoint.IsHttpsAllowed != nil {\n\t\tisHttpsAllowed := *endpoint.IsHttpsAllowed\n\t\tresult.Properties.IsHttpsAllowed = &isHttpsAllowed\n\t}\n\tif endpoint.OptimizationType != nil {\n\t\toptimizationType := *endpoint.OptimizationType\n\t\tresult.Properties.OptimizationType = &optimizationType\n\t}\n\tfor _, item := range endpoint.OriginGroups {\n\t\titem_ARM, err := item.ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult.Properties.OriginGroups = append(result.Properties.OriginGroups, *item_ARM.(*DeepCreatedOriginGroup_ARM))\n\t}\n\tif endpoint.OriginHostHeader != nil {\n\t\toriginHostHeader := *endpoint.OriginHostHeader\n\t\tresult.Properties.OriginHostHeader = &originHostHeader\n\t}\n\tif endpoint.OriginPath != nil {\n\t\toriginPath := *endpoint.OriginPath\n\t\tresult.Properties.OriginPath = &originPath\n\t}\n\tfor _, item := range endpoint.Origins {\n\t\titem_ARM, err := item.ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult.Properties.Origins = append(result.Properties.Origins, *item_ARM.(*DeepCreatedOrigin_ARM))\n\t}\n\tif endpoint.ProbePath != nil {\n\t\tprobePath := *endpoint.ProbePath\n\t\tresult.Properties.ProbePath = &probePath\n\t}\n\tif endpoint.QueryStringCachingBehavior != nil {\n\t\tqueryStringCachingBehavior := *endpoint.QueryStringCachingBehavior\n\t\tresult.Properties.QueryStringCachingBehavior = &queryStringCachingBehavior\n\t}\n\tfor _, item := range endpoint.UrlSigningKeys {\n\t\titem_ARM, err := item.ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult.Properties.UrlSigningKeys = append(result.Properties.UrlSigningKeys, *item_ARM.(*UrlSigningKey_ARM))\n\t}\n\tif endpoint.WebApplicationFirewallPolicyLink != nil {\n\t\twebApplicationFirewallPolicyLink_ARM, err := (*endpoint.WebApplicationFirewallPolicyLink).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\twebApplicationFirewallPolicyLink := *webApplicationFirewallPolicyLink_ARM.(*EndpointProperties_WebApplicationFirewallPolicyLink_ARM)\n\t\tresult.Properties.WebApplicationFirewallPolicyLink = &webApplicationFirewallPolicyLink\n\t}\n\n\t// Set property \"Tags\":\n\tif endpoint.Tags != nil {\n\t\tresult.Tags = make(map[string]string, len(endpoint.Tags))\n\t\tfor key, value := range endpoint.Tags {\n\t\t\tresult.Tags[key] = value\n\t\t}\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "ecbfb6898c1a0ff8294be58410361679", "score": "0.6471702", "text": "func (rule *DeliveryRule) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif rule == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &DeliveryRule_ARM{}\n\n\t// Set property \"Actions\":\n\tfor _, item := range rule.Actions {\n\t\titem_ARM, err := item.ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult.Actions = append(result.Actions, *item_ARM.(*DeliveryRuleAction_ARM))\n\t}\n\n\t// Set property \"Conditions\":\n\tfor _, item := range rule.Conditions {\n\t\titem_ARM, err := item.ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult.Conditions = append(result.Conditions, *item_ARM.(*DeliveryRuleCondition_ARM))\n\t}\n\n\t// Set property \"Name\":\n\tif rule.Name != nil {\n\t\tname := *rule.Name\n\t\tresult.Name = &name\n\t}\n\n\t// Set property \"Order\":\n\tif rule.Order != nil {\n\t\torder := *rule.Order\n\t\tresult.Order = &order\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "ecbfb6898c1a0ff8294be58410361679", "score": "0.6471702", "text": "func (rule *DeliveryRule) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif rule == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &DeliveryRule_ARM{}\n\n\t// Set property \"Actions\":\n\tfor _, item := range rule.Actions {\n\t\titem_ARM, err := item.ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult.Actions = append(result.Actions, *item_ARM.(*DeliveryRuleAction_ARM))\n\t}\n\n\t// Set property \"Conditions\":\n\tfor _, item := range rule.Conditions {\n\t\titem_ARM, err := item.ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult.Conditions = append(result.Conditions, *item_ARM.(*DeliveryRuleCondition_ARM))\n\t}\n\n\t// Set property \"Name\":\n\tif rule.Name != nil {\n\t\tname := *rule.Name\n\t\tresult.Name = &name\n\t}\n\n\t// Set property \"Order\":\n\tif rule.Order != nil {\n\t\torder := *rule.Order\n\t\tresult.Order = &order\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "bae2dcb6cb3732ffb04d0e7b6194984c", "score": "0.64688814", "text": "func (profile *VirtualMachineScaleSetNetworkProfile) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif profile == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &VirtualMachineScaleSetNetworkProfile_ARM{}\n\n\t// Set property \"HealthProbe\":\n\tif profile.HealthProbe != nil {\n\t\thealthProbe_ARM, err := (*profile.HealthProbe).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\thealthProbe := *healthProbe_ARM.(*ApiEntityReference_ARM)\n\t\tresult.HealthProbe = &healthProbe\n\t}\n\n\t// Set property \"NetworkApiVersion\":\n\tif profile.NetworkApiVersion != nil {\n\t\tnetworkApiVersion := *profile.NetworkApiVersion\n\t\tresult.NetworkApiVersion = &networkApiVersion\n\t}\n\n\t// Set property \"NetworkInterfaceConfigurations\":\n\tfor _, item := range profile.NetworkInterfaceConfigurations {\n\t\titem_ARM, err := item.ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult.NetworkInterfaceConfigurations = append(result.NetworkInterfaceConfigurations, *item_ARM.(*VirtualMachineScaleSetNetworkConfiguration_ARM))\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "2bbfd1289415addfbbf3f19b3c4b65dd", "score": "0.64613605", "text": "func (record *SoaRecord) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif record == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &SoaRecord_ARM{}\n\n\t// Set property \"Email\":\n\tif record.Email != nil {\n\t\temail := *record.Email\n\t\tresult.Email = &email\n\t}\n\n\t// Set property \"ExpireTime\":\n\tif record.ExpireTime != nil {\n\t\texpireTime := *record.ExpireTime\n\t\tresult.ExpireTime = &expireTime\n\t}\n\n\t// Set property \"Host\":\n\tif record.Host != nil {\n\t\thost := *record.Host\n\t\tresult.Host = &host\n\t}\n\n\t// Set property \"MinimumTtl\":\n\tif record.MinimumTtl != nil {\n\t\tminimumTtl := *record.MinimumTtl\n\t\tresult.MinimumTtl = &minimumTtl\n\t}\n\n\t// Set property \"RefreshTime\":\n\tif record.RefreshTime != nil {\n\t\trefreshTime := *record.RefreshTime\n\t\tresult.RefreshTime = &refreshTime\n\t}\n\n\t// Set property \"RetryTime\":\n\tif record.RetryTime != nil {\n\t\tretryTime := *record.RetryTime\n\t\tresult.RetryTime = &retryTime\n\t}\n\n\t// Set property \"SerialNumber\":\n\tif record.SerialNumber != nil {\n\t\tserialNumber := *record.SerialNumber\n\t\tresult.SerialNumber = &serialNumber\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "b9a5036b9e89dddaa6ed18c86101de50", "score": "0.64394253", "text": "func (origin *DeepCreatedOrigin) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif origin == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &DeepCreatedOrigin_ARM{}\n\n\t// Set property \"Name\":\n\tif origin.Name != nil {\n\t\tname := *origin.Name\n\t\tresult.Name = &name\n\t}\n\n\t// Set property \"Properties\":\n\tif origin.Enabled != nil ||\n\t\torigin.HostName != nil ||\n\t\torigin.HttpPort != nil ||\n\t\torigin.HttpsPort != nil ||\n\t\torigin.OriginHostHeader != nil ||\n\t\torigin.Priority != nil ||\n\t\torigin.PrivateLinkAlias != nil ||\n\t\torigin.PrivateLinkApprovalMessage != nil ||\n\t\torigin.PrivateLinkLocationReference != nil ||\n\t\torigin.PrivateLinkResourceReference != nil ||\n\t\torigin.Weight != nil {\n\t\tresult.Properties = &DeepCreatedOriginProperties_ARM{}\n\t}\n\tif origin.Enabled != nil {\n\t\tenabled := *origin.Enabled\n\t\tresult.Properties.Enabled = &enabled\n\t}\n\tif origin.HostName != nil {\n\t\thostName := *origin.HostName\n\t\tresult.Properties.HostName = &hostName\n\t}\n\tif origin.HttpPort != nil {\n\t\thttpPort := *origin.HttpPort\n\t\tresult.Properties.HttpPort = &httpPort\n\t}\n\tif origin.HttpsPort != nil {\n\t\thttpsPort := *origin.HttpsPort\n\t\tresult.Properties.HttpsPort = &httpsPort\n\t}\n\tif origin.OriginHostHeader != nil {\n\t\toriginHostHeader := *origin.OriginHostHeader\n\t\tresult.Properties.OriginHostHeader = &originHostHeader\n\t}\n\tif origin.Priority != nil {\n\t\tpriority := *origin.Priority\n\t\tresult.Properties.Priority = &priority\n\t}\n\tif origin.PrivateLinkAlias != nil {\n\t\tprivateLinkAlias := *origin.PrivateLinkAlias\n\t\tresult.Properties.PrivateLinkAlias = &privateLinkAlias\n\t}\n\tif origin.PrivateLinkApprovalMessage != nil {\n\t\tprivateLinkApprovalMessage := *origin.PrivateLinkApprovalMessage\n\t\tresult.Properties.PrivateLinkApprovalMessage = &privateLinkApprovalMessage\n\t}\n\tif origin.PrivateLinkLocationReference != nil {\n\t\tprivateLinkLocationARMID, err := resolved.ResolvedReferences.Lookup(*origin.PrivateLinkLocationReference)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tprivateLinkLocation := privateLinkLocationARMID\n\t\tresult.Properties.PrivateLinkLocation = &privateLinkLocation\n\t}\n\tif origin.PrivateLinkResourceReference != nil {\n\t\tprivateLinkResourceIdARMID, err := resolved.ResolvedReferences.Lookup(*origin.PrivateLinkResourceReference)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tprivateLinkResourceId := privateLinkResourceIdARMID\n\t\tresult.Properties.PrivateLinkResourceId = &privateLinkResourceId\n\t}\n\tif origin.Weight != nil {\n\t\tweight := *origin.Weight\n\t\tresult.Properties.Weight = &weight\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "b9a5036b9e89dddaa6ed18c86101de50", "score": "0.64394253", "text": "func (origin *DeepCreatedOrigin) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif origin == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &DeepCreatedOrigin_ARM{}\n\n\t// Set property \"Name\":\n\tif origin.Name != nil {\n\t\tname := *origin.Name\n\t\tresult.Name = &name\n\t}\n\n\t// Set property \"Properties\":\n\tif origin.Enabled != nil ||\n\t\torigin.HostName != nil ||\n\t\torigin.HttpPort != nil ||\n\t\torigin.HttpsPort != nil ||\n\t\torigin.OriginHostHeader != nil ||\n\t\torigin.Priority != nil ||\n\t\torigin.PrivateLinkAlias != nil ||\n\t\torigin.PrivateLinkApprovalMessage != nil ||\n\t\torigin.PrivateLinkLocationReference != nil ||\n\t\torigin.PrivateLinkResourceReference != nil ||\n\t\torigin.Weight != nil {\n\t\tresult.Properties = &DeepCreatedOriginProperties_ARM{}\n\t}\n\tif origin.Enabled != nil {\n\t\tenabled := *origin.Enabled\n\t\tresult.Properties.Enabled = &enabled\n\t}\n\tif origin.HostName != nil {\n\t\thostName := *origin.HostName\n\t\tresult.Properties.HostName = &hostName\n\t}\n\tif origin.HttpPort != nil {\n\t\thttpPort := *origin.HttpPort\n\t\tresult.Properties.HttpPort = &httpPort\n\t}\n\tif origin.HttpsPort != nil {\n\t\thttpsPort := *origin.HttpsPort\n\t\tresult.Properties.HttpsPort = &httpsPort\n\t}\n\tif origin.OriginHostHeader != nil {\n\t\toriginHostHeader := *origin.OriginHostHeader\n\t\tresult.Properties.OriginHostHeader = &originHostHeader\n\t}\n\tif origin.Priority != nil {\n\t\tpriority := *origin.Priority\n\t\tresult.Properties.Priority = &priority\n\t}\n\tif origin.PrivateLinkAlias != nil {\n\t\tprivateLinkAlias := *origin.PrivateLinkAlias\n\t\tresult.Properties.PrivateLinkAlias = &privateLinkAlias\n\t}\n\tif origin.PrivateLinkApprovalMessage != nil {\n\t\tprivateLinkApprovalMessage := *origin.PrivateLinkApprovalMessage\n\t\tresult.Properties.PrivateLinkApprovalMessage = &privateLinkApprovalMessage\n\t}\n\tif origin.PrivateLinkLocationReference != nil {\n\t\tprivateLinkLocationARMID, err := resolved.ResolvedReferences.Lookup(*origin.PrivateLinkLocationReference)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tprivateLinkLocation := privateLinkLocationARMID\n\t\tresult.Properties.PrivateLinkLocation = &privateLinkLocation\n\t}\n\tif origin.PrivateLinkResourceReference != nil {\n\t\tprivateLinkResourceIdARMID, err := resolved.ResolvedReferences.Lookup(*origin.PrivateLinkResourceReference)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tprivateLinkResourceId := privateLinkResourceIdARMID\n\t\tresult.Properties.PrivateLinkResourceId = &privateLinkResourceId\n\t}\n\tif origin.Weight != nil {\n\t\tweight := *origin.Weight\n\t\tresult.Properties.Weight = &weight\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "78d6daa5783dc5d35f8815dac3f459ec", "score": "0.6438231", "text": "func (extension *VirtualMachineScaleSetExtension) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif extension == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &VirtualMachineScaleSetExtension_ARM{}\n\n\t// Set property \"Name\":\n\tif extension.Name != nil {\n\t\tname := *extension.Name\n\t\tresult.Name = &name\n\t}\n\n\t// Set property \"Properties\":\n\tif extension.AutoUpgradeMinorVersion != nil ||\n\t\textension.EnableAutomaticUpgrade != nil ||\n\t\textension.ForceUpdateTag != nil ||\n\t\textension.ProtectedSettings != nil ||\n\t\textension.ProtectedSettingsFromKeyVault != nil ||\n\t\textension.ProvisionAfterExtensions != nil ||\n\t\textension.Publisher != nil ||\n\t\textension.Settings != nil ||\n\t\textension.SuppressFailures != nil ||\n\t\textension.Type != nil ||\n\t\textension.TypeHandlerVersion != nil {\n\t\tresult.Properties = &VirtualMachineScaleSetExtensionProperties_ARM{}\n\t}\n\tif extension.AutoUpgradeMinorVersion != nil {\n\t\tautoUpgradeMinorVersion := *extension.AutoUpgradeMinorVersion\n\t\tresult.Properties.AutoUpgradeMinorVersion = &autoUpgradeMinorVersion\n\t}\n\tif extension.EnableAutomaticUpgrade != nil {\n\t\tenableAutomaticUpgrade := *extension.EnableAutomaticUpgrade\n\t\tresult.Properties.EnableAutomaticUpgrade = &enableAutomaticUpgrade\n\t}\n\tif extension.ForceUpdateTag != nil {\n\t\tforceUpdateTag := *extension.ForceUpdateTag\n\t\tresult.Properties.ForceUpdateTag = &forceUpdateTag\n\t}\n\tif extension.ProtectedSettings != nil {\n\t\tresult.Properties.ProtectedSettings = make(map[string]v1.JSON, len(extension.ProtectedSettings))\n\t\tfor key, value := range extension.ProtectedSettings {\n\t\t\tresult.Properties.ProtectedSettings[key] = *value.DeepCopy()\n\t\t}\n\t}\n\tif extension.ProtectedSettingsFromKeyVault != nil {\n\t\tprotectedSettingsFromKeyVault_ARM, err := (*extension.ProtectedSettingsFromKeyVault).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tprotectedSettingsFromKeyVault := *protectedSettingsFromKeyVault_ARM.(*KeyVaultSecretReference_ARM)\n\t\tresult.Properties.ProtectedSettingsFromKeyVault = &protectedSettingsFromKeyVault\n\t}\n\tfor _, item := range extension.ProvisionAfterExtensions {\n\t\tresult.Properties.ProvisionAfterExtensions = append(result.Properties.ProvisionAfterExtensions, item)\n\t}\n\tif extension.Publisher != nil {\n\t\tpublisher := *extension.Publisher\n\t\tresult.Properties.Publisher = &publisher\n\t}\n\tif extension.Settings != nil {\n\t\tresult.Properties.Settings = make(map[string]v1.JSON, len(extension.Settings))\n\t\tfor key, value := range extension.Settings {\n\t\t\tresult.Properties.Settings[key] = *value.DeepCopy()\n\t\t}\n\t}\n\tif extension.SuppressFailures != nil {\n\t\tsuppressFailures := *extension.SuppressFailures\n\t\tresult.Properties.SuppressFailures = &suppressFailures\n\t}\n\tif extension.Type != nil {\n\t\ttypeVar := *extension.Type\n\t\tresult.Properties.Type = &typeVar\n\t}\n\tif extension.TypeHandlerVersion != nil {\n\t\ttypeHandlerVersion := *extension.TypeHandlerVersion\n\t\tresult.Properties.TypeHandlerVersion = &typeHandlerVersion\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "ee6b4a8287e7db919174735c47cf34d7", "score": "0.6437265", "text": "func (properties *KeyVaultProperties) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif properties == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &KeyVaultProperties_ARM{}\n\n\t// Set property \"Identity\":\n\tif properties.Identity != nil {\n\t\tidentity_ARM, err := (*properties.Identity).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tidentity := *identity_ARM.(*UserAssignedIdentityProperties_ARM)\n\t\tresult.Identity = &identity\n\t}\n\n\t// Set property \"KeyName\":\n\tif properties.KeyName != nil {\n\t\tkeyName := *properties.KeyName\n\t\tresult.KeyName = &keyName\n\t}\n\n\t// Set property \"KeyVaultUri\":\n\tif properties.KeyVaultUri != nil {\n\t\tkeyVaultUri := *properties.KeyVaultUri\n\t\tresult.KeyVaultUri = &keyVaultUri\n\t}\n\n\t// Set property \"KeyVersion\":\n\tif properties.KeyVersion != nil {\n\t\tkeyVersion := *properties.KeyVersion\n\t\tresult.KeyVersion = &keyVersion\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "39a1aa79b8d2659fb8c30b2be22cdaa2", "score": "0.643441", "text": "func (features *WorkspaceFeatures) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif features == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &WorkspaceFeatures_ARM{}\n\n\t// Set property \"ClusterResourceId\":\n\tif features.ClusterResourceReference != nil {\n\t\tclusterResourceReferenceARMID, err := resolved.ResolvedReferences.Lookup(*features.ClusterResourceReference)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tclusterResourceReference := clusterResourceReferenceARMID\n\t\tresult.ClusterResourceId = &clusterResourceReference\n\t}\n\n\t// Set property \"DisableLocalAuth\":\n\tif features.DisableLocalAuth != nil {\n\t\tdisableLocalAuth := *features.DisableLocalAuth\n\t\tresult.DisableLocalAuth = &disableLocalAuth\n\t}\n\n\t// Set property \"EnableDataExport\":\n\tif features.EnableDataExport != nil {\n\t\tenableDataExport := *features.EnableDataExport\n\t\tresult.EnableDataExport = &enableDataExport\n\t}\n\n\t// Set property \"EnableLogAccessUsingOnlyResourcePermissions\":\n\tif features.EnableLogAccessUsingOnlyResourcePermissions != nil {\n\t\tenableLogAccessUsingOnlyResourcePermissions := *features.EnableLogAccessUsingOnlyResourcePermissions\n\t\tresult.EnableLogAccessUsingOnlyResourcePermissions = &enableLogAccessUsingOnlyResourcePermissions\n\t}\n\n\t// Set property \"ImmediatePurgeDataOn30Days\":\n\tif features.ImmediatePurgeDataOn30Days != nil {\n\t\timmediatePurgeDataOn30Days := *features.ImmediatePurgeDataOn30Days\n\t\tresult.ImmediatePurgeDataOn30Days = &immediatePurgeDataOn30Days\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "b38b13b721a71a208921b21193f3804f", "score": "0.64277244", "text": "func (details *CustomerManagedKeyDetails) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif details == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &CustomerManagedKeyDetails_ARM{}\n\n\t// Set property \"KekIdentity\":\n\tif details.KekIdentity != nil {\n\t\tkekIdentity_ARM, err := (*details.KekIdentity).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tkekIdentity := *kekIdentity_ARM.(*KekIdentityProperties_ARM)\n\t\tresult.KekIdentity = &kekIdentity\n\t}\n\n\t// Set property \"Key\":\n\tif details.Key != nil {\n\t\tkey_ARM, err := (*details.Key).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tkey := *key_ARM.(*WorkspaceKeyDetails_ARM)\n\t\tresult.Key = &key\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "75d684fe0cd6d3330e4dec8891865ceb", "score": "0.64267033", "text": "func (parameters *VirtualMachineScaleSetManagedDiskParameters) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif parameters == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &VirtualMachineScaleSetManagedDiskParameters_ARM{}\n\n\t// Set property \"DiskEncryptionSet\":\n\tif parameters.DiskEncryptionSet != nil {\n\t\tdiskEncryptionSet_ARM, err := (*parameters.DiskEncryptionSet).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdiskEncryptionSet := *diskEncryptionSet_ARM.(*SubResource_ARM)\n\t\tresult.DiskEncryptionSet = &diskEncryptionSet\n\t}\n\n\t// Set property \"SecurityProfile\":\n\tif parameters.SecurityProfile != nil {\n\t\tsecurityProfile_ARM, err := (*parameters.SecurityProfile).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tsecurityProfile := *securityProfile_ARM.(*VMDiskSecurityProfile_ARM)\n\t\tresult.SecurityProfile = &securityProfile\n\t}\n\n\t// Set property \"StorageAccountType\":\n\tif parameters.StorageAccountType != nil {\n\t\tstorageAccountType := *parameters.StorageAccountType\n\t\tresult.StorageAccountType = &storageAccountType\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "cd5700527b9627563e0f32c0de8adae7", "score": "0.6424564", "text": "func (condition *DeliveryRuleClientPortCondition) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif condition == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &DeliveryRuleClientPortCondition_ARM{}\n\n\t// Set property \"Name\":\n\tif condition.Name != nil {\n\t\tresult.Name = *condition.Name\n\t}\n\n\t// Set property \"Parameters\":\n\tif condition.Parameters != nil {\n\t\tparameters_ARM, err := (*condition.Parameters).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tparameters := *parameters_ARM.(*ClientPortMatchConditionParameters_ARM)\n\t\tresult.Parameters = &parameters\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "cd5700527b9627563e0f32c0de8adae7", "score": "0.6424564", "text": "func (condition *DeliveryRuleClientPortCondition) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif condition == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &DeliveryRuleClientPortCondition_ARM{}\n\n\t// Set property \"Name\":\n\tif condition.Name != nil {\n\t\tresult.Name = *condition.Name\n\t}\n\n\t// Set property \"Parameters\":\n\tif condition.Parameters != nil {\n\t\tparameters_ARM, err := (*condition.Parameters).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tparameters := *parameters_ARM.(*ClientPortMatchConditionParameters_ARM)\n\t\tresult.Parameters = &parameters\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "5e64136e1b9b161bf976c198b13d102b", "score": "0.64238065", "text": "func (details *DataLakeStorageAccountDetails) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif details == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &DataLakeStorageAccountDetails_ARM{}\n\n\t// Set property \"AccountUrl\":\n\tif details.AccountUrl != nil {\n\t\taccountUrl := *details.AccountUrl\n\t\tresult.AccountUrl = &accountUrl\n\t}\n\tif details.AccountUrlFromConfig != nil {\n\t\taccountUrlValue, err := resolved.ResolvedConfigMaps.Lookup(*details.AccountUrlFromConfig)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"looking up configmap for property AccountUrl\")\n\t\t}\n\t\taccountUrl := accountUrlValue\n\t\tresult.AccountUrl = &accountUrl\n\t}\n\n\t// Set property \"CreateManagedPrivateEndpoint\":\n\tif details.CreateManagedPrivateEndpoint != nil {\n\t\tcreateManagedPrivateEndpoint := *details.CreateManagedPrivateEndpoint\n\t\tresult.CreateManagedPrivateEndpoint = &createManagedPrivateEndpoint\n\t}\n\n\t// Set property \"Filesystem\":\n\tif details.Filesystem != nil {\n\t\tfilesystem := *details.Filesystem\n\t\tresult.Filesystem = &filesystem\n\t}\n\n\t// Set property \"ResourceId\":\n\tif details.ResourceReference != nil {\n\t\tresourceReferenceARMID, err := resolved.ResolvedReferences.Lookup(*details.ResourceReference)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresourceReference := resourceReferenceARMID\n\t\tresult.ResourceId = &resourceReference\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "7172fcee4a01e10c1383dbd71c646412", "score": "0.6415154", "text": "func (condition *DeliveryRuleUrlPathCondition) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif condition == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &DeliveryRuleUrlPathCondition_ARM{}\n\n\t// Set property \"Name\":\n\tif condition.Name != nil {\n\t\tresult.Name = *condition.Name\n\t}\n\n\t// Set property \"Parameters\":\n\tif condition.Parameters != nil {\n\t\tparameters_ARM, err := (*condition.Parameters).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tparameters := *parameters_ARM.(*UrlPathMatchConditionParameters_ARM)\n\t\tresult.Parameters = &parameters\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "7172fcee4a01e10c1383dbd71c646412", "score": "0.6415154", "text": "func (condition *DeliveryRuleUrlPathCondition) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif condition == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &DeliveryRuleUrlPathCondition_ARM{}\n\n\t// Set property \"Name\":\n\tif condition.Name != nil {\n\t\tresult.Name = *condition.Name\n\t}\n\n\t// Set property \"Parameters\":\n\tif condition.Parameters != nil {\n\t\tparameters_ARM, err := (*condition.Parameters).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tparameters := *parameters_ARM.(*UrlPathMatchConditionParameters_ARM)\n\t\tresult.Parameters = &parameters\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "b09908c5951217f5bc77d7ffc139f817", "score": "0.64061534", "text": "func (config *KubeletConfig) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif config == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &KubeletConfig_ARM{}\n\n\t// Set property \"AllowedUnsafeSysctls\":\n\tfor _, item := range config.AllowedUnsafeSysctls {\n\t\tresult.AllowedUnsafeSysctls = append(result.AllowedUnsafeSysctls, item)\n\t}\n\n\t// Set property \"ContainerLogMaxFiles\":\n\tif config.ContainerLogMaxFiles != nil {\n\t\tcontainerLogMaxFiles := *config.ContainerLogMaxFiles\n\t\tresult.ContainerLogMaxFiles = &containerLogMaxFiles\n\t}\n\n\t// Set property \"ContainerLogMaxSizeMB\":\n\tif config.ContainerLogMaxSizeMB != nil {\n\t\tcontainerLogMaxSizeMB := *config.ContainerLogMaxSizeMB\n\t\tresult.ContainerLogMaxSizeMB = &containerLogMaxSizeMB\n\t}\n\n\t// Set property \"CpuCfsQuota\":\n\tif config.CpuCfsQuota != nil {\n\t\tcpuCfsQuota := *config.CpuCfsQuota\n\t\tresult.CpuCfsQuota = &cpuCfsQuota\n\t}\n\n\t// Set property \"CpuCfsQuotaPeriod\":\n\tif config.CpuCfsQuotaPeriod != nil {\n\t\tcpuCfsQuotaPeriod := *config.CpuCfsQuotaPeriod\n\t\tresult.CpuCfsQuotaPeriod = &cpuCfsQuotaPeriod\n\t}\n\n\t// Set property \"CpuManagerPolicy\":\n\tif config.CpuManagerPolicy != nil {\n\t\tcpuManagerPolicy := *config.CpuManagerPolicy\n\t\tresult.CpuManagerPolicy = &cpuManagerPolicy\n\t}\n\n\t// Set property \"FailSwapOn\":\n\tif config.FailSwapOn != nil {\n\t\tfailSwapOn := *config.FailSwapOn\n\t\tresult.FailSwapOn = &failSwapOn\n\t}\n\n\t// Set property \"ImageGcHighThreshold\":\n\tif config.ImageGcHighThreshold != nil {\n\t\timageGcHighThreshold := *config.ImageGcHighThreshold\n\t\tresult.ImageGcHighThreshold = &imageGcHighThreshold\n\t}\n\n\t// Set property \"ImageGcLowThreshold\":\n\tif config.ImageGcLowThreshold != nil {\n\t\timageGcLowThreshold := *config.ImageGcLowThreshold\n\t\tresult.ImageGcLowThreshold = &imageGcLowThreshold\n\t}\n\n\t// Set property \"PodMaxPids\":\n\tif config.PodMaxPids != nil {\n\t\tpodMaxPids := *config.PodMaxPids\n\t\tresult.PodMaxPids = &podMaxPids\n\t}\n\n\t// Set property \"TopologyManagerPolicy\":\n\tif config.TopologyManagerPolicy != nil {\n\t\ttopologyManagerPolicy := *config.TopologyManagerPolicy\n\t\tresult.TopologyManagerPolicy = &topologyManagerPolicy\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "bc964cd87ddc84d6d083afc3967bd682", "score": "0.6399886", "text": "func (action *ManagementPolicyAction) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif action == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &ManagementPolicyAction_ARM{}\n\n\t// Set property \"BaseBlob\":\n\tif action.BaseBlob != nil {\n\t\tbaseBlob_ARM, err := (*action.BaseBlob).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tbaseBlob := *baseBlob_ARM.(*ManagementPolicyBaseBlob_ARM)\n\t\tresult.BaseBlob = &baseBlob\n\t}\n\n\t// Set property \"Snapshot\":\n\tif action.Snapshot != nil {\n\t\tsnapshot_ARM, err := (*action.Snapshot).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tsnapshot := *snapshot_ARM.(*ManagementPolicySnapShot_ARM)\n\t\tresult.Snapshot = &snapshot\n\t}\n\n\t// Set property \"Version\":\n\tif action.Version != nil {\n\t\tversion_ARM, err := (*action.Version).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tversion := *version_ARM.(*ManagementPolicyVersion_ARM)\n\t\tresult.Version = &version\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "0efda7517879bb99225c439c243a0fd1", "score": "0.6384034", "text": "func (options *CreateUpdateOptions) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif options == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &CreateUpdateOptions_ARM{}\n\n\t// Set property \"AutoscaleSettings\":\n\tif options.AutoscaleSettings != nil {\n\t\tautoscaleSettings_ARM, err := (*options.AutoscaleSettings).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tautoscaleSettings := *autoscaleSettings_ARM.(*AutoscaleSettings_ARM)\n\t\tresult.AutoscaleSettings = &autoscaleSettings\n\t}\n\n\t// Set property \"Throughput\":\n\tif options.Throughput != nil {\n\t\tthroughput := *options.Throughput\n\t\tresult.Throughput = &throughput\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "2b05fd10cb26b8f1fe94aeddbc56ecf6", "score": "0.6377325", "text": "func (condition *DeliveryRuleRequestMethodCondition) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif condition == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &DeliveryRuleRequestMethodCondition_ARM{}\n\n\t// Set property \"Name\":\n\tif condition.Name != nil {\n\t\tresult.Name = *condition.Name\n\t}\n\n\t// Set property \"Parameters\":\n\tif condition.Parameters != nil {\n\t\tparameters_ARM, err := (*condition.Parameters).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tparameters := *parameters_ARM.(*RequestMethodMatchConditionParameters_ARM)\n\t\tresult.Parameters = &parameters\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "2b05fd10cb26b8f1fe94aeddbc56ecf6", "score": "0.6377325", "text": "func (condition *DeliveryRuleRequestMethodCondition) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif condition == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &DeliveryRuleRequestMethodCondition_ARM{}\n\n\t// Set property \"Name\":\n\tif condition.Name != nil {\n\t\tresult.Name = *condition.Name\n\t}\n\n\t// Set property \"Parameters\":\n\tif condition.Parameters != nil {\n\t\tparameters_ARM, err := (*condition.Parameters).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tparameters := *parameters_ARM.(*RequestMethodMatchConditionParameters_ARM)\n\t\tresult.Parameters = &parameters\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "733fdec6ccb1ee31e6857e64d6501779", "score": "0.6363096", "text": "func (configuration *VirtualMachineScaleSetIPConfiguration) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif configuration == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &VirtualMachineScaleSetIPConfiguration_ARM{}\n\n\t// Set property \"Id\":\n\tif configuration.Reference != nil {\n\t\treferenceARMID, err := resolved.ResolvedReferences.Lookup(*configuration.Reference)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treference := referenceARMID\n\t\tresult.Id = &reference\n\t}\n\n\t// Set property \"Name\":\n\tif configuration.Name != nil {\n\t\tname := *configuration.Name\n\t\tresult.Name = &name\n\t}\n\n\t// Set property \"Properties\":\n\tif configuration.ApplicationGatewayBackendAddressPools != nil ||\n\t\tconfiguration.ApplicationSecurityGroups != nil ||\n\t\tconfiguration.LoadBalancerBackendAddressPools != nil ||\n\t\tconfiguration.LoadBalancerInboundNatPools != nil ||\n\t\tconfiguration.Primary != nil ||\n\t\tconfiguration.PrivateIPAddressVersion != nil ||\n\t\tconfiguration.PublicIPAddressConfiguration != nil ||\n\t\tconfiguration.Subnet != nil {\n\t\tresult.Properties = &VirtualMachineScaleSetIPConfigurationProperties_ARM{}\n\t}\n\tfor _, item := range configuration.ApplicationGatewayBackendAddressPools {\n\t\titem_ARM, err := item.ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult.Properties.ApplicationGatewayBackendAddressPools = append(result.Properties.ApplicationGatewayBackendAddressPools, *item_ARM.(*SubResource_ARM))\n\t}\n\tfor _, item := range configuration.ApplicationSecurityGroups {\n\t\titem_ARM, err := item.ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult.Properties.ApplicationSecurityGroups = append(result.Properties.ApplicationSecurityGroups, *item_ARM.(*SubResource_ARM))\n\t}\n\tfor _, item := range configuration.LoadBalancerBackendAddressPools {\n\t\titem_ARM, err := item.ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult.Properties.LoadBalancerBackendAddressPools = append(result.Properties.LoadBalancerBackendAddressPools, *item_ARM.(*SubResource_ARM))\n\t}\n\tfor _, item := range configuration.LoadBalancerInboundNatPools {\n\t\titem_ARM, err := item.ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult.Properties.LoadBalancerInboundNatPools = append(result.Properties.LoadBalancerInboundNatPools, *item_ARM.(*SubResource_ARM))\n\t}\n\tif configuration.Primary != nil {\n\t\tprimary := *configuration.Primary\n\t\tresult.Properties.Primary = &primary\n\t}\n\tif configuration.PrivateIPAddressVersion != nil {\n\t\tprivateIPAddressVersion := *configuration.PrivateIPAddressVersion\n\t\tresult.Properties.PrivateIPAddressVersion = &privateIPAddressVersion\n\t}\n\tif configuration.PublicIPAddressConfiguration != nil {\n\t\tpublicIPAddressConfiguration_ARM, err := (*configuration.PublicIPAddressConfiguration).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tpublicIPAddressConfiguration := *publicIPAddressConfiguration_ARM.(*VirtualMachineScaleSetPublicIPAddressConfiguration_ARM)\n\t\tresult.Properties.PublicIPAddressConfiguration = &publicIPAddressConfiguration\n\t}\n\tif configuration.Subnet != nil {\n\t\tsubnet_ARM, err := (*configuration.Subnet).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tsubnet := *subnet_ARM.(*ApiEntityReference_ARM)\n\t\tresult.Properties.Subnet = &subnet\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "f7c192c1b3cd2f7c3406819055680835", "score": "0.63352066", "text": "func (parameters *UrlRewriteActionParameters) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif parameters == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &UrlRewriteActionParameters_ARM{}\n\n\t// Set property \"Destination\":\n\tif parameters.Destination != nil {\n\t\tdestination := *parameters.Destination\n\t\tresult.Destination = &destination\n\t}\n\n\t// Set property \"PreserveUnmatchedPath\":\n\tif parameters.PreserveUnmatchedPath != nil {\n\t\tpreserveUnmatchedPath := *parameters.PreserveUnmatchedPath\n\t\tresult.PreserveUnmatchedPath = &preserveUnmatchedPath\n\t}\n\n\t// Set property \"SourcePattern\":\n\tif parameters.SourcePattern != nil {\n\t\tsourcePattern := *parameters.SourcePattern\n\t\tresult.SourcePattern = &sourcePattern\n\t}\n\n\t// Set property \"TypeName\":\n\tif parameters.TypeName != nil {\n\t\ttypeName := *parameters.TypeName\n\t\tresult.TypeName = &typeName\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "f7c192c1b3cd2f7c3406819055680835", "score": "0.63352066", "text": "func (parameters *UrlRewriteActionParameters) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif parameters == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &UrlRewriteActionParameters_ARM{}\n\n\t// Set property \"Destination\":\n\tif parameters.Destination != nil {\n\t\tdestination := *parameters.Destination\n\t\tresult.Destination = &destination\n\t}\n\n\t// Set property \"PreserveUnmatchedPath\":\n\tif parameters.PreserveUnmatchedPath != nil {\n\t\tpreserveUnmatchedPath := *parameters.PreserveUnmatchedPath\n\t\tresult.PreserveUnmatchedPath = &preserveUnmatchedPath\n\t}\n\n\t// Set property \"SourcePattern\":\n\tif parameters.SourcePattern != nil {\n\t\tsourcePattern := *parameters.SourcePattern\n\t\tresult.SourcePattern = &sourcePattern\n\t}\n\n\t// Set property \"TypeName\":\n\tif parameters.TypeName != nil {\n\t\ttypeName := *parameters.TypeName\n\t\tresult.TypeName = &typeName\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "0611dc7925670f4a782103d0b4c26179", "score": "0.63330436", "text": "func (database *DatabaseAccounts_MongodbDatabase_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif database == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &DatabaseAccounts_MongodbDatabase_Spec_ARM{}\n\n\t// Set property \"Location\":\n\tif database.Location != nil {\n\t\tlocation := *database.Location\n\t\tresult.Location = &location\n\t}\n\n\t// Set property \"Name\":\n\tresult.Name = resolved.Name\n\n\t// Set property \"Properties\":\n\tif database.Options != nil || database.Resource != nil {\n\t\tresult.Properties = &MongoDBDatabaseCreateUpdateProperties_ARM{}\n\t}\n\tif database.Options != nil {\n\t\toptions_ARM, err := (*database.Options).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\toptions := *options_ARM.(*CreateUpdateOptions_ARM)\n\t\tresult.Properties.Options = &options\n\t}\n\tif database.Resource != nil {\n\t\tresource_ARM, err := (*database.Resource).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresource := *resource_ARM.(*MongoDBDatabaseResource_ARM)\n\t\tresult.Properties.Resource = &resource\n\t}\n\n\t// Set property \"Tags\":\n\tif database.Tags != nil {\n\t\tresult.Tags = make(map[string]string, len(database.Tags))\n\t\tfor key, value := range database.Tags {\n\t\t\tresult.Tags[key] = value\n\t\t}\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "d4dba7cf0d771ee2b91d3e48b2d54fdb", "score": "0.6332815", "text": "func (action *UrlSigningAction) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif action == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &UrlSigningAction_ARM{}\n\n\t// Set property \"Name\":\n\tif action.Name != nil {\n\t\tresult.Name = *action.Name\n\t}\n\n\t// Set property \"Parameters\":\n\tif action.Parameters != nil {\n\t\tparameters_ARM, err := (*action.Parameters).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tparameters := *parameters_ARM.(*UrlSigningActionParameters_ARM)\n\t\tresult.Parameters = &parameters\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "d4dba7cf0d771ee2b91d3e48b2d54fdb", "score": "0.6332815", "text": "func (action *UrlSigningAction) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif action == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &UrlSigningAction_ARM{}\n\n\t// Set property \"Name\":\n\tif action.Name != nil {\n\t\tresult.Name = *action.Name\n\t}\n\n\t// Set property \"Parameters\":\n\tif action.Parameters != nil {\n\t\tparameters_ARM, err := (*action.Parameters).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tparameters := *parameters_ARM.(*UrlSigningActionParameters_ARM)\n\t\tresult.Parameters = &parameters\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "aca1b25e949c017096f8a1dfbd4ae2c5", "score": "0.6329808", "text": "func (policy *UpgradePolicy) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif policy == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &UpgradePolicy_ARM{}\n\n\t// Set property \"AutomaticOSUpgradePolicy\":\n\tif policy.AutomaticOSUpgradePolicy != nil {\n\t\tautomaticOSUpgradePolicy_ARM, err := (*policy.AutomaticOSUpgradePolicy).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tautomaticOSUpgradePolicy := *automaticOSUpgradePolicy_ARM.(*AutomaticOSUpgradePolicy_ARM)\n\t\tresult.AutomaticOSUpgradePolicy = &automaticOSUpgradePolicy\n\t}\n\n\t// Set property \"Mode\":\n\tif policy.Mode != nil {\n\t\tmode := *policy.Mode\n\t\tresult.Mode = &mode\n\t}\n\n\t// Set property \"RollingUpgradePolicy\":\n\tif policy.RollingUpgradePolicy != nil {\n\t\trollingUpgradePolicy_ARM, err := (*policy.RollingUpgradePolicy).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trollingUpgradePolicy := *rollingUpgradePolicy_ARM.(*RollingUpgradePolicy_ARM)\n\t\tresult.RollingUpgradePolicy = &rollingUpgradePolicy\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "f92654ac2e30d380d17e140d04147c16", "score": "0.6329638", "text": "func (creation *DateAfterCreation) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif creation == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &DateAfterCreation_ARM{}\n\n\t// Set property \"DaysAfterCreationGreaterThan\":\n\tif creation.DaysAfterCreationGreaterThan != nil {\n\t\tdaysAfterCreationGreaterThan := *creation.DaysAfterCreationGreaterThan\n\t\tresult.DaysAfterCreationGreaterThan = &daysAfterCreationGreaterThan\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "d4ff750c8e1bc99e91465fab1157a874", "score": "0.6327393", "text": "func (action *DeliveryRuleAction) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif action == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &DeliveryRuleAction_ARM{}\n\n\t// Set property \"CacheExpiration\":\n\tif action.CacheExpiration != nil {\n\t\tcacheExpiration_ARM, err := (*action.CacheExpiration).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcacheExpiration := *cacheExpiration_ARM.(*DeliveryRuleCacheExpirationAction_ARM)\n\t\tresult.CacheExpiration = &cacheExpiration\n\t}\n\n\t// Set property \"CacheKeyQueryString\":\n\tif action.CacheKeyQueryString != nil {\n\t\tcacheKeyQueryString_ARM, err := (*action.CacheKeyQueryString).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcacheKeyQueryString := *cacheKeyQueryString_ARM.(*DeliveryRuleCacheKeyQueryStringAction_ARM)\n\t\tresult.CacheKeyQueryString = &cacheKeyQueryString\n\t}\n\n\t// Set property \"ModifyRequestHeader\":\n\tif action.ModifyRequestHeader != nil {\n\t\tmodifyRequestHeader_ARM, err := (*action.ModifyRequestHeader).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tmodifyRequestHeader := *modifyRequestHeader_ARM.(*DeliveryRuleRequestHeaderAction_ARM)\n\t\tresult.ModifyRequestHeader = &modifyRequestHeader\n\t}\n\n\t// Set property \"ModifyResponseHeader\":\n\tif action.ModifyResponseHeader != nil {\n\t\tmodifyResponseHeader_ARM, err := (*action.ModifyResponseHeader).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tmodifyResponseHeader := *modifyResponseHeader_ARM.(*DeliveryRuleResponseHeaderAction_ARM)\n\t\tresult.ModifyResponseHeader = &modifyResponseHeader\n\t}\n\n\t// Set property \"OriginGroupOverride\":\n\tif action.OriginGroupOverride != nil {\n\t\toriginGroupOverride_ARM, err := (*action.OriginGroupOverride).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\toriginGroupOverride := *originGroupOverride_ARM.(*OriginGroupOverrideAction_ARM)\n\t\tresult.OriginGroupOverride = &originGroupOverride\n\t}\n\n\t// Set property \"RouteConfigurationOverride\":\n\tif action.RouteConfigurationOverride != nil {\n\t\trouteConfigurationOverride_ARM, err := (*action.RouteConfigurationOverride).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trouteConfigurationOverride := *routeConfigurationOverride_ARM.(*DeliveryRuleRouteConfigurationOverrideAction_ARM)\n\t\tresult.RouteConfigurationOverride = &routeConfigurationOverride\n\t}\n\n\t// Set property \"UrlRedirect\":\n\tif action.UrlRedirect != nil {\n\t\turlRedirect_ARM, err := (*action.UrlRedirect).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\turlRedirect := *urlRedirect_ARM.(*UrlRedirectAction_ARM)\n\t\tresult.UrlRedirect = &urlRedirect\n\t}\n\n\t// Set property \"UrlRewrite\":\n\tif action.UrlRewrite != nil {\n\t\turlRewrite_ARM, err := (*action.UrlRewrite).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\turlRewrite := *urlRewrite_ARM.(*UrlRewriteAction_ARM)\n\t\tresult.UrlRewrite = &urlRewrite\n\t}\n\n\t// Set property \"UrlSigning\":\n\tif action.UrlSigning != nil {\n\t\turlSigning_ARM, err := (*action.UrlSigning).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\turlSigning := *urlSigning_ARM.(*UrlSigningAction_ARM)\n\t\tresult.UrlSigning = &urlSigning\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "d4ff750c8e1bc99e91465fab1157a874", "score": "0.6327393", "text": "func (action *DeliveryRuleAction) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif action == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &DeliveryRuleAction_ARM{}\n\n\t// Set property \"CacheExpiration\":\n\tif action.CacheExpiration != nil {\n\t\tcacheExpiration_ARM, err := (*action.CacheExpiration).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcacheExpiration := *cacheExpiration_ARM.(*DeliveryRuleCacheExpirationAction_ARM)\n\t\tresult.CacheExpiration = &cacheExpiration\n\t}\n\n\t// Set property \"CacheKeyQueryString\":\n\tif action.CacheKeyQueryString != nil {\n\t\tcacheKeyQueryString_ARM, err := (*action.CacheKeyQueryString).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcacheKeyQueryString := *cacheKeyQueryString_ARM.(*DeliveryRuleCacheKeyQueryStringAction_ARM)\n\t\tresult.CacheKeyQueryString = &cacheKeyQueryString\n\t}\n\n\t// Set property \"ModifyRequestHeader\":\n\tif action.ModifyRequestHeader != nil {\n\t\tmodifyRequestHeader_ARM, err := (*action.ModifyRequestHeader).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tmodifyRequestHeader := *modifyRequestHeader_ARM.(*DeliveryRuleRequestHeaderAction_ARM)\n\t\tresult.ModifyRequestHeader = &modifyRequestHeader\n\t}\n\n\t// Set property \"ModifyResponseHeader\":\n\tif action.ModifyResponseHeader != nil {\n\t\tmodifyResponseHeader_ARM, err := (*action.ModifyResponseHeader).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tmodifyResponseHeader := *modifyResponseHeader_ARM.(*DeliveryRuleResponseHeaderAction_ARM)\n\t\tresult.ModifyResponseHeader = &modifyResponseHeader\n\t}\n\n\t// Set property \"OriginGroupOverride\":\n\tif action.OriginGroupOverride != nil {\n\t\toriginGroupOverride_ARM, err := (*action.OriginGroupOverride).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\toriginGroupOverride := *originGroupOverride_ARM.(*OriginGroupOverrideAction_ARM)\n\t\tresult.OriginGroupOverride = &originGroupOverride\n\t}\n\n\t// Set property \"RouteConfigurationOverride\":\n\tif action.RouteConfigurationOverride != nil {\n\t\trouteConfigurationOverride_ARM, err := (*action.RouteConfigurationOverride).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trouteConfigurationOverride := *routeConfigurationOverride_ARM.(*DeliveryRuleRouteConfigurationOverrideAction_ARM)\n\t\tresult.RouteConfigurationOverride = &routeConfigurationOverride\n\t}\n\n\t// Set property \"UrlRedirect\":\n\tif action.UrlRedirect != nil {\n\t\turlRedirect_ARM, err := (*action.UrlRedirect).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\turlRedirect := *urlRedirect_ARM.(*UrlRedirectAction_ARM)\n\t\tresult.UrlRedirect = &urlRedirect\n\t}\n\n\t// Set property \"UrlRewrite\":\n\tif action.UrlRewrite != nil {\n\t\turlRewrite_ARM, err := (*action.UrlRewrite).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\turlRewrite := *urlRewrite_ARM.(*UrlRewriteAction_ARM)\n\t\tresult.UrlRewrite = &urlRewrite\n\t}\n\n\t// Set property \"UrlSigning\":\n\tif action.UrlSigning != nil {\n\t\turlSigning_ARM, err := (*action.UrlSigning).ConvertToARM(resolved)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\turlSigning := *urlSigning_ARM.(*UrlSigningAction_ARM)\n\t\tresult.UrlSigning = &urlSigning\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "3cec38a8be575e8484cb7635a6c88f06", "score": "0.6326289", "text": "func (policy *AutomaticRepairsPolicy) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif policy == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &AutomaticRepairsPolicy_ARM{}\n\n\t// Set property \"Enabled\":\n\tif policy.Enabled != nil {\n\t\tenabled := *policy.Enabled\n\t\tresult.Enabled = &enabled\n\t}\n\n\t// Set property \"GracePeriod\":\n\tif policy.GracePeriod != nil {\n\t\tgracePeriod := *policy.GracePeriod\n\t\tresult.GracePeriod = &gracePeriod\n\t}\n\n\t// Set property \"RepairAction\":\n\tif policy.RepairAction != nil {\n\t\trepairAction := *policy.RepairAction\n\t\tresult.RepairAction = &repairAction\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "18e31e52ea546a7f7ae92d849459cef4", "score": "0.63241166", "text": "func (properties *KekIdentityProperties) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif properties == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &KekIdentityProperties_ARM{}\n\n\t// Set property \"UseSystemAssignedIdentity\":\n\tif properties.UseSystemAssignedIdentity != nil {\n\t\tuseSystemAssignedIdentity := *(*properties.UseSystemAssignedIdentity).DeepCopy()\n\t\tresult.UseSystemAssignedIdentity = &useSystemAssignedIdentity\n\t}\n\n\t// Set property \"UserAssignedIdentity\":\n\tif properties.UserAssignedIdentityReference != nil {\n\t\tuserAssignedIdentityReferenceARMID, err := resolved.ResolvedReferences.Lookup(*properties.UserAssignedIdentityReference)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tuserAssignedIdentityReference := userAssignedIdentityReferenceARMID\n\t\tresult.UserAssignedIdentity = &userAssignedIdentityReference\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "db2d3aaf324a691958538cef68ed9a96", "score": "0.6314858", "text": "func (parameters *RequestSchemeMatchConditionParameters) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif parameters == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &RequestSchemeMatchConditionParameters_ARM{}\n\n\t// Set property \"MatchValues\":\n\tfor _, item := range parameters.MatchValues {\n\t\tresult.MatchValues = append(result.MatchValues, item)\n\t}\n\n\t// Set property \"NegateCondition\":\n\tif parameters.NegateCondition != nil {\n\t\tnegateCondition := *parameters.NegateCondition\n\t\tresult.NegateCondition = &negateCondition\n\t}\n\n\t// Set property \"Operator\":\n\tif parameters.Operator != nil {\n\t\toperator := *parameters.Operator\n\t\tresult.Operator = &operator\n\t}\n\n\t// Set property \"Transforms\":\n\tfor _, item := range parameters.Transforms {\n\t\tresult.Transforms = append(result.Transforms, item)\n\t}\n\n\t// Set property \"TypeName\":\n\tif parameters.TypeName != nil {\n\t\ttypeName := *parameters.TypeName\n\t\tresult.TypeName = &typeName\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "db2d3aaf324a691958538cef68ed9a96", "score": "0.6314858", "text": "func (parameters *RequestSchemeMatchConditionParameters) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {\n\tif parameters == nil {\n\t\treturn nil, nil\n\t}\n\tresult := &RequestSchemeMatchConditionParameters_ARM{}\n\n\t// Set property \"MatchValues\":\n\tfor _, item := range parameters.MatchValues {\n\t\tresult.MatchValues = append(result.MatchValues, item)\n\t}\n\n\t// Set property \"NegateCondition\":\n\tif parameters.NegateCondition != nil {\n\t\tnegateCondition := *parameters.NegateCondition\n\t\tresult.NegateCondition = &negateCondition\n\t}\n\n\t// Set property \"Operator\":\n\tif parameters.Operator != nil {\n\t\toperator := *parameters.Operator\n\t\tresult.Operator = &operator\n\t}\n\n\t// Set property \"Transforms\":\n\tfor _, item := range parameters.Transforms {\n\t\tresult.Transforms = append(result.Transforms, item)\n\t}\n\n\t// Set property \"TypeName\":\n\tif parameters.TypeName != nil {\n\t\ttypeName := *parameters.TypeName\n\t\tresult.TypeName = &typeName\n\t}\n\treturn result, nil\n}", "title": "" } ]
a86d55ae88791289ff340cf6f37ef458
Open a new closure cursor.
[ { "docid": "ca56ff637145941761ffb0f3835e2544", "score": "0.7246064", "text": "func closureOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* closure.c:579:12: */\n\tvar p uintptr = pVTab\n\tvar pCur uintptr\n\tpCur = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(closure_cursor{})))\n\tif pCur == uintptr(0) {\n\t\treturn SQLITE_NOMEM\n\t}\n\tlibc.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(closure_cursor{})))\n\t(*closure_cursor)(unsafe.Pointer(pCur)).FpVtab = p\n\t*(*uintptr)(unsafe.Pointer(ppCursor)) = (pCur /* &.base */)\n\t(*closure_vtab)(unsafe.Pointer(p)).FnCursor++\n\treturn SQLITE_OK\n}", "title": "" } ]
[ { "docid": "dddb625f3d2c5f90771dd9592c0e49cd", "score": "0.6598815", "text": "func newCursor(client *Client, fn requestFn, limit int) (c *cursor, err error) {\n\treturn &cursor{client: client, requestFn: fn, limit: limit}, nil\n}", "title": "" }, { "docid": "4d465fb5a7b8e2ec4ed3385a7a2a6544", "score": "0.6533068", "text": "func NewCursor() *Cursor {\n\treturn &Cursor{pos: 0, downwards: true, unlimited: true}\n}", "title": "" }, { "docid": "4910c8f35c7524f8768df0bcb0cec202", "score": "0.6263867", "text": "func newCursor(data cursorData, endpoint string, db *database, allowDirtyReads bool) (Cursor, error) {\n\tif db == nil {\n\t\treturn nil, WithStack(InvalidArgumentError{Message: \"db is nil\"})\n\t}\n\n\tc := &cursor{\n\t\tcursorData: data,\n\t\tendpoint: endpoint,\n\t\tdb: db,\n\t\tconn: db.conn,\n\t\tallowDirtyReads: allowDirtyReads,\n\t}\n\n\tif data.NextBatchID != \"\" {\n\t\tc.retryData = &retryData{\n\t\t\tcursorID: data.ID,\n\t\t\tcurrentBatchID: \"1\",\n\t\t}\n\t}\n\n\treturn c, nil\n}", "title": "" }, { "docid": "217a9a9eeafb1761002bd9e69b96a14c", "score": "0.6243538", "text": "func NewCursor(conn *Connection) *Cursor {\n\treturn &Cursor{connection: conn, environment: conn.environment,\n\t\tarraySize: DefaultArraySize, fetchArraySize: DefaultArraySize,\n\t\tbindArraySize: 1, statementType: -1, outputSize: -1, outputSizeColumn: -1,\n\t\tisOpen: true}\n}", "title": "" }, { "docid": "9ffb575731e0c7f78c2c4e25a2587c8c", "score": "0.61439073", "text": "func NewCursors() Cursors {\n\treturn make(Cursors)\n}", "title": "" }, { "docid": "847b837fd1297eb5d2bcd114d8463526", "score": "0.6031848", "text": "func NewCursor(m *MemoryStore) *Cursor {\n\treturn &Cursor{\n\t\tMemoryStore: m,\n\t\tp: -1,\n\t}\n}", "title": "" }, { "docid": "3191ff68ccd43697b26d6cb00b4a7d6b", "score": "0.5914605", "text": "func (view *View) OpenCursor(key []byte) (api.Cursor, error) {\n\tcur := view.getcursor().opencursor(nil, view.snapshot, key)\n\treturn cur, nil\n}", "title": "" }, { "docid": "a38b19e5e941bd4b1b29e4ebd98da632", "score": "0.570932", "text": "func newBufCursor(cur cursor, ascending bool) *bufCursor {\n\treturn &bufCursor{cur: cur, ascending: ascending}\n}", "title": "" }, { "docid": "a1b854e7db4ad9adc54b36f25c6deab1", "score": "0.56003773", "text": "func closureNext(tls *libc.TLS, cur uintptr) int32 { /* closure.c:621:12: */\n\tvar pCur uintptr = cur\n\t(*closure_cursor)(unsafe.Pointer(pCur)).FpCurrent = closureAvlNext(tls, (*closure_cursor)(unsafe.Pointer(pCur)).FpCurrent)\n\treturn SQLITE_OK\n}", "title": "" }, { "docid": "70e484e6eb56d6cdf1f3df5f96877ade", "score": "0.5539782", "text": "func NewCursor(r *sdl.Renderer) *Cursor {\n\treturn &Cursor{\n\t\trenderer: r,\n\t}\n}", "title": "" }, { "docid": "5adb25a2ffdc00e1a15aa5913f30ba5c", "score": "0.55323726", "text": "func (m *MemoryStore) Cursor(fn func(c storage.Cursor)) error {\n\tfn(NewCursor(m))\n\treturn nil\n}", "title": "" }, { "docid": "cc312ae60e6cc68f4d4da30cda79f4d3", "score": "0.55073905", "text": "func (b *Bucket) cursor() *Cursor {\n\treturn &Cursor{\n\t\ttransaction: b.transaction,\n\t\troot: b.root,\n\t\tstack: make([]pageElementRef, 0),\n\t}\n}", "title": "" }, { "docid": "dc45bb23cb236a52e7f908973ff87462", "score": "0.548059", "text": "func CursorNew(cursor_type C.GdkCursorType) (return__ *Cursor) {\n\tvar __cgo__return__ interface{}\n\t__cgo__return__ = C.gdk_cursor_new(cursor_type)\n\tif __cgo__return__ != nil {\n\t\treturn__ = NewCursorFromCPointer(unsafe.Pointer(reflect.ValueOf(__cgo__return__).Pointer()))\n\t}\n\treturn\n}", "title": "" }, { "docid": "c50f08e0f74ad5444521c7767e8acc29", "score": "0.5469415", "text": "func (conn *Connection) Cursor() *Cursor {\n\treturn NewCursor(conn)\n}", "title": "" }, { "docid": "b6128dca57ed463d5fcc84083f59d96e", "score": "0.5438821", "text": "func (c *Connection) Cursor() *Cursor {\n\treturn &Cursor{\n\t\tconn: c,\n\t\tqueue: make([]*hiveserver.TColumn, 0),\n\t}\n}", "title": "" }, { "docid": "83d9c16cb0ac7047f5b30aa175e94f9c", "score": "0.53818804", "text": "func fsOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* test_fs.c:662:12: */\n\tvar pCur uintptr\n\tpCur = sqlite3.Xsqlite3MallocZero(tls, uint64(unsafe.Sizeof(fs_cursor{})))\n\t*(*uintptr)(unsafe.Pointer(ppCursor)) = (pCur /* &.base */)\n\treturn SQLITE_OK\n}", "title": "" }, { "docid": "57d3d88f489435215d05c5bf5b4bcf26", "score": "0.53713495", "text": "func CreateStandardCursor(shape int32) *Cursor {\n\tcshape, _ := (C.int)(shape), cgoAllocsUnknown\n\t__ret := C.glfwCreateStandardCursor(cshape)\n\t__v := *(**Cursor)(unsafe.Pointer(&__ret))\n\treturn __v\n}", "title": "" }, { "docid": "6896765da5179d7205375ff0771fc973", "score": "0.53688425", "text": "func echoOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* test8.c:557:12: */\n\tvar pCur uintptr\n\tif simulateVtabError(tls, pVTab, ts+27701 /* \"xOpen\" */) != 0 {\n\t\treturn SQLITE_ERROR\n\t}\n\tpCur = sqlite3.Xsqlite3MallocZero(tls, uint64(unsafe.Sizeof(echo_cursor{})))\n\t*(*uintptr)(unsafe.Pointer(ppCursor)) = pCur\n\treturn func() int32 {\n\t\tif pCur != 0 {\n\t\t\treturn SQLITE_OK\n\t\t}\n\t\treturn SQLITE_NOMEM\n\t}()\n}", "title": "" }, { "docid": "ff9368784416083ea9fee4dc8bc2170c", "score": "0.5319729", "text": "func tclOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* test_bestindex.c:234:12: */\n\tvar pCur uintptr\n\tpCur = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(tcl_cursor{})))\n\tif pCur == uintptr(0) {\n\t\treturn SQLITE_NOMEM\n\t}\n\tlibc.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(tcl_cursor{})))\n\t*(*uintptr)(unsafe.Pointer(ppCursor)) = (pCur /* &.base */)\n\treturn SQLITE_OK\n}", "title": "" }, { "docid": "e055a196de3385e881451b4124d6f350", "score": "0.53160435", "text": "func NewDeclareCursor(name string, selectStatement sql.Node) *DeclareCursor {\n\treturn &DeclareCursor{\n\t\tName: name,\n\t\tSelect: selectStatement,\n\t}\n}", "title": "" }, { "docid": "d82816b3b6ac9a1b954b18737f857acc", "score": "0.53109014", "text": "func CreateCursor(image *Image, xhot int32, yhot int32) *Cursor {\n\tcimage, _ := image.PassRef()\n\tcxhot, _ := (C.int)(xhot), cgoAllocsUnknown\n\tcyhot, _ := (C.int)(yhot), cgoAllocsUnknown\n\t__ret := C.glfwCreateCursor(cimage, cxhot, cyhot)\n\t__v := *(**Cursor)(unsafe.Pointer(&__ret))\n\treturn __v\n}", "title": "" }, { "docid": "f9096421357e8b6c024cfb3ee85e7a57", "score": "0.52999544", "text": "func closureClose(tls *libc.TLS, cur uintptr) int32 { /* closure.c:610:12: */\n\tvar pCur uintptr = cur\n\tclosureClearCursor(tls, pCur)\n\t(*closure_vtab)(unsafe.Pointer((*closure_cursor)(unsafe.Pointer(pCur)).FpVtab)).FnCursor--\n\tsqlite3.Xsqlite3_free(tls, pCur)\n\treturn SQLITE_OK\n}", "title": "" }, { "docid": "e05b2a75f1e3a38ad393b239b50c365e", "score": "0.5259148", "text": "func NewCursor(ctx context.Context, query *LogQuery, logChannel LogEntryChannel, logsPerRequest uint32) *Cursor {\n\treturn &Cursor{\n\t\tctx: ctx,\n\t\t// FilePos -1 signals that the LogQuery is to be used to start\n\t\tposition: cursorPosition{\n\t\t\tFilePosition: -1,\n\t\t},\n\t\tquery: *query,\n\t\tunreadMessages: logChannel,\n\t\tlogsPerRequest: logsPerRequest,\n\t}\n}", "title": "" }, { "docid": "7fcaf20e5a1a0c8fdcc4605ccde1bc29", "score": "0.5233843", "text": "func closureClearCursor(tls *libc.TLS, pCur uintptr) { /* closure.c:595:13: */\n\tclosureAvlDestroy(tls, (*closure_cursor)(unsafe.Pointer(pCur)).FpClosure, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sqlite3.Xsqlite3_free})))\n\tsqlite3.Xsqlite3_free(tls, (*closure_cursor)(unsafe.Pointer(pCur)).FzTableName)\n\tsqlite3.Xsqlite3_free(tls, (*closure_cursor)(unsafe.Pointer(pCur)).FzIdColumn)\n\tsqlite3.Xsqlite3_free(tls, (*closure_cursor)(unsafe.Pointer(pCur)).FzParentColumn)\n\t(*closure_cursor)(unsafe.Pointer(pCur)).FzTableName = uintptr(0)\n\t(*closure_cursor)(unsafe.Pointer(pCur)).FzIdColumn = uintptr(0)\n\t(*closure_cursor)(unsafe.Pointer(pCur)).FzParentColumn = uintptr(0)\n\t(*closure_cursor)(unsafe.Pointer(pCur)).FpCurrent = uintptr(0)\n\t(*closure_cursor)(unsafe.Pointer(pCur)).FpClosure = uintptr(0)\n}", "title": "" }, { "docid": "7cf3cfd9a84caeee43585036613a8c45", "score": "0.51970464", "text": "func (q *Query) Cursor(in toolkit.M) dbflex.ICursor {\n\tcursor := new(Cursor)\n\tcursor.SetThis(cursor)\n\n\tct := q.Config(dbflex.ConfigKeyCommandType, dbflex.QuerySelect).(string)\n\tif ct != dbflex.QuerySelect && ct != dbflex.QuerySQL {\n\t\tcursor.SetError(toolkit.Errorf(\"cursor is used for only select command\"))\n\t\treturn cursor\n\t}\n\n\tcmdtxt := q.Config(dbflex.ConfigKeyCommand, \"\").(string)\n\tif cmdtxt == \"\" {\n\t\tcursor.SetError(toolkit.Errorf(\"no command\"))\n\t\treturn cursor\n\t}\n\n\ttablename := q.Config(dbflex.ConfigKeyTableName, \"\").(string)\n\tcq := dbflex.From(tablename).Select(\"count(*) as Count\")\n\tfilter := q.Config(dbflex.ConfigKeyFilter, nil)\n\tif filter != nil {\n\t\tcq.Where(filter.(*dbflex.Filter))\n\t}\n\tcursor.SetCountCommand(cq)\n\n\t//convey.Println(\"cursor command: \", cmdtxt)\n\trows, err := q.db.Query(cmdtxt)\n\tif rows == nil {\n\t\tcursor.SetError(toolkit.Errorf(\"%s. SQL Command: %s\", err.Error(), cmdtxt))\n\t} else {\n\t\tcursor.SetFetcher(rows)\n\t}\n\treturn cursor\n}", "title": "" }, { "docid": "f91fc48f6e7b2402c28328b2204fa789", "score": "0.5192674", "text": "func carrayOpen(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* carray.c:150:12: */\n\tvar pCur uintptr\n\tpCur = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(carray_cursor{})))\n\tif pCur == uintptr(0) {\n\t\treturn SQLITE_NOMEM\n\t}\n\tlibc.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(carray_cursor{})))\n\t*(*uintptr)(unsafe.Pointer(ppCursor)) = (pCur /* &.base */)\n\treturn SQLITE_OK\n}", "title": "" }, { "docid": "dcd429c526edad7d7219e04e53cc2efb", "score": "0.5147815", "text": "func NewNullCursor() Cursor {\n\treturn Cursor{C.clang_getNullCursor()}\n}", "title": "" }, { "docid": "48e1e025846b8ac9e918b136646d7e26", "score": "0.51459366", "text": "func fuzzerOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* fuzzer.c:556:12: */\n\tvar p uintptr = pVTab\n\tvar pCur uintptr\n\tpCur = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(fuzzer_cursor{})))\n\tif pCur == uintptr(0) {\n\t\treturn SQLITE_NOMEM\n\t}\n\tlibc.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(fuzzer_cursor{})))\n\t(*fuzzer_cursor)(unsafe.Pointer(pCur)).FpVtab = p\n\t*(*uintptr)(unsafe.Pointer(ppCursor)) = (pCur /* &.base */)\n\t(*fuzzer_vtab)(unsafe.Pointer(p)).FnCursor++\n\treturn SQLITE_OK\n}", "title": "" }, { "docid": "1becc6b11e0b5eec370ddb9ddb4d572a", "score": "0.5066513", "text": "func (r *SQLRepo) GetCursor(batchSize int, depRepo depository.Repository) *Cursor {\n\tnow := time.Now()\n\treturn &Cursor{\n\t\tBatchSize: batchSize,\n\t\tTransferRepo: r,\n\t\tnewerThan: time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.UTC),\n\t\tDepRepo: depRepo,\n\t}\n}", "title": "" }, { "docid": "1b7045d4579c24731794a8681404bdd1", "score": "0.5056905", "text": "func NewCursorOutput(width int) CursorOutput {\n\treturn CursorOutput{nil, new(bytes.Buffer), CursorWidth{0, 0, width}}\n}", "title": "" }, { "docid": "bf6d5de7b56dcc9b47a09e30575c38cb", "score": "0.50087065", "text": "func CursorNewForDisplay(display IsDisplay, cursor_type C.GdkCursorType) (return__ *Cursor) {\n\tvar __cgo__return__ interface{}\n\t__cgo__return__ = C.gdk_cursor_new_for_display(display.GetDisplayPointer(), cursor_type)\n\tif __cgo__return__ != nil {\n\t\treturn__ = NewCursorFromCPointer(unsafe.Pointer(reflect.ValueOf(__cgo__return__).Pointer()))\n\t}\n\treturn\n}", "title": "" }, { "docid": "6813aaf9b0272d7daf215c7113efcc7e", "score": "0.49683702", "text": "func NewSegmentCursor(data []byte, index Seeker) *SegmentCursor {\n\treturn &SegmentCursor{index: index, data: data, nextOffset: 0}\n}", "title": "" }, { "docid": "ff86dcbc3ef6070902362eac83b87cbb", "score": "0.4966961", "text": "func (b *Bucket) Cursor() (kv.Cursor, error) {\n\t// TODO we should do this by using the Ascend/Descend methods that\n\t// the btree provides.\n\tpairs, err := b.getAll()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn kv.NewStaticCursor(pairs), nil\n}", "title": "" }, { "docid": "9a25c5e2debd19310afa7e5b6d9afb84", "score": "0.49598432", "text": "func (p *TScopeList) Open() *Scope {\n\ts := NewScope()\n\ts.Level = len(p.Items)\n\tp.Items = append(p.Items, s)\n\treturn s\n}", "title": "" }, { "docid": "ebda9d21992260cde92b8b4c08ddd0bd", "score": "0.49538663", "text": "func seriesOpen(tls *libc.TLS, pUnused uintptr, ppCursor uintptr) int32 { /* series.c:149:12: */\n\tvar pCur uintptr\n\t_ = pUnused\n\tpCur = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(series_cursor{})))\n\tif pCur == uintptr(0) {\n\t\treturn SQLITE_NOMEM\n\t}\n\tlibc.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(series_cursor{})))\n\t*(*uintptr)(unsafe.Pointer(ppCursor)) = (pCur /* &.base */)\n\treturn SQLITE_OK\n}", "title": "" }, { "docid": "da347d433044fa44e4bd47725f07383b", "score": "0.4951062", "text": "func (s *Stream) BuildCursor(cursorType CursorType) *Cursor {\n\treturn newCursor(s.storage, cursorType)\n}", "title": "" }, { "docid": "45e7d0e5fb94cc9c8b41378020cb3e8f", "score": "0.4941601", "text": "func NewCursorAtCheckpoint(path string) (cursor *Cursor, err error) {\n\tcontrol, err := control.NewControlFromDataDir(path)\n\tif err == nil {\n\t\tblockReader := blockReader{path, control.XlogBlcksz, control.MaxAlign}\n\t\tcheckPointLocation := LocationFromUint32s(control.CheckPointLogID, control.CheckPointRecordOffset)\n\n\t\tcursor = &Cursor{checkPointLocation, blockReader}\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "d1ae6dc6ad908e4d92508f0d839c4ee3", "score": "0.4938575", "text": "func (cur *Cursor) allocateHandle() error {\n\tcur.isOwned = true\n\treturn ociHandleAlloc(unsafe.Pointer(cur.environment.handle),\n\t\tC.OCI_HTYPE_STMT,\n\t\t(*unsafe.Pointer)(unsafe.Pointer(&cur.handle)),\n\t\t\"allocate statement handle\")\n}", "title": "" }, { "docid": "0586fe0b74d5b6a54b14a2224acf9489", "score": "0.49345395", "text": "func tclvarOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* test_tclvar.c:114:12: */\n\tvar pCur uintptr\n\tpCur = sqlite3.Xsqlite3MallocZero(tls, uint64(unsafe.Sizeof(tclvar_cursor{})))\n\t*(*uintptr)(unsafe.Pointer(ppCursor)) = (pCur /* &.base */)\n\treturn SQLITE_OK\n}", "title": "" }, { "docid": "3cc67cece2e20d747a944295731b94db", "score": "0.48903546", "text": "func (s *Streamer) CursorName(name string) *Streamer {\n\ts.cursorNameGenerator = func() string {\n\t\treturn name\n\t}\n\treturn s\n}", "title": "" }, { "docid": "4e944f87934df8032f4afe4de1c2c375", "score": "0.4851269", "text": "func csvtabOpen(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* csv.c:705:12: */\n\tvar pTab uintptr = p\n\tvar pCur uintptr\n\tvar nByte size_t\n\tnByte = (uint64(unsafe.Sizeof(CsvCursor{})) + ((uint64(unsafe.Sizeof(uintptr(0))) + uint64(unsafe.Sizeof(int32(0)))) * uint64((*CsvTable)(unsafe.Pointer(pTab)).FnCol)))\n\tpCur = sqlite3.Xsqlite3_malloc64(tls, uint64(nByte))\n\tif pCur == uintptr(0) {\n\t\treturn SQLITE_NOMEM\n\t}\n\tlibc.Xmemset(tls, pCur, 0, nByte)\n\t(*CsvCursor)(unsafe.Pointer(pCur)).FazVal = (pCur + 1*296)\n\t(*CsvCursor)(unsafe.Pointer(pCur)).FaLen = ((*CsvCursor)(unsafe.Pointer(pCur)).FazVal + uintptr((*CsvTable)(unsafe.Pointer(pTab)).FnCol)*8)\n\t*(*uintptr)(unsafe.Pointer(ppCursor)) = (pCur /* &.base */)\n\tif csv_reader_open(tls, (pCur+8 /* &.rdr */), (*CsvTable)(unsafe.Pointer(pTab)).FzFilename, (*CsvTable)(unsafe.Pointer(pTab)).FzData) != 0 {\n\t\tcsv_xfer_error(tls, pTab, (pCur + 8 /* &.rdr */))\n\t\treturn SQLITE_ERROR\n\t}\n\treturn SQLITE_OK\n}", "title": "" }, { "docid": "1b4e3a68cba5039efebb60f7bd78ecc3", "score": "0.48431557", "text": "func schemaOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* test_schema.c:110:12: */\n\tvar rc int32 = SQLITE_NOMEM\n\tvar pCur uintptr\n\tpCur = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(schema_cursor{})))\n\tif pCur != 0 {\n\t\tlibc.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(schema_cursor{})))\n\t\t*(*uintptr)(unsafe.Pointer(ppCursor)) = pCur\n\t\trc = SQLITE_OK\n\t}\n\treturn rc\n}", "title": "" }, { "docid": "4df958a096597b9012b01ae0a5cf6bc0", "score": "0.4834536", "text": "func (c *Cursor) Close() {\n\tc.cursor.Close()\n}", "title": "" }, { "docid": "4e463b7c1db2c6efa3c22fd4ebc2f0ea", "score": "0.48267195", "text": "func (a *CommitArea) SetCursor(n int) {\n\ta.CurIdx = n\n\ta.cursorValidation()\n}", "title": "" }, { "docid": "cff99749efd1f19a84856c1325e319be", "score": "0.48243648", "text": "func expertOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* sqlite3expert.c:520:12: */\n\tbp := tls.Alloc(4)\n\tdefer tls.Free(4)\n\n\t*(*int32)(unsafe.Pointer(bp /* rc */)) = SQLITE_OK\n\tvar pCsr uintptr\n\t_ = pVTab\n\tpCsr = idxMalloc(tls, bp /* &rc */, int32(unsafe.Sizeof(ExpertCsr{})))\n\t*(*uintptr)(unsafe.Pointer(ppCursor)) = pCsr\n\treturn *(*int32)(unsafe.Pointer(bp /* rc */))\n}", "title": "" }, { "docid": "f1bbd0c56fd54671d26229f987e59117", "score": "0.48242506", "text": "func (c *Cursor) Close() {\n\tc.Err = c.resetState()\n}", "title": "" }, { "docid": "89cd87d8ad185205e5d3954642f04968", "score": "0.4821859", "text": "func explainOpen(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* explain.c:115:12: */\n\tvar pCur uintptr\n\tpCur = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(explain_cursor{})))\n\tif pCur == uintptr(0) {\n\t\treturn SQLITE_NOMEM\n\t}\n\tlibc.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(explain_cursor{})))\n\t(*explain_cursor)(unsafe.Pointer(pCur)).Fdb = (*explain_vtab)(unsafe.Pointer(p)).Fdb\n\t*(*uintptr)(unsafe.Pointer(ppCursor)) = (pCur /* &.base */)\n\treturn SQLITE_OK\n}", "title": "" }, { "docid": "5dd3a5fdd7f5dea118ec67ba9d84629e", "score": "0.47882572", "text": "func NewCursorPaginator(store Store, request *http.Request, options *Options) (*CursorPaginator, error) {\n\tif options == nil {\n\t\toptions = NewOptions()\n\t}\n\n\tpaginator := &CursorPaginator{\n\t\tpaginator: &paginator{\n\t\t\tStore: store,\n\t\t\tOptions: options,\n\t\t\tRequest: request,\n\t\t\tLimit: GetLimitFromRequest(request, options),\n\t\t},\n\t\tCursor: GetCursorFromRequest(request, options),\n\t\tPreviousURI: null.NewString(\"\", false),\n\t}\n\n\tif options.CursorOptions.Mode == DateModeCursor {\n\t\t// time in cursor is standard timestamp (second)\n\t\tpaginator.Cursor = time.Unix(GetCursorFromRequest(request, options), 0)\n\t}\n\n\treturn paginator, nil\n}", "title": "" }, { "docid": "32aa1027f1d60dfc96f281a460e3231b", "score": "0.47728437", "text": "func (q dbQuery) Cursor(args ...interface{}) Cursor {\n\treturn q.Type((Blob)(nil)).Cursor(args...)\n}", "title": "" }, { "docid": "313907adc0c4d2ac6c803e10bff54196", "score": "0.47681963", "text": "func grabCommandCursor() {\n\tupdateCursorChannel <- true\n}", "title": "" }, { "docid": "4910143b164cd3522fc86cbf7e08c2f3", "score": "0.47607225", "text": "func newVCursorImpl(ctx context.Context, safeSession *SafeSession, keyspace string, tabletType topodatapb.TabletType, marginComments sqlparser.MarginComments, executor *Executor, logStats *LogStats) *vcursorImpl {\n\treturn &vcursorImpl{\n\t\tctx: ctx,\n\t\tsafeSession: safeSession,\n\t\tkeyspace: keyspace,\n\t\ttabletType: tabletType,\n\t\tmarginComments: marginComments,\n\t\texecutor: executor,\n\t\tlogStats: logStats,\n\t}\n}", "title": "" }, { "docid": "037d79857cf5c651a838ebb01339f088", "score": "0.47400936", "text": "func OpenOperachain(name string) *Operachain {\n\tdbFile := fmt.Sprintf(dbFile, name)\n\tif dbExists(dbFile) == false {\n\t\tfmt.Println(\"No existing operachain found. Create one first.\")\n\t\toc := CreateOperachain(name)\n\t\toc.UpdateAddress()\n\t\treturn oc\n\t}\n\taddress := fmt.Sprintf(\"localhost:%s\", name)\n\n\tvar tip []byte\n\tdb, err := bolt.Open(dbFile, 0600, nil)\n\tif err != nil {\n\t\tlog.Panic(err)\n\t}\n\n\terr = db.View(func(tx *bolt.Tx) error {\n\t\tb := tx.Bucket([]byte(blocksBucket))\n\t\ttip = b.Get([]byte(\"l\"))\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\tlog.Panic(err)\n\t}\n\t//genesis block create\n\n\toc := Operachain{\n\t\tDb: db,\n\t\tMakeMutex: new(sync.RWMutex),\n\t\tMyAddress: address,\n\t\tMyTip: tip,\n\t\tKnownHeight: make(map[string]int),\n\t\tKnownTips: make(map[string][]byte),\n\t\tSendConn: make(map[string]net.Conn),\n\t\tMyName: name,\n\t}\n\toc.UpdateAddress()\n\toc.UpdateState()\n\n\treturn &oc\n}", "title": "" }, { "docid": "19fdd595f154e6b141784d99c8296310", "score": "0.47041425", "text": "func (_m *ConnectionPool) Open() {\n\t_m.Called()\n}", "title": "" }, { "docid": "9110b9fdbbac2e0ddf74b88459f3c089", "score": "0.46908686", "text": "func CursorNewFromSurface(display IsDisplay, surface *C.cairo_surface_t, x float64, y float64) (return__ *Cursor) {\n\tvar __cgo__return__ interface{}\n\t__cgo__return__ = C.gdk_cursor_new_from_surface(display.GetDisplayPointer(), surface, C.gdouble(x), C.gdouble(y))\n\tif __cgo__return__ != nil {\n\t\treturn__ = NewCursorFromCPointer(unsafe.Pointer(reflect.ValueOf(__cgo__return__).Pointer()))\n\t}\n\treturn\n}", "title": "" }, { "docid": "8d72a5e940c6618626b4d6eda7ea525c", "score": "0.46795374", "text": "func cursorVarInitialize(v *Variable, cur *Cursor) error {\n\tvar tempCursor *Cursor\n\tvar err error\n\tvar j int\n\n\tv.connection = cur.connection\n\tv.cursors = make([]*Cursor, v.allocatedElements)\n\tdebug(\"cursorVarInitialize conn=%x ae=%d typ.Name=%s\\n\", v.connection, v.allocatedElements, v.typ.Name)\n\tfor i := uint(0); i < v.allocatedElements; i++ {\n\t\ttempCursor = v.connection.NewCursor()\n\t\tif err = tempCursor.allocateHandle(); err != nil {\n\t\t\treturn errgo.Mask(err)\n\t\t}\n\t\tv.cursors[int(i)] = tempCursor\n\t\tj = int(i * v.typ.size)\n\t\tC.cursorVarsetHandle(unsafe.Pointer(&v.dataBytes[j]),\n\t\t\ttempCursor.handle)\n\t\tdebug(\"set position %d(%d) in dataBytes to %x [%s]\", i, j,\n\t\t\tv.dataBytes[j:j+int(v.typ.size)], v.typ.size)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "a426b091319b53b35860a3cac93e8676", "score": "0.46738917", "text": "func (t *Iterator) Cursor() (datastore.Cursor, error) {\n\treturn t.i.Cursor()\n}", "title": "" }, { "docid": "168cf9dc3528a1fe986e5a8d0580bdb3", "score": "0.46708435", "text": "func (col *Collection) Open() *Collection {\n\tvar errMsg *C.char\n\n\tpath := C.CString(col.Path)\n\n\tdefer C.free(unsafe.Pointer(path))\n\n\tif status := C.gorods_open_collection(path, &col.chandle, col.Con.ccon, &errMsg); status != 0 {\n\t\tpanic(fmt.Sprintf(\"iRods Open Collection Failed: %v, %v\", col.Path, C.GoString(errMsg)))\n\t}\n\n\treturn col\n}", "title": "" }, { "docid": "8be1057627c2a138c5f680fecd64c255", "score": "0.46699432", "text": "func (d *driverInternal) Open(ctx context.Context) error {\n\t_, cancel := context.WithCancel(ctx)\n\td.closer = cancel\n\td.LockManager = NewLockManager(ctx, d)\n\n\treturn nil\n}", "title": "" }, { "docid": "e81209e51f9c0a3f4f528ea0a47b0c82", "score": "0.46631294", "text": "func (dbi *DB) Cursor(sqls string, arg ...string) (*Rows, error) {\r\n\tdbi.Lock()\r\n\tdefer dbi.Unlock()\r\n\tSetDatabase(dbi.linkaddr)\r\n\tif dbi.isclose {\r\n\t\treturn nil, errors.New(\"database was not opened.\")\r\n\t}\r\n\r\n\tdbi.Prepare(sqls, arg...)\r\n\tpsql := C.CString(sqls)\r\n\tdefer C.free(unsafe.Pointer(psql))\r\n\r\n\tcurid := C.GO_CURSOR(psql)\r\n\tif int(curid) < 0 {\r\n\t\tdbi.GetError()\r\n\t\treturn nil, errors.New(fmt.Sprint(\"Cannot open cursor for sql, curid=\", int(curid)))\r\n\t}\r\n\r\n\trows := new(Rows)\r\n\trows.Curid = int(curid)\r\n\trows.isclose = false\r\n\trows.linkaddr = dbi.linkaddr\r\n\r\n\t//get all column name into rows\r\n\tinlen := 128\r\n\t// array content for input string\r\n\tinvar := make([](*_Ctype_char), 0)\r\n\tfor i := 0; i < inlen; i++ {\r\n\t\tnbyte := make([]byte, 36)\r\n\t\tpchar := C.CString(string(nbyte))\r\n\t\tdefer C.free(unsafe.Pointer(pchar))\r\n\t\tpvar := (*_Ctype_char)(unsafe.Pointer(pchar))\r\n\t\t// add *char into *char-list\r\n\t\tinvar = append(invar, pvar)\r\n\t}\r\n\r\n\tcolnums := C.GO_COLUMNS(curid, (**_Ctype_char)(unsafe.Pointer(&invar[0])), C.int(inlen))\r\n\tif int(colnums) < 0 {\r\n\t\tdbi.GetError()\r\n\t\tinvar = nil\r\n\t\treturn nil, errors.New(\"Cannot fetch columns name.\")\r\n\t}\r\n\r\n\treslist := make([]string, int(colnums))\r\n\tfor i := 0; i < int(colnums); i++ {\r\n\t\tif dbi.LowerCol == 1 {\r\n\t\t\treslist[i] = strings.ToLower(C.GoString(invar[i]))\r\n\t\t} else {\r\n\t\t\treslist[i] = C.GoString(invar[i])\r\n\t\t}\r\n\t}\r\n\r\n\trows.Cols = reslist\r\n\treslist = nil\r\n\tinvar = nil\r\n\treturn rows, nil\r\n}", "title": "" }, { "docid": "30708fcc47f7620d6977f4a1e034bc5d", "score": "0.46540722", "text": "func wholenumberOpen(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* wholenumber.c:70:12: */\n\tvar pCur uintptr\n\tpCur = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(wholenumber_cursor{})))\n\tif pCur == uintptr(0) {\n\t\treturn SQLITE_NOMEM\n\t}\n\tlibc.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(wholenumber_cursor{})))\n\t*(*uintptr)(unsafe.Pointer(ppCursor)) = (pCur /* &.base */)\n\treturn SQLITE_OK\n}", "title": "" }, { "docid": "06fc8f409950b1c579121e83c3fa0177", "score": "0.46476594", "text": "func (h *HD44780Driver) Cursor(on bool) (err error) {\n\th.mutex.Lock()\n\tdefer h.mutex.Unlock()\n\n\tif on {\n\t\th.displayCtrl |= HD44780_CURSORON\n\t} else {\n\t\th.displayCtrl &= ^HD44780_CURSORON\n\t}\n\n\treturn h.sendCommand(HD44780_DISPLAYCONTROL | h.displayCtrl)\n}", "title": "" }, { "docid": "5f65be616fe6357cb4f4ce074f7730a3", "score": "0.464694", "text": "func (c *integerAscendingCursor) close() error {\n\tif c.tsm.keyCursor == nil {\n\t\treturn nil\n\t}\n\n\tc.tsm.keyCursor.Close()\n\tc.tsm.keyCursor = nil\n\tc.cache.values = nil\n\tc.tsm.values = nil\n\treturn nil\n}", "title": "" }, { "docid": "80207303ac61d8bdd1974744be697cdd", "score": "0.46469268", "text": "func NewClosure(code []uint64, consts []Value, env *Env, argsCount byte) *Closure {\n\treturn &Closure{\n\t\tcode: code,\n\t\tconsts: consts,\n\t\tenv: env,\n\t\targsCount: argsCount,\n\t}\n}", "title": "" }, { "docid": "41ff6cc7ebe3628a946c23976191be53", "score": "0.4633987", "text": "func fstreeOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* test_fs.c:418:12: */\n\tvar pCur uintptr\n\tpCur = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(FstreeCsr{})))\n\tif pCur == uintptr(0) {\n\t\treturn SQLITE_NOMEM\n\t}\n\tlibc.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(FstreeCsr{})))\n\t(*FstreeCsr)(unsafe.Pointer(pCur)).Ffd = -1\n\t*(*uintptr)(unsafe.Pointer(ppCursor)) = (pCur /* &.base */)\n\treturn SQLITE_OK\n}", "title": "" }, { "docid": "da7060098cb70b5dece4fe02bb163159", "score": "0.46325594", "text": "func open(path string) {\n\n\tvar goFunc = func() {\n\n\t\tif _, err := ExecCommand([]string{opt.AppLauncher, path}); err != nil {\n\n\t\t\t// Error is handled by \"xdg-open\" command\n\t\t\tfmt.Println(err)\n\t\t}\n\t}\n\n\tglib.IdleAdd(func() { // IdleAdd to permit gtk3 working right during goroutine\n\t\t// Using goroutine to permit the usage of another thread and freeing the current one.\n\t\tgo goFunc()\n\t})\n}", "title": "" }, { "docid": "bf9739991af88e0662af0e8ff3a6d817", "score": "0.46282348", "text": "func btree_close_cursor(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test3.c:249:26: */\n\tbp := tls.Alloc(48)\n\tdefer tls.Free(48)\n\n\tvar pCur uintptr\n\tvar rc int32\n\n\tif argc != 2 {\n\t\ttcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+15410 /* \"wrong # args: sh...\" */, *(*uintptr)(unsafe.Pointer(argv)),\n\t\t\tts+24710 /* \" ID\\\"\" */, 0))\n\t\treturn TCL_ERROR\n\t}\n\tpCur = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))\n\t{\n\t\tvar pBt uintptr = (*BtCursor)(unsafe.Pointer(pCur)).FpBtree\n\t\tsqlite3.Xsqlite3_mutex_enter(tls, (*sqlite31)(unsafe.Pointer((*Btree)(unsafe.Pointer(pBt)).Fdb)).Fmutex)\n\t\tsqlite3.Xsqlite3BtreeEnter(tls, pBt)\n\t\trc = sqlite3.Xsqlite3BtreeCloseCursor(tls, pCur)\n\t\tsqlite3.Xsqlite3BtreeLeave(tls, pBt)\n\t\tsqlite3.Xsqlite3_mutex_leave(tls, (*sqlite31)(unsafe.Pointer((*Btree)(unsafe.Pointer(pBt)).Fdb)).Fmutex)\n\n\t}\n\ttcl.XTcl_Free(tls, pCur)\n\tif rc != 0 {\n\t\ttcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))\n\t\treturn TCL_ERROR\n\t}\n\treturn SQLITE_OK\n}", "title": "" }, { "docid": "c6da58adfba05bad58a6f0731426312b", "score": "0.4623469", "text": "func (e *CTEExec) Open(ctx context.Context) (err error) {\n\te.reset()\n\tif err := e.BaseExecutor.Open(ctx); err != nil {\n\t\treturn err\n\t}\n\n\te.producer.resTbl.Lock()\n\tdefer e.producer.resTbl.Unlock()\n\n\tif e.producer.checkAndUpdateCorColHashCode() {\n\t\te.producer.reset()\n\t\tif err = e.producer.reopenTbls(); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif !e.producer.opened {\n\t\tif err = e.producer.openProducer(ctx, e); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c19b3688905a9ff79eaa7ca1800a3b8d", "score": "0.4619761", "text": "func (o *ListCustomerGroupsParams) SetCursor(cursor *string) {\n\to.Cursor = cursor\n}", "title": "" }, { "docid": "1e6b22f6ed7671175a18244b6ca24005", "score": "0.4616909", "text": "func (b *Buffer) AddCursor(c *Cursor) {\n\tb.cursors = append(b.cursors, c)\n\tb.EventHandler.cursors = b.cursors\n\tb.EventHandler.active = b.curCursor\n\tb.UpdateCursors()\n}", "title": "" }, { "docid": "f0293b7493085079a75060390ec7e1c3", "score": "0.4595327", "text": "func execClosureNewIntegresDatabase(ctx context.Context, t *testing.T, poolHash string, callee string, closure func(db *sql.DB)) {\n\tt.Helper()\n\n\ttestDatabase, err := client.GetTestDatabase(ctx, poolHash)\n\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to obtain test database: %v\", err)\n\t}\n\n\tconnectionString := testDatabase.Config.ConnectionString()\n\tt.Logf(\"%v: %q\", callee, testDatabase.Config.Database)\n\n\tdb, err := sql.Open(\"postgres\", connectionString)\n\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to setup test database for connectionString %q: %v\", connectionString, err)\n\t}\n\n\tif err := db.PingContext(ctx); err != nil {\n\t\tt.Fatalf(\"Failed to ping test database for connectionString %q: %v\", connectionString, err)\n\t}\n\n\tclosure(db)\n\n\t// this database object is managed and should close automatically after running the test\n\tif err := db.Close(); err != nil {\n\t\tt.Fatalf(\"Failed to close db %q: %v\", connectionString, err)\n\t}\n\n\t// disallow any further refs to managed object after running the test\n\tdb = nil\n}", "title": "" }, { "docid": "13b0b5c1ec9766f31b6af576fbc78314", "score": "0.45936352", "text": "func (_options *ListWorkspacesOptions) SetCursor(cursor string) *ListWorkspacesOptions {\n\t_options.Cursor = core.StringPtr(cursor)\n\treturn _options\n}", "title": "" }, { "docid": "e470a6dcdfa30f0af474784849a52cf1", "score": "0.4591731", "text": "func Cursor(cursor CursorT) Option {\n\treturn listinternal.FuncOption(func(options *listinternal.Options) {\n\t\toptions.Cursor = cursor\n\t})\n}", "title": "" }, { "docid": "0e030e5393ccdd4308d2fa346fe343dc", "score": "0.45880607", "text": "func (c *cursor) Close() error {\n\tif c == nil {\n\t\t// Avoid panics in the case that someone defers a close before checking that the cursor is not nil.\n\t\treturn nil\n\t}\n\tif c := atomic.LoadInt32(&c.closed); c != 0 {\n\t\treturn nil\n\t}\n\tc.closeMutex.Lock()\n\tdefer c.closeMutex.Unlock()\n\tif c.closed == 0 {\n\t\tif c.cursorData.ID != \"\" {\n\t\t\t// Force use of initial endpoint\n\t\t\tctx := WithEndpoint(nil, c.endpoint)\n\n\t\t\treq, err := c.conn.NewRequest(\"DELETE\", path.Join(c.relPath(), c.cursorData.ID))\n\t\t\tif err != nil {\n\t\t\t\treturn WithStack(err)\n\t\t\t}\n\t\t\tresp, err := c.conn.Do(ctx, req)\n\t\t\tif err != nil {\n\t\t\t\treturn WithStack(err)\n\t\t\t}\n\t\t\tif err := resp.CheckStatus(202); err != nil {\n\t\t\t\treturn WithStack(err)\n\t\t\t}\n\t\t}\n\t\tatomic.StoreInt32(&c.closed, 1)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b29e6e5214fc994af23692179dd1c9dd", "score": "0.45804673", "text": "func (_options *ListCounterexamplesOptions) SetCursor(cursor string) *ListCounterexamplesOptions {\n\t_options.Cursor = core.StringPtr(cursor)\n\treturn _options\n}", "title": "" }, { "docid": "bb3aec4fc96554a471880ae141b90432", "score": "0.45739505", "text": "func sqlite3_closure_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* closure.c:953:5: */\n\tvar rc int32 = SQLITE_OK\n\t_ = pApi\n\n\t_ = pzErrMsg\n\trc = sqlite3.Xsqlite3_create_module(tls, db, ts+4244 /* \"transitive_closu...\" */, uintptr(unsafe.Pointer(&closureModule)), uintptr(0))\n\treturn rc\n}", "title": "" }, { "docid": "1cde19bc3a79814403296fbcfd9296c6", "score": "0.4540287", "text": "func WithCursorBufferSize(parent context.Context, cbs int) context.Context {\n\tif parent == nil {\n\t\tpanic(ihzerrors.NewIllegalArgumentError(\"parent context is nil\", nil))\n\t}\n\tv, err := check.NonNegativeInt32(cbs)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn context.WithValue(parent, driver.QueryCursorBufferSizeKey{}, v)\n}", "title": "" }, { "docid": "f0db698a0f080baf6c1eb129ccf180ec", "score": "0.4535304", "text": "func OffsetToCursor(offset int) relay.ConnectionCursor {\n\tstr := fmt.Sprintf(\"%v%v\", PREFIX, offset)\n\treturn relay.ConnectionCursor(base64.StdEncoding.EncodeToString([]byte(str)))\n}", "title": "" }, { "docid": "8234389473259f4251f2582c00112928", "score": "0.45291254", "text": "func spellfix1Open(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* spellfix.c:2331:12: */\n\tvar p uintptr = pVTab\n\tvar pCur uintptr\n\tpCur = sqlite3.Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(spellfix1_cursor{})))\n\tif pCur == uintptr(0) {\n\t\treturn SQLITE_NOMEM\n\t}\n\tlibc.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(spellfix1_cursor{})))\n\t(*spellfix1_cursor)(unsafe.Pointer(pCur)).FpVTab = p\n\t*(*uintptr)(unsafe.Pointer(ppCursor)) = (pCur /* &.base */)\n\treturn SQLITE_OK\n}", "title": "" }, { "docid": "999b1f93da88b2f4498b01b5ed709a81", "score": "0.45282835", "text": "func (e *Exercise) Cursor() string {\n\treturn e.DBCursor().Serialize()\n}", "title": "" }, { "docid": "30cc34af8c924682b8cc715feb228ed0", "score": "0.45255312", "text": "func (c *unsignedAscendingCursor) close() error {\n\tif c.tsm.keyCursor == nil {\n\t\treturn nil\n\t}\n\n\tc.tsm.keyCursor.Close()\n\tc.tsm.keyCursor = nil\n\tc.cache.values = nil\n\tc.tsm.values = nil\n\treturn nil\n}", "title": "" }, { "docid": "1640020e92cbca1e45bf17b541402899", "score": "0.45247623", "text": "func Open(name string, flagArgs ...int) (*Conn, error) {\n\tif len(flagArgs) > 1 {\n\t\treturn nil, pkgErr(MISUSE, \"too many arguments provided to Open\")\n\t}\n\n\tif initErr != nil {\n\t\treturn nil, initErr\n\t}\n\tname += \"\\x00\"\n\n\tvar db *C.sqlite3\n\tflags := C.SQLITE_OPEN_READWRITE | C.SQLITE_OPEN_CREATE\n\tif len(flagArgs) == 1 {\n\t\tflags = flagArgs[0]\n\t}\n\trc := C.sqlite3_open_v2(cStr(name), &db, C.int(flags), nil)\n\tif rc != OK {\n\t\terr := errMsg(rc, db)\n\t\tC.sqlite3_close(db)\n\t\treturn nil, err\n\t}\n\tc := &Conn{db: db}\n\tC.sqlite3_extended_result_codes(db, 1)\n\treturn c, nil\n}", "title": "" }, { "docid": "d577099de451d5a89c78fe2abf195ef0", "score": "0.45191488", "text": "func newPreprocessCursorManager(opChan <-chan *RecordedOp) (*preprocessCursorManager, error) {\n\tuserInfoLogger.Logvf(Always, \"Preprocessing file\")\n\n\tresult := preprocessCursorManager{\n\t\tcursorInfos: make(map[int64]*preprocessCursorInfo),\n\t\topToCursors: make(map[opKey]int64),\n\t}\n\n\tcursorsSeen := &cursorsSeenMap{}\n\n\t// Loop over all the ops found in the file\n\tfor op := range opChan {\n\n\t\t// If they don't produce a cursor, skip them\n\t\tif op.RawOp.Header.OpCode != OpCodeGetMore && op.RawOp.Header.OpCode != OpCodeKillCursors &&\n\t\t\top.RawOp.Header.OpCode != OpCodeReply && op.RawOp.Header.OpCode != OpCodeCommandReply && op.RawOp.Header.OpCode != OpCodeCommand {\n\t\t\tcontinue\n\t\t}\n\t\tif op.RawOp.Header.OpCode == OpCodeCommand {\n\t\t\tcommandName, err := getCommandName(&op.RawOp)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif commandName != \"getMore\" && commandName != \"getmore\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tparsedOp, err := op.RawOp.Parse()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tswitch castOp := parsedOp.(type) {\n\t\tcase cursorsRewriteable:\n\t\t\t// If the op makes use of a cursor, such as a getmore or a killcursors,\n\t\t\t// track this op and attemp to match it with the reply that contains its\n\t\t\t// cursor\n\t\t\tcursorIDs, err := castOp.getCursorIDs()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tfor _, cursorID := range cursorIDs {\n\t\t\t\tif cursorID == 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tcursorsSeen.trackSeen(cursorID, op.SeenConnectionNum)\n\t\t\t}\n\n\t\tcase Replyable:\n\t\t\t// If the op is a reply it may contain a cursorID. If so, track this\n\t\t\t// op and attempt to pair it with the the op that requires its\n\t\t\t// cursor id.\n\t\t\tcursorID, err := castOp.getCursorID()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif cursorID == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tcursorsSeen.trackReplied(cursorID, op)\n\n\t\t}\n\t}\n\n\tfor cursorID, counter := range *cursorsSeen {\n\t\tif cursorID != 0 && counter.replySeen && counter.usesSeen > 0 {\n\t\t\tresult.cursorInfos[cursorID] = &preprocessCursorInfo{\n\t\t\t\tfailChan: make(chan struct{}),\n\t\t\t\tsuccessChan: make(chan struct{}),\n\t\t\t\tnumUsesLeft: counter.usesSeen,\n\t\t\t\treplyConn: counter.replyConn,\n\t\t\t}\n\t\t\tresult.opToCursors[counter.opOriginKey] = cursorID\n\n\t\t}\n\t}\n\tuserInfoLogger.Logvf(Always, \"Preprocess complete\")\n\treturn &result, nil\n\n}", "title": "" }, { "docid": "6550f1f9f4ed17aa1c84010e8c44d8de", "score": "0.45121226", "text": "func (c Cursor) Availability() AvailabilityKind {\n\treturn AvailabilityKind(C.clang_getCursorAvailability(c.c))\n}", "title": "" }, { "docid": "7a1634cb96237b0713d312244215f2dd", "score": "0.4511583", "text": "func (k *KeyTreeCursor) MakeClosure(a TreeAction) PaneKeyAction {\n\tif a.action != nil {\n\t\treturn a.action\n\t} else if a.any != nil {\n\t\treturn func(p Pane) bool {\n\t\t\treturn a.any(p, k.wildcards)\n\t\t}\n\t} else if a.mouse != nil {\n\t\treturn func(p Pane) bool {\n\t\t\treturn a.mouse(p, k.mouseInfo)\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "ff2eb92c97158f4d335a09fbc47d12d6", "score": "0.45114273", "text": "func (c *Cylinder) Open(open bool) {\n\tc.open = open\n}", "title": "" }, { "docid": "ff46bdff5137353c6425bacec5e1d525", "score": "0.4503999", "text": "func ClosureInFunc() {\n\ta := 1\n\tb := 2\n\tmyFu := func() {\n\t\t// this will access variable in parrent block\n\t\ta = 5\n\t\t// this will create new variable just for myFu func\n\t\tb := 3\n\t\tfmt.Println(a)\n\t\tb++\n\t\tfmt.Println(b)\n\t}\n\tmyFu()\n\tfmt.Println(a)\n\tfmt.Println(b)\n\n}", "title": "" }, { "docid": "0b55fe5149a91040a558d493bfb04a50", "score": "0.44993636", "text": "func (b *Buffer) MergeCursors() {\n\tvar cursors []*Cursor\n\tfor i := 0; i < len(b.cursors); i++ {\n\t\tc1 := b.cursors[i]\n\t\tif c1 != nil {\n\t\t\tfor j := 0; j < len(b.cursors); j++ {\n\t\t\t\tc2 := b.cursors[j]\n\t\t\t\tif c2 != nil && i != j && c1.Loc == c2.Loc {\n\t\t\t\t\tb.cursors[j] = nil\n\t\t\t\t}\n\t\t\t}\n\t\t\tcursors = append(cursors, c1)\n\t\t}\n\t}\n\n\tb.cursors = cursors\n\n\tfor i := range b.cursors {\n\t\tb.cursors[i].Num = i\n\t}\n\n\tif b.curCursor >= len(b.cursors) {\n\t\tb.curCursor = len(b.cursors) - 1\n\t}\n\tb.EventHandler.cursors = b.cursors\n\tb.EventHandler.active = b.curCursor\n}", "title": "" }, { "docid": "0af7d52171c97de9ca4efbe6d4045c68", "score": "0.44872501", "text": "func (c *stringAscendingCursor) close() error {\n\tif c.tsm.keyCursor == nil {\n\t\treturn nil\n\t}\n\n\tc.tsm.keyCursor.Close()\n\tc.tsm.keyCursor = nil\n\tc.cache.values = nil\n\tc.tsm.values = nil\n\treturn nil\n}", "title": "" }, { "docid": "fafc7f62c0fa57cb5def2d44e1152aca", "score": "0.4477942", "text": "func GoClangCursorVisitor(cursor, parent C.CXCursor, cfct unsafe.Pointer) (status ChildVisitResult) {\n\ti := *(*C.int)(cfct)\n\tf := visitors.lookup(int(i))\n\n\treturn (*f)(Cursor{cursor}, Cursor{parent})\n}", "title": "" }, { "docid": "dfb7a1850cf4effb945efbdbede8f461", "score": "0.44775832", "text": "func PgxOpen(u *dburl.URL) func(string, string) (*sql.DB, error) {\n\treturn sql.Open\n}", "title": "" }, { "docid": "ca67b294d4401c62b81ec5a51707c59e", "score": "0.447463", "text": "func (c *cursor) use() *cursorOffsetNext {\n\t// A source using a cursor has exclusive access to the use field by\n\t// virtue of that source building a request during a live session,\n\t// or by virtue of the session being stopped.\n\tc.useState = 0\n\treturn &cursorOffsetNext{\n\t\tcursorOffset: c.cursorOffset,\n\t\tfrom: c,\n\t\tcurrentLeaderEpoch: c.leaderEpoch,\n\t}\n}", "title": "" }, { "docid": "28632589cf8ba0cbe16a7b216f637d69", "score": "0.44604322", "text": "func Open(config *Config) *DB {\n\tcli, close := client(config)\n\tdbHandler := cli.Database(config.DBName)\n\tdb := &DB{\n\t\tclient: cli,\n\t\tdb: dbHandler,\n\t\tconfig: config,\n\t\tclose: close,\n\t\tbrk: breaker.NewBreakerGroup(),\n\t\tcollections: sync.Map{},\n\t}\n\treturn db\n}", "title": "" }, { "docid": "d594b4e4652cd7f979f56c4799a7872d", "score": "0.4458655", "text": "func (b *Buffer) SetCursors(c []*Cursor) {\n\tb.cursors = c\n\tb.EventHandler.cursors = b.cursors\n\tb.EventHandler.active = b.curCursor\n}", "title": "" }, { "docid": "f8a9c545723839ec2b3d4a94b8210638", "score": "0.44541624", "text": "func (p *preprocessCursorManager) GetCursor(fileCursorID int64, connectionNum int64) (int64, bool) {\n\tp.RLock()\n\tcursorInfo, ok := p.cursorInfos[fileCursorID]\n\tp.RUnlock()\n\tif !ok {\n\t\treturn 0, false\n\t}\n\tselect {\n\tcase <-cursorInfo.successChan:\n\t\t//the successChan is closed, so we can continue to the next section to\n\t\t//retrieve the cursor\n\tdefault:\n\t\tif connectionNum == cursorInfo.replyConn {\n\t\t\t// the channels are not closed, and this the same connection we are\n\t\t\t// supposed to be waiting on the reply for therefore, the traffic\n\t\t\t// was read out of order at some point, so we should not block\n\t\t\ttoolDebugLogger.Logvf(DebugLow, \"Skipping cursor rewrite of op on same connection with connection number: %v and cursorID: %v\", connectionNum, fileCursorID)\n\t\t\treturn 0, false\n\t\t}\n\t\t// otherwise, the channel is not closed, but we are not waiting on a\n\t\t// cursor form the same connection, so we should proceed to the next\n\t\t// case\n\t}\n\n\tselect {\n\tcase <-cursorInfo.successChan:\n\t\t// the cursor has been set after an op was completed which contained it\n\t\tp.Lock()\n\t\tcursorInfo.numUsesLeft--\n\t\tp.cursorInfos[fileCursorID] = cursorInfo\n\t\tcursor := cursorInfo.liveCursorID\n\t\tif cursorInfo.numUsesLeft <= 0 {\n\t\t\tdelete(p.cursorInfos, fileCursorID)\n\t\t}\n\t\tp.Unlock()\n\n\t\treturn cursor, true\n\tcase <-cursorInfo.failChan:\n\t\t//the fail chan was closed, which means no cursor is coming for this op\n\t\treturn 0, false\n\t}\n\n}", "title": "" }, { "docid": "adc052d0beb9276ec57d495bce146698", "score": "0.44451424", "text": "func (e *CheckIndexRangeExec) Open(ctx context.Context) error {\n\ttCols := e.table.Cols()\n\tfor _, ic := range e.index.Columns {\n\t\tcol := tCols[ic.Offset]\n\t\te.cols = append(e.cols, col)\n\t}\n\n\tcolTypeForHandle := e.GetSchema().Columns[len(e.cols)].RetType\n\te.cols = append(e.cols, &model.ColumnInfo{\n\t\tID: model.ExtraHandleID,\n\t\tName: model.ExtraHandleName,\n\t\tFieldType: *colTypeForHandle,\n\t})\n\n\te.srcChunk = tryNewCacheChunk(e)\n\tdagPB, err := e.buildDAGPB()\n\tif err != nil {\n\t\treturn err\n\t}\n\tsc := e.Ctx().GetSessionVars().StmtCtx\n\ttxn, err := e.Ctx().Txn(true)\n\tif err != nil {\n\t\treturn nil\n\t}\n\tvar builder distsql.RequestBuilder\n\tkvReq, err := builder.SetIndexRanges(sc, e.table.ID, e.index.ID, ranger.FullRange()).\n\t\tSetDAGRequest(dagPB).\n\t\tSetStartTS(txn.StartTS()).\n\t\tSetKeepOrder(true).\n\t\tSetFromSessionVars(e.Ctx().GetSessionVars()).\n\t\tSetFromInfoSchema(e.Ctx().GetInfoSchema()).\n\t\tSetConnID(e.Ctx().GetSessionVars().ConnectionID).\n\t\tBuild()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\te.result, err = distsql.Select(ctx, e.Ctx(), kvReq, e.RetFieldTypes())\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d8e396f8ca47928b535bf213a112fd4b", "score": "0.44443548", "text": "func (b *Buffer) NumCursors() int {\n\treturn len(b.cursors)\n}", "title": "" }, { "docid": "8b9ef0f89656dfe4dcb6f4df5b216094", "score": "0.44438237", "text": "func cursorAnimate() <-chan rune {\n\tcursorCh := make(chan rune)\n\tvar cursors string\n\n\tswitch runtime.GOOS {\n\tcase \"linux\":\n\t\t// cursors = \"➩➪➫➬➭➮➯➱\"\n\t\t// cursors = \"▁▃▄▅▆▇█▇▆▅▄▃\"\n\t\tcursors = \"◐◓◑◒\"\n\t\t// cursors = \"←↖↑↗→↘↓↙\"\n\t\t// cursors = \"◴◷◶◵\"\n\t\t// cursors = \"◰◳◲◱\"\n\tcase \"darwin\":\n\t\tcursors = \"◐◓◑◒\"\n\t\t//cursors = \"⣾⣽⣻⢿⡿⣟⣯⣷\"\n\tdefault:\n\t\tcursors = \"|/-\\\\\"\n\t}\n\tgo func() {\n\t\tfor {\n\t\t\tfor _, cursor := range cursors {\n\t\t\t\tcursorCh <- cursor\n\t\t\t}\n\t\t}\n\t}()\n\treturn cursorCh\n}", "title": "" }, { "docid": "ca440818ee8ed8ae94b6088030e35fdb", "score": "0.44402325", "text": "func NewScope(parent *Scope, pos, end token.Pos, comment string) *Scope", "title": "" }, { "docid": "a640b92b4f1ebf9193b425f65ff19fb4", "score": "0.44377545", "text": "func amatchOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* amatch.c:928:12: */\n\tvar p uintptr = pVTab\n\tvar pCur uintptr\n\tpCur = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(amatch_cursor{})))\n\tif pCur == uintptr(0) {\n\t\treturn SQLITE_NOMEM\n\t}\n\tlibc.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(amatch_cursor{})))\n\t(*amatch_cursor)(unsafe.Pointer(pCur)).FpVtab = p\n\t*(*uintptr)(unsafe.Pointer(ppCursor)) = (pCur /* &.base */)\n\t(*amatch_vtab)(unsafe.Pointer(p)).FnCursor++\n\treturn SQLITE_OK\n}", "title": "" }, { "docid": "b7448050dc8678c9d3c042a9c9888869", "score": "0.4432685", "text": "func (d *Driver) Open(name string) (driver.Conn, error) {\n\tc, err := newConn(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, udf := range d.udfs {\n\t\tif err = c.createFunctionInternal(udf); err != nil {\n\t\t\tc.Close()\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn c, nil\n}", "title": "" } ]
73e1e744b4cf195f2b87cab1a46dd1f9
/ SlidesApiServiceTests Convert presentation from request content to format specified. Test for SlidesApi.ConvertAndSave method with invalid password
[ { "docid": "6ab0aa166dee3cec4573d2107c20b897", "score": "0.6334397", "text": "func TestConvertAndSaveInvalidPassword(t *testing.T) {\n testdocument, _ := createTestParamValue(\"ConvertAndSave\", \"document\", \"[]byte\").([]byte)\n testformat, _ := createTestParamValue(\"ConvertAndSave\", \"format\", \"string\").(string)\n testoutPath, _ := createTestParamValue(\"ConvertAndSave\", \"outPath\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"ConvertAndSave\", \"password\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"ConvertAndSave\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"ConvertAndSave\", \"fontsFolder\", \"string\").(string)\n testslides, _ := createTestParamValue(\"ConvertAndSave\", \"slides\", \"[]int32\").([]int32)\n testoptions, _ := createTestParamValue(\"ConvertAndSave\", \"options\", \"ExportOptions\").(IExportOptions)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"ConvertAndSave\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"ConvertAndSave\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n r, e := GetTestApiClient().SlidesApi.ConvertAndSave(testdocument, testformat, testoutPath, testpassword, teststorage, testfontsFolder, testslides, testoptions)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"ConvertAndSave\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" } ]
[ { "docid": "4e7584ea9c08c73cb1c0f97cba7e2230", "score": "0.66835725", "text": "func TestConvert(t *testing.T) {\n testdocument, _ := createTestParamValue(\"Convert\", \"document\", \"[]byte\").([]byte)\n testformat, _ := createTestParamValue(\"Convert\", \"format\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"Convert\", \"password\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"Convert\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"Convert\", \"fontsFolder\", \"string\").(string)\n testslides, _ := createTestParamValue(\"Convert\", \"slides\", \"[]int32\").([]int32)\n testoptions, _ := createTestParamValue(\"Convert\", \"options\", \"ExportOptions\").(IExportOptions)\n e := InitializeTest(\"Convert\", \"\", \"\")\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n c := GetTestApiClient()\n r, _, e := c.SlidesApi.Convert(testdocument, testformat, testpassword, teststorage, testfontsFolder, testslides, testoptions)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n assertBinaryResponse(r, t)\n}", "title": "" }, { "docid": "27e822df4afda96bad33f53a769056ca", "score": "0.64604706", "text": "func TestConvertAndSave(t *testing.T) {\n testdocument, _ := createTestParamValue(\"ConvertAndSave\", \"document\", \"[]byte\").([]byte)\n testformat, _ := createTestParamValue(\"ConvertAndSave\", \"format\", \"string\").(string)\n testoutPath, _ := createTestParamValue(\"ConvertAndSave\", \"outPath\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"ConvertAndSave\", \"password\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"ConvertAndSave\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"ConvertAndSave\", \"fontsFolder\", \"string\").(string)\n testslides, _ := createTestParamValue(\"ConvertAndSave\", \"slides\", \"[]int32\").([]int32)\n testoptions, _ := createTestParamValue(\"ConvertAndSave\", \"options\", \"ExportOptions\").(IExportOptions)\n e := InitializeTest(\"ConvertAndSave\", \"\", \"\")\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n c := GetTestApiClient()\n _, e = c.SlidesApi.ConvertAndSave(testdocument, testformat, testoutPath, testpassword, teststorage, testfontsFolder, testslides, testoptions)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n}", "title": "" }, { "docid": "9608363ae2b8ecd851eff35e51c315e0", "score": "0.62851083", "text": "func TestSavePresentationInvalidFormat(t *testing.T) {\n testname, _ := createTestParamValue(\"SavePresentation\", \"name\", \"string\").(string)\n testformat, _ := createTestParamValue(\"SavePresentation\", \"format\", \"string\").(string)\n testoutPath, _ := createTestParamValue(\"SavePresentation\", \"outPath\", \"string\").(string)\n testoptions, _ := createTestParamValue(\"SavePresentation\", \"options\", \"ExportOptions\").(IExportOptions)\n testpassword, _ := createTestParamValue(\"SavePresentation\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"SavePresentation\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"SavePresentation\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"SavePresentation\", \"fontsFolder\", \"string\").(string)\n testslides, _ := createTestParamValue(\"SavePresentation\", \"slides\", \"[]int32\").([]int32)\n\n invalidValue := invalidizeTestParamValue(testformat, \"SavePresentation\", \"format\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testformat = nullValue\n } else {\n testformat, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"SavePresentation\", \"format\", testformat)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n r, e := GetTestApiClient().SlidesApi.SavePresentation(testname, testformat, testoutPath, testoptions, testpassword, testfolder, teststorage, testfontsFolder, testslides)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"SavePresentation\", \"format\", \"string\", testformat, int32(statusCode), e)\n}", "title": "" }, { "docid": "1731fe02e201f842aab4027da30cb8b3", "score": "0.62593365", "text": "func TestConvertInvalidFormat(t *testing.T) {\n testdocument, _ := createTestParamValue(\"Convert\", \"document\", \"[]byte\").([]byte)\n testformat, _ := createTestParamValue(\"Convert\", \"format\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"Convert\", \"password\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"Convert\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"Convert\", \"fontsFolder\", \"string\").(string)\n testslides, _ := createTestParamValue(\"Convert\", \"slides\", \"[]int32\").([]int32)\n testoptions, _ := createTestParamValue(\"Convert\", \"options\", \"ExportOptions\").(IExportOptions)\n\n invalidValue := invalidizeTestParamValue(testformat, \"Convert\", \"format\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testformat = nullValue\n } else {\n testformat, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"Convert\", \"format\", testformat)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.Convert(testdocument, testformat, testpassword, teststorage, testfontsFolder, testslides, testoptions)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"Convert\", \"format\", \"string\", testformat, int32(statusCode), e)\n}", "title": "" }, { "docid": "9cc25a81d2eb5eb91ee42a21e87d2753", "score": "0.6251537", "text": "func TestConvertAndSaveInvalidFormat(t *testing.T) {\n testdocument, _ := createTestParamValue(\"ConvertAndSave\", \"document\", \"[]byte\").([]byte)\n testformat, _ := createTestParamValue(\"ConvertAndSave\", \"format\", \"string\").(string)\n testoutPath, _ := createTestParamValue(\"ConvertAndSave\", \"outPath\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"ConvertAndSave\", \"password\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"ConvertAndSave\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"ConvertAndSave\", \"fontsFolder\", \"string\").(string)\n testslides, _ := createTestParamValue(\"ConvertAndSave\", \"slides\", \"[]int32\").([]int32)\n testoptions, _ := createTestParamValue(\"ConvertAndSave\", \"options\", \"ExportOptions\").(IExportOptions)\n\n invalidValue := invalidizeTestParamValue(testformat, \"ConvertAndSave\", \"format\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testformat = nullValue\n } else {\n testformat, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"ConvertAndSave\", \"format\", testformat)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n r, e := GetTestApiClient().SlidesApi.ConvertAndSave(testdocument, testformat, testoutPath, testpassword, teststorage, testfontsFolder, testslides, testoptions)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"ConvertAndSave\", \"format\", \"string\", testformat, int32(statusCode), e)\n}", "title": "" }, { "docid": "ec778b5d70dee6fa86f2722345cff353", "score": "0.62423205", "text": "func TestCreatePresentation(t *testing.T) {\n testname, _ := createTestParamValue(\"CreatePresentation\", \"name\", \"string\").(string)\n testdata, _ := createTestParamValue(\"CreatePresentation\", \"data\", \"[]byte\").([]byte)\n testinputPassword, _ := createTestParamValue(\"CreatePresentation\", \"inputPassword\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"CreatePresentation\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"CreatePresentation\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"CreatePresentation\", \"storage\", \"string\").(string)\n e := InitializeTest(\"CreatePresentation\", \"\", \"\")\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n c := GetTestApiClient()\n _, _, e = c.SlidesApi.CreatePresentation(testname, testdata, testinputPassword, testpassword, testfolder, teststorage)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n}", "title": "" }, { "docid": "4bef5dab915c396c8c9fefe5dc675aeb", "score": "0.62214243", "text": "func TestConvertAndSaveInvalidSlides(t *testing.T) {\n testdocument, _ := createTestParamValue(\"ConvertAndSave\", \"document\", \"[]byte\").([]byte)\n testformat, _ := createTestParamValue(\"ConvertAndSave\", \"format\", \"string\").(string)\n testoutPath, _ := createTestParamValue(\"ConvertAndSave\", \"outPath\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"ConvertAndSave\", \"password\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"ConvertAndSave\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"ConvertAndSave\", \"fontsFolder\", \"string\").(string)\n testslides, _ := createTestParamValue(\"ConvertAndSave\", \"slides\", \"[]int32\").([]int32)\n testoptions, _ := createTestParamValue(\"ConvertAndSave\", \"options\", \"ExportOptions\").(IExportOptions)\n\n invalidValue := invalidizeTestParamValue(testslides, \"ConvertAndSave\", \"slides\", \"[]int32\")\n if (invalidValue == nil) {\n testslides = nil\n } else {\n testslides, _ = invalidValue.([]int32)\n }\n\n e := InitializeTest(\"ConvertAndSave\", \"slides\", testslides)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n r, e := GetTestApiClient().SlidesApi.ConvertAndSave(testdocument, testformat, testoutPath, testpassword, teststorage, testfontsFolder, testslides, testoptions)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"ConvertAndSave\", \"slides\", \"[]int32\", testslides, int32(statusCode), e)\n}", "title": "" }, { "docid": "bb5c1f3177c189261582b954f131d9fd", "score": "0.6208704", "text": "func TestSavePresentation(t *testing.T) {\n testname, _ := createTestParamValue(\"SavePresentation\", \"name\", \"string\").(string)\n testformat, _ := createTestParamValue(\"SavePresentation\", \"format\", \"string\").(string)\n testoutPath, _ := createTestParamValue(\"SavePresentation\", \"outPath\", \"string\").(string)\n testoptions, _ := createTestParamValue(\"SavePresentation\", \"options\", \"ExportOptions\").(IExportOptions)\n testpassword, _ := createTestParamValue(\"SavePresentation\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"SavePresentation\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"SavePresentation\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"SavePresentation\", \"fontsFolder\", \"string\").(string)\n testslides, _ := createTestParamValue(\"SavePresentation\", \"slides\", \"[]int32\").([]int32)\n e := InitializeTest(\"SavePresentation\", \"\", \"\")\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n c := GetTestApiClient()\n _, e = c.SlidesApi.SavePresentation(testname, testformat, testoutPath, testoptions, testpassword, testfolder, teststorage, testfontsFolder, testslides)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n}", "title": "" }, { "docid": "3d7761496c632eb09415e0e151f1be45", "score": "0.6205616", "text": "func TestSavePresentationInvalidPassword(t *testing.T) {\n testname, _ := createTestParamValue(\"SavePresentation\", \"name\", \"string\").(string)\n testformat, _ := createTestParamValue(\"SavePresentation\", \"format\", \"string\").(string)\n testoutPath, _ := createTestParamValue(\"SavePresentation\", \"outPath\", \"string\").(string)\n testoptions, _ := createTestParamValue(\"SavePresentation\", \"options\", \"ExportOptions\").(IExportOptions)\n testpassword, _ := createTestParamValue(\"SavePresentation\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"SavePresentation\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"SavePresentation\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"SavePresentation\", \"fontsFolder\", \"string\").(string)\n testslides, _ := createTestParamValue(\"SavePresentation\", \"slides\", \"[]int32\").([]int32)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"SavePresentation\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"SavePresentation\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n r, e := GetTestApiClient().SlidesApi.SavePresentation(testname, testformat, testoutPath, testoptions, testpassword, testfolder, teststorage, testfontsFolder, testslides)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"SavePresentation\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "b17bd09f3cb6b67896cc746ef23e9cb7", "score": "0.61870575", "text": "func TestConvertInvalidDocument(t *testing.T) {\n testdocument, _ := createTestParamValue(\"Convert\", \"document\", \"[]byte\").([]byte)\n testformat, _ := createTestParamValue(\"Convert\", \"format\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"Convert\", \"password\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"Convert\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"Convert\", \"fontsFolder\", \"string\").(string)\n testslides, _ := createTestParamValue(\"Convert\", \"slides\", \"[]int32\").([]int32)\n testoptions, _ := createTestParamValue(\"Convert\", \"options\", \"ExportOptions\").(IExportOptions)\n\n invalidValue := invalidizeTestParamValue(testdocument, \"Convert\", \"document\", \"[]byte\")\n if (invalidValue == nil) {\n testdocument = nil\n } else {\n testdocument, _ = invalidValue.([]byte)\n }\n\n e := InitializeTest(\"Convert\", \"document\", testdocument)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.Convert(testdocument, testformat, testpassword, teststorage, testfontsFolder, testslides, testoptions)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"Convert\", \"document\", \"[]byte\", testdocument, int32(statusCode), e)\n}", "title": "" }, { "docid": "33e649998473d30a3327de4be4e06f8c", "score": "0.6179581", "text": "func TestConvertInvalidSlides(t *testing.T) {\n testdocument, _ := createTestParamValue(\"Convert\", \"document\", \"[]byte\").([]byte)\n testformat, _ := createTestParamValue(\"Convert\", \"format\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"Convert\", \"password\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"Convert\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"Convert\", \"fontsFolder\", \"string\").(string)\n testslides, _ := createTestParamValue(\"Convert\", \"slides\", \"[]int32\").([]int32)\n testoptions, _ := createTestParamValue(\"Convert\", \"options\", \"ExportOptions\").(IExportOptions)\n\n invalidValue := invalidizeTestParamValue(testslides, \"Convert\", \"slides\", \"[]int32\")\n if (invalidValue == nil) {\n testslides = nil\n } else {\n testslides, _ = invalidValue.([]int32)\n }\n\n e := InitializeTest(\"Convert\", \"slides\", testslides)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.Convert(testdocument, testformat, testpassword, teststorage, testfontsFolder, testslides, testoptions)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"Convert\", \"slides\", \"[]int32\", testslides, int32(statusCode), e)\n}", "title": "" }, { "docid": "bcd0653575435b9a3d44e8ecf1697684", "score": "0.61780673", "text": "func TestConvertInvalidPassword(t *testing.T) {\n testdocument, _ := createTestParamValue(\"Convert\", \"document\", \"[]byte\").([]byte)\n testformat, _ := createTestParamValue(\"Convert\", \"format\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"Convert\", \"password\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"Convert\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"Convert\", \"fontsFolder\", \"string\").(string)\n testslides, _ := createTestParamValue(\"Convert\", \"slides\", \"[]int32\").([]int32)\n testoptions, _ := createTestParamValue(\"Convert\", \"options\", \"ExportOptions\").(IExportOptions)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"Convert\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"Convert\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.Convert(testdocument, testformat, testpassword, teststorage, testfontsFolder, testslides, testoptions)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"Convert\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "ee2d22836b4269a1a2154eb603da4a76", "score": "0.61327535", "text": "func TestConvertAndSaveInvalidDocument(t *testing.T) {\n testdocument, _ := createTestParamValue(\"ConvertAndSave\", \"document\", \"[]byte\").([]byte)\n testformat, _ := createTestParamValue(\"ConvertAndSave\", \"format\", \"string\").(string)\n testoutPath, _ := createTestParamValue(\"ConvertAndSave\", \"outPath\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"ConvertAndSave\", \"password\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"ConvertAndSave\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"ConvertAndSave\", \"fontsFolder\", \"string\").(string)\n testslides, _ := createTestParamValue(\"ConvertAndSave\", \"slides\", \"[]int32\").([]int32)\n testoptions, _ := createTestParamValue(\"ConvertAndSave\", \"options\", \"ExportOptions\").(IExportOptions)\n\n invalidValue := invalidizeTestParamValue(testdocument, \"ConvertAndSave\", \"document\", \"[]byte\")\n if (invalidValue == nil) {\n testdocument = nil\n } else {\n testdocument, _ = invalidValue.([]byte)\n }\n\n e := InitializeTest(\"ConvertAndSave\", \"document\", testdocument)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n r, e := GetTestApiClient().SlidesApi.ConvertAndSave(testdocument, testformat, testoutPath, testpassword, teststorage, testfontsFolder, testslides, testoptions)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"ConvertAndSave\", \"document\", \"[]byte\", testdocument, int32(statusCode), e)\n}", "title": "" }, { "docid": "c3fe86b9815d799e352ad87d41c93fc8", "score": "0.60921466", "text": "func TestSaveSlideInvalidPassword(t *testing.T) {\n testname, _ := createTestParamValue(\"SaveSlide\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"SaveSlide\", \"slideIndex\", \"int32\").(int32)\n testformat, _ := createTestParamValue(\"SaveSlide\", \"format\", \"string\").(string)\n testoutPath, _ := createTestParamValue(\"SaveSlide\", \"outPath\", \"string\").(string)\n testoptions, _ := createTestParamValue(\"SaveSlide\", \"options\", \"ExportOptions\").(IExportOptions)\n var testwidth *int32\n testwidthValue := createTestParamValue(\"SaveSlide\", \"width\", \"int32\")\n if (testwidthValue != nil) {\n testwidth = new(int32)\n *testwidth, _ = testwidthValue.(int32)\n }\n var testheight *int32\n testheightValue := createTestParamValue(\"SaveSlide\", \"height\", \"int32\")\n if (testheightValue != nil) {\n testheight = new(int32)\n *testheight, _ = testheightValue.(int32)\n }\n testpassword, _ := createTestParamValue(\"SaveSlide\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"SaveSlide\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"SaveSlide\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"SaveSlide\", \"fontsFolder\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"SaveSlide\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"SaveSlide\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n r, e := GetTestApiClient().SlidesApi.SaveSlide(testname, testslideIndex, testformat, testoutPath, testoptions, testwidth, testheight, testpassword, testfolder, teststorage, testfontsFolder)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"SaveSlide\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "9bbf702498013a26542bd1587a7eca28", "score": "0.60895395", "text": "func TestSaveSlideOnlineInvalidPassword(t *testing.T) {\n testdocument, _ := createTestParamValue(\"SaveSlideOnline\", \"document\", \"[]byte\").([]byte)\n testslideIndex, _ := createTestParamValue(\"SaveSlideOnline\", \"slideIndex\", \"int32\").(int32)\n testformat, _ := createTestParamValue(\"SaveSlideOnline\", \"format\", \"string\").(string)\n testoutPath, _ := createTestParamValue(\"SaveSlideOnline\", \"outPath\", \"string\").(string)\n var testwidth *int32\n testwidthValue := createTestParamValue(\"SaveSlideOnline\", \"width\", \"int32\")\n if (testwidthValue != nil) {\n testwidth = new(int32)\n *testwidth, _ = testwidthValue.(int32)\n }\n var testheight *int32\n testheightValue := createTestParamValue(\"SaveSlideOnline\", \"height\", \"int32\")\n if (testheightValue != nil) {\n testheight = new(int32)\n *testheight, _ = testheightValue.(int32)\n }\n testpassword, _ := createTestParamValue(\"SaveSlideOnline\", \"password\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"SaveSlideOnline\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"SaveSlideOnline\", \"fontsFolder\", \"string\").(string)\n testoptions, _ := createTestParamValue(\"SaveSlideOnline\", \"options\", \"ExportOptions\").(IExportOptions)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"SaveSlideOnline\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"SaveSlideOnline\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n r, e := GetTestApiClient().SlidesApi.SaveSlideOnline(testdocument, testslideIndex, testformat, testoutPath, testwidth, testheight, testpassword, teststorage, testfontsFolder, testoptions)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"SaveSlideOnline\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "f304b59e1c6345c1b049c6e1539b9a28", "score": "0.6072477", "text": "func TestDownloadPresentationInvalidFormat(t *testing.T) {\n testname, _ := createTestParamValue(\"DownloadPresentation\", \"name\", \"string\").(string)\n testformat, _ := createTestParamValue(\"DownloadPresentation\", \"format\", \"string\").(string)\n testoptions, _ := createTestParamValue(\"DownloadPresentation\", \"options\", \"ExportOptions\").(IExportOptions)\n testpassword, _ := createTestParamValue(\"DownloadPresentation\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"DownloadPresentation\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"DownloadPresentation\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"DownloadPresentation\", \"fontsFolder\", \"string\").(string)\n testslides, _ := createTestParamValue(\"DownloadPresentation\", \"slides\", \"[]int32\").([]int32)\n\n invalidValue := invalidizeTestParamValue(testformat, \"DownloadPresentation\", \"format\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testformat = nullValue\n } else {\n testformat, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"DownloadPresentation\", \"format\", testformat)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.DownloadPresentation(testname, testformat, testoptions, testpassword, testfolder, teststorage, testfontsFolder, testslides)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"DownloadPresentation\", \"format\", \"string\", testformat, int32(statusCode), e)\n}", "title": "" }, { "docid": "c70d8384488f8020f528b8bad1fb0e31", "score": "0.6068313", "text": "func TestReplaceTextFormattingOnline(t *testing.T) {\n testdocument, _ := createTestParamValue(\"ReplaceTextFormattingOnline\", \"document\", \"[]byte\").([]byte)\n testoldValue, _ := createTestParamValue(\"ReplaceTextFormattingOnline\", \"oldValue\", \"string\").(string)\n testnewValue, _ := createTestParamValue(\"ReplaceTextFormattingOnline\", \"newValue\", \"string\").(string)\n testportionFormat, _ := createTestParamValue(\"ReplaceTextFormattingOnline\", \"portionFormat\", \"PortionFormat\").(IPortionFormat)\n var testwithMasters *bool\n testwithMastersValue := createTestParamValue(\"ReplaceTextFormattingOnline\", \"withMasters\", \"bool\")\n if (testwithMastersValue != nil) {\n testwithMasters = new(bool)\n *testwithMasters, _ = testwithMastersValue.(bool)\n }\n testpassword, _ := createTestParamValue(\"ReplaceTextFormattingOnline\", \"password\", \"string\").(string)\n e := InitializeTest(\"ReplaceTextFormattingOnline\", \"\", \"\")\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n c := GetTestApiClient()\n r, _, e := c.SlidesApi.ReplaceTextFormattingOnline(testdocument, testoldValue, testnewValue, testportionFormat, testwithMasters, testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n assertBinaryResponse(r, t)\n}", "title": "" }, { "docid": "c0d986aded019f1ca0c9f940b8ebb544", "score": "0.60272706", "text": "func TestSaveSlideOnlineInvalidFormat(t *testing.T) {\n testdocument, _ := createTestParamValue(\"SaveSlideOnline\", \"document\", \"[]byte\").([]byte)\n testslideIndex, _ := createTestParamValue(\"SaveSlideOnline\", \"slideIndex\", \"int32\").(int32)\n testformat, _ := createTestParamValue(\"SaveSlideOnline\", \"format\", \"string\").(string)\n testoutPath, _ := createTestParamValue(\"SaveSlideOnline\", \"outPath\", \"string\").(string)\n var testwidth *int32\n testwidthValue := createTestParamValue(\"SaveSlideOnline\", \"width\", \"int32\")\n if (testwidthValue != nil) {\n testwidth = new(int32)\n *testwidth, _ = testwidthValue.(int32)\n }\n var testheight *int32\n testheightValue := createTestParamValue(\"SaveSlideOnline\", \"height\", \"int32\")\n if (testheightValue != nil) {\n testheight = new(int32)\n *testheight, _ = testheightValue.(int32)\n }\n testpassword, _ := createTestParamValue(\"SaveSlideOnline\", \"password\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"SaveSlideOnline\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"SaveSlideOnline\", \"fontsFolder\", \"string\").(string)\n testoptions, _ := createTestParamValue(\"SaveSlideOnline\", \"options\", \"ExportOptions\").(IExportOptions)\n\n invalidValue := invalidizeTestParamValue(testformat, \"SaveSlideOnline\", \"format\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testformat = nullValue\n } else {\n testformat, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"SaveSlideOnline\", \"format\", testformat)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n r, e := GetTestApiClient().SlidesApi.SaveSlideOnline(testdocument, testslideIndex, testformat, testoutPath, testwidth, testheight, testpassword, teststorage, testfontsFolder, testoptions)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"SaveSlideOnline\", \"format\", \"string\", testformat, int32(statusCode), e)\n}", "title": "" }, { "docid": "1ddae1a25c595474fdf83b974f04d20c", "score": "0.59965837", "text": "func TestCreatePresentationInvalidInputPassword(t *testing.T) {\n testname, _ := createTestParamValue(\"CreatePresentation\", \"name\", \"string\").(string)\n testdata, _ := createTestParamValue(\"CreatePresentation\", \"data\", \"[]byte\").([]byte)\n testinputPassword, _ := createTestParamValue(\"CreatePresentation\", \"inputPassword\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"CreatePresentation\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"CreatePresentation\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"CreatePresentation\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testinputPassword, \"CreatePresentation\", \"inputPassword\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testinputPassword = nullValue\n } else {\n testinputPassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"CreatePresentation\", \"inputPassword\", testinputPassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.CreatePresentation(testname, testdata, testinputPassword, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"CreatePresentation\", \"inputPassword\", \"string\", testinputPassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "d61ab36d07d1b57c65a61beae78b9726", "score": "0.5984627", "text": "func TestSaveSlideInvalidFormat(t *testing.T) {\n testname, _ := createTestParamValue(\"SaveSlide\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"SaveSlide\", \"slideIndex\", \"int32\").(int32)\n testformat, _ := createTestParamValue(\"SaveSlide\", \"format\", \"string\").(string)\n testoutPath, _ := createTestParamValue(\"SaveSlide\", \"outPath\", \"string\").(string)\n testoptions, _ := createTestParamValue(\"SaveSlide\", \"options\", \"ExportOptions\").(IExportOptions)\n var testwidth *int32\n testwidthValue := createTestParamValue(\"SaveSlide\", \"width\", \"int32\")\n if (testwidthValue != nil) {\n testwidth = new(int32)\n *testwidth, _ = testwidthValue.(int32)\n }\n var testheight *int32\n testheightValue := createTestParamValue(\"SaveSlide\", \"height\", \"int32\")\n if (testheightValue != nil) {\n testheight = new(int32)\n *testheight, _ = testheightValue.(int32)\n }\n testpassword, _ := createTestParamValue(\"SaveSlide\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"SaveSlide\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"SaveSlide\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"SaveSlide\", \"fontsFolder\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testformat, \"SaveSlide\", \"format\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testformat = nullValue\n } else {\n testformat, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"SaveSlide\", \"format\", testformat)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n r, e := GetTestApiClient().SlidesApi.SaveSlide(testname, testslideIndex, testformat, testoutPath, testoptions, testwidth, testheight, testpassword, testfolder, teststorage, testfontsFolder)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"SaveSlide\", \"format\", \"string\", testformat, int32(statusCode), e)\n}", "title": "" }, { "docid": "671326ebbe81e5a572a10e84577f3494", "score": "0.59715676", "text": "func TestReplaceTextFormattingOnlineInvalidPortionFormat(t *testing.T) {\n testdocument, _ := createTestParamValue(\"ReplaceTextFormattingOnline\", \"document\", \"[]byte\").([]byte)\n testoldValue, _ := createTestParamValue(\"ReplaceTextFormattingOnline\", \"oldValue\", \"string\").(string)\n testnewValue, _ := createTestParamValue(\"ReplaceTextFormattingOnline\", \"newValue\", \"string\").(string)\n testportionFormat, _ := createTestParamValue(\"ReplaceTextFormattingOnline\", \"portionFormat\", \"PortionFormat\").(IPortionFormat)\n var testwithMasters *bool\n testwithMastersValue := createTestParamValue(\"ReplaceTextFormattingOnline\", \"withMasters\", \"bool\")\n if (testwithMastersValue != nil) {\n testwithMasters = new(bool)\n *testwithMasters, _ = testwithMastersValue.(bool)\n }\n testpassword, _ := createTestParamValue(\"ReplaceTextFormattingOnline\", \"password\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testportionFormat, \"ReplaceTextFormattingOnline\", \"portionFormat\", \"PortionFormat\")\n if (invalidValue == nil) {\n testportionFormat = nil\n } else {\n testportionFormat, _ = invalidValue.(IPortionFormat)\n }\n\n e := InitializeTest(\"ReplaceTextFormattingOnline\", \"portionFormat\", testportionFormat)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.ReplaceTextFormattingOnline(testdocument, testoldValue, testnewValue, testportionFormat, testwithMasters, testpassword)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"ReplaceTextFormattingOnline\", \"portionFormat\", \"PortionFormat\", testportionFormat, int32(statusCode), e)\n}", "title": "" }, { "docid": "2e2456bfc098bae6057bc96cc7ac2e4b", "score": "0.5962464", "text": "func TestDownloadPresentation(t *testing.T) {\n testname, _ := createTestParamValue(\"DownloadPresentation\", \"name\", \"string\").(string)\n testformat, _ := createTestParamValue(\"DownloadPresentation\", \"format\", \"string\").(string)\n testoptions, _ := createTestParamValue(\"DownloadPresentation\", \"options\", \"ExportOptions\").(IExportOptions)\n testpassword, _ := createTestParamValue(\"DownloadPresentation\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"DownloadPresentation\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"DownloadPresentation\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"DownloadPresentation\", \"fontsFolder\", \"string\").(string)\n testslides, _ := createTestParamValue(\"DownloadPresentation\", \"slides\", \"[]int32\").([]int32)\n e := InitializeTest(\"DownloadPresentation\", \"\", \"\")\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n c := GetTestApiClient()\n r, _, e := c.SlidesApi.DownloadPresentation(testname, testformat, testoptions, testpassword, testfolder, teststorage, testfontsFolder, testslides)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n assertBinaryResponse(r, t)\n}", "title": "" }, { "docid": "c0af2ed7ecb039022a5e6ed80c737b7d", "score": "0.59015346", "text": "func TestCreatePresentationInvalidPassword(t *testing.T) {\n testname, _ := createTestParamValue(\"CreatePresentation\", \"name\", \"string\").(string)\n testdata, _ := createTestParamValue(\"CreatePresentation\", \"data\", \"[]byte\").([]byte)\n testinputPassword, _ := createTestParamValue(\"CreatePresentation\", \"inputPassword\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"CreatePresentation\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"CreatePresentation\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"CreatePresentation\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"CreatePresentation\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"CreatePresentation\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.CreatePresentation(testname, testdata, testinputPassword, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"CreatePresentation\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "1f9e3f9db5179fe5e9d022a34b0429af", "score": "0.589872", "text": "func TestDownloadPresentationInvalidPassword(t *testing.T) {\n testname, _ := createTestParamValue(\"DownloadPresentation\", \"name\", \"string\").(string)\n testformat, _ := createTestParamValue(\"DownloadPresentation\", \"format\", \"string\").(string)\n testoptions, _ := createTestParamValue(\"DownloadPresentation\", \"options\", \"ExportOptions\").(IExportOptions)\n testpassword, _ := createTestParamValue(\"DownloadPresentation\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"DownloadPresentation\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"DownloadPresentation\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"DownloadPresentation\", \"fontsFolder\", \"string\").(string)\n testslides, _ := createTestParamValue(\"DownloadPresentation\", \"slides\", \"[]int32\").([]int32)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"DownloadPresentation\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"DownloadPresentation\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.DownloadPresentation(testname, testformat, testoptions, testpassword, testfolder, teststorage, testfontsFolder, testslides)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"DownloadPresentation\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "d7d1fa56aab421a8fa01c891bc2c432d", "score": "0.5850788", "text": "func TestSavePresentationInvalidSlides(t *testing.T) {\n testname, _ := createTestParamValue(\"SavePresentation\", \"name\", \"string\").(string)\n testformat, _ := createTestParamValue(\"SavePresentation\", \"format\", \"string\").(string)\n testoutPath, _ := createTestParamValue(\"SavePresentation\", \"outPath\", \"string\").(string)\n testoptions, _ := createTestParamValue(\"SavePresentation\", \"options\", \"ExportOptions\").(IExportOptions)\n testpassword, _ := createTestParamValue(\"SavePresentation\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"SavePresentation\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"SavePresentation\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"SavePresentation\", \"fontsFolder\", \"string\").(string)\n testslides, _ := createTestParamValue(\"SavePresentation\", \"slides\", \"[]int32\").([]int32)\n\n invalidValue := invalidizeTestParamValue(testslides, \"SavePresentation\", \"slides\", \"[]int32\")\n if (invalidValue == nil) {\n testslides = nil\n } else {\n testslides, _ = invalidValue.([]int32)\n }\n\n e := InitializeTest(\"SavePresentation\", \"slides\", testslides)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n r, e := GetTestApiClient().SlidesApi.SavePresentation(testname, testformat, testoutPath, testoptions, testpassword, testfolder, teststorage, testfontsFolder, testslides)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"SavePresentation\", \"slides\", \"[]int32\", testslides, int32(statusCode), e)\n}", "title": "" }, { "docid": "700689f45ff0b5688acca03c5432c7b7", "score": "0.5842733", "text": "func TestReplaceTextFormattingOnlineInvalidPassword(t *testing.T) {\n testdocument, _ := createTestParamValue(\"ReplaceTextFormattingOnline\", \"document\", \"[]byte\").([]byte)\n testoldValue, _ := createTestParamValue(\"ReplaceTextFormattingOnline\", \"oldValue\", \"string\").(string)\n testnewValue, _ := createTestParamValue(\"ReplaceTextFormattingOnline\", \"newValue\", \"string\").(string)\n testportionFormat, _ := createTestParamValue(\"ReplaceTextFormattingOnline\", \"portionFormat\", \"PortionFormat\").(IPortionFormat)\n var testwithMasters *bool\n testwithMastersValue := createTestParamValue(\"ReplaceTextFormattingOnline\", \"withMasters\", \"bool\")\n if (testwithMastersValue != nil) {\n testwithMasters = new(bool)\n *testwithMasters, _ = testwithMastersValue.(bool)\n }\n testpassword, _ := createTestParamValue(\"ReplaceTextFormattingOnline\", \"password\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"ReplaceTextFormattingOnline\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"ReplaceTextFormattingOnline\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.ReplaceTextFormattingOnline(testdocument, testoldValue, testnewValue, testportionFormat, testwithMasters, testpassword)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"ReplaceTextFormattingOnline\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "a13d5e628b31d1c02019231ce00c3d16", "score": "0.5811409", "text": "func TestCreatePresentationFromTemplateInvalidPassword(t *testing.T) {\n testname, _ := createTestParamValue(\"CreatePresentationFromTemplate\", \"name\", \"string\").(string)\n testtemplatePath, _ := createTestParamValue(\"CreatePresentationFromTemplate\", \"templatePath\", \"string\").(string)\n testdata, _ := createTestParamValue(\"CreatePresentationFromTemplate\", \"data\", \"string\").(string)\n testtemplatePassword, _ := createTestParamValue(\"CreatePresentationFromTemplate\", \"templatePassword\", \"string\").(string)\n testtemplateStorage, _ := createTestParamValue(\"CreatePresentationFromTemplate\", \"templateStorage\", \"string\").(string)\n var testisImageDataEmbedded *bool\n testisImageDataEmbeddedValue := createTestParamValue(\"CreatePresentationFromTemplate\", \"isImageDataEmbedded\", \"bool\")\n if (testisImageDataEmbeddedValue != nil) {\n testisImageDataEmbedded = new(bool)\n *testisImageDataEmbedded, _ = testisImageDataEmbeddedValue.(bool)\n }\n testpassword, _ := createTestParamValue(\"CreatePresentationFromTemplate\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"CreatePresentationFromTemplate\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"CreatePresentationFromTemplate\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"CreatePresentationFromTemplate\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"CreatePresentationFromTemplate\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.CreatePresentationFromTemplate(testname, testtemplatePath, testdata, testtemplatePassword, testtemplateStorage, testisImageDataEmbedded, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"CreatePresentationFromTemplate\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "e0948d05c4913b5627da5af3dd6331c3", "score": "0.57990265", "text": "func TestReplaceTextFormattingOnlineInvalidDocument(t *testing.T) {\n testdocument, _ := createTestParamValue(\"ReplaceTextFormattingOnline\", \"document\", \"[]byte\").([]byte)\n testoldValue, _ := createTestParamValue(\"ReplaceTextFormattingOnline\", \"oldValue\", \"string\").(string)\n testnewValue, _ := createTestParamValue(\"ReplaceTextFormattingOnline\", \"newValue\", \"string\").(string)\n testportionFormat, _ := createTestParamValue(\"ReplaceTextFormattingOnline\", \"portionFormat\", \"PortionFormat\").(IPortionFormat)\n var testwithMasters *bool\n testwithMastersValue := createTestParamValue(\"ReplaceTextFormattingOnline\", \"withMasters\", \"bool\")\n if (testwithMastersValue != nil) {\n testwithMasters = new(bool)\n *testwithMasters, _ = testwithMastersValue.(bool)\n }\n testpassword, _ := createTestParamValue(\"ReplaceTextFormattingOnline\", \"password\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testdocument, \"ReplaceTextFormattingOnline\", \"document\", \"[]byte\")\n if (invalidValue == nil) {\n testdocument = nil\n } else {\n testdocument, _ = invalidValue.([]byte)\n }\n\n e := InitializeTest(\"ReplaceTextFormattingOnline\", \"document\", testdocument)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.ReplaceTextFormattingOnline(testdocument, testoldValue, testnewValue, testportionFormat, testwithMasters, testpassword)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"ReplaceTextFormattingOnline\", \"document\", \"[]byte\", testdocument, int32(statusCode), e)\n}", "title": "" }, { "docid": "867a8e2d3a959f2770985752e2529776", "score": "0.57950383", "text": "func TestConvertAndSaveInvalidStorage(t *testing.T) {\n testdocument, _ := createTestParamValue(\"ConvertAndSave\", \"document\", \"[]byte\").([]byte)\n testformat, _ := createTestParamValue(\"ConvertAndSave\", \"format\", \"string\").(string)\n testoutPath, _ := createTestParamValue(\"ConvertAndSave\", \"outPath\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"ConvertAndSave\", \"password\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"ConvertAndSave\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"ConvertAndSave\", \"fontsFolder\", \"string\").(string)\n testslides, _ := createTestParamValue(\"ConvertAndSave\", \"slides\", \"[]int32\").([]int32)\n testoptions, _ := createTestParamValue(\"ConvertAndSave\", \"options\", \"ExportOptions\").(IExportOptions)\n\n invalidValue := invalidizeTestParamValue(teststorage, \"ConvertAndSave\", \"storage\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n teststorage = nullValue\n } else {\n teststorage, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"ConvertAndSave\", \"storage\", teststorage)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n r, e := GetTestApiClient().SlidesApi.ConvertAndSave(testdocument, testformat, testoutPath, testpassword, teststorage, testfontsFolder, testslides, testoptions)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"ConvertAndSave\", \"storage\", \"string\", teststorage, int32(statusCode), e)\n}", "title": "" }, { "docid": "5a19a185ca3e2dffc12f5ef80999b333", "score": "0.579336", "text": "func TestReplacePresentationTextOnline(t *testing.T) {\n testdocument, _ := createTestParamValue(\"ReplacePresentationTextOnline\", \"document\", \"[]byte\").([]byte)\n testoldValue, _ := createTestParamValue(\"ReplacePresentationTextOnline\", \"oldValue\", \"string\").(string)\n testnewValue, _ := createTestParamValue(\"ReplacePresentationTextOnline\", \"newValue\", \"string\").(string)\n var testignoreCase *bool\n testignoreCaseValue := createTestParamValue(\"ReplacePresentationTextOnline\", \"ignoreCase\", \"bool\")\n if (testignoreCaseValue != nil) {\n testignoreCase = new(bool)\n *testignoreCase, _ = testignoreCaseValue.(bool)\n }\n testpassword, _ := createTestParamValue(\"ReplacePresentationTextOnline\", \"password\", \"string\").(string)\n e := InitializeTest(\"ReplacePresentationTextOnline\", \"\", \"\")\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n c := GetTestApiClient()\n r, _, e := c.SlidesApi.ReplacePresentationTextOnline(testdocument, testoldValue, testnewValue, testignoreCase, testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n assertBinaryResponse(r, t)\n}", "title": "" }, { "docid": "156c49aef900c72a4172c0138355cced", "score": "0.5788596", "text": "func TestConvertInvalidStorage(t *testing.T) {\n testdocument, _ := createTestParamValue(\"Convert\", \"document\", \"[]byte\").([]byte)\n testformat, _ := createTestParamValue(\"Convert\", \"format\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"Convert\", \"password\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"Convert\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"Convert\", \"fontsFolder\", \"string\").(string)\n testslides, _ := createTestParamValue(\"Convert\", \"slides\", \"[]int32\").([]int32)\n testoptions, _ := createTestParamValue(\"Convert\", \"options\", \"ExportOptions\").(IExportOptions)\n\n invalidValue := invalidizeTestParamValue(teststorage, \"Convert\", \"storage\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n teststorage = nullValue\n } else {\n teststorage, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"Convert\", \"storage\", teststorage)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.Convert(testdocument, testformat, testpassword, teststorage, testfontsFolder, testslides, testoptions)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"Convert\", \"storage\", \"string\", teststorage, int32(statusCode), e)\n}", "title": "" }, { "docid": "06adf6173f621e6e6557adf1de0f4313", "score": "0.576842", "text": "func TestDownloadNotesSlideOnlineInvalidFormat(t *testing.T) {\n testdocument, _ := createTestParamValue(\"DownloadNotesSlideOnline\", \"document\", \"[]byte\").([]byte)\n testslideIndex, _ := createTestParamValue(\"DownloadNotesSlideOnline\", \"slideIndex\", \"int32\").(int32)\n testformat, _ := createTestParamValue(\"DownloadNotesSlideOnline\", \"format\", \"string\").(string)\n var testwidth *int32\n testwidthValue := createTestParamValue(\"DownloadNotesSlideOnline\", \"width\", \"int32\")\n if (testwidthValue != nil) {\n testwidth = new(int32)\n *testwidth, _ = testwidthValue.(int32)\n }\n var testheight *int32\n testheightValue := createTestParamValue(\"DownloadNotesSlideOnline\", \"height\", \"int32\")\n if (testheightValue != nil) {\n testheight = new(int32)\n *testheight, _ = testheightValue.(int32)\n }\n testpassword, _ := createTestParamValue(\"DownloadNotesSlideOnline\", \"password\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"DownloadNotesSlideOnline\", \"fontsFolder\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testformat, \"DownloadNotesSlideOnline\", \"format\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testformat = nullValue\n } else {\n testformat, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"DownloadNotesSlideOnline\", \"format\", testformat)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.DownloadNotesSlideOnline(testdocument, testslideIndex, testformat, testwidth, testheight, testpassword, testfontsFolder)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"DownloadNotesSlideOnline\", \"format\", \"string\", testformat, int32(statusCode), e)\n}", "title": "" }, { "docid": "24a6a9dda297b835a987ff1b508424a1", "score": "0.57624376", "text": "func TestSaveSlideOnlineInvalidDocument(t *testing.T) {\n testdocument, _ := createTestParamValue(\"SaveSlideOnline\", \"document\", \"[]byte\").([]byte)\n testslideIndex, _ := createTestParamValue(\"SaveSlideOnline\", \"slideIndex\", \"int32\").(int32)\n testformat, _ := createTestParamValue(\"SaveSlideOnline\", \"format\", \"string\").(string)\n testoutPath, _ := createTestParamValue(\"SaveSlideOnline\", \"outPath\", \"string\").(string)\n var testwidth *int32\n testwidthValue := createTestParamValue(\"SaveSlideOnline\", \"width\", \"int32\")\n if (testwidthValue != nil) {\n testwidth = new(int32)\n *testwidth, _ = testwidthValue.(int32)\n }\n var testheight *int32\n testheightValue := createTestParamValue(\"SaveSlideOnline\", \"height\", \"int32\")\n if (testheightValue != nil) {\n testheight = new(int32)\n *testheight, _ = testheightValue.(int32)\n }\n testpassword, _ := createTestParamValue(\"SaveSlideOnline\", \"password\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"SaveSlideOnline\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"SaveSlideOnline\", \"fontsFolder\", \"string\").(string)\n testoptions, _ := createTestParamValue(\"SaveSlideOnline\", \"options\", \"ExportOptions\").(IExportOptions)\n\n invalidValue := invalidizeTestParamValue(testdocument, \"SaveSlideOnline\", \"document\", \"[]byte\")\n if (invalidValue == nil) {\n testdocument = nil\n } else {\n testdocument, _ = invalidValue.([]byte)\n }\n\n e := InitializeTest(\"SaveSlideOnline\", \"document\", testdocument)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n r, e := GetTestApiClient().SlidesApi.SaveSlideOnline(testdocument, testslideIndex, testformat, testoutPath, testwidth, testheight, testpassword, teststorage, testfontsFolder, testoptions)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"SaveSlideOnline\", \"document\", \"[]byte\", testdocument, int32(statusCode), e)\n}", "title": "" }, { "docid": "dcc2e867c4763e7491d34413b4ce09b1", "score": "0.5747254", "text": "func TestReplaceTextFormattingInvalidPortionFormat(t *testing.T) {\n testname, _ := createTestParamValue(\"ReplaceTextFormatting\", \"name\", \"string\").(string)\n testoldValue, _ := createTestParamValue(\"ReplaceTextFormatting\", \"oldValue\", \"string\").(string)\n testnewValue, _ := createTestParamValue(\"ReplaceTextFormatting\", \"newValue\", \"string\").(string)\n testportionFormat, _ := createTestParamValue(\"ReplaceTextFormatting\", \"portionFormat\", \"PortionFormat\").(IPortionFormat)\n var testwithMasters *bool\n testwithMastersValue := createTestParamValue(\"ReplaceTextFormatting\", \"withMasters\", \"bool\")\n if (testwithMastersValue != nil) {\n testwithMasters = new(bool)\n *testwithMasters, _ = testwithMastersValue.(bool)\n }\n testpassword, _ := createTestParamValue(\"ReplaceTextFormatting\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"ReplaceTextFormatting\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"ReplaceTextFormatting\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testportionFormat, \"ReplaceTextFormatting\", \"portionFormat\", \"PortionFormat\")\n if (invalidValue == nil) {\n testportionFormat = nil\n } else {\n testportionFormat, _ = invalidValue.(IPortionFormat)\n }\n\n e := InitializeTest(\"ReplaceTextFormatting\", \"portionFormat\", testportionFormat)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.ReplaceTextFormatting(testname, testoldValue, testnewValue, testportionFormat, testwithMasters, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"ReplaceTextFormatting\", \"portionFormat\", \"PortionFormat\", testportionFormat, int32(statusCode), e)\n}", "title": "" }, { "docid": "1d2cf9524b96801698b3efcbe6d301fa", "score": "0.5736432", "text": "func TestCreatePresentationFromTemplateInvalidTemplatePassword(t *testing.T) {\n testname, _ := createTestParamValue(\"CreatePresentationFromTemplate\", \"name\", \"string\").(string)\n testtemplatePath, _ := createTestParamValue(\"CreatePresentationFromTemplate\", \"templatePath\", \"string\").(string)\n testdata, _ := createTestParamValue(\"CreatePresentationFromTemplate\", \"data\", \"string\").(string)\n testtemplatePassword, _ := createTestParamValue(\"CreatePresentationFromTemplate\", \"templatePassword\", \"string\").(string)\n testtemplateStorage, _ := createTestParamValue(\"CreatePresentationFromTemplate\", \"templateStorage\", \"string\").(string)\n var testisImageDataEmbedded *bool\n testisImageDataEmbeddedValue := createTestParamValue(\"CreatePresentationFromTemplate\", \"isImageDataEmbedded\", \"bool\")\n if (testisImageDataEmbeddedValue != nil) {\n testisImageDataEmbedded = new(bool)\n *testisImageDataEmbedded, _ = testisImageDataEmbeddedValue.(bool)\n }\n testpassword, _ := createTestParamValue(\"CreatePresentationFromTemplate\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"CreatePresentationFromTemplate\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"CreatePresentationFromTemplate\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testtemplatePassword, \"CreatePresentationFromTemplate\", \"templatePassword\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testtemplatePassword = nullValue\n } else {\n testtemplatePassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"CreatePresentationFromTemplate\", \"templatePassword\", testtemplatePassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.CreatePresentationFromTemplate(testname, testtemplatePath, testdata, testtemplatePassword, testtemplateStorage, testisImageDataEmbedded, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"CreatePresentationFromTemplate\", \"templatePassword\", \"string\", testtemplatePassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "49fcac30ffccacde876ed1082e97a752", "score": "0.57353395", "text": "func TestCreatePresentationFromSource(t *testing.T) {\n testname, _ := createTestParamValue(\"CreatePresentationFromSource\", \"name\", \"string\").(string)\n testsourcePath, _ := createTestParamValue(\"CreatePresentationFromSource\", \"sourcePath\", \"string\").(string)\n testsourcePassword, _ := createTestParamValue(\"CreatePresentationFromSource\", \"sourcePassword\", \"string\").(string)\n testsourceStorage, _ := createTestParamValue(\"CreatePresentationFromSource\", \"sourceStorage\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"CreatePresentationFromSource\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"CreatePresentationFromSource\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"CreatePresentationFromSource\", \"storage\", \"string\").(string)\n e := InitializeTest(\"CreatePresentationFromSource\", \"\", \"\")\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n c := GetTestApiClient()\n _, _, e = c.SlidesApi.CreatePresentationFromSource(testname, testsourcePath, testsourcePassword, testsourceStorage, testpassword, testfolder, teststorage)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n}", "title": "" }, { "docid": "bb4b7905af0fb578d178d97900396f25", "score": "0.5734335", "text": "func TestDownloadNotesSlideInvalidFormat(t *testing.T) {\n testname, _ := createTestParamValue(\"DownloadNotesSlide\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"DownloadNotesSlide\", \"slideIndex\", \"int32\").(int32)\n testformat, _ := createTestParamValue(\"DownloadNotesSlide\", \"format\", \"string\").(string)\n var testwidth *int32\n testwidthValue := createTestParamValue(\"DownloadNotesSlide\", \"width\", \"int32\")\n if (testwidthValue != nil) {\n testwidth = new(int32)\n *testwidth, _ = testwidthValue.(int32)\n }\n var testheight *int32\n testheightValue := createTestParamValue(\"DownloadNotesSlide\", \"height\", \"int32\")\n if (testheightValue != nil) {\n testheight = new(int32)\n *testheight, _ = testheightValue.(int32)\n }\n testpassword, _ := createTestParamValue(\"DownloadNotesSlide\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"DownloadNotesSlide\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"DownloadNotesSlide\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"DownloadNotesSlide\", \"fontsFolder\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testformat, \"DownloadNotesSlide\", \"format\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testformat = nullValue\n } else {\n testformat, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"DownloadNotesSlide\", \"format\", testformat)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.DownloadNotesSlide(testname, testslideIndex, testformat, testwidth, testheight, testpassword, testfolder, teststorage, testfontsFolder)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"DownloadNotesSlide\", \"format\", \"string\", testformat, int32(statusCode), e)\n}", "title": "" }, { "docid": "6c6980ab6d1418f8490ed337d37bca70", "score": "0.57240397", "text": "func TestReplaceTextFormattingInvalidPassword(t *testing.T) {\n testname, _ := createTestParamValue(\"ReplaceTextFormatting\", \"name\", \"string\").(string)\n testoldValue, _ := createTestParamValue(\"ReplaceTextFormatting\", \"oldValue\", \"string\").(string)\n testnewValue, _ := createTestParamValue(\"ReplaceTextFormatting\", \"newValue\", \"string\").(string)\n testportionFormat, _ := createTestParamValue(\"ReplaceTextFormatting\", \"portionFormat\", \"PortionFormat\").(IPortionFormat)\n var testwithMasters *bool\n testwithMastersValue := createTestParamValue(\"ReplaceTextFormatting\", \"withMasters\", \"bool\")\n if (testwithMastersValue != nil) {\n testwithMasters = new(bool)\n *testwithMasters, _ = testwithMastersValue.(bool)\n }\n testpassword, _ := createTestParamValue(\"ReplaceTextFormatting\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"ReplaceTextFormatting\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"ReplaceTextFormatting\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"ReplaceTextFormatting\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"ReplaceTextFormatting\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.ReplaceTextFormatting(testname, testoldValue, testnewValue, testportionFormat, testwithMasters, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"ReplaceTextFormatting\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "b200725fb4bd4cd3914e0c4d9b7365e8", "score": "0.5713055", "text": "func TestReplaceTextFormatting(t *testing.T) {\n testname, _ := createTestParamValue(\"ReplaceTextFormatting\", \"name\", \"string\").(string)\n testoldValue, _ := createTestParamValue(\"ReplaceTextFormatting\", \"oldValue\", \"string\").(string)\n testnewValue, _ := createTestParamValue(\"ReplaceTextFormatting\", \"newValue\", \"string\").(string)\n testportionFormat, _ := createTestParamValue(\"ReplaceTextFormatting\", \"portionFormat\", \"PortionFormat\").(IPortionFormat)\n var testwithMasters *bool\n testwithMastersValue := createTestParamValue(\"ReplaceTextFormatting\", \"withMasters\", \"bool\")\n if (testwithMastersValue != nil) {\n testwithMasters = new(bool)\n *testwithMasters, _ = testwithMastersValue.(bool)\n }\n testpassword, _ := createTestParamValue(\"ReplaceTextFormatting\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"ReplaceTextFormatting\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"ReplaceTextFormatting\", \"storage\", \"string\").(string)\n e := InitializeTest(\"ReplaceTextFormatting\", \"\", \"\")\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n c := GetTestApiClient()\n _, _, e = c.SlidesApi.ReplaceTextFormatting(testname, testoldValue, testnewValue, testportionFormat, testwithMasters, testpassword, testfolder, teststorage)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n}", "title": "" }, { "docid": "98a8eabd3bd748b4c85e7916b0322d5b", "score": "0.5707832", "text": "func TestDownloadSlideInvalidFormat(t *testing.T) {\n testname, _ := createTestParamValue(\"DownloadSlide\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"DownloadSlide\", \"slideIndex\", \"int32\").(int32)\n testformat, _ := createTestParamValue(\"DownloadSlide\", \"format\", \"string\").(string)\n testoptions, _ := createTestParamValue(\"DownloadSlide\", \"options\", \"ExportOptions\").(IExportOptions)\n var testwidth *int32\n testwidthValue := createTestParamValue(\"DownloadSlide\", \"width\", \"int32\")\n if (testwidthValue != nil) {\n testwidth = new(int32)\n *testwidth, _ = testwidthValue.(int32)\n }\n var testheight *int32\n testheightValue := createTestParamValue(\"DownloadSlide\", \"height\", \"int32\")\n if (testheightValue != nil) {\n testheight = new(int32)\n *testheight, _ = testheightValue.(int32)\n }\n testpassword, _ := createTestParamValue(\"DownloadSlide\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"DownloadSlide\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"DownloadSlide\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"DownloadSlide\", \"fontsFolder\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testformat, \"DownloadSlide\", \"format\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testformat = nullValue\n } else {\n testformat, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"DownloadSlide\", \"format\", testformat)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.DownloadSlide(testname, testslideIndex, testformat, testoptions, testwidth, testheight, testpassword, testfolder, teststorage, testfontsFolder)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"DownloadSlide\", \"format\", \"string\", testformat, int32(statusCode), e)\n}", "title": "" }, { "docid": "3c3bbc460148516c4c369496f342c528", "score": "0.57036066", "text": "func TestDownloadSlideInvalidPassword(t *testing.T) {\n testname, _ := createTestParamValue(\"DownloadSlide\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"DownloadSlide\", \"slideIndex\", \"int32\").(int32)\n testformat, _ := createTestParamValue(\"DownloadSlide\", \"format\", \"string\").(string)\n testoptions, _ := createTestParamValue(\"DownloadSlide\", \"options\", \"ExportOptions\").(IExportOptions)\n var testwidth *int32\n testwidthValue := createTestParamValue(\"DownloadSlide\", \"width\", \"int32\")\n if (testwidthValue != nil) {\n testwidth = new(int32)\n *testwidth, _ = testwidthValue.(int32)\n }\n var testheight *int32\n testheightValue := createTestParamValue(\"DownloadSlide\", \"height\", \"int32\")\n if (testheightValue != nil) {\n testheight = new(int32)\n *testheight, _ = testheightValue.(int32)\n }\n testpassword, _ := createTestParamValue(\"DownloadSlide\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"DownloadSlide\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"DownloadSlide\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"DownloadSlide\", \"fontsFolder\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"DownloadSlide\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"DownloadSlide\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.DownloadSlide(testname, testslideIndex, testformat, testoptions, testwidth, testheight, testpassword, testfolder, teststorage, testfontsFolder)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"DownloadSlide\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "ab4a36027c6cf23b5137ccc3a22bb17b", "score": "0.5698973", "text": "func TestConvertAndSaveInvalidOptions(t *testing.T) {\n testdocument, _ := createTestParamValue(\"ConvertAndSave\", \"document\", \"[]byte\").([]byte)\n testformat, _ := createTestParamValue(\"ConvertAndSave\", \"format\", \"string\").(string)\n testoutPath, _ := createTestParamValue(\"ConvertAndSave\", \"outPath\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"ConvertAndSave\", \"password\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"ConvertAndSave\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"ConvertAndSave\", \"fontsFolder\", \"string\").(string)\n testslides, _ := createTestParamValue(\"ConvertAndSave\", \"slides\", \"[]int32\").([]int32)\n testoptions, _ := createTestParamValue(\"ConvertAndSave\", \"options\", \"ExportOptions\").(IExportOptions)\n\n invalidValue := invalidizeTestParamValue(testoptions, \"ConvertAndSave\", \"options\", \"ExportOptions\")\n if (invalidValue == nil) {\n testoptions = nil\n } else {\n testoptions, _ = invalidValue.(IExportOptions)\n }\n\n e := InitializeTest(\"ConvertAndSave\", \"options\", testoptions)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n r, e := GetTestApiClient().SlidesApi.ConvertAndSave(testdocument, testformat, testoutPath, testpassword, teststorage, testfontsFolder, testslides, testoptions)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"ConvertAndSave\", \"options\", \"ExportOptions\", testoptions, int32(statusCode), e)\n}", "title": "" }, { "docid": "416f6ca2cc1c1f047e4b722c5e8414cc", "score": "0.5698368", "text": "func TestCreateSpecialSlideParagraphInvalidPassword(t *testing.T) {\n testname, _ := createTestParamValue(\"CreateSpecialSlideParagraph\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"CreateSpecialSlideParagraph\", \"slideIndex\", \"int32\").(int32)\n testslideType, _ := createTestParamValue(\"CreateSpecialSlideParagraph\", \"slideType\", \"string\").(string)\n testshapeIndex, _ := createTestParamValue(\"CreateSpecialSlideParagraph\", \"shapeIndex\", \"int32\").(int32)\n testdto, _ := createTestParamValue(\"CreateSpecialSlideParagraph\", \"dto\", \"Paragraph\").(IParagraph)\n var testposition *int32\n testpositionValue := createTestParamValue(\"CreateSpecialSlideParagraph\", \"position\", \"int32\")\n if (testpositionValue != nil) {\n testposition = new(int32)\n *testposition, _ = testpositionValue.(int32)\n }\n testpassword, _ := createTestParamValue(\"CreateSpecialSlideParagraph\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"CreateSpecialSlideParagraph\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"CreateSpecialSlideParagraph\", \"storage\", \"string\").(string)\n testsubShape, _ := createTestParamValue(\"CreateSpecialSlideParagraph\", \"subShape\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"CreateSpecialSlideParagraph\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"CreateSpecialSlideParagraph\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.CreateSpecialSlideParagraph(testname, testslideIndex, testslideType, testshapeIndex, testdto, testposition, testpassword, testfolder, teststorage, testsubShape)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"CreateSpecialSlideParagraph\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "17c15894062b0be1f204cc42d5b8becb", "score": "0.5695358", "text": "func TestReplacePresentationTextOnlineInvalidPassword(t *testing.T) {\n testdocument, _ := createTestParamValue(\"ReplacePresentationTextOnline\", \"document\", \"[]byte\").([]byte)\n testoldValue, _ := createTestParamValue(\"ReplacePresentationTextOnline\", \"oldValue\", \"string\").(string)\n testnewValue, _ := createTestParamValue(\"ReplacePresentationTextOnline\", \"newValue\", \"string\").(string)\n var testignoreCase *bool\n testignoreCaseValue := createTestParamValue(\"ReplacePresentationTextOnline\", \"ignoreCase\", \"bool\")\n if (testignoreCaseValue != nil) {\n testignoreCase = new(bool)\n *testignoreCase, _ = testignoreCaseValue.(bool)\n }\n testpassword, _ := createTestParamValue(\"ReplacePresentationTextOnline\", \"password\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"ReplacePresentationTextOnline\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"ReplacePresentationTextOnline\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.ReplacePresentationTextOnline(testdocument, testoldValue, testnewValue, testignoreCase, testpassword)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"ReplacePresentationTextOnline\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "30d1f3b896c81ba3f67226c75644ab7a", "score": "0.5671772", "text": "func TestCopyLayoutSlideInvalidPassword(t *testing.T) {\n testname, _ := createTestParamValue(\"CopyLayoutSlide\", \"name\", \"string\").(string)\n testcloneFrom, _ := createTestParamValue(\"CopyLayoutSlide\", \"cloneFrom\", \"string\").(string)\n testcloneFromPosition, _ := createTestParamValue(\"CopyLayoutSlide\", \"cloneFromPosition\", \"int32\").(int32)\n testcloneFromPassword, _ := createTestParamValue(\"CopyLayoutSlide\", \"cloneFromPassword\", \"string\").(string)\n testcloneFromStorage, _ := createTestParamValue(\"CopyLayoutSlide\", \"cloneFromStorage\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"CopyLayoutSlide\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"CopyLayoutSlide\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"CopyLayoutSlide\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"CopyLayoutSlide\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"CopyLayoutSlide\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.CopyLayoutSlide(testname, testcloneFrom, testcloneFromPosition, testcloneFromPassword, testcloneFromStorage, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"CopyLayoutSlide\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "0505d0e881d322a5be83de9146209dd7", "score": "0.5671116", "text": "func TestCreatePresentationInvalidData(t *testing.T) {\n testname, _ := createTestParamValue(\"CreatePresentation\", \"name\", \"string\").(string)\n testdata, _ := createTestParamValue(\"CreatePresentation\", \"data\", \"[]byte\").([]byte)\n testinputPassword, _ := createTestParamValue(\"CreatePresentation\", \"inputPassword\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"CreatePresentation\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"CreatePresentation\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"CreatePresentation\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testdata, \"CreatePresentation\", \"data\", \"[]byte\")\n if (invalidValue == nil) {\n testdata = nil\n } else {\n testdata, _ = invalidValue.([]byte)\n }\n\n e := InitializeTest(\"CreatePresentation\", \"data\", testdata)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.CreatePresentation(testname, testdata, testinputPassword, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"CreatePresentation\", \"data\", \"[]byte\", testdata, int32(statusCode), e)\n}", "title": "" }, { "docid": "676e81090b4c8e30b7b9a0dbdca446b7", "score": "0.5671009", "text": "func TestReplacePresentationTextOnlineInvalidDocument(t *testing.T) {\n testdocument, _ := createTestParamValue(\"ReplacePresentationTextOnline\", \"document\", \"[]byte\").([]byte)\n testoldValue, _ := createTestParamValue(\"ReplacePresentationTextOnline\", \"oldValue\", \"string\").(string)\n testnewValue, _ := createTestParamValue(\"ReplacePresentationTextOnline\", \"newValue\", \"string\").(string)\n var testignoreCase *bool\n testignoreCaseValue := createTestParamValue(\"ReplacePresentationTextOnline\", \"ignoreCase\", \"bool\")\n if (testignoreCaseValue != nil) {\n testignoreCase = new(bool)\n *testignoreCase, _ = testignoreCaseValue.(bool)\n }\n testpassword, _ := createTestParamValue(\"ReplacePresentationTextOnline\", \"password\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testdocument, \"ReplacePresentationTextOnline\", \"document\", \"[]byte\")\n if (invalidValue == nil) {\n testdocument = nil\n } else {\n testdocument, _ = invalidValue.([]byte)\n }\n\n e := InitializeTest(\"ReplacePresentationTextOnline\", \"document\", testdocument)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.ReplacePresentationTextOnline(testdocument, testoldValue, testnewValue, testignoreCase, testpassword)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"ReplacePresentationTextOnline\", \"document\", \"[]byte\", testdocument, int32(statusCode), e)\n}", "title": "" }, { "docid": "3a46ad8df35583d85acd4e0db9af41fe", "score": "0.5666929", "text": "func TestGetPresentation(t *testing.T) {\n testname, _ := createTestParamValue(\"GetPresentation\", \"name\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"GetPresentation\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"GetPresentation\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"GetPresentation\", \"storage\", \"string\").(string)\n e := InitializeTest(\"GetPresentation\", \"\", \"\")\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n c := GetTestApiClient()\n _, _, e = c.SlidesApi.GetPresentation(testname, testpassword, testfolder, teststorage)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n}", "title": "" }, { "docid": "472a153790bcd5064bc0a0bc750de0aa", "score": "0.5666214", "text": "func TestSavePresentationInvalidStorage(t *testing.T) {\n testname, _ := createTestParamValue(\"SavePresentation\", \"name\", \"string\").(string)\n testformat, _ := createTestParamValue(\"SavePresentation\", \"format\", \"string\").(string)\n testoutPath, _ := createTestParamValue(\"SavePresentation\", \"outPath\", \"string\").(string)\n testoptions, _ := createTestParamValue(\"SavePresentation\", \"options\", \"ExportOptions\").(IExportOptions)\n testpassword, _ := createTestParamValue(\"SavePresentation\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"SavePresentation\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"SavePresentation\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"SavePresentation\", \"fontsFolder\", \"string\").(string)\n testslides, _ := createTestParamValue(\"SavePresentation\", \"slides\", \"[]int32\").([]int32)\n\n invalidValue := invalidizeTestParamValue(teststorage, \"SavePresentation\", \"storage\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n teststorage = nullValue\n } else {\n teststorage, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"SavePresentation\", \"storage\", teststorage)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n r, e := GetTestApiClient().SlidesApi.SavePresentation(testname, testformat, testoutPath, testoptions, testpassword, testfolder, teststorage, testfontsFolder, testslides)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"SavePresentation\", \"storage\", \"string\", teststorage, int32(statusCode), e)\n}", "title": "" }, { "docid": "0524dbd39621a0ad026f407046b6b9ee", "score": "0.5664633", "text": "func TestSavePresentationInvalidOptions(t *testing.T) {\n testname, _ := createTestParamValue(\"SavePresentation\", \"name\", \"string\").(string)\n testformat, _ := createTestParamValue(\"SavePresentation\", \"format\", \"string\").(string)\n testoutPath, _ := createTestParamValue(\"SavePresentation\", \"outPath\", \"string\").(string)\n testoptions, _ := createTestParamValue(\"SavePresentation\", \"options\", \"ExportOptions\").(IExportOptions)\n testpassword, _ := createTestParamValue(\"SavePresentation\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"SavePresentation\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"SavePresentation\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"SavePresentation\", \"fontsFolder\", \"string\").(string)\n testslides, _ := createTestParamValue(\"SavePresentation\", \"slides\", \"[]int32\").([]int32)\n\n invalidValue := invalidizeTestParamValue(testoptions, \"SavePresentation\", \"options\", \"ExportOptions\")\n if (invalidValue == nil) {\n testoptions = nil\n } else {\n testoptions, _ = invalidValue.(IExportOptions)\n }\n\n e := InitializeTest(\"SavePresentation\", \"options\", testoptions)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n r, e := GetTestApiClient().SlidesApi.SavePresentation(testname, testformat, testoutPath, testoptions, testpassword, testfolder, teststorage, testfontsFolder, testslides)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"SavePresentation\", \"options\", \"ExportOptions\", testoptions, int32(statusCode), e)\n}", "title": "" }, { "docid": "146219af44aa1d8b1e0b34ddd1df9cd9", "score": "0.5652137", "text": "func TestCreatePresentationFromSourceInvalidPassword(t *testing.T) {\n testname, _ := createTestParamValue(\"CreatePresentationFromSource\", \"name\", \"string\").(string)\n testsourcePath, _ := createTestParamValue(\"CreatePresentationFromSource\", \"sourcePath\", \"string\").(string)\n testsourcePassword, _ := createTestParamValue(\"CreatePresentationFromSource\", \"sourcePassword\", \"string\").(string)\n testsourceStorage, _ := createTestParamValue(\"CreatePresentationFromSource\", \"sourceStorage\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"CreatePresentationFromSource\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"CreatePresentationFromSource\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"CreatePresentationFromSource\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"CreatePresentationFromSource\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"CreatePresentationFromSource\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.CreatePresentationFromSource(testname, testsourcePath, testsourcePassword, testsourceStorage, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"CreatePresentationFromSource\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "69fc472236fab0c14182de5e639195aa", "score": "0.5650585", "text": "func TestCreateSlideInvalidPassword(t *testing.T) {\n testname, _ := createTestParamValue(\"CreateSlide\", \"name\", \"string\").(string)\n testlayoutAlias, _ := createTestParamValue(\"CreateSlide\", \"layoutAlias\", \"string\").(string)\n var testposition *int32\n testpositionValue := createTestParamValue(\"CreateSlide\", \"position\", \"int32\")\n if (testpositionValue != nil) {\n testposition = new(int32)\n *testposition, _ = testpositionValue.(int32)\n }\n testpassword, _ := createTestParamValue(\"CreateSlide\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"CreateSlide\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"CreateSlide\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"CreateSlide\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"CreateSlide\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.CreateSlide(testname, testlayoutAlias, testposition, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"CreateSlide\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "4bb5d743f8a500e9cf78eb3bd3870e94", "score": "0.5643976", "text": "func TestDownloadSlideOnlineInvalidPassword(t *testing.T) {\n testdocument, _ := createTestParamValue(\"DownloadSlideOnline\", \"document\", \"[]byte\").([]byte)\n testslideIndex, _ := createTestParamValue(\"DownloadSlideOnline\", \"slideIndex\", \"int32\").(int32)\n testformat, _ := createTestParamValue(\"DownloadSlideOnline\", \"format\", \"string\").(string)\n var testwidth *int32\n testwidthValue := createTestParamValue(\"DownloadSlideOnline\", \"width\", \"int32\")\n if (testwidthValue != nil) {\n testwidth = new(int32)\n *testwidth, _ = testwidthValue.(int32)\n }\n var testheight *int32\n testheightValue := createTestParamValue(\"DownloadSlideOnline\", \"height\", \"int32\")\n if (testheightValue != nil) {\n testheight = new(int32)\n *testheight, _ = testheightValue.(int32)\n }\n testpassword, _ := createTestParamValue(\"DownloadSlideOnline\", \"password\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"DownloadSlideOnline\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"DownloadSlideOnline\", \"fontsFolder\", \"string\").(string)\n testoptions, _ := createTestParamValue(\"DownloadSlideOnline\", \"options\", \"ExportOptions\").(IExportOptions)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"DownloadSlideOnline\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"DownloadSlideOnline\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.DownloadSlideOnline(testdocument, testslideIndex, testformat, testwidth, testheight, testpassword, teststorage, testfontsFolder, testoptions)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"DownloadSlideOnline\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "fcbe71bf770c6b532f82f0a31a130d5d", "score": "0.5641018", "text": "func TestDownloadSlideOnlineInvalidFormat(t *testing.T) {\n testdocument, _ := createTestParamValue(\"DownloadSlideOnline\", \"document\", \"[]byte\").([]byte)\n testslideIndex, _ := createTestParamValue(\"DownloadSlideOnline\", \"slideIndex\", \"int32\").(int32)\n testformat, _ := createTestParamValue(\"DownloadSlideOnline\", \"format\", \"string\").(string)\n var testwidth *int32\n testwidthValue := createTestParamValue(\"DownloadSlideOnline\", \"width\", \"int32\")\n if (testwidthValue != nil) {\n testwidth = new(int32)\n *testwidth, _ = testwidthValue.(int32)\n }\n var testheight *int32\n testheightValue := createTestParamValue(\"DownloadSlideOnline\", \"height\", \"int32\")\n if (testheightValue != nil) {\n testheight = new(int32)\n *testheight, _ = testheightValue.(int32)\n }\n testpassword, _ := createTestParamValue(\"DownloadSlideOnline\", \"password\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"DownloadSlideOnline\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"DownloadSlideOnline\", \"fontsFolder\", \"string\").(string)\n testoptions, _ := createTestParamValue(\"DownloadSlideOnline\", \"options\", \"ExportOptions\").(IExportOptions)\n\n invalidValue := invalidizeTestParamValue(testformat, \"DownloadSlideOnline\", \"format\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testformat = nullValue\n } else {\n testformat, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"DownloadSlideOnline\", \"format\", testformat)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.DownloadSlideOnline(testdocument, testslideIndex, testformat, testwidth, testheight, testpassword, teststorage, testfontsFolder, testoptions)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"DownloadSlideOnline\", \"format\", \"string\", testformat, int32(statusCode), e)\n}", "title": "" }, { "docid": "9d35a3777426533593df35bd36dacbfd", "score": "0.5625672", "text": "func TestConvertAndSaveInvalidOutPath(t *testing.T) {\n testdocument, _ := createTestParamValue(\"ConvertAndSave\", \"document\", \"[]byte\").([]byte)\n testformat, _ := createTestParamValue(\"ConvertAndSave\", \"format\", \"string\").(string)\n testoutPath, _ := createTestParamValue(\"ConvertAndSave\", \"outPath\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"ConvertAndSave\", \"password\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"ConvertAndSave\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"ConvertAndSave\", \"fontsFolder\", \"string\").(string)\n testslides, _ := createTestParamValue(\"ConvertAndSave\", \"slides\", \"[]int32\").([]int32)\n testoptions, _ := createTestParamValue(\"ConvertAndSave\", \"options\", \"ExportOptions\").(IExportOptions)\n\n invalidValue := invalidizeTestParamValue(testoutPath, \"ConvertAndSave\", \"outPath\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testoutPath = nullValue\n } else {\n testoutPath, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"ConvertAndSave\", \"outPath\", testoutPath)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n r, e := GetTestApiClient().SlidesApi.ConvertAndSave(testdocument, testformat, testoutPath, testpassword, teststorage, testfontsFolder, testslides, testoptions)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"ConvertAndSave\", \"outPath\", \"string\", testoutPath, int32(statusCode), e)\n}", "title": "" }, { "docid": "4f8246b79fbcb1a0076e1394597acbef", "score": "0.56165123", "text": "func TestSavePresentationInvalidName(t *testing.T) {\n testname, _ := createTestParamValue(\"SavePresentation\", \"name\", \"string\").(string)\n testformat, _ := createTestParamValue(\"SavePresentation\", \"format\", \"string\").(string)\n testoutPath, _ := createTestParamValue(\"SavePresentation\", \"outPath\", \"string\").(string)\n testoptions, _ := createTestParamValue(\"SavePresentation\", \"options\", \"ExportOptions\").(IExportOptions)\n testpassword, _ := createTestParamValue(\"SavePresentation\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"SavePresentation\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"SavePresentation\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"SavePresentation\", \"fontsFolder\", \"string\").(string)\n testslides, _ := createTestParamValue(\"SavePresentation\", \"slides\", \"[]int32\").([]int32)\n\n invalidValue := invalidizeTestParamValue(testname, \"SavePresentation\", \"name\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testname = nullValue\n } else {\n testname, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"SavePresentation\", \"name\", testname)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n r, e := GetTestApiClient().SlidesApi.SavePresentation(testname, testformat, testoutPath, testoptions, testpassword, testfolder, teststorage, testfontsFolder, testslides)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"SavePresentation\", \"name\", \"string\", testname, int32(statusCode), e)\n}", "title": "" }, { "docid": "67143a68e2d14f9f656292117811a8a0", "score": "0.56156933", "text": "func TestReplacePresentationTextInvalidPassword(t *testing.T) {\n testname, _ := createTestParamValue(\"ReplacePresentationText\", \"name\", \"string\").(string)\n testoldValue, _ := createTestParamValue(\"ReplacePresentationText\", \"oldValue\", \"string\").(string)\n testnewValue, _ := createTestParamValue(\"ReplacePresentationText\", \"newValue\", \"string\").(string)\n var testignoreCase *bool\n testignoreCaseValue := createTestParamValue(\"ReplacePresentationText\", \"ignoreCase\", \"bool\")\n if (testignoreCaseValue != nil) {\n testignoreCase = new(bool)\n *testignoreCase, _ = testignoreCaseValue.(bool)\n }\n testpassword, _ := createTestParamValue(\"ReplacePresentationText\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"ReplacePresentationText\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"ReplacePresentationText\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"ReplacePresentationText\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"ReplacePresentationText\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.ReplacePresentationText(testname, testoldValue, testnewValue, testignoreCase, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"ReplacePresentationText\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "8479cfa643d2438bd43097796b636ad3", "score": "0.5610299", "text": "func TestDownloadNotesSlideOnlineInvalidPassword(t *testing.T) {\n testdocument, _ := createTestParamValue(\"DownloadNotesSlideOnline\", \"document\", \"[]byte\").([]byte)\n testslideIndex, _ := createTestParamValue(\"DownloadNotesSlideOnline\", \"slideIndex\", \"int32\").(int32)\n testformat, _ := createTestParamValue(\"DownloadNotesSlideOnline\", \"format\", \"string\").(string)\n var testwidth *int32\n testwidthValue := createTestParamValue(\"DownloadNotesSlideOnline\", \"width\", \"int32\")\n if (testwidthValue != nil) {\n testwidth = new(int32)\n *testwidth, _ = testwidthValue.(int32)\n }\n var testheight *int32\n testheightValue := createTestParamValue(\"DownloadNotesSlideOnline\", \"height\", \"int32\")\n if (testheightValue != nil) {\n testheight = new(int32)\n *testheight, _ = testheightValue.(int32)\n }\n testpassword, _ := createTestParamValue(\"DownloadNotesSlideOnline\", \"password\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"DownloadNotesSlideOnline\", \"fontsFolder\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"DownloadNotesSlideOnline\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"DownloadNotesSlideOnline\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.DownloadNotesSlideOnline(testdocument, testslideIndex, testformat, testwidth, testheight, testpassword, testfontsFolder)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"DownloadNotesSlideOnline\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "418b8bcb593a93fd6e25deb75742fcb6", "score": "0.56052935", "text": "func TestUpdateSpecialSlideParagraphInvalidPassword(t *testing.T) {\n testname, _ := createTestParamValue(\"UpdateSpecialSlideParagraph\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"UpdateSpecialSlideParagraph\", \"slideIndex\", \"int32\").(int32)\n testslideType, _ := createTestParamValue(\"UpdateSpecialSlideParagraph\", \"slideType\", \"string\").(string)\n testshapeIndex, _ := createTestParamValue(\"UpdateSpecialSlideParagraph\", \"shapeIndex\", \"int32\").(int32)\n testparagraphIndex, _ := createTestParamValue(\"UpdateSpecialSlideParagraph\", \"paragraphIndex\", \"int32\").(int32)\n testdto, _ := createTestParamValue(\"UpdateSpecialSlideParagraph\", \"dto\", \"Paragraph\").(IParagraph)\n testpassword, _ := createTestParamValue(\"UpdateSpecialSlideParagraph\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"UpdateSpecialSlideParagraph\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"UpdateSpecialSlideParagraph\", \"storage\", \"string\").(string)\n testsubShape, _ := createTestParamValue(\"UpdateSpecialSlideParagraph\", \"subShape\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"UpdateSpecialSlideParagraph\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"UpdateSpecialSlideParagraph\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.UpdateSpecialSlideParagraph(testname, testslideIndex, testslideType, testshapeIndex, testparagraphIndex, testdto, testpassword, testfolder, teststorage, testsubShape)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"UpdateSpecialSlideParagraph\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "1eabf3f2e752b6ba7d1f2790035720f2", "score": "0.5595731", "text": "func TestCreatePresentationFromTemplate(t *testing.T) {\n testname, _ := createTestParamValue(\"CreatePresentationFromTemplate\", \"name\", \"string\").(string)\n testtemplatePath, _ := createTestParamValue(\"CreatePresentationFromTemplate\", \"templatePath\", \"string\").(string)\n testdata, _ := createTestParamValue(\"CreatePresentationFromTemplate\", \"data\", \"string\").(string)\n testtemplatePassword, _ := createTestParamValue(\"CreatePresentationFromTemplate\", \"templatePassword\", \"string\").(string)\n testtemplateStorage, _ := createTestParamValue(\"CreatePresentationFromTemplate\", \"templateStorage\", \"string\").(string)\n var testisImageDataEmbedded *bool\n testisImageDataEmbeddedValue := createTestParamValue(\"CreatePresentationFromTemplate\", \"isImageDataEmbedded\", \"bool\")\n if (testisImageDataEmbeddedValue != nil) {\n testisImageDataEmbedded = new(bool)\n *testisImageDataEmbedded, _ = testisImageDataEmbeddedValue.(bool)\n }\n testpassword, _ := createTestParamValue(\"CreatePresentationFromTemplate\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"CreatePresentationFromTemplate\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"CreatePresentationFromTemplate\", \"storage\", \"string\").(string)\n e := InitializeTest(\"CreatePresentationFromTemplate\", \"\", \"\")\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n c := GetTestApiClient()\n _, _, e = c.SlidesApi.CreatePresentationFromTemplate(testname, testtemplatePath, testdata, testtemplatePassword, testtemplateStorage, testisImageDataEmbedded, testpassword, testfolder, teststorage)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n}", "title": "" }, { "docid": "b390aa6185d5f2451a6a026a3d566ba0", "score": "0.5588159", "text": "func TestConvertInvalidOptions(t *testing.T) {\n testdocument, _ := createTestParamValue(\"Convert\", \"document\", \"[]byte\").([]byte)\n testformat, _ := createTestParamValue(\"Convert\", \"format\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"Convert\", \"password\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"Convert\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"Convert\", \"fontsFolder\", \"string\").(string)\n testslides, _ := createTestParamValue(\"Convert\", \"slides\", \"[]int32\").([]int32)\n testoptions, _ := createTestParamValue(\"Convert\", \"options\", \"ExportOptions\").(IExportOptions)\n\n invalidValue := invalidizeTestParamValue(testoptions, \"Convert\", \"options\", \"ExportOptions\")\n if (invalidValue == nil) {\n testoptions = nil\n } else {\n testoptions, _ = invalidValue.(IExportOptions)\n }\n\n e := InitializeTest(\"Convert\", \"options\", testoptions)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.Convert(testdocument, testformat, testpassword, teststorage, testfontsFolder, testslides, testoptions)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"Convert\", \"options\", \"ExportOptions\", testoptions, int32(statusCode), e)\n}", "title": "" }, { "docid": "46f8f01b45edc2dd3ee256d695ab8f63", "score": "0.5582954", "text": "func TestSavePresentationInvalidOutPath(t *testing.T) {\n testname, _ := createTestParamValue(\"SavePresentation\", \"name\", \"string\").(string)\n testformat, _ := createTestParamValue(\"SavePresentation\", \"format\", \"string\").(string)\n testoutPath, _ := createTestParamValue(\"SavePresentation\", \"outPath\", \"string\").(string)\n testoptions, _ := createTestParamValue(\"SavePresentation\", \"options\", \"ExportOptions\").(IExportOptions)\n testpassword, _ := createTestParamValue(\"SavePresentation\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"SavePresentation\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"SavePresentation\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"SavePresentation\", \"fontsFolder\", \"string\").(string)\n testslides, _ := createTestParamValue(\"SavePresentation\", \"slides\", \"[]int32\").([]int32)\n\n invalidValue := invalidizeTestParamValue(testoutPath, \"SavePresentation\", \"outPath\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testoutPath = nullValue\n } else {\n testoutPath, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"SavePresentation\", \"outPath\", testoutPath)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n r, e := GetTestApiClient().SlidesApi.SavePresentation(testname, testformat, testoutPath, testoptions, testpassword, testfolder, teststorage, testfontsFolder, testslides)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"SavePresentation\", \"outPath\", \"string\", testoutPath, int32(statusCode), e)\n}", "title": "" }, { "docid": "67591cb8c8f2865b4ff5752bf235d2c8", "score": "0.558037", "text": "func TestDownloadPresentationInvalidSlides(t *testing.T) {\n testname, _ := createTestParamValue(\"DownloadPresentation\", \"name\", \"string\").(string)\n testformat, _ := createTestParamValue(\"DownloadPresentation\", \"format\", \"string\").(string)\n testoptions, _ := createTestParamValue(\"DownloadPresentation\", \"options\", \"ExportOptions\").(IExportOptions)\n testpassword, _ := createTestParamValue(\"DownloadPresentation\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"DownloadPresentation\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"DownloadPresentation\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"DownloadPresentation\", \"fontsFolder\", \"string\").(string)\n testslides, _ := createTestParamValue(\"DownloadPresentation\", \"slides\", \"[]int32\").([]int32)\n\n invalidValue := invalidizeTestParamValue(testslides, \"DownloadPresentation\", \"slides\", \"[]int32\")\n if (invalidValue == nil) {\n testslides = nil\n } else {\n testslides, _ = invalidValue.([]int32)\n }\n\n e := InitializeTest(\"DownloadPresentation\", \"slides\", testslides)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.DownloadPresentation(testname, testformat, testoptions, testpassword, testfolder, teststorage, testfontsFolder, testslides)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"DownloadPresentation\", \"slides\", \"[]int32\", testslides, int32(statusCode), e)\n}", "title": "" }, { "docid": "100bc52d9149d7020ae50936f6a43807", "score": "0.5579419", "text": "func TestDownloadNotesSlideInvalidPassword(t *testing.T) {\n testname, _ := createTestParamValue(\"DownloadNotesSlide\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"DownloadNotesSlide\", \"slideIndex\", \"int32\").(int32)\n testformat, _ := createTestParamValue(\"DownloadNotesSlide\", \"format\", \"string\").(string)\n var testwidth *int32\n testwidthValue := createTestParamValue(\"DownloadNotesSlide\", \"width\", \"int32\")\n if (testwidthValue != nil) {\n testwidth = new(int32)\n *testwidth, _ = testwidthValue.(int32)\n }\n var testheight *int32\n testheightValue := createTestParamValue(\"DownloadNotesSlide\", \"height\", \"int32\")\n if (testheightValue != nil) {\n testheight = new(int32)\n *testheight, _ = testheightValue.(int32)\n }\n testpassword, _ := createTestParamValue(\"DownloadNotesSlide\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"DownloadNotesSlide\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"DownloadNotesSlide\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"DownloadNotesSlide\", \"fontsFolder\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"DownloadNotesSlide\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"DownloadNotesSlide\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.DownloadNotesSlide(testname, testslideIndex, testformat, testwidth, testheight, testpassword, testfolder, teststorage, testfontsFolder)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"DownloadNotesSlide\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "d31f0db675ddbc36c0ed90fb594760db", "score": "0.556727", "text": "func TestCreatePresentationFromSourceInvalidSourcePassword(t *testing.T) {\n testname, _ := createTestParamValue(\"CreatePresentationFromSource\", \"name\", \"string\").(string)\n testsourcePath, _ := createTestParamValue(\"CreatePresentationFromSource\", \"sourcePath\", \"string\").(string)\n testsourcePassword, _ := createTestParamValue(\"CreatePresentationFromSource\", \"sourcePassword\", \"string\").(string)\n testsourceStorage, _ := createTestParamValue(\"CreatePresentationFromSource\", \"sourceStorage\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"CreatePresentationFromSource\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"CreatePresentationFromSource\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"CreatePresentationFromSource\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testsourcePassword, \"CreatePresentationFromSource\", \"sourcePassword\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testsourcePassword = nullValue\n } else {\n testsourcePassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"CreatePresentationFromSource\", \"sourcePassword\", testsourcePassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.CreatePresentationFromSource(testname, testsourcePath, testsourcePassword, testsourceStorage, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"CreatePresentationFromSource\", \"sourcePassword\", \"string\", testsourcePassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "a5a4ff0d89333fd8f7101343fc4cf507", "score": "0.55567193", "text": "func TestSaveSlideOnline(t *testing.T) {\n testdocument, _ := createTestParamValue(\"SaveSlideOnline\", \"document\", \"[]byte\").([]byte)\n testslideIndex, _ := createTestParamValue(\"SaveSlideOnline\", \"slideIndex\", \"int32\").(int32)\n testformat, _ := createTestParamValue(\"SaveSlideOnline\", \"format\", \"string\").(string)\n testoutPath, _ := createTestParamValue(\"SaveSlideOnline\", \"outPath\", \"string\").(string)\n var testwidth *int32\n testwidthValue := createTestParamValue(\"SaveSlideOnline\", \"width\", \"int32\")\n if (testwidthValue != nil) {\n testwidth = new(int32)\n *testwidth, _ = testwidthValue.(int32)\n }\n var testheight *int32\n testheightValue := createTestParamValue(\"SaveSlideOnline\", \"height\", \"int32\")\n if (testheightValue != nil) {\n testheight = new(int32)\n *testheight, _ = testheightValue.(int32)\n }\n testpassword, _ := createTestParamValue(\"SaveSlideOnline\", \"password\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"SaveSlideOnline\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"SaveSlideOnline\", \"fontsFolder\", \"string\").(string)\n testoptions, _ := createTestParamValue(\"SaveSlideOnline\", \"options\", \"ExportOptions\").(IExportOptions)\n e := InitializeTest(\"SaveSlideOnline\", \"\", \"\")\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n c := GetTestApiClient()\n _, e = c.SlidesApi.SaveSlideOnline(testdocument, testslideIndex, testformat, testoutPath, testwidth, testheight, testpassword, teststorage, testfontsFolder, testoptions)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n}", "title": "" }, { "docid": "65f8191d216fe89405e9a8e680a8362d", "score": "0.5554842", "text": "func TestCopyLayoutSlide(t *testing.T) {\n testname, _ := createTestParamValue(\"CopyLayoutSlide\", \"name\", \"string\").(string)\n testcloneFrom, _ := createTestParamValue(\"CopyLayoutSlide\", \"cloneFrom\", \"string\").(string)\n testcloneFromPosition, _ := createTestParamValue(\"CopyLayoutSlide\", \"cloneFromPosition\", \"int32\").(int32)\n testcloneFromPassword, _ := createTestParamValue(\"CopyLayoutSlide\", \"cloneFromPassword\", \"string\").(string)\n testcloneFromStorage, _ := createTestParamValue(\"CopyLayoutSlide\", \"cloneFromStorage\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"CopyLayoutSlide\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"CopyLayoutSlide\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"CopyLayoutSlide\", \"storage\", \"string\").(string)\n e := InitializeTest(\"CopyLayoutSlide\", \"\", \"\")\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n c := GetTestApiClient()\n _, _, e = c.SlidesApi.CopyLayoutSlide(testname, testcloneFrom, testcloneFromPosition, testcloneFromPassword, testcloneFromStorage, testpassword, testfolder, teststorage)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n}", "title": "" }, { "docid": "186b156bfce6b512ee4c21feb74a015f", "score": "0.5550262", "text": "func TestCreateNotesSlideInvalidPassword(t *testing.T) {\n testname, _ := createTestParamValue(\"CreateNotesSlide\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"CreateNotesSlide\", \"slideIndex\", \"int32\").(int32)\n testdto, _ := createTestParamValue(\"CreateNotesSlide\", \"dto\", \"NotesSlide\").(INotesSlide)\n testpassword, _ := createTestParamValue(\"CreateNotesSlide\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"CreateNotesSlide\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"CreateNotesSlide\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"CreateNotesSlide\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"CreateNotesSlide\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.CreateNotesSlide(testname, testslideIndex, testdto, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"CreateNotesSlide\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "418447cbbaf9103682d6e8ecc9c73543", "score": "0.5547813", "text": "func TestCreateParagraphInvalidPassword(t *testing.T) {\n testname, _ := createTestParamValue(\"CreateParagraph\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"CreateParagraph\", \"slideIndex\", \"int32\").(int32)\n testshapeIndex, _ := createTestParamValue(\"CreateParagraph\", \"shapeIndex\", \"int32\").(int32)\n testdto, _ := createTestParamValue(\"CreateParagraph\", \"dto\", \"Paragraph\").(IParagraph)\n var testposition *int32\n testpositionValue := createTestParamValue(\"CreateParagraph\", \"position\", \"int32\")\n if (testpositionValue != nil) {\n testposition = new(int32)\n *testposition, _ = testpositionValue.(int32)\n }\n testpassword, _ := createTestParamValue(\"CreateParagraph\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"CreateParagraph\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"CreateParagraph\", \"storage\", \"string\").(string)\n testsubShape, _ := createTestParamValue(\"CreateParagraph\", \"subShape\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"CreateParagraph\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"CreateParagraph\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.CreateParagraph(testname, testslideIndex, testshapeIndex, testdto, testposition, testpassword, testfolder, teststorage, testsubShape)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"CreateParagraph\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "ec795154b92ce92ae4d9122c4dd794c5", "score": "0.5541261", "text": "func TestCopySlideInvalidPassword(t *testing.T) {\n testname, _ := createTestParamValue(\"CopySlide\", \"name\", \"string\").(string)\n testslideToCopy, _ := createTestParamValue(\"CopySlide\", \"slideToCopy\", \"int32\").(int32)\n var testposition *int32\n testpositionValue := createTestParamValue(\"CopySlide\", \"position\", \"int32\")\n if (testpositionValue != nil) {\n testposition = new(int32)\n *testposition, _ = testpositionValue.(int32)\n }\n testsource, _ := createTestParamValue(\"CopySlide\", \"source\", \"string\").(string)\n testsourcePassword, _ := createTestParamValue(\"CopySlide\", \"sourcePassword\", \"string\").(string)\n testsourceStorage, _ := createTestParamValue(\"CopySlide\", \"sourceStorage\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"CopySlide\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"CopySlide\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"CopySlide\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"CopySlide\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"CopySlide\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.CopySlide(testname, testslideToCopy, testposition, testsource, testsourcePassword, testsourceStorage, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"CopySlide\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "ebdbcfe0d72b69462bfbce7de2b6233b", "score": "0.55179757", "text": "func TestCreateNotesSlideInvalidDto(t *testing.T) {\n testname, _ := createTestParamValue(\"CreateNotesSlide\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"CreateNotesSlide\", \"slideIndex\", \"int32\").(int32)\n testdto, _ := createTestParamValue(\"CreateNotesSlide\", \"dto\", \"NotesSlide\").(INotesSlide)\n testpassword, _ := createTestParamValue(\"CreateNotesSlide\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"CreateNotesSlide\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"CreateNotesSlide\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testdto, \"CreateNotesSlide\", \"dto\", \"NotesSlide\")\n if (invalidValue == nil) {\n testdto = nil\n } else {\n testdto, _ = invalidValue.(INotesSlide)\n }\n\n e := InitializeTest(\"CreateNotesSlide\", \"dto\", testdto)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.CreateNotesSlide(testname, testslideIndex, testdto, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"CreateNotesSlide\", \"dto\", \"NotesSlide\", testdto, int32(statusCode), e)\n}", "title": "" }, { "docid": "87aba9dbcc108b2ed0d32279f9560d78", "score": "0.5515455", "text": "func TestReplaceSlideTextOnlineInvalidPassword(t *testing.T) {\n testdocument, _ := createTestParamValue(\"ReplaceSlideTextOnline\", \"document\", \"[]byte\").([]byte)\n testslideIndex, _ := createTestParamValue(\"ReplaceSlideTextOnline\", \"slideIndex\", \"int32\").(int32)\n testoldValue, _ := createTestParamValue(\"ReplaceSlideTextOnline\", \"oldValue\", \"string\").(string)\n testnewValue, _ := createTestParamValue(\"ReplaceSlideTextOnline\", \"newValue\", \"string\").(string)\n var testignoreCase *bool\n testignoreCaseValue := createTestParamValue(\"ReplaceSlideTextOnline\", \"ignoreCase\", \"bool\")\n if (testignoreCaseValue != nil) {\n testignoreCase = new(bool)\n *testignoreCase, _ = testignoreCaseValue.(bool)\n }\n testpassword, _ := createTestParamValue(\"ReplaceSlideTextOnline\", \"password\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"ReplaceSlideTextOnline\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"ReplaceSlideTextOnline\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.ReplaceSlideTextOnline(testdocument, testslideIndex, testoldValue, testnewValue, testignoreCase, testpassword)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"ReplaceSlideTextOnline\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "8d690ef4c7d874ecf819e2db83f953ae", "score": "0.55085605", "text": "func TestGetLayoutSlideInvalidPassword(t *testing.T) {\n testname, _ := createTestParamValue(\"GetLayoutSlide\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"GetLayoutSlide\", \"slideIndex\", \"int32\").(int32)\n testpassword, _ := createTestParamValue(\"GetLayoutSlide\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"GetLayoutSlide\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"GetLayoutSlide\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"GetLayoutSlide\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"GetLayoutSlide\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.GetLayoutSlide(testname, testslideIndex, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"GetLayoutSlide\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "5a3b65e851771ce997285ac9cca10f82", "score": "0.5501421", "text": "func TestGetPresentationInvalidPassword(t *testing.T) {\n testname, _ := createTestParamValue(\"GetPresentation\", \"name\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"GetPresentation\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"GetPresentation\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"GetPresentation\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"GetPresentation\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"GetPresentation\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.GetPresentation(testname, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"GetPresentation\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "7fcbf853ff82442986fc472d9b88f0f0", "score": "0.5498672", "text": "func TestCreateSpecialSlideParagraphInvalidDto(t *testing.T) {\n testname, _ := createTestParamValue(\"CreateSpecialSlideParagraph\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"CreateSpecialSlideParagraph\", \"slideIndex\", \"int32\").(int32)\n testslideType, _ := createTestParamValue(\"CreateSpecialSlideParagraph\", \"slideType\", \"string\").(string)\n testshapeIndex, _ := createTestParamValue(\"CreateSpecialSlideParagraph\", \"shapeIndex\", \"int32\").(int32)\n testdto, _ := createTestParamValue(\"CreateSpecialSlideParagraph\", \"dto\", \"Paragraph\").(IParagraph)\n var testposition *int32\n testpositionValue := createTestParamValue(\"CreateSpecialSlideParagraph\", \"position\", \"int32\")\n if (testpositionValue != nil) {\n testposition = new(int32)\n *testposition, _ = testpositionValue.(int32)\n }\n testpassword, _ := createTestParamValue(\"CreateSpecialSlideParagraph\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"CreateSpecialSlideParagraph\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"CreateSpecialSlideParagraph\", \"storage\", \"string\").(string)\n testsubShape, _ := createTestParamValue(\"CreateSpecialSlideParagraph\", \"subShape\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testdto, \"CreateSpecialSlideParagraph\", \"dto\", \"Paragraph\")\n if (invalidValue == nil) {\n testdto = nil\n } else {\n testdto, _ = invalidValue.(IParagraph)\n }\n\n e := InitializeTest(\"CreateSpecialSlideParagraph\", \"dto\", testdto)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.CreateSpecialSlideParagraph(testname, testslideIndex, testslideType, testshapeIndex, testdto, testposition, testpassword, testfolder, teststorage, testsubShape)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"CreateSpecialSlideParagraph\", \"dto\", \"Paragraph\", testdto, int32(statusCode), e)\n}", "title": "" }, { "docid": "50aeac24014e1005529f98571c56ae9c", "score": "0.54934794", "text": "func TestDownloadSpecialSlideShapeInvalidPassword(t *testing.T) {\n testname, _ := createTestParamValue(\"DownloadSpecialSlideShape\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"DownloadSpecialSlideShape\", \"slideIndex\", \"int32\").(int32)\n testslideType, _ := createTestParamValue(\"DownloadSpecialSlideShape\", \"slideType\", \"string\").(string)\n testshapeIndex, _ := createTestParamValue(\"DownloadSpecialSlideShape\", \"shapeIndex\", \"int32\").(int32)\n testformat, _ := createTestParamValue(\"DownloadSpecialSlideShape\", \"format\", \"string\").(string)\n testoptions, _ := createTestParamValue(\"DownloadSpecialSlideShape\", \"options\", \"IShapeExportOptions\").(IIShapeExportOptions)\n var testscaleX *float64\n testscaleXValue := createTestParamValue(\"DownloadSpecialSlideShape\", \"scaleX\", \"float64\")\n if (testscaleXValue != nil) {\n testscaleX = new(float64)\n *testscaleX, _ = testscaleXValue.(float64)\n }\n var testscaleY *float64\n testscaleYValue := createTestParamValue(\"DownloadSpecialSlideShape\", \"scaleY\", \"float64\")\n if (testscaleYValue != nil) {\n testscaleY = new(float64)\n *testscaleY, _ = testscaleYValue.(float64)\n }\n testbounds, _ := createTestParamValue(\"DownloadSpecialSlideShape\", \"bounds\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"DownloadSpecialSlideShape\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"DownloadSpecialSlideShape\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"DownloadSpecialSlideShape\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"DownloadSpecialSlideShape\", \"fontsFolder\", \"string\").(string)\n testsubShape, _ := createTestParamValue(\"DownloadSpecialSlideShape\", \"subShape\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"DownloadSpecialSlideShape\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"DownloadSpecialSlideShape\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.DownloadSpecialSlideShape(testname, testslideIndex, testslideType, testshapeIndex, testformat, testoptions, testscaleX, testscaleY, testbounds, testpassword, testfolder, teststorage, testfontsFolder, testsubShape)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"DownloadSpecialSlideShape\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "765d27dbcba35432410418442f48c3bb", "score": "0.54863137", "text": "func TestReplaceSlideTextInvalidPassword(t *testing.T) {\n testname, _ := createTestParamValue(\"ReplaceSlideText\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"ReplaceSlideText\", \"slideIndex\", \"int32\").(int32)\n testoldValue, _ := createTestParamValue(\"ReplaceSlideText\", \"oldValue\", \"string\").(string)\n testnewValue, _ := createTestParamValue(\"ReplaceSlideText\", \"newValue\", \"string\").(string)\n var testignoreCase *bool\n testignoreCaseValue := createTestParamValue(\"ReplaceSlideText\", \"ignoreCase\", \"bool\")\n if (testignoreCaseValue != nil) {\n testignoreCase = new(bool)\n *testignoreCase, _ = testignoreCaseValue.(bool)\n }\n testpassword, _ := createTestParamValue(\"ReplaceSlideText\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"ReplaceSlideText\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"ReplaceSlideText\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"ReplaceSlideText\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"ReplaceSlideText\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.ReplaceSlideText(testname, testslideIndex, testoldValue, testnewValue, testignoreCase, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"ReplaceSlideText\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "61a87d0eb1cb64e1931f5afc748485b0", "score": "0.54746467", "text": "func TestGetParagraphEffectiveInvalidPassword(t *testing.T) {\n testname, _ := createTestParamValue(\"GetParagraphEffective\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"GetParagraphEffective\", \"slideIndex\", \"int32\").(int32)\n testshapeIndex, _ := createTestParamValue(\"GetParagraphEffective\", \"shapeIndex\", \"int32\").(int32)\n testparagraphIndex, _ := createTestParamValue(\"GetParagraphEffective\", \"paragraphIndex\", \"int32\").(int32)\n testpassword, _ := createTestParamValue(\"GetParagraphEffective\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"GetParagraphEffective\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"GetParagraphEffective\", \"storage\", \"string\").(string)\n testsubShape, _ := createTestParamValue(\"GetParagraphEffective\", \"subShape\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"GetParagraphEffective\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"GetParagraphEffective\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.GetParagraphEffective(testname, testslideIndex, testshapeIndex, testparagraphIndex, testpassword, testfolder, teststorage, testsubShape)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"GetParagraphEffective\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "2858199a7773390373855b95f3c6b324", "score": "0.54742074", "text": "func TestGetSlideInvalidPassword(t *testing.T) {\n testname, _ := createTestParamValue(\"GetSlide\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"GetSlide\", \"slideIndex\", \"int32\").(int32)\n testpassword, _ := createTestParamValue(\"GetSlide\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"GetSlide\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"GetSlide\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"GetSlide\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"GetSlide\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.GetSlide(testname, testslideIndex, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"GetSlide\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "8910f50c95ea4aec7bb7ad0346b28378", "score": "0.5473541", "text": "func TestGetSpecialSlideParagraphInvalidPassword(t *testing.T) {\n testname, _ := createTestParamValue(\"GetSpecialSlideParagraph\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"GetSpecialSlideParagraph\", \"slideIndex\", \"int32\").(int32)\n testslideType, _ := createTestParamValue(\"GetSpecialSlideParagraph\", \"slideType\", \"string\").(string)\n testshapeIndex, _ := createTestParamValue(\"GetSpecialSlideParagraph\", \"shapeIndex\", \"int32\").(int32)\n testparagraphIndex, _ := createTestParamValue(\"GetSpecialSlideParagraph\", \"paragraphIndex\", \"int32\").(int32)\n testpassword, _ := createTestParamValue(\"GetSpecialSlideParagraph\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"GetSpecialSlideParagraph\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"GetSpecialSlideParagraph\", \"storage\", \"string\").(string)\n testsubShape, _ := createTestParamValue(\"GetSpecialSlideParagraph\", \"subShape\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"GetSpecialSlideParagraph\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"GetSpecialSlideParagraph\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.GetSpecialSlideParagraph(testname, testslideIndex, testslideType, testshapeIndex, testparagraphIndex, testpassword, testfolder, teststorage, testsubShape)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"GetSpecialSlideParagraph\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "913b5651ac8303aa30985d0d9993dca7", "score": "0.5464856", "text": "func TestUpdateSlideInvalidPassword(t *testing.T) {\n testname, _ := createTestParamValue(\"UpdateSlide\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"UpdateSlide\", \"slideIndex\", \"int32\").(int32)\n testslideDto, _ := createTestParamValue(\"UpdateSlide\", \"slideDto\", \"Slide\").(ISlide)\n testpassword, _ := createTestParamValue(\"UpdateSlide\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"UpdateSlide\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"UpdateSlide\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"UpdateSlide\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"UpdateSlide\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.UpdateSlide(testname, testslideIndex, testslideDto, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"UpdateSlide\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "7045692f86bf2317c80e5ce3ce6277df", "score": "0.5464616", "text": "func TestMoveSlideInvalidPassword(t *testing.T) {\n testname, _ := createTestParamValue(\"MoveSlide\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"MoveSlide\", \"slideIndex\", \"int32\").(int32)\n testnewPosition, _ := createTestParamValue(\"MoveSlide\", \"newPosition\", \"int32\").(int32)\n testpassword, _ := createTestParamValue(\"MoveSlide\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"MoveSlide\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"MoveSlide\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"MoveSlide\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"MoveSlide\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.MoveSlide(testname, testslideIndex, testnewPosition, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"MoveSlide\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "e14358bb45e2924243aee331f6c8df4f", "score": "0.5462518", "text": "func TestUpdateLayoutSlideInvalidSlideDto(t *testing.T) {\n testname, _ := createTestParamValue(\"UpdateLayoutSlide\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"UpdateLayoutSlide\", \"slideIndex\", \"int32\").(int32)\n testslideDto, _ := createTestParamValue(\"UpdateLayoutSlide\", \"slideDto\", \"LayoutSlide\").(ILayoutSlide)\n testpassword, _ := createTestParamValue(\"UpdateLayoutSlide\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"UpdateLayoutSlide\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"UpdateLayoutSlide\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testslideDto, \"UpdateLayoutSlide\", \"slideDto\", \"LayoutSlide\")\n if (invalidValue == nil) {\n testslideDto = nil\n } else {\n testslideDto, _ = invalidValue.(ILayoutSlide)\n }\n\n e := InitializeTest(\"UpdateLayoutSlide\", \"slideDto\", testslideDto)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.UpdateLayoutSlide(testname, testslideIndex, testslideDto, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"UpdateLayoutSlide\", \"slideDto\", \"LayoutSlide\", testslideDto, int32(statusCode), e)\n}", "title": "" }, { "docid": "241e197ec86930fc5f3159db39d5b305", "score": "0.54553974", "text": "func TestSavePresentationInvalidFolder(t *testing.T) {\n testname, _ := createTestParamValue(\"SavePresentation\", \"name\", \"string\").(string)\n testformat, _ := createTestParamValue(\"SavePresentation\", \"format\", \"string\").(string)\n testoutPath, _ := createTestParamValue(\"SavePresentation\", \"outPath\", \"string\").(string)\n testoptions, _ := createTestParamValue(\"SavePresentation\", \"options\", \"ExportOptions\").(IExportOptions)\n testpassword, _ := createTestParamValue(\"SavePresentation\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"SavePresentation\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"SavePresentation\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"SavePresentation\", \"fontsFolder\", \"string\").(string)\n testslides, _ := createTestParamValue(\"SavePresentation\", \"slides\", \"[]int32\").([]int32)\n\n invalidValue := invalidizeTestParamValue(testfolder, \"SavePresentation\", \"folder\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testfolder = nullValue\n } else {\n testfolder, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"SavePresentation\", \"folder\", testfolder)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n r, e := GetTestApiClient().SlidesApi.SavePresentation(testname, testformat, testoutPath, testoptions, testpassword, testfolder, teststorage, testfontsFolder, testslides)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"SavePresentation\", \"folder\", \"string\", testfolder, int32(statusCode), e)\n}", "title": "" }, { "docid": "0093c7da2a2e4dac5da82e9c90f2ab71", "score": "0.5454031", "text": "func TestSetSlideShowPropertiesInvalidPassword(t *testing.T) {\n testname, _ := createTestParamValue(\"SetSlideShowProperties\", \"name\", \"string\").(string)\n testdto, _ := createTestParamValue(\"SetSlideShowProperties\", \"dto\", \"SlideShowProperties\").(ISlideShowProperties)\n testpassword, _ := createTestParamValue(\"SetSlideShowProperties\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"SetSlideShowProperties\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"SetSlideShowProperties\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"SetSlideShowProperties\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"SetSlideShowProperties\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.SetSlideShowProperties(testname, testdto, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"SetSlideShowProperties\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "b368039d457a7c5ed0c75ade4d180665", "score": "0.5433658", "text": "func TestCreatePresentationFromTemplateInvalidData(t *testing.T) {\n testname, _ := createTestParamValue(\"CreatePresentationFromTemplate\", \"name\", \"string\").(string)\n testtemplatePath, _ := createTestParamValue(\"CreatePresentationFromTemplate\", \"templatePath\", \"string\").(string)\n testdata, _ := createTestParamValue(\"CreatePresentationFromTemplate\", \"data\", \"string\").(string)\n testtemplatePassword, _ := createTestParamValue(\"CreatePresentationFromTemplate\", \"templatePassword\", \"string\").(string)\n testtemplateStorage, _ := createTestParamValue(\"CreatePresentationFromTemplate\", \"templateStorage\", \"string\").(string)\n var testisImageDataEmbedded *bool\n testisImageDataEmbeddedValue := createTestParamValue(\"CreatePresentationFromTemplate\", \"isImageDataEmbedded\", \"bool\")\n if (testisImageDataEmbeddedValue != nil) {\n testisImageDataEmbedded = new(bool)\n *testisImageDataEmbedded, _ = testisImageDataEmbeddedValue.(bool)\n }\n testpassword, _ := createTestParamValue(\"CreatePresentationFromTemplate\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"CreatePresentationFromTemplate\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"CreatePresentationFromTemplate\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testdata, \"CreatePresentationFromTemplate\", \"data\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testdata = nullValue\n } else {\n testdata, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"CreatePresentationFromTemplate\", \"data\", testdata)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.CreatePresentationFromTemplate(testname, testtemplatePath, testdata, testtemplatePassword, testtemplateStorage, testisImageDataEmbedded, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"CreatePresentationFromTemplate\", \"data\", \"string\", testdata, int32(statusCode), e)\n}", "title": "" }, { "docid": "1c8700a9ab92bf452bfec97296fab2a2", "score": "0.54256916", "text": "func TestSetSlidePropertiesInvalidPassword(t *testing.T) {\n testname, _ := createTestParamValue(\"SetSlideProperties\", \"name\", \"string\").(string)\n testdto, _ := createTestParamValue(\"SetSlideProperties\", \"dto\", \"SlideProperties\").(ISlideProperties)\n testpassword, _ := createTestParamValue(\"SetSlideProperties\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"SetSlideProperties\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"SetSlideProperties\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"SetSlideProperties\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"SetSlideProperties\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.SetSlideProperties(testname, testdto, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"SetSlideProperties\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "3b312630b01d066efcd9d381f5d2ab50", "score": "0.54245853", "text": "func TestUpdateSpecialSlideParagraphInvalidDto(t *testing.T) {\n testname, _ := createTestParamValue(\"UpdateSpecialSlideParagraph\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"UpdateSpecialSlideParagraph\", \"slideIndex\", \"int32\").(int32)\n testslideType, _ := createTestParamValue(\"UpdateSpecialSlideParagraph\", \"slideType\", \"string\").(string)\n testshapeIndex, _ := createTestParamValue(\"UpdateSpecialSlideParagraph\", \"shapeIndex\", \"int32\").(int32)\n testparagraphIndex, _ := createTestParamValue(\"UpdateSpecialSlideParagraph\", \"paragraphIndex\", \"int32\").(int32)\n testdto, _ := createTestParamValue(\"UpdateSpecialSlideParagraph\", \"dto\", \"Paragraph\").(IParagraph)\n testpassword, _ := createTestParamValue(\"UpdateSpecialSlideParagraph\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"UpdateSpecialSlideParagraph\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"UpdateSpecialSlideParagraph\", \"storage\", \"string\").(string)\n testsubShape, _ := createTestParamValue(\"UpdateSpecialSlideParagraph\", \"subShape\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testdto, \"UpdateSpecialSlideParagraph\", \"dto\", \"Paragraph\")\n if (invalidValue == nil) {\n testdto = nil\n } else {\n testdto, _ = invalidValue.(IParagraph)\n }\n\n e := InitializeTest(\"UpdateSpecialSlideParagraph\", \"dto\", testdto)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.UpdateSpecialSlideParagraph(testname, testslideIndex, testslideType, testshapeIndex, testparagraphIndex, testdto, testpassword, testfolder, teststorage, testsubShape)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"UpdateSpecialSlideParagraph\", \"dto\", \"Paragraph\", testdto, int32(statusCode), e)\n}", "title": "" }, { "docid": "981bcc7a805ce0f055516521d0cfe3d1", "score": "0.5422093", "text": "func TestUpdateLayoutSlideInvalidPassword(t *testing.T) {\n testname, _ := createTestParamValue(\"UpdateLayoutSlide\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"UpdateLayoutSlide\", \"slideIndex\", \"int32\").(int32)\n testslideDto, _ := createTestParamValue(\"UpdateLayoutSlide\", \"slideDto\", \"LayoutSlide\").(ILayoutSlide)\n testpassword, _ := createTestParamValue(\"UpdateLayoutSlide\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"UpdateLayoutSlide\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"UpdateLayoutSlide\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"UpdateLayoutSlide\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"UpdateLayoutSlide\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.UpdateLayoutSlide(testname, testslideIndex, testslideDto, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"UpdateLayoutSlide\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "8aa490280d09c8bf78dec21cb6762618", "score": "0.5418011", "text": "func TestSaveSlideOnlineInvalidOptions(t *testing.T) {\n testdocument, _ := createTestParamValue(\"SaveSlideOnline\", \"document\", \"[]byte\").([]byte)\n testslideIndex, _ := createTestParamValue(\"SaveSlideOnline\", \"slideIndex\", \"int32\").(int32)\n testformat, _ := createTestParamValue(\"SaveSlideOnline\", \"format\", \"string\").(string)\n testoutPath, _ := createTestParamValue(\"SaveSlideOnline\", \"outPath\", \"string\").(string)\n var testwidth *int32\n testwidthValue := createTestParamValue(\"SaveSlideOnline\", \"width\", \"int32\")\n if (testwidthValue != nil) {\n testwidth = new(int32)\n *testwidth, _ = testwidthValue.(int32)\n }\n var testheight *int32\n testheightValue := createTestParamValue(\"SaveSlideOnline\", \"height\", \"int32\")\n if (testheightValue != nil) {\n testheight = new(int32)\n *testheight, _ = testheightValue.(int32)\n }\n testpassword, _ := createTestParamValue(\"SaveSlideOnline\", \"password\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"SaveSlideOnline\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"SaveSlideOnline\", \"fontsFolder\", \"string\").(string)\n testoptions, _ := createTestParamValue(\"SaveSlideOnline\", \"options\", \"ExportOptions\").(IExportOptions)\n\n invalidValue := invalidizeTestParamValue(testoptions, \"SaveSlideOnline\", \"options\", \"ExportOptions\")\n if (invalidValue == nil) {\n testoptions = nil\n } else {\n testoptions, _ = invalidValue.(IExportOptions)\n }\n\n e := InitializeTest(\"SaveSlideOnline\", \"options\", testoptions)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n r, e := GetTestApiClient().SlidesApi.SaveSlideOnline(testdocument, testslideIndex, testformat, testoutPath, testwidth, testheight, testpassword, teststorage, testfontsFolder, testoptions)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"SaveSlideOnline\", \"options\", \"ExportOptions\", testoptions, int32(statusCode), e)\n}", "title": "" }, { "docid": "9db512a540abb54cbfc4b6b09dd2fd92", "score": "0.5417638", "text": "func TestImportFromPdf(t *testing.T) {\n testname, _ := createTestParamValue(\"ImportFromPdf\", \"name\", \"string\").(string)\n testpdf, _ := createTestParamValue(\"ImportFromPdf\", \"pdf\", \"[]byte\").([]byte)\n testpassword, _ := createTestParamValue(\"ImportFromPdf\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"ImportFromPdf\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"ImportFromPdf\", \"storage\", \"string\").(string)\n e := InitializeTest(\"ImportFromPdf\", \"\", \"\")\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n c := GetTestApiClient()\n _, _, e = c.SlidesApi.ImportFromPdf(testname, testpdf, testpassword, testfolder, teststorage)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n}", "title": "" }, { "docid": "cbf1a3f794d13547b268d90a21bf7639", "score": "0.5417088", "text": "func TestReplacePresentationText(t *testing.T) {\n testname, _ := createTestParamValue(\"ReplacePresentationText\", \"name\", \"string\").(string)\n testoldValue, _ := createTestParamValue(\"ReplacePresentationText\", \"oldValue\", \"string\").(string)\n testnewValue, _ := createTestParamValue(\"ReplacePresentationText\", \"newValue\", \"string\").(string)\n var testignoreCase *bool\n testignoreCaseValue := createTestParamValue(\"ReplacePresentationText\", \"ignoreCase\", \"bool\")\n if (testignoreCaseValue != nil) {\n testignoreCase = new(bool)\n *testignoreCase, _ = testignoreCaseValue.(bool)\n }\n testpassword, _ := createTestParamValue(\"ReplacePresentationText\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"ReplacePresentationText\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"ReplacePresentationText\", \"storage\", \"string\").(string)\n e := InitializeTest(\"ReplacePresentationText\", \"\", \"\")\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n c := GetTestApiClient()\n _, _, e = c.SlidesApi.ReplacePresentationText(testname, testoldValue, testnewValue, testignoreCase, testpassword, testfolder, teststorage)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n}", "title": "" }, { "docid": "2a226c4714acb780e6469c9901b29ae9", "score": "0.54133314", "text": "func TestSaveSlide(t *testing.T) {\n testname, _ := createTestParamValue(\"SaveSlide\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"SaveSlide\", \"slideIndex\", \"int32\").(int32)\n testformat, _ := createTestParamValue(\"SaveSlide\", \"format\", \"string\").(string)\n testoutPath, _ := createTestParamValue(\"SaveSlide\", \"outPath\", \"string\").(string)\n testoptions, _ := createTestParamValue(\"SaveSlide\", \"options\", \"ExportOptions\").(IExportOptions)\n var testwidth *int32\n testwidthValue := createTestParamValue(\"SaveSlide\", \"width\", \"int32\")\n if (testwidthValue != nil) {\n testwidth = new(int32)\n *testwidth, _ = testwidthValue.(int32)\n }\n var testheight *int32\n testheightValue := createTestParamValue(\"SaveSlide\", \"height\", \"int32\")\n if (testheightValue != nil) {\n testheight = new(int32)\n *testheight, _ = testheightValue.(int32)\n }\n testpassword, _ := createTestParamValue(\"SaveSlide\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"SaveSlide\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"SaveSlide\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"SaveSlide\", \"fontsFolder\", \"string\").(string)\n e := InitializeTest(\"SaveSlide\", \"\", \"\")\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n c := GetTestApiClient()\n _, e = c.SlidesApi.SaveSlide(testname, testslideIndex, testformat, testoutPath, testoptions, testwidth, testheight, testpassword, testfolder, teststorage, testfontsFolder)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n}", "title": "" }, { "docid": "1428c2cd7badc009869d399675d80172", "score": "0.5412718", "text": "func TestSetProtectionOnline(t *testing.T) {\n testdocument, _ := createTestParamValue(\"SetProtectionOnline\", \"document\", \"[]byte\").([]byte)\n testdto, _ := createTestParamValue(\"SetProtectionOnline\", \"dto\", \"ProtectionProperties\").(IProtectionProperties)\n testpassword, _ := createTestParamValue(\"SetProtectionOnline\", \"password\", \"string\").(string)\n e := InitializeTest(\"SetProtectionOnline\", \"\", \"\")\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n c := GetTestApiClient()\n r, _, e := c.SlidesApi.SetProtectionOnline(testdocument, testdto, testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n assertBinaryResponse(r, t)\n}", "title": "" }, { "docid": "770c09e76279564eb392c4b5c4327b47", "score": "0.54120404", "text": "func TestCopySlideInvalidSourcePassword(t *testing.T) {\n testname, _ := createTestParamValue(\"CopySlide\", \"name\", \"string\").(string)\n testslideToCopy, _ := createTestParamValue(\"CopySlide\", \"slideToCopy\", \"int32\").(int32)\n var testposition *int32\n testpositionValue := createTestParamValue(\"CopySlide\", \"position\", \"int32\")\n if (testpositionValue != nil) {\n testposition = new(int32)\n *testposition, _ = testpositionValue.(int32)\n }\n testsource, _ := createTestParamValue(\"CopySlide\", \"source\", \"string\").(string)\n testsourcePassword, _ := createTestParamValue(\"CopySlide\", \"sourcePassword\", \"string\").(string)\n testsourceStorage, _ := createTestParamValue(\"CopySlide\", \"sourceStorage\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"CopySlide\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"CopySlide\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"CopySlide\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testsourcePassword, \"CopySlide\", \"sourcePassword\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testsourcePassword = nullValue\n } else {\n testsourcePassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"CopySlide\", \"sourcePassword\", testsourcePassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.CopySlide(testname, testslideToCopy, testposition, testsource, testsourcePassword, testsourceStorage, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"CopySlide\", \"sourcePassword\", \"string\", testsourcePassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "547b9c98714ee4ab3fa50e44985f46a4", "score": "0.54063594", "text": "func TestUpdateParagraphInvalidPassword(t *testing.T) {\n testname, _ := createTestParamValue(\"UpdateParagraph\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"UpdateParagraph\", \"slideIndex\", \"int32\").(int32)\n testshapeIndex, _ := createTestParamValue(\"UpdateParagraph\", \"shapeIndex\", \"int32\").(int32)\n testparagraphIndex, _ := createTestParamValue(\"UpdateParagraph\", \"paragraphIndex\", \"int32\").(int32)\n testdto, _ := createTestParamValue(\"UpdateParagraph\", \"dto\", \"Paragraph\").(IParagraph)\n testpassword, _ := createTestParamValue(\"UpdateParagraph\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"UpdateParagraph\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"UpdateParagraph\", \"storage\", \"string\").(string)\n testsubShape, _ := createTestParamValue(\"UpdateParagraph\", \"subShape\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"UpdateParagraph\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"UpdateParagraph\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.UpdateParagraph(testname, testslideIndex, testshapeIndex, testparagraphIndex, testdto, testpassword, testfolder, teststorage, testsubShape)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"UpdateParagraph\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "0f90c1f41e8c420abdc788a3663de2bd", "score": "0.5404069", "text": "func TestSaveSlideOnlineInvalidStorage(t *testing.T) {\n testdocument, _ := createTestParamValue(\"SaveSlideOnline\", \"document\", \"[]byte\").([]byte)\n testslideIndex, _ := createTestParamValue(\"SaveSlideOnline\", \"slideIndex\", \"int32\").(int32)\n testformat, _ := createTestParamValue(\"SaveSlideOnline\", \"format\", \"string\").(string)\n testoutPath, _ := createTestParamValue(\"SaveSlideOnline\", \"outPath\", \"string\").(string)\n var testwidth *int32\n testwidthValue := createTestParamValue(\"SaveSlideOnline\", \"width\", \"int32\")\n if (testwidthValue != nil) {\n testwidth = new(int32)\n *testwidth, _ = testwidthValue.(int32)\n }\n var testheight *int32\n testheightValue := createTestParamValue(\"SaveSlideOnline\", \"height\", \"int32\")\n if (testheightValue != nil) {\n testheight = new(int32)\n *testheight, _ = testheightValue.(int32)\n }\n testpassword, _ := createTestParamValue(\"SaveSlideOnline\", \"password\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"SaveSlideOnline\", \"storage\", \"string\").(string)\n testfontsFolder, _ := createTestParamValue(\"SaveSlideOnline\", \"fontsFolder\", \"string\").(string)\n testoptions, _ := createTestParamValue(\"SaveSlideOnline\", \"options\", \"ExportOptions\").(IExportOptions)\n\n invalidValue := invalidizeTestParamValue(teststorage, \"SaveSlideOnline\", \"storage\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n teststorage = nullValue\n } else {\n teststorage, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"SaveSlideOnline\", \"storage\", teststorage)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n r, e := GetTestApiClient().SlidesApi.SaveSlideOnline(testdocument, testslideIndex, testformat, testoutPath, testwidth, testheight, testpassword, teststorage, testfontsFolder, testoptions)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"SaveSlideOnline\", \"storage\", \"string\", teststorage, int32(statusCode), e)\n}", "title": "" }, { "docid": "d80de1a1977d9b7b2507a7b4ace132a0", "score": "0.54031974", "text": "func TestGetParagraphInvalidPassword(t *testing.T) {\n testname, _ := createTestParamValue(\"GetParagraph\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"GetParagraph\", \"slideIndex\", \"int32\").(int32)\n testshapeIndex, _ := createTestParamValue(\"GetParagraph\", \"shapeIndex\", \"int32\").(int32)\n testparagraphIndex, _ := createTestParamValue(\"GetParagraph\", \"paragraphIndex\", \"int32\").(int32)\n testpassword, _ := createTestParamValue(\"GetParagraph\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"GetParagraph\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"GetParagraph\", \"storage\", \"string\").(string)\n testsubShape, _ := createTestParamValue(\"GetParagraph\", \"subShape\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"GetParagraph\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"GetParagraph\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.GetParagraph(testname, testslideIndex, testshapeIndex, testparagraphIndex, testpassword, testfolder, teststorage, testsubShape)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"GetParagraph\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "d625c1a4b23d254a6e879141246dfaf4", "score": "0.5401892", "text": "func TestCreatePresentationInvalidStorage(t *testing.T) {\n testname, _ := createTestParamValue(\"CreatePresentation\", \"name\", \"string\").(string)\n testdata, _ := createTestParamValue(\"CreatePresentation\", \"data\", \"[]byte\").([]byte)\n testinputPassword, _ := createTestParamValue(\"CreatePresentation\", \"inputPassword\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"CreatePresentation\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"CreatePresentation\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"CreatePresentation\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(teststorage, \"CreatePresentation\", \"storage\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n teststorage = nullValue\n } else {\n teststorage, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"CreatePresentation\", \"storage\", teststorage)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.CreatePresentation(testname, testdata, testinputPassword, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"CreatePresentation\", \"storage\", \"string\", teststorage, int32(statusCode), e)\n}", "title": "" }, { "docid": "bf498946de8cc2f8097e40881043c9d3", "score": "0.5401239", "text": "func TestCreateParagraphInvalidDto(t *testing.T) {\n testname, _ := createTestParamValue(\"CreateParagraph\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"CreateParagraph\", \"slideIndex\", \"int32\").(int32)\n testshapeIndex, _ := createTestParamValue(\"CreateParagraph\", \"shapeIndex\", \"int32\").(int32)\n testdto, _ := createTestParamValue(\"CreateParagraph\", \"dto\", \"Paragraph\").(IParagraph)\n var testposition *int32\n testpositionValue := createTestParamValue(\"CreateParagraph\", \"position\", \"int32\")\n if (testpositionValue != nil) {\n testposition = new(int32)\n *testposition, _ = testpositionValue.(int32)\n }\n testpassword, _ := createTestParamValue(\"CreateParagraph\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"CreateParagraph\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"CreateParagraph\", \"storage\", \"string\").(string)\n testsubShape, _ := createTestParamValue(\"CreateParagraph\", \"subShape\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testdto, \"CreateParagraph\", \"dto\", \"Paragraph\")\n if (invalidValue == nil) {\n testdto = nil\n } else {\n testdto, _ = invalidValue.(IParagraph)\n }\n\n e := InitializeTest(\"CreateParagraph\", \"dto\", testdto)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.CreateParagraph(testname, testslideIndex, testshapeIndex, testdto, testposition, testpassword, testfolder, teststorage, testsubShape)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"CreateParagraph\", \"dto\", \"Paragraph\", testdto, int32(statusCode), e)\n}", "title": "" } ]
9e58ae8a2805d6433bb48480febb2b40
Deprecated: Use SetAuthPubKeyReq.ProtoReflect.Descriptor instead.
[ { "docid": "b7b81a5bc2a698527ca6aa3046163b91", "score": "0.7616085", "text": "func (*SetAuthPubKeyReq) Descriptor() ([]byte, []int) {\n\treturn file_Auth_Auth_proto_rawDescGZIP(), []int{9}\n}", "title": "" } ]
[ { "docid": "48b3be618f8ffe85818a8d5b4b04ac97", "score": "0.7270044", "text": "func (*GetAuthPubKeyReq) Descriptor() ([]byte, []int) {\n\treturn file_Auth_Auth_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "95eeede597304d4a816b3e0e26ec2764", "score": "0.71376216", "text": "func (*SetAuthPubKeyRsp) Descriptor() ([]byte, []int) {\n\treturn file_Auth_Auth_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "f6aefafce6986a3b9deb622720a8f90e", "score": "0.6690429", "text": "func (*GetAuthPubKeyRsp) Descriptor() ([]byte, []int) {\n\treturn file_Auth_Auth_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "bdb05886e36068423b9e1528618a580c", "score": "0.64452", "text": "func (*GenerateKeyPairRequest) Descriptor() ([]byte, []int) {\n\treturn file_spire_plugin_agent_keymanager_v0_keymanager_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "cbd13e390def3552c13a7db518f5bcc7", "score": "0.6339199", "text": "func (*PublicKeyRequest) Descriptor() ([]byte, []int) {\n\treturn file_drand_control_proto_rawDescGZIP(), []int{16}\n}", "title": "" }, { "docid": "69b0923931de009bccb71c0c92236de0", "score": "0.63340575", "text": "func (*ImportPrivateKeyRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{19}\n}", "title": "" }, { "docid": "7361cbf8114fdb0cc4c6bac373429294", "score": "0.625456", "text": "func (*StorePrivateKeyRequest) Descriptor() ([]byte, []int) {\n\treturn file_spire_plugin_agent_keymanager_v0_keymanager_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "193fd8083c4cb3aa20cb96e50c5a9619", "score": "0.62443364", "text": "func (*PrivateKeyRequest) Descriptor() ([]byte, []int) {\n\treturn file_drand_control_proto_rawDescGZIP(), []int{18}\n}", "title": "" }, { "docid": "9a76efabe9482dd051a3c4e6d0ce45af", "score": "0.6224886", "text": "func (*UpdateSshPublicKeyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_oslogin_v1alpha_oslogin_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "27337506101580c924ee3c68efcb945b", "score": "0.61981475", "text": "func (*EnableCertificateAuthorityRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_security_privateca_v1beta1_service_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "0626cb851ad93d991631111ce8660cb6", "score": "0.61532366", "text": "func (*ImportSshPublicKeyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_oslogin_v1alpha_oslogin_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "98f685db144a1a8eaa0af75e89a0d9b7", "score": "0.6151141", "text": "func (*DumpPrivKeyRequest) Descriptor() ([]byte, []int) {\n\treturn file_LightWalletService_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "86f4d33e06c73ec8839c32a2277c60e3", "score": "0.6148731", "text": "func (*FetchPrivateKeyRequest) Descriptor() ([]byte, []int) {\n\treturn file_spire_plugin_agent_keymanager_v0_keymanager_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "ca454a21e2350866f8aad318cac63071", "score": "0.61427265", "text": "func (*KeyImportRequest) Descriptor() ([]byte, []int) {\n\treturn file_rpc_proto_rawDescGZIP(), []int{71}\n}", "title": "" }, { "docid": "982683cae850a92b589f436b652446f1", "score": "0.6127754", "text": "func (*FetchPublicKeyRequest) Descriptor() ([]byte, []int) {\n\treturn file_fhe_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "cdda64248228b66cd5ed7a5b3406ca4c", "score": "0.61143637", "text": "func (*UpdateAccessKeyRequest) Descriptor() ([]byte, []int) {\n\treturn file_yandex_cloud_iam_v1_awscompatibility_access_key_service_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "ce16baf3c5cbb77faf46010b09c8d17f", "score": "0.6104018", "text": "func (*KeyRequest) Descriptor() ([]byte, []int) {\n\treturn file_rpc_proto_rawDescGZIP(), []int{76}\n}", "title": "" }, { "docid": "a94b3302ba687a53d03797bbd0a3c014", "score": "0.61021805", "text": "func (*KeyGenerateRequest) Descriptor() ([]byte, []int) {\n\treturn file_rpc_proto_rawDescGZIP(), []int{61}\n}", "title": "" }, { "docid": "e3f66c2adb3d82b3bb018f6c884937b3", "score": "0.608382", "text": "func (*DeleteSshPublicKeyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_oslogin_v1alpha_oslogin_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "49632657bd0875e83d77f206bcd2d47f", "score": "0.6070001", "text": "func (*GenerateKeyRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_v1_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "dbf8082dc6be9234124f297554bb5c0d", "score": "0.6068589", "text": "func (*KeysRequest) Descriptor() ([]byte, []int) {\n\treturn file_rpc_proto_rawDescGZIP(), []int{78}\n}", "title": "" }, { "docid": "86d534e1ef503446c031fc28260fc44c", "score": "0.6060543", "text": "func (*ApiKeyDeleteRequest) Descriptor() ([]byte, []int) {\n\treturn file_github_com_solo_io_gloo_projects_gloo_api_v1_enterprise_options_extauth_v1_extauth_proto_rawDescGZIP(), []int{47}\n}", "title": "" }, { "docid": "42877c82c746a3d0eb86b0cb6c3bbe2f", "score": "0.6043965", "text": "func (*VerifyRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_imp_api_signing_signing_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "4aa1f378187e83cefb189d17fbb350b3", "score": "0.6043409", "text": "func (*ChangePassphraseRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{27}\n}", "title": "" }, { "docid": "7cec7a0e71e03a38b885ccc88fcc068f", "score": "0.6037285", "text": "func (*AuthSetupRequest) Descriptor() ([]byte, []int) {\n\treturn file_rpc_proto_rawDescGZIP(), []int{40}\n}", "title": "" }, { "docid": "c5b28e9ef518b270915e0ee1a462d61a", "score": "0.6037278", "text": "func (*AuthProvisionRequest) Descriptor() ([]byte, []int) {\n\treturn file_rpc_proto_rawDescGZIP(), []int{46}\n}", "title": "" }, { "docid": "c63943875fb788d8630be03e0d1c0c2b", "score": "0.6024237", "text": "func (*ApiKeyUpdateRequest) Descriptor() ([]byte, []int) {\n\treturn file_github_com_solo_io_gloo_projects_gloo_api_v1_enterprise_options_extauth_v1_extauth_proto_rawDescGZIP(), []int{45}\n}", "title": "" }, { "docid": "13337c69944e8f4cac85f1c1b230f081", "score": "0.6023525", "text": "func (*GetSshPublicKeyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_oslogin_v1alpha_oslogin_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "6278274773bbff76f089c587def88cab", "score": "0.60168487", "text": "func (*UpdateAsymmetricEncryptionKeyRequest) Descriptor() ([]byte, []int) {\n\treturn file_yandex_cloud_kms_v1_asymmetricencryption_asymmetric_encryption_key_service_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "03e83b5aee85d6a5748ed8f4ff24a09d", "score": "0.60053426", "text": "func (*FetchPublicKeyBySHA256Request) Descriptor() ([]byte, []int) {\n\treturn file_fhe_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "cde9b7bf7b12ece64dae9ce4fd9944ba", "score": "0.6004229", "text": "func (*GenerateDataKeyRequest) Descriptor() ([]byte, []int) {\n\treturn file_yandex_cloud_kms_v1_symmetric_crypto_service_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "1018c834adc89d4a0a7cab9a3462e502", "score": "0.5990333", "text": "func (*ActivateCertificateAuthorityRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_security_privateca_v1beta1_service_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "c4af3bf9925742c89cbd866292f373f9", "score": "0.597908", "text": "func (*RequestUpdateAuth) Descriptor() ([]byte, []int) {\n\treturn file_pkg_auth_proto_auth_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "6da2117813d71cdb8a43e97c25ae78d9", "score": "0.5976628", "text": "func (*UpdateCertificateAuthorityRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_security_privateca_v1beta1_service_proto_rawDescGZIP(), []int{17}\n}", "title": "" }, { "docid": "5fd65708846bb2e3aa1e934dce89b030", "score": "0.5966063", "text": "func (*GrantRevokePermissionRequestPB) Descriptor() ([]byte, []int) {\n\treturn file_yb_master_master_proto_rawDescGZIP(), []int{145}\n}", "title": "" }, { "docid": "bf31e908ab7af8c9c88b53bcde29acc6", "score": "0.59554505", "text": "func (*GetKeyRequest) Descriptor() ([]byte, []int) {\n\treturn file_flags_flags_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "66ff432c06abdfdea9c9e3958efa1f9d", "score": "0.5954207", "text": "func (*RevokeCertificateRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_security_privateca_v1beta1_service_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "8d0920a7686caa24987d08b4177606e7", "score": "0.59511846", "text": "func (*RequestChangePrivateAccountRequest) Descriptor() ([]byte, []int) {\n\treturn file_account_proto_rawDescGZIP(), []int{11}\n}", "title": "" }, { "docid": "2991f4d7c4bda0120c6a45da30d24dfb", "score": "0.59471965", "text": "func (*AuthProvisionsRequest) Descriptor() ([]byte, []int) {\n\treturn file_rpc_proto_rawDescGZIP(), []int{53}\n}", "title": "" }, { "docid": "93cd77db98dd88e07127ba51cc89b8c2", "score": "0.5936207", "text": "func (*CoinWithDrawRevokeReq) Descriptor() ([]byte, []int) {\n\treturn file_proto_coin_proto_rawDescGZIP(), []int{13}\n}", "title": "" }, { "docid": "5367aafcf30f56ac2473f6b13eee3716", "score": "0.5934731", "text": "func (*ImportKeyReq) Descriptor() ([]byte, []int) {\n\treturn file_relayer_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "c5c7e19cc413ca2e381ecaf260333d07", "score": "0.59316325", "text": "func (*ApiKeyCreateRequest) Descriptor() ([]byte, []int) {\n\treturn file_github_com_solo_io_gloo_projects_gloo_api_v1_enterprise_options_extauth_v1_extauth_proto_rawDescGZIP(), []int{41}\n}", "title": "" }, { "docid": "05895109bb03d882aa473f3515bc3c0c", "score": "0.59236073", "text": "func (*UpdateAuthSettingsRequest) Descriptor() ([]byte, []int) {\n\treturn file_yandex_cloud_mdb_opensearch_v1_cluster_service_proto_rawDescGZIP(), []int{50}\n}", "title": "" }, { "docid": "bfa8406c5cbde65cc094e9fc938719c6", "score": "0.5921374", "text": "func (*UpdateCertificateRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_security_privateca_v1beta1_service_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "73bb99d3d47866d976d37bfa23bf16d8", "score": "0.5918103", "text": "func (*SignInExternalRequest) Descriptor() ([]byte, []int) {\n\treturn file_account_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "1929d7c8a8180c6bdc3ae1dcfef82703", "score": "0.59156364", "text": "func (*CreateAsymmetricEncryptionKeyRequest) Descriptor() ([]byte, []int) {\n\treturn file_yandex_cloud_kms_v1_asymmetricencryption_asymmetric_encryption_key_service_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "16f07dc8bc1ec031d1c652abd411f7ce", "score": "0.59013355", "text": "func (*DeleteAccessKeyRequest) Descriptor() ([]byte, []int) {\n\treturn file_yandex_cloud_iam_v1_awscompatibility_access_key_service_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "59d0d71f31d77e1b75ec25841b547f16", "score": "0.5899162", "text": "func (*AuthReq) Descriptor() ([]byte, []int) {\n\treturn file_iam_iam_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "6a74a994c6d8b9edbc8212b84929c196", "score": "0.5896562", "text": "func (*DeleteAsymmetricEncryptionKeyRequest) Descriptor() ([]byte, []int) {\n\treturn file_yandex_cloud_kms_v1_asymmetricencryption_asymmetric_encryption_key_service_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "5e85157f41642b248e364ea18f8641e3", "score": "0.5891102", "text": "func (*SignInRequest) Descriptor() ([]byte, []int) {\n\treturn file_messages_auth_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "0d79ddd809f39e8b69eee288323aa95c", "score": "0.58906484", "text": "func (*SecretK8SRequest) Descriptor() ([]byte, []int) {\n\treturn file_pkg_proto_bcs_storage_proto_rawDescGZIP(), []int{73}\n}", "title": "" }, { "docid": "94574f480d603669726e0949475dd7f3", "score": "0.5888816", "text": "func (*AuthPasswordChangeRequest) Descriptor() ([]byte, []int) {\n\treturn file_rpc_proto_rawDescGZIP(), []int{50}\n}", "title": "" }, { "docid": "454d56f57beac5012346f33e32655927", "score": "0.58844525", "text": "func (*OAuthConfigSetSomeRequest) Descriptor() ([]byte, []int) {\n\treturn file_arista_identityprovider_v1_services_gen_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "cee9e3299ff4b5956f1f0813fe717719", "score": "0.58839613", "text": "func (*RequestAuthID) Descriptor() ([]byte, []int) {\n\treturn file_pkg_auth_proto_auth_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "d97f7b74c3459e8c1c8ad48247531655", "score": "0.58760965", "text": "func (*SetNetworkPolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_container_v1_cluster_service_proto_rawDescGZIP(), []int{104}\n}", "title": "" }, { "docid": "628289eec5a8ce07bb15010433c9170e", "score": "0.5863664", "text": "func (*AuthDeprovisionRequest) Descriptor() ([]byte, []int) {\n\treturn file_rpc_proto_rawDescGZIP(), []int{48}\n}", "title": "" }, { "docid": "ecde08affe8fc57d218ac55ffb7a3532", "score": "0.5846437", "text": "func (*RenewNonDomainJoinedKerberosLeaseRequest) Descriptor() ([]byte, []int) {\n\treturn file_credentialsfetcher_credentialsfetcher_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "da50d8793d6b4c2365faa9cabe45737c", "score": "0.5846223", "text": "func (*GetAsymmetricEncryptionKeyRequest) Descriptor() ([]byte, []int) {\n\treturn file_yandex_cloud_kms_v1_asymmetricencryption_asymmetric_encryption_key_service_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "6bf4eb93cf691e42cbdeb33f5d99392d", "score": "0.58459836", "text": "func (*KeyRequest) Descriptor() ([]byte, []int) {\n\treturn file_KeyValue_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "463989e0cb631e5d3f728ebf87f6bfee", "score": "0.58421785", "text": "func (*CMsgGCCStrike15V2_ClientAuthKeyCode) Descriptor() ([]byte, []int) {\n\treturn file_cstrike15_gcmessages_proto_rawDescGZIP(), []int{109}\n}", "title": "" }, { "docid": "f97bc8bc22a77cbb22e8604a9a2c1ec1", "score": "0.58407307", "text": "func (*CreateNonDomainJoinedKerberosLeaseRequest) Descriptor() ([]byte, []int) {\n\treturn file_credentialsfetcher_credentialsfetcher_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "f6efbc8e5650a87e9a6bd3b0440daf82", "score": "0.58391756", "text": "func (*CreateAccessKeyRequest) Descriptor() ([]byte, []int) {\n\treturn file_yandex_cloud_iam_v1_awscompatibility_access_key_service_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "e58f98c181f416fe6718b12b2514dd8a", "score": "0.5837885", "text": "func (*AuthorizeKey) Descriptor() ([]byte, []int) {\n\treturn file_authorize_key_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "b28022ac1bdf44f8bf422d783a0f5366", "score": "0.58350736", "text": "func (*AuthReq) Descriptor() ([]byte, []int) {\n\treturn file_proto_message_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "f2ebf84dded2f7839be05a2e0df30edb", "score": "0.5834588", "text": "func (*CosmosPubKey) Descriptor() ([]byte, []int) {\n\treturn file_injective_exchange_rpc_proto_rawDescGZIP(), []int{11}\n}", "title": "" }, { "docid": "b246c23e36ddfab2afd8f400a7b21457", "score": "0.5819353", "text": "func (*SetRequest) Descriptor() ([]byte, []int) {\n\treturn file_samerkv_samerkv_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "a22d047381d8952dccc0f4923b620d00", "score": "0.5816094", "text": "func (*GenerateKeyPairResponse) Descriptor() ([]byte, []int) {\n\treturn file_spire_plugin_agent_keymanager_v0_keymanager_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "36b05fafa5e9ea313686b8dfb25f6712", "score": "0.5810526", "text": "func (*GetAccessKeyRequest) Descriptor() ([]byte, []int) {\n\treturn file_yandex_cloud_iam_v1_awscompatibility_access_key_service_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "6a6e876f0220cf46422cf0e4da4b35e0", "score": "0.58096683", "text": "func (*SignRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_imp_api_signing_signing_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "4dbd3066cd0cec6c038f6c37a93c324f", "score": "0.58092695", "text": "func (*SigchainRequest) Descriptor() ([]byte, []int) {\n\treturn file_rpc_proto_rawDescGZIP(), []int{15}\n}", "title": "" }, { "docid": "d4b80a577d03be853279962e45def816", "score": "0.5808929", "text": "func (*RegenerateRootRequest) Descriptor() ([]byte, []int) {\n\treturn file_interservice_deployment_certificate_authority_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "c36f5e27f73276c6507093491b5fd0f1", "score": "0.5799575", "text": "func (*PutRequest) Descriptor() ([]byte, []int) {\n\treturn file_kv_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "01f0778907d4509ab82aa433a29df475", "score": "0.57966864", "text": "func (*SecretRequest) Descriptor() ([]byte, []int) {\n\treturn file_rpc_proto_rawDescGZIP(), []int{81}\n}", "title": "" }, { "docid": "2e5f09254abfc8d13d3c1538a214768c", "score": "0.57942736", "text": "func (*AuthRequest) Descriptor() ([]byte, []int) {\n\treturn file_auth_service_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "60e10ca2912af7d42f7a5ac472f36d5f", "score": "0.57923764", "text": "func (*KeyRemoveRequest) Descriptor() ([]byte, []int) {\n\treturn file_rpc_proto_rawDescGZIP(), []int{73}\n}", "title": "" }, { "docid": "a4432ea4ac93e6d71be5580ceb61843c", "score": "0.5791715", "text": "func (*AddOrUpdatePolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_cerbos_request_v1_request_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "6291d1b051de3d0e0c341401f8cc102e", "score": "0.577778", "text": "func (*VerifyUserTokenRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_authService_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "865d0f0812ed2d0bd591b49fd5dcb57a", "score": "0.57774246", "text": "func (*UpdateTokenReq) Descriptor() ([]byte, []int) {\n\treturn file_user_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "10917f6abab036c378f11cc98b492b6a", "score": "0.57708615", "text": "func (*VaultAuthRequest) Descriptor() ([]byte, []int) {\n\treturn file_rpc_proto_rawDescGZIP(), []int{116}\n}", "title": "" }, { "docid": "d77082929001acbe7a37d97c7b2fd7c3", "score": "0.5769711", "text": "func (*VerifyRequest) Descriptor() ([]byte, []int) {\n\treturn edgelq_iam_proto_v1alpha2_attestation_custom_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "6f47fa17e69344228ad72ad624236c65", "score": "0.5767272", "text": "func (*RequestCreateAuth) Descriptor() ([]byte, []int) {\n\treturn file_pkg_auth_proto_auth_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "9b55147fd8fbf77498ef75a3cea7d01d", "score": "0.57627684", "text": "func (*OAuthConfigSetRequest) Descriptor() ([]byte, []int) {\n\treturn file_arista_identityprovider_v1_services_gen_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "eb7e5c027680746b0c3e4cf44a643f18", "score": "0.57577854", "text": "func (*KeyExportRequest) Descriptor() ([]byte, []int) {\n\treturn file_rpc_proto_rawDescGZIP(), []int{69}\n}", "title": "" }, { "docid": "1363a085d951a3009df021819a7e2fc1", "score": "0.57572573", "text": "func (*UpdateOrganizationAPIKeyRequest) Descriptor() ([]byte, []int) {\n\treturn file_ttn_lorawan_v3_organization_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "f1d34272132acaee9780849418063d97", "score": "0.5753226", "text": "func (*TokenRequest) Descriptor() ([]byte, []int) {\n\treturn file_auth_service_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "b3bab5d70729a281080916e6f6955288", "score": "0.57516485", "text": "func (*PolicyKey) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_server_quota_quotapb_ids_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "ea4d420f6389f089ee0a3fd8e648e96b", "score": "0.57495266", "text": "func (*GetAuthSettingsRequest) Descriptor() ([]byte, []int) {\n\treturn file_yandex_cloud_mdb_opensearch_v1_cluster_service_proto_rawDescGZIP(), []int{49}\n}", "title": "" }, { "docid": "d3559c1dd758a8d3b178341149aa96ad", "score": "0.5743296", "text": "func (*VerifyRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_auth_auth_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "8aef241f500f0fc14637a07a27ccfb3d", "score": "0.57332957", "text": "func (*RevokeRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_v1_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "e68f4624fdf5211e77d9aa38949ec0a4", "score": "0.5730252", "text": "func (*IdentityProviderReq) Descriptor() ([]byte, []int) {\n\treturn file_protodef_identity_identity_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "8ce2dedff2c058e6b1de2ec112d2db78", "score": "0.5728938", "text": "func (*AuthObjectRequest) Descriptor() ([]byte, []int) {\n\treturn file_ric_auth_ricauth_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "8ce2dedff2c058e6b1de2ec112d2db78", "score": "0.5728938", "text": "func (*AuthObjectRequest) Descriptor() ([]byte, []int) {\n\treturn file_ric_auth_ricauth_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "6c7ddfa30ffa5af8371ae4c5d8aa46a2", "score": "0.5726865", "text": "func (*SAMLConfigSetSomeRequest) Descriptor() ([]byte, []int) {\n\treturn file_arista_identityprovider_v1_services_gen_proto_rawDescGZIP(), []int{18}\n}", "title": "" }, { "docid": "5b5f6f4e80e63a0c87775592c5a06bb0", "score": "0.57248056", "text": "func (*PutHostRequest) Descriptor() ([]byte, []int) {\n\treturn file_pkg_proto_bcs_storage_proto_rawDescGZIP(), []int{112}\n}", "title": "" }, { "docid": "12f112f978a8d7bce161146f0ea5ef36", "score": "0.57222223", "text": "func (*CheckRequest) Descriptor() ([]byte, []int) {\n\treturn file_envoy_service_auth_v2_external_auth_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "c891c73214474de613cf4cf3ded4ea2b", "score": "0.5720694", "text": "func (*ClientAuthRequest) Descriptor() ([]byte, []int) {\n\treturn file_node_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "ec7461eb75bac023e520e037bca4ee8e", "score": "0.57196134", "text": "func (*GetGroupMemberRequest) Descriptor() ([]byte, []int) {\n\treturn edgelq_iam_proto_v1alpha2_group_member_service_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "a3f6773107d1ba236a7782190ad21c80", "score": "0.57174706", "text": "func (*ExternalAccountKey) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_security_publicca_v1beta1_resources_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "bcddc3ebac1866d9b6fb51a5c63dc269", "score": "0.57129264", "text": "func (*X509KeyPair_Inline) Descriptor() ([]byte, []int) {\n\treturn file_pkg_proto_configuration_tls_tls_proto_rawDescGZIP(), []int{2, 0}\n}", "title": "" }, { "docid": "7286594646aea4127cd747f2dcf89d27", "score": "0.57100254", "text": "func (*CreateCertificateAuthorityRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_security_privateca_v1beta1_service_proto_rawDescGZIP(), []int{7}\n}", "title": "" } ]
1823e15766513c727bbdd3c4c506bde9
Transact invokes the (paid) contract method with params as input values.
[ { "docid": "3971776e4e026efedbe6f544897c8970", "score": "0.0", "text": "func (_FedRangeQABI *FedRangeQABIRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _FedRangeQABI.Contract.FedRangeQABITransactor.contract.Transact(opts, method, params...)\n}", "title": "" } ]
[ { "docid": "1d4a12033e40afc9ba017546ee7c1e83", "score": "0.6794016", "text": "func (s *SmartContract) Invoke(stub shim.ChaincodeStubInterface) sc.Response {\n\t//extrai o nome da funcao e os argumentos associados a uma transacao\n\tfn, args := stub.GetFunctionAndParameters()\n\n\t//implementa o tratamento para cada funcao reconhecida pelo chaincode\n\tif fn == \"inserirAvaliacao\" {\n\t\t//permite a um professor cadastrar uma avaliacao especifica\n\t\treturn s.inserirAvaliacao(stub, args)\n\n\t} else if fn == \"responderAvaliacao\" {\n\t\t//permite ao aluno responder a avaliacao\n\t\treturn s.responderAvaliacao(stub, args)\n\n\t} else if fn == \"colarAvaliacao\" {\n\t\t//permite ao aluno responder a avaliacao (colando)\n\t\treturn s.colarAvaliacao(stub, args)\n\t\t\n\t} else if fn == \"corrigirAvaliacao\" {\n\t\t//permite ao professor corrigir e atribuir nota a avaliacao\n\t\treturn s.corrigirAvaliacao(stub, args)\n\t\n\t} else if fn == \"countLedger\" {\n\t\t//conta o numero de registros no ledger\n\t\treturn s.countLedger(stub)\n\n\t} else if fn == \"queryLedger\" {\n\t\t//executa uma query livre no CouchDB\n\t\treturn s.queryLedger(stub, args)\n\t}\n\n\t//function fn not implemented, notify error\n\treturn shim.Error(\"Ce tah de brincadera??? Essa funcao nao existe no chaincode!\")\n}", "title": "" }, { "docid": "3cc5785a2e35e44717cb1879b683e061", "score": "0.6765584", "text": "func (t *SmartContract) Invoke(stub shim.ChaincodeStubInterface) peer.Response {\n\t logger.Info(\"########### bloodcard_cc0 Invoke ###########\")\n\t // Extract the function and args from the transaction proposal\n\t fn, args := stub.GetFunctionAndParameters()\n \n\t logger.Info(stub.GetTxID())\n\t logger.Info(stub.GetChannelID())\n \n\n\t switch method := fn; method {\n\t\t case \"initLedger\":\n\t\t\t return t.initLedger(stub)\n\t\tcase \"queryCard\":\n\t\t\treturn t.queryCard(stub, args)\n\t\tcase \"createNewCard\":\n\t\t\treturn t.createNewCard(stub, args)\n\t\t case \"useCard\":\n\t\t\t return t.useCard(stub, args)\n\t\tcase \"donateCard\":\n\t\t\treturn t.donateCard(stub, args)\n\t\tcase \"getHistory\":\n\t\t\treturn t.getHistory(stub, args)\n\t\t default :\n\t\t return shim.Success([]byte(nil))\n\t }\n\n }", "title": "" }, { "docid": "c617ba0d18f0821203fec5b0a5c1ba6d", "score": "0.67425424", "text": "func (wr *WasmPcRuntime) CallContract(fnname string, args [][]byte, txid string, channelid string) {\n\n\tmsg := &contract.InvokeTransactionRequest{\n\t\tChannelId: channelid,\n\t\tTransactionId: txid,\n\t\tTransactionName: fnname,\n\t\tArgs: args}\n\n\targsBuffer, err := proto.Marshal(msg)\n\tcheck(err)\n\n\tlog.Printf(\"[host] calling %s txid=%s\", fnname, txid)\n\t// result, err := wr.vm.Run(entryID, int64(len(fnBuffer)), int64(len(argsBuffer)))\n\t// log.Printf(\"%d %s\", result, wr.callctx.finalResult.Data)\n\n\tresult, err := wr.wapcInstance.Invoke(wr.ctx, \"InvokeTransaction\", []byte(argsBuffer))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(string(result))\n}", "title": "" }, { "docid": "b3693de86c593f7097d2e093a9fc3574", "score": "0.6659189", "text": "func (s *SmartContract) Invoke(APIstub shim.ChaincodeStubInterface) peer.Response {\n\n\t// Retrieve the requested Smart Contract function and arguments\n\tfunction, args := APIstub.GetFunctionAndParameters()\n\t// Route to the appropriate handler function to interact with the ledger appropriately\n\tif function == \"createCpty\" {\n\t\treturn s.createCpty(APIstub, args)\n\t} else if function == \"createTestCpty\" {\n\t\t\treturn s.createTestCpty(APIstub, args)\t\t\n\t} else if function == \"updateCpty\" {\n\t\treturn s.updateCpty(APIstub, args)\n } else if function == \"deleteCpty\" {\n\t\treturn s.deleteCpty(APIstub, args)\n\t} else if function == \"queryCpty\" {\n\t\treturn s.queryCpty(APIstub, args)\t\n\t} else if function == \"queryAllCpty\" {\n\t\treturn s.queryAllCpty(APIstub, args)\t\n\t//User\n\t} else if function == \"createUser\" {\n\t\treturn s.createUser(APIstub, args)\t\t\n\t} else if function == \"updateUser\" {\n\t\treturn s.updateUser(APIstub, args)\t\t\t\n\t} else if function == \"queryUser\" {\n\t\treturn s.queryUser(APIstub, args)\t\t\t\n\t//CptyISDA\n\t} else if function == \"createCptyISDA\" {\n\t\treturn s.createCptyISDA(APIstub, args)\n\t} else if function == \"updateCptyISDA\" {\n\t\treturn s.updateCptyISDA(APIstub, args)\n\t} else if function == \"deleteCptyISDA\" {\n\t\treturn s.deleteCptyISDA(APIstub, args)\n\t} else if function == \"queryCptyISDA\" {\n\t\treturn s.queryCptyISDA(APIstub, args)\t\n\t} else if function == \"queryCptyISDAByCpty\" {\n\t\treturn s.queryCptyISDAByCpty(APIstub, args)\t\t\t\n\t} else if function == \"queryAllCptyISDA\" {\n\t\treturn s.queryAllCptyISDA(APIstub, args)\n\t//CptyAsset\n } else if function == \"createCptyAsset\" {\n return s.createCptyAsset(APIstub, args)\n\t} else if function == \"updateCptyAsset\" {\n\t\treturn s.updateCptyAsset(APIstub, args)\n } else if function == \"queryTXIDCptyAsset\" {\n\t\treturn s.queryTXIDCptyAsset(APIstub, args)\t\t\n\t} else if function == \"CreateCashFlow\" {\n\t\treturn s.CreateCashFlow(APIstub, args)\t\t\t\t\n\n\t//} else if function == \"fetchEURUSDviaOraclize\" {\n\t//\treturn s.fetchEURUSDviaOraclize(APIstub)\n\n } else if function == \"getrate\" {\n\t\treturn s.getrate(APIstub, args)\n\n\t// Transaction Functions\n } else if function == \"FXTradeTransfer\" {\n\t\treturn s.FXTradeTransfer(APIstub, args)\n\t} else if function == \"CorrectFXTradeTransfer\" {\n\t\treturn s.CorrectFXTradeTransfer(APIstub, args)\n\t// Transaction MTM Functions\n\t} else if function == \"FXTradeMTM\" {\n\t\treturn s.FXTradeMTM(APIstub, args)\t\n\t} else if function == \"CreateFXTradeMTM\" {\n\t\treturn s.CreateFXTradeMTM(APIstub, args)\t\t\n\t} else if function == \"deleteFXTradeMTM\" {\n\t\treturn s.deleteFXTradeMTM(APIstub, args)\n\t} else if function == \"QueryFXTradeMTM\" {\n\t\treturn s.QueryFXTradeMTM(APIstub, args)\t\t\t\t\n\t// Transaction Settlment Functions\n\t} else if function == \"FXTradeSettlment\" {\n\t\treturn s.FXTradeSettlment(APIstub, args)\t\n // Transaction FXTradeCollateral Functions\n } else if function == \"FXTradeCollateral\" {\n\t return s.FXTradeCollateral(APIstub, args)\n\t} else if function == \"UpdateFXTradeCollateral\" {\n\t\treturn s.UpdateFXTradeCollateral(APIstub, args)\t \n\t} else if function == \"CreateCollateralDetail\" {\n\t\treturn s.CreateCollateralDetail(APIstub, args)\t \n\t} else if function == \"CollateralSettlment\" {\n\t\treturn s.CollateralSettlment(APIstub, args)\t\t\n\t} else if function == \"queryFXTradeCollateral\" {\n\t\treturn s.queryFXTradeCollateral(APIstub, args)\t\t\t\t \n // MTM Price Functions\n } else if function == \"createMTMPrice\" {\n\t\treturn s.createMTMPrice(APIstub, args)\n\t} else if function == \"createBondPrice\" {\n\t\treturn s.createBondPrice(APIstub, args)\n\n } else if function == \"queryTables\" { \n\t\treturn s.queryTables(APIstub, args)\n\t} else if function == \"queryTXIDTransactions\" {\n\t\treturn s.queryTXIDTransactions(APIstub, args)\t\n\t} else if function == \"queryTXIDCollateral\" {\n\t\treturn s.queryTXIDCollateral(APIstub, args)\t\t\t\n\t} else if function == \"queryTXKEYTransactions\" {\n\t return s.queryTXKEYTransactions(APIstub, args)\n\t} else if function == \"queryHistoryTXKEYTransactions\" {\n\t return s.queryHistoryTXKEYTransactions(APIstub, args)\n\t} else if function == \"getHistoryForTransaction\" {\n\t return s.getHistoryForTransaction(APIstub, args)\n\t} else if function == \"getHistoryTXIDForTransaction\" {\n\t return s.getHistoryTXIDForTransaction(APIstub, args)\n\t} else if function == \"getHistoryForQueuedTransaction\" {\n\t return s.getHistoryForQueuedTransaction(APIstub, args)\n\t} else if function == \"getHistoryTXIDForQueuedTransaction\" {\n\t return s.getHistoryTXIDForQueuedTransaction(APIstub, args)\n\t} else if function == \"queryAllTransactions\" {\n\t return s.queryAllTransactions(APIstub, args)\n\t} else if function == \"queryAllQueuedTransactions\" {\n\t return s.queryAllQueuedTransactions(APIstub, args)\n\t} else if function == \"queryAllHistoryTransactions\" {\n\t return s.queryAllHistoryTransactions(APIstub, args)\n\t} else if function == \"queryAllTransactionKeys\" {\n\t return s.queryAllTransactionKeys(APIstub, args)\n\t} else if function == \"queryQueuedTransactionStatus\" {\n\t return s.queryQueuedTransactionStatus(APIstub, args)\n\t} else if function == \"queryHistoryTransactionStatus\" {\n\t\treturn s.queryHistoryTransactionStatus(APIstub, args)\n\t} else if function == \"queryMTMTransactionStatus\" {\n\t\treturn s.queryMTMTransactionStatus(APIstub, args)\n\t} else if function == \"queryCollateralTransactionStatus\" {\n\t\treturn s.queryCollateralTransactionStatus(APIstub, args)\t\t\n\t} else if function == \"queryCollateralDetailStatus\" {\n\t\treturn s.queryCollateralDetailStatus(APIstub, args)\t\t\t\n\t} else if function == \"queryDayEndCollateralStatus\" {\n\t\treturn s.queryDayEndCollateralStatus(APIstub, args)\t\t\t\t\t\n\t} else if function == \"queryCptyISDAStatus\" {\n\t\treturn s.queryCptyISDAStatus(APIstub, args)\t\t\n } else if function == \"queryCptyAssetStatus\" {\n\t\treturn s.queryCptyAssetStatus(APIstub, args)\t\n\t} else if function == \"queryCashFlowStatus\" {\n\t\treturn s.queryCashFlowStatus(APIstub, args)\t\t\t\n\t} else if function == \"queryMTMPrice\" {\n\t\treturn s.queryMTMPrice(APIstub, args)\t\t\n\t} else if function == \"queryBondPrice\" {\n\t\treturn s.queryBondPrice(APIstub, args)\t\t\t\n\t} else if function == \"updateQueuedTransactionHcode\" {\n\t return s.updateQueuedTransactionHcode(APIstub, args)\n\t} else if function == \"updateHistoryTransactionHcode\" {\n\t\treturn s.updateHistoryTransactionHcode(APIstub, args)\t\n\t} else if function == \"testEvent\" {\n\t\treturn s.testEvent(APIstub, args)\t\n\t\t\t\n\t} else {\n //map functions\n\t\treturn s.mapFunction(APIstub, function, args)\n\t}\n\n\treturn shim.Error(\"Invalid Smart Contract function name.\")\n}", "title": "" }, { "docid": "bb52e5f2b47d629ac215dd6407409a52", "score": "0.66483545", "text": "func (s *SmartContract) Invoke(APIstub shim.ChaincodeStubInterface) peer.Response {\n\n\t// Retrieve request paramenters\n\tfunction, args := APIstub.GetFunctionAndParameters()\n\n\tlogger.Debug(\"Chaincode Invoke method on function: \" + function)\n\n\tswitch function {\n\tcase \"init\":\n\t\treturn s.Init(APIstub)\n\tcase \"initLedger\":\n\t\treturn s.initLedger(APIstub, args)\n\tcase \"viewMedicalRecord\":\n\t\treturn s.viewMedicalRecord(APIstub, args)\n\tcase \"viewMedicalRecordNoEval\":\n\t\treturn s.viewMedicalRecordNoEval(APIstub, args)\n\tcase \"updateMedicalRecord\":\n\t\treturn s.updateMedicalRecord(APIstub, args)\n\tcase \"updateMedicalRecordNoEval\":\n\t\treturn s.updateMedicalRecordNoEval(APIstub, args)\n\tcase \"getGlobalState\":\n\t\treturn s.getGlobalState(APIstub, args)\n\tcase \"getGlobalStateNoEval\":\n\t\treturn s.getGlobalStateNoEval(APIstub, args)\n\tcase \"addMedicalRecord\":\n\t\treturn s.addMedicalRecord(APIstub, args)\n\tcase \"addMedicalRecordNoEval\":\n\t\treturn s.addMedicalRecordNoEval(APIstub, args)\n\tcase \"updateConsent\":\n\t\treturn s.updateConsent(APIstub, args)\n\tcase \"updateConsentNoEval\":\n\t\treturn s.updateConsentNoEval(APIstub, args)\n\tcase \"trackMedicalRecord\":\n\t\treturn s.trackMedicalRecord(APIstub, args)\n\tcase \"trackMedicalRecordNoEval\":\n\t\treturn s.trackMedicalRecordNoEval(APIstub, args)\n\t}\n\n\treturn shim.Error(\"Invalid request\")\n}", "title": "" }, { "docid": "7ffab2fa424d51049c675db3d60d9e5c", "score": "0.66241354", "text": "func (t *SmartContract) Invoke(stub shim.ChaincodeStubInterface) sc.Response {\n\n\t// Retrieve the requested Smart Contract function and arguments\n\tfunction, args := stub.GetFunctionAndParameters()\n\n\t// Route to the appropriate handler function to interact with the ledger appropriately\n\tif function == \"registerUser\" {\n\t\treturn t.registerUser(stub, args)\n\t} else if function == \"confirmUser\" {\n\t\treturn t.confirmUser(stub, args)\n\t} else if function == \"unConfirmUser\" {\n\t\treturn t.unConfirmUser(stub, args)\n\t} else if function == \"blockUser\" {\n\t\treturn t.blockUser(stub, args)\n\t} else if function == \"unBlockUser\" {\n\t\treturn t.unBlockUser(stub, args)\n\t} else if function == \"queryUser\" {\n\t\treturn t.queryUser(stub, args)\n\t} else if function == \"queryAllUsers\" {\n\t\treturn t.queryAllUsers(stub, args)\n\t} else if function == \"transferMoney\" {\n\t\treturn t.transferMoney(stub, args)\n\t} else if function == \"queryUserBalance\" {\n\t\treturn t.queryUserBalance(stub, args)\n\t} else if function == \"generateMoney\" {\n\t\treturn t.generateMoney(stub, args)\n\t} else if function == \"loginUser\" {\n\t\treturn t.loginUser(stub, args)\n\t} else if function == \"queryActiveUsers\" {\n\t\treturn t.queryActiveUsers(stub, args)\n\t} else if function == \"queryAllLogs\" {\n\t\treturn t.queryAllLogs(stub, args)\n\t} else if function == \"queryActiveDepositAccounts\" {\n\t\treturn t.queryActiveDepositAccounts(stub, args)\n\t} else if function == \"deposit\" {\n\t\treturn t.deposit(stub, args)\n\t} else if function == \"payProfits\" {\n\t\treturn t.payProfits(stub, args)\n\t} else if function == \"calculateProfits\" {\n\t\treturn t.calculateProfits(stub, args)\n\t} else if function == \"queryUserDeposits\" {\n\t\treturn t.queryUserDeposits(stub, args)\n\t}\n\treturn shim.Error(\"Invalid Smart Contract function name.\")\n}", "title": "" }, { "docid": "edbe72002dcfca1ff6f783b2d9feb5e2", "score": "0.65123385", "text": "func (s *SmartContract) Invoke(APIstub shim.ChaincodeStubInterface) sc.Response {\n\n\t// Retrieve the requested Smart Contract function and arguments\n\tfunction, args := APIstub.GetFunctionAndParameters()\n\t// Route to the appropriate handler function to interact with the ledger appropriately\n\tif function == \"queryAnnouncementOnTree\" {\n\t\treturn s.queryAnnouncementOnTree(APIstub, args)\n\t} else if function == \"queryAllTreeAnnouncements\" {\n\t\treturn s.queryAllTreeAnnouncements(APIstub)\n\t} else if function == \"queryAllTreeAnnouncementsAlt\" {\n\t\treturn s.queryAllTreeAnnouncementsAlt(APIstub)\n\t} else if function == \"initLedger\" {\n\t\treturn s.initLedger(APIstub)\n\t} else if function == \"announceVerifiedTreePath\" {\n\t\treturn s.announceVerifiedTreePath(APIstub, args)\n\t} else if function == \"updateVerifiedPath\" {\n\t\treturn s.updateVerifiedPath(APIstub, args)\n\t} else if function == \"registerComplaint\" {\n\t\treturn s.registerComplaint(APIstub, args)\n\t} else if function == \"queryComplaint\" {\n\t\treturn s.queryComplaint(APIstub, args)\n\t}\n\n\treturn shim.Error(\"Invalid Smart Contract function name.\")\n}", "title": "" }, { "docid": "6c9794610f86e2319e5f19706907565a", "score": "0.64972305", "text": "func (s *SmartContract) Invoke(APIstub shim.ChaincodeStubInterface) sc.Response {\n\n\t// Retrieve the requested Smart Contract function and arguments\n\tfunction, args := APIstub.GetFunctionAndParameters()\n\t// Route to the appropriate handler function to interact with the ledger\n\tif function == \"getParkingTime\" {\n\t\treturn s.getParkingTimeC(APIstub, args)\n\t} else if function == \"getParkingTimeC\" {\n\t\treturn s.getParkingTimeC(APIstub, args)\n\t} else if function == \"getParkingTimeK\" {\n\t\treturn s.getParkingTime(APIstub, args)\n\t} else if function == \"save\" { //GENERIC save for debugging\n\t\treturn s.saveCD(APIstub, args)\n\t} else if function == \"saveC\" { //GENERIC save for debugging\n\t\treturn s.saveC(APIstub, args)\n\t} else if function == \"saveCD\" { //GENERIC save for debugging\n\t\treturn s.saveCD(APIstub, args)\n\t} else if function == \"getAll\" {\n\t\treturn s.getAll(APIstub)\n\t\t\n\t} else if function == \"saveParkingtimeOpenTime\" {\n\t\treturn s.saveParkingtimeOpenTime(APIstub, args)\n\t} else if function == \"saveReservation\" {\n\t\treturn s.saveReservation(APIstub, args)\n\t} else if function == \"saveParkingtime\" {\n\t\treturn s.saveParkingtime(APIstub, args)\n\t} else if function == \"getParkingtimesForParkingspot\" {\n\t\treturn s.getParkingtimesForParkingspot(APIstub, args)\n\n\t} else if function == \"findBetweenTime\" {\n\t\treturn s.findBetweenTime(APIstub, args)\n\t} else if function == \"extendParkingTime\" {\n\t\treturn s.extendParkingTime(APIstub, args)\n\t} else if function == \"iextendParkingTime\" {\n\t\treturn s.iextendParkingTime(APIstub, args)\n\t} else if function == \"EndParking\" {\n\t\treturn s.EndParking(APIstub, args)\n\t\t//user\n\t} else if function == \"GetUsers\" {\n\t\treturn s.GetUsers(APIstub, args)\n\t} else if function == \"GetUser\" {\n\t\treturn s.GetUser(APIstub, args)\n\t} else if function == \"SetUser\" {\n\t\treturn s.SetUser(APIstub, args)\n\n\t} else if function == \"findByQuery\" {\n\t\treturn s.findByQuery(APIstub, args)\n\t\n\t//parkingspots\n\t} else if function == \"GetParkingspot\" {\n\t\treturn s.GetParkingspot(APIstub, args)\n\t} else if function == \"GetOwnerParkingspots\" {\n\t\treturn s.GetOwnerParkingspots(APIstub, args)\n\t} else if function == \"FindParkingspotToRent\" {\n\t\treturn s.FindParkingspotToRent(APIstub, args)\n\t} else if function == \"SaveParkingspot\" {\n\t\treturn s.SaveParkingspot(APIstub, args)\n\t\t// return s.ForwardRequestToService(s.SaveParkingspot, APIstub, args)\n\n\t} else if function == \"initLedger\" {\n\t\treturn s.initLedger(APIstub)\n\t}\n\n\treturn shim.Error(fmt.Sprintf(\"Invalid Smart Contract function name: %s\", function))\n}", "title": "" }, { "docid": "3e32bfb3b03bc7dfd215c34d71eb1d1c", "score": "0.6494181", "text": "func (t *SimpleAsset) Invoke(stub shim.ChaincodeStubInterface) peer.Response {\n\t// Extract the function and args from the transaction proposal\n\tfn, args := stub.GetFunctionAndParameters()\n\n\tvar result string\n\tvar err error\n\tresult = fn\n\tif fn == \"download_request\" {\n\t\targs := stub.GetStringArgs()\n\t\t// args = [sender_pk, recipient_pk, amount, deposit_time, recipient_ip, recipient_port]\n\t\tif len(args) != 6 {\n\t\t\treturn shim.Error(\"Incorrect arguments. Expecting [sender_pk, recipient_pk, deposit_amount, deposit_time, recipient_ip, recipient_port]\")\n\t\t}\n\t\tamount, err := strconv.Atoi(args[2])\n\t\tif err != nil || amount < 0 {\n\t\t\treturn shim.Error(\"Invalid amount passed\")\n\t\t}\n\t\tdt, err := time.Parse(\"01/02/2006\", args[3])\n\t\tif err != nil || !dt.After(time.Now()) {\n\t\t\treturn shim.Error(\"Invalid time passed\")\n\t\t}\n\t\tsenderPublicKey := args[0]\n\t\trecipientPublicKey := args[1]\n\t\tcontractKey := ContractKeyPrefix + senderPublicKey + recipientPublicKey\n\t\tds := Party{pubKey: senderPublicKey, IPAddress: SenderIP, Port: SenderPort}\n\t\tdr := Party{pubKey: recipientPublicKey, IPAddress: args[4], Port: args[5]}\n\t\tapdl := APDL{\"download_requested\", ds, dr, dt, amount}\n\t\tinitialAmount := []byte(strconv.Itoa(StartAmount))\n\t\terr = stub.PutState(senderPublicKey, initialAmount)\n\t\terr = stub.PutState(recipientPublicKey, initialAmount)\n\t\tb, err := json.Marshal(apdl)\n\t\terr = stub.PutState(contractKey, b)\n\t\tif err != nil {\n\t\t\treturn shim.Error(\"[-] Failed to process download request transaction. Error!\")\n\t\t}\n\t} else if fn == \"penalty\" {\n\t\tif len(args) != 5 {\n\t\t\treturn shim.Error(\"need to pass recipient sig\")\n\t\t}\n\t\t// args = [message, recipientSig, senderSig, s_pubKey, r_pubKey]\n\t\t// Xsig = \"rStr,sStr\"\n\t\tcontractKey := ContractKeyPrefix + args[3] + args[4]\n\t\tcontract, err := stub.GetState(contractKey)\n\t\tif err != nil {\n\t\t\treturn shim.Error(\"[-] Failed to get contract\")\n\t\t}\n\t\tvar apdl APDL\n\t\tjson.Unmarshal(contract, &apdl)\n\t\t// check if status is active to prevent double penalty.\n\t\tpublicKeys := []string{apdl.SoftwareOwner.pubKey, apdl.SoftwareUser.pubKey}\n\t\tsignatures := []string{args[1], args[2]}\n\t\tif verifySig(args[0], publicKeys, signatures) != true {\n\t\t\treturn shim.Error(\"[-] Signature verification failed. Penalty not applied.\")\n\t\t}\n\t\tvalue, err := stub.GetState(apdl.SoftwareUser.pubKey)\n\t\tbalance, _ := strconv.Atoi(string(value))\n\t\tbalance = balance + apdl.DepositAmount\n\t\tendBalance := []byte(strconv.Itoa(balance))\n\t\tstub.PutState(apdl.SoftwareUser.pubKey, endBalance)\n\t\tapdl.Status = \"penalized\"\n\t\tb, err := json.Marshal(apdl)\n\t\tstub.PutState(contractKey, b)\n\t\tresult = \"[+] Penalty applied\\n\"\n\n\t} else if fn == \"refund\" {\n\t\tif len(args) != 5 {\n\t\t\treturn shim.Error(\"need to pass recipient sig\")\n\t\t}\n\t\t// args = [message, recipientSig, senderSig, r_pubKey, s_pubKey]\n\t\tcontractKey := ContractKeyPrefix + args[3] + args[4]\n\t\tcontract, err := stub.GetState(contractKey)\n\t\tif err != nil {\n\t\t\treturn shim.Error(err.Error())\n\t\t}\n\t\tvar apdl APDL\n\t\tjson.Unmarshal(contract, &apdl)\n\t\tif apdl.Status != \"download_request\" {\n\t\t\treturn shim.Error(\"[-] Invalid status for refund. Current status: \" + apdl.Status)\n\t\t}\n\t\ttnow := time.Now()\n\t\tif tnow.After(apdl.ContractExpiry) {\n\t\t\tapdl.Status = \"expired\"\n\t\t\tb, _ := json.Marshal(apdl)\n\t\t\tstub.PutState(ContractKey, b)\n\t\t\tresult = \"[+] APDL contract expired.\"\n\t\t} else {\n\t\t\treturn shim.Error(\"[-] APDL contract not yet expired\")\n\t\t}\n\t}\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\t// Return the result as success payload\n\treturn shim.Success([]byte(result))\n}", "title": "" }, { "docid": "1ad1949b39c891196e3c6a45169fc591", "score": "0.6492794", "text": "func (_Pausable *PausableTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Pausable.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "70c0f435d9d195e8bdc7ce404304a47b", "score": "0.64925176", "text": "func (s *SmartContract) Invoke(APIstub shim.ChaincodeStubInterface) sc.Response {\n\n\t// Retrieve the requested Smart Contract function and arguments\n\tfunction, args := APIstub.GetFunctionAndParameters()\n\t// Route to the appropriate handler function to interact with the ledger appropriately\n\tif function == \"queryCar\" {\n\t\treturn s.queryCar(APIstub, args)\n\t} else if function == \"initLedger\" {\n\t\treturn s.initLedger(APIstub)\n\t} else if function == \"createCar\" {\n\t\treturn s.createCar(APIstub, args)\n\t} else if function == \"queryAllCars\" {\n\t\treturn s.queryAllCars(APIstub)\n\t} else if function == \"changeCarOwner\" {\n\t\treturn s.changeCarOwner(APIstub, args)\n\t} else if function == \"registerAccount\" {\n\t\treturn s.registerAccount(APIstub, args)\n\t} else if function == \"addManufacturer\" {\n\t\treturn s.addManufacturer(APIstub, args)\n\t} else if function == \"addFactory\" {\n\t\treturn s.addFactory(APIstub, args)\n\t} else if function == \"addProduct\" {\n\t\treturn s.addProduct(APIstub, args)\n\t} else if function == \"updateProductOwner\" {\n\t\treturn s.updateProductOwner(APIstub, args)\n\t} else if function == \"updateAccountOwnerManufacturerID\" {\n\t\treturn s.updateAccountOwnerManufacturerID(APIstub, args)\n\t} else if function == \"updateAccountToken\" {\n\t\treturn s.updateAccountToken(APIstub, args)\n\t} else if function == \"updateAccount\" {\n\t\treturn s.updateAccount(APIstub, args)\n\t} else if function == \"updateManufacturer\" {\n\t\treturn s.updateManufacturer(APIstub, args)\n\t} else if function == \"updateFactory\" {\n\t\treturn s.updateFactory(APIstub, args)\n\t} else if function == \"updateProduct\" {\n\t\treturn s.updateProduct(APIstub, args)\n\t} else if function == \"queryAccountbyToken\" {\n\t\treturn s.queryAccountbyToken(APIstub, args)\n\t} else if function == \"queryAccountbyEmail\" {\n\t\treturn s.queryAccountbyEmail(APIstub, args)\n\t} else if function == \"queryAccountbyUsername\" {\n\t\treturn s.queryAccountbyUsername(APIstub, args)\n\t} else if function == \"queryManufacturerbyAccountID\" {\n\t\treturn s.queryManufacturerbyAccountID(APIstub, args)\n\t} else if function == \"queryManufacturerbyTradeLicenceID\" {\n\t\treturn s.queryManufacturerbyTradeLicenceID(APIstub, args)\n\t} else if function == \"queryFactorybyManufacturerID\" {\n\t\treturn s.queryFactorybyManufacturerID(APIstub, args)\n\t} else if function == \"queryFactorybyID\" {\n\t\treturn s.queryFactorybyID(APIstub, args)\n\t} else if function == \"queryProductbyID\" {\n\t\treturn s.queryProductbyID(APIstub, args)\n\t} else if function == \"queryProductbyCode\" {\n\t\treturn s.queryProductbyCode(APIstub, args)\n\t} else if function == \"queryProductbyOwnerAccountID\" {\n\t\treturn s.queryProductbyOwnerAccountID(APIstub, args)\n\t} else if function == \"queryProductbyManufacturerID\" {\n\t\treturn s.queryProductbyManufacturerID(APIstub, args)\n\t} else if function == \"queryProductbyFactoryID\" {\n\t\treturn s.queryProductbyFactoryID(APIstub, args)\n\t}\n\treturn shim.Error(\"Invalid Smart Contract function name.\")\n}", "title": "" }, { "docid": "1ad1949b39c891196e3c6a45169fc591", "score": "0.64915013", "text": "func (_Pausable *PausableTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Pausable.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "86be0b268c5ce3de2394315496c554d8", "score": "0.64499706", "text": "func (cc *Chaincode) invoke(stub shim.ChaincodeStubInterface, args []string) sc.Response {\n\tvar A, B string // Entities\n\tvar Aval, Bval int // Asset holdings\n\tvar X int // Transaction value\n\tvar err error\n\n\tif len(args) != 3 {\n\t\treturn shim.Error(\"Incorrect number of arguments. Expecting 3\")\n\t}\n\n\tA = args[0]\n\tB = args[1]\n\n\t// Get the state from the ledger\n\t// TODO: will be nice to have a GetAllState call to ledger\n\tAvalbytes, err := stub.GetState(A)\n\tif err != nil {\n\t\treturn shim.Error(\"Failed to get state\")\n\t}\n\tif Avalbytes == nil {\n\t\treturn shim.Error(\"Entity not found\")\n\t}\n\tAval, _ = strconv.Atoi(string(Avalbytes))\n\n\tBvalbytes, err := stub.GetState(B)\n\tif err != nil {\n\t\treturn shim.Error(\"Failed to get state\")\n\t}\n\tif Bvalbytes == nil {\n\t\treturn shim.Error(\"Entity not found\")\n\t}\n\tBval, _ = strconv.Atoi(string(Bvalbytes))\n\n\t// Perform the execution\n\tX, err = strconv.Atoi(args[2])\n\tif err != nil {\n\t\treturn shim.Error(\"Invalid transaction amount, expecting a integer value\")\n\t}\n\tAval = Aval - X\n\tBval = Bval + X\n\tfmt.Printf(\"Aval = %d, Bval = %d\\n\", Aval, Bval)\n\n\t// Write the state back to the ledger\n\terr = stub.PutState(A, []byte(strconv.Itoa(Aval)))\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\n\terr = stub.PutState(B, []byte(strconv.Itoa(Bval)))\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\n\treturn shim.Success(nil)\n}", "title": "" }, { "docid": "ebcff2664bfa48eafa197a205a2780dd", "score": "0.6437658", "text": "func (s *SmartContract) Invoke(APIstub shim.ChaincodeStubInterface) sc.Response {\n\n\t// Retrieve the requested Smart Contract function and arguments\n\tfunction, args := APIstub.GetFunctionAndParameters()\n\t// Route to the appropriate handler function to interact with the ledger\n\tif function == \"initLedger\" {\n\t\treturn s.initLedger(APIstub)\n\t} else if function == \"queryAllGroups\" {\n\t\treturn s.queryAllGroups(APIstub)\n\t} else if function == \"addGroup\" {\n\t\treturn s.addGroup(APIstub, args)\n\t} else if function == \"queryAllStudents\" {\n\t\treturn s.queryAllStudents(APIstub)\n\t} else if function == \"queryTestById\" {\n\t\treturn s.queryTestById(APIstub, args)\n\t} else if function == \"createTestForGroup\" {\n\t\treturn s.createTestForGroup(APIstub, args)\n\t} else if function == \"prepareForExam\" {\n\t\treturn s.prepareForExam(APIstub, args)\n\t} else if function == \"takeTheTest\" {\n\t\treturn s.takeTheTest(APIstub, args)\n\t} else if function == \"addStudent\" {\n\t\treturn s.addStudent(APIstub, args)\n\t} else if function == \"getStudentRecord\" {\n\t\treturn s.getStudentRecord(APIstub, args)\n\t}\n\n\treturn shim.Error(\"Invalid Smart Contract function name.\")\n}", "title": "" }, { "docid": "78ca624f15485732a314cacc7ce18a4b", "score": "0.6431096", "text": "func (s *SmartContract) Invoke(stub shim.ChaincodeStubInterface) sc.Response {\n\n\t// Retrieve the requested Smart Contract function and arguments\n\tfunction, args := stub.GetFunctionAndParameters()\n\tlogger.Info(fmt.Sprintf(\"Starting fulltostackcoin smart contract Invoke for %s and arguments passed are %v\", function, args))\n\n\t// Route to the appropriate handler function to interact with the ledger appropriately\n\tswitch function {\n\tcase \"createWallet\":\n\t\treturn s.createWallet(stub, args)\n\tcase \"getWallet\":\n\t\treturn s.getWallet(stub, args)\n\tcase \"searchWallets\":\n\t\treturn s.searchWallets(stub, args)\n\tcase \"updateWalletMobileHash\":\n\t\treturn s.updateWalletMobileHash(stub, args)\n\tcase \"searchWalletTransactions\":\n\t\treturn s.searchWalletTransactions(stub, args)\n\tcase \"searchTreasureTransactions\":\n\t\treturn s.searchTreasureTransactions(stub, args)\n\tcase \"createTreasure\":\n\t\treturn s.createTreasure(stub, args)\n\tcase \"getTreasure\":\n\t\treturn s.getTreasure(stub, args)\n\tcase \"purchaseCoins\":\n\t\treturn s.purchaseCoins(stub, args)\n\tcase \"spendCoins\":\n\t\treturn s.spendCoins(stub, args)\n\tcase \"setOptions\":\n\t\treturn s.setOptions(stub, args)\n\tcase \"getOptions\":\n\t\treturn s.getOptions(stub, args)\n\tdefault:\n\t\treturn shim.Error(\"Invalid Smart contract function name.\")\n\t}\n}", "title": "" }, { "docid": "bf3616b6efc4bf5304b769b3da4cb605", "score": "0.64152336", "text": "func (_Utilities *UtilitiesTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\r\n\treturn _Utilities.Contract.contract.Transact(opts, method, params...)\r\n}", "title": "" }, { "docid": "30a5ed17c83808ac88ac2e6fbb53ba44", "score": "0.6410333", "text": "func (s *SmartContract) Invoke(APIstub shim.ChaincodeStubInterface) sc.Response {\n\n\t// Retrieve the requested Smart Contract function and arguments\n\tfunction, args := APIstub.GetFunctionAndParameters()\n\t// Route to the appropriate handler function to interact with the ledger appropriately\n\n\tfmt.Println(\"=======================================\")\n\tfmt.Println(\"function name is %s\", function)\n\n\tif function == \"queryPerson\" {\n\t\treturn s.queryPerson(APIstub, args)\n\t} else if function == \"initLedger\" {\n\t\treturn s.initLedger(APIstub)\n\t} else if function == \"createPerson\" {\n\t\treturn s.createPerson(APIstub, args)\n\t} else if function == \"queryPersons\" {\n\t\treturn s.queryPersons(APIstub)\n\t}\n\t// else if function == \"changeCarOwner\" {\n\t// \treturn s.changeCarOwner(APIstub, args)\n\t// }\n\n\treturn shim.Error(\"Invalid Smart Contract function name.\")\n}", "title": "" }, { "docid": "dcf46a0629c9880bb96782ed74d84093", "score": "0.6403716", "text": "func (s *SmartContract) Invoke(APIstub shim.ChaincodeStubInterface) sc.Response {\r\n\r\n\t// Retrieve the requested Smart Contract function and arguments\r\n\tfunction, args := APIstub.GetFunctionAndParameters()\r\n\t// Route to the appropriate handler function to interact with the ledger appropriately\r\n\tif function == \"registerParticipant\" { \t\t // Done - This is to add legitimate users with role in system.\r\n\t\treturn s.registerParticipant(APIstub, args)\r\n\t} else if function == \"addNewContainer\" { \t\t\t// Done - This is for granting a new container to Transporter by Container Supplier.\r\n\t\treturn s.addNewContainer(APIstub, args)\r\n\t} else if function == \"getParticipant\" {\r\n\t\treturn s.getParticipant(APIstub, args)\r\n\t} else if function == \"loadContainerWithPackages\" { \t// Done - This is to support container loading process(only available containers can be loaded).\r\n\t\treturn s.loadContainerWithPackages(APIstub, args)\r\n\t} else if function == \"createCargoLoadContainers\" {\t\t// Done - This is to create a new Cargo and associate loaded containers with it.\r\n\t\treturn s.createCargoLoadContainers(APIstub, args)\r\n\t} else if function == \"updateCargoAttributes\" { \t // Done - This is to support cargo movement and IOT sensor based updates. \r\n\t\treturn s.updateCargoAttributes(APIstub, args)\r\n\t} else if function == \"updateCargoCoordinates\" {\t\t// Done - This is to update cargo and its associated container coordinates (IOT based).\r\n\t\treturn s.updateCargoCoordinates(APIstub, args)\r\n\t} else if function == \"changeCargoCustody\" {\t\t // Done - This is to record cargo ownership changes.\r\n\t\treturn s.changeCargoCustody(APIstub, args)\r\n\t} else if function == \"updateContainerAttributes\" { // Done - This is to support container IOT sensor based updates.\r\n\t\treturn s.updateContainerAttributes(APIstub, args)\r\n\t} else if function == \"changeContainerCustody\" { \t// Done - This is to record container ownership changes.\r\n\t\treturn s.changeContainerCustody(APIstub, args)\r\n\t} else if function == \"unloadContainerFromCargo\" { // Done - This is to support container unloading process.\r\n\t\treturn s.unloadContainerFromCargo(APIstub, args)\r\n\t} else if function == \"traceCargo\" { // Done - This is to trace Cargo\r\n\t\treturn s.traceCargo(APIstub, args)\r\n\t} else if function == \"trackCargoDetails\" {\t\t\t // Done - This is to track Cargo\r\n\t\treturn s.trackCargoDetails(APIstub, args)\r\n\t} else if function == \"traceContainer\" { // Done - This is to trace Container\r\n\t\treturn s.traceContainer(APIstub, args)\r\n\t} else if function == \"trackContainerDetails\" {\t\t\t// Done - This is to track Container\r\n\t\treturn s.trackContainerDetails(APIstub, args)\r\n\t} else if function == \"getLoadedContainers\" {\t\t\t// Done - This is to get all Loaded state Containers\r\n\t\treturn s.getLoadedContainers(APIstub)\r\n\t} else if function == \"getAvilableContainers\" {\t\t\t// Done - This is to get all Available state Containers\r\n\t\treturn s.getAvilableContainers(APIstub)\r\n\t}\r\n\r\n\treturn shim.Error(\"Invalid Smart Contract function name.\")\r\n}", "title": "" }, { "docid": "c05312204d4fb6b7a3e24f6b86a3c82b", "score": "0.640113", "text": "func (t *SmartContract) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\n\tif function == \"init\" {\n\t\treturn t.Init(stub)\n\t}\n\tbcFunc := bcFunctions[function]\n\tif bcFunc == nil {\n\t\treturn shim.Error(\"Invalid invoke function.\")\n\t}\n\treturn bcFunc(stub, args)\n}", "title": "" }, { "docid": "c36aabd0b477009947045011b9f4735c", "score": "0.6396508", "text": "func (_Swapper *SwapperTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Swapper.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "309331f7ef9a623137392b31ac1fce7a", "score": "0.6390234", "text": "func (_DebtEngine *DebtEngineTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _DebtEngine.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "cf3fb8ab9d5bb76ec683f136ecd42d4d", "score": "0.6385157", "text": "func (s *SmartContract) Invoke(APIstub shim.ChaincodeStubInterface) sc.Response {\n\n\t// Retrieve the requested Smart Contract function and arguments\n\tfunction, args := APIstub.GetFunctionAndParameters()\n\t// Route to the appropriate handler function to interact with the ledger\n\tif function == \"queryPoints\" {\n\t\treturn s.queryPoints(APIstub, args)\n\t} else if function == \"initLedger\" {\n\t\treturn s.initLedger(APIstub)\n\t} else if function == \"recordPoints\" {\n\t\treturn s.recordPoints(APIstub, args)\n\t} else if function == \"queryAllPoints\" {\n\t\treturn s.queryAllPoints(APIstub)\n\t} else if function == \"changePointsHolder\" {\n\t\treturn s.changePointsHolder(APIstub, args)\n\t}\n\n\treturn shim.Error(\"Invalid Smart Contract function name.\")\n}", "title": "" }, { "docid": "43f1a9972029a5abcc6b2d5fae5281a2", "score": "0.63802165", "text": "func (_DOSProxyInterface *DOSProxyInterfaceTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _DOSProxyInterface.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "8321a3ae10c680752299957c46b51cf6", "score": "0.63797677", "text": "func (_Main *MainTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Main.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "67a5e342aa9111a332d1d4ea0c6a374a", "score": "0.6374486", "text": "func (_MyContract *MyContractTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _MyContract.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "8af7d590abb198e830185c966a8cbc56", "score": "0.63742745", "text": "func (_MyContract *MyContractRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _MyContract.Contract.MyContractTransactor.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "b736d1d2884f168439c6916d1131a953", "score": "0.63721263", "text": "func (_Console *ConsoleTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Console.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "5b949ab4022becebad2d9b647ddbc248", "score": "0.63695866", "text": "func (_ERC20Pausable *ERC20PausableTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _ERC20Pausable.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "8fd6d96a2ab071aa87a7bfc29a02120d", "score": "0.6356726", "text": "func (s *SmartContract) Invoke(APIstub shim.ChaincodeStubInterface) sc.Response {\n\n // Retrieve the requested Smart Contract function and arguments\n function, args := APIstub.GetFunctionAndParameters()\n // Route to the appropriate handler function to interact with the ledger\n if function == \"queryTuna\" {\n return s.queryTuna(APIstub, args)\n } else if function == \"initLedger\" {\n return s.initLedger(APIstub)\n } else if function == \"recordTuna\" {\n return s.recordTuna(APIstub, args)\n } else if function == \"queryAllTuna\" {\n return s.queryAllTuna(APIstub)\n } else if function == \"changeTunaHolder\" {\n return s.changeTunaHolder(APIstub, args)\n }\n\n return shim.Error(\"Invalid Smart Contract function name.\")\n}", "title": "" }, { "docid": "5c4f46717f227efe91844adcf1401d0d", "score": "0.6354536", "text": "func (_VaultHelper *VaultHelperTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _VaultHelper.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "8d9a9c06c189572cbfd388aa1067cdee", "score": "0.63530004", "text": "func (_ArbVMContractProxy *ArbVMContractProxyRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _ArbVMContractProxy.Contract.ArbVMContractProxyTransactor.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "7700c21375b7c32ca2717784390ed6ef", "score": "0.6351093", "text": "func (_Pausable *PausableRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Pausable.Contract.PausableTransactor.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "7700c21375b7c32ca2717784390ed6ef", "score": "0.63504267", "text": "func (_Pausable *PausableRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Pausable.Contract.PausableTransactor.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "5d55e14c1511aee3839555cdbd690599", "score": "0.6346104", "text": "func (_ArbVMContractProxy *ArbVMContractProxyTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _ArbVMContractProxy.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "a41109ccf356235d0d72eaa3b819a8e9", "score": "0.6345353", "text": "func (_VM *VMTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _VM.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "a41109ccf356235d0d72eaa3b819a8e9", "score": "0.6345353", "text": "func (_VM *VMTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _VM.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "4cd67cea96f8a195e7d5bcb6cffc3f67", "score": "0.63453203", "text": "func (_Vesting *VestingTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Vesting.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "fbecd902c5468a1d129dc34756cb2e8e", "score": "0.6334031", "text": "func (_Initializable *InitializableTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Initializable.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "24aa9eabb0cd9c80a874e4d31d75e7a7", "score": "0.63299704", "text": "func (s *SmartContract) Invoke(APIstub shim.ChaincodeStubInterface) sc.Response {\n\n\t// Retrieve the requested Smart Contract function and arguments\n\tfunction, args := APIstub.GetFunctionAndParameters()\n\t// Route to the appropriate handler function to interact with the ledger\n\tif function == \"queryWine\" {\n\t\treturn s.queryWine(APIstub, args)\n\t} else if function == \"initLedger\" {\n\t\treturn s.initLedger(APIstub)\n\t} else if function == \"recordWine\" {\n\t\treturn s.recordWine(APIstub, args)\n\t} else if function == \"queryAllWine\" {\n\t\treturn s.queryAllWine(APIstub)\n\t} else if function == \"changedByVinery\" {\n\t\treturn s.changedByVinery(APIstub, args)\n\t}else if function == \"changedByBottler\" {\n\t\treturn s.changedByBottler(APIstub, args)\n\t}\n\n\treturn shim.Error(\"Invalid Smart Contract function name.\")\n}", "title": "" }, { "docid": "0bc51d891c7a86e7552c0268f811075a", "score": "0.63290316", "text": "func (s *SmartContract) Invoke(APIstub shim.ChaincodeStubInterface) peer.Response {\n\n\t// Retrieve the requested Smart Contract function and arguments\n\tfunction, args := APIstub.GetFunctionAndParameters()\n\t// Route to the appropriate handler function to interact with the ledger appropriately\n\tif function == \"queryBond\" {\n\t\treturn s.queryBond(APIstub, args)\n\t} else if function == \"initLedger\" {\n\t\treturn s.initLedger(APIstub)\n\t} else if function == \"createBond\" {\n\t\treturn s.createBond(APIstub, args)\n\t} else if function == \"queryAllBonds\" {\n\t\treturn s.queryAllBonds(APIstub)\n\t} else if function == \"changeBondOwner\" {\n\t\treturn s.changeBondOwner(APIstub, args)\n\t}\n\n\treturn shim.Error(\"Invalid Smart Contract function name.\")\n}", "title": "" }, { "docid": "dd5dc3ff7adefa0cf201c9ea569a7ffd", "score": "0.63252026", "text": "func (t *SimpleTrans) newTrans(stub shim.ChaincodeStubInterface,args []string) pb.Response {\r\n var sender, receiver string // Entities\r\n var senderVal, receiverVal float64 // Asset holdings\r\n var amount, forex float64 // Transaction value\r\n var err error\r\n\r\n if len(args) != 6 {\r\n return shim.Error(\"Expecting 6 arguments\")\r\n }\r\n sender = args[0]\r\n receiver = args[1]\r\n // sender_currency = strings.ToUpper(args[2])\r\n // receiver_currency = strings.ToUpper(args[3])\r\n forex, err = strconv.ParseFloat(args[5], 64)\r\n\r\n // Get the state from the ledger\r\n senderAsBytes, err := stub.GetState(sender)\r\n if err != nil {\r\n return shim.Error(\"Failed to get state of senderUser\")\r\n }\r\n if senderAsBytes == nil {\r\n return shim.Error(\"Entity not found\")\r\n }\r\n senderUser := User{}\r\n json.Unmarshal(senderAsBytes, &senderUser)\r\n senderVal = senderUser.AUD\r\n if senderVal < amount{\r\n return shim.Error(\"You do not have sufficent Balance\")\r\n }\r\n receiverAsBytes, err := stub.GetState(receiver)\r\n if err != nil {\r\n return shim.Error(\"Failed to get state of receiverUser\")\r\n }\r\n if receiverAsBytes == nil {\r\n return shim.Error(\"Entity not found\")\r\n }\r\n receiverUser := User{}\r\n json.Unmarshal(receiverAsBytes, &receiverUser)\r\n receiverVal = receiverUser.INR\r\n\r\n // Perform the execution\r\n amount, err = strconv.ParseFloat(args[4], 64)\r\n if err != nil {\r\n return shim.Error(\"Invalid transaction amount, expecting a Float value\")\r\n }\r\n senderVal = senderVal - amount\r\n receiverVal = receiverVal + amount*forex\r\n fmt.Printf(\"senderVal = %d, receiverVal = %d\\n\", senderVal, receiverVal)\r\n\r\n // Write the state back to the ledger\r\n senderUser.AUD = senderVal\r\n senderAsBytes, _ = json.Marshal(senderUser)\r\n err = stub.PutState(sender, senderAsBytes)\r\n if err != nil {\r\n return shim.Error(err.Error())\r\n }\r\n receiverUser.INR = receiverVal\r\n receiverAsBytes, _ = json.Marshal(receiverUser)\r\n err = stub.PutState(receiver, receiverAsBytes)\r\n if err != nil {\r\n return shim.Error(err.Error())\r\n }\r\n\r\n //update daala ledger of sushmit\r\n daalaAudAsBytes, err := stub.GetState(\"sushmit@sgit.io\")\r\n daalaAudUser := User{}\r\n json.Unmarshal(daalaAudAsBytes, &daalaAudUser)\r\n audVal := daalaAudUser.AUD\r\n audVal = audVal + amount\r\n dtxVal := daalaAudUser.DTX\r\n dtxVal -= amount //1 DTX = 1 AUD\r\n daalaAudUser.DTX = dtxVal\r\n daalaAudUser.AUD = audVal\r\n daalaAudAsBytes, _ = json.Marshal(daalaAudUser)\r\n err = stub.PutState(\"sushmit@sgit.io\", daalaAudAsBytes)\r\n if err != nil {\r\n return shim.Error(err.Error())\r\n }\r\n\r\n //update daala ledger of nitin\r\n daalaInrAsBytes, err := stub.GetState(\"nitin@sgit.io\")\r\n daalaInrUser := User{}\r\n json.Unmarshal(daalaInrAsBytes, &daalaInrUser)\r\n inrVal := daalaInrUser.INR\r\n inrVal = inrVal - amount*forex\r\n dtxVal = daalaInrUser.DTX\r\n dtxVal = dtxVal + amount //1 DTX = 1 AUD\r\n daalaInrUser.DTX = dtxVal\r\n daalaInrUser.INR = inrVal\r\n daalaInrAsBytes, _ = json.Marshal(daalaInrUser)\r\n err = stub.PutState(\"nitin@sgit.io\", daalaInrAsBytes)\r\n if err != nil {\r\n return shim.Error(err.Error())\r\n }\r\n\r\n // write final transation ledger\r\n // id := make([]byte, 16)\r\n // n, err := io.ReadFull(rand.Reader, id)\r\n // if n != len(id) || err != nil {\r\n // return shim.Error(err.Error())\r\n // }\r\n // timestamp := time.Now()\r\n // uuid := fmt.Sprintf(\"%s\", id)\r\n // var transation = Transaction{Id: uuid, Sender:sender, Receiver: receiver, Sender_currency: sender_currency, Receiver_currency: receiver_currency, Timestamp: timestamp.String(), Forex: forex, Balance:amount}\r\n\r\n // // Recording data to the ledger\r\n // transationAsBytes, _ := json.Marshal(transation)\r\n // err = stub.PutState(sender, transationAsBytes)\r\n // if err != nil {\r\n // return shim.Error(fmt.Sprintf(\"Failed to create new transation: %s\", args[0]))\r\n // }\r\n\r\n return shim.Success(nil)\r\n\r\n\r\n}", "title": "" }, { "docid": "894d0be661debb6442be706aae7d0cf3", "score": "0.6315959", "text": "func (_Poolbindings *PoolbindingsTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Poolbindings.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "38a389cdba68bb257fc11dea4f4de0f7", "score": "0.63155645", "text": "func (s *SmartContract) Invoke(APIstub shim.ChaincodeStubInterface) sc.Response {\n\n\t// Retrieve the requested Smart Contract function and arguments\n\tfunction, args := APIstub.GetFunctionAndParameters()\n\t// Route to the appropriate handler function to interact with the ledger\n\tif function == \"query\" {\n\t\treturn s.query(APIstub, args)\n\t} else if function == \"insertCarbon\" {\n\t\treturn s.insertCarbon(APIstub, args)\n\t} else if function == \"queryAllCarbonPollution\" {\n\t\treturn s.queryAllCarbonPollution(APIstub, args)\n\t} else if function == \"initLedger\" {\n\t\treturn s.initLedger(APIstub)\n\t}\n\n\treturn shim.Error(\"Invalid Smart Contract function name.\")\n}", "title": "" }, { "docid": "c20c26ec613691ca90dc2688c103e86c", "score": "0.6309778", "text": "func (s *SmartContract) Invoke(stub shim.ChaincodeStubInterface) peer.Response {\n \n fn, args := stub.GetFunctionAndParameters()\n\n if fn == \"AddComponent\" {\n\n\t\treturn s.AddComponent(stub, args)\n\n\t} else if fn == \"TransferComponent\" {\n\n\t\treturn s.TransferComponent(stub, args)\n\n\t} else if fn == \"MountComponent\" {\n\n\t\treturn s.MountComponent(stub, args)\n\n\t} else if fn == \"ReplaceComponent\" {\n\n\t\treturn s.ReplaceComponent(stub, args)\n\n\t} else if fn == \"RecallComponent\" {\n\n\t\treturn s.RecallComponent(stub, args)\n\n\t} else if fn == \"InitLedger\" {\n\n return s.InitLedger(stub)\n\n } else if fn == \"CreateCar\" {\n\n return s.CreateCar(stub, args)\n\n } else if fn == \"QueryCar\" {\n\n return s.QueryCar(stub, args)\n\n } else if fn == \"QueryComponent\" {\n\n return s.QueryComponent(stub, args)\n }\n\n return shim.Error(\"Invalid Smart Contract function name.\")\n \n}", "title": "" }, { "docid": "a1844c2abb27515a32b9b00c92af7772", "score": "0.6308127", "text": "func (_StakingContract *StakingContractRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _StakingContract.Contract.StakingContractTransactor.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "837617e433238415d54aaca0f913ba59", "score": "0.6304052", "text": "func (_StakingContract *StakingContractTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _StakingContract.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "b73234579c50bd09448b2fb869d43495", "score": "0.63027894", "text": "func (s *SmartContract) Invoke(APIstub shim.ChaincodeStubInterface) sc.Response {\n\t_, args := APIstub.GetFunctionAndParameters()\n\n\t// Route to the appropriate handler function to interact with the ledger appropriately\n\tif args[0] == \"addProduct\" {\n\t\treturn s.addProduct(APIstub, args)\n\t}else if args[0] == \"addProductItem\" {\n\t\treturn s.addProductItem(APIstub, args)\n\t}else if args[0] == \"actionToProduct\" {\n\t\treturn s.actionToProduct(APIstub, args)\n\t} else if args[0] == \"getProductDetails\" {\n\t\treturn s.getProductDetails(APIstub, args)\n\t}else if args[0] == \"getProductList\" {\n\t\treturn s.getProductList(APIstub, args)\n\t}else if args[0] == \"getProductsByMID\" {\n\t\treturn s.getProductsByMID(APIstub, args)\n\t}else if args[0] == \"changeStatus\" {\n\t\treturn s.changeStatus(APIstub, args)\n\t}else if args[0] == \"addUser\" {\n\t\treturn s.addUser(APIstub, args)\n\t}else if args[0] == \"getUsersByRole\" {\n\t\treturn s.getUsersByRole(APIstub, args)\n\t}else if args[0] == \"changeStatusOrShippingDetails\" {\n\t\treturn s.changeStatusOrShippingDetails(APIstub, args)\n\t}else if args[0] == \"getStatusOrShippingDetails\" {\n\t\treturn s.getStatusOrShippingDetails(APIstub, args)\n\t}else if args[0] == \"getItemsByMID\" {\n\t\treturn s.getItemsByMID(APIstub, args)\n\t}else if args[0] == \"addSubUsers\" {\n\t\treturn s.addSubUsers(APIstub, args)\n\t}else if args[0] == \"getSubUsersById\" {\n\t\treturn s.getSubUsersById(APIstub, args)\n\t}\n\n\treturn shim.Error(\"Invalid Smart Contract function name.\")\n}", "title": "" }, { "docid": "01ecf150b64ec27daaa0dc3c0e6d2db8", "score": "0.6299727", "text": "func (_Utils *UtilsTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Utils.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "01ecf150b64ec27daaa0dc3c0e6d2db8", "score": "0.6299727", "text": "func (_Utils *UtilsTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Utils.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "01ecf150b64ec27daaa0dc3c0e6d2db8", "score": "0.6299727", "text": "func (_Utils *UtilsTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Utils.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "f50675f561ba7661bbd995a0abf9e397", "score": "0.62991405", "text": "func (s *SmartContract) Invoke(APIstub shim.ChaincodeStubInterface) sc.Response {\n\n\tfunction, args := APIstub.GetFunctionAndParameters()\n\n\tlogger.Infof(\"Function name is: %d\", function)\n\tlogger.Infof(\"Args length is : %d\", len(args))\n\n\tswitch function {\n\tcase \"createPolicy\":\n\t\treturn s.createPolicy(APIstub, args)\n\tcase \"queryPolicy\":\n\t\treturn s.queryPolicy(APIstub, args)\n\tcase \"queryPolicyHistory\":\n\t\treturn s.getHistoryForAsset(APIstub, args)\n\tcase \"addRule\":\n\t\treturn s.addRule(APIstub, args)\t\n\t}\n\t\n\treturn shim.Error(\"Invoke Function Not Success.\")\n\n}", "title": "" }, { "docid": "cd84d0d56c324a59eca270999d42c101", "score": "0.6295044", "text": "func (t *SimpleChaincode) Invoke(APIstub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := APIstub.GetFunctionAndParameters()\n\tif function == \"create\" {\n\t\treturn t.create(APIstub, args)\n\t} else if function == \"enroll\" {\n\t\treturn t.enroll(APIstub, args)\n\t} else if function == \"vote\" {\n\t\treturn t.vote(APIstub, args)\n\t} else if function == \"query\" {\n\t\treturn t.query(APIstub, args)\n\t}\n\n\treturn shim.Error(\"Invalid Smart Contract function name. Expecting \\\"create\\\" \\\"enroll\\\" \\\"vote\\\"\")\n}", "title": "" }, { "docid": "19c3702185caae60068cf43cc4c1afa1", "score": "0.6290681", "text": "func (_NonProfit *NonProfitTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _NonProfit.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "ca725b886c87be4367cb16ea356c41bc", "score": "0.6285507", "text": "func (_Produce *ProduceTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Produce.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "2638d55bbc24832c6e9a7a964eff3489", "score": "0.6285025", "text": "func (s *SmartContract) Invoke(APIstub shim.ChaincodeStubInterface) sc.Response {\n\n\t// Retrieve the requested Smart Contract function and arguments\n\tfunction, args := APIstub.GetFunctionAndParameters()\n\t// Route to the appropriate handler function to interact with the ledger appropriately\n\tif function == \"queryLPN\" {\n\t\treturn s.queryLPN(APIstub, args)\n\t} else if function == \"initLedger\" {\n\t\treturn s.initLedger(APIstub)\n\t} else if function == \"createLPN\" {\n\t\treturn s.createLPN(APIstub, args)\n\t} else if function == \"queryAllLPNs\" {\n\t\treturn s.queryAllLPNs(APIstub)\n\t} else if function == \"changeLPNExpiry\" {\n\t\treturn s.changeLPNExpiry(APIstub, args)\n\t}\n\n\treturn shim.Error(\"Invalid Smart Contract function name.\")\n}", "title": "" }, { "docid": "b0d2114ce1dcaaac7152f771ac463f1a", "score": "0.62849003", "text": "func (_NonProfit *NonProfitRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _NonProfit.Contract.NonProfitTransactor.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "5ba52e7fbcc9bb8cc483e63937c47238", "score": "0.62812847", "text": "func (s *SmartContract) Invoke(APIstub shim.ChaincodeStubInterface) sc.Response {\n\n\t// Retrieve the requested Smart Contract function and arguments\n\tfunction, args := APIstub.GetFunctionAndParameters()\n\t// Route to the appropriate handler function to interact with the ledger\n\tif function == \"initClientLedger\" {\n\t\treturn s.initClientLedger(APIstub)\n\t} else if function == \"queryAllClients\" {\n\t\treturn s.queryAllClients(APIstub)\n\t} else if function == \"queryClient\" {\n\t\treturn s.queryClient(APIstub, args)\n\t} else if function == \"addClient\" {\n\t\treturn s.addClient(APIstub, args)\n\t} else if function == \"updateClient\" {\n\t\treturn s.updateClient(APIstub, args)\n\t} else if function == \"removeClient\" {\n\t\treturn s.removeClient(APIstub, args)\n\t} else if function == \"clientHistory\" {\n\t\treturn s.clientHistory(APIstub, args)\n\t} else if function == \"queryClientsByRange\" {\n \treturn s.queryClientsByRange(APIstub, args)\n\t}\n\n\treturn shim.Error(\"Invalid Smart Contract function name.\")\n}", "title": "" }, { "docid": "2f63905c2ff4fb613202eb2a57ec195e", "score": "0.62804914", "text": "func (s *SmartContract) Invoke(APIstub shim.ChaincodeStubInterface) sc.Response {\n\n\t// Retrieve the requested Smart Contract function and arguments\n\tfunction, args := APIstub.GetFunctionAndParameters()\n\t// Route to the appropriate handler function to interact with the ledger appropriately\n\tif function == \"queryDonation\" {\n\t\treturn s.queryDonation(APIstub, args)\n\t} else if function == \"initLedger\" {\n\t\treturn s.initLedger(APIstub)\n\t} else if function == \"createDonation\" {\n\t\treturn s.createDonation(APIstub, args)\n\t} else if function == \"queryAllDonations\" {\n\t\treturn s.queryAllDonations(APIstub)\n\t} else if function == \"totalDonationAmount\" {\n\t\treturn s.totalDonationAmount(APIstub)\n\t}\n\n\treturn shim.Error(\"Invalid Smart Contract function name.\")\n}", "title": "" }, { "docid": "159bed855c1b09e510faa823e0d39987", "score": "0.6279942", "text": "func (_SushiStaking *SushiStakingTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _SushiStaking.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "0f142306d0b41e0eac0df2f4e957dd5c", "score": "0.62796336", "text": "func (_Holder *HolderTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Holder.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "332639288899660bbbc429427a82a25a", "score": "0.6278749", "text": "func (_Bindings *BindingsTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Bindings.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "7f21c8fe0e41d4178dc1ef7df2286175", "score": "0.62771827", "text": "func (_Ownable *OwnableTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Ownable.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "7f21c8fe0e41d4178dc1ef7df2286175", "score": "0.627698", "text": "func (_Ownable *OwnableTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Ownable.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "7f21c8fe0e41d4178dc1ef7df2286175", "score": "0.627698", "text": "func (_Ownable *OwnableTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Ownable.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "7f21c8fe0e41d4178dc1ef7df2286175", "score": "0.627698", "text": "func (_Ownable *OwnableTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Ownable.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "7f21c8fe0e41d4178dc1ef7df2286175", "score": "0.627698", "text": "func (_Ownable *OwnableTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Ownable.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "1443375238e7638ce43e25b51ec8fec4", "score": "0.6274721", "text": "func (s *SmartContract) Invoke(APIstub shim.ChaincodeStubInterface) sc.Response {\r\n\t// Retrieve the requested Smart Contract function and arguments\r\n\tfunction, args := APIstub.GetFunctionAndParameters()\r\n\t// Route to the appropriate handler function to interact with the ledger appropriately\r\n\tif function == \"initLedger\" {\r\n\t\treturn s.initLedger(APIstub)\r\n\t} else if function == \"queryPaper\" {\r\n\t\treturn s.queryPaper(APIstub, args)\r\n\t}\r\n\treturn shim.Error(\"Invalid Smart Contract function name.\")\r\n}", "title": "" }, { "docid": "da0b8693ae6111b72eddc6faf4e5412e", "score": "0.6274302", "text": "func (s *SmartContract) Invoke(APIstub shim.ChaincodeStubInterface) sc.Response {\n \n\t // Retrieve the requested Smart Contract function and arguments\n\t function, args := APIstub.GetFunctionAndParameters()\n\t // Route to the appropriate handler function to interact with the ledger appropriately\n\t if function == \"showSingleMaintenance\" {\n\t\t return s.showSingleMaintenance(APIstub, args)\n\t } else if function == \"initLedger\" {\n\t\t return s.initLedger(APIstub)\n\t } else if function == \"createNewMaintenance\" {\n\t\t return s.createNewMaintenance(APIstub, args)\n\t } else if function == \"showAllHvacMaintenance\" {\n\t\t return s.showAllHvacMaintenance(APIstub)\n\t } else if function == \"filterByInstallerID\" {\n\t\treturn s.filterByInstallerID(APIstub, args)\n\t }else if function == \"filterByInstallDates\" {\n\t\t return s.filterByInstallDates(APIstub, args)\n\t }else if function == \"filterByMaintenanceDate\"{\n\t\t return s.filterByMaintenanceDate(APIstub, args)\n\t }else if function == \"filterByBuildingId\"{\n\t\t return s.filterByBuildingId(APIstub, args)\n\t } \n \n\t return shim.Error(\"Invalid Smart Contract function name.\")\n }", "title": "" }, { "docid": "71b52082d1a13c303a8df75db17597b7", "score": "0.62713015", "text": "func (_DOSOnChainSDK *DOSOnChainSDKTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _DOSOnChainSDK.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "ab0cce8e117729189a460c84addfc4db", "score": "0.6270167", "text": "func (_Vault *VaultTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Vault.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "ab0cce8e117729189a460c84addfc4db", "score": "0.6270167", "text": "func (_Vault *VaultTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Vault.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "f2d6b3652f2e9de44dac49e2e9f4685d", "score": "0.62700665", "text": "func (_Orders *OrdersTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Orders.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "bbeea47a119fbf3d6472567d016dd0ee", "score": "0.6269209", "text": "func (_Contract *ContractRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Contract.Contract.ContractTransactor.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "bbeea47a119fbf3d6472567d016dd0ee", "score": "0.6269209", "text": "func (_Contract *ContractRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Contract.Contract.ContractTransactor.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "bbeea47a119fbf3d6472567d016dd0ee", "score": "0.6269209", "text": "func (_Contract *ContractRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Contract.Contract.ContractTransactor.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "41c315a8a74b1132c481878729a3c1df", "score": "0.62671936", "text": "func (a *AccountBalance) Invoke(APIstub shim.ChaincodeStubInterface) peer.Response {\n \n\t // Retrieve the requested Smart Contract function and arguments\n\t function, args := APIstub.GetFunctionAndParameters()\n \n\t var result string\n\t var err error\n \n\t // Route to the appropriate handler function to interact with the ledger appropriately\n\t if function == \"getVoucher\" {\n\t\t result, err = getVoucher(APIstub, args)\n\t } else {\n\t\t return shim.Error(\"Invalid Smart Contract function name.\")\n\t }\n\t \n\t if err != nil {\n\t\t return shim.Error(err.Error())\n\t }\n \n\t // Return the result as success payload\n\t return shim.Success([]byte(result))\n }", "title": "" }, { "docid": "907def87b740ee7a0ae6119af2f34cf1", "score": "0.62670684", "text": "func (_TestABI *TestABITransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _TestABI.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "be654f1a25b05116ec11975668a94a47", "score": "0.62645185", "text": "func (_Main *MainRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Main.Contract.MainTransactor.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "db71ddfd3726c1d0651fffc2e34e3b76", "score": "0.62619436", "text": "func (_SloadCall *SloadCallTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _SloadCall.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "04e3994bdc0b20e16aebba44650a16d0", "score": "0.62603813", "text": "func (_VRFConsumer *VRFConsumerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _VRFConsumer.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "258b9a40478e20d15cbba74528cc659d", "score": "0.6257712", "text": "func (_AskMeAnything *AskMeAnythingTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _AskMeAnything.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "bdd0364f19a11d5d5df3c6a556e87021", "score": "0.6254192", "text": "func (s *SmartContract) Invoke(APIstub shim.ChaincodeStubInterface) sc.Response {\n\n\t// Retrieve the requested Smart Contract function and arguments\n\tfunction, args := APIstub.GetFunctionAndParameters()\n\t// Route to the appropriate handler function to interact with the ledger appropriately\n\tif function == \"createAsset\" {\n\t\treturn s.createAsset(APIstub, args)\n\t} else if function == \"initLedger\" {\n\t\treturn s.initLedger(APIstub)\n\t} else if function == \"changeAssetOwner\" {\n\t\treturn s.changeAssetOwner(APIstub, args)\n\t} else if function == \"getItemHistory\"{\n\t\treturn s.getItemHistory(APIstub, args)\n\t}\n\n\treturn shim.Error(\"Invalid Smart Contract function name.\")\n}", "title": "" }, { "docid": "2976b138f60809b423762b472d6444f2", "score": "0.62504023", "text": "func (s *SmartContract) Invoke(APIstub shim.ChaincodeStubInterface) sc.Response {\n\n\t// Retrieve the requested Smart Contract function and arguments\n\tfunction, args := APIstub.GetFunctionAndParameters()\n\t// Route to the appropriate handler function to interact with the ledger\n\tif function == \"querySeat\" {\n\t\treturn s.querySeat(APIstub, args)\n\t} else if function == \"initLedger\" {\n\t\treturn s.initLedger(APIstub)\n\t} else if function == \"recordSeat\" {\n\t\treturn s.recordSeat(APIstub, args)\n\t} else if function == \"queryAllSeat\" {\n\t\treturn s.queryAllSeat(APIstub)\n\t} else if function == \"changeSeatHolder\" {\n\t\treturn s.changeSeatHolder(APIstub, args)\n\t}\n\n\treturn shim.Error(\"Invalid Function\")\n}", "title": "" }, { "docid": "b6820d91e23ef7b5571f8b4e7b190cfd", "score": "0.62458956", "text": "func (_Flapper *FlapperTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Flapper.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "3ee5b22e36776f9ae02f77b56e92efca", "score": "0.6245244", "text": "func (_ContractsContract *ContractsContractRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _ContractsContract.Contract.ContractsContractTransactor.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "e0348ef03015b6d2a90c3c929df49abb", "score": "0.62389654", "text": "func (_Contract *ContractTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Contract.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "e0348ef03015b6d2a90c3c929df49abb", "score": "0.62389654", "text": "func (_Contract *ContractTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Contract.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "e0348ef03015b6d2a90c3c929df49abb", "score": "0.62389654", "text": "func (_Contract *ContractTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Contract.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "c011b35e75737575e39c79e60d0b6db7", "score": "0.62375414", "text": "func (_ZapLibrary *ZapLibraryTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\r\n\treturn _ZapLibrary.Contract.contract.Transact(opts, method, params...)\r\n}", "title": "" }, { "docid": "e4b62a2d1792701c26dab5f244d2d620", "score": "0.622557", "text": "func (t *SimpleAsset) Invoke(stub shim.ChaincodeStubInterface) peer.Response {\n\n\t// Extract the function and args from the transaction proposal\n fn, args := stub.GetFunctionAndParameters()\n switch fn {\n\t\tcase \"transfer\": \n return t.transfer(stub, args)\n\n\t\tcase \"withdraw\": \n return t.withdraw(stub, args)\n\n\t\tcase \"deposit\": \n return t.deposit(stub, args)\n\n\t\tcase \"getBalance\": \n return t.getBalance(stub, args)\n\n case \"createClient\": \n return t.createClient(stub, args)\n\n case \"addStocks\": \n return t.AddStocks(stub, args)\n\n case \"removeStocks\": \n return t.RemoveStocks(stub, args)\n\n case \"buyStocks\": \n return t.buyStocks(stub, args)\n\n case \"sellStocks\": \n return t.sellStocks(stub, args)\n \n case \"queryClientLogs\":\n return t.QueryClientLogs(stub,args)\n \n case \"queryuserList\":\n return t.QueryuserList(stub,args) \n \n\t}\n\n\t//return shim.Error(\"Unknown action, check the first argument\")\n\treturn shim.Error(fn)\n}", "title": "" }, { "docid": "0e61225b383a948aca46f59db124edd0", "score": "0.6224222", "text": "func (_App *AppTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _App.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "a72ae579a545dccd79e61bc188d8bcc3", "score": "0.6222442", "text": "func (_Factory *FactoryTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Factory.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "cdbf340a2d8312d2aa57b9071d240eca", "score": "0.6214333", "text": "func (_DOSOnChainSDK *DOSOnChainSDKRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _DOSOnChainSDK.Contract.DOSOnChainSDKTransactor.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "7cfba72d4d3f462988b1234c2ee79895", "score": "0.62134665", "text": "func (_IChallengeFactory *IChallengeFactoryTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _IChallengeFactory.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "4e47a4d1a074423bf6ce4fa1f7d93a3a", "score": "0.6213433", "text": "func (_AastraVault *AastraVaultTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _AastraVault.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "824328a1918b4f7eadbb1509d929afbd", "score": "0.62119013", "text": "func (_Adjudicator *AdjudicatorTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Adjudicator.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "41100653eac62455b8e4c0fd3feb5bff", "score": "0.6209939", "text": "func (_Value *ValueTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Value.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "74ad95bad87391acf1016bd1702f2b5b", "score": "0.6205637", "text": "func (_ContractsContract *ContractsContractTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _ContractsContract.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "7818049794de153696c5ed6367520e17", "score": "0.62053496", "text": "func (_AskMeAnything *AskMeAnythingRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _AskMeAnything.Contract.AskMeAnythingTransactor.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "25c1a033b75d49e0f1326aaf12514c1e", "score": "0.62027526", "text": "func (_Staking *StakingTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Staking.Contract.contract.Transact(opts, method, params...)\n}", "title": "" }, { "docid": "25c1a033b75d49e0f1326aaf12514c1e", "score": "0.62027526", "text": "func (_Staking *StakingTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {\n\treturn _Staking.Contract.contract.Transact(opts, method, params...)\n}", "title": "" } ]
57ce97a0de34502a437ccf94317cef7d
TestNvim sets XDG tmpdir and return the nvim.Nvim for unit testing.
[ { "docid": "5a4ce37dee4419e5d151d22a0480c445", "score": "0.7658927", "text": "func TestNvim(t *testing.T, file ...string) *nvim.Nvim {\n\ttmpDir := filepath.Join(os.TempDir(), \"nvim-go-test\")\n\tdefer os.RemoveAll(tmpDir)\n\n\tif err := setXDGEnv(tmpDir); err != nil {\n\t\tt.Fatalf(\"couldn't setup XDG directories: %v\", err)\n\t}\n\n\t// Disable debug log output\n\tos.Setenv(\"NVIM_GO_DEBUG\", \"\")\n\n\t// -u: Use <init.vim> instead of the default\n\t// -n: No swap file, use memory only\n\targs := []string{\"-u\", \"NONE\", \"-n\"}\n\tif file != nil {\n\t\t// -p: Open N tab pages (default: one for each file)\n\t\targs = append(args, \"-p\")\n\n\t\tfor _, f := range file {\n\t\t\targs = append(args, f)\n\t\t}\n\t}\n\tn, err := nvim.NewEmbedded(&nvim.EmbedOptions{\n\t\tArgs: args,\n\t\tLogf: t.Logf,\n\t})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tdone := make(chan error, 1)\n\tgo func() {\n\t\tdone <- n.Serve()\n\t\terr := n.Close()\n\t\tserveErr := <-done\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif err != nil {\n\t\t\tt.Fatal(serveErr)\n\t\t}\n\t}()\n\n\treturn n\n}", "title": "" } ]
[ { "docid": "6477c3bd3be02835430402161216a80c", "score": "0.5332737", "text": "func setXDGEnv(dir string) error {\n\thome := filepath.Join(dir, \"home\", \"testnvim\")\n\tif err := os.MkdirAll(home, 0755); err != nil {\n\t\treturn err\n\t}\n\n\txdgEnvDir := []xdgEnv{\n\t\t{\"XDG_CONFIG_HOME\", filepath.Join(home, \".config\")},\n\t\t{\"XDG_CACHE_HOME\", filepath.Join(home, \".cache\")},\n\t\t{\"XDG_DATA_HOME\", filepath.Join(home, \".local\", \"share\")},\n\t\t{\"XDG_RUNTIME_DIR\", filepath.Join(dir, \"run\", \"user\", \"1000\")},\n\t\t{\"XDG_DATA_DIRS\", filepath.Join(dir, \"usr\", \"local\", \"share\")},\n\t\t{\"XDG_CONFIG_DIRS\", filepath.Join(dir, \"etc\", \"xdg\")},\n\t}\n\tfor _, p := range xdgEnvDir {\n\t\tos.Setenv(p.env, p.path)\n\t\tif err := os.MkdirAll(p.path, 0755); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "fa3b470b216b075ccd3b9e8c414e21b2", "score": "0.5114257", "text": "func NewVim() (*Vim, error) {\n\n\t// check that we have all require dependency\n\terr := system.CheckDependence()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tjetConfig, err := ReadConfig()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to read configuration %s\", err)\n\t}\n\n\t// populate all required dir\n\terr = system.BuildTenantDirs(jetConfig.GetAnsible().AnsibleTemplates, jetConfig.GetDeploymentName())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar vim Vim\n\tvim.jetConfig = &jetConfig\n\n\tp, err := plugin.Open(\"./plugins/vmwarevim.so\")\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\tos.Exit(1)\n\t}\n\n\tvim.vimPlugin = p\n\tsymbol, err := p.Lookup(\"Init\")\n\tif err != nil {\n\t\tpanic(\"Failed lookup init\")\n\t}\n\n\tvim.db, err = dbutil.CreateDatabase()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to connect to database\")\n\t}\n\n\tpluggableVim, err := symbol.(func() (jettypes.VimPlugin, error))()\n\tif err != nil {\n\t\tfmt.Println(\"unexpected type from module symbol\")\n\t\tos.Exit(1)\n\t}\n\n\tvim.pluggableVim = pluggableVim\n\terr = pluggableVim.InitPlugin(&jetConfig.Infra.Vcenter)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed initilize vim\")\n\t}\n\n\treturn &vim, nil\n}", "title": "" }, { "docid": "1687d62ebbef096dc81b6bea4008ab2b", "score": "0.47584707", "text": "func SetupTmpMinishiftHome(t *testing.T) string {\n\tvar err error\n\ttmpDir, err := ioutil.TempDir(\"\", \"minishift-tmp-test-dir-\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tos.Setenv(\"MINISHIFT_HOME\", tmpDir)\n\tstate.InstanceDirs = state.GetMinishiftDirsStructure(tmpDir)\n\n\treturn tmpDir\n}", "title": "" }, { "docid": "01963c3d89a4118d510f50571d22067f", "score": "0.47053498", "text": "func IsNVME(testPath string) bool {\n\treturn strings.Contains(testPath, \"nvme\")\n}", "title": "" }, { "docid": "40114eed9535d96951de5b5f9271ac19", "score": "0.45622948", "text": "func Nvim_command(fd int, cmd []byte) {\n\tfn := \"nvim_command\"\n\te := verify_only_call(fd, fn, \"c\", cmd)\n\tif e != nil {\n\t\tlog.Panicf(\"Nvim command failed with message '%s'\", e)\n\t}\n}", "title": "" }, { "docid": "d53a710a82521c721949927af28f106b", "score": "0.45461696", "text": "func SetRoot(root string) {\n\tvvmnroot = root\n\tvvmnrootSrc = filepath.Join(root, \"src\")\n\tvvmnrootVim = filepath.Join(root, \"vim\")\n\tvvmnrootRepo = filepath.Join(root, \"repo\")\n}", "title": "" }, { "docid": "907de4f9f90121683c8b54b11ddb063d", "score": "0.45456746", "text": "func (suite *persistentVolumeClaimSuite) persistentVolumeClaimSuiteNewNuxeo() *v1alpha1.Nuxeo {\n\ttestStorageClass := \"foo-storage-class\"\n\treturn &v1alpha1.Nuxeo{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: suite.nuxeoName,\n\t\t\tNamespace: suite.namespace,\n\t\t\tUID: \"bdd9861e-4ad8-4681-a93c-1f48cd49a01e\",\n\t\t},\n\t\t// whatever else is needed for the suite\n\t\tSpec: v1alpha1.NuxeoSpec{\n\t\t\tNodeSets: []v1alpha1.NodeSet{{\n\t\t\t\tName: \"test\",\n\t\t\t\tReplicas: 1,\n\t\t\t\tStorage: []v1alpha1.NuxeoStorageSpec{{\n\t\t\t\t\t// should result in the creation of a default PVC\n\t\t\t\t\tStorageType: v1alpha1.NuxeoStorageBinaries,\n\t\t\t\t\tSize: \"10M\",\n\t\t\t\t}, {\n\t\t\t\t\t// should not result in the creation of a PVC because volume source explicitly provided\n\t\t\t\t\tStorageType: v1alpha1.NuxeoStorageTransientStore,\n\t\t\t\t\tSize: \"1Gi\",\n\t\t\t\t\tVolumeSource: corev1.VolumeSource{\n\t\t\t\t\t\tEmptyDir: &corev1.EmptyDirVolumeSource{},\n\t\t\t\t\t},\n\t\t\t\t}, {\n\t\t\t\t\t// should result in the creation of an explicit PVC matching this spec\n\t\t\t\t\tStorageType: v1alpha1.NuxeoStorageData,\n\t\t\t\t\tVolumeClaimTemplate: corev1.PersistentVolumeClaim{\n\t\t\t\t\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\t\t\t\t\tName: \"explicit-pvc\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\tSpec: corev1.PersistentVolumeClaimSpec{\n\t\t\t\t\t\t\tAccessModes: []corev1.PersistentVolumeAccessMode{corev1.ReadWriteOnce},\n\t\t\t\t\t\t\tResources: corev1.ResourceRequirements{\n\t\t\t\t\t\t\t\tLimits: nil,\n\t\t\t\t\t\t\t\tRequests: corev1.ResourceList{\n\t\t\t\t\t\t\t\t\tcorev1.ResourceStorage: resource.MustParse(\"10M\"),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tStorageClassName: &testStorageClass,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t}},\n\t\t\t}},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "fba5a1b0cae31c882971db56d4998e7a", "score": "0.44822162", "text": "func XdgDataDir() string {\n\treturn xdgOr(\"XDG_DATA_HOME\", \".local/share\")\n}", "title": "" }, { "docid": "83ad7ef7b2faff7f33369754377bdeac", "score": "0.4459469", "text": "func TestVM(t *testing.T) {\n\to := &vmtest.Options{\n\t\tQEMUOpts: qemu.Options{\n\t\t\tDevices: []qemu.Device{\n\t\t\t\t// CONFIG_ATA_PIIX is required for this option to work.\n\t\t\t\tqemu.ArbitraryArgs{\"-hda\", \"testdata/mbrdisk\"},\n\t\t\t\tqemu.ArbitraryArgs{\"-hdb\", \"../testdata/12Kzeros\"},\n\t\t\t\tqemu.ArbitraryArgs{\"-hdc\", \"../testdata/gptdisk\"},\n\t\t\t\tqemu.ArbitraryArgs{\"-hdd\", \"testdata/gptdisk_label\"},\n\t\t\t\tqemu.ArbitraryArgs{\"-drive\", \"file=../testdata/gptdisk2,if=none,id=NVME1\"},\n\t\t\t\t// use-intel-id uses the vendor=0x8086 and device=0x5845 ids for NVME\n\t\t\t\tqemu.ArbitraryArgs{\"-device\", \"nvme,drive=NVME1,serial=nvme-1,use-intel-id\"},\n\n\t\t\t\t// With NVMe devices enabled, kernel crashes when not using q35 machine model.\n\t\t\t\tqemu.ArbitraryArgs{\"-machine\", \"q35\"},\n\t\t\t},\n\t\t},\n\t}\n\tvmtest.GolangTest(t, []string{\"github.com/u-root/u-root/pkg/mount/block\"}, o)\n}", "title": "" }, { "docid": "e0dc0e2afd5629c97705138417a88170", "score": "0.444552", "text": "func (o *StorageNetAppStorageVm) GetNvmeEnabled() bool {\n\tif o == nil || o.NvmeEnabled == nil {\n\t\tvar ret bool\n\t\treturn ret\n\t}\n\treturn *o.NvmeEnabled\n}", "title": "" }, { "docid": "7fd012390d86c991e586efb6750d5e48", "score": "0.43903396", "text": "func NewNVMECLI(e command.CmdExecutor, logger *logrus.Logger) *NVMECLI {\n\treturn &NVMECLI{e: e, log: logger.WithField(\"component\", \"NVMECLI\")}\n}", "title": "" }, { "docid": "e21a84d31bc7c6acf619c21fd591f89e", "score": "0.43865702", "text": "func InitTestConfig() (*GophotoConfig, string, error) {\n\tdir, err := ioutil.TempDir(\"\", \"teststorage\")\n\tif err != nil {\n\t\treturn nil, \"\", err\n\t}\n\tlog.Infof(\"Created temporary test dir: %s\", dir)\n\n\t// TODO: Create a sub-dir for working directory\n\n\tcfg := &GophotoConfig{\n\t\tAssetsPath: \"./public\", // TODO\n\t\tDatabase: Database{Open: \"user=postgres dbname=gophoto\"},\n\t\tLocalStorage: &LocalStorage{Path: \"./storage\"}, // TODO\n\t\tWorkDirPath: dir,\n\t\tAPIPort: 8200,\n\t}\n\n\treturn cfg, dir, nil\n}", "title": "" }, { "docid": "3fd78cf13f2084ef262c55aee30bac94", "score": "0.4382985", "text": "func vmSyncTestPath() string {\n\treturn fmt.Sprintf(\"/etc/test/nested/copy/%d/hosts\", os.Getpid())\n}", "title": "" }, { "docid": "1666982bd4f79a8b26b2298d8b38cb8b", "score": "0.4381905", "text": "func (s *NFSSuite) TestNFSDriver(c *C) {\n\tvar (\n\t\troot string\n\t\tdriver *NFSDriver\n\t)\n\n\troot = c.MkDir()\n\td, err := Init(root, []string{NetworkDisabled})\n\tc.Assert(err, IsNil)\n\tdriver = d.(*NFSDriver)\n\n\t// Test initializing a bad directory\n\td, err = Init(root+\"notadir\", nil)\n\tc.Assert(err, NotNil)\n\tc.Assert(d, IsNil)\n\n\t// Test initializing a file instead of a dir\n\tfname := filepath.Join(root, \"iamafile\")\n\tioutil.WriteFile(fname, []byte(\"hi\"), 0664)\n\td, err = Init(fname, nil)\n\tc.Assert(err, Equals, volume.ErrNotADirectory)\n\tc.Assert(d, IsNil)\n\n\tvol, err := driver.Create(\"volume\")\n\tc.Assert(vol, IsNil)\n\tc.Assert(err, Equals, ErrNotSupported)\n\n\terr = driver.Remove(\"volume\")\n\tc.Assert(err, Equals, ErrNotSupported)\n\n\tstatus, err := driver.Status()\n\tc.Assert(status, IsNil)\n\tc.Assert(err, Equals, ErrNotSupported)\n\n\tvolpath := filepath.Join(root, \"testvolume\")\n\tif err := os.MkdirAll(volpath, 0775); err != nil {\n\t\tc.Error(err)\n\t}\n\n\tvol, err = driver.GetTenant(\"volume\")\n\tc.Assert(vol, IsNil)\n\tc.Assert(err, Equals, ErrNotSupported)\n\n\tvolname := \"testvolume\"\n\tvol, err = driver.Get(volname)\n\n\tc.Assert(err, IsNil)\n\tc.Assert(vol, NotNil)\n\tc.Assert(vol.Path(), Equals, volpath)\n\tc.Assert(vol.Name(), Equals, volname)\n\tc.Assert(vol.Driver(), Equals, driver)\n\tc.Assert(vol.Tenant(), Equals, volname)\n\n\twc, err := vol.WriteMetadata(\"\", \"\")\n\tc.Assert(wc, IsNil)\n\tc.Assert(err, Equals, ErrNotSupported)\n\n\trc, err := vol.ReadMetadata(\"\", \"\")\n\tc.Assert(rc, IsNil)\n\tc.Assert(err, Equals, ErrNotSupported)\n\n\tc.Assert(vol.Snapshot(\"\", \"\", []string{}), Equals, ErrNotSupported)\n\n\tinfo, err := vol.SnapshotInfo(\"\")\n\tc.Assert(info, IsNil)\n\tc.Assert(err, Equals, ErrNotSupported)\n\n\tsnaps, err := vol.Snapshots()\n\tc.Assert(snaps, IsNil)\n\tc.Assert(err, Equals, ErrNotSupported)\n\n\tc.Assert(vol.RemoveSnapshot(\"\"), Equals, ErrNotSupported)\n\tc.Assert(vol.Rollback(\"\"), Equals, ErrNotSupported)\n\tc.Assert(vol.Export(\"\", \"\", nil, []string{}), Equals, ErrNotSupported)\n\tc.Assert(vol.Import(\"\", nil), Equals, ErrNotSupported)\n\n\tc.Assert(driver.Exists(volname), Equals, true)\n\tc.Assert(driver.List(), DeepEquals, []string{volname})\n\tc.Assert(driver.Release(volname), IsNil)\n\tc.Assert(driver.Cleanup(), IsNil)\n\n}", "title": "" }, { "docid": "22a8135584ce8603b855cec39cc1a67e", "score": "0.43217126", "text": "func GetVirtualBoxHiddenDirectory() string {\n\tswitch runtime.GOOS {\n\tcase \"darwin\":\n\t\treturn filepath.Join(GetHomeDirectory(), \"Library\", \"VirtualBox\")\n\tcase \"linux\":\n\t\treturn filepath.Join(GetHomeDirectory(), \".config\", \"VirtualBox\")\n\tcase \"windows\":\n\t\treturn filepath.Join(GetHomeDirectory(), \".VirtualBox\")\n\tdefault:\n\t\tlog.Debug(\"GetVirtualBoxHiddenDirectory() could not detect execution environment\")\n\t}\n\n\treturn filepath.Join(GetHomeDirectory(), \".VirtualBox\")\n}", "title": "" }, { "docid": "0eab708b247140dc9cf345174b0bf80c", "score": "0.4308711", "text": "func testKitKitDirectory(t *testing.T) (string, func()) {\n\toldHome := os.Getenv(\"KITKIT_HOME\")\n\tdir, err := ioutil.TempDir(\"testdata\", \"kitkit\")\n\tif err != nil {\n\t\tt.Fatalf(\"failed to create tempdir: %s\", err)\n\t}\n\n\terr = os.Setenv(\"KITKIT_HOME\", dir)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif err = config.KitkitSetup(); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\treturn dir, func() {\n\t\terr = os.Setenv(\"KITKIT_HOME\", oldHome)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\n\t\terr = os.RemoveAll(dir)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to remove the testdata/kitkit directory: %s\", err)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6353c1a25380fc85ba5222a42ba7dde8", "score": "0.4276124", "text": "func (o *StorageNetAppStorageVm) SetNvmeEnabled(v bool) {\n\to.NvmeEnabled = &v\n}", "title": "" }, { "docid": "5c3daf03a130c9281a3ca7f4c156671c", "score": "0.42712197", "text": "func (suite *TestSuite) GetNuclioHostSourceDir() string {\n\treturn common.GetEnvOrDefaultString(\"NUCLIO_TEST_HOST_PATH\", suite.GetNuclioSourceDir())\n}", "title": "" }, { "docid": "dc479ec471ee1349145afa3a1c1c1e5c", "score": "0.42561647", "text": "func optGNMIAddr(opts []DevOpt) *gNMIAddr {\n\tfor _, o := range opts {\n\t\tif v, ok := o.(*gNMIAddr); ok {\n\t\t\treturn v\n\t\t}\n\t}\n\treturn &gNMIAddr{host: \"localhost\", port: 0}\n}", "title": "" }, { "docid": "1d3617d23f3828452e2f521775afb32e", "score": "0.4241421", "text": "func NewNFSStub(caller sacloud.APICaller) sacloud.NFSAPI {\n\treturn &NFSStub{}\n}", "title": "" }, { "docid": "7113e75354fc68f470564ccc0859b953", "score": "0.41579348", "text": "func StorageGetNRangeTest(app *Server, t *testing.T, n int) {\n\tapp.Storage.Clear()\n\ttestData := base64.StdEncoding.EncodeToString([]byte(units[0]))\n\tfor i := 1; i < n; i++ {\n\t\tvalue := strconv.Itoa(i)\n\t\tkey, err := app.Storage.Pivot(\"test/\"+value, testData, int64(i), 0)\n\t\trequire.NoError(t, err)\n\t\trequire.Equal(t, value, key)\n\t\ttime.Sleep(time.Millisecond * 1)\n\t}\n\n\t_, err := app.Storage.Pivot(\"test/0\", testData, 0, 0)\n\trequire.NoError(t, err)\n\n\tlimit := 1\n\ttestObjects, err := app.Storage.GetNRange(\"test/*\", limit, 0, 1)\n\trequire.NoError(t, err)\n\trequire.Equal(t, limit, len(testObjects))\n\t// require.Equal(t, int64(0), testObjects[0].Created)\n\t// require.Equal(t, \"0\", testObjects[0].Index)\n\trequire.Equal(t, int64(1), testObjects[0].Created)\n\trequire.Equal(t, \"1\", testObjects[0].Index)\n}", "title": "" }, { "docid": "ab45b9213d4a453ebf3ebc69056fd5b2", "score": "0.4151413", "text": "func CreateNfsPv(pvName string,\n\tnfsServerAddr string,\n\tnfsExportDir string,\n\tnfsMountOption string) error {\n\n\tfn := \"CreateNfsPv\"\n\t// Let's Create PV & PVC before creating JOB\n\tpv := &corev1.PersistentVolume{\n\t\tTypeMeta: metav1.TypeMeta{Kind: \"PersistentVolume\"},\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: pvName,\n\t\t\tAnnotations: map[string]string{\n\t\t\t\tSkipResourceAnnotation: \"true\",\n\t\t\t},\n\t\t},\n\t\tSpec: corev1.PersistentVolumeSpec{\n\t\t\t// Setting it to empty stringm so that default storage class will not selected.\n\t\t\tStorageClassName: \"\",\n\t\t\tAccessModes: []corev1.PersistentVolumeAccessMode{\n\t\t\t\t\"ReadWriteMany\",\n\t\t\t},\n\t\t\tCapacity: corev1.ResourceList{\n\t\t\t\tcorev1.ResourceName(corev1.ResourceStorage): resource.MustParse(nfsVolumeSize),\n\t\t\t},\n\t\t\tPersistentVolumeSource: corev1.PersistentVolumeSource{\n\t\t\t\tNFS: &corev1.NFSVolumeSource{\n\t\t\t\t\tServer: nfsServerAddr,\n\t\t\t\t\tPath: nfsExportDir,\n\t\t\t\t\tReadOnly: false,\n\t\t\t\t},\n\t\t\t},\n\t\t\tMountOptions: []string{nfsMountOption},\n\t\t},\n\t}\n\n\tif _, err := core.Instance().CreatePersistentVolume(pv); err != nil && !apierrors.IsAlreadyExists(err) {\n\t\terrMsg := fmt.Sprintf(\"creation of pv name [%s] failed: %v\", pvName, err)\n\t\tlogrus.Errorf(\"%s: %v\", fn, errMsg)\n\t\treturn fmt.Errorf(errMsg)\n\t}\n\n\t// wait for pv to be available\n\t_, err := WaitForPVAvailable(pvName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "4ef9a009634480863db0a01985b6a017", "score": "0.41424087", "text": "func (o *VirtualizationVmwareKernelNetworkAllOf) GetVsphereReplicationNfcOk() (*bool, bool) {\n\tif o == nil || o.VsphereReplicationNfc == nil {\n\t\treturn nil, false\n\t}\n\treturn o.VsphereReplicationNfc, true\n}", "title": "" }, { "docid": "2334996415fe2393338885aa90b4a47f", "score": "0.41287494", "text": "func testvfs_cmd(tls *libc.TLS, cd ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_vfs.c:1438:26: */\n\tbp := tls.Alloc(28)\n\tdefer tls.Free(28)\n\n\tvar p uintptr // New object\n\tvar pVfs uintptr // New VFS\n\tvar zVfs uintptr\n\tvar nByte int32 // Bytes of space to allocate at p\n\n\tvar i int32\n\t// var isNoshm int32 at bp+4, 4\n\t// True if -noshm is passed\n\t// var isFullshm int32 at bp+24, 4\n\t// True if -fullshm is passed\n\t// var isDefault int32 at bp+8, 4\n\t// True if -default is passed\n\t// var szOsFile int32 at bp+12, 4\n\t// Value passed to -szosfile\n\t// var mxPathname int32 at bp+16, 4\n\t// Value passed to -mxpathname\n\t// var iVersion int32 at bp+20, 4\n\n\t// var nSwitch int32 at bp, 4\n\n\tvar zSwitch uintptr\n\t*(*int32)(unsafe.Pointer(bp + 4 /* isNoshm */)) = 0\n\t*(*int32)(unsafe.Pointer(bp + 24 /* isFullshm */)) = 0\n\t*(*int32)(unsafe.Pointer(bp + 8 /* isDefault */)) = 0\n\t*(*int32)(unsafe.Pointer(bp + 12 /* szOsFile */)) = 0\n\t*(*int32)(unsafe.Pointer(bp + 16 /* mxPathname */)) = -1\n\t*(*int32)(unsafe.Pointer(bp + 20 /* iVersion */)) = 3 // Value passed to -iversion\n\n\tif !((objc < 2) || (0 != (objc % 2))) {\n\t\tgoto __1\n\t}\n\tgoto bad_args\n__1:\n\t;\n\ti = 2\n__2:\n\tif !(i < objc) {\n\t\tgoto __4\n\t}\n\tzSwitch = tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp /* &nSwitch */)\n\n\tif !((*(*int32)(unsafe.Pointer(bp /* nSwitch */)) > 2) && (0 == libc.Xstrncmp(tls, ts+39132 /* \"-noshm\" */, zSwitch, uint64(*(*int32)(unsafe.Pointer(bp /* nSwitch */)))))) {\n\t\tgoto __5\n\t}\n\tif !(tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr((i+1))*8)), bp+4 /* &isNoshm */) != 0) {\n\t\tgoto __7\n\t}\n\treturn TCL_ERROR\n__7:\n\t;\n\tif !(*(*int32)(unsafe.Pointer(bp + 4 /* isNoshm */)) != 0) {\n\t\tgoto __8\n\t}\n\t*(*int32)(unsafe.Pointer(bp + 24 /* isFullshm */)) = 0\n__8:\n\t;\n\tgoto __6\n__5:\n\tif !((*(*int32)(unsafe.Pointer(bp /* nSwitch */)) > 2) && (0 == libc.Xstrncmp(tls, ts+27059 /* \"-default\" */, zSwitch, uint64(*(*int32)(unsafe.Pointer(bp /* nSwitch */)))))) {\n\t\tgoto __9\n\t}\n\tif !(tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr((i+1))*8)), bp+8 /* &isDefault */) != 0) {\n\t\tgoto __11\n\t}\n\treturn TCL_ERROR\n__11:\n\t;\n\tgoto __10\n__9:\n\tif !((*(*int32)(unsafe.Pointer(bp /* nSwitch */)) > 2) && (0 == libc.Xstrncmp(tls, ts+39139 /* \"-szosfile\" */, zSwitch, uint64(*(*int32)(unsafe.Pointer(bp /* nSwitch */)))))) {\n\t\tgoto __12\n\t}\n\tif !(tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr((i+1))*8)), bp+12 /* &szOsFile */) != 0) {\n\t\tgoto __14\n\t}\n\treturn TCL_ERROR\n__14:\n\t;\n\tgoto __13\n__12:\n\tif !((*(*int32)(unsafe.Pointer(bp /* nSwitch */)) > 2) && (0 == libc.Xstrncmp(tls, ts+39149 /* \"-mxpathname\" */, zSwitch, uint64(*(*int32)(unsafe.Pointer(bp /* nSwitch */)))))) {\n\t\tgoto __15\n\t}\n\tif !(tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr((i+1))*8)), bp+16 /* &mxPathname */) != 0) {\n\t\tgoto __17\n\t}\n\treturn TCL_ERROR\n__17:\n\t;\n\tgoto __16\n__15:\n\tif !((*(*int32)(unsafe.Pointer(bp /* nSwitch */)) > 2) && (0 == libc.Xstrncmp(tls, ts+39161 /* \"-iversion\" */, zSwitch, uint64(*(*int32)(unsafe.Pointer(bp /* nSwitch */)))))) {\n\t\tgoto __18\n\t}\n\tif !(tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr((i+1))*8)), bp+20 /* &iVersion */) != 0) {\n\t\tgoto __20\n\t}\n\treturn TCL_ERROR\n__20:\n\t;\n\tgoto __19\n__18:\n\tif !((*(*int32)(unsafe.Pointer(bp /* nSwitch */)) > 2) && (0 == libc.Xstrncmp(tls, ts+39171 /* \"-fullshm\" */, zSwitch, uint64(*(*int32)(unsafe.Pointer(bp /* nSwitch */)))))) {\n\t\tgoto __21\n\t}\n\tif !(tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr((i+1))*8)), bp+24 /* &isFullshm */) != 0) {\n\t\tgoto __23\n\t}\n\treturn TCL_ERROR\n__23:\n\t;\n\tif !(*(*int32)(unsafe.Pointer(bp + 24 /* isFullshm */)) != 0) {\n\t\tgoto __24\n\t}\n\t*(*int32)(unsafe.Pointer(bp + 4 /* isNoshm */)) = 0\n__24:\n\t;\n\tgoto __22\n__21:\n\tgoto bad_args\n__22:\n\t;\n__19:\n\t;\n__16:\n\t;\n__13:\n\t;\n__10:\n\t;\n__6:\n\t;\n\tgoto __3\n__3:\n\ti = i + (2)\n\tgoto __2\n\tgoto __4\n__4:\n\t;\n\n\tif !(uint64(*(*int32)(unsafe.Pointer(bp + 12 /* szOsFile */))) < uint64(unsafe.Sizeof(TestvfsFile{}))) {\n\t\tgoto __25\n\t}\n\t*(*int32)(unsafe.Pointer(bp + 12 /* szOsFile */)) = int32(unsafe.Sizeof(TestvfsFile{}))\n__25:\n\t;\n\n\tzVfs = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))\n\tnByte = (int32((uint64(unsafe.Sizeof(Testvfs{})) + uint64(int32(libc.Xstrlen(tls, zVfs)))) + uint64(1)))\n\tp = tcl.XTcl_Alloc(tls, uint32(nByte))\n\tlibc.Xmemset(tls, p, 0, uint64(nByte))\n\t(*Testvfs)(unsafe.Pointer(p)).FiDevchar = -1\n\t(*Testvfs)(unsafe.Pointer(p)).FiSectorsize = -1\n\n\t// Create the new object command before querying SQLite for a default VFS\n\t// to use for 'real' IO operations. This is because creating the new VFS\n\t// may delete an existing [testvfs] VFS of the same name. If such a VFS\n\t// is currently the default, the new [testvfs] may end up calling the\n\t// methods of a deleted object.\n\ttcl.XTcl_CreateObjCommand(tls, interp, zVfs, *(*uintptr)(unsafe.Pointer(&struct {\n\t\tf func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32\n\t}{testvfs_obj_cmd})), p, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{testvfs_obj_del})))\n\t(*Testvfs)(unsafe.Pointer(p)).FpParent = sqlite3.Xsqlite3_vfs_find(tls, uintptr(0))\n\t(*Testvfs)(unsafe.Pointer(p)).Finterp = interp\n\n\t(*Testvfs)(unsafe.Pointer(p)).FzName = (p + 1*104)\n\tlibc.Xmemcpy(tls, (*Testvfs)(unsafe.Pointer(p)).FzName, zVfs, (libc.Xstrlen(tls, zVfs) + uint64(1)))\n\n\tpVfs = tcl.XTcl_Alloc(tls, uint32(unsafe.Sizeof(sqlite3_vfs{})))\n\tlibc.Xmemcpy(tls, pVfs, uintptr(unsafe.Pointer(&tvfs_vfs)), uint64(unsafe.Sizeof(sqlite3_vfs{})))\n\t(*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData = p\n\t(*sqlite3_vfs)(unsafe.Pointer(pVfs)).FiVersion = *(*int32)(unsafe.Pointer(bp + 20 /* iVersion */))\n\t(*sqlite3_vfs)(unsafe.Pointer(pVfs)).FzName = (*Testvfs)(unsafe.Pointer(p)).FzName\n\t(*sqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname = (*sqlite3_vfs)(unsafe.Pointer((*Testvfs)(unsafe.Pointer(p)).FpParent)).FmxPathname\n\tif !((*(*int32)(unsafe.Pointer(bp + 16 /* mxPathname */)) >= 0) && (*(*int32)(unsafe.Pointer(bp + 16 /* mxPathname */)) < (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname)) {\n\t\tgoto __26\n\t}\n\t(*sqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname = *(*int32)(unsafe.Pointer(bp + 16 /* mxPathname */))\n__26:\n\t;\n\t(*sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile = *(*int32)(unsafe.Pointer(bp + 12 /* szOsFile */))\n\t(*Testvfs)(unsafe.Pointer(p)).FpVfs = pVfs\n\t(*Testvfs)(unsafe.Pointer(p)).FisNoshm = *(*int32)(unsafe.Pointer(bp + 4 /* isNoshm */))\n\t(*Testvfs)(unsafe.Pointer(p)).FisFullshm = *(*int32)(unsafe.Pointer(bp + 24 /* isFullshm */))\n\t(*Testvfs)(unsafe.Pointer(p)).Fmask = TESTVFS_ALL_MASK\n\n\tsqlite3.Xsqlite3_vfs_register(tls, pVfs, *(*int32)(unsafe.Pointer(bp + 8 /* isDefault */)))\n\n\treturn TCL_OK\n\nbad_args:\n\ttcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+39180 /* \"VFSNAME ?-noshm ...\" */)\n\treturn TCL_ERROR\n}", "title": "" }, { "docid": "77ad68b16701f6c5cd9e5d62f67c11dd", "score": "0.4128657", "text": "func newVimClient(ctx context.Context, config *config.VSphereVMProviderConfig) (*vim25.Client, *session.Manager, error) {\n\tlog.Info(\"Creating new vim Client\", \"VcPNID\", config.VcPNID, \"VcPort\", config.VcPort)\n\tsoapURL, err := soap.ParseURL(net.JoinHostPort(config.VcPNID, config.VcPort))\n\tif err != nil {\n\t\treturn nil, nil, errors.Wrapf(err, \"failed to parse %s:%s\", config.VcPNID, config.VcPort)\n\t}\n\n\tsoapClient := soap.NewClient(soapURL, config.InsecureSkipTLSVerify)\n\tif !config.InsecureSkipTLSVerify {\n\t\terr = soapClient.SetRootCAs(config.CAFilePath)\n\t\tif err != nil {\n\t\t\treturn nil, nil, errors.Wrapf(err, \"failed to set root CA %s: %v\", config.CAFilePath, err)\n\t\t}\n\t}\n\n\tvimClient, err := vim25.NewClient(ctx, soapClient)\n\tif err != nil {\n\t\treturn nil, nil, errors.Wrapf(err, \"error creating a new vim client for url: %v\", soapURL)\n\t}\n\n\tuserInfo := url.UserPassword(config.VcCreds.Username, config.VcCreds.Password)\n\tsm := session.NewManager(vimClient)\n\n\t// Set a custom keepalive handler function\n\tvimClient.RoundTripper = keepalive.NewHandlerSOAP(soapClient, keepAliveIdleTime, SoapKeepAliveHandlerFn(soapClient, sm, userInfo))\n\n\t// Initial login. This will also start the keepalive.\n\tif err = sm.Login(ctx, userInfo); err != nil {\n\t\t// Log message used by VMC LINT. Refer to before making changes\n\t\treturn nil, nil, errors.Wrapf(err, \"login failed for url: %v\", soapURL)\n\t}\n\n\treturn vimClient, sm, err\n}", "title": "" }, { "docid": "171ac71e30ac7c5851dfbbb7162a2e5f", "score": "0.4127034", "text": "func withTemporaryGitConfig(t *testing.T) {\n\tt.Helper()\n\tgitConfigDir := t.TempDir()\n\tkey := \"GIT_CONFIG_GLOBAL\"\n\tt.Setenv(key, filepath.Join(gitConfigDir, \"config\"))\n}", "title": "" }, { "docid": "f8709a196f7600bef8a2722090b63bce", "score": "0.41135186", "text": "func NewMockNVMeInterface(ctrl *gomock.Controller) *MockNVMeInterface {\n\tmock := &MockNVMeInterface{ctrl: ctrl}\n\tmock.recorder = &MockNVMeInterfaceMockRecorder{mock}\n\treturn mock\n}", "title": "" }, { "docid": "c839922a0dbd8d162e02426a28387982", "score": "0.41121396", "text": "func TempDir(t testing.TB) string {\n\tt.Helper()\n\n\tif IsRunningInSubprocess {\n\t\tdir, err := os.MkdirTemp(\"\", \"LandlockTestTempDir\")\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"os.MkdirTemp: %v\", err)\n\t\t}\n\t\treturn dir\n\t}\n\treturn t.TempDir()\n}", "title": "" }, { "docid": "1d9e2f1657365381c7e304940944ad4b", "score": "0.4111262", "text": "func NewNbdkit(plugin NbdkitPlugin, nbdkitPidFile string) *Nbdkit {\n\treturn &Nbdkit{\n\t\tNbdPidFile: nbdkitPidFile,\n\t\tplugin: plugin,\n\t}\n}", "title": "" }, { "docid": "84441071d5ef74394e2d68a613adcd22", "score": "0.4096635", "text": "func createNginxVhost() {\n\tfmt.Println(\">>>> Check if \" + NginxSitesAvailablePath + \" folder is exist..\")\n\tif _, err := os.Stat(NginxSitesAvailablePath); err != nil {\n\t\tfmt.Println(\">>>> Folder \" + NginxSitesAvailablePath + \" does not exist!. Abort\")\n\t\trevertGitChanges();\n\t\tos.Exit(1)\n\t\treturn\n\t}\n\n\tfmt.Println(\">>>> Create nginx server block for domain: \" + domain + \".\")\n\t// Get/download the file from source\n\tcmdWget := exec.Command(\"wget\", \"https://raw.githubusercontent.com/metallurgical/server-host-automation/master/default-nginx-host.conf\", \"-P\", \"/tmp\")\n\tcmdWget.Run()\n\n\t// Move the file from source into nginx sites-available folder\n\tvar vhostFileName = domain + \".conf\"\n\tvar domainPath = NginxSitesAvailablePath + \"/\" + vhostFileName\n\tif isExist, _ := exists(domainPath); isExist == true {\n\t\tfmt.Println(\">>>> Server block already exist. Skip\")\n\t} else {\n\t\tcmdCp := exec.Command(\"mv\", \"/tmp/default-nginx-host.conf\", domainPath)\n\t\tcmdCp.Run()\n\n\t\t// Replace document root full path into new project directory path\n\t\treplaceContent(domainPath, \"[documentRoot]\", projectRoot+\"/public\")\n\t\t// Replace matching server name with new the exact domain name\n\t\treplaceContent(domainPath, \"[serverName]\", domain)\n\t\t// Get the full path of php-fpm socket. This will return the output\n\t\t// something similar to this eg: \"listen = /run/php/php7.4-fpm.sock\"\n\t\t// cmdGetFpmPath, err := exec.Command(\"bash\", \"-c\", \"cat /etc/php/\"+phpVersion+\"/fpm/pool.d/www.conf | grep 'listen ='\").Output()\n\t\tversion, _ := getPhpVersion()\n\t\tcmdGetFpmPath, err := exec.Command(\"bash\", \"-c\", \"cat /etc/php/\"+version+\"/fpm/pool.d/www.conf | grep 'listen ='\").Output()\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\n\t\t// Replace php fpm socket path\n\t\treplaceContent(domainPath, \"[phpFpmSocket]\", \"unix:/var\"+strings.TrimSpace(string(cmdGetFpmPath)[9:]))\n\t\tfmt.Println(\">>>> Done creating server block\")\n\t\t// Once successfully created into sites-available, create symlink to that file\n\t\tfmt.Println(\">>>> Create symlink server block for domain: \" + domain)\n\t\tcmdLn := exec.Command(\"ln\", \"-s\", domainPath, \"/etc/nginx/sites-enabled/\")\n\t\tcmdLn.Run()\n\n\t\t// Restart nginx web server once done\n\t\tfmt.Println(\">>>> Reloading web server to take effect of new changes\")\n\t\tcmdRestartWebServer := exec.Command(\"service\", \"nginx\", \"reload\")\n\t\tcmdRestartWebServer.Run()\n\t\tfmt.Println(\">>>> Project are available to browse with new domain: \" + domain)\n\t}\n}", "title": "" }, { "docid": "96cbb66084d46c402814b2fa73fd6799", "score": "0.40901992", "text": "func TestONNX(t *testing.T) {\n\tvar testConstructors []func() *testbackend.TestCase\n\tif testing.Short() {\n\t\tfor optype := range operators {\n\t\t\ttestConstructors = append(testConstructors, testbackend.GetOpTypeTests(optype)...)\n\t\t}\n\t} else {\n\t\ttestConstructors = testbackend.GetAllRegisteredTests()\n\t}\n\tvar tests []*testbackend.TestCase\n\tfor i := 0; i < len(testConstructors); i++ {\n\t\ttc := testConstructors[i]() // capture range variable\n\t\ttests = append(tests, tc)\n\t\tt.Run(tc.GetInfo(), tc.RunTest(NewGraph(), false))\n\t}\n\tfile, ok := os.LookupEnv(\"ONNX_COVERAGE\")\n\tif ok {\n\t\t// TODO write the coverate to a file\n\t\tf, err := os.Create(file)\n\t\tif err != nil {\n\t\t\tt.Fatal(\"cannot write report\", err)\n\t\t}\n\t\tdefer f.Close()\n\t\tsort.Sort(testreport.ByStatus(tests))\n\t\tfmt.Fprintf(f, \"Covering %.1f%% of the onnx integration tests\\n\", testreport.Coverage(tests))\n\t\ttestreport.WriteCoverageReport(f, tests, testreport.ReportTable)\n\t}\n}", "title": "" }, { "docid": "55bc7bb0cdddb3ce4d763a4eb90dd858", "score": "0.4085394", "text": "func XdgConfigDir() string {\n\treturn xdgOr(\"XDG_CONFIG_HOME\", \".config\")\n}", "title": "" }, { "docid": "f371c95906d2ad1b312067144fc0131f", "score": "0.40853363", "text": "func TestDir(t *testing.T, dirPrefix string) string {\n\tt.Helper()\n\n\ttmp, err := ioutil.TempDir(\"\", dirPrefix)\n\tif err != nil {\n\t\tt.Fatalf(\"err: %v\", err)\n\t}\n\n\treturn tmp\n}", "title": "" }, { "docid": "5c5da8f2ba938cf8ec31292a5ccf172d", "score": "0.40764293", "text": "func New() Interface {\n\treturn &nvmdev{mdevParentsRoot, mdevDevicesRoot}\n}", "title": "" }, { "docid": "16e9153dd456a821de9eb948f4978668", "score": "0.4076372", "text": "func (vars ExtraVars) NovaNetwork() error {\n\tcommand.ExecuteWithOutput(\"playback\", \"--ansible\", \"openstack_nova_network_compute.yml\", \"--extra-vars\", \"host=\"+vars.HostName, \"my_ip=\"+vars.MyIP, \"-vvvv\")\n\treturn nil\n}", "title": "" }, { "docid": "65343d796b82e7164319b3507b32ee9c", "score": "0.40728277", "text": "func StorageGetNTest(app *Server, t *testing.T, n int) {\n\tapp.Storage.Clear()\n\ttestData := base64.StdEncoding.EncodeToString([]byte(units[0]))\n\tfor i := 0; i < n; i++ {\n\t\tvalue := strconv.Itoa(i)\n\t\tkey, err := app.Storage.Set(\"test/\"+value, testData)\n\t\trequire.NoError(t, err)\n\t\trequire.Equal(t, value, key)\n\t\ttime.Sleep(time.Millisecond * 1)\n\t}\n\n\tlimit := 1\n\ttestObjects, err := app.Storage.GetN(\"test/*\", limit)\n\trequire.NoError(t, err)\n\trequire.Equal(t, limit, len(testObjects))\n\trequire.Equal(t, strconv.Itoa(n-1), testObjects[0].Index)\n}", "title": "" }, { "docid": "106b50a51b5c3d3a85bd471501930858", "score": "0.40716022", "text": "func xdgSupport() bool {\n\tre := regexp.MustCompile(\"^XDG_*\")\n\tfor _, e := range os.Environ() {\n\t\tif re.FindAllString(e, 1) != nil {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "cf675e42e311c2b7d80a2e3e2c2545c6", "score": "0.4063683", "text": "func NvidiaPaths(configFilePath, userEnvPath string) ([]string, []string, error) {\n\tif userEnvPath != \"\" {\n\t\toldPath := os.Getenv(\"PATH\")\n\t\tos.Setenv(\"PATH\", userEnvPath)\n\t\tdefer os.Setenv(\"PATH\", oldPath)\n\t}\n\n\t// Parse nvidia-container-cli for the necessary binaries/libs, fallback to a\n\t// list of required binaries/libs if the nvidia-container-cli is unavailable\n\tnvidiaFiles, err := nvidiaContainerCli(\"list\", \"--binaries\", \"--libraries\")\n\tif err != nil {\n\t\tsylog.Verbosef(\"nvidiaContainerCli returned: %v\", err)\n\t\tsylog.Verbosef(\"Falling back to nvliblist.conf\")\n\n\t\tnvidiaFiles, err = gpuliblist(configFilePath)\n\t\tif err != nil {\n\t\t\treturn nil, nil, fmt.Errorf(\"could not read %s: %v\", filepath.Base(configFilePath), err)\n\t\t}\n\t}\n\n\treturn paths(nvidiaFiles)\n}", "title": "" }, { "docid": "f892faf622e3ef0fead25093b2db462d", "score": "0.4058644", "text": "func Vim(path string) (err error) {\n\tvim := \"vim\"\n\tif _, err = exec.LookPath(vim); err != nil {\n\t\treturn fmt.Errorf(\"vim not found on this system!\")\n\t}\n\tcmd := exec.Command(vim, path)\n\tcmd.Stdin, cmd.Stdout, cmd.Stderr = os.Stdin, os.Stdout, os.Stderr\n\tif err = cmd.Start(); err != nil {\n\t\treturn\n\t}\n\tif err = cmd.Wait(); err != nil {\n\t\treturn\n\t}\n\treturn\n}", "title": "" }, { "docid": "8c1767866fff70ce97534acc6b6b36af", "score": "0.40569916", "text": "func (o *VirtualizationVmwareKernelNetworkAllOf) GetVsphereReplicationNfc() bool {\n\tif o == nil || o.VsphereReplicationNfc == nil {\n\t\tvar ret bool\n\t\treturn ret\n\t}\n\treturn *o.VsphereReplicationNfc\n}", "title": "" }, { "docid": "2e457de3763c92b8da895a2bb73198a1", "score": "0.4056245", "text": "func GetXdgConfigPaths() []string {\n\tpathsToTry := make([]string, 0)\n\n\tif XdgConfigHome != `` {\n\t\tpathsToTry = append(pathsToTry, strings.TrimSuffix(XdgConfigHome, `/`))\n\t}\n\n\tfor _, dir := range strings.Split(XdgConfigDirs, `:`) {\n\t\tpathsToTry = append(pathsToTry, strings.TrimSuffix(dir, `/`))\n\t}\n\n\treturn pathsToTry\n}", "title": "" }, { "docid": "e0a907626a253fed0cd2d987e0ed54ba", "score": "0.40542537", "text": "func mustGetConfigDir() string {\n\tconst xdgAppName = \"pinniped\"\n\n\tif path := os.Getenv(\"XDG_CONFIG_HOME\"); path != \"\" {\n\t\treturn filepath.Join(path, xdgAppName)\n\t}\n\thome, err := os.UserHomeDir()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn filepath.Join(home, \".config\", xdgAppName)\n}", "title": "" }, { "docid": "5131110a143207cdc93e24bc70eb5928", "score": "0.4050886", "text": "func DefaultVegaDir() string {\n\tif runtime.GOOS == \"windows\" {\n\t\t// shortcut for windows\n\t\tp, err := os.UserHomeDir()\n\t\tif err == nil {\n\t\t\treturn filepath.Join(p, \".vega\")\n\t\t}\n\t}\n\n\tex, err := os.Executable()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\texPath := filepath.Dir(ex)\n\tif exPath == \"/usr/bin\" {\n\t\treturn \"/etc/vega\"\n\t}\n\tif exPath == \"/usr/local/vega/bin\" {\n\t\treturn \"/usr/local/vega/etc\"\n\t}\n\tif exPath == \"/usr/local/bin\" {\n\t\treturn \"/usr/local/etc/vega\"\n\t}\n\treturn os.ExpandEnv(\"$HOME/.vega\")\n}", "title": "" }, { "docid": "90a7420ea711b5ffd0b5ad4cb56f6ab6", "score": "0.40467134", "text": "func (o *StorageNetAppStorageVm) HasNvmeEnabled() bool {\n\tif o != nil && o.NvmeEnabled != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "d61190c9c9af344e463ebfcba7ba0de6", "score": "0.4039307", "text": "func TestConfig() *Config {\n\td, err := os.MkdirTemp(\"\", \"pm-test\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tcfg := &Config{\n\t\tOutputDir: filepath.Join(d, \"output\"),\n\t\tManifestPath: filepath.Join(d, \"manifest\"),\n\t\tKeyPath: filepath.Join(d, \"key\"),\n\t\tTempDir: filepath.Join(d, \"tmp\"),\n\t\tPkgName: \"testpackage\",\n\t\tPkgRepository: \"testrepository.com\",\n\t\tPkgVersion: \"0\",\n\t\tSubpackagesPath: \"\",\n\t\tPkgABIRevision: TestABIRevision,\n\t}\n\tfor _, d := range []string{cfg.OutputDir, cfg.TempDir} {\n\t\tos.MkdirAll(d, os.ModePerm)\n\t}\n\treturn cfg\n}", "title": "" }, { "docid": "1440103e23e6ee641b9d0f4e3bef603a", "score": "0.4027963", "text": "func GetRoot() string {\n\treturn vvmnroot\n}", "title": "" }, { "docid": "0629174e64bb3eb103f54fc0994880ed", "score": "0.402389", "text": "func (cw *ConfigWrapper) vimURL() (*url.URL, error) {\n\tu, err := url.Parse(\"https://\" + cw.config.VSphereServer + \"/sdk\")\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error parse url: %s\", err)\n\t}\n\n\tu.User = url.UserPassword(cw.config.User, cw.config.Password)\n\n\treturn u, nil\n}", "title": "" }, { "docid": "7d24255554d9fe0924854bb16b5b3410", "score": "0.40192497", "text": "func (o *StorageNetAppStorageVm) GetNvmeEnabledOk() (*bool, bool) {\n\tif o == nil || o.NvmeEnabled == nil {\n\t\treturn nil, false\n\t}\n\treturn o.NvmeEnabled, true\n}", "title": "" }, { "docid": "4e44fca3f2f8ba0bb629566307f19267", "score": "0.40150174", "text": "func installVimInContainer(ctx context.Context, cont *vm.Container) error {\n\t// Check whether vim is preinstalled or not.\n\tif err := cont.Command(ctx, \"vim\", \"--version\").Run(testexec.DumpLogOnError); err == nil {\n\t\treturn nil\n\t}\n\n\t// Run command sudo apt update in container.\n\tif err := cont.Command(ctx, \"sudo\", \"apt\", \"update\").Run(testexec.DumpLogOnError); err != nil {\n\t\treturn errors.Wrap(err, \"failed to run command sudo apt update in container\")\n\t}\n\n\t// Run command sudo apt install vim in container.\n\tif err := cont.Command(ctx, \"sudo\", \"DEBIAN_FRONTEND=noninteractive\", \"apt-get\", \"-y\", \"install\", \"vim\").Run(testexec.DumpLogOnError); err != nil {\n\t\treturn errors.Wrap(err, \"failed to run command sudo apt install vim in container\")\n\t}\n\n\t// Run command vim --version and check the output to make sure vim has been installed successfully.\n\tif err := cont.Command(ctx, \"vim\", \"--version\").Run(testexec.DumpLogOnError); err != nil {\n\t\treturn errors.Wrap(err, \"failed to install vim in container\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "de418ffb400aadbd696cb067f7150d93", "score": "0.40092236", "text": "func TestAncienttRunCommand(t *testing.T) {\n\terr := run(nil, []string{})\n\t// Not nill because there is no config file named `testdefinition.yaml` where the current working directory is\n\tassert.NotNil(t, err)\n\n\t// TODO Generate temp dir and create basic `testdefinition.yaml` in it, switch cwd to tmp dir, no error should be returned then\n\t/*\n\t \ttmpFile, err := ioutil.TempFile(os.TempDir(), \"ancienttgotests\")\n\t \trequire.Nil(t, err)\n\t // defer delete tmpfile\n\n\t \terr = run(nil, []string{})\n\t \t// Not nill because there is no config file named `testdefinition.yaml` where the current working directory is\n\t \tassert.Nil(t, err)\n\t*/\n}", "title": "" }, { "docid": "cc3ce71e2ff9b99308f247a2bc109b0b", "score": "0.40049192", "text": "func TestStickyDir(t *testing.T) {\n\trunIntegrationTest(t, nil, \"./test_sticky\")\n}", "title": "" }, { "docid": "6e1ddf0b73a941c31479dba03f500db3", "score": "0.4004144", "text": "func TestNewIPVSConfig(t *testing.T) {\n\t// simple instantiation to test that defaults are set\n\tconfig, err := NewIPVSConfig([]string{})\n\tif err != nil {\n\t\tt.Fatal(\"saw error instantiating IPVSConfig\", err)\n\t}\n\n\t// non-exhaustive list to check some of our defaults\n\tvalue, err := config.GetSysCtlSetting(\"am_droprate\")\n\tif value != \"10\" || err != nil {\n\t\tt.Fatalf(\"config did not correctly set default; expected 10, saw %s\", value)\n\t}\n\n\tvalue, err = config.GetSysCtlSetting(\"amemthresh\")\n\tif value != \"1024\" || err != nil {\n\t\tt.Fatalf(\"config did not correctly set default; expected 1024, saw %s\", value)\n\t}\n\n\tvalue, err = config.GetSysCtlSetting(\"ignore_tunneled\")\n\tif value != \"1\" || err != nil {\n\t\tt.Fatalf(\"config did not correctly set default; expected 1, saw %s\", value)\n\t}\n\n\tvalue, err = config.GetSysCtlSetting(\"sync_qlen_max\")\n\tif value != \"1028304\" || err != nil {\n\t\tt.Fatalf(\"config did not correctly set default; expected 1028304, saw %s\", value)\n\t}\n\n\tvalue, err = config.GetSysCtlSetting(\"pmtu_disc\")\n\tif value != \"1\" || err != nil {\n\t\tt.Fatalf(\"config did not correctly set default; expected 1, saw %s\", value)\n\t}\n\n\tvalue, err = config.GetSysCtlSetting(\"schedule_icmp\")\n\tif value != \"0\" || err != nil {\n\t\tt.Fatalf(\"config did not correctly set default; expected 0, saw %s\", value)\n\t}\n\n\t// test setting defaults via strings to simulate passing in via CLI\n\tcliParams := []string{\"backup_only=500\", \"conntrack=500\", \"expire_quiescent_template=500\", \"pmtu_disc=500\", \"sync_ports=500\", \"sync_sock_size=500\"}\n\tconfig, err = NewIPVSConfig(cliParams)\n\tif err != nil {\n\t\tt.Fatal(\"saw error instantiating IPVSConfig\", err)\n\t}\n\n\tvalue, err = config.GetSysCtlSetting(\"backup_only\")\n\tif value != \"500\" || err != nil {\n\t\tt.Fatalf(\"config did not correctly set default; expected 0, saw %s\", value)\n\t}\n\n\tvalue, err = config.GetSysCtlSetting(\"conntrack\")\n\tif value != \"500\" || err != nil {\n\t\tt.Fatalf(\"config did not correctly set default; expected 0, saw %s\", value)\n\t}\n\n\tvalue, err = config.GetSysCtlSetting(\"expire_quiescent_template\")\n\tif value != \"500\" || err != nil {\n\t\tt.Fatalf(\"config did not correctly set default; expected 0, saw %s\", value)\n\t}\n\n\tvalue, err = config.GetSysCtlSetting(\"pmtu_disc\")\n\tif value != \"500\" || err != nil {\n\t\tt.Fatalf(\"config did not correctly set default; expected 0, saw %s\", value)\n\t}\n\n\tvalue, err = config.GetSysCtlSetting(\"sync_ports\")\n\tif value != \"500\" || err != nil {\n\t\tt.Fatalf(\"config did not correctly set default; expected 0, saw %s\", value)\n\t}\n\n\tvalue, err = config.GetSysCtlSetting(\"sync_sock_size\")\n\tif value != \"500\" || err != nil {\n\t\tt.Fatalf(\"config did not correctly set default; expected 0, saw %s\", value)\n\t}\n\n\t// verify an error is produced for a bogus tag and that we don't panic\n\tcliParams = []string{\"bogus-tag\"}\n\t_, err = NewIPVSConfig(cliParams)\n\tif err == nil {\n\t\tt.Fatal(\"should have seen an error for a bogus tag, saw <nil>\")\n\t}\n\n\t// eg 3/19/21 - this is okay to remove because we now allow any tag from the user (trust the admin)\n\t// verify an error is produced for a bogus tag that is correctly formatted\n\t// cliParams = []string{\"bogus-tag=1\"}\n\t// _, err = NewIPVSConfig(cliParams)\n\t// if err == nil {\n\t// \tt.Fatal(\"should have seen an error for a bogus tag, saw <nil>\")\n\t// }\n}", "title": "" }, { "docid": "b3c68b7df0031f44feee0306eeb60e5e", "score": "0.3995012", "text": "func initConfig() {\n\tvar configDir string\n\tvar err error\n\tconfigFile := \"gnverifier\"\n\n\t// Find config directory.\n\tconfigDir, err = os.UserConfigDir()\n\tif err != nil {\n\t\tlog.Fatal().Err(err).Msg(\"Cannot find config directory\")\n\t}\n\n\t// Search config in home directory with name \".gnmatcher\" (without extension).\n\tviper.AddConfigPath(configDir)\n\tviper.SetConfigName(configFile)\n\n\t// Set environment variables to override\n\t// config file settings\n\t_ = viper.BindEnv(\"DataSources\", \"GNV_DATA_SOURCES\")\n\t_ = viper.BindEnv(\"Format\", \"GNV_FORMAT\")\n\t_ = viper.BindEnv(\"Jobs\", \"GNV_JOBS\")\n\t_ = viper.BindEnv(\"NsqdContainsFilter\", \"GNV_NSQD_CONTAINS_FILTER\")\n\t_ = viper.BindEnv(\"NsqdRegexFilter\", \"GNV_NSQD_REGEX_FILTER\")\n\t_ = viper.BindEnv(\"NsqdTCPAddress\", \"GNV_NSQD_TCP_ADDRESS\")\n\t_ = viper.BindEnv(\"VerifierURL\", \"GNV_VERIFIER_URL\")\n\t_ = viper.BindEnv(\"WithAllMatches\", \"GNV_WITH_ALL_MATCHES\")\n\t_ = viper.BindEnv(\"WithCapitalization\", \"GNV_WITH_CAPITALIZATION\")\n\t_ = viper.BindEnv(\"WithSpeciesGroup\", \"GNV_WITH_SPECIES_GROUP\")\n\t_ = viper.BindEnv(\n\t\t\"WithUninomialFuzzyMatch\",\n\t\t\"GNV_WITH_UNINOMIAL_FUZZY_MATCH\",\n\t)\n\t_ = viper.BindEnv(\"WithWebLogs\", \"GNV_WITH_WEB_LOGS\")\n\n\tviper.AutomaticEnv() // read in environment variables that match\n\n\tconfigPath := filepath.Join(configDir, fmt.Sprintf(\"%s.yaml\", configFile))\n\ttouchConfigFile(configPath)\n\n\t// If a config file is found, read it in.\n\tif err := viper.ReadInConfig(); err == nil {\n\t\tmsg = append(msg,\n\t\t\tfmt.Sprintf(\"Using config file: %s.\", viper.ConfigFileUsed()))\n\t}\n\tgetOpts()\n}", "title": "" }, { "docid": "b10571f348476e8569bb18a39063fc6a", "score": "0.3983474", "text": "func NewNetNS(t mockConstructorTestingTNewNetNS) *NetNS {\n\tmock := &NetNS{}\n\tmock.Mock.Test(t)\n\n\tt.Cleanup(func() { mock.AssertExpectations(t) })\n\n\treturn mock\n}", "title": "" }, { "docid": "b151a716192bcbe077b3423d14403e86", "score": "0.39831772", "text": "func GetHostNqn(ctx context.Context) (string, error) {\n\tLogc(ctx).Debug(\">>>> nvme_linux.GetHostNqn\")\n\tdefer Logc(ctx).Debug(\"<<<< nvme_linux.GetHostNqn\")\n\n\tout, err := command.Execute(ctx, \"cat\", \"/etc/nvme/hostnqn\")\n\tif err != nil {\n\t\tLogc(ctx).WithField(\"Error\", err).Warn(\"Could not read hostnqn; perhaps NVMe is not installed?\")\n\t\treturn \"\", fmt.Errorf(\"failed to get hostnqn: %v\", err)\n\t}\n\n\tnewout := strings.Split(string(out), \"\\n\")\n\treturn newout[0], nil\n}", "title": "" }, { "docid": "a828feb7cf60f1387e2e5470cb248f10", "score": "0.39821106", "text": "func TestNewVdiskNBDConfig(t *testing.T) {\n\tassert := assert.New(t)\n\n\tfor _, validCase := range validVdiskNBDConfigYAML {\n\t\tcfg, err := NewVdiskNBDConfig([]byte(validCase))\n\t\tif assert.NoError(err, validCase) {\n\t\t\tassert.NotNil(cfg, validCase)\n\t\t}\n\t}\n\n\tfor _, invalidCase := range invalidVdiskNBDConfigYAML {\n\t\tcfg, err := NewVdiskNBDConfig([]byte(invalidCase))\n\t\tif assert.Error(err, invalidCase) {\n\t\t\tt.Logf(\"NewVdiskNBDConfig error: %v\", err)\n\t\t\tassert.Nil(cfg, invalidCase)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "25988741d21cc92fff7591dc8b6c512f", "score": "0.3977393", "text": "func TestConfig(prefixPath, configFile string) error {\n\tcmd := exec.Command(\"nginx\", \"-t\", \"-p\", prefixPath, \"-c\", configFile)\n\n\t// log.Printf(\"About to execute command %+v\", cmd)\n\n\tout, execErr := cmd.CombinedOutput()\n\n\terr := findError(\"emerg\", out)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = findError(\"warn\", out)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t//defer checking the execErr until the end. Otherwise we won't receive emerg errors\n\tif execErr != nil {\n\t\treturn execErr\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "8ff6bf15965c1b8334ffd93d901b1bf2", "score": "0.397543", "text": "func runTestSuite(t *testing.T, dir string, govulndb string, update bool) {\n\tparallelLimiterInit.Do(func() {\n\t\tlimit := (runtime.GOMAXPROCS(0) + 3) / 4\n\t\tif limit > 2 && unsafe.Sizeof(uintptr(0)) < 8 {\n\t\t\tlimit = 2\n\t\t}\n\t\tparallelLimiter = make(chan struct{}, limit)\n\t})\n\n\tts, err := cmdtest.Read(dir)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tts.DisableLogging = true\n\n\tts.Commands[\"govulncheck\"] = func(args []string, inputFile string) ([]byte, error) {\n\t\tparallelLimiter <- struct{}{}\n\t\tdefer func() { <-parallelLimiter }()\n\n\t\tnewargs := append([]string{\"-db\", govulndb}, args...)\n\n\t\tbuf := &bytes.Buffer{}\n\t\tcmd := scan.Command(context.Background(), newargs...)\n\t\tcmd.Stdout = buf\n\t\tcmd.Stderr = buf\n\t\tif inputFile != \"\" {\n\t\t\tinput, err := os.Open(filepath.Join(dir, inputFile))\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tdefer input.Close()\n\t\t\tcmd.Stdin = input\n\t\t}\n\t\t// We set GOVERSION to always get the same results regardless of the underlying Go build system.\n\t\tcmd.Env = append(os.Environ(), \"GOVERSION=go1.18\")\n\t\tif err := cmd.Start(); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\terr := cmd.Wait()\n\t\tswitch e := err.(type) {\n\t\tcase nil:\n\t\tcase interface{ ExitCode() int }:\n\t\t\terr = &cmdtest.ExitCodeErr{Msg: err.Error(), Code: e.ExitCode()}\n\t\t\tif e.ExitCode() == 0 {\n\t\t\t\terr = nil\n\t\t\t}\n\t\tdefault:\n\t\t\tfmt.Fprintln(buf, err)\n\t\t\terr = &cmdtest.ExitCodeErr{Msg: err.Error(), Code: 1}\n\t\t}\n\t\tsorted := buf\n\t\tif err == nil && isJSONMode(args) {\n\t\t\t// parse, sort and reprint the output for test stability\n\t\t\tgather := test.NewMockHandler()\n\t\t\tif err := govulncheck.HandleJSON(buf, gather); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tsorted = &bytes.Buffer{}\n\t\t\th := govulncheck.NewJSONHandler(sorted)\n\t\t\tif err := gather.Write(h); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tout := sorted.Bytes()\n\t\tfor _, fix := range fixups {\n\t\t\tout = fix.apply(out)\n\t\t}\n\t\treturn out, err\n\t}\n\tif update {\n\t\tts.Run(t, true)\n\t\treturn\n\t}\n\tts.RunParallel(t, false)\n}", "title": "" }, { "docid": "d46e0752c982e94178dbc6a358e574e5", "score": "0.39691916", "text": "func TestPrefixReplaceNTT(t *testing.T) {\n\tclearEnv()\n\tsetContent(\"ntt.env\", `K3_FNORD=\"var2\"`)\n\tenv.Load(\"ntt.env\")\n\tassert.Equal(t, \"var2\", env.Getenv(\"NTT_FNORD\"))\n\tassert.Equal(t, \"var2\", env.Getenv(\"K3_FNORD\"))\n}", "title": "" }, { "docid": "c7b6ed3a6950bea48efd0922fa7138b3", "score": "0.39659303", "text": "func GetVirtualBoxVMsDirectory() string {\n\treturn filepath.Join(GetHomeDirectory(), \"VirtualBox VMs\")\n}", "title": "" }, { "docid": "2defd311efbed871ed2bc21566b7d2c5", "score": "0.39632905", "text": "func SetupHomeDirectories(t *testing.T) {\n}", "title": "" }, { "docid": "b85358adc694160488de49c52ec66700", "score": "0.39613968", "text": "func TestGoDotEnvVariableWorking(t *testing.T) {\n\tEnvFilePath = \"../.env_test\"\n\n\tusermail, err := GoDotEnvVariable(\"USERMAIL\")\n\n\tt.Run(\"Get username\", func(t *testing.T) {\n\t\tif err != nil {\n\t\t\tt.Errorf(\"err = %v, want nil\", err)\n\t\t}\n\n\t\tif usermail != \"myusername\" {\n\t\t\tt.Errorf(\"usermail = %v, want myusername\", usermail)\n\t\t}\n\t})\n}", "title": "" }, { "docid": "38638cd0bd5b8da752da62e627f6ec62", "score": "0.39590523", "text": "func (s *TestSuite) TestTreePath(t *testing.T) {\n\t// Make a simulated device\n\tsimulator := gnmi.CreateSimulator(t)\n\tdefer gnmi.DeleteSimulator(t, simulator)\n\n\t// Make a GNMI client to use for requests\n\tgnmiClient := gnmi.GetGNMIClientOrFail(t)\n\n\tgetPath := gnmi.GetDevicePath(simulator.Name(), newRootEnabledPath)\n\n\t// Set name of new root using gNMI client\n\tsetNamePath := []proto.DevicePath{\n\t\t{DeviceName: simulator.Name(), Path: newRootConfigNamePath, PathDataValue: newRootName, PathDataType: proto.StringVal},\n\t}\n\tgnmi.SetGNMIValueOrFail(t, gnmiClient, setNamePath, gnmi.NoPaths, gnmi.NoExtensions)\n\n\t// Set values using gNMI client\n\tsetPath := []proto.DevicePath{\n\t\t{DeviceName: simulator.Name(), Path: newRootDescriptionPath, PathDataValue: newDescription, PathDataType: proto.StringVal},\n\t\t{DeviceName: simulator.Name(), Path: newRootEnabledPath, PathDataValue: \"false\", PathDataType: proto.BoolVal},\n\t}\n\tgnmi.SetGNMIValueOrFail(t, gnmiClient, setPath, gnmi.NoPaths, gnmi.NoExtensions)\n\n\t// Check that the name value was set correctly\n\tgnmi.CheckGNMIValue(t, gnmiClient, setNamePath, newRootName, 0, \"Query name after set returned the wrong value\")\n\n\t// Check that the enabled value was set correctly\n\tgnmi.CheckGNMIValue(t, gnmiClient, getPath, \"false\", 0, \"Query enabled after set returned the wrong value\")\n\n\t// Remove the root path we added\n\tgnmi.SetGNMIValueOrFail(t, gnmiClient, gnmi.NoPaths, getPath, gnmi.NoExtensions)\n\n\t// Make sure child got removed\n\tgnmi.CheckGNMIValue(t, gnmiClient, setNamePath, newRootName, 0, \"New child was not removed\")\n\n\t// Make sure new root got removed\n\tgnmi.CheckGNMIValue(t, gnmiClient, getPath, \"\", 0, \"New root was not removed\")\n}", "title": "" }, { "docid": "7f05e27671c8a6fc3b71ad32fb49467d", "score": "0.39581707", "text": "func TestTVTerminal(t *testing.T) {\n\tt.Run(\"TVTerminal\", func(t *testing.T) {\n\t\tTermSuite(t, func() TerminalUI {\n\t\t\treturn NewTVTerminal()\n\t\t})\n\t})\n}", "title": "" }, { "docid": "e8456fe016d904762666f80614e7c4e0", "score": "0.39537242", "text": "func GetTestingEnvVariables() *Env {\n\n\twd, err := os.Getwd()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Since we are loading configuration files from the root dir, when running from main package\n\t// this is fine but for testing we need to find the root dir\n\tdir := filepath.Dir(wd)\n\n\tfor dir[len(dir)-24:] != \"gopg-casbin-adapter\" {\n\t\tdir = filepath.Dir(dir)\n\t}\n\n\treturn &Env{Environment: \"test\", ProjectRootPath: dir}\n}", "title": "" }, { "docid": "ac422d1f83f9d7f1bdd1f4f6b2014d0d", "score": "0.39521104", "text": "func newTestDataDir() (*testDataDir, error) {\n\tworkingDir, err := os.Getwd()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tpath := filepath.Join(workingDir, \"testdata\")\n\n\terr = os.MkdirAll(path, 0770)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &testDataDir{\n\t\troot: path,\n\t}, nil\n}", "title": "" }, { "docid": "8856bbe0e00ee4581f7f3cbc45e3af2d", "score": "0.3944108", "text": "func detectTest() {\n\t// if we are running tests, the temporary file go creates for us\n\t// will end in \".test\"\n\tsplit := strings.Split(os.Args[0], \".\")\n\textension := split[len(split)-1]\n\tif extension == \"test\" {\n\t\tEnv = \"test\"\n\t}\n}", "title": "" }, { "docid": "636ac8ae773e073170bb229e420633bf", "score": "0.39375207", "text": "func VBoxManagePath() string {\n\tcmd := \"VBoxManage\"\n\tif p := os.Getenv(\"VBOX_INSTALL_PATH\"); p != \"\" {\n\t\tif path, err := exec.LookPath(filepath.Join(p, cmd)); err == nil {\n\t\t\treturn path\n\t\t}\n\t}\n\n\tif p := os.Getenv(\"VBOX_MSI_INSTALL_PATH\"); p != \"\" {\n\t\tif path, err := exec.LookPath(filepath.Join(p, cmd)); err == nil {\n\t\t\treturn path\n\t\t}\n\t}\n\n\t// Look in default installation path for VirtualBox version > 5\n\tif path, err := exec.LookPath(filepath.Join(\"C:\\\\Program Files\\\\Oracle\\\\VirtualBox\", cmd)); err == nil {\n\t\treturn path\n\t}\n\n\t// Look in windows registry\n\tif p, err := findVBoxInstallDirInRegistry(); err == nil {\n\t\tif path, err := exec.LookPath(filepath.Join(p, cmd)); err == nil {\n\t\t\treturn path\n\t\t}\n\t}\n\n\tif path, err := exec.LookPath(cmd); err == nil {\n\t\treturn path\n\t}\n\treturn cmd\n}", "title": "" }, { "docid": "f9d42a3e6f6af02c25a0c1e5a92dc066", "score": "0.39353257", "text": "func Dir(t *testing.T) string {\n\tdir, err := ioutil.TempDir(\"\", \"maddy-tests-\")\n\tif err != nil {\n\t\tt.Fatalf(\"can't create test dir: %v\", err)\n\t}\n\treturn dir\n}", "title": "" }, { "docid": "a99ee2edd58390355cb6cd5a59d39f94", "score": "0.39335766", "text": "func NewTestCommand(subCommand *cobra.Command, params *KnParams) *cobra.Command {\n\trootCmd := &cobra.Command{\n\t\tUse: \"kn\",\n\t\tPersistentPreRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn flags.ReconcileBoolFlags(cmd.Flags())\n\t\t},\n\t}\n\tif params.Output != nil {\n\t\trootCmd.SetOut(params.Output)\n\t}\n\trootCmd.AddCommand(subCommand)\n\treturn rootCmd\n}", "title": "" }, { "docid": "6b065b167a8c822f8f0f97dc22c2a1ba", "score": "0.39305532", "text": "func (ts *Tester) CreateMNG() error {\n\tif !ts.cfg.IsAddOnManagedNodeGroupsEnabled() {\n\t\tts.lg.Warn(\"mng has not been enabled; skipping creation MNG\")\n\t\treturn nil\n\t}\n\n\tcolorstring.Printf(\"\\n\\n\\n[light_green]mngTester.Create [default](%q, %q)\\n\", ts.cfg.ConfigPath, ts.cfg.KubectlCommand())\n\tif err := catchInterrupt(\n\t\tts.lg,\n\t\tts.stopCreationCh,\n\t\tts.stopCreationChOnce,\n\t\tts.interruptSig,\n\t\tts.mngTester.Create,\n\t); err != nil {\n\t\treturn err\n\t}\n\n\tneedGPU := false\nfound:\n\tfor _, mv := range ts.cfg.AddOnManagedNodeGroups.MNGs {\n\t\tswitch mv.AMIType {\n\t\tcase awseks.AMITypesAl2X8664Gpu:\n\t\t\tneedGPU = true\n\t\t\tbreak found\n\t\t}\n\t}\n\tif !ts.cfg.StatusManagedNodeGroups.NvidiaDriverInstalled && needGPU {\n\t\tcolorstring.Printf(\"\\n\\n\\n[light_green]gpuTester.InstallNvidiaDriver [default](%q, %q)\\n\", ts.cfg.ConfigPath, ts.cfg.KubectlCommand())\n\t\tif err := catchInterrupt(\n\t\t\tts.lg,\n\t\t\tts.stopCreationCh,\n\t\t\tts.stopCreationChOnce,\n\t\t\tts.interruptSig,\n\t\t\tts.gpuTester.InstallNvidiaDriver,\n\t\t); err != nil {\n\t\t\tts.lg.Warn(\"failed to install Nvidia driver\", zap.Error(err))\n\t\t}\n\n\t\tcolorstring.Printf(\"\\n\\n\\n[light_green]gpuTester.RunNvidiaSMI [default](%q, %q)\\n\", ts.cfg.ConfigPath, ts.cfg.KubectlCommand())\n\t\tif err := catchInterrupt(\n\t\t\tts.lg,\n\t\t\tts.stopCreationCh,\n\t\t\tts.stopCreationChOnce,\n\t\t\tts.interruptSig,\n\t\t\tts.gpuTester.RunNvidiaSMI,\n\t\t); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn ts.cfg.Sync()\n}", "title": "" }, { "docid": "4905068eacebbf75202089d3199d828c", "score": "0.392545", "text": "func NewNdtp(sys util.System, options *util.Options, pool *db.Pool, exitChan chan struct{},\n\tconfChan chan *db.ConfMsg) *Ndtp {\n\tc := new(Ndtp)\n\tc.info = new(info)\n\tc.ndtpSession = new(ndtpSession)\n\tc.connection = new(connection)\n\tc.id = sys.ID\n\tc.name = sys.Name\n\tc.address = sys.Address\n\tc.logger = logrus.WithFields(logrus.Fields{\"type\": \"ndtp_client\", \"vis\": sys.ID})\n\tc.Options = options\n\tc.Input = make(chan []byte, NdtpChanSize)\n\tc.exitChan = exitChan\n\tc.pool = pool\n\tc.confChan = confChan\n\treturn c\n}", "title": "" }, { "docid": "0c6f0d641fb6abf7c5fe199f55e077a0", "score": "0.39248678", "text": "func newTestNetworkPlugin(t *testing.T) *nettest.MockNetworkPlugin {\n\tctrl := gomock.NewController(t)\n\treturn nettest.NewMockNetworkPlugin(ctrl)\n}", "title": "" }, { "docid": "caefef7cbc438733e03f5ff43a4dfa79", "score": "0.39241087", "text": "func GetNVMEIdNSFeature(ctx context.Context, diskPath, feature string) (string, error) {\n\tcmd := \"nvme id-ns -n 1 \" + diskPath + \" | grep \" + feature\n\tout, err := testexec.CommandContext(ctx, \"sh\", \"-c\", cmd).Output(testexec.DumpLogOnError)\n\tif err != nil {\n\t\treturn \"0\", errors.Wrap(err, \"failed to read NVMe id-ns feature\")\n\t}\n\tvalue := string(out)\n\treturn strings.TrimSpace(strings.Split(strings.TrimSpace(value), \":\")[1]), nil\n}", "title": "" }, { "docid": "d59ca109705b30fd57c7f61cba2ba990", "score": "0.39199746", "text": "func TestConfigCommand(t *testing.T) {\n\t// Set up tests and give ourselves a working directory.\n\tassert := asrt.New(t)\n\ttestDir := testcommon.CreateTmpDir(\"TestConfigCommand\")\n\n\t// testcommon.Chdir()() and CleanupDir() checks their own errors (and exit)\n\tdefer testcommon.CleanupDir(testDir)\n\tdefer testcommon.Chdir(testDir)()\n\n\t// Create a docroot folder.\n\terr := os.Mkdir(filepath.Join(testDir, \"docroot\"), 0644)\n\tif err != nil {\n\t\tt.Errorf(\"Could not create docroot directory under %s\", testDir)\n\t}\n\n\t// Create the ddevapp we'll use for testing.\n\t// This should return an error, since no existing config can be read.\n\tconfig, err := NewConfig(testDir, DefaultProviderName)\n\tassert.Error(err)\n\n\t// Randomize some values to use for Stdin during testing.\n\tname := strings.ToLower(util.RandString(16))\n\tinvalidDir := strings.ToLower(util.RandString(16))\n\tinvalidAppType := strings.ToLower(util.RandString(8))\n\n\t// This is a bit hard to follow, but we create an example input buffer that writes the sitename, a (invalid) document root, a valid document root,\n\t// an invalid app type, and finally a valid site type (drupal8)\n\tinput := fmt.Sprintf(\"%s\\n%s\\ndocroot\\n%s\\ndrupal8\", name, invalidDir, invalidAppType)\n\tscanner := bufio.NewScanner(strings.NewReader(input))\n\tutil.SetInputScanner(scanner)\n\n\trestoreOutput := testcommon.CaptureStdOut()\n\terr = config.Config()\n\tassert.NoError(err, t)\n\tout := restoreOutput()\n\n\t// Ensure we have expected vales in output.\n\tassert.Contains(out, \"Creating a new ddev project\")\n\tassert.Contains(out, testDir)\n\tassert.Contains(out, fmt.Sprintf(\"No directory could be found at %s\", filepath.Join(testDir, invalidDir)))\n\tassert.Contains(out, fmt.Sprintf(\"%s is not a valid application type\", invalidAppType))\n\n\t// Ensure values were properly set on the config struct.\n\tassert.Equal(name, config.Name)\n\tassert.Equal(\"drupal8\", config.AppType)\n\tassert.Equal(\"docroot\", config.Docroot)\n\terr = PrepDdevDirectory(testDir)\n\tassert.NoError(err)\n\n}", "title": "" }, { "docid": "20cf93e795d56ca58b107950dbef6977", "score": "0.3919405", "text": "func TestnetFilesCmd(ctx *Context, cdc *wire.Codec, appInit AppInit) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"testnet\",\n\t\tShort: \"Initialize files for a Gaiad testnet\",\n\t\tLong: `testnet will create \"v\" number of directories and populate each with\nnecessary files (private validator, genesis, config, etc.).\n\nNote, strict routability for addresses is turned off in the config file.\n\nExample:\n\n\tgaiad testnet --v 4 --output-dir ./output --starting-ip-address 192.168.10.2\n\t`,\n\t\tRunE: func(_ *cobra.Command, _ []string) error {\n\t\t\tconfig := ctx.Config\n\t\t\terr := testnetWithConfig(config, cdc, appInit)\n\t\t\treturn err\n\t\t},\n\t}\n\tcmd.Flags().Int(nValidators, 4,\n\t\t\"Number of validators to initialize the testnet with\")\n\tcmd.Flags().String(outputDir, \"./mytestnet\",\n\t\t\"Directory to store initialization data for the testnet\")\n\tcmd.Flags().String(nodeDirPrefix, \"node\",\n\t\t\"Prefix the directory name for each node with (node results in node0, node1, ...)\")\n\n\tcmd.Flags().String(startingIPAddress, \"192.168.0.1\",\n\t\t\"Starting IP address (192.168.0.1 results in persistent peers list ID0@192.168.0.1:46656, ID1@192.168.0.2:46656, ...)\")\n\treturn cmd\n}", "title": "" }, { "docid": "7dadf3e7013dcffd66846cfad6771ac9", "score": "0.3913723", "text": "func NewZkTestLogger(t *testing.T) *ZkTestLogger {\n\treturn &ZkTestLogger{\n\t\ttestLogger: AdaptTestLogger(t),\n\t}\n}", "title": "" }, { "docid": "01cf20e7ff0354b20e40e2f9477d725b", "score": "0.39084655", "text": "func (nh *NVMeHandler) NewNVMeSubsystem(ctx context.Context, subsNqn string) NVMeSubsystemInterface {\n\tsub, err := getNVMeSubsystem(ctx, subsNqn)\n\tif err != nil {\n\t\tLogc(ctx).WithField(\"Error\", err).Warnf(\"Failed to get subsystem: %v; returning minimal subsystem\", err)\n\t\treturn &NVMeSubsystem{NQN: subsNqn}\n\t}\n\treturn sub\n}", "title": "" }, { "docid": "a95ad06369b7c06b730237027a45d3f7", "score": "0.39061475", "text": "func newTempRepo(t sktest.TestingT) *tempRepo {\n\ttestDataDir := go_testutils.TestDataDir(t)\n\tret := newTempRepoFrom(filepath.Join(testDataDir, \"testrepo.zip\"))\n\tret.Dir = filepath.Join(ret.Dir, \"testrepo\")\n\treturn ret\n}", "title": "" }, { "docid": "67f71e33f97a991b0b82cad34279bc7c", "score": "0.39050525", "text": "func NewNvmeNamespaceInfoType() *NvmeNamespaceInfoType {\n\treturn &NvmeNamespaceInfoType{}\n}", "title": "" }, { "docid": "3635a8aa34532fa777e79b288b63cfd1", "score": "0.3900611", "text": "func TestVagrantClient_Helper(t *testing.T) {\n\t// Find where \"-- HELPER\" exists in the os.Args. If not found, exit.\n\targs := os.Args\n\tfor idx, arg := range args {\n\t\tif arg == \"--\" {\n\t\t\targs = os.Args[idx+1:]\n\t\t\tbreak\n\t\t}\n\t}\n\tif len(args) == 0 || args[0] != \"HELPER\" {\n\t\treturn\n\t}\n\targs = args[1:]\n\n\t// If we got here, we were called as part of a test that executed an exec.Cmd\n\t// object. We output some information about the arguments passed to us.\n\tif len(args) > 0 {\n\t\tvar output string\n\t\tvar ok bool\n\t\t// if custom test output key is set, use it to retrieve test output data\n\t\toutputKey := os.Getenv(EnvTestOutputKey)\n\t\tif outputKey != \"\" {\n\t\t\toutput, ok = successfulOutput[outputKey]\n\t\t} else { // otherwise, use the subcommand name\n\t\t\toutput, ok = successfulOutput[args[0]]\n\t\t}\n\t\tif ok {\n\t\t\tfmt.Print(output)\n\t\t} else {\n\t\t\tfmt.Printf(\"123,,subcommand,%v\\n\", args[0])\n\t\t\tfor _, arg := range args[1:] {\n\t\t\t\tif arg == \"--machine-readable\" {\n\t\t\t\t\tfmt.Println(\"123,,machine-readable,true\")\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Printf(\"123,,arg,%v\\n\", arg)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "cca44e04fee50526238243ce52080f0b", "score": "0.3878034", "text": "func TestNerdctlConfig(t *testing.T) {\n\ttestutil.DockerIncompatible(t)\n\tt.Parallel()\n\ttomlPath := filepath.Join(t.TempDir(), \"nerdctl.toml\")\n\terr := os.WriteFile(tomlPath, []byte(`\nsnapshotter = \"dummy-snapshotter-via-toml\"\n`), 0400)\n\tassert.NilError(t, err)\n\tbase := testutil.NewBase(t)\n\n\t// [Default]\n\tbase.Cmd(\"info\", \"-f\", \"{{.Driver}}\").AssertOutExactly(containerd.DefaultSnapshotter + \"\\n\")\n\n\t// [TOML, Default]\n\tif len(base.Env) == 0 {\n\t\tbase.Env = os.Environ()\n\t}\n\tbase.Env = append(base.Env, \"NERDCTL_TOML=\"+tomlPath)\n\tbase.Cmd(\"info\", \"-f\", \"{{.Driver}}\").AssertOutExactly(\"dummy-snapshotter-via-toml\\n\")\n\n\t// [CLI, TOML, Default]\n\tbase.Cmd(\"info\", \"-f\", \"{{.Driver}}\", \"--snapshotter=dummy-snapshotter-via-cli\").AssertOutExactly(\"dummy-snapshotter-via-cli\\n\")\n\n\t// [Env, TOML, Default]\n\tbase.Env = append(base.Env, \"CONTAINERD_SNAPSHOTTER=dummy-snapshotter-via-env\")\n\tbase.Cmd(\"info\", \"-f\", \"{{.Driver}}\").AssertOutExactly(\"dummy-snapshotter-via-env\\n\")\n\n\t// [CLI, Env, TOML, Default]\n\tbase.Cmd(\"info\", \"-f\", \"{{.Driver}}\", \"--snapshotter=dummy-snapshotter-via-cli\").AssertOutExactly(\"dummy-snapshotter-via-cli\\n\")\n}", "title": "" }, { "docid": "8a5c675042e1df8f876c9ec46f42d87a", "score": "0.38759965", "text": "func ExampleNpv() {\n\trate := decimal.NewFromFloat(0.08)\n\tvalues := []decimal.Decimal{decimal.NewFromInt(-40000), decimal.NewFromInt(5000), decimal.NewFromInt(8000), decimal.NewFromInt(12000), decimal.NewFromInt(30000)}\n\tnpv := gofinancial.Npv(rate, values)\n\tfmt.Printf(\"npv:%v\", npv.Round(0))\n\t// Output:\n\t// npv:3065\n}", "title": "" }, { "docid": "e42c228e402c966d21374d284300fd7a", "score": "0.38745788", "text": "func getKyvernoNameSpace() string {\n\tkyvernoNamespace := os.Getenv(\"KYVERNO_NAMESPACE\")\n\tif kyvernoNamespace == \"\" {\n\t\tkyvernoNamespace = \"kyverno\"\n\t}\n\treturn kyvernoNamespace\n}", "title": "" }, { "docid": "6a3511b92d6d1e146fa9c099f2ad7027", "score": "0.38685834", "text": "func NewNFSVolumeLister(indexer cache.Indexer) NFSVolumeLister {\n\treturn &nFSVolumeLister{indexer: indexer}\n}", "title": "" }, { "docid": "d750fa6a51e94e2200dced3e3cf14009", "score": "0.38653487", "text": "func VidosDataDirFor(suffix string) string {\n\n\tdir := VidosDataDir + string(os.PathSeparator) + suffix\n\terr := os.MkdirAll(dir, os.ModePerm)\n\tCrashOnErrors(err)\n\treturn dir\n}", "title": "" }, { "docid": "fdb68139c2a11b150bea113e31e8e5ae", "score": "0.3858613", "text": "func NewNemoDriver(cfg *NemoCfg) (Driver, error) {\n\tvar opts *gonemo.Options\n\n\tif cfg.OptionPath != \"\" {\n\t\topts, _ = gonemo.NewOptions(cfg.OptionPath)\n\t} else {\n\t\topts = gonemo.NewDefaultOptions()\n\t}\n\n\tdb := gonemo.OpenNemo(opts, cfg.DataPath)\n\n\tdriver := &nemoDrvier{\n\t\tdb: db,\n\t}\n\n\tdriver.init(cfg)\n\n\treturn driver, nil\n}", "title": "" }, { "docid": "ec61558a784fa574e98b38ef4d23a3d1", "score": "0.3855037", "text": "func TestTempDir(tb testing.TB) string {\n\ttb.Helper()\n\tname, err := os.MkdirTemp(\"\", \"mtail-test\")\n\tif err != nil {\n\t\ttb.Fatal(err)\n\t}\n\ttb.Cleanup(func() {\n\t\tif err := os.RemoveAll(name); err != nil {\n\t\t\ttb.Fatalf(\"os.RemoveAll(%s): %s\", name, err)\n\t\t}\n\t})\n\treturn name\n}", "title": "" }, { "docid": "a6d6de22a1d746bb1bd2b8df4678faf1", "score": "0.38509068", "text": "func (s *TestSuite) TestDeleteRoot() {\n\tconst (\n\t\tinterfaceName = \"testinterface\"\n\t\trootPath = \"/interfaces/interface[name=\" + interfaceName + \"]\"\n\t\tnamePath = rootPath + \"/config/name\"\n\t\tdescriptionPath = rootPath + \"/config/description\"\n\t)\n\n\t// Wait for config to connect to the target\n\ts.WaitForTargetAvailable(topo.ID(s.simulator1.Name))\n\n\t// Make a GNMI client to use for requests\n\tgnmiClient := s.NewOnosConfigGNMIClientOrFail(test.NoRetry)\n\n\t// Create new interface tree using gNMI client\n\tsetNamePath := []proto.GNMIPath{\n\t\t{TargetName: s.simulator1.Name, Path: namePath, PathDataValue: interfaceName, PathDataType: proto.StringVal},\n\t}\n\tsetReq := &gnmiutils.SetRequest{\n\t\tCtx: s.Context(),\n\t\tClient: gnmiClient,\n\t\tExtensions: s.SyncExtension(),\n\t\tEncoding: gnmiapi.Encoding_PROTO,\n\t\tUpdatePaths: setNamePath,\n\t}\n\tsetReq.SetOrFail(s.T())\n\n\t// Set the description field of the new interface\n\tsetDescriptionPath := []proto.GNMIPath{\n\t\t{TargetName: s.simulator1.Name, Path: descriptionPath, PathDataValue: \"123\", PathDataType: proto.StringVal},\n\t}\n\tsetReq = &gnmiutils.SetRequest{\n\t\tCtx: s.Context(),\n\t\tClient: gnmiClient,\n\t\tExtensions: s.SyncExtension(),\n\t\tEncoding: gnmiapi.Encoding_PROTO,\n\t\tUpdatePaths: setDescriptionPath,\n\t}\n\tsetReq.SetOrFail(s.T())\n\n\t// Make sure that the new paths are there by reading all the paths from the top\n\tgetReq := &gnmiutils.GetRequest{\n\t\tCtx: s.Context(),\n\t\tClient: gnmiClient,\n\t\tExtensions: s.SyncExtension(),\n\t\tEncoding: gnmiapi.Encoding_PROTO,\n\t\tPaths: gnmiutils.GetTargetPath(s.simulator1.Name, \"/\"),\n\t}\n\tpaths, err := getReq.Get()\n\ts.NoError(err)\n\ts.True(checkForPath(paths, descriptionPath))\n\ts.True(checkForPath(paths, namePath))\n\n\t// Now delete the interface\n\trootTargetPath := []proto.GNMIPath{\n\t\t{TargetName: s.simulator1.Name, Path: rootPath, PathDataValue: interfaceName, PathDataType: proto.StringVal},\n\t}\n\tsetReq.UpdatePaths = nil\n\tsetReq.DeletePaths = rootTargetPath\n\tsetReq.SetOrFail(s.T())\n\n\t// Make sure that the paths are gone\n\tpaths, err = getReq.Get()\n\ts.NoError(err)\n\ts.False(checkForPath(paths, descriptionPath))\n\ts.False(checkForPath(paths, namePath))\n}", "title": "" }, { "docid": "4ca73ab0e125f2fe56aa9d8e53320e3d", "score": "0.38464254", "text": "func IsNotExistMkDir(src string) error {\n\tif notExist := CheckNotExist(src); notExist == true {\n\t\tif err := MkDir(src); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "4ca73ab0e125f2fe56aa9d8e53320e3d", "score": "0.38464254", "text": "func IsNotExistMkDir(src string) error {\n\tif notExist := CheckNotExist(src); notExist == true {\n\t\tif err := MkDir(src); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "d85978ac1b45fafc8601d3cb71f3d41b", "score": "0.38454887", "text": "func GetNovaMetadata(domain libvirt.VirDomain) (map[string]string, error) {\n\tdomXML, err := getDomainXML(domain)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnovaMetadata := generateNovaMetadata(domXML)\n\n\treturn novaMetadata, nil\n}", "title": "" }, { "docid": "23b9a48317abf96995ddb26d05d758ef", "score": "0.38424793", "text": "func (s *systemtestSuite) TestNetprofileMultipleTenantVXLAN(c *C) {\n\ts.testNetprofileMultipleTenant(c, \"vxlan\")\n}", "title": "" }, { "docid": "27c6c6830cc000f6b81457db6d74843a", "score": "0.3838849", "text": "func Test() error {\n\targs := []string{\"test\", \"./...\", \"--count=1\"}\n\tif mg.Verbose() {\n\t\targs = append(args, \"-v\")\n\t}\n\treturn sh.RunV(\"go\", args...)\n}", "title": "" }, { "docid": "e429f843a01759c33f111247d176e323", "score": "0.38353047", "text": "func TestRootNotDir(t *testing.T) {\n\n\tassert := assert.New(t)\n\n\tfs := []fileInfo{\n\t\tmkFile(\"/opt/extensions\", 1, 0777),\n\t}\n\n\tassert.NoError(within(fs, func() {\n\t\tagents := ListExternalAgentPaths(\"opt/extensions\")\n\t\tassert.Equal(0, len(agents))\n\t}))\n}", "title": "" }, { "docid": "41213ff5f32fdde40b67ed88fa7e74c5", "score": "0.38346493", "text": "func localSyncTestPath() string {\n\treturn filepath.Join(localpath.MiniPath(), \"/files\", vmSyncTestPath())\n}", "title": "" }, { "docid": "98e2ec1890d3f645a72c138adacbdba2", "score": "0.3833683", "text": "func cmdTest(cmd []string, cwd, name, testType string) *test {\n\treturn &test{\n\t\tName: name,\n\t\tCmd: strings.Join(cmd, \" \"),\n\t\trun: func() (string, error) {\n\t\t\tcommand := exec.Command(cmd[0], cmd[1:]...)\n\t\t\tif cwd != \"\" {\n\t\t\t\tcommand.Dir = cwd\n\t\t\t}\n\t\t\toutput, err := command.CombinedOutput()\n\t\t\tif err != nil {\n\t\t\t\tif _, err2 := exec.LookPath(cmd[0]); err2 != nil {\n\t\t\t\t\treturn string(output), fmt.Errorf(ERR_NEED_INSTALL, cmd[0], err)\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn string(output), err\n\t\t},\n\t\tType: testType,\n\t}\n}", "title": "" }, { "docid": "b0898ad12826f7ca5de00e3c5842dd2f", "score": "0.38324347", "text": "func (bc *Blockchain) GetTestVM(t trigger.Type, tx *transaction.Transaction, b *block.Block) (*vm.VM, func()) {\n\td := bc.dao.GetWrapped().(*dao.Simple)\n\tsystemInterop := bc.newInteropContext(t, d, b, tx)\n\tvm := systemInterop.SpawnVM()\n\tvm.SetPriceGetter(systemInterop.GetPrice)\n\tvm.LoadToken = contract.LoadToken(systemInterop)\n\treturn vm, systemInterop.Finalize\n}", "title": "" }, { "docid": "e527930bd1f51e0618750ad30854e162", "score": "0.38290852", "text": "func GetTestingVars(t testing.TB) map[string]string {\n\tm := make(map[string]string)\n\ttestingVarsPath := os.Getenv(\"LONDON_TESTING_VARS\")\n\tif len(testingVarsPath) == 0 {\n\t\tt.Fatalf(\"no testing vars file defined (LONDON_TESTING_VARS) check hack/testing_vars_doc file\")\n\t}\n\n\tfile, err := os.Open(testingVarsPath)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to open testing vars %v err:%v\", testingVarsPath, err)\n\t}\n\n\tfscanner := bufio.NewScanner(file)\n\tfor fscanner.Scan() {\n\t\ttxt := fscanner.Text()\n\t\tparts := strings.Split(txt, \" \")\n\t\tif len(parts) == 2 {\n\t\t\tm[parts[0]] = parts[1]\n\t\t} else {\n\t\t\tm[txt] = \"\"\n\t\t}\n\t}\n\n\treturn m\n}", "title": "" }, { "docid": "5c9860056c11217bc5c69098617310e4", "score": "0.38283086", "text": "func (o *StorageNetAppStorageVm) GetNfsEnabled() bool {\n\tif o == nil || o.NfsEnabled == nil {\n\t\tvar ret bool\n\t\treturn ret\n\t}\n\treturn *o.NfsEnabled\n}", "title": "" } ]
8318bf182a87caac962bb8eee73df038
construct implements constructor of InputPeerClass.
[ { "docid": "8156432ac3f4d9c91db9ef426a6e1191", "score": "0.7945564", "text": "func (i InputPeerUserFromMessage) construct() InputPeerClass { return &i }", "title": "" } ]
[ { "docid": "c9c08436ca48641cdc8fd253880ad5d3", "score": "0.8295881", "text": "func (i InputPeerSelf) construct() InputPeerClass { return &i }", "title": "" }, { "docid": "8feff85d9bda954abea8ab30a240ab03", "score": "0.8085196", "text": "func (i InputPeerEmpty) construct() InputPeerClass { return &i }", "title": "" }, { "docid": "a8943b21f369af35af35a07be59761ee", "score": "0.8084738", "text": "func (i InputPeerChat) construct() InputPeerClass { return &i }", "title": "" }, { "docid": "7f7ba1011d1ffd896c45565f221e2734", "score": "0.80340016", "text": "func (i InputPeerChannel) construct() InputPeerClass { return &i }", "title": "" }, { "docid": "faed622018520163142e55da92ead164", "score": "0.79927623", "text": "func (i InputPeerUser) construct() InputPeerClass { return &i }", "title": "" }, { "docid": "a75e6cf5a36c59f7df9279b1501dd7ff", "score": "0.78849953", "text": "func (i InputPeerChannelFromMessage) construct() InputPeerClass { return &i }", "title": "" }, { "docid": "b7e65d7295d8cc96947335757171ff8a", "score": "0.71218014", "text": "func (p PeerChat) construct() PeerClass { return &p }", "title": "" }, { "docid": "ee296186de18802b4c046241d6d22dce", "score": "0.6820168", "text": "func (p PeerChannel) construct() PeerClass { return &p }", "title": "" }, { "docid": "a5d8653b240509902b547c43e2cff3f6", "score": "0.66868955", "text": "func (p PeerUser) construct() PeerClass { return &p }", "title": "" }, { "docid": "f321ea68bba9acf5c54a45bf171f1ded", "score": "0.6664727", "text": "func (i InputUserFromMessage) construct() InputUserClass { return &i }", "title": "" }, { "docid": "774750dffae9a30c2875c3f3ff6b5730", "score": "0.64221877", "text": "func (m MessagePeerVoteInputOption) construct() MessagePeerVoteClass { return &m }", "title": "" }, { "docid": "ab9643e33656748ade7a656dcf435a23", "score": "0.64076054", "text": "func (i InputUserSelf) construct() InputUserClass { return &i }", "title": "" }, { "docid": "644aa744ee26e2fc01ee7a1dae6b9ae5", "score": "0.6403475", "text": "func (i InputMediaContact) construct() InputMediaClass { return &i }", "title": "" }, { "docid": "d8f696394c2e3e3ce0b29c112728da15", "score": "0.6345773", "text": "func (i InputInvoiceMessage) construct() InputInvoiceClass { return &i }", "title": "" }, { "docid": "036375613abf0228504344c39d5b55f8", "score": "0.6320653", "text": "func (i InputReplyToMessage) construct() InputReplyToClass { return &i }", "title": "" }, { "docid": "4d6dea2e97985223a1b6eb6b42664da8", "score": "0.6302487", "text": "func (i InputUser) construct() InputUserClass { return &i }", "title": "" }, { "docid": "1a222adbb50fab5e14c030c18c3ae9ba", "score": "0.62052006", "text": "func (c ChatParticipants) construct() ChatParticipantsClass { return &c }", "title": "" }, { "docid": "8a89243bf27be81bf5b21a30d1356878", "score": "0.61729157", "text": "func (i InputMediaGeoLive) construct() InputMediaClass { return &i }", "title": "" }, { "docid": "2e367439e30b0c3913535996b611ed3e", "score": "0.61334443", "text": "func (i InputMediaGame) construct() InputMediaClass { return &i }", "title": "" }, { "docid": "33c2cba654dbe8f75882a78a0f1fa8a6", "score": "0.6096246", "text": "func (i InputMediaPhoto) construct() InputMediaClass { return &i }", "title": "" }, { "docid": "55ab68819eb1142d4ce975e058b27586", "score": "0.6090575", "text": "func (m MessageSenderChat) construct() MessageSenderClass { return &m }", "title": "" }, { "docid": "772315c980305391353a2a1344003364", "score": "0.6064733", "text": "func (i InputMediaDocument) construct() InputMediaClass { return &i }", "title": "" }, { "docid": "a55cdd1e2c77f7042d2c401c1fe87e17", "score": "0.6040313", "text": "func (k KeyboardButtonRequestPeer) construct() KeyboardButtonClass { return &k }", "title": "" }, { "docid": "9c0505e4971a6f3209a8e2a9c9f43503", "score": "0.6033943", "text": "func (i InputMediaPhotoExternal) construct() InputMediaClass { return &i }", "title": "" }, { "docid": "24a2439b64f5f234e0f76093c71b67d4", "score": "0.598422", "text": "func (i InputReplyToStory) construct() InputReplyToClass { return &i }", "title": "" }, { "docid": "c7b18014c40034468f5a28182547c6b8", "score": "0.5974316", "text": "func (i InputMediaVenue) construct() InputMediaClass { return &i }", "title": "" }, { "docid": "f36cc8df88680e7d9cc211435a25db39", "score": "0.5970162", "text": "func (i InputMediaPoll) construct() InputMediaClass { return &i }", "title": "" }, { "docid": "1a5fa06275eedc22f1ee3235668fcd4c", "score": "0.59451604", "text": "func (t TargetChatChosen) construct() TargetChatClass { return &t }", "title": "" }, { "docid": "73625dde043750764b377fb0c5692fe0", "score": "0.5939945", "text": "func (m MessagePeerVote) construct() MessagePeerVoteClass { return &m }", "title": "" }, { "docid": "dfc2811160ea4eb0a9b7b2c0ba09e101", "score": "0.5920338", "text": "func (i InputMediaEmpty) construct() InputMediaClass { return &i }", "title": "" }, { "docid": "50c6fb5acf51ad48642f14b46ec0b5b6", "score": "0.59029293", "text": "func (i InputMediaInvoice) construct() InputMediaClass { return &i }", "title": "" }, { "docid": "d706e229b44ed4f3178d7bfa19e1f82e", "score": "0.5880193", "text": "func (i InputMediaGeoPoint) construct() InputMediaClass { return &i }", "title": "" }, { "docid": "727d2db24bd8ee9513e9b11340aa3471", "score": "0.5877335", "text": "func (i InputMediaDice) construct() InputMediaClass { return &i }", "title": "" }, { "docid": "5d6e485efb109f1c1cb591316a5f2494", "score": "0.58744496", "text": "func (i InputUserEmpty) construct() InputUserClass { return &i }", "title": "" }, { "docid": "e9bbff1996d41f97e97fbbd4562f917f", "score": "0.586382", "text": "func (i InputGameID) construct() InputGameClass { return &i }", "title": "" }, { "docid": "3f11651cb7a5b0af3c8664a52504fbb0", "score": "0.5863418", "text": "func (m MessageSenderUser) construct() MessageSenderClass { return &m }", "title": "" }, { "docid": "7b63c781fc40e174f076e773c87f13bb", "score": "0.5828163", "text": "func (i InputMediaDocumentExternal) construct() InputMediaClass { return &i }", "title": "" }, { "docid": "82924219c7783b1252a8f29d5b4155be", "score": "0.5827537", "text": "func (m MessagePeerVoteMultiple) construct() MessagePeerVoteClass { return &m }", "title": "" }, { "docid": "5917a19cdcdf3bb013bab7cd7f471c0b", "score": "0.5816987", "text": "func (i InputBotInlineMessageID) construct() InputBotInlineMessageIDClass { return &i }", "title": "" }, { "docid": "73c6867e032038a97d4a79f3843468cc", "score": "0.5801705", "text": "func (i InputInvoiceName) construct() InputInvoiceClass { return &i }", "title": "" }, { "docid": "c4d33c2e0469e94e4c8ff08ff8d38faf", "score": "0.57873416", "text": "func (e MessagesExportedChatInvite) construct() MessagesExportedChatInviteClass { return &e }", "title": "" }, { "docid": "da6a24d5c9cf5333ca23a70151bd019a", "score": "0.57529014", "text": "func (i InputMediaUploadedPhoto) construct() InputMediaClass { return &i }", "title": "" }, { "docid": "51ba752bf7fb45c785a014653897ec63", "score": "0.5748961", "text": "func (t ContactsTopPeers) construct() ContactsTopPeersClass { return &t }", "title": "" }, { "docid": "db2bc0c03b2aca10accba365b79f732a", "score": "0.5679804", "text": "func (i InputMediaUploadedDocument) construct() InputMediaClass { return &i }", "title": "" }, { "docid": "a89f5fefa6001e4c5383dccd043f0e23", "score": "0.56403655", "text": "func (i InputMediaStory) construct() InputMediaClass { return &i }", "title": "" }, { "docid": "75244a15be5689db119897a0ce5f8a1a", "score": "0.5632284", "text": "func (t TargetChatCurrent) construct() TargetChatClass { return &t }", "title": "" }, { "docid": "8b43b83d43f5b81bd7ef2cc693897d4b", "score": "0.55979854", "text": "func (this *PingMsgProc) Init(proto *Protocol) {\n this.parent = proto\n}", "title": "" }, { "docid": "08e20bf2da7207815ad5f9295c97d3d7", "score": "0.55657935", "text": "func (i InputKeyboardButtonUserProfile) construct() KeyboardButtonClass { return &i }", "title": "" }, { "docid": "7093f6ca24a1243a29f06a6cde26ba68", "score": "0.55260354", "text": "func (i InputBotInlineMessageID64) construct() InputBotInlineMessageIDClass { return &i }", "title": "" }, { "docid": "7cb2e8eadadd08a02aaf56858068474f", "score": "0.5518443", "text": "func (c ChannelMessagesFilter) construct() ChannelMessagesFilterClass { return &c }", "title": "" }, { "docid": "4a0709af897527de856d71c6659d30ab", "score": "0.549118", "text": "func (this *PPEventCli) Init(proto *Protocol) {\n this.parent = proto\n}", "title": "" }, { "docid": "daad8cff4d55e03a91259f313adf8e4e", "score": "0.5476197", "text": "func (m MessageVideoChatStarted) construct() MessageContentClass { return &m }", "title": "" }, { "docid": "aaa2b15c1de0980005908d01e89a1ce2", "score": "0.5471645", "text": "func (m MessagePinMessage) construct() MessageContentClass { return &m }", "title": "" }, { "docid": "26bd01e1852adfd1e8290f093cf0fa64", "score": "0.5467637", "text": "func (m MessageInviteVideoChatParticipants) construct() MessageContentClass { return &m }", "title": "" }, { "docid": "e753c80d5600555cdb45f5e92bf6c4f2", "score": "0.5442965", "text": "func (t ContactsTopPeersNotModified) construct() ContactsTopPeersClass { return &t }", "title": "" }, { "docid": "6d382f828d38124397c399aecc59643a", "score": "0.5422032", "text": "func (i InputBotAppID) construct() InputBotAppClass { return &i }", "title": "" }, { "docid": "703ba24e83261c5ec1151e333cc9eb3c", "score": "0.54157805", "text": "func (t TargetChatInternalLink) construct() TargetChatClass { return &t }", "title": "" }, { "docid": "149ca39d98204dc17921f3acb5f1d6b2", "score": "0.54050416", "text": "func (c *CreateCommand) constructInput() *fastly.CreatePrivateKeyInput {\n\tvar input fastly.CreatePrivateKeyInput\n\n\tinput.Key = c.key\n\tinput.Name = c.name\n\n\treturn &input\n}", "title": "" }, { "docid": "6c2c348c66b9217014ee4d6b47fd0702", "score": "0.53849846", "text": "func (c ChatParticipantsForbidden) construct() ChatParticipantsClass { return &c }", "title": "" }, { "docid": "746ff291319d3c7a24c047d4d7b9abcd", "score": "0.5377705", "text": "func (i InputGameShortName) construct() InputGameClass { return &i }", "title": "" }, { "docid": "1c3d181aec93102c717a74cf1f50911a", "score": "0.5350819", "text": "func (e MessagesExportedChatInviteReplaced) construct() MessagesExportedChatInviteClass { return &e }", "title": "" }, { "docid": "55529286d6c970074ba65eda9604f50a", "score": "0.5346483", "text": "func (m MessagePassportDataReceived) construct() MessageContentClass { return &m }", "title": "" }, { "docid": "23da4892ada56ca8645b90fbf59f97f9", "score": "0.53433084", "text": "func (c Chat) InputPeer() tg.InputPeerClass {\n\treturn c.raw.AsInputPeer()\n}", "title": "" }, { "docid": "a918777fd3416b376c00dc821c3ffd5b", "score": "0.53322375", "text": "func (c MessagesChats) construct() MessagesChatsClass { return &c }", "title": "" }, { "docid": "f4e9b05954bdf40283032ec09fef81e2", "score": "0.5325842", "text": "func (s SupergroupMembersFilterBots) construct() SupergroupMembersFilterClass { return &s }", "title": "" }, { "docid": "ce89bddde35f5645daf3980f4a97ff5c", "score": "0.5319335", "text": "func (t ContactsTopPeersDisabled) construct() ContactsTopPeersClass { return &t }", "title": "" }, { "docid": "296cb2ef4ab458441b24b7c96d8b18af", "score": "0.53093886", "text": "func NewInput(\n\tcfg *common.Config,\n\toutlet channel.Connector,\n\tinputContext input.Context,\n) (input.Input, error) {\n\t// Extract and validate the input's configuration.\n\tconf := defaultConfig()\n\tif err := cfg.Unpack(&conf); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Build outlet for events.\n\tout, err := outlet(cfg, inputContext.DynamicFields)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Wrap input.Context's Done channel with a context.Context. This goroutine\n\t// stops with the parent closes the Done channel.\n\tinputCtx, cancelInputCtx := context.WithCancel(context.Background())\n\tgo func() {\n\t\tdefer cancelInputCtx()\n\t\tselect {\n\t\tcase <-inputContext.Done:\n\t\tcase <-inputCtx.Done():\n\t\t}\n\t}()\n\n\t// If the input ever needs to be made restartable, then context would need\n\t// to be recreated with each restart.\n\tworkerCtx, workerCancel := context.WithCancel(inputCtx)\n\n\tin := &pubsubInput{\n\t\tconfig: conf,\n\t\tlog: logp.NewLogger(\"google.pubsub\").With(\n\t\t\t\"pubsub_project\", conf.ProjectID,\n\t\t\t\"pubsub_topic\", conf.Topic,\n\t\t\t\"pubsub_subscription\", conf.Subscription),\n\t\toutlet: out,\n\t\tinputCtx: inputCtx,\n\t\tworkerCtx: workerCtx,\n\t\tworkerCancel: workerCancel,\n\t\tackedCount: atomic.NewUint32(0),\n\t}\n\n\tin.log.Info(\"Initialized Google Pub/Sub input.\")\n\treturn in, nil\n}", "title": "" }, { "docid": "7b7754f94b370e209169d9e7585cd4fb", "score": "0.5305354", "text": "func (m MessageSupergroupChatCreate) construct() MessageContentClass { return &m }", "title": "" }, { "docid": "83ff374d13dd1c392ca2b9504ecc7a9f", "score": "0.5301717", "text": "func (inv *ActionNetworkCreateInvocation) NewInput() *ActionNetworkCreateInput {\n\tinv.Input = &ActionNetworkCreateInput{}\n\treturn inv.Input\n}", "title": "" }, { "docid": "c22381bbc3c3fbaa4e72bb8b3454b6cb", "score": "0.5251275", "text": "func (m MessageChatAddMembers) construct() MessageContentClass { return &m }", "title": "" }, { "docid": "4719bf69422b42be3311be47601f95c4", "score": "0.52302843", "text": "func (m MessageAudio) construct() MessageContentClass { return &m }", "title": "" }, { "docid": "fe94ab97406430423acf6a4305416be1", "score": "0.52259016", "text": "func (i InputKeyboardButtonURLAuth) construct() KeyboardButtonClass { return &i }", "title": "" }, { "docid": "3134b432ae431c4619d8406a1cc03bde", "score": "0.5211632", "text": "func (s SupergroupMembersFilterContacts) construct() SupergroupMembersFilterClass { return &s }", "title": "" }, { "docid": "6a537d7bc2d6f1a1cbe94817467eb460", "score": "0.52075714", "text": "func (c ChannelMessagesFilterEmpty) construct() ChannelMessagesFilterClass { return &c }", "title": "" }, { "docid": "bb2e1e3bb18e52de1bc6313a0dd0813d", "score": "0.5192505", "text": "func (m MessageChatShared) construct() MessageContentClass { return &m }", "title": "" }, { "docid": "55af374e4e31173bfc4cd526f5248259", "score": "0.5192051", "text": "func (m MessageVideoNote) construct() MessageContentClass { return &m }", "title": "" }, { "docid": "3531549ec29b2b581f007cb31cf40df4", "score": "0.5186887", "text": "func (this *PongMsgProc) Init(proto *Protocol) {\n this.parent = proto\n}", "title": "" }, { "docid": "349c66631fba6dccc497f9d6b2c96293", "score": "0.51754063", "text": "func (m MessageBasicGroupChatCreate) construct() MessageContentClass { return &m }", "title": "" }, { "docid": "1e54322d1ff9128624c01e1c7fcc6121", "score": "0.5166983", "text": "func (s SupergroupMembersFilterMention) construct() SupergroupMembersFilterClass { return &s }", "title": "" }, { "docid": "5f1b21822abec669c32bb1a868031cf6", "score": "0.5165188", "text": "func (m MessageVideo) construct() MessageContentClass { return &m }", "title": "" }, { "docid": "c9624fc95f44642e336133a2a6201002", "score": "0.51483613", "text": "func (m MessageChatChangePhoto) construct() MessageContentClass { return &m }", "title": "" }, { "docid": "133b332b3c437a59bb5ee83111093a6b", "score": "0.5146572", "text": "func newPeerBase(origCfg *Config, inbound bool) *Peer {\n\tcfg := *origCfg // Copy to avoid mutating caller.\n\n\tp := Peer{\n\t\tinbound: inbound,\n\t\tstallControl: make(chan StallControlMsg, 1), // nonblocking sync\n\t\toutputQueue: make(chan outMsg, outputBufferSize),\n\t\tsendQueue: make(chan outMsg, 1), // nonblocking sync\n\t\tsendDoneQueue: make(chan struct{}, 1), // nonblocking sync\n\t\tinQuit: make(chan struct{}),\n\t\tqueueQuit: make(chan struct{}),\n\t\toutQuit: make(chan struct{}),\n\t\tquit: make(chan struct{}),\n\t\tcfg: cfg, // Copy so caller can't mutate.\n\t\tservices: cfg.Services,\n\t\tprotocolVersion: cfg.ProtocolVersion,\n\t}\n\tp.AddMessageFunc(cfg.MessageFunc)\n\treturn &p\n}", "title": "" }, { "docid": "46a391e5912ee64584b8288fb370d678", "score": "0.5138405", "text": "func (m MessageVoiceNote) construct() MessageContentClass { return &m }", "title": "" }, { "docid": "01cc88091601c33fe39bd95197a79869", "score": "0.51318514", "text": "func NewInput(\n\tcfg *common.Config,\n\toutlet channel.Connector,\n\tcontext input.Context,\n) (input.Input, error) {\n\tinitLogger.Do(func() {\n\t\tlogger = logp.NewLogger(inputName)\n\t})\n\tout, err := outlet(cfg, context.DynamicFields)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tconfig := defaultConfig\n\tif err = cfg.Unpack(&config); err != nil {\n\t\tout.Close()\n\t\treturn nil, err\n\t}\n\n\tvar customFields []fields.FieldDict\n\tfor _, yamlPath := range config.CustomDefinitions {\n\t\tf, err := LoadFieldDefinitionsFromFile(yamlPath)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrapf(err, \"failed parsing custom field definitions from file '%s'\", yamlPath)\n\t\t}\n\t\tcustomFields = append(customFields, f)\n\t}\n\tdecoder, err := decoder.NewDecoder(decoder.NewConfig().\n\t\tWithProtocols(config.Protocols...).\n\t\tWithExpiration(config.ExpirationTimeout).\n\t\tWithCustomFields(customFields...))\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"error initializing netflow decoder\")\n\t}\n\n\tinput := &netflowInput{\n\t\toutlet: out,\n\t\tforwarder: harvester.NewForwarder(out),\n\t\tdecoder: decoder,\n\t\tlogger: logger,\n\t\tqueueSize: config.PacketQueueSize,\n\t}\n\n\tinput.udp = udp.New(&config.Config, input.packetDispatch)\n\treturn input, nil\n}", "title": "" }, { "docid": "9b85bbb38d473f50f9ff1d824ff92f52", "score": "0.5128578", "text": "func (m MessagePassportDataSent) construct() MessageContentClass { return &m }", "title": "" }, { "docid": "73043308efe5793d875d3d26bec66fcd", "score": "0.5126452", "text": "func DecodeInputPeer(buf *bin.Buffer) (InputPeerClass, error) {\n\tid, err := buf.PeekID()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tswitch id {\n\tcase InputPeerEmptyTypeID:\n\t\t// Decoding inputPeerEmpty#7f3b18ea.\n\t\tv := InputPeerEmpty{}\n\t\tif err := v.Decode(buf); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to decode InputPeerClass: %w\", err)\n\t\t}\n\t\treturn &v, nil\n\tcase InputPeerSelfTypeID:\n\t\t// Decoding inputPeerSelf#7da07ec9.\n\t\tv := InputPeerSelf{}\n\t\tif err := v.Decode(buf); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to decode InputPeerClass: %w\", err)\n\t\t}\n\t\treturn &v, nil\n\tcase InputPeerChatTypeID:\n\t\t// Decoding inputPeerChat#35a95cb9.\n\t\tv := InputPeerChat{}\n\t\tif err := v.Decode(buf); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to decode InputPeerClass: %w\", err)\n\t\t}\n\t\treturn &v, nil\n\tcase InputPeerUserTypeID:\n\t\t// Decoding inputPeerUser#dde8a54c.\n\t\tv := InputPeerUser{}\n\t\tif err := v.Decode(buf); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to decode InputPeerClass: %w\", err)\n\t\t}\n\t\treturn &v, nil\n\tcase InputPeerChannelTypeID:\n\t\t// Decoding inputPeerChannel#27bcbbfc.\n\t\tv := InputPeerChannel{}\n\t\tif err := v.Decode(buf); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to decode InputPeerClass: %w\", err)\n\t\t}\n\t\treturn &v, nil\n\tcase InputPeerUserFromMessageTypeID:\n\t\t// Decoding inputPeerUserFromMessage#a87b0a1c.\n\t\tv := InputPeerUserFromMessage{}\n\t\tif err := v.Decode(buf); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to decode InputPeerClass: %w\", err)\n\t\t}\n\t\treturn &v, nil\n\tcase InputPeerChannelFromMessageTypeID:\n\t\t// Decoding inputPeerChannelFromMessage#bd2a0840.\n\t\tv := InputPeerChannelFromMessage{}\n\t\tif err := v.Decode(buf); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to decode InputPeerClass: %w\", err)\n\t\t}\n\t\treturn &v, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unable to decode InputPeerClass: %w\", bin.NewUnexpectedID(id))\n\t}\n}", "title": "" }, { "docid": "a0f431b49ac43d5244f601519775ab1d", "score": "0.5107856", "text": "func NewInput(i *InputPlugin) {\n\tinputSync.Lock()\n\tdefer inputSync.Unlock()\n\n\tif i == nil || i.Input == nil {\n\t\tpanic(\"nil output or method passed to poller.NewOutput\")\n\t}\n\n\tinputs = append(inputs, i)\n}", "title": "" }, { "docid": "a3f5e58b7bb246c1dcca28794c5e91e4", "score": "0.5073369", "text": "func (m MessageContact) construct() MessageContentClass { return &m }", "title": "" }, { "docid": "9d046f60a0f220e7cce8e0ca12a01096", "score": "0.50662744", "text": "func (m MessageSuggestProfilePhoto) construct() MessageContentClass { return &m }", "title": "" }, { "docid": "fac10fcf53711dbfbefc8d4a31965637", "score": "0.5064896", "text": "func (m MessageGame) construct() MessageContentClass { return &m }", "title": "" }, { "docid": "d49f9f5f58eef77d934be3dea5062a0b", "score": "0.5050254", "text": "func (m MsgDetailedInfo) construct() MsgDetailedInfoClass { return &m }", "title": "" }, { "docid": "c2131ac8ce609a51e6c24480f08dbfcf", "score": "0.5031043", "text": "func (m MsgNewDetailedInfo) construct() MsgDetailedInfoClass { return &m }", "title": "" }, { "docid": "a1c3918e796628e4a040cfd5253899ec", "score": "0.50306326", "text": "func (m MessageChatUpgradeFrom) construct() MessageContentClass { return &m }", "title": "" }, { "docid": "5e41d934b6d111a200af87f034c4c798", "score": "0.5021776", "text": "func (k KeyboardButtonRequestPhone) construct() KeyboardButtonClass { return &k }", "title": "" }, { "docid": "f65a697de22e2cdfa8c44837305c411a", "score": "0.5013669", "text": "func (m MessageChatUpgradeTo) construct() MessageContentClass { return &m }", "title": "" }, { "docid": "2389a03712d55676cb06972260379e4c", "score": "0.5003104", "text": "func TestConstructorOf(t *testing.T) {\n\tConstructorOf(MessageEnvelope{})\n}", "title": "" }, { "docid": "c5009fe3dcb9fdc1b6a03611e631cd32", "score": "0.5002387", "text": "func (p Photo) construct() PhotoClass { return &p }", "title": "" }, { "docid": "d0c61d7c4f1f563549beb52922fbb1f6", "score": "0.50018424", "text": "func (m MessagePhoto) construct() MessageContentClass { return &m }", "title": "" }, { "docid": "5d2c76451dad02ea7d32c6b8a6c1f254", "score": "0.49951667", "text": "func (m MessageContactRegistered) construct() MessageContentClass { return &m }", "title": "" }, { "docid": "9195d2e7099715f7bb679179632ba15a", "score": "0.49805605", "text": "func (m MessageVideoChatEnded) construct() MessageContentClass { return &m }", "title": "" } ]
b10cd5dead96700021de691ae4c3ff3c
One would typically keep a channel of publishings, a sequence number, and a set of unacknowledged sequence numbers and loop until the publishing channel is closed.
[ { "docid": "4cfdd162a5057a5a5f493f7b174011dc", "score": "0.0", "text": "func confirmOne(confirms <-chan amqp.Confirmation) {\n\tlog.Printf(\"waiting for confirmation of one publishing\")\n\n\tif confirmed := <-confirms; confirmed.Ack {\n\t\tlog.Printf(\"confirmed delivery with delivery tag: %d\", confirmed.DeliveryTag)\n\t} else {\n\t\tlog.Printf(\"failed delivery of delivery tag: %d\", confirmed.DeliveryTag)\n\t}\n}", "title": "" } ]
[ { "docid": "c6e96441ff83664104f9224626f9c5de", "score": "0.6348614", "text": "func publisher(out chan string) {\r\n\tpublisherID++\r\n\tthisID := publisherID\r\n\tdataID := 0\r\n\tfor {\r\n\t\tdataID++\r\n\t\tfmt.Printf(\"publisher %d is pushing data\\n\", thisID)\r\n\t\tdata := fmt.Sprintf(\"Data from publisher %d. Data %d\", thisID, dataID)\r\n\t\tout <- data\r\n\t}\r\n}", "title": "" }, { "docid": "5cb21d061b8f5cac928f9e7ccf2cb5d0", "score": "0.6312045", "text": "func Publish(sessions chan chan Session, msgs <-chan Message, queueName string) {\n\n\tfor session := range sessions {\n\t\tvar (\n\t\t\trunning bool\n\t\t\treading = msgs\n\t\t\tpending = make(chan Message, 1)\n\t\t\tconfirm = make(chan amqp.Confirmation, 1)\n\t\t)\n\n\t\tpub := <-session\n\n\t\t// publisher confirms for this channel/connection\n\t\tif err := pub.Confirm(false); err != nil {\n\t\t\tlog.Printf(\"publisher confirms not supported\")\n\t\t\tclose(confirm) // confirms not supported, simulate by always nacking\n\t\t} else {\n\t\t\tpub.NotifyPublish(confirm)\n\t\t}\n\n\tPublish:\n\t\tfor {\n\t\t\tvar body Message\n\t\t\tselect {\n\t\t\tcase confirmed, ok := <-confirm:\n\t\t\t\tif !ok {\n\t\t\t\t\tbreak Publish\n\t\t\t\t}\n\t\t\t\tif !confirmed.Ack {\n\t\t\t\t\tlog.Printf(\"nack message %d, body: %q\", confirmed.DeliveryTag, string(body.Body))\n\t\t\t\t}\n\t\t\t\treading = msgs\n\n\t\t\tcase body = <-pending:\n\t\t\t\terr := pub.Publish(\"\", queueName, false, false, amqp.Publishing{\n\t\t\t\t\tBody: body.Body,\n\t\t\t\t})\n\n\t\t\t\t// Retry failed delivery on next session\n\t\t\t\tif err != nil {\n\t\t\t\t\tbody.Response <- false\n\t\t\t\t\tpending <- body\n\t\t\t\t\tpub.Close()\n\t\t\t\t\tbreak Publish\n\t\t\t\t}\n\n\t\t\t\t// Let response channel know all is ok\n\t\t\t\tbody.Response <- true\n\n\t\t\tcase body, running = <-reading:\n\t\t\t\t// all messages consumed\n\t\t\t\tif !running {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\t// work on pending delivery until ack'd\n\t\t\t\tpending <- body\n\t\t\t\treading = nil\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "275abda6d47d65222554115cc2b7f222", "score": "0.6270052", "text": "func publishHandler(p *nsq.Producer, publish chan *Message) {\n\tfor {\n\t\tm := <-publish\n\t\tif err := p.Publish(m.Topic, []byte(m.Body)); err != nil {\n\t\t\tlog.Print(err)\n\n\t\t\t// retry to send the message in 1 second\n\t\t\tgo func(m *Message) {\n\t\t\t\ttime.Sleep(time.Second)\n\t\t\t\tpublish <- m\n\t\t\t}(m)\n\n\t\t\tcontinue\n\t\t}\n\n\t\tlog.Printf(\"published message '%s' to topic '%s'\", m.Body, m.Topic)\n\t}\n}", "title": "" }, { "docid": "96b8dcb951926e318bb273b0476b7999", "score": "0.6226452", "text": "func (p *Producer) loop() {\n\t// handle success chan\n\tgo func() {\n\t\tdefer p.wg.Done()\n\t\tfor s := range p.asyncProducer.Successes() {\n\t\t\tp.loger.Debug(\"[Producer] Send message sucessed! Topic:%s, partitions:%d, offset:%d, timestamp:%s\", s.Topic, s.Partition, s.Offset, s.Timestamp.String())\n\t\t}\n\t}()\n\n\t// handle error chan\n\tgo func() {\n\t\tdefer p.wg.Done()\n\t\tfor err := range p.asyncProducer.Errors() {\n\t\t\tp.loger.Error(\"[Producer] Send message error!\", err.Err)\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "5146836c51e2081a49575e5f692b720e", "score": "0.6203876", "text": "func (p *SafeProducer) notifyPublish(notifier PublishNotifier) {\n\tconfirmations := make(chan amqp.Confirmation)\n\tp.publishNotifier = notifier\n\n\tgo func() {\n\t\tfor {\n\t\t\terr := p.channel.Confirm(false)\n\t\t\tif err != nil {\n\t\t\t\twait(p.channel.delaySeconds)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tatomic.StoreInt32(&p.confirmed, 1)\n\n\t\t\tgo func(publishings <-chan amqp.Publishing) {\n\t\t\t\tsemaphore := make(chan struct{}, DefaultRepublishRoutine)\n\t\t\t\tfor publishing := range publishings {\n\t\t\t\t\tmessage := publishing\n\t\t\t\t\tsemaphore <- struct{}{}\n\t\t\t\t\tgo func() {\n\t\t\t\t\t\tdefer func() { <-semaphore }()\n\t\t\t\t\t\tdebugf(\"quick republish message: %v, %v\", string(message.Body), message.Timestamp)\n\t\t\t\t\t\tp.Publish(message)\n\t\t\t\t\t}()\n\t\t\t\t}\n\t\t\t}(p.deliveryCache.Republish())\n\n\t\t\tatomic.StoreUint64(&p.deliveryTag, 0)\n\n\t\t\tfor c := range p.channel.NotifyPublish(make(chan amqp.Confirmation)) {\n\t\t\t\tconfirmations <- c\n\t\t\t}\n\t\t\twait(p.channel.delaySeconds)\n\t\t\tif p.channel.IsClosed() {\n\t\t\t\tclose(confirmations)\n\t\t\t\tdebug(\"confirmations closed\")\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tatomic.StoreInt32(&p.confirmed, 0)\n\t\t}\n\t}()\n\n\tgo func() {\n\t\tfor confirm := range confirmations {\n\t\t\t// dc, ok := p.deliveryCache.(*DeliveryMapCache)\n\t\t\t// if ok {\n\t\t\t// \tdebug(dc.deliveryMap, p.deliveryTag, confirm.DeliveryTag)\n\t\t\t// }\n\t\t\tmessage := p.deliveryCache.Load(confirm.DeliveryTag)\n\t\t\tnotifier(p, message, confirm)\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "87165b30f22c6906bf5e2515b39f931e", "score": "0.6150225", "text": "func (p *publisher) Run(wg *sync.WaitGroup, quit <-chan struct{}) {\n\tdefer wg.Done()\n\tp.debugf(\"running event publisher %d\", p.ID)\n\terr := p.createChannel()\n\tif err != nil {\n\t\terr = errors.Wrap(err, \"cant create publisher channel\")\n\t\tp.ShouldQuit <- err\n\t\treturn\n\t}\n\tfor {\n\t\tselect {\n\t\tcase pub := <-p.Publishings:\n\t\t\tmsg := eventToPublishing(pub.e)\n\t\t\terr := p.ch.Publish(p.Exchange, pub.e.Name, false, false, *msg)\n\t\t\tif err != nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tp.tag++\n\t\t\tp.publishings[p.tag] = pub\n\t\tcase c := <-p.confirms:\n\t\t\tpub := p.publishings[c.DeliveryTag]\n\t\t\tdelete(p.publishings, c.DeliveryTag)\n\t\t\tif !c.Ack {\n\t\t\t\tpub.err = fmt.Errorf(\"publisher %d delivery %d nacked by broker\", p.ID, c.DeliveryTag)\n\t\t\t}\n\t\t\tpub.done <- c.Ack\n\t\tcase amqpErr, ok := <-p.err:\n\t\t\tif ok {\n\t\t\t\tif err := p.handleProtocolError(amqpErr); err != nil {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\tcase <-quit:\n\t\t\tp.debugf(\"stopping event publisher %d\", p.ID)\n\t\t\twaitForOutstandingPublishings(p.publishings, p.ShutdownTimeout)\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "11f3cef9131c59821d18231b44f84a9f", "score": "0.6081102", "text": "func produce(link chan<- int, id int, wg *sync.WaitGroup) {\n\tdefer wg.Done()\n\tfor _, amount := range messages[id] {\n\t\tlink <- amount\n\t}\n}", "title": "" }, { "docid": "11f3cef9131c59821d18231b44f84a9f", "score": "0.6081102", "text": "func produce(link chan<- int, id int, wg *sync.WaitGroup) {\n\tdefer wg.Done()\n\tfor _, amount := range messages[id] {\n\t\tlink <- amount\n\t}\n}", "title": "" }, { "docid": "385f4ed7f61c0b12c0546361c16a1756", "score": "0.6049448", "text": "func (this *WorkerPnb) doPublish(push *Push) {\n\tlog.Debug(\"push.body in pnb: ID[%d], body[%s]\", push.id, push.Body)\n\tpnb := messaging.NewPubnub(this.config.PublishKey,\n\t\tthis.config.SubscribeKey, this.config.SecretKey,\n\t\tthis.config.CipherKey, this.config.UseSsl, \"\")\n\tmsg, _, channels := push.Unmarshal(string(push.Body))\n\tlog.Debug(\"message : %s\", msg)\n\tlog.Debug(\"push to : %s\", channels)\n\tfor _, channel := range channels {\n\t\tgo func(channel string) {\n\t\t\tsuccessChannel := make(chan []byte)\n\t\t\terrorChannel := make(chan []byte)\n\t\t\tlog.Debug(\"channel : %s\", channel)\n\t\t\tgo pnb.Publish(channel, msg, successChannel, errorChannel)\n\t\t\tselect {\n\t\t\tcase msg := <-successChannel:\n\t\t\t\t//push.conn.Delete(push.id) // ack success\n\t\t\t\tlog.Debug(\"pnb: %s\", string(msg))\n\n\t\t\tcase err := <-errorChannel:\n\t\t\t\t//push.conn.Bury(push.id, 1) // ack fail\n\t\t\t\tlog.Error(\"pnb: %s\", string(err))\n\t\t\t}\n\t\t}(channel)\n\t}\n\n}", "title": "" }, { "docid": "7d7ae457963ff7a6603a8a1d5fa27444", "score": "0.6008167", "text": "func publish(subscriptions map[chan string][]chan string) {\n\tfor {\n\t\tfor publisher, subscribers := range subscriptions {\n\t\t\tselect {\n\t\t\tcase message := <-publisher:\n\t\t\t\tfor _, subscriber := range subscribers {\n\t\t\t\t\tsubscriber <- message\n\t\t\t\t}\n\t\t\tcase <-time.After(time.Millisecond):\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "48ed0cb30a94c040977685e30581bb80", "score": "0.5928641", "text": "func (n *nmq) consume() {\n\tfor {\n\n\t\tfor i := 0; i < len(n.channels); i++ {\n\t\t\tn.consumeKey(n.channels[i]) // nolint\n\t\t}\n\n\t\t//time.Sleep(n.poolTime)\n\t}\n}", "title": "" }, { "docid": "a538a63e2ac23e4ab3b7d430565a4ce4", "score": "0.59104824", "text": "func (n *notificationChannels) wait() {\n\tfor {\n\t\tn.mu.Lock()\n\t\tch := n.mu.ch\n\t\tn.mu.ch = nil\n\t\tn.mu.Unlock()\n\n\t\tif len(ch) == 0 {\n\t\t\tbreak\n\t\t}\n\n\t\tfor _, c := range ch {\n\t\t\t<-c\n\t\t}\n\t}\n}", "title": "" }, { "docid": "343e167d697bf51c85a0b93af1f6d69b", "score": "0.5898733", "text": "func responder(rmqchannel *amqp.Channel, datachannel chan rmqdata){\n\n for data := range datachannel{\n\n datacontents,err:=json.Marshal(data)\n if err!=nil{\n fmt.Println(\"Error converting response data to byte slice=\", err.Error())\n continue\n }\n msg := amqp.Publishing{\n DeliveryMode: amqp.Persistent,\n Type: \"topic\",\n Timestamp: time.Now(),\n ContentType: \"text/plain\",\n Body: datacontents,\n }\n if err:=rmqchannel.Publish(EXCHANGE_NAME, data.ResponseKey, false, false, msg); err!=nil{\n fmt.Println(\"Error publishing response message to RMQ=\", err.Error())\n }\n }\n}", "title": "" }, { "docid": "2818a2aeee081759f88f551c6bdfd711", "score": "0.58982044", "text": "func Produce(ch chan int) {\n\tfor i := 0; i < 6; i++ {\n\t\tch <- i // can be locked here, waiting for readers\n\t}\n\n\t// close writting, you cannot write after close\n\tclose(ch)\n}", "title": "" }, { "docid": "a3275c08241c5f8e1a2dba92e30dd5d9", "score": "0.58955944", "text": "func main() {\n\tdone := make(chan bool)\n\tgo publishMessage()\n\t<-done\n\n}", "title": "" }, { "docid": "c41ffc851632169417cddfa38c10e2a0", "score": "0.5886886", "text": "func reliablePublisher(ch *Channel, params *rpRunning, done *syncutil.Waiter) {\n\tdefer done.Done() // signal on exit\n\tdefer close(params.result_ch) // result will be pushed first (see below)\n\tdefer close(params.acked)\n\tdefer close(params.nacked)\n\n\t// set up result structure; push on exit\n\tresult := &rpResult{}\n\tresult.initialize()\n\tdefer func() { params.result_ch <- result }() // will be called before done.Done()\n\n\t// for managing actual publisher routine (makes blocking Publish() calls)\n\t// lock-step signaling (req/rep pattern)\n\ttopublish := make(chan *PublishRequest) // capacity=0 so we're never queuing requests internally\n\tpubresults := make(chan error, 1) // capacity=1 so we can queue one response (so publisher can always exit)\n\tdefer close(topublish) // will signal routine to stop\n\n\t// define raw publisher routine (because Publish() may block)\n\t// reads input from <topublish>, writes results to <pubresults>\n\t// reads until <topublish> closed, closes <pubresults> on exit\n\tpublisher := func() {\n\t\tdefer close(pubresults) // close when done\n\t\tfor p := range topublish {\n\t\t\t// Publish(exchange, key, mandatory, immediate, msg)\n\t\t\tpubresults <- ch.Publish(p.Exchange, p.Key, p.Mandatory, p.Immediate, *p.Message)\n\t\t}\n\t}\n\tgo publisher()\n\n\t// for managing event loop\n\tlastseqnum := uint64(0) // first is 1\n\toutstanding := result.Outstanding // keyed on sequence number (automatically update result)\n\tready := true // publish routine ready?\n\tquitting := false // not yet\n\tvar quit_timer <-chan time.Time // will be set when quitting\n\n\t// helper functions\n\thandleResult := func(num uint64, output chan *PublishResult, err error, label string) { // got an ack/nack/error back from publisher\n\t\treq, ok := outstanding[num] // get request\n\t\tif !ok { // not found\n\t\t\tfmt.Printf(\"ReliablePublisher(): ERROR: received unexpected %s: %v\\n\", label, num)\n\t\t}\n\t\tdelete(outstanding, num) // remove it from the map\n\t\toutput <- &PublishResult{num, err, req} // send it to output channel\n\t}\n\tstartToQuit := func() {\n\t\tquitting = true // continue looping to handle remaining acks/nacks\n\t\tquit_timer = time.After(QUIT_TIMEOUT) // set quit timer\n\t\tif len(outstanding) > 0 {\n\t\t\tfmt.Printf(\"ReliablePublisher(): handling acks for %v outstanding msgs before exiting\\n\", len(outstanding))\n\t\t}\n\t}\n\n\t// loop, publishing messages & handling events\nloop:\n\tfor {\n\t\tif quitting && len(outstanding) == 0 { // no more acks/nacks to process?\n\t\t\tbreak loop\n\t\t}\n\n\t\tselect { // check for events\n\n\t\t// quit timer expired?\n\t\tcase <-quit_timer:\n\t\t\tbreak loop\n\n\t\t// quit signaled?\n\t\tcase <-params.quit_ch:\n\t\t\tfmt.Println(\"ReliablePublisher(): got quit signal\")\n\t\t\tstartToQuit()\n\n\t\t// connection or channel exception?\n\t\tcase result.Error = <-ch.CloseEvents(): // if so, set result error code\n\t\t\tfmt.Printf(\"ReliablePublisher(): got connection/channel exception: %v\\n\", result.Error)\n\t\t\tbreak loop\n\n\t\t// got an ack (or ack channel closed)?\n\t\tcase acknum, ok := <-ch.AckEvents():\n\t\t\tif !ok { // ack channel closed (probably resulting from channel close exception)\n\t\t\t\tfmt.Println(\"ReliablePublisher(): ack channel closed unexpectedly\")\n\t\t\t\tbreak loop\n\t\t\t}\n\t\t\thandleResult(acknum, params.acked, nil, \"ack\") // handle ack\n\n\t\t// got a nack (or nack channel closed)?\n\t\tcase nacknum, ok := <-ch.NackEvents():\n\t\t\tif !ok { // nack channel closed (probably resulting from channel close exception)\n\t\t\t\tfmt.Println(\"ReliablePublisher(): ERROR: nack channel closed unexpectedly\")\n\t\t\t\tbreak loop\n\t\t\t}\n\t\t\thandleResult(nacknum, params.nacked, nil, \"nack\") // handle nack\n\n\t\t// got a result from publisher routine?\n\t\tcase err := <-pubresults:\n\t\t\tready = true // publisher free\n\t\t\tif err != nil { // error\n\t\t\t\thandleResult(lastseqnum, params.nacked, err, \"Publish() error\") // handle as nack w/ error\n\t\t\t}\n\n\t\t// no channels ready\n\t\tdefault:\n\t\t\tswitch {\n\n\t\t\t// quitting? still have to handle acks/nacks in flight\n\t\t\t// not ready? waiting for a response from publisher routine\n\t\t\tcase quitting || !ready:\n\t\t\t\ttime.Sleep(time.Microsecond) // and continue\n\n\t\t\t// running & ready: try get next request\n\t\t\tdefault:\n\t\t\t\tselect { // don't block\n\t\t\t\tcase req, ok := <-params.requests: // got one (or channel closed)\n\t\t\t\t\tswitch ok {\n\n\t\t\t\t\tcase true: // got a request\n\t\t\t\t\t\ttopublish <- req // send it to publisher\n\t\t\t\t\t\tready = false // publisher busy\n\t\t\t\t\t\tlastseqnum++ // update seqnum\n\t\t\t\t\t\toutstanding[lastseqnum] = req // put it in the map\n\n\t\t\t\t\tcase false: // input closed\n\t\t\t\t\t\tfmt.Println(\"ReliablePublisher(): input closed\")\n\t\t\t\t\t\tstartToQuit()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(outstanding) > 0 {\n\t\tfmt.Printf(\"ReliablePublisher(): WARNING: exiting with %v msgs not acked/nacked\\n\", len(outstanding))\n\t}\n}", "title": "" }, { "docid": "4e4f49c47e57d152e822f1aa30910f75", "score": "0.5886131", "text": "func (w *connSessionWatcher) publish(expired bool) {\n\tw.lock.Lock()\n\tdefer w.lock.Unlock()\n\n\tfor _, ch := range w.watchers {\n\t\tch <- expired\n\t\tclose(ch)\n\t}\n\tw.watchers = make([]chan bool, 0)\n}", "title": "" }, { "docid": "e00d197c9fac5e53fdd7e00695e5ce8a", "score": "0.5845561", "text": "func (n *NSQ) loop() {\n\tvar (\n\t\tmRunning = n.stats.GetGauge(\"output.nsq.running\")\n\t\tmCount = n.stats.GetCounter(\"output.nsq.count\")\n\t\tmSendErr = n.stats.GetCounter(\"output.nsq.send.error\")\n\t\tmSendSucc = n.stats.GetCounter(\"output.nsq.send.success\")\n\t)\n\n\tdefer func() {\n\t\tatomic.StoreInt32(&n.running, 0)\n\n\t\tn.disconnect()\n\t\tmRunning.Decr(1)\n\n\t\tclose(n.closedChan)\n\t}()\n\tmRunning.Incr(1)\n\n\tfor {\n\t\tif err := n.connect(); err != nil {\n\t\t\tn.log.Errorf(\"Failed to connect to NSQ: %v\\n\", err)\n\t\t\tselect {\n\t\t\tcase <-time.After(time.Second):\n\t\t\tcase <-n.closeChan:\n\t\t\t\treturn\n\t\t\t}\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\tn.log.Infof(\"Sending NSQ messages to address: %s\\n\", n.conf.NSQ.Address)\n\n\tvar open bool\n\tfor atomic.LoadInt32(&n.running) == 1 {\n\t\tvar ts types.Transaction\n\t\tselect {\n\t\tcase ts, open = <-n.transactions:\n\t\t\tif !open {\n\t\t\t\treturn\n\t\t\t}\n\t\tcase <-n.closeChan:\n\t\t\treturn\n\t\t}\n\t\tmCount.Incr(1)\n\t\terr := ts.Payload.Iter(func(i int, p types.Part) error {\n\t\t\treturn n.producer.Publish(n.conf.NSQ.Topic, p.Get())\n\t\t})\n\t\tif err != nil {\n\t\t\tmSendErr.Incr(1)\n\t\t} else {\n\t\t\tmSendSucc.Incr(1)\n\t\t}\n\t\tselect {\n\t\tcase ts.ResponseChan <- response.NewError(err):\n\t\tcase <-n.closeChan:\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9a5f5f3b84b07d7c6e6b7ceee1e3da85", "score": "0.5819029", "text": "func mainchannel(){\n c:=make(chan string)\n go countchannel(\"sheep\",c)//this function sen input via c\n\n for{\n msg,open:=<-c//wait until is received (blocking nature)\n if!open{ //to check whether channel is close, if so break for loop and main routine will come to an end\n break\n }\n fmt.Println(msg)\n\n /*or write another way\n for msg:=range c{\n if!open{\n break\n }\n fmt.Println(msg)\n }\n */\n \n }\n}", "title": "" }, { "docid": "70ab6d2667d000d8414261370d14efae", "score": "0.58044535", "text": "func producer() {\n\ti := 1\n\n\tfor {\n\t\teventChannel <- i\n\t\tif i == 100 {\n\t\t\ti = 1\n\t\t} else {\n\t\t\ti++\n\t\t}\n\t\ttime.Sleep(time.Millisecond * 100)\n\t}\n}", "title": "" }, { "docid": "b9f0178e52c5a1a39352b9cdb88854ce", "score": "0.5796899", "text": "func (p *AssuredPublisher) ensureChannel() {\n\tp.getChannelWithoutLock()\n\tp.lock.Lock()\n\tcloseChannel := p.closeChannel\n\tp.lock.Unlock()\n\tselect {\n\tcase e := <-closeChannel:\n\t\tlog.Printf(\"Error: publisher's channel has been closed (%+#v). Recreating it\", e)\n\t\tp.lock.Lock()\n\t\tp._channel = nil\n\t\tp.lock.Unlock()\n\t\tp.reconnect()\n\tdefault:\n\t}\n}", "title": "" }, { "docid": "a6a72fe85669a43876accadc8d1057a4", "score": "0.5795446", "text": "func main() {\n\tsize := flag.Int(\"size\", 10, \"Size of payload in bytes\")\n\tcount := flag.Int(\"count\", 10, \"Number of messages to publish\")\n\tflag.Parse()\n\n\tamqpConn, err := amqp.DialConfig(\"amqp://lunar:lunar@localhost:5672\", amqp.Config{\n\t\tVhost: \"/\",\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer amqpConn.Close()\n\n\tchannel, err := amqpConn.Channel()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer channel.Close()\n\terr = channel.ExchangeDeclare(\"amqp-load\", \"topic\", true, false, false, false, nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\t_, err = channel.QueueDeclare(\"load\", true, false, false, false, nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\terr = channel.QueueBind(\"load\", \"#\", \"amqp-load\", false, nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tvar wg sync.WaitGroup\n\twg.Add(*count)\n\tlog.Printf(\"Publishing %d messages\", *count)\n\tp := payload(*size)\n\tfor i := 0; i < *count; i++ {\n\t\tgo func() {\n\t\t\tdefer wg.Done()\n\t\t\terr = channel.PublishWithContext(context.Background(), \"amqp-load\", \"load\", false, false, amqp.Publishing{\n\t\t\t\tBody: p,\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t}()\n\t}\n\tlog.Printf(\"Waiting for publications to complete\")\n\twg.Wait()\n}", "title": "" }, { "docid": "87bdf79d205d2bbc1975ec3ef2418cfe", "score": "0.57653403", "text": "func (cp *ConnectionPool) Publish(p amqp.Publishing, s RabbitServer, q RabbitQueue, route ...string) (e porterr.IError) {\n\t// Get connection with initiated channel\n\tconn, e := cp.GetConnection(s)\n\tif e != nil {\n\t\treturn\n\t}\n\t// Publish to all routing keys\n\tfor _, key := range route {\n\t\terr := conn.Publish(q.Exchange, key, false, false, p)\n\t\tif err != nil {\n\t\t\te = porterr.NewF(porterr.PortErrorProducer, err.Error())\n\t\t\tbreak\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "3f4142fef61e68e515144ec945d45d59", "score": "0.57623416", "text": "func main() {\n\tconn, err := amqp.Dial(\"amqp://guest:guest@localhost:5672/\")\n\tu.FailOnError(err, \"Failed to connect to RabbitMQ\")\n\tdefer conn.Close()\n\n\tch, err := conn.Channel()\n\tu.FailOnError(err, \"Failed to open a channel\")\n\tdefer ch.Close()\n\n\tq, err := ch.QueueDeclare(\n\t\t\"stuffs\", // name\n\t\ttrue, // durable\n\t\tfalse, // delete when unused\n\t\tfalse, // exclusive\n\t\tfalse, // no-wait\n\t\tnil, // arguments\n\t)\n\tu.FailOnError(err, \"Failed to declare a queue\")\n\n\tmsgs, err := ch.Consume(\n\t\tq.Name, // queue\n\t\t\"\", // consumer\n\t\tfalse, // auto-ack\n\t\tfalse, // exclusive\n\t\tfalse, // no-local\n\t\tfalse, // no-wait\n\t\tnil, // args\n\t)\n\n\tu.FailOnError(err, \"Failed to register a consumer\")\n\n\tforever := make(chan bool)\n\n\tgo enqueuer(outgoing)\n\n\tgo func() {\n\t\ti := 0\n\t\tfor d := range msgs {\n\t\t\tfmt.Println(\"Beginning\", time.Now().UnixNano())\n\t\t\td.Ack(true)\n\t\t\tdata := e.GojayUnmarshal(d.Body)\n\n\t\t\treturnResult(data)\n\t\t\tfmt.Printf(\"End of # %v: %v \\n\", i, time.Now().UnixNano())\n\t\t\ti++\n\t\t}\n\n\t}()\n\n\tlog.Printf(\" [*] Waiting for messages. To exit press CTRL+C\")\n\t<-forever\n\n}", "title": "" }, { "docid": "da1b6f8b1359f2ea3eb945a89d688864", "score": "0.5757468", "text": "func main() {\n\tch := make(chan int)\n\n\tfor i := 0; i < 5; i++ {\n\t\tgo consumer(i, ch)\n\t}\n\n\tproduce(ch)\n\n\tfmt.Println(\"done :)\")\n}", "title": "" }, { "docid": "3b2b723387fd18dcbdcdf7b25b3ef7a1", "score": "0.5754202", "text": "func (px *Paxos) Pusher() {\n for px.dead == false {\n px.mu.Lock()\n for i, s := range px.Seqs {\n if !s.Decided{\n DPrintf(\"[PAXOS] \" + px.peers[px.me] + \": PUSHER: pushing seq \" + strconv.Itoa(i))\n go px.Proposer(i, s.Value)\n }\n }\n px.mu.Unlock()\n time.Sleep(100 * time.Millisecond)\n }\n}", "title": "" }, { "docid": "274d161b62181856a53a8f144e64d28a", "score": "0.5732926", "text": "func (mq *rabbitmqPublisher) Publish(buffer *bytes.Buffer) error {\n\tif !mq.isConnected {\n\t\treturn errors.New(\"failed to push: not connected\")\n\t}\n\tfor {\n\t\terr := mq.UnsafePush(buffer)\n\t\tif err != nil {\n\t\t\tif err == ErrDisconnected {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\t\tselect {\n\t\tcase confirm := <-mq.notifyConfirm:\n\t\t\tif confirm.Ack {\n\t\t\t\treturn nil\n\t\t\t}\n\t\tcase <-time.After(mq.configuration.ResendDelay):\n\t\t}\n\t}\n}", "title": "" }, { "docid": "32e6aeddc5792059cb3755c137ff73dc", "score": "0.5726498", "text": "func (rp *Republisher) republish() {\n\tlog.Debug().Msg(\"republisher: republish: triggered.\")\n\trp.mu.Lock()\n\tdefer rp.mu.Unlock()\n\n\tqs := rp.qManager.Queues()\n\tlog.Debug().Msgf(\"republisher: republish: number of queues to process: %d\", len(qs))\n\n\tif len(qs) == 0 {\n\t\t// If there are no queues then there is nothing for us to do.\n\t\treturn\n\t}\n\n\twriteCh := make(chan runQueueItem)\n\tvar wg sync.WaitGroup\n\twg.Add(len(qs))\n\n\tgo func() {\n\t\twg.Wait()\n\t\tclose(writeCh)\n\t}()\n\n\trun := newRun(\n\t\ttime.Now(), // Read up until now.\n\t\tqs,\n\t)\n\n\tfor i := range run.queues {\n\t\tgo func(rq *runQueue) {\n\t\t\tdefer wg.Done()\n\t\t\trp.processQueue(rq, writeCh, run.until)\n\t\t}(&run.queues[i])\n\t}\n\n\t// Based on our max in flight limit, create workers to publish messages and\n\t// wait for acknowledgements.\n\tconcurrency := rp.opts.maxInFlight\n\tvar pubWg sync.WaitGroup\n\treadCh := make(chan runQueueItem)\n\tvar running int\n\tfor qi := range writeCh {\n\t\tselect {\n\t\t// If there is a worker waiting for a message then use it.\n\t\tcase readCh <- qi:\n\t\t\tcontinue\n\t\tdefault:\n\t\t\tif concurrency == -1 || running < concurrency {\n\t\t\t\t// No workers available, so create a new one.\n\t\t\t\trunning++\n\t\t\t\tlog.Debug().Msgf(\"republisher: republish: spinning up new worker: %d\", running)\n\n\t\t\t\tpubWg.Add(1)\n\t\t\t\tgo func() {\n\t\t\t\t\tdefer pubWg.Done()\n\t\t\t\t\trp.publishMessages(readCh)\n\t\t\t\t}()\n\t\t\t}\n\t\t\treadCh <- qi\n\t\t}\n\t}\n\tclose(readCh)\n\tpubWg.Wait()\n\n\t// Update the checkpoint for the queues.\n\t// There could in theory be a lot of them so we'll try to do them\n\t// concurrently.\n\tvar updateCpWg sync.WaitGroup\n\tupdateCpWg.Add(len(run.queues))\n\tfor i := range run.queues {\n\t\tgo func(rq *runQueue) {\n\t\t\tdefer updateCpWg.Done()\n\t\t\tif err := rq.saveCheckpoint(); err != nil {\n\t\t\t\tlog.Err(err).Msg(\"problem saving checkpoint\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}(&run.queues[i])\n\t}\n\tupdateCpWg.Wait()\n}", "title": "" }, { "docid": "a6e78d896c89372357383e72c1e6c719", "score": "0.571843", "text": "func channel_producer(p *Producer) {\n\n\tfor m := range p.ProduceChannel {\n\t\terr := p.produce(m, C.RD_KAFKA_MSG_F_BLOCK, nil, nil)\n\t\tif err != nil {\n\t\t\tm.TopicPartition.Error = err\n\t\t\tp.Events <- m\n\t\t}\n\t}\n\n\tp.handle.terminated_chan <- \"channel_producer\"\n}", "title": "" }, { "docid": "a14e310c505f414ded10db3adf1cf8e5", "score": "0.57025665", "text": "func publishRoutine(channels string, message string) {\n\terrorChannel := make(chan []byte)\n\tsuccessChannel := make(chan []byte)\n\tfmt.Println(\"Publishing message: \", message)\n\tgo pub.Publish(channels, message, successChannel, errorChannel)\n\tgo handleResult(successChannel, errorChannel, messaging.GetNonSubscribeTimeout(), \"Publish\")\n}", "title": "" }, { "docid": "fd01546f6837d1dd9422027bf9f6ac7c", "score": "0.5700084", "text": "func (r *Registry) Publish(channel Channel, event Event) {\n\tr.Lock()\n\tdefer r.Unlock()\n\n\tfor id, fn := range r.functions {\n\t\tif fn(channel, event) {\n\t\t\tstream := r.streams[id]\n\n\t\t\t// Perform a non-blocking send to the stream so that we can detect the\n\t\t\t// situation where a client has a full stream and isn't draining events from\n\t\t\t// it. When this happens we'll continue sending to the remaining clients.\n\t\t\tselect {\n\t\t\tcase stream <- event: // success\n\t\t\tdefault: // failure\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "548c1e22cfa8b4f04207e474268c0daf", "score": "0.56947935", "text": "func countchannel(thing string,c chan string ){\n for i:=1;i<=10;i++{\n tt := strconv.Itoa(i)+thing\n c<-tt//wait until ready to be sent (blocking nature)\n time.Sleep(time.Millisecond*500)\n }\n close(c)//need to close channel \n}", "title": "" }, { "docid": "22ed830e5faf7561155695e57609e174", "score": "0.56359464", "text": "func producer(first chan int) {\n\tdefer close(first)\n\tfor i := 0; i < 10; i++ {\n\t\tfirst <- i\n\t}\n}", "title": "" }, { "docid": "9e900a65a954f705e274e540def50fe6", "score": "0.56329095", "text": "func (rp *Republisher) publishMessages(ch <-chan runQueueItem) {\n\tfor rqi := range ch {\n\t\tfb := flatbuf.GetRootAsRequeueMessage(rqi.queueItem.V, 0)\n\n\t\tlog.Debug().\n\t\t\tStr(\"msg\", string(fb.OriginalPayloadBytes())).\n\t\t\tMsg(\"republishing message\")\n\n\t\tif rqi.queueItem.IsExpired() {\n\t\t\t// Don't send a message with an expired TTL.\n\t\t\t// TTL will take care of removing the message from disk for us.\n\t\t\tlog.Debug().\n\t\t\t\tStr(\"msg\", string(fb.OriginalPayloadBytes())).\n\t\t\t\tMsg(\"message is expired\")\n\t\t\tcontinue\n\t\t}\n\n\t\tsubj := string(fb.OriginalSubject())\n\t\tdata := fb.OriginalPayloadBytes()\n\n\t\trqi.runQueue.q.Stats.AddInFlight(1)\n\t\t_, err := rp.nc.Request(subj, data, rp.opts.ackTimeout)\n\t\trqi.runQueue.q.Stats.AddInFlight(-1)\n\t\tif err != nil {\n\t\t\tlog.Err(err).\n\t\t\t\tStr(\"msg\", string(fb.OriginalPayloadBytes())).\n\t\t\t\tMsg(\"error doing Request for message\")\n\n\t\t\t// We just spent a retry.\n\t\t\t// So if retires == 1 it will now be zero and we should throw away the message.\n\t\t\t// If retires > 1 then there are retries still left to be spent.\n\t\t\tif fb.Retries() > 1 {\n\t\t\t\t// Requeue the message to disk for a future time.\n\t\t\t\tif err := rp.requeueMessageToDisk(rqi, fb); err != nil {\n\t\t\t\t\tlog.Err(err).\n\t\t\t\t\t\tInterface(\"queueItem\", rqi.queueItem).\n\t\t\t\t\t\tMsg(\"unable to requeue message\")\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\t// Got the ACK or ran out of retries.\n\t\t// Remove the message from disk.\n\t\tif err := rp.removeMessageFromDisk(rqi.queueItem, fb); err != nil {\n\t\t\tlog.Err(err).\n\t\t\t\tInterface(\"queueItem\", rqi.queueItem).\n\t\t\t\tMsg(\"unable to remove message from store\")\n\t\t\t// Should we stop processing?\n\t\t\tcontinue\n\t\t}\n\t\trqi.runQueue.q.Stats.AddCount(-1)\n\t}\n}", "title": "" }, { "docid": "e16dfa474f58cb3f7ed54225d17c4e0d", "score": "0.5617561", "text": "func consumer(id int, ch <-chan int) {\n\t// only finishes the loop when the channel is drained and closed // HL\n\tfor v := range ch {\n\t\tfmt.Printf(\"[%d] received: %d\\n\", id, v)\n\t}\n}", "title": "" }, { "docid": "bdf7341abd90eac822b3969ecca25a7f", "score": "0.56049067", "text": "func (ps *PubSub) Publish(message string) {\n\tif ps.closed {\n\t\treturn\n\t}\n\n\tlistLength := len(ps.subs)\n\tfor i := 0; i < listLength; i++ {\n\t\tif ps.subs[i] != nil {\n\t\t\tselect {\n\t\t\tcase ps.subs[i] <- message:\n\t\t\tdefault:\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c326ba0e3bb42561f159b1278f5dffa9", "score": "0.5604399", "text": "func producerReceiver1() {\n\tc := make(chan int)\n\tgo producer(c)\n\tfor {\n\t\tv, ok := <-c\n\t\tif !ok {\n\t\t\tbreak\n\t\t}\n\t\tfmt.Println(\"Received\", v, ok)\n\t}\n}", "title": "" }, { "docid": "79259d5ea9c9ecf1378a6f0a79a968dc", "score": "0.56031466", "text": "func example3() {\n\trabbitmq1, err1 := gorabbitmq.NewRabbitMqSubscription(\"exchange.example3\", MQURL)\n\tdefer rabbitmq1.Destroy()\n\tif err1 != nil {\n\t\tlog.Println(err1)\n\t}\n\trabbitmq2, err2 := gorabbitmq.NewRabbitMqSubscription(\"exchange.example3\", MQURL)\n\tdefer rabbitmq2.Destroy()\n\tif err2 != nil {\n\t\tlog.Println(err2)\n\t}\n\n\tgo func() {\n\t\tfor i := 0; i < 10000; i++ {\n\t\t\trabbitmq1.Publish(\"消息:\" + strconv.Itoa(i))\n\t\t}\n\t}()\n\n\tgo func() {\n\t\tmsgs, err3 := rabbitmq2.Consume()\n\t\tif err3 != nil {\n\t\t\tlog.Println(err3)\n\t\t}\n\t\tfor d := range msgs {\n\t\t\tlog.Printf(\"接受到了:%s\", d.Body)\n\t\t}\n\t}()\n\n\tforever := make(chan bool)\n\t<-forever\n}", "title": "" }, { "docid": "855b0ad927586a3bb19b5d496db26fab", "score": "0.559798", "text": "func (wss *webSocketServer) publish(msg []byte) {\n\twss.subscribersMu.Lock()\n\tdefer wss.subscribersMu.Unlock()\n\n\twss.publishLimiter.Wait(context.Background())\n\n\tfor s := range wss.subscribers {\n\t\tselect {\n\t\tcase s.msgs <- msg:\n\t\tdefault:\n\t\t\tgo s.closeSlow()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4d33030c73c5ce2ef80432ad12150f25", "score": "0.55947995", "text": "func (p *AssuredPublisher) initNewChannel() {\n\tchannel := p.getChannelWithoutLock()\n\tcloseChannel := channel.NotifyClose(make(chan *amqp.Error, 1))\n\tp.lock.Lock()\n\tp.closeChannel = closeChannel\n\tp.sequenceNumber = 0\n\tp.lock.Unlock()\n\tgo p.continuoslyReceiveConfirmations()\n}", "title": "" }, { "docid": "af6ae244e21d85abbf9d7088e4d8163c", "score": "0.5577539", "text": "func producersAndConsumers() {\n\n\t// This is a producer thread that fills the pipeline\n\tproducer := func(p chan int) {\n\t\tfor i := 0; i < 5; i++ {\n\t\t\ttime.Sleep(500 * time.Millisecond)\n\t\t\tp <- rand.Intn(100)\n\t\t}\n\t\tclose(p) // no more production is coming\n\t}\n\n\tpipeline := make(chan int)\n\tgo producer(pipeline)\n\n\t// This range will read from the channel until it's closed\n\tfor p := range pipeline {\n\t\tfmt.Println(p)\n\t}\n\tfmt.Println(\"Done.\\n----------------------------\")\n\n\tnums := make(chan int)\n\tstop := make(chan bool)\n\tgo func() { producer(nums) }()\n\tgo func() {\n\t\ttime.Sleep(2 * time.Second)\n\t\tstop <- true // send a command on the stop channel\n\t}()\n\n\tfor {\n\t\t// This select will read a message from one of the channels and act accordingly.\n\t\t// Blocks until one of the cases can run (i.e. there's a message).\n\t\t// If there are multiple messages, it chooses one at random.\n\t\tselect {\n\t\tcase n := <-nums:\n\t\t\tfmt.Println(n)\n\t\tcase <-stop:\n\t\t\tfmt.Printf(\"\\nWe're done.\\n\")\n\t\t\treturn\n\t\tdefault: // doesn't block\n\t\t\tfmt.Println(\" waiting for data...\")\n\t\t\ttime.Sleep(300 * time.Millisecond)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c1edcb447cd3f212dad74b546aa88f93", "score": "0.557579", "text": "func main() {\n\tconn, err := amqp.Dial(\"amqp://admin:Password123@159.65.220.217:5672\")\n\tfailOnError(err, \"Failed to connect\")\n\tdefer conn.Close()\n\n\tch, err := conn.Channel()\n\tfailOnError(err, \"Failed to create channel\")\n\tdefer ch.Close()\n\n\terr = ch.ExchangeDeclare(\n\t\t\"einars_football_data\", // name\n\t\t\"fanout\", // type\n\t\ttrue, // durable\n\t\tfalse, // auto-deleted\n\t\tfalse, // internal\n\t\tfalse, // no-wait\n\t\tnil, // arguments\n\t)\n\tfailOnError(err, \"Failed to declare an exchange\")\n\n\tfor i := 0; i < 1000; i++ {\n\t\tmsg := fmt.Sprintf(\"%d Einar's message from a broker sender\", i)\n\t\terr = ch.Publish(\n\t\t\t\"einars_football_data\", // exchange\n\t\t\t\"\", // routing key\n\t\t\tfalse, // mandatory\n\t\t\tfalse, // immediate\n\t\t\tamqp.Publishing{\n\t\t\t\tContentType: \"text/plain\",\n\t\t\t\tBody: []byte(msg),\n\t\t\t})\n\t\tfailOnError(err, \"Failed to publish a message\")\n\t}\n}", "title": "" }, { "docid": "27ce1603b36cb9f14f189eff0f6185d6", "score": "0.5545287", "text": "func produceMessages(producer sarama.AsyncProducer, signals chan os.Signal) {\n\tfor {\n\t\ttime.Sleep(time.Second)\n\t\tmessage := &sarama.ProducerMessage{Topic: KafkaTopic, Value: sarama.StringEncoder(\"Hello from go\")}\n\t\tselect {\n\t\tcase producer.Input() <- message:\n\t\t\tenqueued++\n\t\t\tlog.Println(\"New Message produced\")\n\t\tcase <-signals:\n\t\t\tproducer.AsyncClose() // Trigger a shutdown of the producer.\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "3fd3f72328a58f821406e98a2e5d1717", "score": "0.55268264", "text": "func consumer(mrg chan int, len int){\n\tfor i:=0; i<len; i++{\n\t\tdata := <-mrg\n\t\tprintln(\"Received data: \", data)\n\t}\n\tend <- true\n}", "title": "" }, { "docid": "6a2e603c7ef339ef2f4244fa311b219d", "score": "0.54998374", "text": "func (p *publisher) publish(\n\tctx context.Context,\n\texchange string,\n\tkey string,\n\tmandatory bool,\n\tmsg amqp.Publishing,\n) error {\n\tmsg.DeliveryMode = 2 // persistent\n\n\tch, err := p.acquire()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := ch.Channel.Publish(\n\t\texchange,\n\t\tkey,\n\t\tmandatory,\n\t\tfalse, // immediate\n\t\tmsg,\n\t); err != nil {\n\t\treturn err\n\t}\n\n\tselect {\n\tcase r := <-ch.Return:\n\t\tgo p.confirmThenRelease(ch)\n\t\treturn errors.New(\"broker could not route message, \" + r.ReplyText)\n\n\tcase c := <-ch.Confirm:\n\t\t// wait for a confirmation from the broker, once we receive one\n\t\t// (regardless of whether it's an ack or a nack) we can return the\n\t\t// channel to the pool\n\t\tp.release(ch)\n\n\t\tif c.Ack {\n\t\t\treturn nil\n\t\t}\n\n\t\t// there's no more meaningful error to be returned here. The RMQ docs\n\t\t// simply say: \"basic.nack will only be delivered if an internal error\n\t\t// occurs in the Erlang process responsible for a queue.\"\n\t\treturn errors.New(\"broker did not confirm message publication\")\n\n\tcase err := <-ch.Close:\n\t\t// if the channel is closed before we receive the confirmation, we do\n\t\t// not return the channel to the pool\n\t\treturn err\n\n\tcase <-ctx.Done():\n\t\t// if our context is canceled before we receive the confirmation, return\n\t\t// the channel the pool only after our confirmation has been consumed.\n\t\tgo p.confirmThenRelease(ch)\n\t\treturn ctx.Err()\n\t}\n}", "title": "" }, { "docid": "9594854d60a8162e2b6e9c7010347023", "score": "0.5497651", "text": "func (c *sugarOperations) PublishAndWait(ctx context.Context, topic *Topic, payload interface{}, state State, target int) (seq int64, err error) {\n\tseq, err = c.Publish(ctx, topic, payload)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\n\tb, err := c.Barrier(ctx, state, target)\n\tif err != nil {\n\t\treturn seq, err\n\t}\n\n\t<-b.C\n\treturn seq, err\n}", "title": "" }, { "docid": "09582f093d1091a9c288538807ade9bc", "score": "0.54908967", "text": "func (p *publisher) createChannel() (err error) {\n\tp.ch, err = p.Connection.Open()\n\tif err != nil {\n\t\treturn\n\t}\n\n\t// put channel in confirm mode\n\terr = p.ch.Confirm(false)\n\tif err != nil {\n\t\treturn\n\t}\n\n\t// subscribe to error notifications\n\tp.err = make(chan *amqp.Error, 1)\n\tp.ch.NotifyClose(p.err)\n\n\t// subscribe to publishing confirmations\n\tp.confirms = make(chan amqp.Confirmation, p.MaxPublishingsInFlight)\n\tp.ch.NotifyPublish(p.confirms)\n\n\tp.publishings = make(map[uint64]publishing, p.MaxPublishingsInFlight)\n\tp.tag = 0\n\treturn\n}", "title": "" }, { "docid": "67b2c135b0409c1f11369d8f1da45a8c", "score": "0.5484049", "text": "func ChannelConsumer(die chan Signal, n string, p chan Signal) {\n\tfor {\n\t\tselect {\n\t\tcase s := <-p: // blocking if empty buffer\n\t\t\tmux.Lock()\n\t\t\t//if logging {\n\t\t\tconsumerColor.Printf(\"\\t\\t\\t\\t\\t%T , %v -> %s\\n\", s, s, n)\n\t\t\tmux.Unlock()\n\t\t\t//}\n\t\tcase <-die: // signal for process termination\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "dff0599339e6d31e8a4ed61bfedfd1dc", "score": "0.54809785", "text": "func Consume(id string, ch <-chan string, wg *sync.WaitGroup) { // Consume now takes a waitgroup aswell.\n\tfor s := range ch {\n\t\tfmt.Println(id, \"received\", s)\n\t\tRandomSleep(100) // Simulate time to consume data.\n\t}\n\twg.Done() // Alert main that consumers are done.\n}", "title": "" }, { "docid": "ba8f0191e589df3232b02b2db4e41993", "score": "0.5477243", "text": "func example12() {\n\trabbitmq1, err1 := gorabbitmq.NewRabbitMQSimple(\"queue1\", MQURL)\n\tdefer rabbitmq1.Destroy()\n\tif err1 != nil {\n\t\tlog.Println(err1)\n\t}\n\trabbitmq2, err2 := gorabbitmq.NewRabbitMQSimple(\"queue1\", MQURL)\n\tdefer rabbitmq2.Destroy()\n\tif err2 != nil {\n\t\tlog.Println(err2)\n\t}\n\n\tgo func() {\n\t\tfor i := 0; i < 10000; i++ {\n\t\t\trabbitmq1.Publish(\"消息:\" + strconv.Itoa(i))\n\t\t}\n\t}()\n\n\tgo func() {\n\t\tmsgs, err3 := rabbitmq2.Consume()\n\t\tif err3 != nil {\n\t\t\tlog.Println(err3)\n\t\t}\n\t\tfor d := range msgs {\n\t\t\tlog.Printf(\"接受到了:%s\", d.Body)\n\t\t}\n\t}()\n\n\tforever := make(chan bool)\n\t<-forever\n}", "title": "" }, { "docid": "0ff78857fd71f44fa1c45d25c7a44d9a", "score": "0.54705083", "text": "func (p *publisher) release(ch *channel) {\n\tselect {\n\tcase p.channels <- ch:\n\tdefault:\n\t\t_ = ch.Channel.Close()\n\t}\n}", "title": "" }, { "docid": "c962d605c32c0b30f23de6f9675a490e", "score": "0.5450688", "text": "func producer(nums chan int) {\n\tn := r.Int()%cap(nums) + 1\n\tfor i := 0; i < n; i++ {\n\t\tnums <- r.Int() % 200\n\t}\n\tclose(nums)\n}", "title": "" }, { "docid": "06918cf3c0ff0758530e69e5ed4b99b3", "score": "0.5445626", "text": "func consume(link <-chan int, wg *sync.WaitGroup, writes chan<- writeOp, resource string) {\n\tdefer wg.Done()\n\tfor amount := range link {\n\t\twrite := writeOp{\n\t\t\tkey: resource,\n\t\t\tval: amount}\n\t\twrites <- write\n\t}\n}", "title": "" }, { "docid": "976a45efda9971bf7db5b6b0a7159b83", "score": "0.5436788", "text": "func (s *Subscriber) Publish(c, msg string) int {\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\n\tfound := 0\n\nsubs:\n\tfor sub := range s.channels {\n\t\tif sub == c {\n\t\t\ts.publish <- PubsubMessage{c, msg}\n\t\t\tfound++\n\t\t\tbreak subs\n\t\t}\n\t}\n\npats:\n\tfor orig, pat := range s.patterns {\n\t\tif pat != nil && pat.MatchString(c) {\n\t\t\ts.ppublish <- PubsubPmessage{orig, c, msg}\n\t\t\tfound++\n\t\t\tbreak pats\n\t\t}\n\t}\n\n\treturn found\n}", "title": "" }, { "docid": "1a5cffcb3ffc2844d401fb1ff60edab9", "score": "0.5427961", "text": "func producer(c chan int) {\n\tfor i := 0; i < 10; i++ {\n\t\tc <- i\n\t}\n\tclose(c)\n}", "title": "" }, { "docid": "b916869b2b4f249a688f084bc1057f00", "score": "0.54205465", "text": "func (s *subscriber) writePump() {\n\tticker := time.NewTicker(pingPeriod)\n\tdefer func() {\n\t\tlog.Println(\"[subscriber] writePump exiting\")\n\t\tticker.Stop()\n\t\ts.conn.Close()\n\t}()\n\tfor {\n\t\tselect {\n\t\tcase message, ok := <-s.send:\n\t\t\ts.conn.SetWriteDeadline(time.Now().Add(writeWait))\n\t\t\tif !ok {\n\t\t\t\t// The pub closed the channel.\n\t\t\t\ts.conn.WriteMessage(websocket.CloseMessage, []byte{})\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tw, err := s.conn.NextWriter(websocket.TextMessage)\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tw.Write(message)\n\n\t\t\t// Add queued chat messages to the current websocket message.\n\t\t\tn := len(s.send)\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\tw.Write(newline)\n\t\t\t\tw.Write(<-s.send)\n\t\t\t}\n\n\t\t\tif err := w.Close(); err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\tcase <-ticker.C:\n\t\t\ts.conn.SetWriteDeadline(time.Now().Add(writeWait))\n\t\t\tif err := s.conn.WriteMessage(websocket.PingMessage, nil); err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9ab0195c88130c19483af48c228d10ce", "score": "0.5418596", "text": "func receiverLoop(conn io.Reader, qosChannel chan<- QOSResponse, message chan<- Message, s sender) {\n\tvar p Marshaller\n\tvar err error\n\nLoop:\n\tfor {\n\t\tif p, err = PacketRead(conn); err != nil {\n\t\t\tif err == io.EOF {\n\t\t\t\tlog.Printf(\"Connection closed\\n\")\n\t\t\t}\n\t\t\tlog.Printf(\"packet read error: %q\\n\", err)\n\t\t\tbreak Loop\n\t\t}\n\t\t// fmt.Printf(\"Received: %+v\\n\", p)\n\n\t\tsendAckIfNeeded(p, s)\n\n\t\t// Only broadcast message back to client when we receive publish packets\n\t\tswitch packetType := p.(type) {\n\t\tcase PublishPacket:\n\t\t\tm := Message{}\n\t\t\tm.Topic = packetType.Topic\n\t\t\tm.Payload = packetType.Payload\n\t\t\tmessage <- m // TODO Back pressure. We may block on processing message if client does not read fast enough. Make sure we can quit.\n\t\tdefault:\n\t\t\tif ResponsePacket, ok := p.(QOSResponse); ok {\n\t\t\t\tqosChannel <- ResponsePacket\n\t\t\t}\n\t\t}\n\t}\n\n\t// Loop ended, send receiver close signal\n\tclose(qosChannel)\n}", "title": "" }, { "docid": "baa3e61452af18c48620cbae4c013ce4", "score": "0.5415681", "text": "func (broker *PubSub) Publish(topic string, data interface{}) error {\n broker.RLock()\n defer broker.RUnlock()\n\n subKeys, ok := broker.topics[topic]\n if !ok || len(subKeys) == 0 {\n return fmt.Errorf(\"No subscribers for topic: %s\", topic)\n }\n\n for _, subKey := range subKeys {\n\n go func(broker *PubSub, subKey string, data interface{}) {\n\n broker.RLock()\n sub, ok := broker.subs[subKey]\n broker.RUnlock()\n\n if !ok {\n panic(\"Subscriber ID does not exist.\")\n }\n\n sub.Data()<- data\n\n }(broker, subKey, data)\n\n }\n\n return nil\n}", "title": "" }, { "docid": "996a3a3fa40d1917abc06a8efe09618c", "score": "0.5414501", "text": "func (b *Broker) Publish(payload interface{}, topics ...string) {\n\tfor _, topic := range topics {\n\t\tif b.Subscribers(topic) < 1 {\n\t\t\tcontinue\n\t\t}\n\t\tb.topicsLock.RLock()\n\t\tfor _, s := range b.topics[topic] {\n\t\t\tm := &Message{\n\t\t\t\ttopic: topic,\n\t\t\t\tpayload: payload,\n\t\t\t}\n\t\t\tch := s.GetAck()\n\t\t\tgo (func(s *Subscriber) {\n\t\t\tRETRY:\n\t\t\t\ts.Signal(m)\n\t\t\t\tselect {\n\t\t\t\tcase msg := <-ch:\n\t\t\t\t\t// ACK has been received for the message sent, so move ahead\n\t\t\t\t\t//fmt.Printf(\"Received ack from the subscriber: %s\\n\", msg.GetID())\n\t\t\t\t\t_ = msg\n\t\t\t\tcase <-time.After(5 * time.Second):\n\t\t\t\t\t//fmt.Printf(\"Didn't receive ack from the subscriber: %s, retrying\\n\", s.GetID())\n\t\t\t\t\t// ACK hasn't been received in the time limit. Retry sending the message\n\t\t\t\t\tgoto RETRY\n\t\t\t\t}\n\t\t\t})(s)\n\t\t}\n\t\tb.topicsLock.RUnlock()\n\t}\n}", "title": "" }, { "docid": "ba1094ac56171fa610f6a48e5387da1f", "score": "0.540624", "text": "func pubSubListener(consumer pulsar.Consumer, dbConn *pgx.Conn) {\n\tfor {\n\t\t// Blocks until a message is received\n\t\tmsg, err := consumer.Receive(context.Background())\n\t\tcommon.ExitOnError(err, \"PubSub message error: %v\")\n\n\t\tpayload := pb.TargetsAcquiredPayload{}\n\n\t\t// Unmarshalls payload\n\t\tif err := protojson.Unmarshal(msg.Payload(), &payload); err == nil {\n\t\t\t// Store Payload in the database\n\t\t\tfor _, t := range payload.Data {\n\t\t\t\tif _, err := dbConn.Exec(context.Background(), \"INSERT INTO targets (id, message, created_on, updated_on) VALUES ($1, $2, $3, $4)\", t.Id, t.Message, t.CreatedOn, t.UpdatedOn); err != nil {\n\t\t\t\t\tlog.Printf(\"Failed to save target with error: %v\\n\", err.Error())\n\t\t\t\t\tcontinue //Skip the rest of the logic, do not acknowledge message\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlog.Printf(\"%d Target(s) saved to database. \\n\", len(payload.Data))\n\t\t\tconsumer.Ack(msg)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "452a09d1b4174203ed28b369cfe02d30", "score": "0.54008025", "text": "func main() {\n\n\tclient := commons.Connect(clientId)\n\n\tn := 0\n\tfor {\n\t\tn++\n\n\t\t// le taux d'humidité dans une maison doit se situer entre 50 et 60 %.\n\t\thumidity := 50 + (n % 10)\n\n\t\t//\t\tmsg := fmt.Sprintf(\"My message %d\", n)\n\t\tmsg := fmt.Sprintf(\"%d\", humidity)\n\t\tfmt.Println(\"PUB [\" + topic + \"] : \" + msg)\n\n\t\t// Publish will publish a message with the specified QoS and content to the specified topic.\n\t\t// Returns a token to track delivery of the message to the broker\n\t\t//\n\t\t// Publish(topic string, qos byte, retained bool, payload interface{}) Token\n\n\t\tclient.Publish(topic, 0, false, msg)\n\n\t\ttime.Sleep(3 * time.Second)\n\t}\n}", "title": "" }, { "docid": "ef57fc70b7e5fa3bfb5302cbe6b4473e", "score": "0.540024", "text": "func (h *hub) Publish(topicName topic, args ...interface{}) {\n\trArgs := buildHandlerArgs(args)\n\n\th.mtx.RLock()\n\tdefer h.mtx.RUnlock()\n\n\tif hs, ok := h.channels[topicName]; ok {\n\t\tfor _, handler := range hs {\n\t\t\th.wg.Add(1)\n\t\t\thandler.queue <- rArgs\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0743cc3a0cefbff23d88b3158dd8bee3", "score": "0.5396706", "text": "func SendMessage(c chan<- int) {\n\tincrement := GenerateCounter()\n\n\tfor { // while true, infinite writing\n\t\ttime.Sleep(time.Second)\n\t\tc <- increment()\n\t}\n}", "title": "" }, { "docid": "6159f403d6c39af75263cd72e77be84c", "score": "0.5392321", "text": "func (p *pusher) push() {\n\tfor {\n\t\tselect {\n\t\tcase logEventBatch := <-p.pushChan:\n\t\t\tp.publisher.Publish(logEventBatch)\n\t\tcase <-p.shutdownChan:\n\t\t\tlog.Printf(\"D! logpusher: push routine receives the shutdown signal, exiting.\")\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "37cbc78ff635d53afcac3307cca40c62", "score": "0.5388182", "text": "func (sClient *s_client) clientMain(s *server) {\n\tfor {\n\t\tvar readReturnChan chan *readReturn\n\t\treadReturnChan = nil\n\n\t\tif sClient.messageToPush != nil && sClient.messageToPush.seqNum == sClient.seqExpected {\n\t\t\treadReturnChan = s.readReturnChan\n\t\t}\n\n\t\tselect {\n\t\tcase <-sClient.clientCloseChan: //CloseConn or Close called\n\t\t\t//set sth to true\n\t\t\tsClient.aboutToClose = true\n\t\t\tif sClient.checkAllSent(s) { //no resend routine around\n\t\t\t\tsClient.clientTerminateAll(s)\n\t\t\t\treturn\n\t\t\t}\n\t\tcase message := <-sClient.messageChan:\n\t\t\tif sClient.aboutToClose == false { //ignore incoming data messages from the client if it's closed here\n\t\t\t\tack := NewAck(message.ConnID, message.SeqNum)\n\t\t\t\tackRequest := &writeAckRequest{\n\t\t\t\t\tack: ack,\n\t\t\t\t\tclient: sClient,\n\t\t\t\t}\n\t\t\t\ts.writeAckChan <- ackRequest\n\t\t\t\tif message.SeqNum > sClient.seqExpected {\n\t\t\t\t\tif !sClient.alreadyReceived(message.SeqNum) {\n\t\t\t\t\t\tsClient.pendingMessages = append(sClient.pendingMessages, message)\n\t\t\t\t\t}\n\t\t\t\t} else if message.SeqNum == sClient.seqExpected {\n\t\t\t\t\twrapMessage := &readReturn{\n\t\t\t\t\t\tconnID: message.ConnID,\n\t\t\t\t\t\tseqNum: message.SeqNum,\n\t\t\t\t\t\tpayload: message.Payload,\n\t\t\t\t\t\terr: nil,\n\t\t\t\t\t}\n\t\t\t\t\tsClient.messageToPush = wrapMessage\n\t\t\t\t}\n\t\t\t}\n\t\tcase readReturnChan <- sClient.messageToPush:\n\t\t\t//if entered here, means we just pushed the message with seqNum\n\t\t\t//client.seqExpected to the main readReturnChan, thus need to update\n\t\t\t//and check whether we have pendingMessages that can be\n\t\t\t// fmt.Println(\"server: has pushed the message\")\n\n\t\t\tsClient.seqExpected += 1\n\t\t\t//go through pending messages and check if already received the next\n\t\t\t//message in order, check againt client.seqExpected\n\t\t\tsClient.messageToPush = nil\n\t\t\tfor i := 0; i < len(sClient.pendingMessages); i++ {\n\t\t\t\tmessage := sClient.pendingMessages[i]\n\t\t\t\tif message.SeqNum == sClient.seqExpected {\n\t\t\t\t\t//make sure sending messages out in order\n\t\t\t\t\twrapMessage := &readReturn{\n\t\t\t\t\t\tconnID: message.ConnID,\n\t\t\t\t\t\tseqNum: message.SeqNum,\n\t\t\t\t\t\tpayload: message.Payload,\n\t\t\t\t\t\terr: nil,\n\t\t\t\t\t}\n\t\t\t\t\tsClient.messageToPush = wrapMessage\n\t\t\t\t\t//cut this message off pendingMessages\n\t\t\t\t\tsClient.pendingMessages = append(sClient.pendingMessages[:i], sClient.pendingMessages[i+1:]...)\n\n\t\t\t\t\tbreak //make sure only push one message to the read()\n\t\t\t\t}\n\t\t\t}\n\t\t\tif sClient.messageToPush == nil && sClient.aboutToClose { //no more message to Push to Read()\n\t\t\t\tdroppedMsg := &readReturn{\n\t\t\t\t\tconnID: sClient.connID,\n\t\t\t\t\tseqNum: -1,\n\t\t\t\t\tpayload: nil,\n\t\t\t\t\terr: errors.New(\"This client disconnected\"),\n\t\t\t\t}\n\t\t\t\ts.readReturnChan <- droppedMsg //might block\n\t\t\t\treturn\n\n\t\t\t}\n\t\t// below two cases are for partA\n\t\tcase payload := <-sClient.addToWindowChan:\n\t\t\t//don't do Write() application call when closeConn is closed\n\t\t\tif sClient.aboutToClose == false {\n\t\t\t\tseqNum := sClient.writeSeqNum\n\t\t\t\tsClient.writeSeqNum += 1\n\t\t\t\tsize := len(payload)\n\t\t\t\tchecksum := makeCheckSum(sClient.connID, seqNum, size, payload)\n\t\t\t\toriginal := NewData(sClient.connID, seqNum, size, payload, checksum)\n\t\t\t\tmsg, err := marshal(original)\n\t\t\t\tif err != nil {\n\t\t\t\t\t//don't do anything?\n\t\t\t\t\t//s.writeBackChan <- err\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\telem := &windowElem{\n\t\t\t\t\tseqNum: seqNum,\n\t\t\t\t\tackChan: make(chan int),\n\t\t\t\t\tmsg: msg,\n\t\t\t\t}\n\t\t\t\t// the below condition is ** key **\n\t\t\t\tif seqNum < sClient.windowStart+s.params.WindowSize && sClient.window[seqNum-sClient.windowStart] == nil {\n\t\t\t\t\t// can be put into the window\n\t\t\t\t\tsClient.window[seqNum-sClient.windowStart] = elem\n\t\t\t\t\tgo sClient.resendRoutine(elem, s) // NOTE: the first time sending is also done in resendRoutine\n\t\t\t\t} else {\n\t\t\t\t\tsClient.writeBuffer = append(sClient.writeBuffer, elem)\n\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase seqNum := <-sClient.resendSuccessChan:\n\t\t\tif seqNum < sClient.windowStart { //if sth already passed\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tindex := seqNum - sClient.windowStart\n\t\t\tsClient.window[index].ackChan <- 1 //let resendRoutine for this message stop\n\t\t\tsClient.window[index] = nil\n\t\t\twindow := sClient.window\n\n\t\t\tif sClient.aboutToClose && sClient.checkAllSent(s) { //no more pending messages\n\t\t\t\tsClient.clientTerminateAll(s)\n\t\t\t\treturn\n\t\t\t}\n\t\t\t//if the flag is true, check if window is all nil, len(writeBuffer ) ==0\n\t\t\t//all resendRoutine should be stopped, and stop the timeRoutine for this client\n\t\t\t//and send itself to s.clientRemoveChan\n\n\t\t\tif index == 0 { //need to update windowStart\n\t\t\t\tbuffer := sClient.writeBuffer\n\t\t\t\toffset := 0\n\t\t\t\tfor i := 0; i < s.params.WindowSize; i++ {\n\t\t\t\t\tif window[i] == nil {\n\t\t\t\t\t\toffset += 1\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// for cleaniness and garbage recollection purpose, remake\n\t\t\t\t// the window every time we slide the window\n\t\t\t\toffset = min(sClient.writeSeqNum-sClient.windowStart, offset)\n\t\t\t\twindowSize := s.params.WindowSize\n\t\t\t\tnewWindow := make([]*windowElem, windowSize)\n\t\t\t\tfor i := offset; i < windowSize; i++ {\n\t\t\t\t\tnewWindow[i-offset] = window[i]\n\t\t\t\t}\n\n\t\t\t\t// add element in the buffer to the window\n\t\t\t\temptyStartIndex := windowSize - offset\n\t\t\t\tbufferToCopy := min(len(sClient.writeBuffer), offset)\n\t\t\t\tfor i := 0; i < bufferToCopy; i++ {\n\t\t\t\t\tnewWindow[i+emptyStartIndex] = buffer[i]\n\t\t\t\t\tgo sClient.resendRoutine(buffer[i], s)\n\t\t\t\t}\n\t\t\t\t// shrink the buffer\n\t\t\t\tnewBuffer := buffer[bufferToCopy:]\n\t\t\t\t//change windowStart\n\t\t\t\tsClient.windowStart += offset\n\t\t\t\t//update window, buffer\n\t\t\t\tsClient.window = newWindow\n\t\t\t\tsClient.writeBuffer = newBuffer\n\t\t\t}\n\t\tcase <-sClient.connDropChan: //conneciton dropped\n\n\t\t\tfor i := 0; i < s.params.WindowSize; i++ {\n\t\t\t\tif sClient.window[i] != nil {\n\t\t\t\t\tsClient.window[i].ackChan <- 1 //stop the resend routine\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tif sClient.aboutToClose { //if closeConn called\n\t\t\t\t//ignore pendingMessages\n\t\t\t\tsClient.clientTerminateAll(s) //might block\n\t\t\t\t//s.readReturnChan <- droppedMsg\n\t\t\t\treturn\n\t\t\t}\n\t\t\t//regular timeout\n\t\t\tsClient.aboutToClose = true\n\t\t\tif sClient.messageToPush == nil { //no more message to Push to Read()\n\t\t\t\tdroppedMsg := &readReturn{\n\t\t\t\t\tconnID: sClient.connID,\n\t\t\t\t\tseqNum: -1,\n\t\t\t\t\tpayload: nil,\n\t\t\t\t\terr: errors.New(\"This client disconnected\"),\n\t\t\t\t}\n\t\t\t\tsClient.clientTerminateAll(s) //might block\n\t\t\t\ts.readReturnChan <- droppedMsg\n\t\t\t\treturn //terminate clientMain since won't be used anymore\n\t\t\t}\n\n\t\t}\n\t}\n}", "title": "" }, { "docid": "65f8d232ec3e61350be7c3fd7e81844b", "score": "0.53794694", "text": "func (c *consumer) Run() {\n\tc.t.Go(func() error {\n\t\tdefer func() {\n\t\t\terr := c.channel.Close()\n\t\t\tif err != nil {\n\t\t\t\tc.hub.Publish(hub.Message{\n\t\t\t\t\tName: \"rabbit.consumer.error\",\n\t\t\t\t\tBody: []byte(\"Error closing the consumer channel\"),\n\t\t\t\t\tFields: hub.Fields{\"error\": err},\n\t\t\t\t})\n\t\t\t}\n\t\t}()\n\t\td, err := c.channel.Consume(c.queue, \"rabbitmq-\"+c.name+\"-\"+c.hash,\n\t\t\tc.opts.AutoAck,\n\t\t\tc.opts.Exclusive,\n\t\t\tc.opts.NoLocal,\n\t\t\tc.opts.NoWait,\n\t\t\tc.opts.Args)\n\t\tif err != nil {\n\t\t\tc.hub.Publish(hub.Message{\n\t\t\t\tName: \"rabbit.consumer.error\",\n\t\t\t\tBody: []byte(\"Failed to start consume\"),\n\t\t\t\tFields: hub.Fields{\"error\": err},\n\t\t\t})\n\t\t\treturn err\n\t\t}\n\t\tdying := c.t.Dying()\n\t\tclosed := c.channel.NotifyClose(make(chan *amqp.Error))\n\t\tctx, cancel := context.WithCancel(context.Background())\n\t\tdefer cancel()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-dying:\n\t\t\t\t// When dying we wait for any remaining worker to finish\n\t\t\t\tc.workerPool.Wait()\n\t\t\t\treturn nil\n\t\t\tcase err := <-closed:\n\t\t\t\treturn err\n\t\t\tcase msg, ok := <-d:\n\t\t\t\tif !ok {\n\t\t\t\t\tc.hub.Publish(hub.Message{\n\t\t\t\t\t\tName: \"rabbit.consumer.error\",\n\t\t\t\t\t\tBody: []byte(\"receive an empty delivery. closing consumer\"),\n\t\t\t\t\t\tFields: hub.Fields{},\n\t\t\t\t\t})\n\t\t\t\t\treturn errors.New(\"receive an empty delivery\")\n\t\t\t\t}\n\t\t\t\t// When maxWorkers goroutines are in flight, Acquire blocks until one of the\n\t\t\t\t// workers finishes.\n\t\t\t\tc.workerPool.Acquire()\n\t\t\t\tgo func(msg amqp.Delivery) {\n\t\t\t\t\tnctx := ctx\n\t\t\t\t\tif c.timeout >= time.Second {\n\t\t\t\t\t\tvar canc context.CancelFunc\n\t\t\t\t\t\tnctx, canc = context.WithTimeout(ctx, c.timeout)\n\t\t\t\t\t\tdefer canc()\n\t\t\t\t\t}\n\t\t\t\t\tc.processMessage(nctx, msg)\n\t\t\t\t\tc.workerPool.Release()\n\t\t\t\t}(msg)\n\t\t\t}\n\t\t}\n\t})\n}", "title": "" }, { "docid": "17f410906d6507c3dc08f7356b877b75", "score": "0.5372874", "text": "func provider(c chan <- string) {\n for i := 0; i < messageCount; i++ {\n c <- fmt.Sprintf(\"chan provider info %d\", i)\n }\n}", "title": "" }, { "docid": "79bf65c5888002cfbeaf6dc66d7a35bb", "score": "0.53627014", "text": "func example4() {\n\trabbitmq1, err1 := gorabbitmq.NewRabbitMqRouting(\"exchange.example4\", \"key.one\", MQURL)\n\tdefer rabbitmq1.Destroy()\n\tif err1 != nil {\n\t\tlog.Println(err1)\n\t}\n\trabbitmq2, err2 := gorabbitmq.NewRabbitMqRouting(\"exchange.example4\", \"key.one\", MQURL)\n\tdefer rabbitmq2.Destroy()\n\tif err2 != nil {\n\t\tlog.Println(err2)\n\t}\n\trabbitmq3, err3 := gorabbitmq.NewRabbitMqRouting(\"exchange.example4\", \"key.two\", MQURL)\n\tdefer rabbitmq3.Destroy()\n\tif err3 != nil {\n\t\tlog.Println(err3)\n\t}\n\n\tgo func() {\n\t\tfor i := 0; i < 10000; i++ {\n\t\t\trabbitmq1.Publish(\"消息:\" + strconv.Itoa(i))\n\t\t}\n\t}()\n\n\tgo func() {\n\t\tmsgs, err4 := rabbitmq2.Consume()\n\t\tif err4 != nil {\n\t\t\tlog.Println(err4)\n\t\t}\n\t\tfor d := range msgs {\n\t\t\tlog.Printf(\"key.one接受到了:%s\", d.Body)\n\t\t}\n\t}()\n\tgo func() {\n\t\tmsgs, err5 := rabbitmq3.Consume()\n\t\tif err5 != nil {\n\t\t\tlog.Println(err5)\n\t\t}\n\t\tfor d := range msgs {\n\t\t\tlog.Printf(\"key.two接受到了:%s\", d.Body)\n\t\t}\n\t}()\n\n\tforever := make(chan bool)\n\t<-forever\n}", "title": "" }, { "docid": "cff8ea62d583ea1ef2ce968afc49abde", "score": "0.53626686", "text": "func TestContinueAfterSubscribeClose(\n\tt *testing.T,\n\ttCtx TestContext,\n\tcreatePubSub PubSubConstructor,\n) {\n\tif !tCtx.Features.Persistent {\n\t\tt.Skip(\"Non-Persistent is not supported yet\")\n\t}\n\n\tif tCtx.Features.ExactlyOnceDelivery {\n\t\tt.Skip(\"ExactlyOnceDelivery test is not supported yet\")\n\t}\n\n\ttotalMessagesCount := 5000\n\tbatches := 5\n\tif testing.Short() {\n\t\ttotalMessagesCount = 50\n\t\tbatches = 2\n\t}\n\tbatchSize := int(totalMessagesCount / batches)\n\treadAttempts := batches * 4\n\n\tpub, sub := createPubSub(t)\n\tdefer closePubSub(t, pub, sub)\n\n\ttopicName := testTopicName(tCtx.TestID)\n\tif subscribeInitializer, ok := sub.(message.SubscribeInitializer); ok {\n\t\trequire.NoError(t, subscribeInitializer.SubscribeInitialize(topicName))\n\t}\n\n\tpublishedMessages := AddSimpleMessagesParallel(t, totalMessagesCount, pub, topicName, 50)\n\n\treceivedMessages := map[string]*message.Message{}\n\tfor i := 0; i < readAttempts; i++ {\n\n\t\tpub, sub := createPubSub(t)\n\n\t\tmessages, err := sub.Subscribe(context.Background(), topicName)\n\t\trequire.NoError(t, err)\n\n\t\tmessagesToRead := batchSize\n\t\tmessagesLeft := totalMessagesCount - len(receivedMessages)\n\n\t\tif messagesToRead > messagesLeft {\n\t\t\tmessagesToRead = messagesLeft\n\t\t}\n\n\t\treceivedMessagesBatch, _ := bulkRead(tCtx, messages, messagesToRead, defaultTimeout)\n\t\tclosePubSub(t, pub, sub)\n\n\t\tfor _, msg := range receivedMessagesBatch {\n\t\t\treceivedMessages[msg.UUID] = msg\n\t\t}\n\n\t\tclosePubSub(t, pub, sub)\n\n\t\tif len(receivedMessages) >= totalMessagesCount {\n\t\t\tbreak\n\t\t}\n\t}\n\n\t// to make this test more robust - let's consume all missing messages\n\t// (we care here if we didn't lost any message, not if we received duplicated)\n\tmissingMessagesCount := totalMessagesCount - len(receivedMessages)\n\tif missingMessagesCount > 0 && !tCtx.Features.ExactlyOnceDelivery {\n\t\tmessages, err := sub.Subscribe(context.Background(), topicName)\n\t\trequire.NoError(t, err)\n\t\tdefer closePubSub(t, pub, sub)\n\n\t\ttimeout := time.After(defaultTimeout)\n\n\tMessagesLoop:\n\t\tfor len(receivedMessages) < totalMessagesCount {\n\t\t\tselect {\n\t\t\tcase msg, ok := <-messages:\n\t\t\t\tif !ok {\n\t\t\t\t\tbreak MessagesLoop\n\t\t\t\t}\n\n\t\t\t\treceivedMessages[msg.UUID] = msg\n\t\t\t\tmsg.Ack()\n\t\t\tcase <-timeout:\n\t\t\t\tbreak MessagesLoop\n\t\t\t}\n\t\t}\n\t}\n\n\t// we need to deduplicate messages, because bulkRead will deduplicate only per one batch\n\tuniqueReceivedMessages := message.Messages{}\n\tfor _, msg := range receivedMessages {\n\t\tuniqueReceivedMessages = append(uniqueReceivedMessages, msg)\n\t}\n\n\tAssertAllMessagesReceived(t, publishedMessages, uniqueReceivedMessages)\n}", "title": "" }, { "docid": "d8e4a45d8718cfdcd1dc737e6764714e", "score": "0.53610927", "text": "func (sub *Subscription) Pub(msgs ...*Message) {\n\tfor _, msg := range msgs {\n\t\tselect {\n\t\tcase <-sub.Done():\n\t\t\treturn\n\t\tcase sub.msgCh <- msg:\n\t\t\tif msg.isFinal {\n\t\t\t\tsub.Close()\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a2cdfad0b194ffc1dc6f84cde82437d8", "score": "0.53556824", "text": "func consumer(c <- chan int) (result int) {\n for i := range c {\n fmt.Println(\"=> chan consumer reads item from the channel:\", i)\n result += i\n }\n return\n}", "title": "" }, { "docid": "b8b2f5fc803bbf4be1c37428bc71d197", "score": "0.53311765", "text": "func (o *PostgresOutput) receiver(or OutputRunner, wg *sync.WaitGroup) {\n\tvar (\n\t\tpack *PipelinePack\n\t\tcount int\n\t)\n\tok := true\n\tticker := time.Tick(time.Duration(o.flushInterval) * time.Millisecond)\n\toutBatch := [][]interface{}{}\n\tinChan := or.InChan()\n\n\tfor ok {\n\t\tselect {\n\t\tcase pack, ok = <-inChan:\n\t\t\tif !ok {\n\t\t\t\t// Closed inChan => we're shutting down, flush data\n\t\t\t\tif len(outBatch) > 0 {\n\t\t\t\t\to.batchChan <- outBatch\n\t\t\t\t}\n\t\t\t\tclose(o.batchChan)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t// Read values from message fields\n\t\t\tval, e := o.convertMessageToValues(pack.Message, o.insertFields)\n\t\t\tpack.Recycle()\n\t\t\tif e != nil {\n\t\t\t\tor.LogError(e)\n\t\t\t} else {\n\t\t\t\toutBatch = append(outBatch, val)\n\t\t\t\tif count = count + 1; o.CheckFlush(count, len(outBatch)) {\n\t\t\t\t\tif len(outBatch) > 0 {\n\t\t\t\t\t\t// This will block until the other side is ready to accept\n\t\t\t\t\t\t// this batch, so we can't get too far ahead.\n\t\t\t\t\t\to.batchChan <- outBatch\n\t\t\t\t\t\toutBatch = <-o.backChan\n\t\t\t\t\t\tcount = 0\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tcase <-ticker:\n\t\t\tif len(outBatch) > 0 {\n\t\t\t\t// This will block until the other side is ready to accept\n\t\t\t\t// this batch, freeing us to start on the next one.\n\t\t\t\to.batchChan <- outBatch\n\t\t\t\toutBatch = <-o.backChan\n\t\t\t\tcount = 0\n\t\t\t}\n\t\t}\n\t}\n\twg.Done()\n}", "title": "" }, { "docid": "e379c59a546b40c9dd81d0adc9e2da9c", "score": "0.532912", "text": "func (m *Broadcaster) loop() {\n\tfor event := range m.incoming {\n\t\tfor _, w := range m.watchers {\n\t\t\tselect {\n\t\t\tcase w.result <- event:\n\t\t\tcase <-w.stopped:\n\t\t\tdefault:\n\t\t\t}\n\t\t}\n\t}\n\tm.closeAll()\n\tm.distributing.Done()\n}", "title": "" }, { "docid": "dbd7c47a654a4bcb5979cf9fe740b28e", "score": "0.5327126", "text": "func printer(input chan int, exit chan bool) {\n defer close(exit)\n for i := range input {\n fmt.Println(i)\n }\n}", "title": "" }, { "docid": "2da039d8409d466f407af79cb8ab23f5", "score": "0.5324252", "text": "func confirmOne(ack, nack chan uint64) {\n\tlog.Printf(\"waiting for confirmation of one publishing\")\n\n\tselect {\n\tcase tag := <-ack:\n\t\tlog.Printf(\"confirmed delivery with delivery tag: %d\", tag)\n\tcase tag := <-nack:\n\t\tlog.Printf(\"failed delivery of delivery tag: %d\", tag)\n\t}\n}", "title": "" }, { "docid": "917afd9c56eed4ae24adf513e8581bde", "score": "0.5322186", "text": "func main() {\n\n\t// Make a string channel\n\tc := fanIn(boring(\"aaa\"), boring(\"bbb\"))\n\n\tfor i := 0; i < 5; i++ {\n\n\t\t// Note we don't know who comes first here\n\t\t// so we could end up with:\n\t\t// aaa, bbb : the order doesn't matter here\n\t\t// bbb, aaa : but the next two must contain aaa and bbb\n\t\t\n\t\tmsg1 := <-c; fmt.Println(msg1.str)\n\t\tmsg2 := <-c; fmt.Println(msg2.str)\n\t\tmsg1.wait <- true // release msg1\n\t\tmsg2.wait <- true // release msg2\n\t}\n\t\n\tfmt.Println(\"Done\\n\");\n}", "title": "" }, { "docid": "04586aad57ecb23614aa43c051979a2e", "score": "0.5321539", "text": "func (c *client) Publish(msg ...*PublishPacket) {\n\tfor _, m := range msg {\n\t\tif m == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tp := m\n\t\tif p.Qos > Qos2 {\n\t\t\tp.Qos = Qos2\n\t\t}\n\n\t\tif p.Qos != Qos0 && p.PacketID == 0 {\n\t\t\tp.PacketID = c.idGen.next(p)\n\t\t\tif err := c.persist.Store(sendKey(p.PacketID), p); err != nil {\n\t\t\t\tc.msgC <- newPersistMsg(err)\n\t\t\t}\n\t\t}\n\t\tc.sendC <- p\n\t}\n}", "title": "" }, { "docid": "4e7392c0ecfac81370b927b41eca93fd", "score": "0.53165555", "text": "func (n *nmq) processConsume(consumer Consumer, doneMessage chan *Message) {\n\tfor data := range doneMessage {\n\t\tconsumer.Do(data)\n\t}\n}", "title": "" }, { "docid": "06605b69c13bf4050d9dcadf7a3904b7", "score": "0.5314448", "text": "func Herausholen() <-chan amqp.Delivery {\n\tconn, err := amqp.Dial(os.Getenv(\"AMQP_URL\"))\n\tFailOnError(err, \"Failed to connect to RabbitMQ\")\n\tdefer conn.Close()\n\n\tch, err := conn.Channel()\n\tFailOnError(err, \"Failed to open a channel\")\n\tdefer ch.Close()\n\n\tq, err := ch.QueueDeclare(\n\t\t\"affChange\", // name\n\t\tfalse, // durable\n\t\tfalse, // delete when unused\n\t\tfalse, // exclusive\n\t\tfalse, // no-wait\n\t\tnil, // arguments\n\t)\n\tFailOnError(err, \"Failed to declare a queue\")\n\n\tmsgs, err := ch.Consume(\n\t\tq.Name, // queue\n\t\t\"\", // consumer\n\t\ttrue, // auto-ack\n\t\tfalse, // exclusive\n\t\tfalse, // no-local\n\t\tfalse, // no-wait\n\t\tnil, // arguments\n\t)\n\tFailOnError(err, \"Failed to register a consumer\")\n\n\treturn msgs\n}", "title": "" }, { "docid": "6ad3e85dddf85671575a8beff60b0e76", "score": "0.5314405", "text": "func Produce(id string, n int, ch chan<- string, wg *sync.WaitGroup) {\n\tfor i := 0; i < n; i++ {\n\t\tRandomSleep(100) // Simulate time to produce data.\n\t\tch <- id + \":\" + strconv.Itoa(i)\n\t}\n\twg.Done() // Alert main that producers are done.\n}", "title": "" }, { "docid": "924d71fbb5341e891903c3e9e0b0bab8", "score": "0.53128797", "text": "func (mc *markerconsumer) runComsumerLoop() {\n\tconst timeout = 1 * time.Second\n\n\tfor mc.isConsumerLoopRunning() {\n\t\t// Attempt to read a message\n\t\tmsg := mc.readMessage(timeout)\n\n\t\tnow := time.Now()\n\n\t\t// If we've receive a message, add it to our queue and update committed offsets\n\t\tif msg != nil {\n\t\t\tmc.handleMessage(msg, now)\n\t\t}\n\n\t\t// Regardless of whether we've received a message or not, perform redeliveries if required\n\t\tfor _, ap := range mc.assignedPartitions {\n\t\t\tap.Redeliver(now)\n\t\t}\n\t}\n\tmc.consumerWG.Done()\n}", "title": "" }, { "docid": "505d31f3721b71a7d88a50c1f01fa206", "score": "0.5304591", "text": "func (p *publisher) acquire() (*channel, error) {\n\tselect {\n\tcase ch := <-p.channels:\n\t\treturn ch, nil\n\tdefault:\n\t}\n\n\tc, err := p.conn.Channel()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := c.Confirm(false); err != nil { // false = noWait\n\t\treturn nil, err\n\t}\n\n\tch := &channel{\n\t\tChannel: c,\n\t\tClose: make(chan *amqp.Error),\n\t\tReturn: make(chan amqp.Return, 1),\n\t\tConfirm: make(chan amqp.Confirmation, 1),\n\t}\n\n\tc.NotifyClose(ch.Close)\n\tc.NotifyReturn(ch.Return)\n\tc.NotifyPublish(ch.Confirm)\n\n\treturn ch, nil\n}", "title": "" }, { "docid": "c100b69f9f1d82c8e442287371d9a396", "score": "0.52910066", "text": "func TestForWithChannels(t *testing.T) {\n\n\tqueue := make(chan string, 2)\n\tqueue <- \"one\"\n\tqueue <- \"two\"\n\tclose(queue)\n\n\tfor elem := range queue {\n\t\tfmt.Println(elem)\n\t}\n}", "title": "" }, { "docid": "94e5a1f50690b548e395c204e301124c", "score": "0.528527", "text": "func producer(t time.Duration, ch chan int) {\n\tfor ; i < 100; i++ {\n\t\ttime.Sleep(t)\n\t\tch <- i\n\t}\n}", "title": "" }, { "docid": "2422ebd8a79fbf7682238406d2cac10c", "score": "0.52841693", "text": "func send(ch chan<- int) { //getting a generic channel (chan int) as sending channel (chan<- int)\n\n\tfor i := 0; i < 10; i++ {\n\t\twg.Add(1) //adding a goroutine to waitgroup\n\t\tgo func(i int) {\n\t\t\tfor j := 1; j <= 10; j++ {\n\t\t\t\tch <- i + j //sending a value to channel\n\t\t\t}\n\t\t\twg.Done() //send a signal that waitgroup has finished\n\t\t}(i)\n\n\t}\n\twg.Wait() //waits till control reaches this point\n\tclose(ch) //closing the channel\n}", "title": "" }, { "docid": "c750e8a9e2e3822164c619358b27d627", "score": "0.5282551", "text": "func Publish(channel, data string) {\n\t_ = redis.Do(radix.Cmd(nil, \"PUBLISH\", channel, data))\n}", "title": "" }, { "docid": "1f878e94f8eac4713e7b432b7c877e10", "score": "0.5281341", "text": "func (sc *SeqConsumer) Run() error {\n\tctx, ctxCancel := context.WithCancel(context.Background())\n\tcHandler := consumerGroupHandler{\n\t\t// can set the number of messages to consumer here e.g.\n\t\t// toConsume: 50,\n\t}\n\tdefer sc.ConsumerGrp.Close()\n\tfmt.Println(\"Waiting for messages to consume...\")\n\tfor {\n\t\terr := sc.ConsumerGrp.Consume(ctx, []string{sc.topicName}, cHandler)\n\t\tif err != nil {\n\t\t\tctxCancel()\n\t\t\tsc.ConsumerGrp.Close()\n\t\t\treturn err\n\t\t}\n\t\tctxCancel()\n\t\terr = sc.ConsumerGrp.Close()\n\t\tif err == nil {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d06101b9b39eb6d51b6a0c4ef9f518d5", "score": "0.52786213", "text": "func process(id uint64, i uint64, channel chan uint64, exit chan bool) {\n\tfor {\n\t\tselect {\n\t\tcase <-exit:\n\t\t\tchannel <- id\n\t\t\tchannel <- i\n\t\t\treturn\n\t\tdefault:\n\t\t\tfmt.Println(id, \" : \", i)\n\t\t\ti = i + 1\n\t\t\ttime.Sleep(time.Millisecond * 500)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f089b95197457b38aa3f16aeb1927e17", "score": "0.5277992", "text": "func (c *confirms) resequence() {\n\tfor c.expecting <= c.published {\n\t\tsequenced, found := c.sequencer[c.expecting]\n\t\tif !found {\n\t\t\treturn\n\t\t}\n\t\tc.confirm(sequenced)\n\t}\n}", "title": "" }, { "docid": "b78cfa1a3e168060f20e9d38cb2d3ae0", "score": "0.5277736", "text": "func produce(outC chan [lotLen]int) {\n\tvar lot [lotLen]int\n\tvar c int\n\trand.Seed(time.Now().UnixNano())\n\tfor i := 0; i < 100; i++ {\n\t\tfor j := 0; j < lotLen; j++ {\n\t\t\tlot[j] = c\n\t\t\tc++\n\t\t}\n\t\ttime.Sleep(time.Duration(rand.Intn(15)) * time.Millisecond)\n\t\toutC <- lot\n\t}\n\tclose(outC)\n}", "title": "" }, { "docid": "e67ffc5df86fe70032a395dfee78beaf", "score": "0.52737534", "text": "func (sc *chanCollection) open(s channel) {\n\tfor {\n\t\tmsg, ok := <-s.redisCh\n\t\tif s.activated && s.consumers() == 0 {\n\t\t\tlog.Printf(\"zero consumers on %s\", s.id)\n\t\t\tsc.remove(s)\n\t\t\treturn\n\t\t}\n\t\tif ok {\n\t\t\ts.activated = true\n\t\t\ts.es.SendMessage(msg.Message, \"\", \"\")\n\t\t\tlog.Printf(\">> %s (consumers: %d)\", s.id, s.consumers())\n\t\t}\n\t}\n}", "title": "" }, { "docid": "de0d3ec3175a4acb30a47c593d56c92c", "score": "0.5270205", "text": "func shovelManagement(feed, statusReq, statusResp chan bool, sleepSeconds int, verbose bool) {\n // asynchronously report is chef running status\n shovelRunningStatus := false\n go func(){\n for {\n <-statusReq\n statusResp <- shovelRunningStatus\n }\n }()\n\n // asynchronously set boolean for which rabbit command to run\n feedStatus := false\n go func(){\n for {\n feedStatus = <-feed\n }\n }()\n\n // verified that stopping a stoped shovel or starting a started shovel doesn't\n // effect the rabbit broker. the rabbit broker informs the caller that the \n // current state matches desires state and to go away. it says 'err' but that's\n // a gentle way of saying, 'YES! AND I AM ALREADY!'\n for {\n shovelRunningStatus = true\n command := \"stop\"\n if feedStatus {\n command = \"start\"\n }\n if verbose {\n log.Println(rabbitProg + \" \" + command)\n }\n cmd := exec.Command(rabbitProg, command)\n var out bytes.Buffer\n cmd.Stdout = &out\n cmd.Stderr = &out\n err := cmd.Run()\n if err != nil {\n handle_cmd_error(err, out)\n }\n shovelRunningStatus = false\n\n time.Sleep(time.Duration(sleepSeconds) * time.Second)\n }\n}", "title": "" }, { "docid": "10af6e4a919ccc6890abe8ba82f49285", "score": "0.52632165", "text": "func main() {\n\tqueueOne := make(chan int, 10)\n\n\tgo func() {\n\t\tfor i := 0; i < 10; i++ {\n\t\t\tif i > 5 {\n\t\t\t\tclose(queueOne)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tqueueOne <- i\n\t\t}\n\t\t//close(queueOne)\n\t}()\n\n\tfor value := range queueOne {\n\t\tfmt.Println(\"v1 = \", value)\n\t}\n}", "title": "" }, { "docid": "bf283c34542c6f21b31f58c40d0d8843", "score": "0.5262544", "text": "func Test_multiple_sender(t *testing.T) {\n\tc := make(chan string, 5)\n\ttime.AfterFunc(50*time.Millisecond, func() {\n\t\tt.Logf(\"channel c has %d/%d items\\n\", len(c), cap(c))\n\t\tt.Log(\"channel closed\")\n\t\tclose(c)\n\t})\n\n\tgo func() {\n\t\tc <- \"sender 1 data 1\"\n\t\tc <- \"sender 1 data 2\"\n\t}()\n\n\tgo func() {\n\t\tc <- \"sender 2 data 1\"\n\t\tc <- \"sender 2 data 2\"\n\t}()\n\n\ttime.Sleep(100 * time.Millisecond)\n\n\tfor s := range c {\n\t\tt.Logf(\"read c (%d/%d) value \\\"%s\\\" \\n\", len(c), cap(c), s)\n\t}\n\n\tt.Log(\"finish\")\n}", "title": "" }, { "docid": "0b2f1f85cb23a70c6240f78d5d8c7756", "score": "0.5262156", "text": "func main() {\n\tmessages := make(chan string, 3)\n\n\tmessages <- \"buffered\"\n\tmessages <- \"channel\"\n\tmessages <- \"thirdvalue\"\n\tfmt.Println(\"lengthis is: \", len(messages))\n\n\tfmt.Println(<-messages)\n\tfmt.Println(\"lengthis is: \", len(messages))\n\tfmt.Println(<-messages)\n\n\ttime.Sleep(2* time.Second)\n\tfmt.Println(<-messages)\n\n\tfmt.Println(\"lengthis is: \", len(messages))\n}", "title": "" }, { "docid": "79b2b05cec460b774ba60e0463022eb0", "score": "0.5253683", "text": "func (this *Producer) Publish(n int64) {\n\tthis.WrittenCursor.Set(n)\n}", "title": "" }, { "docid": "a0866a4a629dc571a925f6e3be32a18e", "score": "0.52531284", "text": "func subChan(chanName string, printOrder chan string, conn redis.Conn) {\n\tpsc := redis.PubSubConn{Conn: conn}\n\tpsc.Subscribe(chanName)\n\tfor {\n\t\tswitch r := psc.Receive().(type) {\n\t\tcase error:\n\t\t\tfmt.Println(r.Error())\n\t\t\treturn\n\t\tcase redis.Subscription:\n\t\t\tswitch r.Kind {\n\t\t\tcase \"subscribe\":\n\t\t\t\tfmt.Println(\"Subscribed to: \" + r.Channel)\n\t\t\tcase \"unsubscribe\":\n\t\t\t\tfmt.Println(\"Unsubscribed to: \" + r.Channel)\n\t\t\t\treturn\n\t\t\t}\n\t\tcase redis.Message:\n\t\t\t/* Hack to keep atomic operations: use a separator that should\n\t\t\tnot appear in the tag nor the title in order to do only one send. */\n\t\t\tprintOrder <- r.Channel + \"ð\" + string(r.Data)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1c0200ee2e1e09c718269aa46e540d2e", "score": "0.5252812", "text": "func publishMessage(channel chan PubMessage, socket *zeromq.Socket) {\n\tdefer socket.Close()\n\tfor {\n\t\tmessage := <-channel\n\t\ttopic := message.GetTopic()\n\t\tzmessage := message.GetMessage()\n\t\tmessagedata := zmessage.GetTag() + constants.Delimiter + zmessage.GetContent()\n\t\t_, err := socket.SendMessage(topic, messagedata)\n\t\tif err != nil {\n\t\t\tprintln(\"[ZMQ] unable to send message. Error = \" + err.Error())\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ef11a05e590a862f6203c5f364e2baeb", "score": "0.5249208", "text": "func proc(ws *Conn) {\n\tfor {\n\t\tselect {\n\n\t\tcase msg := <-ws.chanIn:\n\t\t\tprocessMessage(ws, msg)\n\n\t\tcase <-ws.chanProcClose:\n\t\t\t// Exit\n\t\t\t//fmt.Println(\"---X_R proc finished\")\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b38fca64f246a48edcfba410c51d1095", "score": "0.524185", "text": "func consume(link <-chan int, wg *sync.WaitGroup, counter *SafeCounter, resource string) {\n\tdefer wg.Done()\n\tfor amount := range link {\n\t\tcounter.Add(resource, amount)\n\t}\n}", "title": "" }, { "docid": "0aa30e7d492fa280fdfa8ec2cfbe6a75", "score": "0.52394414", "text": "func pump(in chan string, wg *sync.WaitGroup) {\n\tfmt.Println(\"pump start\")\n\tdefer wg.Done()\n\ti := 0\n\tpumploop:\n\tfor {\n\t\tselect{\n\t\tcase _,ok:=<-closeQue:\n\t\t\tif ok {\n\t\t\t\tclose(closeQue)\n\t\t\t}\n\t\t\tfmt.Println(\"break pumploop\")\n\t\t\tbreak pumploop\n\t\tcase _,ok:=<-doneQue:\n\t\t\tif ok {\n\t\t\t\tin<-\"\"\n\t\t\t}\n\t\t\tfmt.Println(\"quit message received\")\n\t\t\tfmt.Println(\"break pumploop\")\n\t\t\tbreak pumploop\n\n\n\t\tcase in <- \"msg\" + strconv.Itoa(i):\n\n\t\t\tfmt.Printf(\"pump msg%d \\n \",i)\n\t\t\ttime.Sleep(2 * time.Millisecond)\n\t\t}\n\t\ti++\n\t\t\n\t}\n\tfmt.Println(\"pump wg.Done\")\n}", "title": "" } ]
69a20c48d24dd96ccd910ab52379d464
InitNode3 represents database configuration of Node3
[ { "docid": "25d19dace6df799ef363f4b4e788b209", "score": "0.78753364", "text": "func InitNode3() Repository {\n\tgodotenv.Load()\n\tdbHost := os.Getenv(\"NODE3_HOST\")\n\tdbPort := os.Getenv(\"NODE3_PORT\")\n\tdbUser := os.Getenv(\"NODE3_USER\")\n\tdbName := os.Getenv(\"NODE3_NAME\")\n\tdbPass := os.Getenv(\"NODE3_PASSWORD\")\n\n\tdb, err := gorm.Open(\"postgres\", fmt.Sprintf(\"host=%s port=%s user=%s dbname=%s password=%s sslmode=disable\", dbHost, dbPort, dbUser, dbName, dbPass))\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"failed to connect to database: %v\", err))\n\t}\n\n\tdb.AutoMigrate(&model.Block{})\n\n\treturn &databaseRepository{db}\n}", "title": "" } ]
[ { "docid": "1eb697bbf03cd8a1300069965c4cd393", "score": "0.6265662", "text": "func init() {\n\tdb := &Conf{}\n\terr := envconfig.Process(\"\", db)\n\tif err != nil {\n\t\tfmt.Println(\"Error in envconfig\")\n\t\tlog.Fatal(err.Error())\n\t}\n\tfmt.Println(\"DB HOST : %v\", db.DbHost)\n\tcluster = gocql.NewCluster(db.DbHost)\n\tcluster.Keyspace = \"system\"\n\tcluster.Timeout = time.Second * 20\n\tcluster.ConnectTimeout = time.Second * 20\n\n\tSession, err := cluster.CreateSession()\n\tdefer Session.Close()\n\tif err != nil {\n\t\tfmt.Println(\"Create session failed\")\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Cassandra init done\")\n\n\t//Create Keyspace\n\tif err := Session.Query(`CREATE KEYSPACE IF NOT EXISTS albumspace WITH replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };`).Exec(); err != nil {\n\t\tlog.Fatal(err)\n\t} else {\n\t\tfmt.Println(\"Keyspace created\")\n\t}\n\n\tcluster.Keyspace = \"albumspace\"\n\tsession, err := cluster.CreateSession()\n\tdefer session.Close()\n\tif err != nil {\n\t\tlog.Fatal(\"createSession:\", err)\n\t}\n\n\t//Create Table albumtable\n\tif err := session.Query(`CREATE TABLE IF NOT EXISTS albumtable(albname TEXT PRIMARY KEY, imagelist LIST<TEXT>);`).Exec(); err != nil {\n\t\tlog.Fatal(err)\n\t} else {\n\t\tfmt.Println(\"Table albumtable created\")\n\t}\n}", "title": "" }, { "docid": "d0f24185f311ca9789cdf2f214cbf5ad", "score": "0.62032557", "text": "func (n *Node) initDatabase() error {\n\tn.DB = n.Config.DB\n\n\texpectedGenesis, err := genesis.Genesis(n.Config.NetworkID)\n\tif err != nil {\n\t\treturn err\n\t}\n\trawExpectedGenesisHash := hashing.ComputeHash256(expectedGenesis)\n\n\trawGenesisHash, err := n.DB.Get(genesisHashKey)\n\tif err == database.ErrNotFound {\n\t\trawGenesisHash = rawExpectedGenesisHash\n\t\terr = n.DB.Put(genesisHashKey, rawGenesisHash)\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tgenesisHash, err := ids.ToID(rawGenesisHash)\n\tif err != nil {\n\t\treturn err\n\t}\n\texpectedGenesisHash, err := ids.ToID(rawExpectedGenesisHash)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif !genesisHash.Equals(expectedGenesisHash) {\n\t\treturn fmt.Errorf(\"db contains invalid genesis hash. DB Genesis: %s Generated Genesis: %s\", genesisHash, expectedGenesisHash)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e32e8ad752ae654dbfe85257136468f8", "score": "0.61499876", "text": "func initNode(args []string) {\n clusterID := uuid.NewUUID4().String()\n if err := engine.initEngines(args, clusterID); err != nil {\n return\n }\n if err := server.startBootstrap(clusterID); err != nil {\n return\n }\n}", "title": "" }, { "docid": "486cf3e15391d0a591b68a054204e12b", "score": "0.60240304", "text": "func InitNode1() Repository {\n\tgodotenv.Load()\n\tdbHost := os.Getenv(\"NODE1_HOST\")\n\tdbPort := os.Getenv(\"NODE1_PORT\")\n\tdbUser := os.Getenv(\"NODE1_USER\")\n\tdbName := os.Getenv(\"NODE1_NAME\")\n\tdbPass := os.Getenv(\"NODE1_PASSWORD\")\n\n\tdb, err := gorm.Open(\"postgres\", fmt.Sprintf(\"host=%s port=%s user=%s dbname=%s password=%s sslmode=disable\", dbHost, dbPort, dbUser, dbName, dbPass))\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"failed to connect to database: %v\", err))\n\t}\n\n\tdb.AutoMigrate(&model.Block{})\n\n\treturn &databaseRepository{db}\n}", "title": "" }, { "docid": "bf8f8692d8598c5d2e276f118645b90b", "score": "0.5926603", "text": "func Init(u string, dbn string) {\n\n\tuuid = u\n\n\t// \t{\"table\", \"id\", \"note\", \"error\"},\n\n\tif dbn == \"\" {\n\t\tdbname = dbnameDefault\n\t} else {\n\t\tdbname = dbn\n\t}\n}", "title": "" }, { "docid": "63e21f3de0b462d134abb393364eeb52", "score": "0.58780456", "text": "func init() {\n\tconfig.Read()\n\n\tdao.Server = config.Server\n\tdao.Database = config.Database\n\tdao.Connect()\n}", "title": "" }, { "docid": "63e21f3de0b462d134abb393364eeb52", "score": "0.58780456", "text": "func init() {\n\tconfig.Read()\n\n\tdao.Server = config.Server\n\tdao.Database = config.Database\n\tdao.Connect()\n}", "title": "" }, { "docid": "63e21f3de0b462d134abb393364eeb52", "score": "0.58780456", "text": "func init() {\n\tconfig.Read()\n\n\tdao.Server = config.Server\n\tdao.Database = config.Database\n\tdao.Connect()\n}", "title": "" }, { "docid": "63e21f3de0b462d134abb393364eeb52", "score": "0.58780456", "text": "func init() {\n\tconfig.Read()\n\n\tdao.Server = config.Server\n\tdao.Database = config.Database\n\tdao.Connect()\n}", "title": "" }, { "docid": "b54f3c09cce35725b8e2078a1c7386ba", "score": "0.5861351", "text": "func InitDB(conf *config.ServerConfig) {\n\tdb, err := Open(conf)\n\tif err != nil {\n\t\tlog.Error(err)\n\t\treturn\n\t}\n\t_defaultDB[masterNode] = db\n}", "title": "" }, { "docid": "c2e4d6cf6523e1df2cc119d697882099", "score": "0.58074045", "text": "func init() {\n\tconfig.Read()\n\n\tdao.Server = config.Server\n\tdao.Database = config.Database\n\tdao.Connect()\n\tdao2.Server = config.Server\n\tdao2.Database = config.Database\n\tdao2.Connect2()\n}", "title": "" }, { "docid": "690d415581d842dc3fa73f7eb5e378b9", "score": "0.57821006", "text": "func (this *Database) Init() (err error) {\n\tif err = this.setdbType(); err != nil {\n\t\treturn\n\t}\n\n\tif err = this.setProtocol(); err != nil {\n\t\treturn\n\t}\n\n\t// rewrite empty host and port for the MySql and Postgresql\n\tif this.dbType != dbTypeSqLite {\n\t\tthis.Host = strDefault(this.Host, defaultHost)\n\n\t\tif this.dbType == dbTypeMySql {\n\t\t\tthis.Port = intDefault(this.Port, defaultMysqlPort)\n\t\t} else {\n\t\t\tthis.Port = intDefault(this.Port, defaultPgsqlPort)\n\t\t}\n\n\t\tif isEmpty(this.User) {\n\t\t\treturn ErrorUserNameRequired\n\t\t}\n\n\t\tif isEmpty(this.Name) {\n\t\t\treturn ErrorDBNameRequired\n\t\t}\n\t} else {\n\t\tthis.Host = strDefault(this.Host, defaultSqliteDataFile)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "2815f3adaaa998eae42791f47d3fbc9f", "score": "0.57450426", "text": "func (s *Sqlite3Storage) Init() error {\n\n\tif s.dbh == nil {\n\t\tdb, err := sql.Open(\"sqlite3\", s.Filename)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unable to open db file: %s\", err.Error())\n\t\t}\n\n\t\terr = db.Ping()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"db init failure: %s\", err.Error())\n\t\t}\n\t\ts.dbh = db\n\t}\n\t// create the data structures if necessary\n\tstatement, _ := s.dbh.Prepare(\"CREATE TABLE IF NOT EXISTS visited (id INTEGER PRIMARY KEY, requestID INTEGER, visited INT)\")\n\t_, err := statement.Exec()\n\tif err != nil {\n\t\treturn err\n\t}\n\tstatement, _ = s.dbh.Prepare(\"CREATE INDEX IF NOT EXISTS idx_visited ON visited (requestID)\")\n\t_, err = statement.Exec()\n\tif err != nil {\n\t\treturn err\n\t}\n\tstatement, _ = s.dbh.Prepare(\"CREATE TABLE IF NOT EXISTS cookies (id INTEGER PRIMARY KEY, host TEXT, cookies TEXT)\")\n\t_, err = statement.Exec()\n\tif err != nil {\n\t\treturn err\n\t}\n\tstatement, err = s.dbh.Prepare(\"CREATE INDEX IF NOT EXISTS idx_cookies ON cookies (host)\")\n\t_, err = statement.Exec()\n\tif err != nil {\n\t\treturn err\n\t}\n\tstatement, err = s.dbh.Prepare(\"CREATE TABLE IF NOT EXISTS queue (id INTEGER PRIMARY KEY, data BLOB)\")\n\t_, err = statement.Exec()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d2deb6d09ead7e277f9722584acf4161", "score": "0.5742505", "text": "func init() {\n\tconf.Read()\n\tdao.Server = conf.Server\n\tdao.Database = conf.Database\n}", "title": "" }, { "docid": "3385019f80af14f293104fba56e1e29b", "score": "0.56939876", "text": "func init() {\n\tconfig.Read()\n\n\tdao.Server = config.Server\n\tdao.Database = config.Database\n\tdao.Connect()\n\n\treview_dao.Server = config.Server\n\treview_dao.Database = config.Database\n\treview_dao.Connect()\n}", "title": "" }, { "docid": "d8219888587471d6c2836718566b2208", "score": "0.56731075", "text": "func (_Abimarket3 *Abimarket3Session) Initialize() (*types.Transaction, error) {\n\treturn _Abimarket3.Contract.Initialize(&_Abimarket3.TransactOpts)\n}", "title": "" }, { "docid": "c07084ac31c1f16d5dd803cf650ef13e", "score": "0.56664604", "text": "func init() {\n\tinitConfig()\n\tcreateDbSession()\n}", "title": "" }, { "docid": "6d1a8d9c5e2e9f78704ae5c1a5598c0d", "score": "0.56656796", "text": "func (_Abimarket3 *Abimarket3TransactorSession) Initialize() (*types.Transaction, error) {\n\treturn _Abimarket3.Contract.Initialize(&_Abimarket3.TransactOpts)\n}", "title": "" }, { "docid": "c8d080f3fd3de8dba46e9b604eddf834", "score": "0.56626517", "text": "func InitNode2() Repository {\n\tgodotenv.Load()\n\tdbHost := os.Getenv(\"NODE2_HOST\")\n\tdbPort := os.Getenv(\"NODE2_PORT\")\n\tdbUser := os.Getenv(\"NODE2_USER\")\n\tdbName := os.Getenv(\"NODE2_NAME\")\n\tdbPass := os.Getenv(\"NODE2_PASSWORD\")\n\n\tdb, err := gorm.Open(\"postgres\", fmt.Sprintf(\"host=%s port=%s user=%s dbname=%s password=%s sslmode=disable\", dbHost, dbPort, dbUser, dbName, dbPass))\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"failed to connect to database: %v\", err))\n\t}\n\n\tdb.AutoMigrate(&model.Block{})\n\n\treturn &databaseRepository{db}\n}", "title": "" }, { "docid": "1954fb92489107fb23aefe579800f037", "score": "0.5621953", "text": "func (t *Tree) initNodeData(key string) error {\n\tv, err := t.cluster.View([]byte(node.NodeDataBucketID), []byte(key))\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(v) != 0 {\n\t\treturn nil\n\t}\n\n\tt.logger.Info(key, \"is not inited, begin to init\")\n\n\t// Create rootNode map/bucket and init template.\n\tif _, err := t.NewNode(node.RootNode, \"\", \"-\", node.Root); err != nil {\n\t\tpanic(\"create root node fail: \" + err.Error())\n\t}\n\n\tfor _, meta := range node.InitNodes {\n\t\tl := strings.SplitAfterN(meta.Name, node.NodeDeli, 2)\n\t\tif len(l) != 2 {\n\t\t\tcontinue\n\t\t}\n\t\tif _, err := t.NewNode(strings.TrimSuffix(l[0], node.NodeDeli), meta.Comment, l[1], meta.Tp, node.NotMatchMachine); err != nil {\n\t\t\tpanic(\"create node \" + meta.Name + \" failed: \" + err.Error())\n\t\t}\n\t}\n\n\tif common.IsDocker() {\n\t\tfor _, meta := range node.InitMachines {\n\t\t\tif err := t.SetResource(meta.NS, meta.Type, meta.ResourceList); err != nil {\n\t\t\t\tpanic(\"create machine in \" + meta.NS + \" failed: \" + err.Error())\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "bada20626eae9688f4b3196d78d87301", "score": "0.5615252", "text": "func Init(cfg *DBConfig) error {\n\tvar err error\n\n\tos.MkdirAll(cfg.Location, os.ModePerm)\n\t//dsn := fmt.Sprintf(\"%s:%s@tcp(%s)/%s?charset=utf8mb4&parseTime=True&loc=Local\", cfg.User, cfg.Password, cfg.Location, cfg.DBName)\n\t//db, err = gorm.Open(mysql.New(mysql.Config{\n\t//\tDSN: dsn, // DSN data source name\n\t//\tDefaultStringSize: 256, // string 类型字段的默认长度\n\t//\tDisableDatetimePrecision: true, // 禁用 datetime 精度,MySQL 5.6 之前的数据库不支持\n\t//\tDontSupportRenameIndex: true, // 重命名索引时采用删除并新建的方式,MySQL 5.7 之前的数据库和 MariaDB 不支持重命名索引\n\t//\tDontSupportRenameColumn: true, // 用 `change` 重命名列,MySQL 8 之前的数据库和 MariaDB 不支持重命名列\n\t//\tSkipInitializeWithVersion: false, // 根据当前 MySQL 版本自动配置\n\t//}), &gorm.Config{})\n\tdbClient, err = gorm.Open(sqlite.Open(cfg.Location+cfg.DBName+\".db3\"), &gorm.Config{})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"db connect failed: %v\", err)\n\t}\n\n\tdbClient.AutoMigrate(\n\t\t&Envior{},\n\t)\n\treturn nil\n}", "title": "" }, { "docid": "73ce7899dfe08904d38e8fb39a504d5f", "score": "0.5576451", "text": "func InitDAL() {\n\tDAL = new(MyDAL)\n\tvar err error\n\tCFG, err = NewConfig(\"./config.json\")\n\tutils.CheckError(\"InitDAL\", err)\n\tif err != nil {\n\t\tos.Exit(1)\n\t}\n\tnodeRole := strings.ToLower(CFG.NodeRole)\n\tif nodeRole != \"primary\" && nodeRole != \"replica\" {\n\t\tfmt.Printf(\"Error: node_role %s is not supported, it should be primary or replica, please check config.json \\n\", nodeRole)\n\t\tutils.DebugPrintln(\"Error: node_role \", nodeRole, \" is not supported, it should be primary or replica, please check config.json\")\n\t\tos.Exit(1)\n\t}\n\tIsPrimary = (nodeRole == \"primary\")\n\tif IsPrimary {\n\t\tconn := fmt.Sprintf(\"host=%s port=%s user=%s password=%s dbname=%s sslmode=disable\",\n\t\t\tCFG.PrimaryNode.Database.Host,\n\t\t\tCFG.PrimaryNode.Database.Port,\n\t\t\tCFG.PrimaryNode.Database.User,\n\t\t\tCFG.PrimaryNode.Database.Password,\n\t\t\tCFG.PrimaryNode.Database.DBName)\n\t\tDAL.db, err = sql.Open(\"postgres\", conn)\n\t\tutils.CheckError(\"InitDAL sql.Open:\", err)\n\t\tif err != nil {\n\t\t\tos.Exit(1)\n\t\t}\n\t\t// Check if the User and Password are Correct\n\t\t_, err = DAL.db.Query(\"select 1\")\n\t\tutils.CheckError(\"InitDAL Failed, Error:\", err)\n\t\tif err != nil {\n\t\t\tutils.DebugPrintln(\"InitDAL Failed, Please check the database user and password. Error:\", err)\n\t\t\tos.Exit(1)\n\t\t}\n\n\t\t// Database user and password OK\n\t\tDAL.db.SetMaxOpenConns(99)\n\t} else {\n\t\t// Init Node Key (Share with primary node)\n\t\tNodeKey = NodeHexKeyToCryptKey(CFG.ReplicaNode.NodeKey)\n\t}\n}", "title": "" }, { "docid": "1df2cfffb4f0302f19bc793928541e49", "score": "0.556523", "text": "func (db *DB) Init() error {\n\tquery := `\n\ncreate table if not exists identities (\n id integer not null primary key,\n name text not null,\n created_at timestamp not null,\n public_key blob not null -- an x509 cert as ascii\n);\n\ncreate table if not exists ledger (\n id integer not null primary key,\n created_at timestamp not null,\n identity integer not null,\n message text not null,\n hash blob not null,\n\n foreign key (identity) references identities(id)\n);\n`\n\tif _, err := db.Exec(query); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7c942abf9403176d29306dbc1b204598", "score": "0.5561278", "text": "func init() {\n\tmongoConfig.Read()\n\tjwtConfig.Read()\n\n\tdao.Server = mongoConfig.Server\n\tdao.Database = mongoConfig.Database\n\tdao.Connect()\n}", "title": "" }, { "docid": "47846dba56e5944b7a85d8cda66107cc", "score": "0.5552054", "text": "func InitDatabase(db *models.Database) error {\n\t//if err := common.TestTCPConn(fmt.Sprintf(\"%s:%d\", db.Host, db.Port), 60, 2); err != nil {\n\t//\treturn err\n\t//}\n\n\tif err := orm.RegisterDriver(\"postgres\", orm.DRPostgres); err != nil {\n\t\treturn err\n\t}\n\n\tinfo := fmt.Sprintf(\"host=%s port=%s user=%s password=%s dbname=%s sslmode=%s\",\n\t\tdb.Host, strconv.Itoa(db.Port), db.Username, db.Password, db.Database, db.SSLMode)\n\n\tif err := orm.RegisterDataBase(\"default\", \"postgres\", info, db.MaxIdleConns, db.MaxOpenConns); err != nil {\n\t\treturn err\n\t}\n\n\tdatabase, _ := orm.GetDB()\n\tdatabase.SetMaxOpenConns(db.MaxOpenConns)\n\n\tfmt.Println(\"Register database completed\")\n\treturn nil\n}", "title": "" }, { "docid": "89fa00ba42b058ac0102124a793e5f20", "score": "0.55454206", "text": "func Init(c config.DatabaseStruct) {\n\tconnArgs := fmt.Sprintf(\"sslmode=%s host=%s dbname=%s user=%s password=%s\", c.SSLMode, c.Host, c.DBName, c.User, c.Password)\n\tdb, err = gorm.Open(\"postgres\", connArgs)\n\tif err != nil {\n\t\tlog.Error(\"database.Init\", err)\n\t}\n\t// 全局使用單數表名\n\tdb.SingularTable(true)\n\n\t// // 启用Logger,显示详细日志\n\t// db.LogMode(true)\n\n\t// // 禁用日志记录器,不显示任何日志\n\t// db.LogMode(false)\n\n\t// // 调试单个操作,显示此操作的详细日志\n\t// db.Debug().Where(\"name = ?\", \"jinzhu\").First(&User{})\n\n}", "title": "" }, { "docid": "8ad979dabb002699b3f7d574ad699de5", "score": "0.5544", "text": "func init() {\n\t// dbType := conf.ServerCfg.Get(constant.DB_TYPE)\n\t// dbHost := conf.ServerCfg.Get(constant.DB_HOST)\n\t// dbPort := conf.ServerCfg.Get(constant.DB_PORT)\n\t// dbUser := conf.ServerCfg.Get(constant.DB_USER)\n\t// dbPwd := conf.ServerCfg.Get(constant.DB_PWD)\n\t// dbName := conf.ServerCfg.Get(constant.DB_NAME)\n\n\t// dbType := constant.DB_TYPE\n\t// dbHost := constant.DB_HOST\n\t// dbPort := constant.DB_PORT\n\t// dbUser := constant.DB_USER\n\t// dbPwd := constant.DB_PWD\n\t// dbName := constant.DB_NAME\n\n\tvar err error\n\n\tDb, err = gorm.Open(\"mysql\", \"root:root@(localhost:3306)/scratch_maker?charset=utf8&parseTime=True&loc=Local\")\n\tif err != nil {\n\t\tlog.Fatalln(\"Fail to connect database!\")\n\t}\n\tfmt.Printf(\"database connected!!!\")\n\n\tDb.SingularTable(true)\n\tif !Db.HasTable(&User{}) {\n\t\tDb.CreateTable(&User{})\n\t}\n\tif !Db.HasTable(&Game{}) {\n\t\tDb.CreateTable(&Game{})\n\t}\n\tif !Db.HasTable(&Photo{}) {\n\t\tDb.CreateTable(&Photo{})\n\t}\n}", "title": "" }, { "docid": "1231c872512849906408f62e373030cb", "score": "0.5529271", "text": "func Init(config dbconfig.DatabaseConfig) {\n\tdb, err := Connect(config)\n\tif err != nil {\n\t\tlog.Println(\"Couldn't connect!\", err.Error())\n\t\tpanic(err)\n\t} else {\n\t\tSetDB(db)\n\t\tlog.Println(\"Database connected on \", config.DBHost+config.DBPort)\n\t}\n}", "title": "" }, { "docid": "22ec3f7ef83c318ec9fe8dc9f9a1c6f3", "score": "0.55235887", "text": "func Init(c Config) {\n\tconfigOnce.Do(func() {\n\t\tlog.Infof(\"Initializing database.\")\n\n\t\tlog.Verbosef(\"Setting the database config as follows:\")\n\t\tlog.Verbosef(\"{ Host: %v\", c.Host)\n\t\tlog.Verbosef(\", Post: %v\", c.Port)\n\t\tlog.Verbosef(\", DB: %v\", c.DB)\n\t\tlog.Verbosef(\", User: %v }\", c.User)\n\n\t\tconfig = &c\n\t})\n}", "title": "" }, { "docid": "5b55675034b105f81ad45e3b4ca95543", "score": "0.5516668", "text": "func Init() {\n\tvar err error\n\tconst (\n\t\thost = \"ec2-52-73-247-67.compute-1.amazonaws.com\"\n\t\tuser = \"hyrjphcachsrpy\"\n\t\tpassword = \"1ef60c7ca1d1737639e27fcfd40b3b7cb65669499cdc7baefa85e76274c92043\"\n\t\tdatabase = \"d8e81j1jlb7c16\"\n\n\t\t// host = \"localhost\"\n\t\t// user = \"postgres\"\n\t\t// password = \"motordoc\"\n\t\t// dbname = \"postgres\"\n\t\t// database = \"motordoc\"\n\t)\n\n\tdbinfo := fmt.Sprintf(\"user=%s password=%s host=%s port=5432 dbname=%s\", // sslmode=disable\n\t\tuser,\n\t\tpassword,\n\t\thost,\n\t\tdatabase,\n\t)\n\n\tfmt.Println(\"==>\", dbinfo)\n\n\tdb, err = gorm.Open(\"postgres\", dbinfo)\n\tif err != nil {\n\t\tlog.Println(\"Error al conectarse a la base de datos\")\n\t\tpanic(err)\n\t}\n\tlog.Println(\"------Base de datos conectada-----\")\n}", "title": "" }, { "docid": "cacb9a17799b42ae0541d73871cdb1b4", "score": "0.55078536", "text": "func Init(conf *Config, sch SchemaList) *DB {\n\tif conf.Port < 1000 {\n\t\tpanic(\"graphinit: invalid dgraph port number\")\n\t}\n\tdb := connect(conf, sch)\n\treturn db\n}", "title": "" }, { "docid": "a2d1145cd9d2f02e49e79fbb7d4763c1", "score": "0.5505524", "text": "func Init(c config.Config) {\n\tschema = strings.Split(c.Server.DatabaseURL, \"://\")\n\tif schema[0] == \"sqlite\" {\n\t\tdb, err = gorm.Open(\"sqlite3\", schema[1])\n\t\tif err != nil {\n\t\t\tfmt.Fprintln(os.Stderr, \"failed to connect database: \"+err.Error())\n\t\t\tos.Exit(255)\n\t\t}\n\t\tdb.Exec(\"PRAGMA foreign_keys = ON;\")\n\t} else if schema[0] == \"mysql\" {\n\t\tdb, err = gorm.Open(\"mysql\", schema[1]+\"?charset=utf8&parseTime=True&loc=Local\")\n\t\tif err != nil {\n\t\t\tos.Exit(255)\n\t\t}\n\t} else {\n\t\tfmt.Println(\"dosanco can not recognise database url\")\n\t\tos.Exit(255)\n\t}\n\n\tif c.Feature.Network {\n\t\tinitNetwork()\n\t\tinitIPAllocation()\n\t}\n\tif c.Feature.Host {\n\t\tinitHost()\n\t}\n\tif c.Feature.DataCenter {\n\t\tinitDataCenter()\n\t}\n}", "title": "" }, { "docid": "d349a43a705a080bd0f6d44f57919163", "score": "0.5491911", "text": "func (d *Store) Initialize() error {\n\tqueries := []string{\n\t\t\"CREATE SCHEMA cm\",\n\t\t\"CREATE TYPE cm.membership_status AS ENUM ('active', 'prep', 'inactive')\",\n\t\t\"CREATE TYPE cm.blood_group AS ENUM ('A+', 'A-', 'B+', 'B-', 'O+', 'O-', 'AB+', 'AB-')\",\n\t\t\"CREATE TYPE cm.family_role AS ENUM ('spouse', 'children', 'sibling', 'parent')\",\n\t\t\"CREATE TYPE cm.txn_type AS ENUM ('tithe', 'donation')\",\n\t\t\"CREATE TABLE IF NOT EXISTS cm.user (_id BIGSERIAL, username VARCHAR, password VARCHAR, session_token VARCHAR)\",\n\n\t\t//To Add: Blood Group, date of baptism, date of confirmation, membership status, profession, remarks, photo\n\t\tfmt.Sprintf(\"CREATE TABLE IF NOT EXISTS cm.member (%s BIGINT, %s VARCHAR, %s VARCHAR, %s date, %s VARCHAR, %s VARCHAR, %s VARCHAR, %s VARCHAR, %s VARCHAR, %s VARCHAR, %s BIGINT, %s VARCHAR, %s BIGINT, %s cm.blood_group, %s BYTEA)\", ID, FirstName, LastName, DateOfBirth, Gender, Phone, Home, Email, Address, Pincode, FamilyID, Remarks, ProfessionID, BloodGroup, Photo),\n\n\t\t\"CREATE TABLE IF NOT EXISTS cm.family (_id BIGINT, family_head BIGINT)\",\n\t\t\"CREATE TABLE IF NOT EXISTS cm.transactions (_id BIGINT, amount numeric, date date, type cm.txn_type, remarks VARCHAR)\",\n\t\tfmt.Sprintf(\"CREATE TABLE IF NOT EXISTS cm.profession (%s BIGINT, %s VARCHAR)\", ID, Description),\n\n\t\t// Default Values\n\t\tfmt.Sprintf(\"INSERT INTO cm.profession(%s, %s) VALUES (%s, 'Doctor'), (%s, 'Engineer'), (%s, 'Architect'), (%s, 'Other')\", ID, Description, strconv.FormatInt(d.NextID(), 10), strconv.FormatInt(d.NextID(), 10), strconv.FormatInt(d.NextID(), 10), strconv.FormatInt(d.NextID(), 10)),\n\t}\n\tfor _, q := range queries {\n\t\t_, err := d.cxn.Exec(context.TODO(), q)\n\t\tif err != nil {\n\t\t\tfmt.Println(\"err: \", q)\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d0369e4db2368098eb4d16dbf39f9763", "score": "0.5491518", "text": "func init(){\n\t// Instantiate the database connections needed\n\n}", "title": "" }, { "docid": "0a8ea8d36de20c67fd7746aa7279231c", "score": "0.5474381", "text": "func (db *DBCreds) Init(host string, port int, admin string, passwd string, dbtype string, dbname string, cfgsrc string, extra string) {\n\tdb.addr = host\n\tdb.port = port\n\tdb.admin = admin\n\tdb.passwd = passwd\n\tdb.name = dbname\n\tdb.dbtype = dbtype\n\tdb.cfgsrc = cfgsrc\n\tdb.extra = extra\n}", "title": "" }, { "docid": "c84ea35efb2bd476d5540c8f8b0df7c9", "score": "0.54732174", "text": "func Initialize(name string, c *Config, configFile string) error {\n\tnode := c.Topology[name]\n\n\tif !node.IsMaster {\n\t\treturn nil\n\t}\n\tglog.Infof(\"Initializing master node %q\", name)\n\tbase := c.General.WorkArea\n\terr := CreateCertKeyArea(base)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = CreateKeyForCA(base)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = CreateCertificateForCA(c.Mgmt.Info[0].Prefix, node.ID, base)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = CreateX509CertForCA(base)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = CreateRSAForCA(base)\n\tif err != nil {\n\t\treturn err\n\t}\n\thash, err := CreateDigestForCA(base)\n\tif err != nil {\n\t\treturn err\n\t}\n\ttoken, err := CreateToken()\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = UpdateConfigYAML(configFile, token, hash)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tglog.Infof(\"Node %q initialized\", name)\n\treturn nil\n}", "title": "" }, { "docid": "4acc157d660d3efdf70f6627729fb4ab", "score": "0.5462373", "text": "func init() {\n\tlogrus.Printf(\"Initializing data storage...\")\n\tconf := config.GetStorageConfiguration()\n\tif err := InitializeObjectStorage(conf); err != nil {\n\t\tlogrus.Fatal(\"Error initializing storage : \", err)\n\t}\n\tif err := InitializeDatabase(conf); err != nil {\n\t\tlogrus.Fatal(\"Error initializaing database : \", err)\n\t}\n\tlogrus.Println(\"Storage configured!\")\n}", "title": "" }, { "docid": "62c0159e10d6b192f38c81391ab2fd83", "score": "0.5456398", "text": "func InitDatabase() *sql.DB {\n\tdb, err := sql.Open(\"sqlite3\", defaultDatabaseFile)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\tsqlStmt := `\n\tCREATE TABLE IF NOT EXISTS installation (is_already_installed boolean, access_token text);\n\tCREATE TABLE IF NOT EXISTS containers (id integer not null primary key autoincrement, container_id text, container_name text, image_name text, network_id text, author text);\n\tCREATE TABLE IF NOT EXISTS networks (id integer not null primary key autoincrement, network_id text, network_name text, author text);\n\t`\n\t_, err = db.Exec(sqlStmt)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\treturn db\n}", "title": "" }, { "docid": "8a1f7c6f3a7a93ec72ac60de66dafc90", "score": "0.54550904", "text": "func (s *SQLStore) Init() {\n\tvar err error\n\n\tconfigSchema := `PRAGMA foreign_keys = ON;`\n\n\t_, err = s.db.Exec(configSchema)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\teventSchema := `CREATE TABLE events (\n\t\tid TEXT NOT NULL,\n\t\ttitle TEXT NOT NULL,\n\t\tdesc TEXT NOT NULL,\n\t\tPRIMARY KEY(id)\n\t\t);`\n\n\t_, err = s.db.Exec(eventSchema)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tquestionSchema := `CREATE TABLE questions (\n\t\tid TEXT NOT NULL,\n\t\tevent_id TEXT NOT NULL,\n\t\tbody TEXT NOT NULL,\n\t\tcreated_timestamp DATETIME NOT NULL,\n\t\tFOREIGN KEY(event_id) REFERENCES events(id)\n\t\t);`\n\n\t_, err = s.db.Exec(questionSchema)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "697eeedae82187354e5e91bf250ff5e4", "score": "0.5449477", "text": "func init() {\n\tconfig = GetConfig()\n\tlogger = NewLogger(config.LogConfig)\n\tvar err error\n\t// Must be \"=\", else `db` is not available in handlers.\n\tdb, err = getDB()\n\tcheckErr(err)\n\tinitKeySets()\n}", "title": "" }, { "docid": "f55b6fe7ec575968caab7dd3a32fda6b", "score": "0.54328513", "text": "func (_Abimarket3 *Abimarket3Transactor) Initialize(opts *bind.TransactOpts) (*types.Transaction, error) {\n\treturn _Abimarket3.contract.Transact(opts, \"initialize\")\n}", "title": "" }, { "docid": "655bb0bcf19380d6885741d090365874", "score": "0.54186356", "text": "func (db *MongoDB) Init() error {\n\t db.Databasename = common.Config.MgDbName\n \n\t // DialInfo holds options for establishing a session with a MongoDB cluster.\n\t dialInfo := &mgo.DialInfo{\n\t\t Addrs: []string{common.Config.MgAddrs}, // Get HOST + PORT\n\t\t Timeout: 60 * time.Second,\n\t\t Database: db.Databasename, // Database name\n\t\t Username: common.Config.MgDbUsername, // Username\n\t\t Password: common.Config.MgDbPassword, // Password\n\t }\n \n\t // Create a session which maintains a pool of socket connections\n\t // to the DB MongoDB database.\n\t var err error\n\t db.MgDbSession, err = mgo.DialWithInfo(dialInfo)\n \n\t if err != nil {\n\t\t log.Debug(\"Can't connect to mongo, go error: \", err)\n\t\t return err\n\t }\n \n\t return db.initData()\n }", "title": "" }, { "docid": "03b3dc7ce675a20477cd0c30fd8ca6db", "score": "0.5414259", "text": "func (dm *DatabaseManager) Init(db map[int]*Database) {\n\tdm.DBList = db\n\n\tfor _, value := range dm.DBList {\n\t\tdm.connect(value)\n\t}\n}", "title": "" }, { "docid": "1ae586ae5f587dd542568705f536be79", "score": "0.541213", "text": "func init() {\n\torm.RegisterDataBase(\"default\", \"mysql\", \"root:tester@tcp(127.0.0.1:3306)/test?charset=utf8\")\n\n\torm.RegisterModel(new(User), new(Article), new(ArticleType))\n\n\torm.RunSyncdb(\"default\", false, true)\n\t// true: 每次运行程序时, 重新创建表\n\t// orm.RunSyncdb(\"default\", true, true)\n}", "title": "" }, { "docid": "d387a723af304a29a8a1f4a444dc81fb", "score": "0.541127", "text": "func StormInit(database string) error {\n\tdb, err := storm.Open(database, StormCodec)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"could not get database connection\")\n\t}\n\n\tif err := db.Init(&model.User{}); err != nil {\n\t\treturn errors.Wrap(err, \"could not init user index\")\n\t}\n\n\terr = db.Init(&model.Item{})\n\treturn errors.Wrap(err, \"could not init item index\")\n}", "title": "" }, { "docid": "cb38c6fa207916e05cbf17139a7f33ba", "score": "0.5395331", "text": "func Init() {\n\tloadConfig()\n\tconnection := fmt.Sprintf(\"host=%s user=%s password=%s dbname=%s sslmode=disable\", config.Database.Host, config.Database.User, config.Database.Password, config.Database.Name)\n\tmodels.InitDB(connection)\n}", "title": "" }, { "docid": "e728ba04cf49e14515273e3e2aa2f145", "score": "0.5379759", "text": "func Init() error {\n\tdsn := fmt.Sprintf(\"postgres://%s:%s@%s/%s?sslmode=%s\",\n\t\tconf.Database.User,\n\t\tconf.Database.Password,\n\t\tconf.Database.Host,\n\t\tconf.Database.Name,\n\t\tconf.Database.SSLMode,\n\t)\n\tdb, err := gorm.Open(postgres.Open(dsn), &gorm.Config{\n\t\tNowFunc: func() time.Time {\n\t\t\treturn dbutil.Now()\n\t\t},\n\t})\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"open connection\")\n\t}\n\n\t// Migrate databases.\n\tif db.AutoMigrate(allTables...) != nil {\n\t\treturn errors.Wrap(err, \"auto migrate\")\n\t}\n\n\tActions = NewActionsStore(db)\n\tBulletins = NewBulletinsStore(db)\n\tChallenges = NewChallengesStore(db)\n\tFlags = NewFlagsStore(db)\n\tGameBoxes = NewGameBoxesStore(db)\n\tLogs = NewLogsStore(db)\n\tManagers = NewManagersStore(db)\n\tTeams = NewTeamsStore(db)\n\n\treturn nil\n}", "title": "" }, { "docid": "c1a31e64f3f35452116315af49da6c9c", "score": "0.5375244", "text": "func (ds *DataStore) Init(db Database.Database) {\n\tds.Database = db\n}", "title": "" }, { "docid": "49d1a3c788594eef30b90af2009838fd", "score": "0.53745776", "text": "func InitDatabase(c *conf.Config) (model.Storage, error) {\n\tdb, err := model.BootstrapPostgres(c.Database)\n\tif err != nil {\n\t\treturn nil, err\n\t} else {\n\t\tlog.Info().Msgf(\"database ssl status is %s\", c.Database.SslMode)\n\t}\n\treturn db, nil\n}", "title": "" }, { "docid": "d881b12423e726d9e8581eb275913315", "score": "0.5355824", "text": "func InitDB(config string) error {\n\treturn connectToDB(\"./database.sqlite3\")\n}", "title": "" }, { "docid": "79d186076189885907c3410922e2e982", "score": "0.5354568", "text": "func init() {\n\n\t// Make and set the DB connection.\n\tdb, _ = sqlx.Open(\"mysql\", \"root:password@tcp(localhost:3306)/people\")\n}", "title": "" }, { "docid": "e5db64d8d67edf77153fe3df2706af93", "score": "0.53521615", "text": "func newConfigV3() *configV3 {\n\tconf := new(configV3)\n\tconf.Version = \"3\"\n\tconf.Aliases = make(map[string]string)\n\tconf.Hosts = make(map[string]hostConfigV3)\n\treturn conf\n}", "title": "" }, { "docid": "d379a7891556012abc9717b563529ef2", "score": "0.53504544", "text": "func init() {\n\tdbType := conf.ServerCfg.Get(constant.DBType)\n\tdbHost := conf.ServerCfg.Get(constant.DBHost)\n\tdbPort := conf.ServerCfg.Get(constant.DBPort)\n\tdbUser := conf.ServerCfg.Get(constant.DBUser)\n\tdbPwd := conf.ServerCfg.Get(constant.DBPwd)\n\tdbName := conf.ServerCfg.Get(constant.DBName)\n\n\tvar err error\n\tdb, err = gorm.Open(dbType, fmt.Sprintf(constant.DBConnect, dbUser, dbPwd, dbHost, dbPort, dbName))\n\tif err != nil {\n\t\tutils.AppLogger.Fatal(err.Error(), zap.String(\"service\", \"init()\"))\n\t}\n\n\tdb.SingularTable(true)\n\tif !db.HasTable(&Auth{}) {\n\t\tdb.CreateTable(&Auth{})\n\t}\n\n\tif !db.HasTable(&Bucket{}) {\n\t\tdb.CreateTable(&Bucket{})\n\t}\n\n\tif !db.HasTable(&Photo{}) {\n\t\tdb.CreateTable(&Photo{})\n\t}\n\n\t// run a goroutine never exit to listen to redis callbacks\n\tgo listenRedisCallback()\n\n}", "title": "" }, { "docid": "e12ef06834b8dcf3cbe14ca6ee787aed", "score": "0.5346515", "text": "func (c *CockroachDB) Init(metadata state.Metadata) error {\n\treturn c.dbaccess.Init(metadata)\n}", "title": "" }, { "docid": "109e9477cc3c646ba3c6aa222ce2b503", "score": "0.53419805", "text": "func Initialize(kvEngine Engine, description string) error {\n\tkvDB, ok := kvEngine.(OrderedKeyValueDB)\n\tif !ok {\n\t\treturn fmt.Errorf(\"Database %q is not a valid ordered key-value database\", kvEngine.String())\n\t}\n\n\tvar err error\n\tmanager.graphEngine, err = NewGraphStore(kvDB)\n\tif err != nil {\n\t\treturn err\n\t}\n\tmanager.graphDB, ok = manager.graphEngine.(GraphDB)\n\tif !ok {\n\t\treturn fmt.Errorf(\"Database %q cannot support a graph database\", kvEngine.String())\n\t}\n\tmanager.graphSetter, ok = manager.graphEngine.(GraphSetter)\n\tif !ok {\n\t\treturn fmt.Errorf(\"Database %q cannot support a graph setter\", kvEngine.String())\n\t}\n\tmanager.graphGetter, ok = manager.graphEngine.(GraphGetter)\n\tif !ok {\n\t\treturn fmt.Errorf(\"Database %q cannot support a graph getter\", kvEngine.String())\n\t}\n\n\t// Setup the three tiers of storage. In the case of a single local server with\n\t// embedded storage engines, it's simpler because we don't worry about cross-process\n\t// synchronization.\n\tmanager.metadata = kvDB\n\tmanager.mutable = kvDB\n\tmanager.immutable = kvDB\n\n\tmanager.enginesAvail = append(manager.enginesAvail, description)\n\n\tmanager.setup = true\n\treturn nil\n}", "title": "" }, { "docid": "b6672ca6d74077279bb636c51e242f65", "score": "0.5330876", "text": "func Initialization(ctx context.Context) error {\n\t// Set go-routine count\n\tcoreCount = runtime.NumCPU()\n\tif coreCount < 4 {\n\t\tcoreCount = 4\n\t}\n\n\t// Get environment various\n\tisTracking, err := strconv.ParseBool(os.Getenv(\"IS_TRACKING\"))\n\tif err != nil {\n\t\treturn errors.New(\"Invalid environment various (for sql tracking)\")\n\t}\n\n\t// Create internal database connection pool\n\tif err := createInternalConnectionPool(ctx, false); err != nil {\n\t\treturn err\n\t} else {\n\t\tlog.Println(\"[NOTICE] Successful connection with internal database\")\n\t}\n\n\t// Create exteranl database connection pool\n\tgExDB = make(map[string]model.ConnInfo)\n\tif err := createExternalConnectionPool(ctx, isTracking); err != nil {\n\t\treturn err\n\t} else {\n\t\tlog.Println(\"[NOTICE] Successful connection with external databases\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5c9a8799451280947656c0b992e04aff", "score": "0.53306717", "text": "func init() {\n\tdialect.Register(\"sqlite3\", Dialect())\n}", "title": "" }, { "docid": "82781915b54ffa472a5ef93b7007464b", "score": "0.5311139", "text": "func (conection *DBConection) Init() error {\n\n\tconfigDB := fmt.Sprintf(\"%s:%s@tcp(%s)/%s\",\n\t\tconection.User,\n\t\tconection.Password,\n\t\tconection.Address,\n\t\tconection.Schema,\n\t)\n\n\tvar err error\n\tconection.db, err = sqlx.Open(\"mysql\", configDB)\n\tif err != nil {\n\t\treturn errors.New(\"sql.Open failed\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c40b2999d35f7437519eb379f20177b7", "score": "0.5309797", "text": "func init() {\n\tvar err error\n\tDb, err = sql.Open(\"mysql\", user+\":\"+passwd+\"@tcp(\"+dbhostip+\")/\"+dbname+\"?charset=utf8\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t//Db.Query(\"drop database if exists gwp\")\n\t//Db.Query(\"create database gwp\")\n\t//Db.Query(\"use gwp\")\n\t//Db.Query(\"create table posts(id int primary key, )database gwp\")\n}", "title": "" }, { "docid": "840a9ec8d1f424da3951c4c5ecf49e41", "score": "0.53052026", "text": "func Init(params *config.ParameterContainer) {\n\n\tParameterContainer = params\n\n\tDB = &db{\n\t\tUser: params.Value(\"db:user\"),\n\t\tPassword: params.Value(\"db:pass\"),\n\t\tHost: params.Value(\"db:host\"),\n\t\tName: params.Value(\"db:name\"),\n\t}\n\n\tWeb = &web{\n\t\tHost: params.Value(\"web:host\"),\n\t\tPort: params.Value(\"web:port\"),\n\t}\n\n\tMailer = &mailer{\n\t\tHost: params.Value(\"mailer:host\"),\n\t\tPort: params.Value(\"mailer:port\"),\n\t\tUser: params.Value(\"mailer:user\"),\n\t\tPassword: params.Value(\"mailer:pass\"),\n\t}\n\n\tLogger = &logger{\n\t\tDebug: params.Value(\"logger:debug\"),\n\t}\n\n\tTheme = &theme{}\n}", "title": "" }, { "docid": "afd1b9e6267e25e461f1680d79b12e3f", "score": "0.5290948", "text": "func Init() *gorm.DB {\n\tdb, err := gorm.Open(\"sqlite3\", \"./sqlite3.db\")\n\tif err != nil {\n\t\tfmt.Println(\"db err: \", err)\n\t}\n\tdb.DB().SetMaxIdleConns(10)\n\tdb.LogMode(true)\n\treturn db\n}", "title": "" }, { "docid": "d8db2248bf0a23344bcf6e6b27d46d0e", "score": "0.52906907", "text": "func InitDatabase(context *userbase.DbContext) {\n\n\tcontext.CreateUser(userbase.CreateUserRequest{\n\t\tUsername: \"root\",\n\t\tAuthentication: userbase.AuthenticationInfo{\n\t\t\tPassword: \"abcd1234\",\n\t\t\tEmail: \"root@ericmas001.com\"},\n\t\tProfile: userbase.ProfileInfo{\n\t\t\tDisplayName: \"ADMIN\"}})\n\n\tcontext.CreateUser(userbase.CreateUserRequest{\n\t\tUsername: \"dummy\",\n\t\tAuthentication: userbase.AuthenticationInfo{\n\t\t\tPassword: \"abcd1234\",\n\t\t\tEmail: \"dummy@ericmas001.com\"},\n\t\tProfile: userbase.ProfileInfo{\n\t\t\tDisplayName: \"UNUSED\"}})\n\n\tdumpUsers(context)\n\tinsertDummyToken(context)\n\tinsertDummyRecoveryToken(context)\n}", "title": "" }, { "docid": "551574e54ab28332d3b1007128fd030f", "score": "0.52882093", "text": "func Init(config *config.Configuration) (*DataBase, error) {\n\tds, err := connect(config, config.Database.Type)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ds, nil\n}", "title": "" }, { "docid": "767616f903df517bfee57932e1d225f6", "score": "0.5283835", "text": "func InitDB(dbc *DatabaseCfg) {\n\t// Create ORM engine and database\n\tvar err error\n\tvar dbtype string\n\tvar datasource string\n\n\tlog.Debugf(\"Database config: %+v\", dbc)\n\n\tswitch dbc.Type {\n\tcase \"sqlite3\":\n\t\tdbtype = \"sqlite3\"\n\t\tdatasource = dataDir + \"/\" + dbc.Name + \".db\"\n\tcase \"mysql\":\n\t\tdbtype = \"mysql\"\n\t\tdatasource = dbc.User + \":\" + dbc.Pass + \"@\" + dbc.Host + \"/\" + dbc.Name + \"?charset=utf8\"\n\tdefault:\n\t\tlog.Errorf(\"unknown db type %s\", dbc.Type)\n\t\treturn\n\t}\n\n\tdbc.x, err = xorm.NewEngine(dbtype, datasource)\n\tif err != nil {\n\t\tlog.Fatalf(\"Fail to create engine: %v\\n\", err)\n\t}\n\n\tif len(dbc.SQLLogFile) != 0 {\n\t\tdbc.x.ShowSQL(true)\n\t\tf, error := os.Create(logDir + \"/\" + dbc.SQLLogFile)\n\t\tif err != nil {\n\t\t\tlog.Errorln(\"Fail to create log file \", error)\n\t\t}\n\t\tdbc.x.SetLogger(xorm.NewSimpleLogger(f))\n\t}\n\tif dbc.Debug == \"true\" {\n\t\tdbc.x.Logger().SetLevel(core.LOG_DEBUG)\n\t}\n\n\t// Sync tables\n\tif err = dbc.x.Sync(new(InfluxCfg)); err != nil {\n\t\tlog.Fatalf(\"Fail to sync database InfluxCfg: %v\\n\", err)\n\t}\n\tif err = dbc.x.Sync(new(SnmpDeviceCfg)); err != nil {\n\t\tlog.Fatalf(\"Fail to sync database SnmpDeviceCfg: %v\\n\", err)\n\t}\n\tif err = dbc.x.Sync(new(SnmpMetricCfg)); err != nil {\n\t\tlog.Fatalf(\"Fail to sync database SnmpMetricCfg: %v\\n\", err)\n\t}\n\tif err = dbc.x.Sync(new(InfluxMeasurementCfg)); err != nil {\n\t\tlog.Fatalf(\"Fail to sync database InfluxMeasurementCfg: %v\\n\", err)\n\t}\n\tif err = dbc.x.Sync(new(MeasFilterCfg)); err != nil {\n\t\tlog.Fatalf(\"Fail to sync database MeasurementFilterCfg : %v\\n\", err)\n\t}\n\tif err = dbc.x.Sync(new(MeasurementFieldCfg)); err != nil {\n\t\tlog.Fatalf(\"Fail to sync database MeasurementFieldCfg: %v\\n\", err)\n\t}\n\tif err = dbc.x.Sync(new(MGroupsCfg)); err != nil {\n\t\tlog.Fatalf(\"Fail to sync database MGroupCfg: %v\\n\", err)\n\t}\n\tif err = dbc.x.Sync(new(MGroupsMeasurements)); err != nil {\n\t\tlog.Fatalf(\"Fail to sync database MGroupsMeasurements: %v\\n\", err)\n\t}\n\tif err = dbc.x.Sync(new(SnmpDevMGroups)); err != nil {\n\t\tlog.Fatalf(\"Fail to sync database SnmpDevMGroups: %v\\n\", err)\n\t}\n\tif err = dbc.x.Sync(new(SnmpDevFilters)); err != nil {\n\t\tlog.Fatalf(\"Fail to sync database SnmpDevFilters: %v\\n\", err)\n\t}\n\n}", "title": "" }, { "docid": "27ec9bae6e0f39ee27c18ac22ec4bbb7", "score": "0.5280133", "text": "func (storage DBStorage) Init() error {\n\t_, err := storage.connection.Exec(`\n\t\tcreate table IF NOT EXISTS report (\n\t\t\torg_id integer not null,\n\t\t\tcluster varchar not null unique,\n\t\t\treport varchar not null,\n\t\t\treported_at datetime,\n\t\t\tPRIMARY KEY(org_id, cluster)\n\t\t);\n\t`)\n\treturn err\n}", "title": "" }, { "docid": "570b2eb76d511d4e5aa9c3adb324a08a", "score": "0.5273982", "text": "func (n *node) initialize(seed net.Addr) {\n}", "title": "" }, { "docid": "b981179edc00c35b73d62fedd17b108a", "score": "0.52690905", "text": "func InitDB(dbc *DatabaseCfg) {\n\t// Create ORM engine and database\n\tvar err error\n\tvar dbtype string\n\tvar datasource string\n\n\tlog.Debugf(\"Database config: %+v\", dbc)\n\n\tswitch dbc.Type {\n\tcase \"sqlite3\":\n\t\tdbtype = \"sqlite3\"\n\t\tdatasource = appdir + \"/conf/\" + dbc.Name + \".db\"\n\tcase \"mysql\":\n\t\tdbtype = \"mysql\"\n\t\tdatasource = dbc.User + \":\" + dbc.Pass + \"@\" + dbc.Host + \"/\" + dbc.Name + \"?charset=utf8\"\n\tdefault:\n\t\tlog.Errorf(\"unknown db type %s\", dbc.Type)\n\t\treturn\n\t}\n\n\tdbc.x, err = xorm.NewEngine(dbtype, datasource)\n\tif err != nil {\n\t\tlog.Fatalf(\"Fail to create engine: %v\\n\", err)\n\t}\n\n\tif len(dbc.SQLLogFile) != 0 {\n\t\tdbc.x.ShowSQL(true)\n\t\tf, error := os.Create(appdir + \"/log/\" + dbc.SQLLogFile)\n\t\tif err != nil {\n\t\t\tlog.Errorln(\"Fail to create log file \", error)\n\t\t}\n\t\tdbc.x.SetLogger(xorm.NewSimpleLogger(f))\n\t}\n\tif dbc.Debug == \"true\" {\n\t\tdbc.x.Logger().SetLevel(core.LOG_DEBUG)\n\t}\n\n\t// Sync tables\n\tif err = dbc.x.Sync(new(InfluxCfg)); err != nil {\n\t\tlog.Fatalf(\"Fail to sync database InfluxCfg: %v\\n\", err)\n\t}\n\tif err = dbc.x.Sync(new(SnmpDeviceCfg)); err != nil {\n\t\tlog.Fatalf(\"Fail to sync database SnmpDeviceCfg: %v\\n\", err)\n\t}\n\tif err = dbc.x.Sync(new(SnmpMetricCfg)); err != nil {\n\t\tlog.Fatalf(\"Fail to sync database SnmpMetricCfg: %v\\n\", err)\n\t}\n\tif err = dbc.x.Sync(new(InfluxMeasurementCfg)); err != nil {\n\t\tlog.Fatalf(\"Fail to sync database InfluxMeasurementCfg: %v\\n\", err)\n\t}\n\tif err = dbc.x.Sync(new(MeasFilterCfg)); err != nil {\n\t\tlog.Fatalf(\"Fail to sync database MeasurementFilterCfg : %v\\n\", err)\n\t}\n\tif err = dbc.x.Sync(new(MeasurementFieldCfg)); err != nil {\n\t\tlog.Fatalf(\"Fail to sync database MeasurementFieldCfg: %v\\n\", err)\n\t}\n\tif err = dbc.x.Sync(new(MGroupsCfg)); err != nil {\n\t\tlog.Fatalf(\"Fail to sync database MGroupCfg: %v\\n\", err)\n\t}\n\tif err = dbc.x.Sync(new(MGroupsMeasurements)); err != nil {\n\t\tlog.Fatalf(\"Fail to sync database MGroupsMeasurements: %v\\n\", err)\n\t}\n\tif err = dbc.x.Sync(new(SnmpDevMGroups)); err != nil {\n\t\tlog.Fatalf(\"Fail to sync database SnmpDevMGroups: %v\\n\", err)\n\t}\n\tif err = dbc.x.Sync(new(SnmpDevFilters)); err != nil {\n\t\tlog.Fatalf(\"Fail to sync database SnmpDevFilters: %v\\n\", err)\n\t}\n\n}", "title": "" }, { "docid": "18c897024d56bfe57c9c508a52ea54e6", "score": "0.5263614", "text": "func Init(host string, user string, pass string, port int64, database string) {\n\n\tSetupDatabase(host, user, pass, port, database)\n\n\tcolumns := []*model.TableColumns{}\n\n\tquery := fmt.Sprintf(\"SELECT * FROM `COLUMNS` where `TABLE_SCHEMA`='%v' order by `TABLE_NAME`\", database)\n\tfmt.Printf(\"/* COLUMNS: */ %v;\\n\", query)\n\terr := ConnectionInformationSchema.Select(&columns, query)\n\tif err != nil {\n\t\tfmt.Printf(\"Error: %v\", err)\n\t\tos.Exit(1)\n\t}\n\n\tquery = fmt.Sprintf(\"SELECT * FROM `KEY_COLUMN_USAGE` where `TABLE_SCHEMA`='%v' order by `TABLE_NAME`\", database)\n\tfmt.Printf(\"/* KEY_COLUMN_USAGE: */ %v;\\n\", query)\n\terr = ConnectionInformationSchema.Select(&keyColumnUsage, query)\n\tif err != nil {\n\t\tfmt.Printf(\"Error: %v\", err)\n\t\tos.Exit(1)\n\t}\n\n\tfor _, v := range columns {\n\t\tif len(tables.Tables) == 0 || tables.Tables[tables.Current].Name != v.TableName {\n\t\t\ttables.Tables = append(tables.Tables, &model.Table{})\n\t\t\ttables.Current = len(tables.Tables) - 1\n\t\t}\n\t\ttables.Tables[tables.Current].Columns = append(tables.Tables[tables.Current].Columns, v)\n\t\ttables.Tables[tables.Current].Name = v.TableName\n\t}\n\t//spew.Dump(keyColumnUsage)\n}", "title": "" }, { "docid": "51d9e706c45b54efde2c480eef78187a", "score": "0.52542096", "text": "func DatabaseInit() (err error) {\n\tDBInstance, err = sqlx.Open(\"postgres\", cfg.CONFIG.DatabaseResourceStr)\n\tif err != nil {\n\t\tlog.Panic(\"connect to database server error: \", err)\n\t} else {\n\t\tlog.Println(\"connect to the database successfully with: \", cfg.CONFIG.DatabaseResourceStr)\n\t}\n\n\t// DBInstance.DB.SetMaxOpenConns(50)\n\treturn err\n}", "title": "" }, { "docid": "46bf2bf3ac69461a8858d8d434f68279", "score": "0.5253605", "text": "func InitDB() {\n\n\t// Get the database information from the configuration\n\trethinkdbhost, err := config.Config.GetString(\"default\", \"rethinkdb_host\")\n\tif err != nil {\n\t\tlogging.Log(\"Problem with config file! (rethinkdb_host)\")\n\t}\n\n\trethinkdbport, err := config.Config.GetString(\"default\", \"rethinkdb_port\")\n\tif err != nil {\n\t\tlogging.Log(\"Problem with config file! (rethinkdb_port)\")\n\t}\n\n\trethinkdbname, err := config.Config.GetString(\"default\", \"rethinkdb_dbname\")\n\n\tif err != nil {\n\t\tlogging.Log(\"Problem with config file! (rethinkdb_dbname)\")\n\t}\n\n\t// Setup the database if it doesn't exist yet\n\tsetupDatabase(rethinkdbhost, rethinkdbport, rethinkdbname)\n\n\t// Initiate the permanent session\n\tsession, err := r.Connect(r.ConnectOpts{\n\t\tAddress: rethinkdbhost + \":\" + rethinkdbport,\n\t\tDatabase: rethinkdbname,\n\t})\n\n\tSession = session\n}", "title": "" }, { "docid": "02cb015e3c9eb4ba9769f9564f903372", "score": "0.524088", "text": "func Init() {\n\tdsn := \"host=localhost user=postgres password=postgres dbname=postgres port=5432\"\n\tvar err error\n\tConn, err = gorm.Open(postgres.Open(dsn), &gorm.Config{})\n\tif err != nil {\n\t\tfmt.Fprintf(os.Stderr, \"Unable to connection to database: %v\\n\", err)\n\t\tos.Exit(1)\n\t}\n\tinitData()\n}", "title": "" }, { "docid": "03d8831c88832f77edd6ecf2b38c0af4", "score": "0.5238608", "text": "func initializer(id int, n int, clients int, scenario int, rem int) {\n\tvariables.Initialize(id, n, clients, rem)\n\tlogger.InitializeLogger(\"./logs/out/\", \"./logs/error/\")\n\n\tconfig.InitializeScenario(scenario)\n\tif variables.Remote {\n\t\tconfig.InitializeIP()\n\t} else {\n\t\tconfig.InitializeLocal()\n\t}\n\n\tlogger.OutLogger.Print(\n\t\t\"ID:\", variables.ID, \" | N:\", variables.N, \" | F:\", variables.F, \" | Clients:\",\n\t\tvariables.Clients, \" | Scenario:\", config.Scenario, \" | Remote:\", variables.Remote, \"\\n\\n\",\n\t)\n\n\tthreshenc.ReadKeys(\"./keys/\")\n\n\tmessenger.InitializeMessenger()\n\tmessenger.Subscribe()\n\n\tif (config.Scenario == \"IDLE\") && (variables.Byzantine) {\n\t\tlogger.ErrLogger.Println(config.Scenario)\n\t\treturn\n\t}\n\n\tmessenger.TransmitMessages()\n\tmodules.InitiateAtomicBroadcast()\n\ttime.Sleep(2 * time.Second) // Wait 2s before start accepting requests to initiate all maps\n\tmodules.RequestHandler()\n}", "title": "" }, { "docid": "f70e59cf6bb1fbfdfb3c398ed5d17afc", "score": "0.52379966", "text": "func InitDB() {\n\n\tdataFile, err := ioutil.ReadFile(\"data.json\")\n\tif err != nil {\n\t\tlog.Println(\"error reading data file: \", err)\n\t}\n\tif err := json.Unmarshal(dataFile, &tmpDevices); err != nil {\n\t\tlog.Println(\"error parsing data file \", err)\n\t}\n\tfmt.Println(\"db init ok: \", tmpDevices)\n\tfor _, val := range tmpDevices.Items {\n\t\tDevice := new(pb.Device)\n\t\tDevice.Id = int32(val.ID)\n\t\tDevice.Hardware = val.Hardware\n\t\tDevice.Location = val.Location\n\t\tDevice.Name = val.Name\n\t\tDevice.State = int32(val.State)\n\t\tDevice.Type = getDeviceType(val.Type)\n\t\tDevices.Device = append(Devices.Device, Device)\n\t}\n}", "title": "" }, { "docid": "19db4b5ca50ea7317d1589b084d546b7", "score": "0.5236875", "text": "func Init(conf config.Config) error {\n\tif err := OpenDB(conf); err != nil {\n\t\treturn err\n\t}\n\tif err := MigrateDB(); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2d51d8d45e6661dbe400715f3a46cea9", "score": "0.5230211", "text": "func (node *esxHwNode) Init(in *iota.Node) (*iota.Node, error) {\n\n\tnode.init(in)\n\tnode.iotaNode.name = in.GetName()\n\n\tnode.hostIP = in.GetEsxConfig().GetIpAddress()\n\tnode.hostUsername = in.GetEsxConfig().GetUsername()\n\tnode.hostPassword = in.GetEsxConfig().GetPassword()\n\tnode.imagesMap = make(map[string]string)\n\n\terr := node.initHostConnect()\n\tif err != nil {\n\t\treturn &iota.Node{NodeStatus: &iota.IotaAPIResponse{ApiStatus: iota.APIResponseType_API_SERVER_ERROR, ErrorMsg: err.Error()}}, err\n\t}\n\n\tif err = node.addNodeEntities(in); err != nil {\n\t\tmsg := fmt.Sprintf(\"Adding node entities failed : %s\", err.Error())\n\t\tnode.logger.Error(msg)\n\t\treturn &iota.Node{NodeStatus: &iota.IotaAPIResponse{ApiStatus: iota.APIResponseType_API_SERVER_ERROR, ErrorMsg: msg}}, err\n\t}\n\n\tsslThumbprint, err := node.getSSLThumbprint()\n\tif err != nil {\n\t\treturn &iota.Node{NodeStatus: &iota.IotaAPIResponse{ApiStatus: iota.APIResponseType_API_SERVER_ERROR, ErrorMsg: err.Error()}}, err\n\t}\n\n\tin.EsxConfig.SslThumbprint = sslThumbprint\n\tin.NodeStatus = apiSuccess\n\n\treturn in, nil\n}", "title": "" }, { "docid": "fb5eb9ab081be929e04d05b748510c8e", "score": "0.5227077", "text": "func (d *dbCreator) Init() {\n\td.hosts = strings.Split(hosts, \",\")\n\td.connection = make([]*siridb.Connection, 0)\n\tfor _, hostport := range d.hosts {\n\t\tx := strings.Split(hostport, \":\")\n\t\thost := x[0]\n\t\tport, err := strconv.ParseUint(x[1], 10, 16)\n\t\tif err != nil {\n\t\t\tfatal(err)\n\t\t}\n\t\td.connection = append(d.connection, siridb.NewConnection(host, uint16(port)))\n\t}\n}", "title": "" }, { "docid": "49c000a70dff1e3e588057438b96a27c", "score": "0.52200747", "text": "func InitDB() {\n\tdb.Connect(Config.Db, Log)\n}", "title": "" }, { "docid": "5c88ab0151b7bc406760781a431ac3f0", "score": "0.5218313", "text": "func InitDatabase(conn *pgx.Conn) *Database {\n\treturn &Database{conn}\n}", "title": "" }, { "docid": "498b1e09025a57032ad0cdeac158e441", "score": "0.5214976", "text": "func initDB() error {\n\n\t// Creating KEYSPACE (if not exists)\n\terr := Sess.Query(stmts.CREATE_KSPACE).Exec()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Creating Users (if not exists)\n\terr = Sess.Query(stmts.CREATE_USERS).Exec()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Creating Sessions (if not exists)\n\terr = Sess.Query(stmts.CREATE_SESSIONS).Exec()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Creating Posts (if not exists)\n\terr = Sess.Query(stmts.CREATE_POSTS).Exec()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Adding administrator\n\treturn Sess.Query(stmts.CREATE_ADMIN).Exec()\n}", "title": "" }, { "docid": "c6442f0631fc9f7691656e8c24e72261", "score": "0.5207694", "text": "func InitDatabase(database Database) {\n\tdb = database\n}", "title": "" }, { "docid": "0cdc71964efb5e28b2550f050edbe301", "score": "0.5204345", "text": "func Init() Env {\n\t// Change the dbURI based on the local database that you are running\n\tconst (\n\t\tdbURI string = \"neo4j://127.0.0.1:7687\"\n\t\tdbUsername string = \"neo4j\"\n\t\tdbPassword string = \"test\"\n\t)\n\n\tconn, err := db.NewConn(dbURI, dbUsername, dbPassword)\n\tif err != nil {\n\t\tlog.Fatal(\"Error connecting to database:\", err)\n\t}\n\n\tmodels := models.Init(conn)\n\treturn Env{\n\t\tmodels: *models,\n\t}\n}", "title": "" }, { "docid": "81e07680aabe4886ad8136da5e6f2764", "score": "0.5194178", "text": "func Init(c config.Config) (*Database, error) {\n\tconn, err := sqlx.Open(c.DB.Driver, c.DB.DSN)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\td := &Database{Conn: conn}\n\tif err := d.Conn.Ping(); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := d.create(); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := d.prepare(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn d, nil\n}", "title": "" }, { "docid": "bef20377223c4dd18eadf71c17867b43", "score": "0.51913977", "text": "func initDb() *db {\n\tlog.Println(\"Connecting to database\")\n\n\tsession, err := r.Connect(r.ConnectOpts{\n\t\tAddress: \"localhost:28015\",\n\t\tDatabase: \"angles\",\n\t})\n\n\tif err != nil {\n\t\tlog.Fatalln(err)\n\t}\n\n\tsession.Use(\"angles\")\n\n\treturn &db{\n\t\tsession: session,\n\t}\n}", "title": "" }, { "docid": "52b8e47c3207c2387344384ae15e6274", "score": "0.519001", "text": "func init() {\n\terr := util.LoadConfig(\"\")\n\tdb.InitDB()\n\tif err != nil {\n\t\tlog.Fatalf(\"Unable to load config: %v\", err)\n\t}\n}", "title": "" }, { "docid": "70f5f65ae3423f9d831dbc2835fb5f8b", "score": "0.5185076", "text": "func (s *IoTDB) Init() error {\n\tif s.Timeout < 0 {\n\t\treturn errors.New(\"negative timeout\")\n\t}\n\tif !choice.Contains(s.ConvertUint64To, []string{\"int64\", \"int64_clip\", \"text\"}) {\n\t\treturn fmt.Errorf(\"unknown 'uint64_conversion' method %q\", s.ConvertUint64To)\n\t}\n\tif !choice.Contains(s.TimeStampUnit, []string{\"second\", \"millisecond\", \"microsecond\", \"nanosecond\"}) {\n\t\treturn fmt.Errorf(\"unknown 'timestamp_precision' method %q\", s.TimeStampUnit)\n\t}\n\tif !choice.Contains(s.TreatTagsAs, []string{\"fields\", \"device_id\"}) {\n\t\treturn fmt.Errorf(\"unknown 'convert_tags_to' method %q\", s.TreatTagsAs)\n\t}\n\n\tif s.User.Empty() {\n\t\ts.User.Destroy()\n\t\ts.User = config.NewSecret([]byte(\"root\"))\n\t}\n\tif s.Password.Empty() {\n\t\ts.Password.Destroy()\n\t\ts.Password = config.NewSecret([]byte(\"root\"))\n\t}\n\n\ts.Log.Info(\"Initialization completed.\")\n\treturn nil\n}", "title": "" }, { "docid": "8277a681221f0e6d42dbe238d112e4fc", "score": "0.5183874", "text": "func init() {\n\tinitFn := func(config *KVConfig) (KVStore, error) {\n\t\tif config.Debug {\n\t\t\tfmt.Println(\"Initializing leveldb backend store\")\n\t\t}\n\n\t\treturn NewLVDB(config)\n\t}\n\n\terr := SetDefault(KVName, initFn)\n\n\tif err != nil {\n\t\tfmt.Println(\"Failed to initialize leveldb backend\")\n\t}\n}", "title": "" }, { "docid": "8f0e4d18894fbd3669006fdb3be9a46b", "score": "0.5169518", "text": "func (f *Flow) Init(key string, now int64, packet *gopacket.Packet, length int64, nodeTID string, parentUUID string, L2ID int64, L3ID int64) {\n\tf.Start = now\n\tf.Last = now\n\n\tf.newLinkLayer(packet, length)\n\n\tf.NodeTID = nodeTID\n\tf.ParentUUID = parentUUID\n\n\tf.LayersPath = layerPathFromGoPacket(packet)\n\tappLayers := strings.Split(f.LayersPath, \"/\")\n\tf.Application = appLayers[len(appLayers)-1]\n\n\t// no network layer then no transport layer\n\tif err := f.newNetworkLayer(packet); err == nil {\n\t\tf.newTransportLayer(packet)\n\t}\n\n\t// need to have as most variable filled as possible to get correct UUID\n\tf.UpdateUUID(key, L2ID, L3ID)\n}", "title": "" }, { "docid": "ed8aa08dbbb2a3f2bb2fbbd7c4e6e113", "score": "0.5169036", "text": "func (m *MySQL) Init(metadata state.Metadata) error {\n\tm.logger.Debug(\"Initializing MySql state store\")\n\n\tval, ok := metadata.Properties[tableNameKey]\n\n\tif ok && val != \"\" {\n\t\tm.tableName = val\n\t} else {\n\t\t// Default to the constant\n\t\tm.tableName = defaultTableName\n\t}\n\n\tval, ok = metadata.Properties[schemaNameKey]\n\n\tif ok && val != \"\" {\n\t\tm.schemaName = val\n\t} else {\n\t\t// Default to the constant\n\t\tm.schemaName = defaultSchemaName\n\t}\n\n\tm.connectionString, ok = metadata.Properties[connectionStringKey]\n\n\tif !ok || m.connectionString == \"\" {\n\t\tm.logger.Error(\"Missing MySql connection string\")\n\n\t\treturn fmt.Errorf(errMissingConnectionString)\n\t}\n\n\tval, ok = metadata.Properties[pemPathKey]\n\n\tif ok && val != \"\" {\n\t\terr := m.factory.RegisterTLSConfig(val)\n\t\tif err != nil {\n\t\t\tm.logger.Error(err)\n\n\t\t\treturn err\n\t\t}\n\t}\n\n\tdb, err := m.factory.Open(m.connectionString)\n\n\t// will be nil if everything is good or an err that needs to be returned\n\treturn m.finishInit(db, err)\n}", "title": "" }, { "docid": "5b42d34e722ffe38a7a1314246863cfb", "score": "0.5167178", "text": "func (db *Database) Init() error {\n\tif err := db.establishConnection(); err != nil {\n\t\treturn err\n\t}\n\n\tif err := db.prepareStatements(); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "7fd54f6f6513696ec464e47624552700", "score": "0.5164145", "text": "func Init(db *Database) {\n\tswitch db.Driver {\n\tcase \"etcd\":\n\t\t// C = etcd.Init(db.Driver, db.Crendential)\n\t\tfmt.Printf(\"etcd is not implemented right now!\")\n\t\treturn\n\tcase \"mongodb\":\n\t\t//DbAdapter = mongo.Init(strings.Split(db.Endpoint, \",\"))\n\t\tDbAdapter = mongo.Init(db.Endpoint)\n\t\treturn\n\tdefault:\n\t\tfmt.Printf(\"Can't find database driver %s!\\n\", db.Driver)\n\t}\n}", "title": "" }, { "docid": "cd149aab2574fc5caacbc2460750d6ed", "score": "0.516132", "text": "func Init(config *DB) error {\n\tif config == nil {\n\t\treturn errors.New(\"empty config\")\n\t}\n\tdbConfig = config\n\n\t_, err := mgo.Dial(dbConfig.Address)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fe368864e00fd2cedfe84a8e6c4117b2", "score": "0.5160173", "text": "func (n *Handler) Init(c *config.AlertConfig) error {\n\tc.Logger.Info(\"node handler initialized\")\n\tn.conf = c\n\treturn nil\n}", "title": "" }, { "docid": "936afd69fd9550fa5cf72a2f0358815d", "score": "0.5160172", "text": "func Init(config *Config) {\n\tinitLogger(config)\n\tinitDb(config)\n}", "title": "" }, { "docid": "ed4f4b3b42db1d49e9928fb3ea02de74", "score": "0.51530504", "text": "func (thirdParty *esxThirdPartyHwNode) Init(in *iota.Node) (*iota.Node, error) {\n\tin, err := thirdParty.esxHwNode.Init(in)\n\tif err != nil {\n\t\treturn in, err\n\t}\n\n\tif !in.Reload {\n\t\terr = thirdParty.createNaplesDataSwitch(0, in.GetThirdPartyNicConfig().GetNicType(), \"\")\n\t\tif err != nil {\n\t\t\tmsg := \"failed to create naples data switch\"\n\t\t\tthirdParty.logger.Error(msg)\n\t\t\t//return &iota.Node{NodeStatus: &iota.IotaAPIResponse{ApiStatus: iota.APIResponseType_API_SERVER_ERROR, ErrorMsg: msg}}, err\n\t\t}\n\n\t}\n\n\tif err = thirdParty.setHostIntfs(in); err != nil {\n\t\treturn &iota.Node{NodeStatus: &iota.IotaAPIResponse{ApiStatus: iota.APIResponseType_API_SERVER_ERROR, ErrorMsg: err.Error()}}, err\n\n\t}\n\treturn in, nil\n}", "title": "" }, { "docid": "47e52dc90397ebab9c602b40436fefba", "score": "0.514851", "text": "func (s *Server) Initialize(Dbdriver, DbUser, DbPassword, DbPort, DbHost, DbName string) {\n\tvar err error\n\n\tif Dbdriver == \"mysql\" {\n\t\tDBURL := fmt.Sprintf(\"%s:%s@tcp(%s:%s)/%s?charset=utf8&parseTime=True&loc=Local\", DbUser, DbPassword, DbHost, DbPort, DbName)\n\t\ts.DB, err = gorm.Open(Dbdriver, DBURL)\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"Cannot connect to %s database\", Dbdriver)\n\t\t\tlog.Fatal(\"This is the error:\", err)\n\t\t} else {\n\t\t\tfmt.Printf(\"We are connected to the %s database\", Dbdriver)\n\t\t}\n\t} else if Dbdriver == \"postgres\" {\n\t\tDBURL := fmt.Sprintf(\"host=%s port=%s user=%s dbname=%s sslmode=disable password=%s\", DbHost, DbPort, DbUser, DbName, DbPassword)\n\t\ts.DB, err = gorm.Open(Dbdriver, DBURL)\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"Cannot connect to %s database\", Dbdriver)\n\t\t\tlog.Fatal(\"This is the error connecting to postgres:\", err)\n\t\t} else {\n\t\t\tfmt.Printf(\"We are connected to the %s database\", Dbdriver)\n\t\t}\n\t} else {\n\t\tfmt.Println(\"Unknown Driver\")\n\t}\n\n\ts.DB.Debug().AutoMigrate(\n\t\t&models.Task{},\n\t\t&models.User{},\n\t)\n\n\ts.Router = gin.Default()\n\ts.Router.Use(middlewares.CORSMiddleware())\n\ts.initializeRoutes()\n}", "title": "" }, { "docid": "41a450c632ad53591d201c7868c51c90", "score": "0.5144033", "text": "func Init() {\n\tredisConnection()\n\tcouchBaseConnection()\n\tdgraphConnection()\n\tminIOConnection()\n\tscylladbConnection()\n}", "title": "" }, { "docid": "e79a94581188d0da3de1edf1bb10044a", "score": "0.5144032", "text": "func init() {\n\tconf := configuration.GetConfiguration()\n\tif db == nil {\n\t\tvar err error\n\t\tcnx := \"host=\" + conf.Pg.Host\n\t\tcnx = cnx + \" port=\" + strconv.FormatInt(conf.Pg.Port, 10)\n\t\tcnx = cnx + \" user=\" + conf.Pg.User\n\t\tcnx = cnx + \" dbname=\" + conf.Pg.Schema\n\t\tcnx = cnx + \" sslmode=disable\"\n\t\tcnx = cnx + \" password=\" + conf.Pg.Password\n\n\t\tdb, err = gorm.Open(\"postgres\", cnx)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\t// configuration de la base\n\t\t// supprime le fait que gorm cherche une table qui correspond au nom de la struc avec un s au bout\n\t\t// db.SingularTable(true)\n\t\t// est ce que ça marche en général ça ?\n\t\t// db.Set(\"gorm:save_associations\", false)\n\t\tdb.LogMode(true)\n\t}\n}", "title": "" }, { "docid": "53d7f5601b7f3af6a117d68364552ee5", "score": "0.513945", "text": "func Init() error {\n\tlog.Println(\"Initializing DB\")\n\n\t_, err := os.Stat(dbFlatFile)\n\tif os.IsNotExist(err) {\n\t\tlog.Println(\"creating sqlite db flat file\")\n\t\t_, err := os.Create(dbFlatFile)\n\t\tif err != nil {\n\t\t\tlog.Println(err)\n\t\t\treturn err\n\t\t}\n\t}\n\n\tdb, err = sql.Open(\"sqlite3\", dbFlatFile)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn err\n\t}\n\n\tlog.Println(\"creating reminder table\")\n\terr = createReminderTable()\n\tif err != nil {\n\t\tlog.Println(err)\n\t}\n\n\treturn err\n\n}", "title": "" }, { "docid": "97e3f58fe379a836600e33b69ed0e361", "score": "0.51382786", "text": "func Initialize() {\n\tlogger = log.New(os.Stdout, \"[debug] \", log.Lshortfile)\n\n\t// Enable/Disable logger\n\tif !debug {\n\t\tlogger.SetOutput(ioutil.Discard)\n\t}\n\tlogger.Println(\"Initializing: Logging Enabled\")\n\n\tlogger.Println(\"Parsing Command-Line Arguments:\")\n\tghash, numZeroes, nodesFilePath, nodeID, nodesIpPort, clientsIpPort = ParseArguments()\n\n\t// Parses Node File into a list of strings\n\tnodes = ParseNodeFile(nodesFilePath)\n\n\t// Initialize global variables\n\tglobalKeyValue = make(map[kvlib.Key]kvlib.Value)\n\ttxKeyValue = make(map[int]map[kvlib.Key]kvlib.Value)\n\tnextTXID = 1\n\tlastCmds = make(map[int]string)\n\tabortedTX = make(map[int]bool)\n\tchannels = make(map[int]chan int)\n\ttxHashes = make(map[int]string)\n\n\tclientTimers = make(map[int]*time.Timer)\n\ttimeout = time.Duration(4 * len(nodes))\n\n\ttxAccessKeys = make(map[int][]kvlib.Key)\n\ttxAccessDepth = make(map[int]int)\n\n\toutsideTxnBlocks = make(map[int]int)\n\n\t// Initialize the blockchain and internal variables\n\tbChain.Init(ghash)\n}", "title": "" }, { "docid": "8b7e725d9ae66b47141847827b58c755", "score": "0.5136196", "text": "func init() {\r\n\r\n\tfmt.Println(\"db connected!!\")\r\n}", "title": "" } ]
d114e703d78b1a3ccce49074e6347fc2
chooseModuleWithSummary is an utility function that prompts a list of available modules with a short summary
[ { "docid": "7ead20ee249213ee9e71e9a92690b4d6", "score": "0.8390728", "text": "func chooseModuleWithSummary() (module.Module, error) {\n\t// TODO: This function can be merged into chooseModule()\n\tmodules := module.All()\n\tdict := make(map[string]module.Module)\n\tsummaries := make([]string, 0, len(modules))\n\tfor _, module := range modules {\n\t\tdict[module.Summary()] = module\n\t\tsummaries = append(summaries, module.Summary())\n\t}\n\tchoice, err := ui.Select(\"Choose module\", summaries, \"\", false)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn dict[choice], nil\n}", "title": "" } ]
[ { "docid": "0915f04ba35d07021925f4e91b32af13", "score": "0.5970127", "text": "func Describe(names ...string) {\n\tmodules := findModules(names, nil)\n\n\tif len(modules) == 0 {\n\t\tfmt.Printf(\"No matching modules found.\\n\")\n\t\treturn\n\t}\n\n\tfor _, m := range modules {\n\t\tm.showHelp()\n\t\tfmt.Printf(\"\\n\\n\")\n\t}\n}", "title": "" }, { "docid": "a6a93fe9e3ae9b1ab33609999eb17506", "score": "0.56397444", "text": "func DoModulePrompt(module string, items []string) (result string, err error) {\n\n\tprompt := promptui.Select{\n\t\tLabel: module + \" actions:\",\n\t\tItems: items,\n\t}\n\t_, result, err = prompt.Run()\n\tresult = strings.ToLower(result)\n\n\t//if core.IsError(err) {\n\t//\tlog.Debug(\"%s prompt menu failed: %v.\", module, err)\n\t//}\n\n\treturn\n}", "title": "" }, { "docid": "45fdecc34481dacac59eb3c00d35ed82", "score": "0.5565379", "text": "func chooseModule() (module.Module, error) {\n\tmodules := module.All()\n\tdict := make(map[string]module.Module)\n\tnames := make([]string, 0, len(modules))\n\tfor _, module := range modules {\n\t\tdict[module.Name()] = module\n\t\tnames = append(names, module.Name())\n\t}\n\tchoice, err := ui.Select(\"Choose module\", names, \"\", false)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn dict[choice], nil\n}", "title": "" }, { "docid": "1d3f6c7db294184e5bca30ea32381270", "score": "0.554354", "text": "func (i *GoMod) Summary() string {\n\treturn \"Go module info\"\n}", "title": "" }, { "docid": "782ed2e04b12cb133e4b608b025385ed", "score": "0.54728717", "text": "func Summary(summary string) (old string) {\n\treturn CommandLine.Summary(summary)\n}", "title": "" }, { "docid": "83e51f6a5c8ed9360598c6db21fbddc2", "score": "0.5313284", "text": "func (o *OpenAI) Summary(text string) (response string, err error) {\n\treturn o.chatGPTRequest(text, \"\", \"Make a short summary, up to 50 words, followed by a list of bullet points. Each bullet point is limited to 50 words, up to 7 in total. All in markdown format and translated to russian:\\n\")\n}", "title": "" }, { "docid": "8da67a7d33c250e8012fc41cef77b7e0", "score": "0.5251591", "text": "func modulesUsage() {\n\tfmt.Fprintf(os.Stderr, `Service is the modules service interface.\nUsage:\n %s [globalflags] modules COMMAND [flags]\n\nCOMMAND:\n meta: Meta implements meta.\n\nAdditional help:\n %s modules COMMAND --help\n`, os.Args[0], os.Args[0])\n}", "title": "" }, { "docid": "117525c4e9e4ced59b01f97a3e80dff6", "score": "0.50609934", "text": "func (o Options) Summary(vendorDecoder OptionDecoder) string {\n\treturn o.ToString(OptionHumanizer{\n\t\tValueHumanizer: parserFor(vendorDecoder),\n\t\tCodeHumanizer: func(c uint8) OptionCode {\n\t\t\treturn optionCode(c)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "c1915c5b3f3cd3737b2d36a8a65f38a8", "score": "0.5038334", "text": "func (m *myModule) Summary() module.SummaryStruct {\n\tcounts := m.Counts()\n\treturn module.SummaryStruct{\n\t\tCalled: counts.CalledCount,\n\t\tAccepted: counts.AcceptedCount,\n\t\tCompleted: counts.CompletedCount,\n\t\tHandling: counts.HandlingNumber,\n\t\tExtra: nil,\n\t}\n}", "title": "" }, { "docid": "33d21a398f7053a948ede8971ea9b672", "score": "0.5018132", "text": "func (f *FlagSet) Summary(summary string) (old string) {\n\told, f.summary = f.summary, f.ReplaceTags(summary)\n\treturn\n}", "title": "" }, { "docid": "498dc709866b10870bce8af65ddcd318", "score": "0.4962047", "text": "func goModSummary(m module.Version) (*modFileSummary, error) {\n\tif m.Version == \"\" && !inWorkspaceMode() && MainModules.Contains(m.Path) {\n\t\tpanic(\"internal error: goModSummary called on a main module\")\n\t}\n\n\tif cfg.BuildMod == \"vendor\" {\n\t\tsummary := &modFileSummary{\n\t\t\tmodule: module.Version{Path: m.Path},\n\t\t}\n\t\tif vendorVersion[m.Path] != m.Version {\n\t\t\t// This module is not vendored, so packages cannot be loaded from it and\n\t\t\t// it cannot be relevant to the build.\n\t\t\treturn summary, nil\n\t\t}\n\n\t\t// For every module other than the target,\n\t\t// return the full list of modules from modules.txt.\n\t\treadVendorList(MainModules.mustGetSingleMainModule())\n\n\t\t// We don't know what versions the vendored module actually relies on,\n\t\t// so assume that it requires everything.\n\t\tsummary.require = vendorList\n\t\treturn summary, nil\n\t}\n\n\tactual := resolveReplacement(m)\n\tif HasModRoot() && cfg.BuildMod == \"readonly\" && !inWorkspaceMode() && actual.Version != \"\" {\n\t\tkey := module.Version{Path: actual.Path, Version: actual.Version + \"/go.mod\"}\n\t\tif !modfetch.HaveSum(key) {\n\t\t\tsuggestion := fmt.Sprintf(\"; to add it:\\n\\tgo mod download %s\", m.Path)\n\t\t\treturn nil, module.VersionError(actual, &sumMissingError{suggestion: suggestion})\n\t\t}\n\t}\n\tsummary, err := rawGoModSummary(actual)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif actual.Version == \"\" {\n\t\t// The actual module is a filesystem-local replacement, for which we have\n\t\t// unfortunately not enforced any sort of invariants about module lines or\n\t\t// matching module paths. Anything goes.\n\t\t//\n\t\t// TODO(bcmills): Remove this special-case, update tests, and add a\n\t\t// release note.\n\t} else {\n\t\tif summary.module.Path == \"\" {\n\t\t\treturn nil, module.VersionError(actual, errors.New(\"parsing go.mod: missing module line\"))\n\t\t}\n\n\t\t// In theory we should only allow mpath to be unequal to m.Path here if the\n\t\t// version that we fetched lacks an explicit go.mod file: if the go.mod file\n\t\t// is explicit, then it should match exactly (to ensure that imports of other\n\t\t// packages within the module are interpreted correctly). Unfortunately, we\n\t\t// can't determine that information from the module proxy protocol: we'll have\n\t\t// to leave that validation for when we load actual packages from within the\n\t\t// module.\n\t\tif mpath := summary.module.Path; mpath != m.Path && mpath != actual.Path {\n\t\t\treturn nil, module.VersionError(actual, fmt.Errorf(`parsing go.mod:\n\tmodule declares its path as: %s\n\t but was required as: %s`, mpath, m.Path))\n\t\t}\n\t}\n\n\tfor _, mainModule := range MainModules.Versions() {\n\t\tif index := MainModules.Index(mainModule); index != nil && len(index.exclude) > 0 {\n\t\t\t// Drop any requirements on excluded versions.\n\t\t\t// Don't modify the cached summary though, since we might need the raw\n\t\t\t// summary separately.\n\t\t\thaveExcludedReqs := false\n\t\t\tfor _, r := range summary.require {\n\t\t\t\tif index.exclude[r] {\n\t\t\t\t\thaveExcludedReqs = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif haveExcludedReqs {\n\t\t\t\ts := new(modFileSummary)\n\t\t\t\t*s = *summary\n\t\t\t\ts.require = make([]module.Version, 0, len(summary.require))\n\t\t\t\tfor _, r := range summary.require {\n\t\t\t\t\tif !index.exclude[r] {\n\t\t\t\t\t\ts.require = append(s.require, r)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tsummary = s\n\t\t\t}\n\t\t}\n\t}\n\treturn summary, nil\n}", "title": "" }, { "docid": "d2aa657f2d528a79353b7969eeb16db3", "score": "0.49156317", "text": "func Summary(app *kingpin.Application, cfg *config) {\n\tc := app.Command(\"summary\", \"prints a summary of existing tags for a given search query\")\n\tc.Action(func(_ *kingpin.ParseContext) error {\n\t\tset, err := search.Summary(cfg)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfor name, _ := range set {\n\t\t\tc := set.Get(name)\n\t\t\tif len(c) > 0 {\n\t\t\t\tcfg.Log().Infof(\"%s (%s)\", name, strings.Join(c, \", \"))\n\t\t\t} else {\n\t\t\t\tcfg.Log().Info(name)\n\t\t\t}\n\t\t}\n\n\t\treturn nil\n\t})\n\tc.Arg(\"query\", \"the search query\").\n\t\tRequired().\n\t\tStringVar(&cfg.query)\n\tc.Flag(\"path\", \"the root dir to start the search with\").\n\t\tShort('C').\n\t\tDefault(\".\").\n\t\tExistingDirVar(&cfg.root)\n}", "title": "" }, { "docid": "a166a99d305f7f13f1e0dd89fc685abd", "score": "0.48499835", "text": "func Summary() string {\n\treturn fmt.Sprintf(\"%v, %v\", CodeSummary(), BuildSummary())\n}", "title": "" }, { "docid": "b5f3520d8cc873e80212fc7e19d77ff8", "score": "0.48303166", "text": "func (fm *fakeModule) Summary() SummaryStruct {\n\treturn SummaryStruct{}\n}", "title": "" }, { "docid": "b0ee8df032d3113224a1f71395cfa3bc", "score": "0.48002636", "text": "func LoadSummaryFromDescription(m *model.Metadata, summaryFile string) error {\n\t// request summary\n\tsummary, err := smmry.GetSummaryFromDescription(m.Description)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// set summary\n\tm.Summary = summary\n\t// cache summary file\n\twriteSummaryFile(summaryFile, m.Summary)\n\treturn nil\n}", "title": "" }, { "docid": "781200827e685365acefd76135b2d28c", "score": "0.4775718", "text": "func (sg *SchnorrGroup) Summary() {\n\tfmt.Println(\"p = \", sg.p.Text(10))\n\tfmt.Println(\"q = \", sg.q.Text(10))\n}", "title": "" }, { "docid": "673f3cd790d3c4bed3eba5addb0301f2", "score": "0.47707585", "text": "func briefHelpText() string {\n\tbuf := &bytes.Buffer{}\n\tbuf.WriteString(\"Available commands: -- \\\":help all\\\" for detailed help, \\\":help usage\\\" for usage\\n\")\n\tfor i, k := range allKeywords {\n\t\tfmt.Fprintf(buf, \" :%s <%s>\", k, keywordInfoMap[k].argName)\n\t\tif i != len(allKeywords)-1 {\n\t\t\tbuf.WriteString(\"\\n\")\n\t\t}\n\t}\n\treturn buf.String()\n}", "title": "" }, { "docid": "5ce5c25fc441915ceb7513d2e3f960b7", "score": "0.47293514", "text": "func (p *ticketVotePlugin) cmdSummary(token []byte) (string, error) {\n\t// Get best block. This cmd does not write any data so we do not\n\t// have to use the safe best block.\n\tbb, err := p.bestBlockUnsafe()\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"bestBlockUnsafe: %v\", err)\n\t}\n\n\t// Get summary\n\tsr, err := p.summary(token, bb)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"summary: %v\", err)\n\t}\n\n\t// Prepare reply\n\treply, err := json.Marshal(sr)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn string(reply), nil\n}", "title": "" }, { "docid": "abbf6491d9e7c424982a9da4de2b4eb4", "score": "0.47248292", "text": "func (b *LimitedSupportReasonBuilder) Summary(value string) *LimitedSupportReasonBuilder {\n\tb.summary = value\n\tb.bitmap_ |= 64\n\treturn b\n}", "title": "" }, { "docid": "8dd69863859653fd511b7cd0b1a3075b", "score": "0.4694823", "text": "func (c *helpCmd) summaryLine(usage string) string {\n\tusage = strings.TrimSpace(usage)\n\ts := bufio.NewScanner(bytes.NewBufferString(usage))\n\tif s.Scan() {\n\t\tif len(s.Text()) > 1 {\n\t\t\treturn s.Text()\n\t\t}\n\t}\n\treturn \"Missing summary.\"\n}", "title": "" }, { "docid": "73a1fc2594c614d05d10c5e50ec70f34", "score": "0.46944612", "text": "func ShowDep() string {\n\treturn \"testmodule v2.0.1, fasthttp v1.21.0\"\n}", "title": "" }, { "docid": "0b65f85fe9f887fdd4f9d09ff0b0ba54", "score": "0.46833345", "text": "func (h *Handlers) GetSummary(w http.ResponseWriter, r *http.Request) {\n\tinput := &hub.GetPackageInput{\n\t\tRepositoryName: chi.URLParam(r, \"repoName\"),\n\t\tPackageName: chi.URLParam(r, \"packageName\"),\n\t}\n\tdataJSON, err := h.pkgManager.GetSummaryJSON(r.Context(), input)\n\tif err != nil {\n\t\th.logger.Error().Err(err).Interface(\"input\", input).Str(\"method\", \"GetSummary\").Send()\n\t\thelpers.RenderErrorJSON(w, err)\n\t\treturn\n\t}\n\thelpers.RenderJSON(w, dataJSON, helpers.DefaultAPICacheMaxAge, http.StatusOK)\n}", "title": "" }, { "docid": "5ce5339ccd4026309b89d9a01fdaf80c", "score": "0.4643988", "text": "func (c *ListCommand) printSummary(out io.Writer, rs []*fastly.Token) {\n\tt := text.NewTable(out)\n\tt.AddHeader(\"NAME\", \"TOKEN ID\", \"USER ID\", \"SCOPE\", \"SERVICES\")\n\tfor _, r := range rs {\n\t\tt.AddLine(r.Name, r.ID, r.UserID, r.Scope, strings.Join(r.Services, \", \"))\n\t}\n\tt.Print()\n}", "title": "" }, { "docid": "8271c4d787c3603397f1e38971e3e5c7", "score": "0.46266448", "text": "func (r Result) Summary() string {\n\tif r.SkipCount+r.UnsupportedCount == 0 {\n\t\treturn \"\"\n\t}\n\tvar plural, reason string\n\tif r.SkipCount+r.UnsupportedCount > 1 {\n\t\tplural = \"s\"\n\t}\n\tif r.SkipCount == 0 {\n\t\treason = \"unsupported feature\"\n\t} else if r.UnsupportedCount == 0 {\n\t\treason = \"problem\"\n\t} else {\n\t\treason = \"problems or unsupported feature\"\n\t}\n\treturn fmt.Sprintf(\"Skipped %d operation%s due to %s%s\", r.SkipCount+r.UnsupportedCount, plural, reason, plural)\n}", "title": "" }, { "docid": "b7acf64a449693d77611275e9f79124e", "score": "0.46242845", "text": "func BySummary(opts ...sql.OrderTermOption) OrderOption {\n\treturn sql.OrderByField(FieldSummary, opts...).ToFunc()\n}", "title": "" }, { "docid": "73d628566a635527d6b10825ab066c44", "score": "0.46237803", "text": "func Summary(summary string) func(*openapi.OperationInfo) {\n\treturn func(o *openapi.OperationInfo) {\n\t\to.Summary = summary\n\t}\n}", "title": "" }, { "docid": "efc0093e304d15e2b47c38c5360c16fd", "score": "0.46216476", "text": "func displayUsage() {\n\ttype Usage struct {\n\t\tCreate, Gen, Pop, List string\n\t}\n\n\tvar u = []Usage{{CreateUsage, GenUsage, PopUsage, ListUsage}}\n\n\tt := template.Must(template.New(\"bublUsage\").Parse(bublUsage))\n\n\tfor _, usage := range u {\n\t\tif err := t.Execute(os.Stdout, usage); err != nil {\n\t\t\tlog.Fatalln(\"ERROR: Failed creating template!\", err)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a3408ccbdc85f7fe90b4cae4428b479e", "score": "0.45964906", "text": "func LoadSummary(m *model.Metadata, summaryFile string, useCache bool) error {\n\t// use cache if available\n\tif useCache {\n\t\tb, err := ioutil.ReadFile(summaryFile)\n\t\tif err == nil {\n\t\t\tm.Summary = string(b)\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn LoadSummaryFromDescription(m, summaryFile)\n}", "title": "" }, { "docid": "a4dd17be23e5266f065b6db3c155f1ea", "score": "0.45817304", "text": "func chooseItem(module module.Module, withAdd bool) (item.Item, error) {\n\titems, err := module.List()\n\tif err != nil {\n\t\treturn item.Item{}, err\n\t}\n\t// Create a map of items\n\titemsDict := make(map[string]item.Item)\n\tnames := []string{}\n\tfor _, item := range items {\n\t\titemsDict[item.Name()] = item\n\t\tnames = append(names, item.Name())\n\t}\n\tif withAdd {\n\t\tnames = append([]string{\"+ Create a new one\"}, names...)\n\t}\n\t// Prompt list of items\n\tresult, err := ui.Select(fmt.Sprintf(\"Choose a %s or create one\",\n\t\tmodule.Singular()), names, \"\", true)\n\tif err != nil {\n\t\treturn item.Item{}, err\n\t}\n\titem := itemsDict[result]\n\treturn item, nil\n}", "title": "" }, { "docid": "49edb8caa830d735e0fa44d6e6db2050", "score": "0.45703858", "text": "func (module *Module) Description() string {\n\treturn \"Fetch a telnet banner\"\n}", "title": "" }, { "docid": "f0804b0fc246ab3d49137972e0c19299", "score": "0.45259127", "text": "func Summary(markup ...vecty.MarkupOrChild) *vecty.HTML {\n\treturn vecty.Tag(\"summary\", markup...)\n}", "title": "" }, { "docid": "9d5af7ed7bcf5d14128a9c86c51b207d", "score": "0.4499931", "text": "func showUsage() {\n\tgenUsage().Render()\n}", "title": "" }, { "docid": "9d5af7ed7bcf5d14128a9c86c51b207d", "score": "0.4499931", "text": "func showUsage() {\n\tgenUsage().Render()\n}", "title": "" }, { "docid": "e00e9541753ca55ab2a81ec29855f1a3", "score": "0.44982514", "text": "func formatPlanModuleSingle(\n\tbuf *bytes.Buffer, m *terraform.ModuleDiff, opts *PlanOpts) {\n\t// Ignore empty diffs\n\tif m.Empty() {\n\t\treturn\n\t}\n\n\tmoduleName := fmt.Sprintf(\"module.%s\", strings.Join(m.Path[1:], \".\"))\n\n\t// Determine the color for the text (green for adding, yellow\n\t// for change, red for delete), and symbol, and output the\n\t// resource header.\n\tcolor := \"yellow\"\n\tsymbol := \"~\"\n\tswitch m.ChangeType() {\n\tcase terraform.DiffCreate:\n\t\tcolor = \"green\"\n\t\tsymbol = \"+\"\n\tcase terraform.DiffDestroy:\n\t\tcolor = \"red\"\n\t\tsymbol = \"-\"\n\t}\n\n\tbuf.WriteString(opts.Color.Color(fmt.Sprintf(\n\t\t\"[%s]%s %s\\n\",\n\t\tcolor, symbol, moduleName)))\n\tbuf.WriteString(fmt.Sprintf(\n\t\t\" %d resource(s)\",\n\t\tlen(m.Resources)))\n\tbuf.WriteString(opts.Color.Color(\"[reset]\\n\"))\n}", "title": "" }, { "docid": "d727983875868e42c69bce0597224365", "score": "0.44875744", "text": "func moduleAndPackageNames(ctx *gcp.Context, fn fnInfo) (string, string, error) {\n\tresult, err := ctx.Exec([]string{\"go\", \"list\", \"-m\"}, gcp.WithWorkDir(fn.Source), gcp.WithUserAttribution)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\tfnMod := result.Stdout\n\t// Add the module name to the the package name, such that go build will be able to find it,\n\t// if a directory with the package name is not at the app root. Otherwise, assume the package is at the module root.\n\tfnPackage := fnMod\n\tfnPackageExists, err := ctx.FileExists(ctx.ApplicationRoot(), fn.Package)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\tif fnPackageExists {\n\t\tfnPackage = fmt.Sprintf(\"%s/%s\", fnMod, fn.Package)\n\t}\n\treturn fnMod, fnPackage, nil\n}", "title": "" }, { "docid": "b789dbd41e1976167612b280a78c9003", "score": "0.4484237", "text": "func dispHelp() {\n\texec, _ := os.Executable()\n\texec = filepath.Base(exec)\n\tfmt.Printf(`\n` + FormatText(strings.Join([]string{Name, Vers, \"©\" + YearCreat, Creat, Repository}, \" \"), 80, true) + `\n` + FormatText(Descr, 80, true) + `\n` + FormatText(LicenseShort, 80, true) + `\n\nusage:\n` + exec + ` [OPTION] [HASH-METHODS]... -i [FILES]... -o [OUTPUT-FILE]\n\n[OPTION]\n\n-h, --help\tThis help.\n\n-s, --sum\tAdd a '.SUM' file for each given file(s) including choosen\n\t\thash methods.\n\n-r, --recursive\tIf a directory is given as input file (or dot), determine\n\t\twhether\ta recursive scan will be done or not, default NOT.\n\n-n, --noname\tDisable filename display.\n\n-d ,--decimal\tUse decimal for file size calculation. (1000 instead of 1024).\n\n-x, --noosrem\tDoes not add OS. reminder in output file(s).\n\n[HASH-METHODS]\n\n\tUses one or more hash methods to calculate the checksum of the\n\tgiven file(s).\n\n-Md4, -Md5,\n-Sha1, -Sha256, -Sha384, -Sha512,\n-Sha3_256, -Sha3_384, -Sha3_512,\n-Blake2b256, -Blake2b384, -Blake2b512\n\n\tBLAKE hashing methods are impressive in terms of their\n\treliability and speed compared to SHAs. Not yet really popular.\n\tThey're present here not for public distribution use but rather\n\tfor personal use on large files (e.g: comparison of .mkv).\n\n[INPUT/OUTPUT-FILES]\n\n-i, --input\tIndicate that the following files should be considered to be\n\t\thashed.\n\n-o, --output\tSpecify the name of the file in which you want to place the\n\t\tcollected checksums. This replaces the \"--sum\" option, so you\n\t\tcan only use one or the other.\n\nExample:\n\n` + exec + ` -s -MD5 -SHA1 -i data.json main.go blue.book\n\n\tWill create '.SUM' file for 'data.json' 'main.go' 'blue.book',\n\tincluding they're MD5 and SHA1 checksum.\n\n` + exec + ` -SHA256 -BLAKE2b256 -i data.json main.go blue.book -o output.SUM\n\n\tCalculate the SHA256, SHA512 and BLAKE2b256 checksum for the given\n\t'data.json' 'main.go' 'blue.book' files and fill a single 'output.SUM'\n\tfile with the informations gathered.\n`)\n}", "title": "" }, { "docid": "4346f10722d162eacf10355c0b6a36fc", "score": "0.44738242", "text": "func Usage(cfg interface{}, headerText *string, usageFuncs ...func()) func() {\n\treturn FUsage(os.Stderr, cfg, headerText, usageFuncs...)\n}", "title": "" }, { "docid": "9befbfb3fa4c9a1b32b0aea8e8790ea2", "score": "0.44733903", "text": "func Choose(what string, kind string, choices, help []string, defaultValue string, required bool, newOk bool) string {\n\tvalueDescription := \"an existing\"\n\tif newOk {\n\t\tvalueDescription = \"your own\"\n\t}\n\tfmt.Printf(\"Choose a number from below, or type in %s %s.\\n\", valueDescription, kind)\n\t// Empty input is allowed if not required is set, or if\n\t// required is set but there is a default value to use.\n\tif defaultValue != \"\" {\n\t\tfmt.Printf(\"Press Enter for the default (%s).\\n\", defaultValue)\n\t} else if !required {\n\t\tfmt.Printf(\"Press Enter to leave empty.\\n\")\n\t}\n\tattributes := []string{terminal.HiRedFg, terminal.HiGreenFg}\n\tfor i, text := range choices {\n\t\tvar lines []string\n\t\tif help != nil && help[i] != \"\" {\n\t\t\tparts := strings.Split(help[i], \"\\n\")\n\t\t\tlines = append(lines, parts...)\n\t\t\tlines = append(lines, fmt.Sprintf(\"(%s)\", text))\n\t\t}\n\t\tpos := i + 1\n\t\tterminal.WriteString(attributes[i%len(attributes)])\n\t\tif len(lines) == 0 {\n\t\t\tfmt.Printf(\"%2d > %s\\n\", pos, text)\n\t\t} else {\n\t\t\tmid := (len(lines) - 1) / 2\n\t\t\tfor i, line := range lines {\n\t\t\t\tvar sep rune\n\t\t\t\tswitch i {\n\t\t\t\tcase 0:\n\t\t\t\t\tsep = '/'\n\t\t\t\tcase len(lines) - 1:\n\t\t\t\t\tsep = '\\\\'\n\t\t\t\tdefault:\n\t\t\t\t\tsep = '|'\n\t\t\t\t}\n\t\t\t\tnumber := \" \"\n\t\t\t\tif i == mid {\n\t\t\t\t\tnumber = fmt.Sprintf(\"%2d\", pos)\n\t\t\t\t}\n\t\t\t\tfmt.Printf(\"%s %c %s\\n\", number, sep, line)\n\t\t\t}\n\t\t}\n\t\tterminal.WriteString(terminal.Reset)\n\t}\n\tfor {\n\t\tfmt.Printf(\"%s> \", what)\n\t\tresult := ReadLine()\n\t\ti, err := strconv.Atoi(result)\n\t\tif err != nil {\n\t\t\tfor _, v := range choices {\n\t\t\t\tif result == v {\n\t\t\t\t\treturn result\n\t\t\t\t}\n\t\t\t}\n\t\t\tif result == \"\" {\n\t\t\t\t// If empty string is in the predefined list of choices it has already been returned above.\n\t\t\t\t// If parameter required is not set, then empty string is always a valid value.\n\t\t\t\tif !required {\n\t\t\t\t\treturn result\n\t\t\t\t}\n\t\t\t\t// If parameter required is set, but there is a default, then empty input means default.\n\t\t\t\tif defaultValue != \"\" {\n\t\t\t\t\treturn defaultValue\n\t\t\t\t}\n\t\t\t\t// If parameter required is set, and there is no default, then an input value is required.\n\t\t\t\tfmt.Printf(\"This value is required and it has no default.\\n\")\n\t\t\t} else if newOk {\n\t\t\t\t// If legal input is not restricted to defined choices, then any nonzero input string is accepted.\n\t\t\t\treturn result\n\t\t\t} else {\n\t\t\t\t// A nonzero input string was specified but it did not match any of the strictly defined choices.\n\t\t\t\tfmt.Printf(\"This value must match %s value.\\n\", valueDescription)\n\t\t\t}\n\t\t} else {\n\t\t\tif i >= 1 && i <= len(choices) {\n\t\t\t\treturn choices[i-1]\n\t\t\t}\n\t\t\tfmt.Printf(\"No choices with this number.\\n\")\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d15cd63599b83c4f2bad60d7d1ae8394", "score": "0.4470923", "text": "func formatPlanModuleExpand(\n\tbuf *bytes.Buffer, m *terraform.ModuleDiff, opts *PlanOpts) {\n\t// Ignore empty diffs\n\tif m.Empty() {\n\t\treturn\n\t}\n\n\tvar moduleName string\n\tif !m.IsRoot() {\n\t\tmoduleName = fmt.Sprintf(\"module.%s\", strings.Join(m.Path[1:], \".\"))\n\t}\n\n\t// We want to output the resources in sorted order to make things\n\t// easier to scan through, so get all the resource names and sort them.\n\tnames := make([]string, 0, len(m.Resources))\n\tfor name, _ := range m.Resources {\n\t\tnames = append(names, name)\n\t}\n\tsort.Strings(names)\n\n\t// Go through each sorted name and start building the output\n\tfor _, name := range names {\n\t\trdiff := m.Resources[name]\n\t\tif rdiff.Empty() {\n\t\t\tcontinue\n\t\t}\n\n\t\tdataSource := strings.HasPrefix(name, \"data.\")\n\n\t\tif moduleName != \"\" {\n\t\t\tname = moduleName + \".\" + name\n\t\t}\n\n\t\t// Determine the color for the text (green for adding, yellow\n\t\t// for change, red for delete), and symbol, and output the\n\t\t// resource header.\n\t\tcolor := \"yellow\"\n\t\tsymbol := \"~\"\n\t\toldValues := true\n\t\tswitch rdiff.ChangeType() {\n\t\tcase terraform.DiffDestroyCreate:\n\t\t\tcolor = \"green\"\n\t\t\tsymbol = \"-/+\"\n\t\tcase terraform.DiffCreate:\n\t\t\tcolor = \"green\"\n\t\t\tsymbol = \"+\"\n\t\t\toldValues = false\n\n\t\t\t// If we're \"creating\" a data resource then we'll present it\n\t\t\t// to the user as a \"read\" operation, so it's clear that this\n\t\t\t// operation won't change anything outside of the Terraform state.\n\t\t\t// Unfortunately by the time we get here we only have the name\n\t\t\t// to work with, so we need to cheat and exploit knowledge of the\n\t\t\t// naming scheme for data resources.\n\t\t\tif dataSource {\n\t\t\t\tsymbol = \"<=\"\n\t\t\t\tcolor = \"cyan\"\n\t\t\t}\n\t\tcase terraform.DiffDestroy:\n\t\t\tcolor = \"red\"\n\t\t\tsymbol = \"-\"\n\t\t}\n\n\t\tvar extraAttr []string\n\t\tif rdiff.DestroyTainted {\n\t\t\textraAttr = append(extraAttr, \"tainted\")\n\t\t}\n\t\tif rdiff.DestroyDeposed {\n\t\t\textraAttr = append(extraAttr, \"deposed\")\n\t\t}\n\t\tvar extraStr string\n\t\tif len(extraAttr) > 0 {\n\t\t\textraStr = fmt.Sprintf(\" (%s)\", strings.Join(extraAttr, \", \"))\n\t\t}\n\n\t\tbuf.WriteString(opts.Color.Color(fmt.Sprintf(\n\t\t\t\"[%s]%s %s%s\\n\",\n\t\t\tcolor, symbol, name, extraStr)))\n\n\t\t// Get all the attributes that are changing, and sort them. Also\n\t\t// determine the longest key so that we can align them all.\n\t\tkeyLen := 0\n\t\tkeys := make([]string, 0, len(rdiff.Attributes))\n\t\tfor key, _ := range rdiff.Attributes {\n\t\t\t// Skip the ID since we do that specially\n\t\t\tif key == \"id\" {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tkeys = append(keys, key)\n\t\t\tif len(key) > keyLen {\n\t\t\t\tkeyLen = len(key)\n\t\t\t}\n\t\t}\n\t\tsort.Strings(keys)\n\n\t\t// Go through and output each attribute\n\t\tfor _, attrK := range keys {\n\t\t\tattrDiff := rdiff.Attributes[attrK]\n\n\t\t\tv := attrDiff.New\n\t\t\tif v == \"\" && attrDiff.NewComputed {\n\t\t\t\tv = \"<computed>\"\n\t\t\t}\n\n\t\t\tif attrDiff.Sensitive {\n\t\t\t\tv = \"<sensitive>\"\n\t\t\t}\n\n\t\t\tupdateMsg := \"\"\n\t\t\tif attrDiff.RequiresNew && rdiff.Destroy {\n\t\t\t\tupdateMsg = opts.Color.Color(\" [red](forces new resource)\")\n\t\t\t} else if attrDiff.Sensitive && oldValues {\n\t\t\t\tupdateMsg = opts.Color.Color(\" [yellow](attribute changed)\")\n\t\t\t}\n\n\t\t\tif oldValues {\n\t\t\t\tvar u string\n\t\t\t\tif attrDiff.Sensitive {\n\t\t\t\t\tu = \"<sensitive>\"\n\t\t\t\t} else {\n\t\t\t\t\tu = attrDiff.Old\n\t\t\t\t}\n\t\t\t\tbuf.WriteString(fmt.Sprintf(\n\t\t\t\t\t\" %s:%s %#v => %#v%s\\n\",\n\t\t\t\t\tattrK,\n\t\t\t\t\tstrings.Repeat(\" \", keyLen-len(attrK)),\n\t\t\t\t\tu,\n\t\t\t\t\tv,\n\t\t\t\t\tupdateMsg))\n\t\t\t} else {\n\t\t\t\tbuf.WriteString(fmt.Sprintf(\n\t\t\t\t\t\" %s:%s %#v%s\\n\",\n\t\t\t\t\tattrK,\n\t\t\t\t\tstrings.Repeat(\" \", keyLen-len(attrK)),\n\t\t\t\t\tv,\n\t\t\t\t\tupdateMsg))\n\t\t\t}\n\t\t}\n\n\t\t// Write the reset color so we don't overload the user's terminal\n\t\tbuf.WriteString(opts.Color.Color(\"[reset]\\n\"))\n\t}\n}", "title": "" }, { "docid": "db6dc0bae5373cfdd1c2627495a7ba09", "score": "0.44700986", "text": "func printProposalSummary(token string, s piv1.Summary) {\n\tprintf(\"Token : %v\\n\", token)\n\tprintf(\"Status: %v\\n\", s.Status)\n}", "title": "" }, { "docid": "3be2dcbaa06b5b75965b396337e853eb", "score": "0.44616428", "text": "func someFunctionUsage() {\n\tfmt.Fprintf(os.Stderr, `The calc service performs operations on numbers.\nUsage:\n %s [globalflags] some--function COMMAND [flags]\n\nCOMMAND:\n add: Add implements add.\n\nAdditional help:\n %s some--function COMMAND --help\n`, os.Args[0], os.Args[0])\n}", "title": "" }, { "docid": "ec22a87ff07af09b3b905392524acf92", "score": "0.44562235", "text": "func Summary(name string) {\n\tcollector.Summary(name)\n}", "title": "" }, { "docid": "f2d3f5535cc837f89abf58c34541d56a", "score": "0.4428977", "text": "func (e *Executor) PrintTasksHelp() {\n\ttasks := e.tasksWithDesc()\n\tif len(tasks) == 0 {\n\t\te.Logger.Outf(logger.Yellow, \"[task: No tasks with description available]()\")\n\t\treturn\n\t}\n\t// e.Logger.Outf(logger.Default, \"task: Available tasks for this project:\")\n\n\tr, _ := glamour.NewTermRenderer(\n\t\tglamour.WithAutoStyle(),\n\t\tglamour.WithWordWrap(120),\n\t)\n\n\ttext := \"# Tasks \\n**Available tasks for this project** : \\n\"\n\ttext += \"TASK | DESCRIPTION\\n---|:----------\\n\"\n\t// Format in tab-separated columns with a tab stop of 8.\n\t// w := tabwriter.NewWriter(e.Stdout, 0, 8, 0, '\\t', 0)\n\tfor _, task := range tasks {\n\t\tif task.When {\n\t\t\ttext += fmt.Sprintf(\" _%s_ | %s\\n\", task.Name(), task.Desc)\n\t\t}\n\t}\n\tout, _ := r.Render(text)\n\tfmt.Print(out)\n}", "title": "" }, { "docid": "cce586608597542d192b9e29fdc7d1dd", "score": "0.44228488", "text": "func (k *OrderedClient) Summary(\n\tctx context.Context,\n) (string, error) {\n\ttempDir, err := ioutil.TempDir(\"\", \"cluster-summary\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer func() {\n\t\tif k.keepConfigs {\n\t\t\tlog.Infof(\"Keeping temporary configs in %s\", tempDir)\n\t\t} else {\n\t\t\tos.RemoveAll(tempDir)\n\t\t}\n\t}()\n\n\terr = data.RestoreAssets(tempDir, \"scripts/cluster-summary\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tcmd := exec.Command(\n\t\t\"python\",\n\t\tfilepath.Join(tempDir, \"scripts/cluster-summary/cluster_summary.py\"),\n\t\t\"--no-color\",\n\t\t\"--kubeconfig\",\n\t\tk.kubeConfigPath,\n\t)\n\n\toutput, err := cmd.CombinedOutput()\n\treturn string(output), err\n}", "title": "" }, { "docid": "95d599d7b2e69c53c506ba5cbe87fcd4", "score": "0.4409523", "text": "func (m *Module) Description() string {\n\treturn \"Grab an FTP banner\"\n}", "title": "" }, { "docid": "b58768bc2fcc9a749a0d2f16e3e9829f", "score": "0.43930987", "text": "func (s *SQLVet) PrintSummary() {\n\tcli.Show(\"Checked %d SQL queries.\", s.QueryCnt)\n\tif s.ErrCnt == 0 {\n\t\tcli.Success(\"🎉 Everything is awesome!\")\n\t} else {\n\t\tcli.Error(\"Identified %d errors.\", s.ErrCnt)\n\t}\n}", "title": "" }, { "docid": "630cc554780facfcce5380f0a5d72fe7", "score": "0.43891022", "text": "func menuHelpModule() {\n\ttable := tablewriter.NewWriter(os.Stdout)\n\ttable.SetAlignment(tablewriter.ALIGN_LEFT)\n\ttable.SetBorder(false)\n\ttable.SetCaption(true, \"Module Menu Help\")\n\ttable.SetHeader([]string{\"Command\", \"Description\", \"Options\"})\n\n\tdata := [][]string{\n\t\t{\"back\", \"Return to the main menu\", \"\"},\n\t\t{\"info\", \"Show information about a module\"},\n\t\t{\"main\", \"Return to the main menu\", \"\"},\n\t\t{\"reload\", \"Reloads the module to a fresh clean state\"},\n\t\t{\"run\", \"Run or execute the module\", \"\"},\n\t\t{\"set\", \"Set the value for one of the module's options\", \"<option name> <option value>\"},\n\t\t{\"show\", \"Show information about a module or its options\", \"info, options\"},\n\t}\n\n\ttable.AppendBulk(data)\n\tfmt.Println()\n\ttable.Render()\n\tfmt.Println()\n\tmessage(\"info\", \"Visit the wiki for additional information https://github.com/Ne0nd0g/reaper/wiki/reaper-Server-Module-Menu\")\n}", "title": "" }, { "docid": "d9bd013331e3880da0757b4312fa2f0a", "score": "0.43790817", "text": "func tasksUsage() {\n\tfmt.Fprintf(os.Stderr, `Service is the tasks service interface.\nUsage:\n %s [globalflags] tasks COMMAND [flags]\n\nCOMMAND:\n five: Five implements five.\n\nAdditional help:\n %s tasks COMMAND --help\n`, os.Args[0], os.Args[0])\n}", "title": "" }, { "docid": "7780b64c7709ae9fc9b748780ba43f81", "score": "0.43765616", "text": "func rawGoModSummary(m module.Version) (*modFileSummary, error) {\n\tif m.Path == \"\" && MainModules.Contains(m.Path) {\n\t\tpanic(\"internal error: rawGoModSummary called on the Target module\")\n\t}\n\n\ttype key struct {\n\t\tm module.Version\n\t}\n\ttype cached struct {\n\t\tsummary *modFileSummary\n\t\terr error\n\t}\n\tc := rawGoModSummaryCache.Do(key{m}, func() any {\n\t\tsummary := new(modFileSummary)\n\t\tname, data, err := rawGoModData(m)\n\t\tif err != nil {\n\t\t\treturn cached{nil, err}\n\t\t}\n\t\tf, err := modfile.ParseLax(name, data, nil)\n\t\tif err != nil {\n\t\t\treturn cached{nil, module.VersionError(m, fmt.Errorf(\"parsing %s: %v\", base.ShortPath(name), err))}\n\t\t}\n\t\tif f.Module != nil {\n\t\t\tsummary.module = f.Module.Mod\n\t\t\tsummary.deprecated = f.Module.Deprecated\n\t\t}\n\t\tif f.Go != nil && f.Go.Version != \"\" {\n\t\t\trawGoVersion.LoadOrStore(m, f.Go.Version)\n\t\t\tsummary.goVersion = f.Go.Version\n\t\t\tsummary.pruning = pruningForGoVersion(f.Go.Version)\n\t\t} else {\n\t\t\tsummary.pruning = unpruned\n\t\t}\n\t\tif len(f.Require) > 0 {\n\t\t\tsummary.require = make([]module.Version, 0, len(f.Require))\n\t\t\tfor _, req := range f.Require {\n\t\t\t\tsummary.require = append(summary.require, req.Mod)\n\t\t\t}\n\t\t}\n\t\tif len(f.Retract) > 0 {\n\t\t\tsummary.retract = make([]retraction, 0, len(f.Retract))\n\t\t\tfor _, ret := range f.Retract {\n\t\t\t\tsummary.retract = append(summary.retract, retraction{\n\t\t\t\t\tVersionInterval: ret.VersionInterval,\n\t\t\t\t\tRationale: ret.Rationale,\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\treturn cached{summary, nil}\n\t}).(cached)\n\n\treturn c.summary, c.err\n}", "title": "" }, { "docid": "23f052def17d1ce7f1a328166eaeba2b", "score": "0.43738368", "text": "func (w *PollModule) Description() string { return \"Manages the polling system.\" }", "title": "" }, { "docid": "0eaf0012e6958b069d107efcc9c508a7", "score": "0.43576843", "text": "func (s *summaryState) PrintSummary() {\n\tif config.Vars.NoSummary == true {\n\t\tlog.Printf(\"[NOTICE] Summary Log suppressed by configuration NoSummary=true.\")\n\t} else {\n\t\tsummary, _ := json.MarshalIndent(s, \"\", \" \")\n\t\tlog.Printf(\"Finished\\n%s\", summary) // Summary output should not be handled by log levels\n\t}\n}", "title": "" }, { "docid": "460f7b3c7eae1c663a2c4be8017a98da", "score": "0.43547595", "text": "func (q *Quran) Summary(ctx context.Context, req *pb.SummaryRequest, rsp *pb.SummaryResponse) error {\n\tlang := \"en\"\n\tif len(req.Language) > 0 {\n\t\tlang = req.Language\n\t}\n\tif req.Chapter <= 0 {\n\t\treturn errors.BadRequest(\"quran.chapter-summary\", \"require chapter id\")\n\t}\n\n\tvar resp map[string]*domain.ChapterInfo\n\turi := fmt.Sprintf(apiUrl+\"chapters/%d/info?language=%s\", req.Chapter, lang)\n\n\tif err := api.Get(uri, &resp); err != nil {\n\t\tlogger.Errorf(\"Failed to retrieve chapter info: %v\", err)\n\t\treturn errors.InternalServerError(\"quran.chapter-summary\", \"Failed to retrieve chapter summary\")\n\t}\n\n\tinfo := resp[\"chapter_info\"]\n\trsp.Chapter = info.ChapterId\n\trsp.Summary = info.ShortText\n\trsp.Source = info.Source\n\trsp.Text = info.Text\n\n\treturn nil\n}", "title": "" }, { "docid": "23f085a6ab0172536cdad4d6e7ced3d5", "score": "0.43530688", "text": "func (o *LimitedSupportReason) Summary() string {\n\tif o != nil && o.bitmap_&64 != 0 {\n\t\treturn o.summary\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "48f4b7e1d58f6342f6bbdf3ec3026f98", "score": "0.43340334", "text": "func (item *Augeas) Brief() string {\n\tvar brief string\n\tbrief = \"\\nFile path: \\t\" + item.FilePath + \"\\nLens: \\t\\t\" + item.Lens + \"\\nOption path: \\t\" + item.OptionPath\n\tif item.OptionValue != \"\" {\n\t\tbrief += \"\\nOption value: \\t\" + item.OptionValue\n\t}\n\tif item.Action != \"\" {\n\t\tbrief += \"\\nAction: \\t\" + item.Action\n\t}\n\treturn brief\n}", "title": "" }, { "docid": "6ac1dbc22fa99a0edc9b6061bf709fc0", "score": "0.43182272", "text": "func DescribePackage(repo *util.Repo, packageName string, showContent bool) (string, error) {\n\tif !repo.PackageExists(packageName) {\n\t\treturn \"\", fmt.Errorf(\"Package %s does not exist in your local repository. Pull it using \"+\n\t\t\t\"'capstan package pull %s'\", packageName, packageName)\n\t}\n\n\ttarReader, err := repo.GetPackageTarReader(packageName)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tvar pkg *core.Package\n\tvar cmdConf *runtime.CmdConfig\n\tvar readme string\n\n\tvar content []*tar.Header\n\n\tfor {\n\t\theader, err := tarReader.Next()\n\t\tif err != nil {\n\t\t\tif err == io.EOF {\n\t\t\t\t// Have we reached till the end of the tar?\n\t\t\t\tbreak\n\t\t\t}\n\t\t\treturn \"\", err\n\t\t}\n\n\t\tif absTarPathMatches(header.Name, \"/meta/package.yaml\") {\n\t\t\tdata, err := ioutil.ReadAll(tarReader)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t\tpkg = &core.Package{}\n\t\t\tif err := pkg.Parse(data); err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t} else if absTarPathMatches(header.Name, \"/meta/run.yaml\") {\n\t\t\tdata, err := ioutil.ReadAll(tarReader)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t\tif cmdConf, err = runtime.ParsePackageRunManifestData(data); err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t} else if absTarPathMatches(header.Name, \"/meta/README.md\") {\n\t\t\tdata, err := ioutil.ReadAll(tarReader)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t\treadme = string(data)\n\t\t} else if showContent && !absTarPathMatches(header.Name, \"/meta/\") {\n\t\t\tcontent = append(content, header)\n\t\t}\n\n\t\t// Stop reading if we have all the information\n\t\tif pkg != nil && cmdConf != nil && readme != \"\" && !showContent {\n\t\t\tbreak\n\t\t}\n\t}\n\n\ts := fmt.Sprintln(\"PACKAGE METADATA\")\n\tif pkg != nil {\n\t\ts += fmt.Sprintln(\"name:\", pkg.Name)\n\t\ts += fmt.Sprintln(\"title:\", pkg.Title)\n\t\ts += fmt.Sprintln(\"author:\", pkg.Author)\n\n\t\tif len(pkg.Require) > 0 {\n\t\t\ts += fmt.Sprintln(\"required packages:\")\n\t\t\tfor _, r := range pkg.Require {\n\t\t\t\ts += fmt.Sprintf(\" * %s\\n\", r)\n\t\t\t}\n\t\t}\n\t} else {\n\t\treturn \"\", fmt.Errorf(\"package is not valid: missing meta/package.yaml\")\n\t}\n\n\ts += fmt.Sprintln()\n\n\tif cmdConf != nil {\n\t\ts += fmt.Sprintln(\"PACKAGE EXECUTION\")\n\t\ts += fmt.Sprintln(\"runtime:\", cmdConf.RuntimeType)\n\t\tif cmdConf.ConfigSetDefault == \"\" && len(cmdConf.ConfigSets) == 1 {\n\t\t\tfor configName := range cmdConf.ConfigSets {\n\t\t\t\ts += fmt.Sprintln(\"default configuration:\", configName)\n\t\t\t}\n\t\t} else {\n\t\t\ts += fmt.Sprintln(\"default configuration:\", cmdConf.ConfigSetDefault)\n\t\t}\n\n\t\ts += fmt.Sprintln(\"-----------------------------------------\")\n\t\ts += fmt.Sprintf(\"%-25s | %s\\n\", \"CONFIGURATION NAME\", \"BOOT COMMAND\")\n\t\ts += fmt.Sprintln(\"-----------------------------------------\")\n\t\tfor configName := range cmdConf.ConfigSets {\n\t\t\tbootCmd, err := cmdConf.ConfigSets[configName].GetBootCmd(nil, nil)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t\ts += fmt.Sprintf(\"%-25s | %s\\n\", configName, bootCmd)\n\t\t}\n\t\ts += fmt.Sprintln(\"-----------------------------------------\")\n\t} else {\n\t\ts += fmt.Sprintln(\"No package execution information was found.\")\n\t}\n\n\ts += fmt.Sprintln(\"\")\n\n\tif readme != \"\" {\n\t\ts += fmt.Sprintln(\"PACKAGE DOCUMENTATION\")\n\t\ts += fmt.Sprintln(readme)\n\t}\n\n\tif showContent {\n\t\ts += fmt.Sprintln(\"PACKAGE CONTENT\")\n\t\tfor _, header := range content {\n\t\t\ts += fmt.Sprintf(\"%s %d %d %d %11d %s %s\",\n\t\t\t\theader.FileInfo().Mode().String(), 0, 0, 0, header.Size, header.FileInfo().ModTime().Format(time.RFC822), header.Name)\n\t\t\tif header.FileInfo().Mode()&os.ModeSymlink == os.ModeSymlink {\n\t\t\t\ts += fmt.Sprintf(\" -> %s\", header.Linkname)\n\t\t\t}\n\t\t\ts += fmt.Sprintln(\"\")\n\t\t}\n\t}\n\n\treturn s, nil\n}", "title": "" }, { "docid": "f255b9e940715a2a54a206e8975c19f2", "score": "0.43147278", "text": "func (w *HelpModule) Description() string {\n\treturn \"Contains commands for getting information about Sweetie Bot, her commands, or the server she is in.\"\n}", "title": "" }, { "docid": "f25a09718244b6fd3a273aba9a0670ab", "score": "0.43128914", "text": "func (module *Module) Description() string {\n\treturn \"Perform a handshake with Oracle database servers\"\n}", "title": "" }, { "docid": "be203758efffedf98bcf3c8ec4324b49", "score": "0.43015084", "text": "func summaryFrom(words ...string) Summary {\n\tstore := NewMutexStore()\n\n\tfor _, word := range words {\n\t\tstore.Write(word)\n\t}\n\n\treturn store.Query()\n}", "title": "" }, { "docid": "0f750102f7b727b4605c0c9173e869ff", "score": "0.4291074", "text": "func (b *PrivilegedRoleRequestBuilder) Summary() *PrivilegedRoleSummaryRequestBuilder {\n\tbb := &PrivilegedRoleSummaryRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}\n\tbb.baseURL += \"/summary\"\n\treturn bb\n}", "title": "" }, { "docid": "a84d40fb99840fbbcf1ade0962ba4825", "score": "0.4290504", "text": "func (module *Module) Description() string {\n\treturn \"Fetch a raw banner by sending a static probe and checking the result against a regular expression\"\n}", "title": "" }, { "docid": "960cd9a871af92bc609e91a3164b5f0f", "score": "0.4280018", "text": "func (p *PickPlugin) Help(bot *mmmorty.Bot, service mmmorty.Discord, message mmmorty.DiscordMessage, detailed bool) []string {\n\treturn mmmorty.CommandHelp(service, pickCommand, \"option 1 or option 2 or ...\",\n\t\t\"asks Morty to pick between an arbitrary number of things for you\")\n}", "title": "" }, { "docid": "d2c5dcaa0bd99b3ff658e52c3689213c", "score": "0.42763785", "text": "func (m *IntelligenceProfile) SetSummary(value FormattedContentable)() {\n err := m.GetBackingStore().Set(\"summary\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "e98771f82df9e54873c79e78a2739df6", "score": "0.42722285", "text": "func (a *SummaryStateStruct) PrintSummary() {\n\tif config.Vars.SummaryEnabled == \"false\" {\n\t\tlog.Printf(\"[NOTICE] Summary Log suppressed by configuration SummaryEnabled=false.\")\n\t} else {\n\t\tsummary, _ := json.MarshalIndent(a, \"\", \" \")\n\t\tfmt.Printf(\"%s\", summary) // Summary output should not be handled by log levels\n\t}\n}", "title": "" }, { "docid": "a711343c623ee0df707f9349c5384e62", "score": "0.4268627", "text": "func (t *task) help(taskName string) string {\n\tvar rv string\n\n\tusage := t.usageString(taskName)\n\trv += fmt.Sprintf(\"%s - %s\\n\", usage, t.shortDescription)\n\n\tif len(t.Options) > 0 {\n\t\trv += color.YellowString(\"\\nOptions:\\n\")\n\t\tfor _, opt := range t.Options {\n\t\t\trv += fmt.Sprintf(\" %-20s %s\\n\", color.GreenString(opt.Explain()), opt.Description)\n\t\t}\n\t}\n\n\tif len(t.Arguments) > 0 {\n\t\trv += color.YellowString(\"\\nArguments:\\n\")\n\t\tfor _, arg := range t.getOrderedArguments() {\n\t\t\trv += fmt.Sprintf(\" %-20s %s\\n\", color.GreenString(arg.Explain()), arg.Description)\n\t\t}\n\t}\n\n\tif len(t.subtasks) > 0 {\n\t\trv += color.YellowString(\"\\nAvailable commands:\\n\")\n\t\tvar subtaskNames []string\n\t\tfor subtaskName := range t.subtasks {\n\t\t\tsubtaskNames = append(subtaskNames, subtaskName)\n\t\t}\n\t\tsort.Strings(subtaskNames)\n\t\tfor _, subtaskName := range subtaskNames {\n\t\t\trv += fmt.Sprintf(\" %-20s %s\\n\", color.GreenString(subtaskName), t.subtasks[subtaskName].shortDescription)\n\t\t}\n\t}\n\n\tif len(t.description) > 0 {\n\t\trv += fmt.Sprintln(\"\\nDescription:\")\n\t\tdesc := strings.Trim(t.description, \"\\n\")\n\t\tfor _, line := range strings.Split(desc, \"\\n\") {\n\t\t\trv += fmt.Sprintf(\" %s\\n\", line)\n\t\t}\n\t}\n\n\treturn rv\n}", "title": "" }, { "docid": "6fb11162f7d86baf2b15f784697bf071", "score": "0.42682514", "text": "func (c *ListCommand) printSummary(out io.Writer, rs []*fastly.TLSDomain) error {\n\tt := text.NewTable(out)\n\tt.AddHeader(\"ID\", \"TYPE\")\n\tfor _, r := range rs {\n\t\tt.AddLine(r.ID, r.Type)\n\t}\n\tt.Print()\n\treturn nil\n}", "title": "" }, { "docid": "7c77e8bfa06bf102b7dd833c8847ef07", "score": "0.425981", "text": "func moduleCmd(mta *mta.MTA, moduleName string) (*mta.Module, []string, string, error) {\n\tfor _, m := range mta.Modules {\n\t\tif m.Name == moduleName {\n\t\t\tcommandProvider, buildResults, err := CommandProvider(*m)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, nil, \"\", err\n\t\t\t}\n\t\t\treturn m, commandProvider.Command, buildResults, nil\n\t\t}\n\t}\n\treturn nil, nil, \"\", errors.Errorf(undefinedModuleMsg, moduleName)\n}", "title": "" }, { "docid": "c7a5bae8757409ccc4e6d5fb02d6e5df", "score": "0.4259413", "text": "func usage() {\n\tfmt.Printf(\"%s\", helpString)\n}", "title": "" }, { "docid": "c7a5bae8757409ccc4e6d5fb02d6e5df", "score": "0.4259413", "text": "func usage() {\n\tfmt.Printf(\"%s\", helpString)\n}", "title": "" }, { "docid": "c1dea631d8b9bab1e29bc6a9750d95a1", "score": "0.42586824", "text": "func (finding *Finding) Summary() (param string) {\n\treturn fmt.Sprintf(\"Aegis (%s) - %s\", finding.EntityName, finding.VulnerabilityTitle())\n}", "title": "" }, { "docid": "18caeeaff69be4a863d3780c481d0417", "score": "0.4252989", "text": "func PromptForToolDescription() (toolDescription string, err error) {\n\treader := bufio.NewReader(os.Stdin)\n\tfmt.Printf(\"Enter a short, one line description for your new tool: \")\n\n\tinput, err := reader.ReadString('\\n')\n\tif err != nil {\n\t\terr = errors.Wrapf(err, \"failed to read input name\")\n\t\treturn toolDescription, err\n\t}\n\n\ttoolDescription = strings.TrimRight(input, \"\\n\")\n\n\treturn toolDescription, err\n}", "title": "" }, { "docid": "326b9a3f392ad74be992df88242b0cf6", "score": "0.42492533", "text": "func (u33e *U33eModel) AddSummary(summary string) (u33 *U33eModel) {\n\tu33e.Summary = summary\n\treturn u33e\n}", "title": "" }, { "docid": "686b1e852f76def61acffafc52d340de", "score": "0.42383027", "text": "func (q *IssueRequest) Summary(value string) {\n\tq.values.Set(\"summary\", value)\n}", "title": "" }, { "docid": "2cdb756f0f87d6bbeb43313f08368b41", "score": "0.42340052", "text": "func (M *Module) Inspect() string { return \"module \" + M.Name }", "title": "" }, { "docid": "76ca13ce7eac7f3291bee437723d5d95", "score": "0.42227226", "text": "func printSummary(groups []*TestGroup) {\n\tnumTestCases := 0\n\tnumSkipped := 0\n\tnumFailed := 0\n\n\tfor _, tg := range groups {\n\t\tnumTestCases += tg.CountTestCases()\n\t\tnumSkipped += tg.CountSkipped()\n\t\tnumFailed += tg.CountFailed()\n\t}\n\n\tnumPassed := numTestCases - numSkipped - numFailed\n\n\tfmt.Printf(\"\\x1b[90m\")\n\tfmt.Printf(\"%v tests, %v passed, %v skipped, %v failed\\n\", numTestCases, numPassed, numSkipped, numFailed)\n\tfmt.Printf(\"\\x1b[0m\")\n\n\tif numFailed == 0 {\n\t\tfmt.Printf(\"\\x1b[90m\")\n\t\tfmt.Printf(\"All tests passed\\n\")\n\t\tfmt.Printf(\"\\x1b[0m\")\n\t} else {\n\t\tfmt.Println(\"\")\n\t\tfmt.Printf(\"\\x1b[31m\")\n\t\tfmt.Println(\"===============================================================================\")\n\t\tfmt.Println(\"Failed tests\")\n\t\tfmt.Println(\"===============================================================================\")\n\t\tfmt.Printf(\"\\x1b[0m\")\n\t\tfmt.Println(\"\")\n\n\t\tif numFailed > 0 {\n\t\t\tfor _, tg := range groups {\n\t\t\t\ttg.PrintFailedTestCase(1)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4c58ea374990b3da4c0ebd2d31375d39", "score": "0.4220861", "text": "func (idx *SearchIndex) GetParamsetSummary(test types.TestName, digest types.Digest, is types.IgnoreState) paramtools.ParamSet {\n\treturn idx.paramsetSummaries[is].Get(test, digest)\n}", "title": "" }, { "docid": "03a46caa757737eb6f9b51fcbd1d9c96", "score": "0.42190892", "text": "func PrintEnumerationSummary(total int, tags map[string]int, asns map[int]*ASNSummaryData, demo bool) {\n\tpad := func(num int, chr string) {\n\t\tfor i := 0; i < num; i++ {\n\t\t\tb.Fprint(color.Error, chr)\n\t\t}\n\t}\n\n\tfmt.Fprintln(color.Error)\n\t// Print the header information\n\ttitle := \"OWASP Amass v\"\n\tsite := \"https://github.com/OWASP/Amass\"\n\tb.Fprint(color.Error, title+Version)\n\tnum := 80 - (len(title) + len(Version) + len(site))\n\tpad(num, \" \")\n\tb.Fprintf(color.Error, \"%s\\n\", site)\n\tpad(8, \"----------\")\n\tfmt.Fprintf(color.Error, \"\\n%s%s\", yellow(strconv.Itoa(total)), green(\" names discovered - \"))\n\t// Print the stats using tag information\n\tnum, length := 1, len(tags)\n\tfor k, v := range tags {\n\t\tfmt.Fprintf(color.Error, \"%s: %s\", green(k), yellow(strconv.Itoa(v)))\n\t\tif num < length {\n\t\t\tg.Fprint(color.Error, \", \")\n\t\t}\n\t\tnum++\n\t}\n\tfmt.Fprintln(color.Error)\n\n\tif len(asns) == 0 {\n\t\treturn\n\t}\n\t// Another line gets printed\n\tpad(8, \"----------\")\n\tfmt.Fprintln(color.Error)\n\t// Print the ASN and netblock information\n\tfor asn, data := range asns {\n\t\tasnstr := strconv.Itoa(asn)\n\t\tdatastr := data.Name\n\n\t\tif demo && asn > 0 {\n\t\t\tasnstr = censorString(asnstr, 0, len(asnstr))\n\t\t\tdatastr = censorString(datastr, 0, len(datastr))\n\t\t}\n\n\t\tfmt.Fprintf(color.Error, \"%s%s %s %s\\n\",\n\t\t\tblue(\"ASN: \"), yellow(asnstr), green(\"-\"), green(datastr))\n\n\t\tfor cidr, ips := range data.Netblocks {\n\t\t\tcountstr := strconv.Itoa(ips)\n\t\t\tcidrstr := cidr\n\n\t\t\tif demo {\n\t\t\t\tcidrstr = censorNetBlock(cidrstr)\n\t\t\t}\n\n\t\t\tcountstr = fmt.Sprintf(\"\\t%-4s\", countstr)\n\t\t\tcidrstr = fmt.Sprintf(\"\\t%-18s\", cidrstr)\n\n\t\t\tfmt.Fprintf(color.Error, \"%s%s %s\\n\",\n\t\t\t\tyellow(cidrstr), yellow(countstr), blue(\"Subdomain Name(s)\"))\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a83919e5771cfc2a5fe1ce9cdd72b267", "score": "0.4205776", "text": "func Summary(form string, args string) {\n var out bytes.Buffer\n if 0<len(form) {\n v(\"sumarize form %s with %s\\n\", form, args)\n if app_data.data.Forms[form]==nil {\n fmt.Printf(\"Could not find form '%s'.\\n\", form)\n return\n }\n Table(form)\n out.WriteString(\" \")\n first_form := app_data.data.Forms[form][0]\n var alist []string\n if len(args)<1 {\n form_summary := app_data.data.Settings[form+\".summary\"]\n if 0<len(form_summary) {\n alist = strings.Split(form_summary, \",\")\n }\n } else {\n alist = strings.Split(args, \",\")\n }\n for i,value := range alist {\n if i<len(app_data.data.Forms[form]) {\n field := app_data.data.Forms[form][i]\n data := app_data.data.Columns[field]\n if data == nil {\n /*\n there is no column data, so try getting calculated values \n from the cache. Table caches it's last calculations for \n functions like summary to build on\n */\n row_count := len(app_data.data.Columns[first_form])\n data = make([]interface{}, row_count)\n raw := get_cache(field)\n for i,cached_value := range raw {\n data[i] = cached_value\n }\n }\n if 0<i {\n out.WriteString( app_data.format.divider )\n }\n result := \"\"\n switch value {\n case \"a\", \"avg\":\n result = fmt.Sprintf(app_data.format.template_float, Average(data) )\n case \"c\", \"cnt\", \"count\":\n result = fmt.Sprintf(app_data.format.template_decimal, len(data))\n case \"h\", \"har\", \"harmonic\":\n result = fmt.Sprintf(app_data.format.template_float, Harmonic(data))\n case \"mx\", \"max\":\n result = fmt.Sprintf(app_data.format.template_float, Max(data))\n case \"m\", \"med\", \"medium\":\n result = fmt.Sprintf(app_data.format.template_float, Median(data))\n case \"md\", \"mod\", \"mode\":\n result = fmt.Sprintf(app_data.format.template_float, Mode(data))\n case \"mn\", \"min\":\n result = fmt.Sprintf(app_data.format.template_float, Min(data))\n case \"n\", \"nop\":\n result = fmt.Sprintf(app_data.format.template_string, \"\")\n case \"s\", \"sum\":\n result = fmt.Sprintf(app_data.format.template_float, Sum(data))\n case \"sd\", \"dev\", \"sdev\":\n sd := StandardDeviation(data)\n result = fmt.Sprintf(app_data.format.template_float, sd)\n }\n out.WriteString ( result )\n }\n }\n fmt.Printf( \"%v\\n\", string(out.Bytes()) )\n }\n}", "title": "" }, { "docid": "6c5a71447bb8719d34d003a655bde1f7", "score": "0.41983", "text": "func (module *Module) Description() string {\n\treturn \"Fetch POP3 banners, optionally over TLS\"\n}", "title": "" }, { "docid": "077716ec5f9cd24e85dacc00592d5c28", "score": "0.4196416", "text": "func displayUsage() {\n\tfmt.Printf(\"Usage: jsome [<flags>] [FILE]\\n\\n\")\n\tfmt.Printf(\"Example:\\n\\tjsome file.json\\n\")\n\tfmt.Printf(\"\\tcat file.json | jsome \\n\\n\")\n\tfmt.Printf(\"Optional flags:\\n\\n\")\n\tpflag.PrintDefaults()\n}", "title": "" }, { "docid": "1975df4384b76e0d34dba557d37202f2", "score": "0.41957074", "text": "func moduleAndPackageNames(ctx *gcp.Context, fn fnInfo) (string, string, error) {\n\tresult, err := ctx.Exec([]string{\"go\", \"list\", \"-m\"}, gcp.WithWorkDir(fn.Source), gcp.WithUserAttribution)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\tfnMod := result.Stdout\n\t// golang.org/ref/mod requires that package names in a replace contains at least one dot.\n\tif parts := strings.Split(fnMod, \"/\"); len(parts) > 0 && !strings.Contains(parts[0], \".\") {\n\t\treturn \"\", \"\", gcp.UserErrorf(\"the module path in the function's go.mod must contain a dot in the first path element before a slash, e.g. example.com/module, found: %s\", fnMod)\n\t}\n\t// Add the module name to the the package name, such that go build will be able to find it,\n\t// if a directory with the package name is not at the app root. Otherwise, assume the package is at the module root.\n\tfnPackage := fnMod\n\tfnPackageExists, err := ctx.FileExists(ctx.ApplicationRoot(), fn.Package)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\tif fnPackageExists {\n\t\tfnPackage = fmt.Sprintf(\"%s/%s\", fnMod, fn.Package)\n\t}\n\treturn fnMod, fnPackage, nil\n}", "title": "" }, { "docid": "7d527c825c54a8e291aa4a3d96d8648f", "score": "0.4194951", "text": "func (self *Task) SolutionSummary(whichstream Streamtype) (err error) {\n if _tmp1298 := C.MSK_solutionsummary(self.ptr(),C.int32_t(whichstream)); _tmp1298 != 0 {\n lastcode,lastmsg := self.getlasterror(_tmp1298)\n err = &MosekError{code:Rescode(lastcode),msg:lastmsg}\n return\n }\n return\n}", "title": "" }, { "docid": "6c5aa869805d9e9848bcb2fda338c64b", "score": "0.41694674", "text": "func printUsage() {\n\tfmt.Println(\"Usage:\\n\\n\\tjoker random\\n\\tjoker dump\\n\\tjoker dump -n <number>\")\n}", "title": "" }, { "docid": "8501bcfe1e0eef4d9514c0b280080ca3", "score": "0.41691276", "text": "func (res *MockResult) FormatOverview() string {\n\tlines := []string{\n\t\t\"=======================================\",\n\t\t\" Mocked command \\\"%s\\\"\",\n\t\t\"=======================================\",\n\t}\n\n\treturn fmt.Sprintf(\n\t\tstrings.Join(lines, \"\\n\"),\n\t\tres.input,\n\t)\n}", "title": "" }, { "docid": "6e0c008717d458c568935bb05ffca064", "score": "0.41671327", "text": "func (t *helpCommand) showAll(match matcher.Result, message msg.Message) {\n\tt.once.Do(t.prebuildHelp)\n\n\tvar text string\n\n\ttext += \"Hello <@\" + message.User + \">, I’m your friendly slack-bot. You want me to show you around? :smile: \\n\"\n\ttext += \"I currently listen to the following commands:\\n\"\n\n\tlastCategory := bot.Category{}\n\tfor _, commandHelp := range t.sortedCommands {\n\t\t// print new category header\n\t\tif commandHelp.Category.Name != \"\" && lastCategory != commandHelp.Category {\n\t\t\tlastCategory = commandHelp.Category\n\t\t\ttext += t.printCategoryHeader(commandHelp)\n\t\t}\n\n\t\tif commandHelp.HelpURL != \"\" {\n\t\t\ttext += fmt.Sprintf(\"• <%s|%s>\", commandHelp.HelpURL, commandHelp.Command)\n\t\t} else {\n\t\t\ttext += fmt.Sprintf(\"• *%s*\", commandHelp.Command)\n\t\t}\n\t\tif commandHelp.Description != \"\" {\n\t\t\ttext += fmt.Sprintf(\" _(%s)_\", commandHelp.Description)\n\t\t}\n\t\ttext += \"\\n\"\n\t}\n\n\ttext += \"With *help <command>* I can provide you with more details!\"\n\tt.SendMessage(message, text)\n}", "title": "" }, { "docid": "95e215479d0fbc43e382902d17e1104a", "score": "0.41652492", "text": "func (c *Contents) PrintSummary(head int) {\n\tglog.Infof(\"Loaded from %s\\n\", c.filePath)\n\tglog.Infof(\" %s\\n\", &c.Fingerprint)\n\n\tglog.Infof(\" turn_durations meta %d count %d\\n\", c.TurnDurationsMeta, len(c.TurnDurations))\n\tfor i := 0; i < head && i < len(c.TurnDurations); i++ {\n\t\tglog.Infof(\" turn_durations[%d] %+v\", i, c.TurnDurations[i])\n\t}\n}", "title": "" }, { "docid": "3dfb3d570599515422cf354e1a74eb5f", "score": "0.41603416", "text": "func (cmd *Command) printUsage() {\n\tusage := `Displays shard level report.\n\nUsage: freets_inspect report [flags]\n\n -pattern <pattern>\n Include only files matching a pattern.\n -exact\n Report exact cardinality counts instead of estimates. Note: this can use a lot of memory.\n Defaults to \"false\".\n -detailed\n Report detailed cardinality estimates.\n Defaults to \"false\".\n`\n\n\tfmt.Fprintf(cmd.Stdout, usage)\n}", "title": "" }, { "docid": "d6898bcc3ec64ca3beeb1efdbad7d152", "score": "0.41559702", "text": "func (as *Step) SetSummary(value string) bool {\n\tif as.hasSummary {\n\t\tif as.Text[0] == value {\n\t\t\treturn false\n\t\t}\n\n\t\tas.Text[0] = value\n\t} else {\n\t\tas.Text = append(as.Text, \"\")\n\t\tcopy(as.Text[1:], as.Text)\n\t\tas.Text[0] = value\n\t\tas.hasSummary = true\n\t}\n\treturn true\n}", "title": "" }, { "docid": "ff8e190dfae1a9a82666daf54e777ae0", "score": "0.41502243", "text": "func showSummary(t0 time.Time) {\n\t//elapsed\n\tmsg := `\n\nVersion ` + pVersion + `\n\nBenchmarking is now in progress .... \n\nPlease be patient!\n\nStatistics :\n`\n\tfmt.Println(msg)\n\tfmt.Println()\n\th := strings.SplitN(pAppData.URLInfo.Host, \":\", 2)\n\tfmt.Println(\"Server Hostname:\", h[0])\n\tif len(h) > 1 {\n\t\tfmt.Println(\"Server Port :\", h[1])\n\t}\n\tfmt.Println(\"Document Path :\", pAppData.URLInfo.Path)\n\tfmt.Println(\"Request Method :\", pAppData.Method)\n\tfmt.Println()\n\tslist := pStats.getStatsList()\n\tfor k, v := range slist {\n\t\tfmt.Println(strings.TrimSpace(k), \": \", v)\n\t}\n\tt1 := time.Since(t0)\n\tpAppData.Elapsed = float64(t1.Nanoseconds()) / 1000000 //millis = nanos / 1,000,000\n\tfmt.Println(\"Elapsed : \", fmt.Sprintf(\"%.06f\", pAppData.Elapsed), \"( millisecs )\")\n\tfmt.Println(\"Requests: \", fmt.Sprintf(\"%.06f\", (float64(pAppData.Requests)*float64(1000))/float64(pAppData.Elapsed)), \"( # per sec )\")\n\tfmt.Println(\"App Time: \", t1.String())\n\tfmt.Println(\"Sys Time: \", time.Since(t0).String())\n}", "title": "" }, { "docid": "20ce4221fe84698ea49f5e1e28be73c3", "score": "0.41474184", "text": "func genUsage() *usage.Info {\n\tinfo := usage.NewInfo(\"\", \"recipe\")\n\n\tinfo.AppNameColorTag = \"{*}\" + colorTagApp\n\n\tinfo.AddOption(OPT_DRY_RUN, \"Parse and validate recipe\")\n\tinfo.AddOption(OPT_LIST_PACKAGES, \"List required packages\")\n\tinfo.AddOption(OPT_LIST_PACKAGES_FLAT, \"List required packages in one line {s-}(useful for scripts){!}\")\n\tinfo.AddOption(OPT_VARIABLES, \"List recipe variables\")\n\tinfo.AddOption(OPT_TIME, \"Print execution time for every action\")\n\tinfo.AddOption(OPT_FORMAT, \"Output format {s-}(tap13|tap14|json|xml){!}\", \"format\")\n\tinfo.AddOption(OPT_DIR, \"Path to working directory\", \"dir\")\n\tinfo.AddOption(OPT_PATH, \"Path to directory with binaries\", \"path\")\n\tinfo.AddOption(OPT_ERROR_DIR, \"Path to directory for errors data\", \"dir\")\n\tinfo.AddOption(OPT_TAG, \"One or more command tags to run\", \"tag\")\n\tinfo.AddOption(OPT_QUIET, \"Quiet mode\")\n\tinfo.AddOption(OPT_IGNORE_PACKAGES, \"Do not check system for installed packages\")\n\tinfo.AddOption(OPT_NO_CLEANUP, \"Disable deleting files created during tests\")\n\tinfo.AddOption(OPT_NO_COLOR, \"Disable colors in output\")\n\tinfo.AddOption(OPT_HELP, \"Show this help message\")\n\tinfo.AddOption(OPT_VER, \"Show version\")\n\n\tinfo.AddExample(\n\t\t\"app.recipe\",\n\t\t\"Run tests from app.recipe\",\n\t)\n\n\tinfo.AddExample(\n\t\t\"app.recipe --quiet --error-dir bibop-errors\",\n\t\t\"Run tests from app.recipe in quiet mode and save errors data to bibop-errors directory\",\n\t)\n\n\tinfo.AddExample(\n\t\t\"app.recipe --tag init,service\",\n\t\t\"Run tests from app.recipe and execute commands with tags init and service\",\n\t)\n\n\tinfo.AddExample(\n\t\t\"app.recipe --format json 1> ~/results/app.json\",\n\t\t\"Run tests from app.recipe and save result in JSON format\",\n\t)\n\n\tinfo.AddRawExample(\n\t\t\"sudo dnf install $(bibop app.recipe -L1)\",\n\t\t\"Install all packages required for tests\",\n\t)\n\n\treturn info\n}", "title": "" }, { "docid": "1bab74ce4743127f726ce407a3c28016", "score": "0.413978", "text": "func (m multiboot) description() (string, error) {\n\tvar modules []ModuleDesc\n\tfor i, mod := range m.loadedModules {\n\t\tb, err := uio.ReadAll(m.modules[i].Module)\n\t\tif err != nil {\n\t\t\treturn \"\", nil\n\t\t}\n\t\thash := sha256.Sum256(b)\n\t\tmodules = append(modules, ModuleDesc{\n\t\t\tStart: mod.Start,\n\t\t\tEnd: mod.End,\n\t\t\tCmdline: m.modules[i].Cmdline,\n\t\t\tSHA256: fmt.Sprintf(\"%x\", hash),\n\t\t})\n\n\t}\n\n\tb, err := json.Marshal(Description{\n\t\tStatus: \"ok\",\n\t\tFlags: uint32(m.info.Flags),\n\t\tMemLower: m.info.MemLower,\n\t\tMemUpper: m.info.MemUpper,\n\t\tMmapAddr: m.info.MmapAddr,\n\t\tMmapLength: m.info.MmapLength,\n\n\t\tCmdline: m.cmdLine,\n\t\tBootloader: m.bootloader,\n\n\t\tMmap: m.memoryMap(),\n\t\tModules: modules,\n\t})\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tb = bytes.Replace(b, []byte{'\\n'}, []byte{' '}, -1)\n\treturn string(b), nil\n}", "title": "" }, { "docid": "a30e26f510c3d34d9fc575edf98233d2", "score": "0.41386065", "text": "func randUse() string {\n\tif len(PluginsGo) == 0 {\n\t\treturn \"\"\n\t}\n\tpluginUses := PluginsGo[rand.Intn(len(PluginsGo))].Usage\n\tif pluginUses == nil || len(pluginUses) == 0 {\n\t\treturn \"\"\n\t}\n\treturn pluginUses[rand.Intn(len(pluginUses))]\n}", "title": "" }, { "docid": "5054580acf0f1b3bf33fb10b7189ffda", "score": "0.41385165", "text": "func (o *SupportCaseRequest) Summary() string {\n\tif o != nil && o.bitmap_&512 != 0 {\n\t\treturn o.summary\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "a800bb731f9d9dc2a2fb7653e2f52d69", "score": "0.41312408", "text": "func TestUsageSummary(t *testing.T) {\n\tctx, finish := tests.WithTestSpan(context.Background(), t)\n\tdefer finish()\n\tctx = WithClient(WithFakeAuth(ctx))\n\tassert := tests.Assert(ctx, t)\n\n\tstartMonth := time.Date(2019, 02, 02, 23, 0, 0, 0, time.UTC)\n\tendMonth := time.Date(2019, 02, 02, 23, 0, 0, 0, time.UTC)\n\tincludeOrgDetails := true\n\n\tfixturePath, err := filepath.Abs(\"fixtures/usage/usage_summary.json\")\n\tif err != nil {\n\t\tt.Errorf(\"Failed to get fixture file path: %s\", err)\n\t}\n\tdata, err := os.ReadFile(fixturePath)\n\tif err != nil {\n\t\tt.Errorf(\"Failed to open fixture file: %s\", err)\n\t}\n\n\t// The query params get normalized via autogenerated code, so just confirm that the keys exist in the request\n\tURL, err := Client(ctx).GetConfig().ServerURLWithContext(ctx, \"UsageMeteringApiService.GetUsageSummary\")\n\tassert.NoError(err)\n\tgock.New(URL).\n\t\tGet(\"/api/v1/usage/summary\").\n\t\tMatchParam(\"include_org_details\", strconv.FormatBool(includeOrgDetails)).\n\t\tParamPresent(\"end_month\").\n\t\tParamPresent(\"start_month\").\n\t\tReply(200).\n\t\tJSON(data)\n\tdefer gock.Off()\n\n\tvar expected datadogV1.UsageSummaryResponse\n\tjson.Unmarshal([]byte(data), &expected)\n\n\tapi := datadogV1.NewUsageMeteringApi(Client(ctx))\n\tusage, httpresp, err := api.GetUsageSummary(ctx, startMonth, *datadogV1.NewGetUsageSummaryOptionalParameters().WithEndMonth(endMonth).WithIncludeOrgDetails(includeOrgDetails))\n\tif err != nil {\n\t\tt.Errorf(\"Failed to get Usage Summary: %v\", err)\n\t}\n\tassert.Equal(200, httpresp.StatusCode)\n\tassert.Equal(time.Date(2019, 02, 02, 23, 0, 0, 0, time.UTC), usage.GetStartDate().UTC())\n\tassert.Equal(time.Date(2020, 02, 02, 23, 0, 0, 0, time.UTC), usage.GetEndDate().UTC())\n\tassert.Equal(int64(1), usage.GetApmHostTop99pSum())\n\tassert.Equal(int64(2), usage.GetInfraHostTop99pSum())\n\tassert.Equal(int64(1), usage.GetContainerHwmSum())\n\tassert.Equal(int64(4), usage.GetCustomTsSum())\n\tassert.Equal(int64(5), usage.GetRumSessionCountAggSum())\n\tassert.Equal(int64(6), usage.GetProfilingHostCountTop99pSum())\n\tassert.Equal(int64(7), usage.GetProfilingContainerAgentCountAvg())\n\tassert.Equal(int64(8), usage.GetTwolIngestedEventsBytesAggSum())\n\tassert.Equal(int64(9), usage.GetMobileRumSessionCountAggSum())\n\tassert.Equal(int64(10), usage.GetIncidentManagementMonthlyActiveUsersHwmSum())\n\tassert.Equal(int64(11), usage.GetMobileRumSessionCountIosAggSum())\n\tassert.Equal(int64(12), usage.GetMobileRumSessionCountAndroidAggSum())\n\tassert.Equal(int64(13), usage.GetRumTotalSessionCountAggSum())\n\tassert.Equal(int64(14), usage.GetAzureAppServiceTop99pSum())\n\tassert.Equal(int64(15), usage.GetApmAzureAppServiceHostTop99pSum())\n\n\tvar usageItem = usage.GetUsage()[0]\n\tassert.Equal(time.Date(2020, 02, 02, 23, 0, 0, 0, time.UTC), usageItem.GetDate().UTC())\n\tassert.Equal(int64(1), usageItem.GetAgentHostTop99p())\n\tassert.Equal(int64(2), usageItem.GetApmHostTop99p())\n\tassert.Equal(int64(3), usageItem.GetAwsHostTop99p())\n\tassert.Equal(int64(5), usageItem.GetContainerHwm())\n\tassert.Equal(int64(6), usageItem.GetCustomTsAvg())\n\tassert.Equal(int64(7), usageItem.GetGcpHostTop99p())\n\tassert.Equal(int64(8), usageItem.GetInfraHostTop99p())\n\tassert.Equal(int64(9), usageItem.GetRumSessionCountSum())\n\tassert.Equal(int64(10), usageItem.GetProfilingHostTop99p())\n\tassert.Equal(int64(11), usageItem.GetTwolIngestedEventsBytesSum())\n\tassert.Equal(int64(12), usageItem.GetMobileRumSessionCountSum())\n\tassert.Equal(int64(13), usageItem.GetIncidentManagementMonthlyActiveUsersHwm())\n\tassert.Equal(int64(14), usageItem.GetMobileRumSessionCountIosSum())\n\tassert.Equal(int64(15), usageItem.GetMobileRumSessionCountAndroidSum())\n\tassert.Equal(int64(16), usageItem.GetRumTotalSessionCountSum())\n\tassert.Equal(int64(17), usageItem.GetAzureAppServiceTop99p())\n\tassert.Equal(int64(18), usageItem.GetApmAzureAppServiceHostTop99p())\n\n\tvar usageOrgItem = usageItem.GetOrgs()[0]\n\tassert.Equal(\"1b\", usageOrgItem.GetId())\n\tassert.Equal(\"datadog\", usageOrgItem.GetName())\n\tassert.Equal(int64(1), usageOrgItem.GetAgentHostTop99p())\n\tassert.Equal(int64(2), usageOrgItem.GetApmHostTop99p())\n\tassert.Equal(int64(3), usageOrgItem.GetAwsHostTop99p())\n\tassert.Equal(int64(5), usageOrgItem.GetContainerHwm())\n\tassert.Equal(int64(6), usageOrgItem.GetCustomTsAvg())\n\tassert.Equal(int64(7), usageOrgItem.GetGcpHostTop99p())\n\tassert.Equal(int64(8), usageOrgItem.GetInfraHostTop99p())\n\tassert.Equal(int64(9), usageOrgItem.GetRumSessionCountSum())\n\tassert.Equal(int64(10), usageOrgItem.GetProfilingHostTop99p())\n\tassert.Equal(int64(11), usageOrgItem.GetTwolIngestedEventsBytesSum())\n\tassert.Equal(int64(12), usageOrgItem.GetMobileRumSessionCountSum())\n\tassert.Equal(int64(13), usageOrgItem.GetIncidentManagementMonthlyActiveUsersHwm())\n\tassert.Equal(int64(14), usageItem.GetMobileRumSessionCountIosSum())\n\tassert.Equal(int64(15), usageItem.GetMobileRumSessionCountAndroidSum())\n\tassert.Equal(int64(16), usageItem.GetRumTotalSessionCountSum())\n\tassert.Equal(int64(17), usageOrgItem.GetAzureAppServiceTop99p())\n\tassert.Equal(int64(18), usageOrgItem.GetApmAzureAppServiceHostTop99p())\n}", "title": "" }, { "docid": "0e80565b841b662d16b61273502c682b", "score": "0.41312212", "text": "func (blogPostSetters) Summary(v string) blogPostSetterArg {\n\treturn blogPostSetterArg{\n\t\tfield: \"summary\",\n\t\tvalue: v,\n\t}\n}", "title": "" }, { "docid": "e8e147147d103d0526c6a8d122f33283", "score": "0.4130183", "text": "func showAbout() {\n\tabout := &usage.About{\n\t\tApp: APP,\n\t\tVersion: VER,\n\t\tDesc: DESC,\n\t\tYear: 2006,\n\t\tOwner: \"ESSENTIAL KAOS\",\n\t\tLicense: \"Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0>\",\n\t\tUpdateChecker: usage.UpdateChecker{\"essentialkaos/source-index\", update.GitHubChecker},\n\t}\n\n\tabout.Render()\n}", "title": "" }, { "docid": "1180a4753af6a212509df96b2209d4dd", "score": "0.41263396", "text": "func (o LookupContactFlowModuleResultOutput) Description() pulumi.StringOutput {\n\treturn o.ApplyT(func(v LookupContactFlowModuleResult) string { return v.Description }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "aad6f614e2072fa5a8d5b33d6f1f1a15", "score": "0.41197243", "text": "func PrintModules() error {\n\n\tvar modules = `{{range .Commands}}` +\n\t\ttheme.Primary(\"\\n{{.Name}}\") + ` - ` + theme.Secondary(\"{{.Usage}}\") + `\n\n ` + theme.Primary(\"Usage:\") + ` {{if .UsageText}}{{.UsageText}}{{else}}{{.HelpName}}{{if .VisibleFlags}} [options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}{{end}}\n {{if .Aliases}}` + theme.Primary(\"Aliases:\") + ` {{join .Aliases \", \"}}{{end}}\n {{if .Category}}` + theme.Primary(\"Category:\") + ` {{.Category}}{{end}}{{if .Description}}\n\n` + theme.Section(\"Description\") + `\n{{.Description}}{{end}}{{if .VisibleFlags}}\n\n` + theme.Section(\"Options\") + `\n {{range .VisibleFlags}}` + theme.Flag(\"{{.}}\") + `\n {{end}}{{end}}` + \"\\n\\n\" + `{{end}}`\n\n\tvar commands []*Command\n\n\tfor _, m := range ActiveModules {\n\t\tcommands = append(commands, m.GetModuleCommands()...)\n\t}\n\n\tt := template.Must(template.New(\"modules\").Funcs(funcMap).Parse(modules))\n\n\terr := t.Execute(os.Stdout, Modules{commands})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "aa0612d9d9d111f5541e6a8b2ce9ab15", "score": "0.4112186", "text": "func (t *task) usageString(taskName string) string {\n\trw := color.YellowString(\"Usage:\\n \") + taskName\n\tif len(t.subtasks) > 0 {\n\t\trw += \" <subcommand>\"\n\t}\n\trw += \" [<options>]\"\n\tfor _, arg := range t.getOrderedArguments() {\n\t\trw += fmt.Sprintf(\" <%s>\", arg.Name)\n\t}\n\treturn rw\n}", "title": "" }, { "docid": "38f3883d950ba97de182b7845ed1bec9", "score": "0.4108102", "text": "func usage() {\n\t_, _ = fmt.Fprintf(os.Stderr, \"Please Use the module as : go run <filename>.go <URI>\\n\")\n}", "title": "" }, { "docid": "593794d6825d95c6e42e5a08e855716b", "score": "0.41075897", "text": "func printBriefSummaryAndGetError(succeeded, failed int, failNoOp bool, originalErr error) error {\n\terr := cliutils.PrintBriefSummaryReport(succeeded, failed, failNoOp, originalErr)\n\treturn cliutils.GetCliError(err, succeeded, failed, failNoOp)\n}", "title": "" } ]
21651e833a9acfb58db1a3daacf689d3
GetLocationOk returns a tuple with the Location field value if set, zero value otherwise and a boolean to check if the value has been set.
[ { "docid": "f4d8d13aab44cb86c7c1091fd59d6c04", "score": "0.7820875", "text": "func (o *DirectLinkInterfaces) GetLocationOk() (string, bool) {\n\tif o == nil || o.Location == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.Location, true\n}", "title": "" } ]
[ { "docid": "80980803f83716e188e1e841eb9e5e69", "score": "0.81621873", "text": "func (o *DatacenterProperties) GetLocationOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\n\treturn o.Location, true\n}", "title": "" }, { "docid": "1fc956fbcd482b1006adfe30d3e8cc11", "score": "0.7941339", "text": "func (o *UcsdUcsdRestoreParametersAllOf) GetLocationOk() (*string, bool) {\n\tif o == nil || o.Location == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Location, true\n}", "title": "" }, { "docid": "f27ed69b18f65809e8b241746bf391bd", "score": "0.7718159", "text": "func (o *ApplicationLoadBalancerHttpRule) GetLocationOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\n\treturn o.Location, true\n}", "title": "" }, { "docid": "c60c0e72eb9a5bd72fe6a9902c061c88", "score": "0.7357973", "text": "func (o *ValidationError) GetLocOk() (*[]string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Loc, true\n}", "title": "" }, { "docid": "30d3b73fc5229e45a0721d09f6bbba31", "score": "0.7174451", "text": "func (o *MicrosoftGraphUserSecurityState) GetLogonLocationOk() (string, bool) {\n\tif o == nil || o.LogonLocation == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.LogonLocation, true\n}", "title": "" }, { "docid": "916e94eeb78bff25586436cd26ae617d", "score": "0.7057064", "text": "func (o *Location) GetLatitudeOk() (*float32, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Latitude, true\n}", "title": "" }, { "docid": "c72273cbf96ec4f2e7448b5a8f44a46e", "score": "0.70265514", "text": "func (o *Location) GetLongitudeOk() (*float32, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Longitude, true\n}", "title": "" }, { "docid": "2484eaea0da7287f44c589b4ede24b50", "score": "0.6943358", "text": "func (o *Local) GetLatitudeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Latitude.Get(), o.Latitude.IsSet()\n}", "title": "" }, { "docid": "0cbcd9c8054620134c1de60cd79b07b4", "score": "0.68935025", "text": "func (o *Local) GetLongitudeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Longitude.Get(), o.Longitude.IsSet()\n}", "title": "" }, { "docid": "a58ece3c4325d09be790d22d637c6d0f", "score": "0.67974234", "text": "func (o *SyntheticPrivateLocationUpdate) GetLatitudeOk() (*float64, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Latitude, true\n}", "title": "" }, { "docid": "3dee7520fec679271d52d793c5bf1a60", "score": "0.67278576", "text": "func (o *MicrosoftGraphPerson) GetOfficeLocationOk() (string, bool) {\n\tif o == nil || o.OfficeLocation == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.OfficeLocation, true\n}", "title": "" }, { "docid": "a858ab60463eb37c204bf9d4250602fd", "score": "0.66051704", "text": "func (o *Image) GetFileLocationOk() (*string, bool) {\n\tif o == nil || o.FileLocation == nil {\n\t\treturn nil, false\n\t}\n\treturn o.FileLocation, true\n}", "title": "" }, { "docid": "79da0b21f543c260cbc878739e7a4a18", "score": "0.6570316", "text": "func (o *Model3rdPartySyntheticTestResult) GetLocationResultsOk() (*[]Model3rdPartySyntheticLocationTestResult, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.LocationResults, true\n}", "title": "" }, { "docid": "74fe690b7d5156e8c80a100e83a453f3", "score": "0.6498394", "text": "func (o *SyntheticPrivateLocationUpdate) GetLongitudeOk() (*float64, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Longitude, true\n}", "title": "" }, { "docid": "42a2e9b72f91f99e374cc6385c3b7839", "score": "0.6484073", "text": "func (o *SyntheticPrivateLocationUpdate) GetStatusOk() (*string, bool) {\n\tif o == nil || o.Status == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Status, true\n}", "title": "" }, { "docid": "8fbd03437f64b9920cab7e11becac31e", "score": "0.6478809", "text": "func (o *MicrosoftGraphDeviceGeoLocation) GetLatitudeOk() (AnyOfnumberstringstring, bool) {\n\tif o == nil || o.Latitude == nil {\n\t\tvar ret AnyOfnumberstringstring\n\t\treturn ret, false\n\t}\n\treturn *o.Latitude, true\n}", "title": "" }, { "docid": "1f179a39f8f18dc02b177f5f7ff51a0a", "score": "0.6477757", "text": "func (o *UcsdUcsdRestoreParametersAllOf) HasLocation() bool {\n\tif o != nil && o.Location != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "58edab2550a8c02da1c11b2b20ebce69", "score": "0.6438183", "text": "func (o *V2Monitor) GetLocationsOk() (*[]Monitoringv2Location, bool) {\n\tif o == nil || o.Locations == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Locations, true\n}", "title": "" }, { "docid": "de45442ddb48d8195106b01766a5d91f", "score": "0.6373302", "text": "func (o *SyntheticPublicLocationUpdate) GetStatusOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Status, true\n}", "title": "" }, { "docid": "e69536623a380de55636be862086c3b4", "score": "0.631575", "text": "func (o *EntityScreeningHitData) GetLocationsOk() (*[]GenericScreeningHitLocationItems, bool) {\n\tif o == nil || o.Locations == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Locations, true\n}", "title": "" }, { "docid": "8a34805e18dac1199c686e159883bafe", "score": "0.6293421", "text": "func (o *MicrosoftGraphWindowsPhone81GeneralConfiguration) GetLocationServicesBlockedOk() (bool, bool) {\n\tif o == nil || o.LocationServicesBlocked == nil {\n\t\tvar ret bool\n\t\treturn ret, false\n\t}\n\treturn *o.LocationServicesBlocked, true\n}", "title": "" }, { "docid": "cc35fa1f4dabfafb1814ec38ec3c826c", "score": "0.62395597", "text": "func (g *GeoIP2) HasLocation() (bool, error) {\n\tr, err := g.get(cityDB, \"\")\n\tif r != nil && err == nil {\n\t\treturn true, nil\n\t}\n\treturn false, err\n}", "title": "" }, { "docid": "6a74a861d96abe0e3758519eb43d00f5", "score": "0.6237535", "text": "func (o *SyntheticPublicLocationUpdateAllOf) GetStatusOk() (*string, bool) {\n\tif o == nil || o.Status == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Status, true\n}", "title": "" }, { "docid": "738f200b78345adc6a3b93d8d962c245", "score": "0.62305707", "text": "func (o *SyntheticPrivateLocationUpdate) GetCityOk() (*string, bool) {\n\tif o == nil || o.City == nil {\n\t\treturn nil, false\n\t}\n\treturn o.City, true\n}", "title": "" }, { "docid": "df136f4381174567c2a36e00575f7223", "score": "0.6212081", "text": "func (m *Photo) HasLocation() bool {\n\treturn !m.UnknownLocation()\n}", "title": "" }, { "docid": "219e9aabe20d976832c682463dbbd1b5", "score": "0.6189287", "text": "func (m *PingCheck) TestLocation() *WebsiteLocation {\n\treturn m.testLocationField\n}", "title": "" }, { "docid": "4938d3c480657d53961437fd4a2b557d", "score": "0.61556053", "text": "func (o *SyntheticsTriggerCITestsResponse) GetLocationsOk() (*[]SyntheticsTriggerCITestLocation, bool) {\n\tif o == nil || o.Locations == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Locations, true\n}", "title": "" }, { "docid": "c07060cdb4d4db1cf74ac14a150fb1d5", "score": "0.61552376", "text": "func (o *MicrosoftGraphDeviceGeoLocation) GetLongitudeOk() (AnyOfnumberstringstring, bool) {\n\tif o == nil || o.Longitude == nil {\n\t\tvar ret AnyOfnumberstringstring\n\t\treturn ret, false\n\t}\n\treturn *o.Longitude, true\n}", "title": "" }, { "docid": "3fcb450a9fbf595d452249a5b19a4fc4", "score": "0.615513", "text": "func (o *DatacenterProperties) HasLocation() bool {\n\tif o != nil && o.Location != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "5f7cc78be21e013a2d4671706fa866ab", "score": "0.6060132", "text": "func (o *SyntheticPrivateLocationUpdate) GetAvailabilityLocationOutageOk() (*bool, bool) {\n\tif o == nil || o.AvailabilityLocationOutage == nil {\n\t\treturn nil, false\n\t}\n\treturn o.AvailabilityLocationOutage, true\n}", "title": "" }, { "docid": "de75e086f16e7cbf3e5d00a4b1bf63cf", "score": "0.6040029", "text": "func (m *Photo) UnknownLocation() bool {\n\treturn m.LocationID == \"\" || m.LocationID == UnknownLocation.ID\n}", "title": "" }, { "docid": "4ded81b835525de4c31adab065557b47", "score": "0.60080326", "text": "func (o *PrivateSyntheticLocationAllOf) GetAvailabilityLocationOutageOk() (*bool, bool) {\n\tif o == nil || o.AvailabilityLocationOutage == nil {\n\t\treturn nil, false\n\t}\n\treturn o.AvailabilityLocationOutage, true\n}", "title": "" }, { "docid": "6464bb01d96824a9c741e293db2141ab", "score": "0.59824103", "text": "func (o *Component) GetPositionOk() (*int32, bool) {\n\tif o == nil || o.Position == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Position, true\n}", "title": "" }, { "docid": "863b3d00b66c146e4f7cecd52004fe04", "score": "0.5965937", "text": "func (o *MicrosoftGraphAndroidGeneralDeviceConfiguration) GetLocationServicesBlockedOk() (bool, bool) {\n\tif o == nil || o.LocationServicesBlocked == nil {\n\t\tvar ret bool\n\t\treturn ret, false\n\t}\n\treturn *o.LocationServicesBlocked, true\n}", "title": "" }, { "docid": "aa573fa34e9723edf298ed826d8de0ce", "score": "0.59437114", "text": "func (o *ApplicationLoadBalancerHttpRule) HasLocation() bool {\n\tif o != nil && o.Location != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "08789ea002cb737611b87bd6eaca0427", "score": "0.589929", "text": "func NewNowLocationOK(body *NowResponseBody) *locations.Location {\n\tv := &locations.Location{\n\t\tCountry: *body.Country,\n\t\tDate: *body.Date,\n\t\tTime: *body.Time,\n\t}\n\n\treturn v\n}", "title": "" }, { "docid": "c372b14339be879d2673e4de9ca4bbf8", "score": "0.58776003", "text": "func (p *Plane) HasLocation() bool {\n\tp.rwLock.RLock()\n\tdefer p.rwLock.RUnlock()\n\treturn p.location.hasLatLon\n}", "title": "" }, { "docid": "0d36c5278c4a63656becc4fa1b04914d", "score": "0.5850245", "text": "func (o *VerifyUserResponseDetails) GetAddressOk() (*string, bool) {\n\tif o == nil || o.Address == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Address, true\n}", "title": "" }, { "docid": "a12639422ec710e30a32ca2cbc4df84e", "score": "0.58480424", "text": "func HasLocation() predicate.SurveyCellScan {\n\treturn predicate.SurveyCellScan(func(s *sql.Selector) {\n\t\tstep := sqlgraph.NewStep(\n\t\t\tsqlgraph.From(Table, FieldID),\n\t\t\tsqlgraph.To(LocationTable, FieldID),\n\t\t\tsqlgraph.Edge(sqlgraph.M2O, false, LocationTable, LocationColumn),\n\t\t)\n\t\tsqlgraph.HasNeighbors(s, step)\n\t},\n\t)\n}", "title": "" }, { "docid": "b10ded7b5f9a46c39d73d3092f039292", "score": "0.58231515", "text": "func GetLocation(query string) (Location, bool) {\n\tres, err := http.Get(\"https://maps.google.com/maps/api/geocode/json?address=\" + query + \"&key=\" + os.Getenv(\"GOOGLE_API_KEY\"))\n\n\tif err != nil {\n\t\treturn Location{0, 0}, false\n\t}\n\n\tbody, err := ioutil.ReadAll(res.Body)\n\n\tif err != nil {\n\t\treturn Location{0, 0}, false\n\t}\n\n\tdefer res.Body.Close()\n\n\tjson := string(body)\n\n\tif !gjson.Get(json, \"results.0.geometry.location\").Exists() {\n\t\treturn Location{0, 0}, false\n\t}\n\n\tlocation := Location{\n\t\tLat: gjson.Get(json, \"results.0.geometry.location.lat\").Num,\n\t\tLng: gjson.Get(json, \"results.0.geometry.location.lng\").Num}\n\n\treturn location, true\n}", "title": "" }, { "docid": "2fd5c990af8636012fe7c5fb9df0f909", "score": "0.5822334", "text": "func (o *GetLocationsOK) IsSuccess() bool {\n\treturn true\n}", "title": "" }, { "docid": "1c2b7cfbbaf1344489bed07d9c37e9b5", "score": "0.57785445", "text": "func (o *VersionedProcessor) GetPositionOk() (*Position, bool) {\n\tif o == nil || o.Position == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Position, true\n}", "title": "" }, { "docid": "ef374c7eefbf51f6615bdb678a1db726", "score": "0.5771447", "text": "func (ef *EmptyField) GetLocation() (int, int) {\n\treturn ef.X, ef.Y\n}", "title": "" }, { "docid": "bcb26cc817975b93b1f7930d2754200b", "score": "0.57682616", "text": "func (o *RegisterDetails) GetAddressOk() (*[]string, bool) {\n\tif o == nil || o.Address == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Address, true\n}", "title": "" }, { "docid": "fb018aa8e1dccc339570737fb8be44e9", "score": "0.57451206", "text": "func HasLocation() predicate.Club {\n\treturn predicate.Club(func(s *sql.Selector) {\n\t\tstep := sqlgraph.NewStep(\n\t\t\tsqlgraph.From(Table, FieldID),\n\t\t\tsqlgraph.To(LocationTable, FieldID),\n\t\t\tsqlgraph.Edge(sqlgraph.M2O, true, LocationTable, LocationColumn),\n\t\t)\n\t\tsqlgraph.HasNeighbors(s, step)\n\t})\n}", "title": "" }, { "docid": "d9be31fc0b182672975720481ff79dad", "score": "0.57430524", "text": "func (m *BookingAppointment) GetIsLocationOnline()(*bool) {\n return m.isLocationOnline\n}", "title": "" }, { "docid": "6219d2c0036e368b73eb640c0be23941", "score": "0.57379526", "text": "func (o *SyntheticPrivateLocationUpdate) GetCountryCodeOk() (*string, bool) {\n\tif o == nil || o.CountryCode == nil {\n\t\treturn nil, false\n\t}\n\treturn o.CountryCode, true\n}", "title": "" }, { "docid": "4ddb3d3f17b143ce4a31d1e3af8dfff6", "score": "0.5695766", "text": "func (o *SendMigrationData) GetLocalOk() (*bool, bool) {\n\tif o == nil || o.Local == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Local, true\n}", "title": "" }, { "docid": "21853768fca56043a282ca0482cb39bb", "score": "0.56949323", "text": "func (o *MicrosoftGraphDeviceGeoLocation) GetHeadingOk() (AnyOfnumberstringstring, bool) {\n\tif o == nil || o.Heading == nil {\n\t\tvar ret AnyOfnumberstringstring\n\t\treturn ret, false\n\t}\n\treturn *o.Heading, true\n}", "title": "" }, { "docid": "7ac33b442033df016a829bfe3f2b479e", "score": "0.56865615", "text": "func HasLocation() predicate.Event {\n\treturn predicate.Event(func(s *sql.Selector) {\n\t\tstep := sqlgraph.NewStep(\n\t\t\tsqlgraph.From(Table, FieldID),\n\t\t\tsqlgraph.To(LocationTable, FieldID),\n\t\t\tsqlgraph.Edge(sqlgraph.M2O, false, LocationTable, LocationColumn),\n\t\t)\n\t\tsqlgraph.HasNeighbors(s, step)\n\t})\n}", "title": "" }, { "docid": "70a68f6d8023ddf401ad6e69b8907424", "score": "0.5681269", "text": "func (o *TransferEventListRequest) GetOffsetOk() (*int32, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Offset.Get(), o.Offset.IsSet()\n}", "title": "" }, { "docid": "38086a04da980a35c3bdcdb6a312d06e", "score": "0.5660434", "text": "func (m *Photo) LocationLoaded() bool {\n\tif m.Location == nil {\n\t\treturn false\n\t}\n\n\tif m.Location.Place == nil {\n\t\treturn false\n\t}\n\n\treturn !m.Location.Unknown() && m.Location.ID == m.LocationID\n}", "title": "" }, { "docid": "f6a003c2cbddc39e22c4e090322be6b4", "score": "0.56414837", "text": "func (o *UcsdUcsdRestoreParametersAllOf) GetLocation() string {\n\tif o == nil || o.Location == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Location\n}", "title": "" }, { "docid": "dcd153bdfd6c819f3703b0a3f2c53ea1", "score": "0.5624028", "text": "func (o *DirectLinkInterfaces) HasLocation() bool {\n\tif o != nil && o.Location != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "77008d6258b515bfe8a2677be5582026", "score": "0.56145537", "text": "func (o *VersionedRemoteGroupPort) GetPositionOk() (*Position, bool) {\n\tif o == nil || o.Position == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Position, true\n}", "title": "" }, { "docid": "ff2b283e2379f9ca5e797eb721b0b45b", "score": "0.5614317", "text": "func (o *ControllerServiceDTO) GetPositionOk() (*PositionDTO, bool) {\n\tif o == nil || o.Position == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Position, true\n}", "title": "" }, { "docid": "b0c048067c8527f47f53a5882a3d44d6", "score": "0.560521", "text": "func (o *Merchant) GetAddressOk() (*Address, bool) {\n\tif o == nil || o.Address == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Address, true\n}", "title": "" }, { "docid": "1b92ce091cfbb36c538c1fbbb28dce9f", "score": "0.56039596", "text": "func (o *StorageSasPort) GetAddressOk() (*string, bool) {\n\tif o == nil || o.Address == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Address, true\n}", "title": "" }, { "docid": "bd64fb14fb195d816d4c9dad085e3b43", "score": "0.55687714", "text": "func (m *SurveyWiFiScanMutation) LocationID() (id int, exists bool) {\n\tif m.location != nil {\n\t\treturn *m.location, true\n\t}\n\treturn\n}", "title": "" }, { "docid": "f7e108bc9d4d12e08000c0191c554e2e", "score": "0.55677", "text": "func (o *TransferUserInRequestDeprecated) GetAddressOk() (*TransferUserAddressInRequest, bool) {\n\tif o == nil || o.Address == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Address, true\n}", "title": "" }, { "docid": "e0e44e9c3134058df0c47b2a2131be84", "score": "0.55639714", "text": "func (me *XsdGoPkgHasElem_NormalizedLocationsequenceTxsdDegreeUserAreaDegreeUserAreaschema_NormalizedLocation_TLocationType_) Walk() (err error) {\n\tif fn := WalkHandlers.XsdGoPkgHasElem_NormalizedLocationsequenceTxsdDegreeUserAreaDegreeUserAreaschema_NormalizedLocation_TLocationType_; me != nil {\n\t\tif fn != nil {\n\t\t\tif err = fn(me, true); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif err = me.NormalizedLocation.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif fn != nil {\n\t\t\tif err = fn(me, false); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "c98278806b20d29fc0372418812d39e5", "score": "0.55559534", "text": "func (o *IdentityVerificationUserData) GetAddressOk() (*IdentityVerificationUserAddress, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Address.Get(), o.Address.IsSet()\n}", "title": "" }, { "docid": "08ec45b80a538d62e6e2b40c6b7aa122", "score": "0.5554255", "text": "func (o Offset) NorthOk() (float64, bool) {\n\tif o.north != \"\" {\n\t\treturn o.North, true\n\t}\n\treturn 0.0, false\n}", "title": "" }, { "docid": "574013d13576c81629ccdecc2aeee180", "score": "0.5536266", "text": "func (o *GroupAddress) GetStateOk() (*string, bool) {\n\tif o == nil || o.State == nil {\n\t\treturn nil, false\n\t}\n\treturn o.State, true\n}", "title": "" }, { "docid": "570721e128809119e1344d7e2cf46625", "score": "0.55337536", "text": "func (o *HyperflexSummary) GetAddressOk() (*string, bool) {\n\tif o == nil || o.Address == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Address, true\n}", "title": "" }, { "docid": "25e94cc6cb3290c03c63739135d77b60", "score": "0.55294585", "text": "func (gid GoogleID) StatusLocation() (string, string, error) {\n\te, _ := gid.EnlID()\n\tlat, lon, err := e.StatusLocation()\n\treturn lat, lon, err\n}", "title": "" }, { "docid": "f2b851360c0d5d0c1920a37066cd96c3", "score": "0.55171794", "text": "func (o *NodeSearchResultDTO) GetAddressOk() (*string, bool) {\n\tif o == nil || o.Address == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Address, true\n}", "title": "" }, { "docid": "11773f085ab5782e88552ed98befd25d", "score": "0.55157286", "text": "func (gid GoogleID) StatusLocation() (string, string, error) {\n\te, err := gid.EnlID()\n\tif err != nil {\n\t\tLog.Error(err)\n\t\treturn \"\", \"\", err\n\t}\n\tlat, lon, err := e.StatusLocation()\n\treturn lat, lon, err\n}", "title": "" }, { "docid": "11773f085ab5782e88552ed98befd25d", "score": "0.55157286", "text": "func (gid GoogleID) StatusLocation() (string, string, error) {\n\te, err := gid.EnlID()\n\tif err != nil {\n\t\tLog.Error(err)\n\t\treturn \"\", \"\", err\n\t}\n\tlat, lon, err := e.StatusLocation()\n\treturn lat, lon, err\n}", "title": "" }, { "docid": "d6a0cc75c7082b86b2cf074e1f6e7c5c", "score": "0.5514289", "text": "func IsValidLoc(l string) (DirectiveLocation_Loc, bool) {\n\tiLoc, ok := DirectiveLocation_Loc_value[l]\n\treturn DirectiveLocation_Loc(iLoc), ok\n}", "title": "" }, { "docid": "7f71d77fb001926ef342d77bd0bd2906", "score": "0.5505863", "text": "func (lp *LuaProvider) GetLocation(L *lua.LState) int {\n\tA := lp.provider.GetLocation(L.CheckString(1))\n\tuserDefinedA := L.NewUserData()\n\tuserDefinedA.Value = A\n\tL.SetMetatable(userDefinedA, L.GetTypeMetatable(\"dl.Location\"))\n\tL.Push(userDefinedA)\n\treturn 1\n}", "title": "" }, { "docid": "ffbc0114e4607d99311dc892331bcb5c", "score": "0.5499914", "text": "func (o *SyntheticPrivateLocationUpdate) GetRegionCodeOk() (*string, bool) {\n\tif o == nil || o.RegionCode == nil {\n\t\treturn nil, false\n\t}\n\treturn o.RegionCode, true\n}", "title": "" }, { "docid": "574c6e1ec5ae52270743ba85e2d6606e", "score": "0.5497832", "text": "func (o *ProcessorDTO) GetPositionOk() (*PositionDTO, bool) {\n\tif o == nil || o.Position == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Position, true\n}", "title": "" }, { "docid": "51ded5f1d3dfe23b9f5dec3d4105224a", "score": "0.54896086", "text": "func (o *MortgageLiability) GetPropertyAddressOk() (*MortgagePropertyAddress, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.PropertyAddress, true\n}", "title": "" }, { "docid": "60cc702b8155e438b02b9812b9be432d", "score": "0.5488895", "text": "func (o Offset) EastOk() (float64, bool) {\n\tif o.east != \"\" {\n\t\treturn o.East, true\n\t}\n\treturn 0.0, false\n}", "title": "" }, { "docid": "010f7f95dec6e3b67d2cdcb94f3cab85", "score": "0.5478513", "text": "func (user *User) ValidateLocationAccess() bool {\n\n\tuser.Error = \"\"\n\n\t// define validation of each field of the purchase request\n\terr := validation.ValidateStruct(user,\n\t\tvalidation.Field(&user.IDUser, validation.Required),\n\t\tvalidation.Field(&user.GFKLocation, validation.Required),\n\t)\n\n\t// add potential error text to user.Error\n\tif err != nil {\n\t\tuser.Error = err.Error()\n\t}\n\n\t// return true if no error, false otherwise\n\treturn user.Error == \"\"\n}", "title": "" }, { "docid": "7f056bb6561b60ddc35be77451b27b97", "score": "0.54741675", "text": "func (o *PrivateSyntheticLocationAllOf) GetLocationNodeOutageDelayInMinutesOk() (*int32, bool) {\n\tif o == nil || o.LocationNodeOutageDelayInMinutes == nil {\n\t\treturn nil, false\n\t}\n\treturn o.LocationNodeOutageDelayInMinutes, true\n}", "title": "" }, { "docid": "453daf76d6667abdeac0d98eb797d4d6", "score": "0.54538095", "text": "func (o *SyntheticPrivateLocationUpdate) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "title": "" }, { "docid": "ec4fce268618e93222ee7c49dbe4e88b", "score": "0.54523677", "text": "func (o *AddressList) GetLocalityOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Locality, true\n}", "title": "" }, { "docid": "7515b711235f57e73036b172eb866c35", "score": "0.5446269", "text": "func (o *Ga4ghPatient) GetUpdatedOk() (string, bool) {\n\tif o == nil || o.Updated == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.Updated, true\n}", "title": "" }, { "docid": "2dd05d70f4c304efad83854fb23b2db7", "score": "0.54413694", "text": "func (p Point) ElevationOk() (float64, bool) {\n\tif p.elevation != \"\" {\n\t\treturn p.Elevation, true\n\t}\n\treturn 0.0, false\n}", "title": "" }, { "docid": "a05f29130c0edba73ee2c2e984492310", "score": "0.54295737", "text": "func (m *SurveyCellScanMutation) LocationID() (id int, exists bool) {\n\tif m.location != nil {\n\t\treturn *m.location, true\n\t}\n\treturn\n}", "title": "" }, { "docid": "7ff90ab45cfd87b6142069396a97a67a", "score": "0.5418917", "text": "func (o *Ga4ghStudy) GetUpdatedOk() (string, bool) {\n\tif o == nil || o.Updated == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.Updated, true\n}", "title": "" }, { "docid": "9f6f088137c26f3c5b9e30a2a588e1f8", "score": "0.54065555", "text": "func (o *Local) GetUsrOk() (*int64, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Usr.Get(), o.Usr.IsSet()\n}", "title": "" }, { "docid": "d87b5a8d1ac570b0802cfe8ea27bb3e2", "score": "0.53988045", "text": "func (eid EnlID) StatusLocation() (string, string, error) {\n\tif !vc.configured {\n\t\treturn \"\", \"\", fmt.Errorf(\"the V API key not configured\")\n\t}\n\turl := fmt.Sprintf(\"%s/%s?apikey=%s\", vc.StatusEndpoint, eid, vc.APIKey)\n\treq, err := http.NewRequest(\"GET\", url, nil)\n\tif err != nil {\n\t\tLog.Error(err)\n\t\treturn \"\", \"\", err\n\t}\n\tclient := &http.Client{\n\t\tTimeout: GetTimeout(3 * time.Second),\n\t}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tLog.Error(err)\n\t\treturn \"\", \"\", err\n\t}\n\n\tdefer resp.Body.Close()\n\tbody, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\tLog.Error(err)\n\t\treturn \"\", \"\", err\n\t}\n\n\tvar stat statusResponse\n\terr = json.Unmarshal(body, &stat)\n\tif err != nil {\n\t\tLog.Error(err)\n\t\treturn \"\", \"\", err\n\t}\n\tif stat.Status != 0 {\n\t\terr := fmt.Errorf(\"polling %s returned message: %s\", eid, stat.Message)\n\t\t_ = eid.StatusLocationDisable()\n\t\treturn \"\", \"\", err\n\t}\n\treturn stat.Lat, stat.Lon, nil\n}", "title": "" }, { "docid": "d87b5a8d1ac570b0802cfe8ea27bb3e2", "score": "0.53988045", "text": "func (eid EnlID) StatusLocation() (string, string, error) {\n\tif !vc.configured {\n\t\treturn \"\", \"\", fmt.Errorf(\"the V API key not configured\")\n\t}\n\turl := fmt.Sprintf(\"%s/%s?apikey=%s\", vc.StatusEndpoint, eid, vc.APIKey)\n\treq, err := http.NewRequest(\"GET\", url, nil)\n\tif err != nil {\n\t\tLog.Error(err)\n\t\treturn \"\", \"\", err\n\t}\n\tclient := &http.Client{\n\t\tTimeout: GetTimeout(3 * time.Second),\n\t}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tLog.Error(err)\n\t\treturn \"\", \"\", err\n\t}\n\n\tdefer resp.Body.Close()\n\tbody, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\tLog.Error(err)\n\t\treturn \"\", \"\", err\n\t}\n\n\tvar stat statusResponse\n\terr = json.Unmarshal(body, &stat)\n\tif err != nil {\n\t\tLog.Error(err)\n\t\treturn \"\", \"\", err\n\t}\n\tif stat.Status != 0 {\n\t\terr := fmt.Errorf(\"polling %s returned message: %s\", eid, stat.Message)\n\t\t_ = eid.StatusLocationDisable()\n\t\treturn \"\", \"\", err\n\t}\n\treturn stat.Lat, stat.Lon, nil\n}", "title": "" }, { "docid": "0ca5fe945f2e4b840e677634099546a7", "score": "0.53978723", "text": "func (o *TransferOriginatorAddress) GetCityOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.City, true\n}", "title": "" }, { "docid": "da4190e1a05be58f1aa1bd2becccb2ea", "score": "0.5385291", "text": "func (m *SurveyMutation) LocationID() (id int, exists bool) {\n\tif m.location != nil {\n\t\treturn *m.location, true\n\t}\n\treturn\n}", "title": "" }, { "docid": "78c16afe5071d58754bf5013969970e0", "score": "0.53851414", "text": "func NewGetLocationsOK() *GetLocationsOK {\n\treturn &GetLocationsOK{}\n}", "title": "" }, { "docid": "cd95e83284e8ddd2c686800df4cb04bd", "score": "0.5384597", "text": "func (o *MicrosoftGraphDeviceGeoLocation) GetAltitudeOk() (AnyOfnumberstringstring, bool) {\n\tif o == nil || o.Altitude == nil {\n\t\tvar ret AnyOfnumberstringstring\n\t\treturn ret, false\n\t}\n\treturn *o.Altitude, true\n}", "title": "" }, { "docid": "92bfc43961aa9d8379c3f196afb3b592", "score": "0.5383423", "text": "func (o *Retro) GetCityOk() (*string, bool) {\n\tif o == nil || o.City == nil {\n\t\treturn nil, false\n\t}\n\treturn o.City, true\n}", "title": "" }, { "docid": "97c307950b5049745b9ecae1957a36d4", "score": "0.5381233", "text": "func (o *WorkbookChartLegend) GetPositionOk() (string, bool) {\n\tif o == nil || o.Position == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.Position, true\n}", "title": "" }, { "docid": "90f77c63a6ae310804b8a078407105d1", "score": "0.5381231", "text": "func (o *Room) GetRecordOk() (*bool, bool) {\n\tif o == nil || o.Record == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Record, true\n}", "title": "" }, { "docid": "c03992eecb88d3bbd5eeb107529aaa64", "score": "0.5375929", "text": "func (eid EnlID) StatusLocation() (string, string, error) {\n\tif !vc.configured {\n\t\treturn \"\", \"\", errors.New(\"the V API key not configured\")\n\t}\n\turl := fmt.Sprintf(\"%s/%s?apikey=%s\", vc.statusEndpoint, eid, vc.vAPIKey)\n\treq, err := http.NewRequest(\"GET\", url, nil)\n\tif err != nil {\n\t\tLog.Error(err)\n\t\treturn \"\", \"\", err\n\t}\n\tclient := &http.Client{\n\t\tTimeout: 3 * time.Second,\n\t}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tLog.Error(err)\n\t\treturn \"\", \"\", err\n\t}\n\n\tdefer resp.Body.Close()\n\tbody, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\tLog.Error(err)\n\t\treturn \"\", \"\", err\n\t}\n\n\tvar stat statusResponse\n\terr = json.Unmarshal(body, &stat)\n\tif err != nil {\n\t\tLog.Error(err)\n\t\treturn \"\", \"\", err\n\t}\n\tif stat.Status != 0 {\n\t\terr := fmt.Errorf(\"polling %s returned message: %s\", eid, stat.Message)\n\t\teid.StatusLocationDisable()\n\t\treturn \"\", \"\", err\n\t}\n\treturn stat.Lat, stat.Lon, nil\n}", "title": "" }, { "docid": "ffc859b04b22888bb16825fe68c4a7c5", "score": "0.5374111", "text": "func (o *DnsViewDataData) GetServerAddrOk() (*string, bool) {\n\tif o == nil || o.ServerAddr == nil {\n\t\treturn nil, false\n\t}\n\treturn o.ServerAddr, true\n}", "title": "" }, { "docid": "c4e63642def2d9ae029071feb97e6de6", "score": "0.5362698", "text": "func (o *GroupAddress) GetCityOk() (*string, bool) {\n\tif o == nil || o.City == nil {\n\t\treturn nil, false\n\t}\n\treturn o.City, true\n}", "title": "" }, { "docid": "8622758b371df7757da3c44f33bbbd46", "score": "0.5356188", "text": "func (o *Position) GetDataOk() (*[]PositionData, bool) {\n\tif o == nil || o.Data == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Data, true\n}", "title": "" }, { "docid": "a986cef7ad7d7a1ecf483a13947ce1c4", "score": "0.53544575", "text": "func (o *AccountIdentityMatchScore) GetAddressOk() (*AddressMatchScore, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Address.Get(), o.Address.IsSet()\n}", "title": "" }, { "docid": "c76ea4291c2be2c0a5664e2cbfa5fd7f", "score": "0.53430057", "text": "func (o *DatacenterProperties) GetLocation() *string {\n\tif o == nil {\n\t\treturn nil\n\t}\n\n\treturn o.Location\n\n}", "title": "" }, { "docid": "d4c75fabf4e40f38e98993bce7f5bbe0", "score": "0.5342837", "text": "func GetLocation() *time.Location {\n\tif location == nil {\n\t\tlocation, _ = time.LoadLocation(\"EST\")\n\t}\n\treturn location\n}", "title": "" } ]
c9039886c5c3c112d4d8392e2cdb473a
Field function returns field value.
[ { "docid": "8ed3de0cd55383f64e573031a0aea3e2", "score": "0.0", "text": "func (e VerifyEmailRequestValidationError) Field() string { return e.field }", "title": "" } ]
[ { "docid": "45a1a54f9b6120393a1fa0eefe579cdc", "score": "0.72376895", "text": "func (f *Field) Value() interface{} {\n\tpieces := strings.Split(f.Name, \".\")\n\tanswer, ok := f.renderArgs[pieces[0]]\n\tif !ok {\n\t\treturn \"\"\n\t}\n\n\tval := reflect.ValueOf(answer)\n\tfor i := 1; i < len(pieces); i++ {\n\t\tif val.Kind() == reflect.Ptr {\n\t\t\tval = val.Elem()\n\t\t}\n\t\tval = val.FieldByName(pieces[i])\n\t\tif !val.IsValid() {\n\t\t\treturn \"\"\n\t\t}\n\t}\n\n\treturn val.Interface()\n}", "title": "" }, { "docid": "1385970047b33d5fe356e0debcab6709", "score": "0.7018743", "text": "func (v *field) Val() string {\n\treturn v.val\n}", "title": "" }, { "docid": "5c2c595b1530d880f7f8ae4db091e47e", "score": "0.6947914", "text": "func (f *field) getter() (v string) {\n\t// find owner\n\towner := util.FindOwner(reflect.ValueOf(f.root), f.fullname)\n\tif owner.Kind() != reflect.Struct {\n\t\tlog.Warnf(\"get field[%v] failed, can't find owner Struct\", f.fullname)\n\t\treturn\n\t}\n\t// check it's real Get method\n\tm := owner.Addr().MethodByName(\"Get\" + f.name)\n\tif m.Kind() == reflect.Func && m.Type().NumIn() == 0 && m.Type().NumOut() == 1 && core.ParseQType(m.Type().Out(0)) == f.qtype {\n\t\tresults := m.Call([]reflect.Value{})\n\t\tv = util.ToString(results[0].Interface())\n\t} else {\n\t\tfieldV := owner.FieldByName(f.name)\n\t\tv = util.ToString(fieldV.Interface())\n\t}\n\t// update cache\n\tf.cache = &v\n\treturn\n}", "title": "" }, { "docid": "99417eca3440ac451c97506ef138c3b0", "score": "0.6883265", "text": "func Field(f string) ProcFunc {\n\treturn func(p Proc) error {\n\t\treturn p.Consume(func(v interface{}) error {\n\t\t\tval, err := FieldOf(v, f)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn p.Send(val)\n\t\t})\n\t}\n}", "title": "" }, { "docid": "00d7495980401a76713afb2163d22c4a", "score": "0.67803067", "text": "func (e DataRateIndexValueValidationError) Field() string { return e.field }", "title": "" }, { "docid": "765f7f8085d4b989c49ab2b17dfd1d69", "score": "0.67499834", "text": "func (ff Field) GetValue() interface{} {\n\tif ff.embedded != nil {\n\t\treturn ff.embedded.GetValue()\n\t}\n\n\tif checkVal(ff.Value) {\n\t\treturn ff.Value.Interface()\n\t}\n\n\treturn \"undefinied value\"\n}", "title": "" }, { "docid": "6b383d0fc92c6054059cd6fab8e6c1fb", "score": "0.6732567", "text": "func (m *reflector) GetValue(field *Field) {\n\tif rField, ok := m.lookUpRField(field, false); ok {\n\t\tif rField.Kind() == reflect.Ptr {\n\t\t\tif !rField.IsNil() {\n\t\t\t\tfield.Value = rField.Elem().Interface()\n\t\t\t}\n\t\t} else {\n\t\t\tfield.Value = rField.Interface()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1fc74a133dfa4fe078af373e6dc0299c", "score": "0.6727054", "text": "func (tp *TypedParamInt) Field() string {\n\treturn tp.Fld\n}", "title": "" }, { "docid": "46d2ddaf9ad5c70f414a9ef3a897f3d6", "score": "0.67250234", "text": "func (v Value) Field(i int) Value", "title": "" }, { "docid": "4c043f85eb75d37834465e2394cd0792", "score": "0.6722595", "text": "func (t Term) Field(args ...interface{}) Term {\n\treturn constructMethodTerm(t, \"Field\", p.Term_GET_FIELD, args, map[string]interface{}{})\n}", "title": "" }, { "docid": "bb115de08604ed234579563c36a81982", "score": "0.67199653", "text": "func (e LuaValidationError) Field() string { return e.field }", "title": "" }, { "docid": "35fdb67d3770ab193dd5a2a89ea78a85", "score": "0.6713575", "text": "func (v Value) Field(f StructField) (Value, error) {\n\tif _, ok := v.Type.(*StructType); !ok {\n\t\tpanic(fmt.Sprintf(\"bad type for Value.Field(): %s (%T)\", v.Type, v.Type))\n\t}\n\tv, err := v.typedSlice(f.Offset, f.Type)\n\tif err != nil {\n\t\treturn Value{}, fmt.Errorf(\"error reading field %s.%s, type %s: %v\", v.Type, f.Name, f.Type, err)\n\t}\n\treturn v, nil\n}", "title": "" }, { "docid": "3a901a63156d742b3c08604c16cbc8ca", "score": "0.6710654", "text": "func (f *fieldLevelMock) Field() reflect.Value {\n\treturn f.field\n}", "title": "" }, { "docid": "4af924ba6e8a24bae16854a0940d7a3e", "score": "0.6689969", "text": "func (e DataRateOffsetValueValidationError) Field() string { return e.field }", "title": "" }, { "docid": "d06eb6ce73a3187d32c300ffa6a5943d", "score": "0.6654321", "text": "func (v Value) FieldByName(name string) Value", "title": "" }, { "docid": "23ff0e3e06cc6c06c085dddd56c6888d", "score": "0.66371346", "text": "func (tp *TypedParamULongLong) Field() string {\n\treturn tp.Fld\n}", "title": "" }, { "docid": "d8bbc06725286f5318a4936431cc3be0", "score": "0.66269475", "text": "func (e DeviceEIRPValueValidationError) Field() string { return e.field }", "title": "" }, { "docid": "18922f58423905af6c1554d1316508c5", "score": "0.66188216", "text": "func (e GetPolicyRequestValidationError) Field() string { return e.field }", "title": "" }, { "docid": "f2f56b88d57d78bdc8180ae601e143dd", "score": "0.66127515", "text": "func (e MoneyValidationError) Field() string { return e.field }", "title": "" }, { "docid": "f2139fd7e9d5944410a050f0062210e3", "score": "0.66083837", "text": "func (e GetResponseValidationError) Field() string { return e.field }", "title": "" }, { "docid": "3c61ee40b9ab114173924e5c18b7fc07", "score": "0.6607129", "text": "func (e ReadRequestValidationError) Field() string { return e.field }", "title": "" }, { "docid": "090bdd680c71f79c8e0ee25391089fd3", "score": "0.66065294", "text": "func (e AggregatedDutyCycleValueValidationError) Field() string { return e.field }", "title": "" }, { "docid": "017cb8b0b0c1e82dd6a07dc094edde4e", "score": "0.66029125", "text": "func (c *expressionCompiler) Field(f *criteria.FieldExpression) interface{} {\n\tif strings.Contains(f.FieldName, `\"`) {\n\t\tc.err = append(c.err, errs.Errorf(\"field name must not contain double quotes: %s\", f.FieldName))\n\t\treturn nil\n\t}\n\tif strings.Contains(f.FieldName, `'`) {\n\t\tc.err = append(c.err, errs.Errorf(\"field name must not contain single quotes: %s\", f.FieldName))\n\t\treturn nil\n\t}\n\n\tmappedFieldName, isJSONField := c.getFieldName(f.FieldName)\n\n\t// Check if this field is referencing joinable data\n\tfor _, j := range c.joins {\n\t\tif j.HandlesFieldName(mappedFieldName) {\n\t\t\tj.Active = true\n\t\t\tcol, err := j.TranslateFieldName(mappedFieldName)\n\t\t\tif err != nil {\n\t\t\t\tc.err = append(c.err, errs.Wrapf(err, `failed to translate field \"%s\"`, mappedFieldName))\n\t\t\t}\n\t\t\treturn col // e.g. \"iter.name\"\n\t\t}\n\t}\n\n\tif !isJSONField {\n\t\treturn mappedFieldName\n\t}\n\tif strings.Contains(mappedFieldName, \"'\") {\n\t\t// beware of injection, it's a reasonable restriction for field names,\n\t\t// make sure it's not allowed when creating wi types\n\t\tc.err = append(c.err, errs.Errorf(\"single quote not allowed in field name: %s\", mappedFieldName))\n\t\treturn nil\n\t}\n\n\t// default to plain json field (e.g. for ID comparisons)\n\treturn Column(WorkItemStorage{}.TableName(), \"fields\") + ` @> '{\"` + mappedFieldName + `\"`\n}", "title": "" }, { "docid": "d993917b65cb3a7c983d7f3801949466", "score": "0.6597024", "text": "func (p *Preparer) getValueForField(r Renderer, field reflect.StructField) (reflect.Value, error) {\n\t// get the field name for use in future lookups\n\tname := p.getFieldName(field)\n\traw, isSet := p.Source[name]\n\n\t// validate that the param is present, if required\n\tif err := p.validateRequired(field, raw); err != nil {\n\t\treturn reflect.Zero(field.Type), err\n\t}\n\n\t// return a default type if nothing is set. No need to do any conversions or\n\t// anything in this case, we're simply returning the zero value of the field.\n\tif !isSet {\n\t\treturn reflect.Zero(field.Type), nil\n\t}\n\n\t// now that we know the field is present, we can make sure it's not\n\t// violating any mutual exclusion constraints\n\tif err := p.validateMutuallyExclusive(field); err != nil {\n\t\treturn reflect.Zero(field.Type), err\n\t}\n\n\t// get the base for numeric conversion, if present\n\tbase, err := p.getBase(field)\n\tif err != nil {\n\t\treturn reflect.Zero(field.Type), err\n\t}\n\n\t// finally after all those checks we can deserialize the value of the field\n\t// from the interface{}!\n\tvalue, err := p.convertValue(field.Type, r, name, raw, base)\n\tif err != nil {\n\t\treturn value, err\n\t}\n\n\t// validate results\n\tif err := p.validateValidValues(field, r, base, value); err != nil {\n\t\treturn reflect.Zero(field.Type), err\n\t}\n\n\treturn value, nil\n}", "title": "" }, { "docid": "b11990f2f0b604cbbc2e3650a40eff31", "score": "0.6595707", "text": "func (e GetPolicyReqValidationError) Field() string { return e.field }", "title": "" }, { "docid": "de4e22ffd96c8e6ccbba7decdb33800d", "score": "0.6588594", "text": "func FieldValue(index interface{}, source_arg ...interface{}) (zret string) {\n\n\tvar r *odbc.Row\n\tzret = \"\"\n\tzfromcursor := false\n\tzname := \"\"\n\tvar source interface{}\n\n\tif len(source_arg) == 0 {\n\t\tsource = Alias()\n\t} else {\n\t\tsource = source_arg[0]\n\t}\n\n\tswitch source.(type) {\n\tcase *odbc.Row:\n\t\tr = source.(*odbc.Row)\n\tcase string:\n\t\tzname = source.(string)\n\t\tr = GCursor[zname].Data[Recno(zname)-1]\n\t\tzfromcursor = true\n\tdefault:\n\t\tr = nil\n\t}\n\n\tk := -1\n\n\tif zfromcursor {\n\t\tswitch index.(type) {\n\t\tcase string:\n\t\t\tk = FieldIndex(index.(string), zname)\n\t\tdefault:\n\t\t\tk = int(Val(fmt.Sprintf(\"%v\", index)))\n\n\t\t}\n\t} else {\n\t\tk = int(Val(fmt.Sprintf(\"%v\", index)))\n\t}\n\n\tif r != nil {\n\t\tzret = fmt.Sprintf(\"%v\", r.Get(k))\n\t}\n\t//zret = \"\"\n\t//switch t {\n\t//case -9:\n\t//\tzret = r.GetString(k)\n\t//case -11:\n\t//\tzret = string(r.Get(k).([]byte))\n\t//case 4:\n\t//\tzret = Transform(r.GetInt(k))\n\t//case 2:\n\t//\tzret = Transform(r.Get(k).([]uint8))\n\t//case 6:\n\t//\tzret = Transform(r.Get(k).(float64))\n\n\t//case 93:\n\t//\tzret = Transform(r.Get(k).(time.Time))\n\t//default:\n\t//\tzret = r.GetString(k)\n\t//}\n\treturn\n}", "title": "" }, { "docid": "a7c420b6fb0c00e0b0d3688e67deec6e", "score": "0.6574765", "text": "func (f *StructField) Value() interface{} {\n\treturn f.value.Interface()\n}", "title": "" }, { "docid": "05e9ec3eb1536ead1fddffcee30c048c", "score": "0.65706336", "text": "func (e LuaPerRouteValidationError) Field() string { return e.field }", "title": "" }, { "docid": "ccf849c4e633b98da2a02d6e8afb7eb2", "score": "0.6564606", "text": "func (e LocalValidationError) Field() string { return e.field }", "title": "" }, { "docid": "33d562b694db771b0f7144d0b3bec257", "score": "0.65610546", "text": "func (e DataplaneValidationError) Field() string { return e.field }", "title": "" }, { "docid": "73ce0a99287864d9c3511b2e881791cf", "score": "0.65602475", "text": "func (e DataRequestValidationError) Field() string { return e.field }", "title": "" }, { "docid": "8f69f888737ace3f58f7d53e8bac7982", "score": "0.6558899", "text": "func (e GetTaskResponseValidationError) Field() string { return e.field }", "title": "" }, { "docid": "b39187e2e54332046a188d22ffe12051", "score": "0.65572274", "text": "func (e DataResponseValidationError) Field() string { return e.field }", "title": "" }, { "docid": "84adc910fcabec22a602a3b37ce3834c", "score": "0.6556211", "text": "func (e GetRateSnapshotRequestValidationError) Field() string { return e.field }", "title": "" }, { "docid": "3c90dac69342a7c5038ae0fe08f613ae", "score": "0.6554933", "text": "func (e NodeResultValidationError) Field() string { return e.field }", "title": "" }, { "docid": "00a55c8b240159fdc99c37aac4968d82", "score": "0.6554738", "text": "func (e DataValidationError) Field() string { return e.field }", "title": "" }, { "docid": "e8ea91b1420018187cf873f7b5288239", "score": "0.6551856", "text": "func (tp *TypedParamString) Field() string {\n\treturn tp.Fld\n}", "title": "" }, { "docid": "fcfad910e6ed2eb27cd5239738346a8a", "score": "0.6550822", "text": "func (e GetCloudResponseValidationError) Field() string { return e.field }", "title": "" }, { "docid": "365c2c2bf5aea2416ba2e458b5aabedc", "score": "0.6548569", "text": "func (m *JDModelMutation) Field(name string) (ent.Value, bool) {\n\tswitch name {\n\tcase jdmodel.FieldName:\n\t\treturn m.Name()\n\tcase jdmodel.FieldNickname:\n\t\treturn m.Nickname()\n\tcase jdmodel.FieldPassword:\n\t\treturn m.Password()\n\tcase jdmodel.FieldEmail:\n\t\treturn m.Email()\n\tcase jdmodel.FieldIDNumber:\n\t\treturn m.IDNumber()\n\tcase jdmodel.FieldPhoneNumber:\n\t\treturn m.PhoneNumber()\n\t}\n\treturn nil, false\n}", "title": "" }, { "docid": "e322f7841b29ff716ea5c7f6fddd8718", "score": "0.6541177", "text": "func OutputField(field fieldtype.FieldTyper) interface{} {\n\tvalue := field.FieldValue()\n\tdef := fieldtype.GetDef(field.Type())\n\tif def.HasVariable {\n\t\t//todo: implement washing variable\n\t}\n\treturn value\n}", "title": "" }, { "docid": "b099eeb2f00058e410e7e60d34547a17", "score": "0.65352005", "text": "func (m *TodoMutation) Field(name string) (ent.Value, bool) {\n\tswitch name {\n\tcase todo.FieldTask:\n\t\treturn m.Task()\n\tcase todo.FieldStatus:\n\t\treturn m.Status()\n\t}\n\treturn nil, false\n}", "title": "" }, { "docid": "cfb916c20f20e80e77da3472f48397a3", "score": "0.653476", "text": "func (e GetCloudRequestValidationError) Field() string { return e.field }", "title": "" }, { "docid": "93bbee614751fe9f4041b8d1d62216b9", "score": "0.6534754", "text": "func (e GetAccountRequestValidationError) Field() string { return e.field }", "title": "" }, { "docid": "d5117cbce647b93caa15afe248785b20", "score": "0.65340173", "text": "func (e GetVPCCidrRequestValidationError) Field() string { return e.field }", "title": "" }, { "docid": "f8c7ae73ef7e31ce560272e543d3695c", "score": "0.6533504", "text": "func (e DataRateValidationError) Field() string { return e.field }", "title": "" }, { "docid": "d52cdaaba047ba31037142abb12a8546", "score": "0.6531563", "text": "func (f *File) Field(field PDFieldFlag, git *GitStatus) string {\n\tswitch field {\n\tcase PFieldINode:\n\t\treturn cast.ToString(f.INode())\n\tcase PFieldPermissions:\n\t\treturn f.Permission()\n\tcase PFieldLinks:\n\t\treturn cast.ToString(f.NLinks())\n\tcase PFieldSize:\n\t\treturn ByteSize(f.Size)\n\tcase PFieldBlocks:\n\t\treturn cast.ToString(f.Blocks())\n\tcase PFieldUser:\n\t\treturn f.User()\n\tcase PFieldGroup:\n\t\treturn f.Group()\n\tcase PFieldModified:\n\t\treturn DateString(f.ModifiedTime())\n\tcase PFieldCreated:\n\t\treturn DateString(f.CreatedTime())\n\tcase PFieldAccessed:\n\t\treturn DateString(f.AccessedTime())\n\tcase PFieldGit:\n\t\treturn f.GitXYs(git)\n\tcase PFieldMd5:\n\t\treturn f.GetMd5()\n\tcase PFieldName:\n\t\treturn f.Name()\n\tdefault:\n\t\treturn \"\"\n\t}\n}", "title": "" }, { "docid": "dc180e263d2ce4d4cbd4d1ddb0dedaa5", "score": "0.6530649", "text": "func (e GetTaskRequestValidationError) Field() string { return e.field }", "title": "" }, { "docid": "bcc5b179d4d6f2c91677bf99b4e9b523", "score": "0.65296245", "text": "func (m *SFModelMutation) Field(name string) (ent.Value, bool) {\n\tswitch name {\n\tcase sfmodel.FieldName:\n\t\treturn m.Name()\n\tcase sfmodel.FieldPhoneNumber:\n\t\treturn m.PhoneNumber()\n\tcase sfmodel.FieldAddress:\n\t\treturn m.Address()\n\t}\n\treturn nil, false\n}", "title": "" }, { "docid": "7548fae502cb488d5ff0b832fd4d51aa", "score": "0.65201104", "text": "func (e RuntimeUInt32ValidationError) Field() string { return e.field }", "title": "" }, { "docid": "18db7c5c3bdf955885bd7921129cbbff", "score": "0.6515389", "text": "func (e QueryResultValidationError) Field() string { return e.field }", "title": "" }, { "docid": "cf012ef07df1f866dd96b65eb3bb8205", "score": "0.6513286", "text": "func (e LoRaDataRateValidationError) Field() string { return e.field }", "title": "" }, { "docid": "e0f9c8ac6856dc846b09b73d056ff787", "score": "0.65044445", "text": "func (e PolicyIDValidationError) Field() string { return e.field }", "title": "" }, { "docid": "5f1cc3f7b06fc656f7ef2c24fc4b0f9f", "score": "0.65028626", "text": "func (m *UserMutation) Field(name string) (ent.Value, bool) {\n\tswitch name {\n\tcase user.FieldAccountID:\n\t\treturn m.AccountID()\n\tcase user.FieldCreatedAt:\n\t\treturn m.CreatedAt()\n\tcase user.FieldUpdatedAt:\n\t\treturn m.UpdatedAt()\n\t}\n\treturn nil, false\n}", "title": "" }, { "docid": "013ef9b16849184d4550602e48d960b5", "score": "0.6501439", "text": "func (e RetrieveRequestValidationError) Field() string { return e.field }", "title": "" }, { "docid": "ddc32ecfac854d089e021d02ec81bba1", "score": "0.6501361", "text": "func (m *TransactionMutation) Field(name string) (ent.Value, bool) {\n\tswitch name {\n\tcase transaction.FieldCreatedAt:\n\t\treturn m.CreatedAt()\n\t}\n\treturn nil, false\n}", "title": "" }, { "docid": "6ec47f8fc74a1584381dadd1cc37ee05", "score": "0.6497266", "text": "func (e ThingResponseValidationError) Field() string { return e.field }", "title": "" }, { "docid": "46663e7044c0e54120ca18009637b32d", "score": "0.6497241", "text": "func (e SingleTaskResponseValidationError) Field() string { return e.field }", "title": "" }, { "docid": "eb4eb304c903c53ba18a4c9a9868a6f5", "score": "0.6495785", "text": "func (e CloudValidationError) Field() string { return e.field }", "title": "" }, { "docid": "d34f963f7a93c6b7b49a57accaf1986e", "score": "0.64953214", "text": "func (e GetDatasetRequestValidationError) Field() string { return e.field }", "title": "" }, { "docid": "8b6ffb00d311c977219d070348511bf7", "score": "0.64919424", "text": "func (e GetAccountResponseValidationError) Field() string { return e.field }", "title": "" }, { "docid": "6819d44684f30acb4843d808a3ad3d63", "score": "0.64872956", "text": "func (e HeaderValueValidationError) Field() string { return e.field }", "title": "" }, { "docid": "b64fdb92bcaaad1079d819b1ee02a2de", "score": "0.6484727", "text": "func FieldByValue(table, fieldName, where string, db *mcb.DB) (fieldValue string) {\n\n\tsql := fmt.Sprintf(\"SELECT %v FROM `%v` WHERE %v;\", fieldName, table, where)\n\tpRes := db.Query(sql)\n\n\trows := pRes.GetRows()\n\tfor _, row := range rows {\n\n\t\tfor key := range row {\n\t\t\tfieldValue = fmt.Sprintf(\"%v\", row[key])\n\t\t\treturn\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "3d4f47966674aba3c8555bd0295d9976", "score": "0.6481063", "text": "func (e GetLatestRateSnapshotRequestValidationError) Field() string { return e.field }", "title": "" }, { "docid": "0dc2d7860eb897a762f081529b470ef3", "score": "0.6478628", "text": "func (e VPCCidrValidationError) Field() string { return e.field }", "title": "" }, { "docid": "bb1858fae2571d134c10791b847a1dc8", "score": "0.64777863", "text": "func (e MetaValidationError) Field() string { return e.field }", "title": "" }, { "docid": "15f60fe0eb55b173bfcf15f0c0800b73", "score": "0.64771736", "text": "func (c *Context) FieldValue() string {\n\treturn c.value\n}", "title": "" }, { "docid": "016ba3bf4daa62764fcd8b02d9266c70", "score": "0.6474897", "text": "func (e AccountIDValidationError) Field() string { return e.field }", "title": "" }, { "docid": "01982fcc3974a9df09764dcfb09c8baa", "score": "0.6471593", "text": "func (m *AccessControlMutation) Field(name string) (ent.Value, bool) {\n\tswitch name {\n\tcase accesscontrol.FieldServiceID:\n\t\treturn m.ServiceID()\n\tcase accesscontrol.FieldOpenAuth:\n\t\treturn m.OpenAuth()\n\tcase accesscontrol.FieldBlackList:\n\t\treturn m.BlackList()\n\tcase accesscontrol.FieldWhiteList:\n\t\treturn m.WhiteList()\n\tcase accesscontrol.FieldWhiteHostName:\n\t\treturn m.WhiteHostName()\n\tcase accesscontrol.FieldClientipFlowLimit:\n\t\treturn m.ClientipFlowLimit()\n\tcase accesscontrol.FieldServiceFlowLimit:\n\t\treturn m.ServiceFlowLimit()\n\t}\n\treturn nil, false\n}", "title": "" }, { "docid": "5a0a35c2e2b7db677fe33405c50c8418", "score": "0.64698243", "text": "func (m *ShortMutation) Field(name string) (ent.Value, bool) {\n\tswitch name {\n\tcase short.FieldKey:\n\t\treturn m.Key()\n\tcase short.FieldValue:\n\t\treturn m.Value()\n\t}\n\treturn nil, false\n}", "title": "" }, { "docid": "7b018d8e263195f5cd4f2d949941b563", "score": "0.6469531", "text": "func (e GetProjectResponseValidationError) Field() string { return e.field }", "title": "" }, { "docid": "d228ede40a6d739402fac16a21359b04", "score": "0.6459741", "text": "func (e GetPolicyVersionReqValidationError) Field() string { return e.field }", "title": "" }, { "docid": "0729150e42ef65277cf840091c404fa3", "score": "0.6459688", "text": "func (e FrequencyValueValidationError) Field() string { return e.field }", "title": "" }, { "docid": "754bf697f4b88d334b1125506d010743", "score": "0.6459558", "text": "func (e GetVPCCidrResponseValidationError) Field() string { return e.field }", "title": "" }, { "docid": "3054a5c381880ab8883efc44aa82d21b", "score": "0.6458977", "text": "func Field(fld reflect.StructField) *FieldAccessor {\n\treturn &FieldAccessor{fld}\n}", "title": "" }, { "docid": "cef9a1398177c30aeab45e148b11ffe1", "score": "0.6458059", "text": "func (e GetBusinessRequestValidationError) Field() string { return e.field }", "title": "" }, { "docid": "b8ecdccfd81975d97baa5f06d4d70ac5", "score": "0.6457012", "text": "func (e GetTransactionRequestValidationError) Field() string { return e.field }", "title": "" }, { "docid": "f85ff0de13a034d32b397c2757707444", "score": "0.64556843", "text": "func (e BotValidationError) Field() string { return e.field }", "title": "" }, { "docid": "80ea75e5a85af79b879065e9d1277839", "score": "0.6455584", "text": "func (e FSKDataRateValidationError) Field() string { return e.field }", "title": "" }, { "docid": "9dd90c9b27b3c0994413497224ce6fa7", "score": "0.64534867", "text": "func (e PolicyRefValidationError) Field() string { return e.field }", "title": "" }, { "docid": "6214ce2aea4b6fb0d0dc34da24b58b28", "score": "0.6452482", "text": "func (e SingleTaskRequestValidationError) Field() string { return e.field }", "title": "" }, { "docid": "23b6371f21a917980c6f95474c71d637", "score": "0.6449707", "text": "func (deb *debugger) fieldValue(indent tab, id typeId) {\n\t_, ok := builtinIdToType[id]\n\tif ok {\n\t\tif id == tInterface {\n\t\t\tdeb.interfaceValue(indent)\n\t\t} else {\n\t\t\tdeb.printBuiltin(indent, id)\n\t\t}\n\t\treturn\n\t}\n\twire, ok := deb.wireType[id]\n\tif !ok {\n\t\terrorf(\"type id %d not defined\", id)\n\t}\n\tswitch {\n\tcase wire.ArrayT != nil:\n\t\tdeb.arrayValue(indent, wire)\n\tcase wire.MapT != nil:\n\t\tdeb.mapValue(indent, wire)\n\tcase wire.SliceT != nil:\n\t\tdeb.sliceValue(indent, wire)\n\tcase wire.StructT != nil:\n\t\tdeb.structValue(indent, id)\n\tcase wire.GobEncoderT != nil:\n\t\tdeb.gobEncoderValue(indent, id)\n\tdefault:\n\t\tpanic(\"bad wire type for field\")\n\t}\n}", "title": "" }, { "docid": "93ef142f0f6aceb79f13c00f9afbd9f7", "score": "0.64492655", "text": "func (e ManageDelieverResultValidationError) Field() string { return e.field }", "title": "" }, { "docid": "6b55aafeb0f16d3d02c978c239261567", "score": "0.6448349", "text": "func (e GetNodeResponseValidationError) Field() string { return e.field }", "title": "" }, { "docid": "6a0ad8f18045444d1866948c856c4e52", "score": "0.6446914", "text": "func (e PropertyResponseValidationError) Field() string { return e.field }", "title": "" }, { "docid": "dca00a135cc2ab1be1cfe47414833835", "score": "0.64459103", "text": "func (h *DynMsgHelper) GetFieldValue(msg *dynamic.Message, fld *desc.FieldDescriptor) (ok bool, value string, err error) {\n\tfor _, fg := range h.opts.fieldValueGetters {\n\t\tok, value, err = fg.GetFieldValue(msg, fld)\n\t\tif err != nil {\n\t\t\treturn false, \"\", err\n\t\t}\n\t\tif ok {\n\t\t\treturn true, value, nil\n\t\t}\n\t}\n\treturn false, \"\", nil\n}", "title": "" }, { "docid": "2a9dbf1e4bd5214c61d3f8d810f5120e", "score": "0.64387774", "text": "func (e CalculateFeeCosmosSpecificValidationError) Field() string { return e.field }", "title": "" }, { "docid": "e281095c19469d950e16c17ff9d9f7fd", "score": "0.64350635", "text": "func (e RunnerValidationError) Field() string { return e.field }", "title": "" }, { "docid": "1dc72f4b6aa85321a6d6762035bd8aa5", "score": "0.6434218", "text": "func (e GetBusinessResponseValidationError) Field() string { return e.field }", "title": "" }, { "docid": "39e686a8e6b97fa55ded1bae7cfbabaf", "score": "0.6434015", "text": "func (e MonitorRespValidationError) Field() string { return e.field }", "title": "" }, { "docid": "44dabdd90d1bacddc9fc233dd06f6c43", "score": "0.6433416", "text": "func (e GetPolicyVersionRespValidationError) Field() string { return e.field }", "title": "" }, { "docid": "15f6d49766fe28b0e1542222167e2152", "score": "0.6430315", "text": "func (e CsvResponseValidationError) Field() string { return e.field }", "title": "" }, { "docid": "efeb141e896cb1ae5666fcb8647629d7", "score": "0.6430042", "text": "func (e GetRecommendedFeeRateResponseValidationError) Field() string { return e.field }", "title": "" }, { "docid": "1d1ea91dad36ed8ae84f187f3cc090ac", "score": "0.6429934", "text": "func (e GetUserResponseValidationError) Field() string { return e.field }", "title": "" }, { "docid": "08b3f7c60454706a8102715dfb6b5cc2", "score": "0.6426373", "text": "func (e Dataplane_Networking_InboundValidationError) Field() string { return e.field }", "title": "" }, { "docid": "d65354d3155e1268e3489448fbdcdb4b", "score": "0.6425678", "text": "func (m *TagMutation) Field(name string) (ent.Value, bool) {\n\tswitch name {\n\tcase tag.FieldTag:\n\t\treturn m.Tag()\n\t}\n\treturn nil, false\n}", "title": "" }, { "docid": "5f26f309cd5eea863856dce95868a1ae", "score": "0.64235526", "text": "func (e GetEquipmentResponseValidationError) Field() string { return e.field }", "title": "" }, { "docid": "2d680b7bd9731268032801ed7bd11617", "score": "0.64229524", "text": "func (m *ProjectMutation) Field(name string) (ent.Value, bool) {\n\tswitch name {\n\tcase project.FieldDescription:\n\t\treturn m.Description()\n\tcase project.FieldName:\n\t\treturn m.Name()\n\tcase project.FieldClientid:\n\t\treturn m.Clientid()\n\tcase project.FieldUserid:\n\t\treturn m.Userid()\n\tcase project.FieldMandantid:\n\t\treturn m.Mandantid()\n\tcase project.FieldStatus:\n\t\treturn m.Status()\n\tcase project.FieldTags:\n\t\treturn m.Tags()\n\tcase project.FieldTeam:\n\t\treturn m.Team()\n\t}\n\treturn nil, false\n}", "title": "" }, { "docid": "2187bd08807f04a1a5f2dff60624aead", "score": "0.64226323", "text": "func (e SomeStringResponseValidationError) Field() string { return e.field }", "title": "" }, { "docid": "f10ee1cff0003fcc85052b1af76ea3a8", "score": "0.64224744", "text": "func (m *UserMutation) Field(name string) (ent.Value, bool) {\n\tswitch name {\n\tcase user.FieldAge:\n\t\treturn m.Age()\n\tcase user.FieldName:\n\t\treturn m.Name()\n\t}\n\treturn nil, false\n}", "title": "" }, { "docid": "0775c3649caf17736c47976d26cb24b6", "score": "0.64218575", "text": "func (e GetProjectRequestValidationError) Field() string { return e.field }", "title": "" }, { "docid": "6c762b2d872f65464cc4428ca1f55d83", "score": "0.64205796", "text": "func (e GetEquipmentRequestValidationError) Field() string { return e.field }", "title": "" } ]
a922f8c6ce86da6b9baa952399526558
/ convert this to byte array
[ { "docid": "827b49944ec2b5f1d4cd6c89755bd064", "score": "0.0", "text": "func (F *FP12) ToBytes(w []byte) {\n\tvar t [int(MODBYTES)]byte\n\tMB := int(MODBYTES)\n\tF.a.geta().GetA().ToBytes(t[:])\n\tfor i := 0; i < MB; i++ {\n\t\tw[i] = t[i]\n\t}\n\tF.a.geta().GetB().ToBytes(t[:])\n\tfor i := 0; i < MB; i++ {\n\t\tw[i+MB] = t[i]\n\t}\n\tF.a.getb().GetA().ToBytes(t[:])\n\tfor i := 0; i < MB; i++ {\n\t\tw[i+2*MB] = t[i]\n\t}\n\tF.a.getb().GetB().ToBytes(t[:])\n\tfor i := 0; i < MB; i++ {\n\t\tw[i+3*MB] = t[i]\n\t}\n\n\tF.b.geta().GetA().ToBytes(t[:])\n\tfor i := 0; i < MB; i++ {\n\t\tw[i+4*MB] = t[i]\n\t}\n\tF.b.geta().GetB().ToBytes(t[:])\n\tfor i := 0; i < MB; i++ {\n\t\tw[i+5*MB] = t[i]\n\t}\n\tF.b.getb().GetA().ToBytes(t[:])\n\tfor i := 0; i < MB; i++ {\n\t\tw[i+6*MB] = t[i]\n\t}\n\tF.b.getb().GetB().ToBytes(t[:])\n\tfor i := 0; i < MB; i++ {\n\t\tw[i+7*MB] = t[i]\n\t}\n\n\tF.c.geta().GetA().ToBytes(t[:])\n\tfor i := 0; i < MB; i++ {\n\t\tw[i+8*MB] = t[i]\n\t}\n\tF.c.geta().GetB().ToBytes(t[:])\n\tfor i := 0; i < MB; i++ {\n\t\tw[i+9*MB] = t[i]\n\t}\n\tF.c.getb().GetA().ToBytes(t[:])\n\tfor i := 0; i < MB; i++ {\n\t\tw[i+10*MB] = t[i]\n\t}\n\tF.c.getb().GetB().ToBytes(t[:])\n\tfor i := 0; i < MB; i++ {\n\t\tw[i+11*MB] = t[i]\n\t}\n}", "title": "" } ]
[ { "docid": "7e7fece7c726dabd6d273ea7d99922fe", "score": "0.6695419", "text": "func ToByteArr(v interface{}) []byte {\n\tresult := []byte(\"\")\n\tif v == nil {\n\t\treturn result\n\t}\n\n\tswitch v.(type) {\n\tcase string:\n\t\tresult = []byte(v.(string))\n\tcase int:\n\t\tresult = []byte(strconv.Itoa(v.(int)))\n\tcase int64:\n\t\tresult = []byte(strconv.FormatInt(v.(int64), 10))\n\tcase bool:\n\t\tresult = []byte(strconv.FormatBool(v.(bool)))\n\tcase float64:\n\t\tresult = []byte(strconv.FormatFloat(v.(float64), 'E', -1, 64))\n\tcase []uint8:\n\t\tresult = v.([]uint8)\n\tdefault:\n\t\tresultJSON, err := json.Marshal(v)\n\t\tif err == nil {\n\t\t\tresult = resultJSON\n\t\t} else {\n\t\t\tlog.Println(\"func ToByteArr\", err)\n\t\t}\n\t}\n\n\treturn result\n}", "title": "" }, { "docid": "f2766e3e8207c619711da785252b8ca7", "score": "0.6456562", "text": "func (b Bitvector8) Bytes() []byte {\n\tif len(b) == 0 {\n\t\treturn []byte{}\n\t}\n\tif len(b) > bitvector8ByteSize {\n\t\tret := make([]byte, bitvector8ByteSize)\n\t\tcopy(ret, b[:bitvector8ByteSize])\n\t\treturn ret[:]\n\t}\n\treturn b\n}", "title": "" }, { "docid": "c558010854738898047eaea671743de7", "score": "0.6403442", "text": "func (self *Buffer) Bytes() []byte { return self.buf }", "title": "" }, { "docid": "a574294ee48e3ff12b0cbcfb5549ff7f", "score": "0.63996017", "text": "func (h *Handle) ToByteArray() ([]byte, error) {\n\n\th.Lock()\n\tdefer h.Unlock()\n\tba := make([]byte, 16)\n\tbinary.BigEndian.PutUint64(ba[0:], h.bits)\n\tbinary.BigEndian.PutUint64(ba[8:], h.unselected)\n\tbm, err := h.head.toByteArray()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to serialize head: %s\", err.Error())\n\t}\n\tba = append(ba, bm...)\n\n\treturn ba, nil\n}", "title": "" }, { "docid": "ec9db061c1a69c3b84c21d7365e94ce2", "score": "0.63864386", "text": "func (b *ProtocolWritter) Bytes() []byte { return b.buf[:] }", "title": "" }, { "docid": "200f508fbb7a3b50e1fb2eaefca59e5a", "score": "0.6369607", "text": "func (s *sequence) toByteArray() ([]byte, error) {\n\tvar bb []byte\n\n\tp := s\n\tfor p != nil {\n\t\tb := make([]byte, 12)\n\t\tbinary.BigEndian.PutUint32(b[0:], p.block)\n\t\tbinary.BigEndian.PutUint64(b[4:], p.count)\n\t\tbb = append(bb, b...)\n\t\tp = p.next\n\t}\n\n\treturn bb, nil\n}", "title": "" }, { "docid": "1889c373272503d43b7ebc6f745c2140", "score": "0.63562685", "text": "func toBytes(i interface{}) []byte {\n\tbuf := new(bytes.Buffer)\n\terr := binary.Write(buf, binary.LittleEndian, i)\n\tif err != nil {\n\t\tfmt.Printf(\"Error converting to byte slice: %v\", err)\n\t}\n\treturn buf.Bytes()\n}", "title": "" }, { "docid": "c0d68f34efb6b5f7e3e0a7a12a0c1320", "score": "0.6319444", "text": "func (b *Buffer) Bytes() []byte { return b.data }", "title": "" }, { "docid": "7b2fefa74b547792897e9c71b1f75a2f", "score": "0.6309556", "text": "func (k * Keyspace) toBytes() []byte {\n\tx := make([]byte, k.length)\n\tfor idx, value := range k.current {\n x[idx]=k.space[value]\n }\n return x\n}", "title": "" }, { "docid": "08fc58d3c144122786cb66b58bad1778", "score": "0.6225371", "text": "func (self Address) Bytes() []byte {\n\treturn self[:]\n}", "title": "" }, { "docid": "d40b1e6b48a2613063171897756eae4b", "score": "0.6222609", "text": "func (b Base64Bytes) Bytes() []byte {\n\treturn []byte(b)\n}", "title": "" }, { "docid": "077047458b6c6b0586f2208276eeefa1", "score": "0.6208825", "text": "func (obj *ByteArrayEntity) ToBytes() ([]byte, types.TGError) {\n\tvar encodedMsg bytes.Buffer\n\tencoder := gob.NewEncoder(&encodedMsg)\n\terr := encoder.Encode(obj)\n\t//err := interfaceEncode(encoder, obj)\n\tif err != nil {\n\t\tlogger.Error(fmt.Sprintf(\"ERROR: Returning ByteArrayEntity:ToBytes - unable to write entity in byte format w/ Error: '%+v'\", err.Error()))\n\t\terrMsg := fmt.Sprintf(\"Unable to convert message '%+v' in byte format\", obj)\n\t\treturn nil, exception.GetErrorByType(types.TGErrorIOException, types.INTERNAL_SERVER_ERROR, errMsg, \"\")\n\t}\n\t//logger.Log(fmt.Sprintf(\"Message: %v bytes <--encoded-- %v\", encodedMsg.Len(), m)\n\treturn encodedMsg.Bytes(), nil\n}", "title": "" }, { "docid": "80eb93594900519e938548d0cf40c7fc", "score": "0.61922306", "text": "func (r *Signature) ToBytes() (data []byte) {\n\t// I.X + I.Y + C + S[size]\n\tdata = append(data, r.ImageToBytes()...)\n\tdata = append(data, etmath.PaddedBigBytes(r.C, 32)...)\n\tfor _, s := range r.S {\n\t\tdata = append(data, etmath.PaddedBigBytes(s, 32)...)\n\t}\n\treturn\n}", "title": "" }, { "docid": "a7b73dc690a1b314a3b4adc2057de41d", "score": "0.615545", "text": "func (self *Block) Bytes() []byte {\n\treturn encoder.Serialize(*self)\n}", "title": "" }, { "docid": "cf2295a0785599ce5215e03b7ced96bd", "score": "0.6153063", "text": "func (b *WriteBuffer) ToByteSlice() []byte {\n\tb.mu.Lock()\n\tdefer b.mu.Unlock()\n\n\treturn b.inner.ToByteSlice()\n}", "title": "" }, { "docid": "04644900754705c7157c053b8b532213", "score": "0.61362576", "text": "func (a *AsmBuf) Bytes() []byte", "title": "" }, { "docid": "aacc6039dde241608b8b00df484c0402", "score": "0.61312306", "text": "func Bytes(any mem.Any) []byte { return any.Segment().Data() }", "title": "" }, { "docid": "0c421c5796444e8cb1d505a6c136b99a", "score": "0.6093772", "text": "func (a Address) Bytes() []byte { return a[:] }", "title": "" }, { "docid": "754129128ed2fb220b9171689d6bac4c", "score": "0.609145", "text": "func (app *adapter) ToBytes(key Key) []byte {\n\tpubKey := key.Key()\n\treturn x509.MarshalPKCS1PublicKey(&pubKey)\n}", "title": "" }, { "docid": "9c247ed3890aa8d873a34afb25d3c866", "score": "0.60905504", "text": "func (p UserPacket) ToArray() []byte {\r\n\ta := make([]byte, 18)\r\n\ta[0] = byte(p.Command)\r\n\ta[1] = byte(p.ID >> 24)\r\n\ta[2] = byte(p.ID >> 16)\r\n\ta[3] = byte(p.ID >> 8)\r\n\ta[4] = byte(p.ID)\r\n\ta[5] = 0x00\r\n\ta[6] = byte(p.Source >> 16)\r\n\ta[7] = byte(p.Source >> 8)\r\n\ta[8] = byte(p.Source)\r\n\ta[9] = byte(p.Destination >> 16)\r\n\ta[10] = byte(p.Destination >> 8)\r\n\ta[11] = byte(p.Destination)\r\n\tif p.Encrypted {\r\n\t\ta[17] |= 0x80\r\n\t}\r\n\tif p.End {\r\n\t\ta[17] |= 0x40\r\n\t}\r\n\tif p.TimeSlot == 2 {\r\n\t\ta[17] |= 0x20\r\n\t}\r\n\tif p.PhoneCall {\r\n\t\ta[17] |= 0x10\r\n\t}\r\n\t//TODO convert RTP and Burst to array...\r\n\treturn a\r\n\t//return append(a, p.Payload...)\r\n}", "title": "" }, { "docid": "045402f5eb4783b94ac9633be3c90a6f", "score": "0.60809964", "text": "func (b BaseEvent) GetBytes() []byte {\n\tbz, err := mp.Marshal(b)\n\n\tif err != nil {\n\t\tfmt.Printf(\"Unable to encode event as MsgPack (%v)\", b)\n\t\treturn []byte{}\n\t}\n\n\treturn bz\n}", "title": "" }, { "docid": "1afd69ff643fb6f3b0c9c15e5fb07e42", "score": "0.6075272", "text": "func ToBytes(v any) ([]byte, error) {\n\treturn ToBytesWithFunc(v, nil)\n}", "title": "" }, { "docid": "07fc79c9726731d0189ebf772e5f2d95", "score": "0.6071885", "text": "func (b *Buffer) Bytes() []byte {\n\tb.rw.RLock()\n\tdefer b.rw.RUnlock()\n\tnewSlice := make([]byte, len(b.b.Bytes()))\n\tcopy(newSlice, b.b.Bytes())\n\treturn newSlice\n}", "title": "" }, { "docid": "9d94851735b6c6d3bc209a0bb8fe68ee", "score": "0.6053081", "text": "func (r ResultBytes) Bytes() []byte {\n\treturn []byte(r)\n}", "title": "" }, { "docid": "7ac7b73cb30a05d9b4dfa1eca8681683", "score": "0.6040564", "text": "func (b *Buffer) Bytes() []byte { return b.buf[:b.wpos] }", "title": "" }, { "docid": "e0f7faf7bc10e2fedc36c247402cc489", "score": "0.6038775", "text": "func (p MasterStatusBroadcastPacket) ToArray() []byte {\r\n\treturn p.Header.ToArray([]byte{})\r\n}", "title": "" }, { "docid": "ad32d663766553bab4f1f653f921ec52", "score": "0.6003057", "text": "func (msg *ProtocolDataOutputStream) ToByteArray() ([]byte, types.TGError) {\n\tbuf := make([]byte, msg.oStreamByteCount)\n\t_, err := io.Copy(bytes.NewBuffer(buf), bytes.NewBuffer(msg.Buf))\n\tif err != nil {\n\t\treturn nil, exception.GetErrorByType(types.TGErrorIOException, types.INTERNAL_SERVER_ERROR, err.Error(), \"\")\n\t}\n\treturn buf, nil\n}", "title": "" }, { "docid": "3d4801661eafc4030f9b9ea2ae7a21f3", "score": "0.6000753", "text": "func (this *FcmMsg) toJsonByte() ([]byte, error) {\n\n\treturn json.Marshal(this)\n\n}", "title": "" }, { "docid": "1675de569867bfa92fe76085cd3b6a38", "score": "0.59963655", "text": "func (result *ResourceResult) ToBytes() []byte {\n\tbuffer := make([]byte, result.Data.Get(\"length\").Int())\n\tjs.CopyBytesToGo(buffer, result.Data)\n\treturn buffer\n}", "title": "" }, { "docid": "f82c6df31feefff08425f0be0d334a63", "score": "0.5995286", "text": "func (sk storageKey) bytes() []byte {\n\tif sk.bytesBuf != nil {\n\t\treturn sk.bytesBuf\n\t}\n\n\tbuf := bytes.NewBuffer(nil)\n\tbinary.Write(buf, binary.BigEndian, sk.id)\n\tt := convertTimestampToUint(sk.timestamp)\n\tbinary.Write(buf, binary.BigEndian, t)\n\tbinary.Write(buf, binary.BigEndian, sk.seq)\n\tsk.bytesBuf = buf.Bytes()\n\treturn sk.bytesBuf\n}", "title": "" }, { "docid": "95536cbfa62a3d95f4905cf521943af1", "score": "0.59936565", "text": "func Bytes(v []byte) *[]byte { return &v }", "title": "" }, { "docid": "cf2a8b320d4f55d3dd9254a93b1c887c", "score": "0.5990511", "text": "func (bc *ByteCapsule) Bytes() []byte {\n\treturn bc.bytes\n}", "title": "" }, { "docid": "f7262480257bc9904fa4b46284b51850", "score": "0.5980599", "text": "func (s Sysmap) ToArray() []byte {\r\n\ta := make([]byte, 5)\r\n\ta[0] = s.DeviceType\r\n\ta[1] = s.DeviceNumber\r\n\ta[2] = byte(s.Address >> 8)\r\n\ta[3] = byte(s.Address)\r\n\ta[4] = s.AuthIndex\r\n\treturn a\r\n}", "title": "" }, { "docid": "9b91497c1d0a37d6714c676148836aa2", "score": "0.59789014", "text": "func (k AffinityKey) AsBytes() []byte {\n\treturn k[:]\n}", "title": "" }, { "docid": "bebd9b155a5a59f21a0131be4c714382", "score": "0.59681207", "text": "func (p *Buffer) Bytes() []byte { return p.buf }", "title": "" }, { "docid": "b7e112b302ea0b54517eeb6d674ea552", "score": "0.5959597", "text": "func (b Bytes32) Bytes() []byte {\n\treturn b[:]\n}", "title": "" }, { "docid": "95f5714e12df476056dddacc541bccc2", "score": "0.5958435", "text": "func (pubKey PubKey) Bytes() []byte {\n\treturn pubKey[:]\n}", "title": "" }, { "docid": "2a5f8f712f3aa9c0b910dfc6dcafea40", "score": "0.59502226", "text": "func (w *Writer) Bytes() []byte { return w.s[:w.i] }", "title": "" }, { "docid": "584bf253e4e1477d39a1e936d109d91a", "score": "0.5942598", "text": "func (this *MMALBuffer) Bytes() []byte {\n\tvar result []byte\n\n\tctx := (*C.MMAL_BUFFER_HEADER_T)(this)\n\n\t// Make a fake slice\n\tsliceHeader := (*reflect.SliceHeader)((unsafe.Pointer(&result)))\n\tsliceHeader.Cap = int(ctx.alloc_size)\n\tsliceHeader.Len = int(ctx.alloc_size)\n\tsliceHeader.Data = uintptr(unsafe.Pointer(ctx.data))\n\n\t// Return data\n\treturn result\n}", "title": "" }, { "docid": "216bfd9c440a35dae48f1b35a31685b2", "score": "0.5934786", "text": "func (pac Packet) asBytes() []byte {\n\thl := len(pac.headers)\n\tl := hl + len(pac.payload)\n\tbyteRepr := make([]byte, l)\n\tcopy(byteRepr, pac.headers[:])\n\tcopy(byteRepr[hl:], pac.payload[:])\n\treturn byteRepr\n}", "title": "" }, { "docid": "2a127e08ba1640e03081631b1352c4c0", "score": "0.59345096", "text": "func (adabasBuffer *Buffer) Bytes() []byte {\n\treturn adabasBuffer.buffer\n}", "title": "" }, { "docid": "f3b03209b3b25f1d46b2656de23d9c01", "score": "0.59217286", "text": "func (h *waveHeader) toBytes() []byte {\n\tbuffer := new(bytes.Buffer)\n\tbinary.Write(buffer, binary.LittleEndian, h)\n\n\treturn buffer.Bytes()\n}", "title": "" }, { "docid": "c5ac1b821a7174d124ca2ce37e2105db", "score": "0.59141713", "text": "func toByteArray(arr []uint32) []byte {\n\tvar buffer uint32\n\tvar numberOfBits uint32\n\tvar output []byte\n\n\tfor i := 0; i < len(arr); i++ {\n\t\tbuffer |= uint32(arr[i]) << numberOfBits\n\t\tnumberOfBits += 11\n\n\t\tfor numberOfBits >= 8 {\n\t\t\toutput = append(output, byte(buffer&0xff))\n\t\t\tbuffer >>= 8\n\t\t\tnumberOfBits -= 8\n\t\t}\n\t}\n\n\tif buffer != 0 {\n\t\toutput = append(output, byte(buffer))\n\t}\n\n\treturn output\n}", "title": "" }, { "docid": "60040330e5fed85c71f5ad7cfccff748", "score": "0.5908944", "text": "func (b *Buf) Bytes() []byte {\n\treturn b.s[:len(b.s):len(b.s)]\n}", "title": "" }, { "docid": "4453788b7e1da2261a2dc2f27c69d060", "score": "0.59088224", "text": "func getBytes(t interface{}) []byte {\n\tbuf := &bytes.Buffer{}\n\terr := binary.Write(buf, binary.BigEndian, t)\n\tif err != nil {\n\t\treturn nil\n\t}\n\treturn buf.Bytes()\n}", "title": "" }, { "docid": "50b6f5b4764a9bbe0f8874db44b581ed", "score": "0.5906767", "text": "func (c *Canva) ToBytes() ([]byte, error) {\n\tbuffer := new(bytes.Buffer)\n\tif err := jpeg.Encode(buffer, c.Img(), nil); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn buffer.Bytes(), nil\n}", "title": "" }, { "docid": "ee092c1b73a0fb39bb0cc3486c33eaed", "score": "0.5888784", "text": "func (this *Msg) GetBytes() []byte {\n buffer := make([]byte, len(this.data) + HEADER_LEN_B)\n\n SetMsgHeader(this.header, buffer)\n SetMsgPayload(this.data, buffer)\n\n return buffer\n}", "title": "" }, { "docid": "c649315f09c50450296b5ea5b65ffcd7", "score": "0.5886642", "text": "func (bf *BloomFilter) ToBytes() []byte {\n\tbf.lock.RLock()\n\tdefer bf.lock.RUnlock()\n\tvar bb = []byte{}\n\tfor _, bucket := range bf.buckets {\n\t\tvar a = make([]byte, 4)\n\t\tbinary.BigEndian.PutUint32(a, bucket)\n\t\tbb = append(bb, a...)\n\t}\n\treturn bb\n}", "title": "" }, { "docid": "b17a060bef42efbc4bfb46a7d0286250", "score": "0.58841884", "text": "func (s *ByteStream) ToArray() []byte {\n\tout, _ := s.ToArrayWithError()\n\treturn out\n}", "title": "" }, { "docid": "185cce4ce3c79b21eaf173bda70b860e", "score": "0.5874915", "text": "func (rb *Bitmap) ToBytes() ([]byte, error) {\n\treturn rb.highlowcontainer.toBytes()\n}", "title": "" }, { "docid": "3961229e5edd059ba6be09c9f9f62ee8", "score": "0.5865347", "text": "func (r *BytesRefBuilder) Bytes() []byte {\n\treturn r.bytes\n}", "title": "" }, { "docid": "ceaae81a90001e34f28632fd966c33b7", "score": "0.58605444", "text": "func (b *Buffer) Bytes() []byte {\n\tif b.Len() == 0 {\n\t\treturn nil\n\t}\n\n\tm := make([]byte, 0, b.Len())\n\tidx := b.fidx\n\tfor cur := b.first; cur != nil; cur = cur.next {\n\t\tm = append(m, cur.Bytes()[idx:]...)\n\t\tidx = 0\n\t}\n\treturn m\n}", "title": "" }, { "docid": "7fbf0bc0c7aa24745a176715d6cfe037", "score": "0.58567846", "text": "func (rv ReturnValue) Bytes() []byte {\n\treturn rv.av.B\n}", "title": "" }, { "docid": "6d384cc5e6a546b18d48757102873ee4", "score": "0.5850013", "text": "func (g *G2) ToBytes(p *PointG2) []byte {\n\tout := make([]byte, 192)\n\tif g.IsZero(p) {\n\t\treturn out\n\t}\n\tg.Affine(p)\n\tcopy(out[:96], g.f.toBytes(&p[0]))\n\tcopy(out[96:], g.f.toBytes(&p[1]))\n\treturn out\n}", "title": "" }, { "docid": "35d62407fdf864555c60ce3d3c870ddf", "score": "0.5848996", "text": "func ToByteSlice(vs []*byte) []byte {\n\tps := make([]byte, len(vs))\n\tfor i, v := range vs {\n\t\tps[i] = ToByte(v)\n\t}\n\n\treturn ps\n}", "title": "" }, { "docid": "d69ad9998039e4cbfa1ae059fb478f1c", "score": "0.5845524", "text": "func (b *PackBuffer) Bytes() []byte {\n\treturn b.s\n}", "title": "" }, { "docid": "9690d25e974ffbb6969b7fb8b88edcc1", "score": "0.5839005", "text": "func (pubKey PubKey) Bytes() []byte {\n\treturn []byte(pubKey)\n}", "title": "" }, { "docid": "ce5b068b4182abe958b6be9c5be59bd4", "score": "0.58382857", "text": "func (bx Bytex) Bytes() []byte {\n\treturn bx\n}", "title": "" }, { "docid": "c0f780e0d2776ab52178f5ed5deee238", "score": "0.5835333", "text": "func (e encrypt) ToBytes(encodeMode ...string) []byte {\n\tbytes := string2bytes(e.ToString(encodeMode...))\n\tif len(bytes) == 0 {\n\t\treturn []byte(\"\")\n\t}\n\treturn bytes\n}", "title": "" }, { "docid": "22ffcea91824d7bfb16919746935f1e7", "score": "0.58304536", "text": "func (b HexBytes) Bytes() []byte {\n\treturn []byte(b)\n}", "title": "" }, { "docid": "d9cc2a9989142e1cd007a9a397679bfa", "score": "0.58299553", "text": "func (p XnlPacket) ToArray() []byte {\r\n\ta := make([]byte, 5)\r\n\ta[0] = byte(p.Command)\r\n\ta[1] = byte(p.ID >> 24)\r\n\ta[2] = byte(p.ID >> 16)\r\n\ta[3] = byte(p.ID >> 8)\r\n\ta[4] = byte(p.ID)\r\n\treturn append(a, p.Payload...)\r\n}", "title": "" }, { "docid": "21d9678faa2e9a0c548fe23f4dd2c1e1", "score": "0.58286834", "text": "func (msg *Message) Bytes() []byte {\n\tif msg == nil {\n\t\treturn make([]byte, 0)\n\t}\n\n\tmsgBytes := make([]byte, msg.Size())\n\n\tmsgBytes[0] = msg.EHD1Echonet\n\tmsgBytes[1] = msg.EHD2Format1\n\tmsgBytes[2] = msg.tid[0]\n\tmsgBytes[3] = msg.tid[1]\n\tmsgBytes[4] = msg.seoj[0]\n\tmsgBytes[5] = msg.seoj[1]\n\tmsgBytes[6] = msg.seoj[2]\n\tmsgBytes[7] = msg.deoj[0]\n\tmsgBytes[8] = msg.deoj[1]\n\tmsgBytes[9] = msg.deoj[2]\n\tmsgBytes[10] = byte(msg.esv)\n\tmsgBytes[11] = msg.opc\n\n\toffset := 12\n\tfor n := 0; n < int(msg.opc); n++ {\n\t\tprop := msg.PropertyAt(n)\n\t\tif prop == nil {\n\t\t\tcontinue\n\t\t}\n\t\tmsgBytes[offset] = byte(prop.Code())\n\t\toffset++\n\n\t\tpropSize := prop.Size()\n\t\tmsgBytes[offset] = byte(propSize)\n\t\toffset++\n\t\tif propSize == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tpropData := prop.Data()\n\t\tfor i := 0; i < propSize; i++ {\n\t\t\tmsgBytes[offset+i] = propData[i]\n\t\t}\n\n\t\toffset += propSize\n\t}\n\n\treturn msgBytes\n}", "title": "" }, { "docid": "15e89196c00286fd625397c6059e5536", "score": "0.5826043", "text": "func (b *Buffer) Bytes() []byte {\n\treturn b.buf[0:b.offset]\n}", "title": "" }, { "docid": "2808b931119e24d077ed288751278444", "score": "0.58184344", "text": "func (sc *serverCompress) ToBytes() []byte {\n\n\treturn serializer.ToBytes(map[string]interface{}{\n\t\t\"kindToCode\": sc.kindToCode,\n\t\t\"codeToKind\": sc.codeToKind,\n\t})\n}", "title": "" }, { "docid": "7ecffbc8171cfdd7123bad8efa89b12f", "score": "0.58172905", "text": "func (p Packet) Bytes() []byte {\n\tbts, _ := json.Marshal(p)\n\treturn bts\n}", "title": "" }, { "docid": "b0911e69e60f5bb9cdbf34878d50a4f0", "score": "0.5814459", "text": "func (pk PubKeyLedgerEd25519) Bytes() []byte {\n\treturn amino.BinaryBytes(pk.Wrap())\n}", "title": "" }, { "docid": "18945555c382b6eb1696cd36bcd85ec0", "score": "0.58095604", "text": "func (id ShortID) Bytes() []byte {\n\treturn id[:]\n}", "title": "" }, { "docid": "29829df81457f9ce9da38d4e917a26c0", "score": "0.5805175", "text": "func (pk *PublicKey) ToBytes() []byte {\n\tbytes, _ := x509.MarshalPKIXPublicKey(pk.inner)\n\t// TODO: Find out how this can fail\n\treturn bytes\n}", "title": "" }, { "docid": "8c66adb836f2aa5caa2a89429a76d5f9", "score": "0.5802187", "text": "func (cp ConnectPayload) Bytes() []byte {\n\tp := make([]byte, 1+len(cp.ClientID))\n\tp[0] = byte(len(cp.ClientID))\n\tfor i, c := range cp.ClientID {\n\t\tp[i+1] = byte(c)\n\t}\n\treturn p\n\n}", "title": "" }, { "docid": "cffaf1da50d53712e717c24fff88d2fa", "score": "0.5801209", "text": "func ToByteSlice(v []int) []byte {\n\tbz := make([]byte, len(v))\n\tfor i, vv := range v {\n\t\tbz[i] = byte(vv)\n\t}\n\treturn bz\n}", "title": "" }, { "docid": "9d210e473798b0f800e538b0d38f8d33", "score": "0.57933193", "text": "func (p *ByteBuff) Bytes() []byte {\n\tif p.bb() == nil {\n\t\treturn nil\n\t}\n\treturn p.bb().B\n}", "title": "" }, { "docid": "d1397b83b9c72575dc1c70a622552396", "score": "0.578475", "text": "func GetBytes(sa []string) []byte {\n\tarrayBytes, _ := json.Marshal(sa)\n\treturn arrayBytes\n}", "title": "" }, { "docid": "a951d79fb1e48bf7985ab89f4c33d24c", "score": "0.5783361", "text": "func (p Uint24) Bytes() []byte {\n\treturn p[:]\n}", "title": "" }, { "docid": "e77bfb1abfe68006aeced54f1822026b", "score": "0.5782138", "text": "func (o *StringArr) CompressToBytes() []byte {\n\treturn o.Base.compressToBytes()\n}", "title": "" }, { "docid": "465e06cd938cdaeca6b71426a2cc155d", "score": "0.5779814", "text": "func (msg *KeyDgram) Bytes() []byte {\n\treturn append(msg.BaseDgram.Bytes(), msg.Key[:]...)\n}", "title": "" }, { "docid": "ec61be34d663f639f2d762d1d6d67fad", "score": "0.57768774", "text": "func (k key) Array() [32]byte {\n\treturn k.bytes\n}", "title": "" }, { "docid": "e71e2e066f12e30191bca0fe400eb89c", "score": "0.5775478", "text": "func (b *Buffer) Bytes() []byte {\n\treturn b.Buf\n}", "title": "" }, { "docid": "17966de25209b70ab137d3e5e88f2e99", "score": "0.57745606", "text": "func (tv *TypedBytes) Bytes() []byte {\n\treturn tv.Value\n}", "title": "" }, { "docid": "5cf8168a50945354d0c34b16eb0e35f4", "score": "0.57694775", "text": "func (w *Buffer) Bytes() []byte {\n\treturn w.w.Bytes()\n}", "title": "" }, { "docid": "edb18f06a7540e0564f338e3f2e873a3", "score": "0.57681495", "text": "func (tx *Tx) Bytes() []byte {\r\n\treturn tx.toBytesHelper(0, nil)\r\n}", "title": "" }, { "docid": "edb18f06a7540e0564f338e3f2e873a3", "score": "0.57681495", "text": "func (tx *Tx) Bytes() []byte {\r\n\treturn tx.toBytesHelper(0, nil)\r\n}", "title": "" }, { "docid": "2d18b7e541f17ef125ff07142a46254e", "score": "0.57663506", "text": "func (b *FixedBuf) Bytes() []byte {\n\treturn b.data[0:b.pos]\n}", "title": "" }, { "docid": "a165ec73f616d3f63e81b4a31699a005", "score": "0.5762644", "text": "func (e encrypt) ToBytes(encodingMode ...string) []byte {\n\tbytes := string2bytes(e.ToString(encodingMode...))\n\tif len(bytes) == 0 {\n\t\treturn emptyBytes\n\t}\n\treturn bytes\n}", "title": "" }, { "docid": "37bb1a110fe7f5de810471f3bd0ae281", "score": "0.57591075", "text": "func (pp *PublishPacket) ToByteArray() []byte {\n\tvar resp []byte\n\n\t//Insert all the necesssary fields\n\n\t//Packet Type: PUBLISH\n\theader := PUBLISH<<4 | pp.dup<<3 | byte(pp.qos)<<1 | pp.retain\n\tresp = append(resp, header)\n\n\tvar variableContent []byte\n\n\t//Topic Name\n\tvariableContent = append(variableContent, util.EncodeUTFString(pp.topicRaw)...)\n\n\t//Packet ID\n\tif pp.qos > 0 {\n\t\tbytePacketID := util.Get2ByteInt(pp.packetID)\n\t\tvariableContent = append(variableContent, bytePacketID[0])\n\t\tvariableContent = append(variableContent, bytePacketID[1])\n\t\tlog.Print(variableContent)\n\t}\n\n\tvariableContent = append(variableContent, pp.data...)\n\n\t//Remaining length is the 2 bytes for packet ID + payload length,\n\t//which is 1 byte per return code\n\tremainingLength := len(variableContent)\n\tremainingLengthBytes := util.RemainingLengthEncode(remainingLength)\n\tfor _, remainingLengthByte := range remainingLengthBytes {\n\t\tresp = append(resp, remainingLengthByte)\n\t}\n\n\tresp = append(resp, variableContent...)\n\n\treturn resp\n}", "title": "" }, { "docid": "a14df9a3f5244615e70351d79c6aa2b0", "score": "0.57535726", "text": "func (b *ByteBuffer) Bytes() []byte {\n\treturn b.Buf\n}", "title": "" }, { "docid": "2bdf58045d03b7d6f5b7fb239f1e7ae4", "score": "0.5752459", "text": "func (a *Response) Bytes() []byte {\n\treturn a.b\n}", "title": "" }, { "docid": "b3fe3219952218624845ccf7c9f1d573", "score": "0.5751948", "text": "func (m E164) Bytes() []byte {\n\tif m == nil {\n\t\treturn nil\n\t}\n\tr := make([]byte, len(m))\n\tcopy(r, m)\n\treturn r\n}", "title": "" }, { "docid": "a00b0cf7433d2a3a9e8a889894a04126", "score": "0.57516515", "text": "func (td *txData) Bytes() []byte {\n\treturn append([]byte{derive.DerivationVersion0}, td.frame.data...)\n}", "title": "" }, { "docid": "48a4ffe7b608bc0ea21c31852a0121f5", "score": "0.57448375", "text": "func (n ID) Bytes() []byte {\n\treturn n[:]\n}", "title": "" }, { "docid": "24cb798649533aca557a01bbc7222e45", "score": "0.57446164", "text": "func (a *Account) Bytes() []byte {\n\treturn util.ToBytes(a)\n}", "title": "" }, { "docid": "6f4d2a93098816ab6dbc2292ce3bfa2e", "score": "0.5743764", "text": "func (b Bitlist) Bytes() []byte {\n\tif len(b) == 0 {\n\t\treturn []byte{}\n\t}\n\n\tret := make([]byte, len(b))\n\tcopy(ret, b)\n\n\t// Clear the most significant bit (the length bit).\n\tmsb := uint8(bits.Len8(ret[len(ret)-1])) - 1\n\tclearBit := uint8(1 << msb)\n\tret[len(ret)-1] &^= clearBit\n\n\t// Clear any leading zero bytes.\n\tnewLen := len(ret)\n\tfor i := len(ret) - 1; i >= 0; i-- {\n\t\tif ret[i] != 0x00 {\n\t\t\tbreak\n\t\t}\n\t\tnewLen = i\n\t}\n\n\treturn ret[:newLen]\n}", "title": "" }, { "docid": "02eb7384db7eae6fd4be82ff09ab2f93", "score": "0.5731361", "text": "func (pk *PrivKeyLedgerEd25519) Bytes() []byte {\n\treturn amino.BinaryBytes(pk.Wrap())\n}", "title": "" }, { "docid": "a333b211785141f2200d0b9306be85c4", "score": "0.5727029", "text": "func (s *Signature) ToBytes() ([]byte, error) {\n\tbytes := make([]byte, bls12381SignatureLen)\n\n\tcopy(bytes, g1.ToCompressed(s.A))\n\tcopy(bytes[g1CompressedSize:g1CompressedSize+frCompressedSize], s.E.ToBytes())\n\tcopy(bytes[g1CompressedSize+frCompressedSize:], s.S.ToBytes())\n\n\treturn bytes, nil\n}", "title": "" }, { "docid": "1528cda038bb75269658501fd74c2124", "score": "0.57219565", "text": "func (m MessageType) ToBytes() []byte {\n\treturn []byte{byte(m)}\n}", "title": "" }, { "docid": "4296b153a5af6fea1c323cd16170c79b", "score": "0.5721524", "text": "func (id TransactionID) Bytes() []byte {\n\treturn id[:]\n}", "title": "" }, { "docid": "c617662489146df523b3afc02d2f0090", "score": "0.57214284", "text": "func (p Point) AsBinary() []byte {\n\treturn p.AppendWKB(nil)\n}", "title": "" }, { "docid": "d653953ce44adc1d2b99bd6656d09890", "score": "0.57105225", "text": "func (d *GasData) ToBytes() []byte {\n\tout := make([]byte, GasDataSize)\n\tidx := 0\n\tout[idx] = d.Type()\n\tidx++\n\tout[idx] = d.Id()\n\tidx++\n\tfor _, b := range float64ToBytes(d.percentage) {\n\t\tout[idx] = b\n\t\tidx++\n\t}\n\treturn out\n}", "title": "" }, { "docid": "279614986dab69e937bfa008ab5568a3", "score": "0.5708006", "text": "func (j *Job) Bytes() []byte {\n\treturn j.bts\n}", "title": "" }, { "docid": "761b80467d7e00d42f2de80d07e8bece", "score": "0.5707929", "text": "func (job Job) Bytes() (data []byte) {\n data, _ = json.Marshal(job)\n return\n}", "title": "" }, { "docid": "09c5205cc11afe2069017fa6d1e08de2", "score": "0.57037", "text": "func (t *TreeNode) Bytes() []byte {\n\tb, _ := t.rat.GobEncode()\n\n\treturn b\n}", "title": "" }, { "docid": "6c829924d2cb3a93134f52774c46ccb6", "score": "0.57025486", "text": "func (p DeviceSysmapBroadcastPacket) ToArray() []byte {\r\n\tpayload := make([]byte, 2)\r\n\tlength := len(p.Sysmaps)\r\n\tpayload[0] = byte(length >> 8)\r\n\tpayload[1] = byte(length)\r\n\tfor i := 0; i < int(length); i++ {\r\n\t\tpayload = append(payload, p.Sysmaps[i].ToArray()...)\r\n\t}\r\n\treturn p.Header.ToArray(payload)\r\n}", "title": "" } ]
1c3d147355f4629db764273c8841dba4
ReplaceChild replaces the child object with the same name & namespace as the given child with the contents of the given child. If no child exists in the existing map then no action is taken.
[ { "docid": "bf533961f61d689c8d9f61d2dab3b9d8", "score": "0.8341563", "text": "func (m ChildMap) ReplaceChild(parent metav1.Object, child *unstructured.Unstructured) {\n\tkey := childMapKey(child.GetAPIVersion(), child.GetKind())\n\tchildren := m[key]\n\tif children == nil {\n\t\t// We only want to replace if it already exists, so do nothing.\n\t\treturn\n\t}\n\n\tname := relativeName(parent, child)\n\tif _, found := children[name]; found {\n\t\tchildren[name] = child\n\t}\n}", "title": "" } ]
[ { "docid": "f6f06d2ecbea91d9893522b2ef6bb4e8", "score": "0.68773323", "text": "func (n *node4) replaceChild(txn *Txn, c byte, child *nodeHeader) *nodeHeader {\n\tidx := n.indexOf(c)\n\tif idx < 0 {\n\t\t// Child doesn't exist, don't do anything, this shouldn't really happen...\n\t\treturn &n.nodeHeader\n\t}\n\tn.children[idx] = child\n\treturn &n.nodeHeader\n}", "title": "" }, { "docid": "7796678a2fec77f1229a7b4c4983d62c", "score": "0.66385055", "text": "func (p *basePlan) ReplaceChild(child, newChild Plan) error {\n\tfor i, ch := range p.children {\n\t\tif ch == child {\n\t\t\tp.children[i] = newChild\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn SystemInternalErrorType.Gen(\"RemoveChildren Failed!\")\n}", "title": "" }, { "docid": "4453089ed2fe681bc0d3764299868952", "score": "0.62842476", "text": "func (n *baseNode) ReplaceChild(old Node, nu Node) {\n\tif n.isTerminal {\n\t\tn.noChildren(\"replace\")\n\t}\n\n\tfor i, c := range n.children {\n\t\tif c == n {\n\t\t\tn.children[i] = nu\n\t\t\treturn\n\t\t}\n\t}\n\tn.tree.ErrorAtTokenf(n.Token(), \"Cannot replace child %v with %v. Node is not a child of %v.\", old, nu, n)\n\n}", "title": "" }, { "docid": "58331d6fff42d917a22a42279c473908", "score": "0.57047427", "text": "func (m AnyUnstructRegistry) Replace(obj *unstructured.Unstructured) {\n\tkey := makeKeyFromAPIVersionKind(\n\t\tobj.GetAPIVersion(),\n\t\tobj.GetKind(),\n\t)\n\t// get all children by apiVersion & kind\n\tchildren := m[key]\n\tif children == nil {\n\t\t// Nothing to do since instance does not exist\n\t\treturn\n\t}\n\t// get namespaced name of the object\n\tnsName := namespaceNameOrName(obj)\n\tif _, found := children[nsName]; found {\n\t\tchildren[nsName] = obj\n\t}\n}", "title": "" }, { "docid": "d3165d2b3f6986701f0e9a22996f7afd", "score": "0.56875616", "text": "func (node *Node) SetChild(index Key, child *Node) {\n\tchild.parent = node\n\tnode.children[index] = child\n}", "title": "" }, { "docid": "9210a17d37bae80242ff8347d86bb237", "score": "0.55719835", "text": "func (m RelativeObjectMap) ReplaceObjectIfExists(parent v1.Object, obj *unstructured.Unstructured) {\n\tinternalGvk := GroupVersionKind{obj.GroupVersionKind()}\n\tobjects := m[internalGvk]\n\tif objects == nil {\n\t\t// We only want to replace if it already exists, so do nothing.\n\t\treturn\n\t}\n\tname := relativeName(parent, obj)\n\tif _, found := objects[name]; found {\n\t\tobjects[name] = obj\n\t}\n}", "title": "" }, { "docid": "e983c3c745c250e8bef192900bb6932a", "score": "0.5338138", "text": "func (m AnyUnstructRegistry) ReplaceByReference(\n\treference metav1.Object,\n\tobj *unstructured.Unstructured,\n) {\n\tkey := makeKeyFromAPIVersionKind(\n\t\tobj.GetAPIVersion(),\n\t\tobj.GetKind(),\n\t)\n\t// get all children by apiVersion & kind\n\tchildren := m[key]\n\tif children == nil {\n\t\t// Nothing to do since instance does not exist\n\t\treturn\n\t}\n\t// build object name in the format it is saved\n\t// in the registry\n\tname := relativeName(reference, obj)\n\tif _, found := children[name]; found {\n\t\tchildren[name] = obj\n\t}\n}", "title": "" }, { "docid": "844bfa8973b01e37e43e80a0c392ae54", "score": "0.5255478", "text": "func (n *HTMLNode) ReplaceChildren(old, new Node) error {\n\tfor index, child := range n.Children {\n\t\tif child == old {\n\t\t\tn.Children[index] = new\n\t\t\tbreak\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b0f9c336457b4ab0bcd24e0a1bc87847", "score": "0.50089747", "text": "func (p *basePhysicalPlan) SetChild(i int, child PhysicalPlan) {\n\tp.children[i] = child\n}", "title": "" }, { "docid": "e39432add06d10af28b09f3620f94fa6", "score": "0.4995922", "text": "func (p *pathNode) removeChild(ref *fidRef) {\n\tp.fidRefNames.Delete(ref)\n}", "title": "" }, { "docid": "7380b5d2f8eecb737916d8cfb8288e5a", "score": "0.4898548", "text": "func (self *DisplayObjectContainer) SwapChildren(child *DisplayObject, child2 *DisplayObject) {\n self.Object.Call(\"swapChildren\", child, child2)\n}", "title": "" }, { "docid": "8fe352f6698e3e9644a7dae2cfa7e130", "score": "0.48479402", "text": "func (n *Node) replaceKeyAt(key *Key, i int) {\n\tn.ChildKeys[i] = key\n}", "title": "" }, { "docid": "9288da7766299c87d0fbc1ed2bafd34b", "score": "0.48300913", "text": "func (n *Node) RemoveChild(child *Node) {\n\tif child.parent != n {\n\t\treturn\n\t}\n\tif child.leftSibling != nil {\n\t\tchild.leftSibling.rightSibling = child.rightSibling\n\t}\n\tif child.rightSibling != nil {\n\t\tchild.rightSibling.leftSibling = child.leftSibling\n\t}\n\tif n.firstChild == child {\n\t\tn.firstChild = child.rightSibling\n\t}\n\tif n.lastChild == child {\n\t\tn.lastChild = child.leftSibling\n\t}\n\tchild.parent = nil\n\tchild.leftSibling = nil\n\tchild.rightSibling = nil\n\tchild.revision = initialRevision\n}", "title": "" }, { "docid": "2388ea41b6b294de8010753f8bf57743", "score": "0.47993395", "text": "func (p *baseLogicalPlan) SetChild(i int, child LogicalPlan) {\n\tp.children[i] = child\n}", "title": "" }, { "docid": "64fff593e5866b60c8a1b374f5341525", "score": "0.47965083", "text": "func (n *SpecialMapNode) ChildPathName(child Node, key, val reflect.Value) string {\n\treturn n.Map.ChildPathName(child, key, val)\n}", "title": "" }, { "docid": "23438679c446b0369fda5e0cc02848cd", "score": "0.4740161", "text": "func (c *Bytes) Replace(id int, p []byte) {\n\tif id >= c.size {\n\t\treturn\n\t}\n\ttim := time.Now().Unix()\n\titem := c.vals[id]\n\tif item == nil {\n\t\titem = &entryBytes{data: p, lastAccess: tim}\n\t\tc.vals[id] = item\n\t\tatomic.AddInt64(&c.mem, int64(len(p)))\n\t} else {\n\t\titem.mutex.Lock()\n\t\tmemdif := len(p) - len(item.data)\n\t\titem.data = p\n\t\titem.lastAccess = tim\n\t\titem.mutex.Unlock()\n\t\tatomic.AddInt64(&c.mem, int64(memdif))\n\t}\n}", "title": "" }, { "docid": "4ea85e2227ffd673a072c5af080331d0", "score": "0.46924123", "text": "func (mi *Minion) SetChild(husband *Minion) {\r\n\tmi.child = util.Poisson(int(numChild * mi.Compatibility(husband)))\r\n}", "title": "" }, { "docid": "78f87512143ec54b2d2213d1bc7dded4", "score": "0.46903476", "text": "func (pbs *P2PBucketSource) RemoveChild(bucketCid cid.Cid, ref string) (ipld.Node, error) {\n\tdir, err := p2pstorage.LoadDir(pbs.peer, bucketCid)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t_, newDirNode, err := p2pstorage.RemoveFromDir(pbs.peer, dir, ref)\n\treturn newDirNode, err\n}", "title": "" }, { "docid": "f7d4cdc862594dca7deccffc0a30b265", "score": "0.4666742", "text": "func (self *Text) SwapChildren(child *DisplayObject, child2 *DisplayObject) {\n self.Object.Call(\"swapChildren\", child, child2)\n}", "title": "" }, { "docid": "77dc46c71a5c65d7a24a85e30cf07214", "score": "0.46575436", "text": "func (self *DisplayObjectContainer) RemoveChild(child *DisplayObject) *DisplayObject{\n return &DisplayObject{self.Object.Call(\"removeChild\", child)}\n}", "title": "" }, { "docid": "69d57341f5e832f2b031c43367bdfda2", "score": "0.46527168", "text": "func (c *Interface) Replace(id int, p []byte, size int64) {\n\tif id >= c.size {\n\t\treturn\n\t}\n\ttim := time.Now().Unix()\n\titem := c.vals[id]\n\tif item == nil {\n\t\titem = &entryInterface{data: p, lastAccess: tim, size: size}\n\t\tc.vals[id] = item\n\t\tatomic.AddInt64(&c.mem, size)\n\t} else {\n\t\titem.mutex.Lock()\n\t\tsize -= item.size\n\t\titem.data = p\n\t\titem.lastAccess = tim\n\t\titem.mutex.Unlock()\n\t\tatomic.AddInt64(&c.mem, size)\n\t}\n}", "title": "" }, { "docid": "79dd919ab1f3221624f1a076b1e4686d", "score": "0.4626435", "text": "func (osb *ObjectStorageBucket) Replace(p data.Clonable) data.Clonable {\n\tif osb == nil || p == nil {\n\t\treturn osb\n\t}\n\n\t*osb = *p.(*ObjectStorageBucket)\n\treturn osb\n}", "title": "" }, { "docid": "5c061d2a96e4997398f9e41483baaa99", "score": "0.46189016", "text": "func (n *MapNode) ChildPathName(child Node, key, val reflect.Value) string {\n\tkeyVal := NewFreeValFrom(key)\n\treturn n.MarshalKey(keyVal)\n}", "title": "" }, { "docid": "9ac07d88d1195e8a9c476020e5b53881", "score": "0.4609182", "text": "func (c *LayeredCache) Replace(primary, secondary string, value interface{}) bool {\n\titem := c.bucket(primary).get(primary, secondary)\n\tif item == nil {\n\t\treturn false\n\t}\n\tc.Set(primary, secondary, value, item.TTL())\n\treturn true\n}", "title": "" }, { "docid": "b7005720f24165fd3fe68a225b648f6c", "score": "0.4596961", "text": "func (this *Map) Remove(key interface{}) {\n\tvar child *Node\n\tnode := this.lookup(key)\n\tif node == nil {\n\t\treturn\n\t}\n\tif node.Left != nil && node.Right != nil {\n\t\tpred := node.Left.maximumNode()\n\t\tnode.Key = pred.Key\n\t\tnode.Value = pred.Value\n\t\tnode = pred\n\t}\n\tif node.Left == nil || node.Right == nil {\n\t\tif node.Right == nil {\n\t\t\tchild = node.Left\n\t\t} else {\n\t\t\tchild = node.Right\n\t\t}\n\t\tif node.color == black {\n\t\t\tnode.color = nodeColor(child)\n\t\t\tthis.deleteCase1(node)\n\t\t}\n\t\tthis.replaceNode(node, child)\n\t\tif node.Parent == nil && child != nil {\n\t\t\tchild.color = black\n\t\t}\n\t}\n\tthis.size--\n}", "title": "" }, { "docid": "8d737409a9d4edf1a9916e0846fafd4c", "score": "0.4587044", "text": "func (n *node4) removeChild(txn *Txn, c byte) *nodeHeader {\n\tidx := n.indexOf(c)\n\tif idx < 0 {\n\t\t// Child doesn't exist\n\t\treturn &n.nodeHeader\n\t}\n\n\t// Remove index\n\tremoveByteIndex(n.index[0:n.nChildren], idx)\n\tremoveChild(n.children[0:n.nChildren], idx)\n\tn.nChildren--\n\n\treturn &n.nodeHeader\n}", "title": "" }, { "docid": "75e7eb76324438db95c3c72b4ffcfbae", "score": "0.45865637", "text": "func (b *Bucket) Replace(key string, value interface{}, cas Cas, expiry uint32) (Cas, error) {\n\tbytes, flags, err := b.transcoder.Encode(value)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn b.hlpCasExec(func(cb ioCasCallback) (pendingOp, error) {\n\t\top, err := b.client.Replace([]byte(key), bytes, flags, gocbcore.Cas(cas), expiry, gocbcore.StoreCallback(cb))\n\t\treturn op, err\n\t})\n}", "title": "" }, { "docid": "b8633135248a3c76f148e8aafc44e58b", "score": "0.45708013", "text": "func (mfs *MemFS) RemoveChild(parent *Node, child *Node) (removed *Node) {\n\tif parent != nil {\n\t\tremoved = parent.removeChild(child)\n\t\tif removed != nil {\n\t\t\tmfs.PathNodes.Delete(removed.Path)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "3264e2a89b54ec88675efee4af2ef0e7", "score": "0.45358914", "text": "func (m *InMemoryResourceHandler) Replace(_ *http.Request, id string, attributes scim.ResourceAttributes) (scim.Resource, error) {\n\tif _, ok := m.resources.Get(id); !ok {\n\t\treturn scim.Resource{}, scim_errors.ScimErrorResourceNotFound(id)\n\t}\n\tresource := scim.Resource{\n\t\tID: id,\n\t\tAttributes: attributes,\n\t}\n\tm.resources.Set(id, resource)\n\treturn resource, nil\n}", "title": "" }, { "docid": "af9b3e72f855c85fc1f19ad4f292496f", "score": "0.45337328", "text": "func (node *bstNode) replaceNode(newNode *bstNode) error {\n\tif node.parent != nil {\n\t\tswitch {\n\t\tcase node == node.parent.left:\n\t\t\tnode.parent.left = newNode\n\t\tcase node == node.parent.right:\n\t\t\tnode.parent.right = newNode\n\t\tdefault:\n\t\t\t// can't get here\n\t\t\tlog.Fatal(\"node's parent doesn't include node neither as left nor as right child\")\n\t\t}\n\t}\n\n\tif newNode != nil {\n\t\tnewNode.parent = node.parent\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "158f24134231d471ff2477f17b51f49e", "score": "0.45080167", "text": "func (c *Config) SetChild(name string, idx int, value *Config, opts ...Option) error {\n\treturn c.setField(name, idx, cfgSub{c: value}, opts)\n}", "title": "" }, { "docid": "2b9237e7af078c523c5dd7159767408d", "score": "0.45047376", "text": "func (h *HTML) removeChild(child *HTML) {\n\t// If we're removing the current insert target, use the next\n\t// sibling, if any.\n\tif h.insertBeforeNode != nil && h.insertBeforeNode.Equal(child.node) {\n\t\th.insertBeforeNode = h.insertBeforeNode.Get(\"nextSibling\")\n\t}\n\tunmount(child)\n\tif child.node == nil {\n\t\treturn\n\t}\n\t// Use the child's parent node here, in case our node is not a valid\n\t// target by the time we're called.\n\tchild.node.Get(\"parentNode\").Call(\"removeChild\", child.node)\n}", "title": "" }, { "docid": "96b7013eb20042e24c47d78e356dd72f", "score": "0.4501507", "text": "func (r *Resource) Replace(other *Resource) {\n\tr.SetLabels(mergeStringMaps(other.GetLabels(), r.GetLabels()))\n\tr.SetAnnotations(mergeStringMaps(other.GetAnnotations(), r.GetAnnotations()))\n\tr.SetName(other.GetName())\n}", "title": "" }, { "docid": "99f570adfa549b29025abfd666cc641d", "score": "0.44672102", "text": "func (r *Ray) Child(dest V3) {\n\tchildren := append(*r.Children, Ray{Origin: r.Dest, Dest: dest})\n\tr.Children = &children\n}", "title": "" }, { "docid": "3c368e544ec82bf55df7fbdc34507aca", "score": "0.44671452", "text": "func (n *Node) replaceNode(parent, replacement *Node) error {\n\tif n == nil {\n\t\treturn errors.New(\"replaceNode() not allowed on a nil node\")\n\t}\n\n\tif n == parent.Left {\n\t\tparent.Left = replacement\n\t\treturn nil\n\t}\n\tparent.Right = replacement\n\treturn nil\n}", "title": "" }, { "docid": "5a5425a4e4717a836d95df71407ae87c", "score": "0.44621837", "text": "func (a Address) Child(child interface{}) Address {\n\tid := fmt.Sprint(child)\n\tif strings.ContainsAny(id, \"/\") {\n\t\tpanic(\"address path parts cannot contain a slash\")\n\t}\n\treturn Address{path: path.Join(a.path, id)}\n}", "title": "" }, { "docid": "7fcc7c5f17c218e9cf93d2c4b2d77dbb", "score": "0.4461709", "text": "func (rn *rootNode) WrapChild(child libkbfs.Node) libkbfs.Node {\n\tchild = rn.Node.WrapChild(child)\n\tif child.GetBasename().Plaintext() != AutogitRoot {\n\t\treturn child\n\t}\n\n\trn.lock.RLock()\n\tdefer rn.lock.RUnlock()\n\tif rn.fs == nil {\n\t\trn.am.log.CDebugf(context.TODO(), \"FS not available on WrapChild\")\n\t\treturn child\n\t}\n\n\trn.am.log.CDebugf(context.TODO(), \"Making autogit root node\")\n\treturn &autogitRootNode{\n\t\tNode: &libkbfs.ReadonlyNode{Node: child},\n\t\tam: rn.am,\n\t\tfs: rn.fs,\n\t}\n}", "title": "" }, { "docid": "8153234d137f17f4ca6432be66f13621", "score": "0.4458161", "text": "func (n *Node) replaceNode(parent, replacement *Node) error {\n\tif n == nil {\n\t\treturn errors.New(\"Cannot REPLACE: node to replace is nil\")\n\t}\n\n\tif n == parent.Left {\n\t\tparent.Left = replacement\n\t\treturn nil\n\t}\n\tparent.Right = replacement\n\treturn nil\n}", "title": "" }, { "docid": "58987baf4c4526ba3ae69a7cecb41005", "score": "0.44422624", "text": "func (m Map) SetValue(ns []string, k string, x interface{}) (err error) {\n\n\t// Iterate the namespaces\n\tvar ok bool\n\tm1 := m\n\tfor _, n := range ns {\n\n\t\t// Find the name in the current level\n\t\tif x, ok = m1[n]; !ok {\n\t\t\tx = make(map[string]interface{}, 10) // Create a new level\n\t\t\tm1[n] = x\n\t\t}\n\n\t\t// Value at name should be a map\n\t\tif m1, ok = x.(map[string]interface{}); !ok {\n\t\t\treturn ErrValueNotMap\n\t\t}\n\t}\n\n\t// Set the value in the map\n\tm1[k] = x\n\treturn nil\n}", "title": "" }, { "docid": "40f66bca607515320d149f08472da84d", "score": "0.44406575", "text": "func (n *VGNode) RemoveChild(c *VGNode) {\n\tif c.Parent != n {\n\t\tpanic(\"html: RemoveChild called for a non-child Node\")\n\t}\n\tif n.FirstChild == c {\n\t\tn.FirstChild = c.NextSibling\n\t}\n\tif c.NextSibling != nil {\n\t\tc.NextSibling.PrevSibling = c.PrevSibling\n\t}\n\tif n.LastChild == c {\n\t\tn.LastChild = c.PrevSibling\n\t}\n\tif c.PrevSibling != nil {\n\t\tc.PrevSibling.NextSibling = c.NextSibling\n\t}\n\tc.Parent = nil\n\tc.PrevSibling = nil\n\tc.NextSibling = nil\n}", "title": "" }, { "docid": "1832fa6c7a114e657a46aab4df3d6824", "score": "0.44375345", "text": "func (p *Processor) DeleteChild(ctx context.Context, key string) error {\n\t// Now, every child is a hash which points to a key/value pair in\n\t// Store which in turn points to a file in dst storage.\n\tdstfileRaw, err := p.store.Get(ctx, key)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"unable to retrieve key %s\", key)\n\t}\n\n\tif dstfileRaw != nil {\n\t\tdstfile, err := conv.String(dstfileRaw)\n\t\tif err != nil {\n\t\t\treturn errors.Wrapf(err, \"unable to cast %v to string\", dstfileRaw)\n\t\t}\n\n\t\t// And try to delete it all.\n\t\terr = p.destinationStorage.Delete(ctx, dstfile)\n\t\tif err != nil {\n\t\t\treturn errors.Wrapf(err, \"unable to delete %s on storage\", dstfile)\n\t\t}\n\t}\n\n\terr = p.store.Delete(ctx, key)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"unable to delete key %s\", key)\n\t}\n\n\tp.Logger.Info(\"Deleting child\",\n\t\tlogger.String(\"key\", key))\n\n\treturn nil\n}", "title": "" }, { "docid": "a1f1fd9de276a6872b608e0b42091dd4", "score": "0.44279268", "text": "func (l *Leaf) RemoveChild(n Node) {}", "title": "" }, { "docid": "beb58050df6f88f3cd9e199650de1d83", "score": "0.4424649", "text": "func (node *Node) RemoveChild(index Key) {\n\t_, ok := node.children[index]\n\tif ok {\n\t\tnode.children[index].parent = nil\n\t\tdelete(node.children, index)\n\t}\n}", "title": "" }, { "docid": "af78f8bd27274b5a4795a141d03de593", "score": "0.4419239", "text": "func (r *Ref) Child(id interface{}) *Ref {\n\treturn r.children[r.address.Child(id)]\n}", "title": "" }, { "docid": "a2ed18dc4a98a9cff591511416a795bf", "score": "0.440891", "text": "func (p TransposeMap) Replaced(from, to core.Sequenceable) core.Sequenceable {\n\tif core.IsIdenticalTo(p, from) {\n\t\treturn to\n\t}\n\tif core.IsIdenticalTo(p.Target, from) {\n\t\treturn TransposeMap{Target: to, IndexOffsets: p.IndexOffsets}\n\t}\n\tif rep, ok := p.Target.(core.Replaceable); ok {\n\t\treturn TransposeMap{Target: rep.Replaced(from, to), IndexOffsets: p.IndexOffsets}\n\t}\n\treturn p\n}", "title": "" }, { "docid": "97a90e37d0f561e6b4f8e95e576add07", "score": "0.4407498", "text": "func (self *Text) RemoveChild(child *DisplayObject) *DisplayObject{\n return &DisplayObject{self.Object.Call(\"removeChild\", child)}\n}", "title": "" }, { "docid": "6de9f33dd1dd3ad3897a022f20a623b4", "score": "0.4391184", "text": "func insertChild(children []child, newLeaf child, idx int) []child {\n\tchildren = append(children, child{})\n\tcopy(children[idx+1:], children[idx:])\n\tchildren[idx] = newLeaf\n\treturn children\n}", "title": "" }, { "docid": "78c389e75ec601565159a6a72753c18d", "score": "0.4386482", "text": "func (n *NamedRoute) Replaced() {\n\terr := db.DeleteStruct(n)\n\tif err != nil {\n\t\tlog.Printf(\"router.*NamedRoute.Replaced(): %s could be removed: %s\", n.FQDN(), err)\n\t}\n}", "title": "" }, { "docid": "39b46c8eb28ab35493087b6849fa603e", "score": "0.4373135", "text": "func (c *Class) Replace(info *Object) error {\n\tif info == nil {\n\t\treturn ErrNoArg\n\t}\n\toptions, err := validateQdiscObject(rtmNewClass, info)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn c.action(rtmNewClass, netlink.Create, &info.Msg, options)\n}", "title": "" }, { "docid": "4e90e220c408d27ae831dec1f0d36b90", "score": "0.4366885", "text": "func (p *pathNode) addChild(ref *fidRef, name string) {\n\tif s, ok := p.fidRefNames.Load(ref); ok {\n\t\t// This should not happen, don't proceed.\n\t\tpanic(fmt.Sprintf(\"unexpected fidRef %+v with path %q, wanted %q\", ref, s, name))\n\t}\n\n\tp.fidRefNames.Store(ref, name)\n}", "title": "" }, { "docid": "a7fa8deccc40bbbbb5eda249b46873d1", "score": "0.43640077", "text": "func Set(parent, child, value string) error {\n\tvar err error\n\n\t// set value\n\tconfig[parent][child] = value\n\n\t// marshal\n\tvar data []byte\n\tdata, err = json.Marshal(config)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// write to file\n\terr = ioutil.WriteFile(file, data, os.ModePerm)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "28ffe531449855230e4b78214a69ba1d", "score": "0.43590108", "text": "func (n *Node) RemoveChild(code rune) {\n\tdelete(n.children, code)\n}", "title": "" }, { "docid": "ba345cb765c421d1815861ebc4ab58c4", "score": "0.43499607", "text": "func (o Node) Replace(n Node) error {\n\tif C.cmark_node_replace(o.node, n.node) == 0 {\n\t\treturn errors.New(\"Replace failed\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9e3d1ce93f5b889131bdcf27c82741fc", "score": "0.43455732", "text": "func (ent *Scope) Remove(child Entity) {\n\tfor index := 0; index < len(ent.children); index++ {\n\t\tif ent.children[index] == child {\n\t\t\tent.children = append(ent.children[:index], ent.children[index+1:]...)\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9e487f79a72aea86477b55d39d0d97d4", "score": "0.4338815", "text": "func newChild(ctx Context) *node {\n\tparent, ok := ctx.(*node)\n\t// If the given context is not a node, or if the given context is\n\t// a node that already had a child, return a new node with new map\n\t// fro the given context.\n\tif !ok || parent.fork {\n\t\treturn new(ctx)\n\t}\n\n\t// Copy the parent to the child and increase the child rank.\n\tparent.mu.Lock()\n\tdefer parent.mu.Unlock()\n\tchild := *parent\n\tchild.rank++\n\n\t// Set the fork flag to the parent since it is no longer allowed to\n\t// have children that share the same values map.\n\tparent.fork = true\n\n\treturn &child\n}", "title": "" }, { "docid": "37e9f10173471743b2192080e2d95e88", "score": "0.43265763", "text": "func (mcc *MCacheCluster) Replace(key string, value []byte) {\n\tmcc.cacheCluster.Set(key,value,0)\n}", "title": "" }, { "docid": "0d795db092859caaa0dda8815e83d876", "score": "0.4324141", "text": "func (s *Species) BreedReplace(viable Organisms) {\n\ts.Breed(viable, len(s.members))\n}", "title": "" }, { "docid": "b8728eeffdf9a96a9fcdb9885cdc22bd", "score": "0.43220815", "text": "func (arn autogitRootNode) WrapChild(child libkbfs.Node) libkbfs.Node {\n\tchild = arn.Node.WrapChild(child)\n\trepo := normalizeRepoName(child.GetBasename().Plaintext())\n\treturn &repoDirNode{\n\t\tNode: child,\n\t\tam: arn.am,\n\t\tgitRootFS: arn.fs,\n\t\trepo: repo,\n\t\tsubdir: \"\",\n\t\tbranch: \"\",\n\t}\n}", "title": "" }, { "docid": "9acb211f19e0465fa5303f5c6faf64ed", "score": "0.43206832", "text": "func (ft *DwarfFixupTable) ReferenceChildDIE(s *LSym, ridx int, tgt *LSym, dclidx int, inlIndex int) {\n\t// Protect against concurrent access if multiple backend workers\n\tft.mu.Lock()\n\tdefer ft.mu.Unlock()\n\n\t// Create entry for symbol if not already present.\n\tidx, found := ft.symtab[tgt]\n\tif !found {\n\t\tft.svec = append(ft.svec, symFixups{inlIndex: int32(inlIndex)})\n\t\tidx = len(ft.svec) - 1\n\t\tft.symtab[tgt] = idx\n\t}\n\n\t// Do we have child DIE offsets available? If so, then apply them,\n\t// otherwise create a fixup record.\n\tsf := &ft.svec[idx]\n\tif len(sf.doffsets) > 0 {\n\t\tfound := false\n\t\tfor _, do := range sf.doffsets {\n\t\t\tif do.dclIdx == int32(dclidx) {\n\t\t\t\toff := do.offset\n\t\t\t\ts.R[ridx].Add += int64(off)\n\t\t\t\tfound = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !found {\n\t\t\tft.ctxt.Diag(\"internal error: DwarfFixupTable.ReferenceChildDIE unable to locate child DIE offset for dclIdx=%d src=%v tgt=%v\", dclidx, s, tgt)\n\t\t}\n\t} else {\n\t\tsf.fixups = append(sf.fixups, relFixup{s, int32(ridx), int32(dclidx)})\n\t}\n}", "title": "" }, { "docid": "fd9fd2370aedfffd9d66c98220c221a4", "score": "0.42995295", "text": "func Replace(id string, fg *Group) error {\n\tobjID, err := model.ToObjectID(id)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif fg.ID.IsZero() {\n\t\tfg.ID = objID\n\t}\n\n\tfg.Modified = timestamp{time.Now()}\n\n\tc := database.GetDB().Collection(Collection)\n\n\topts := options.FindOneAndReplace()\n\topts.SetUpsert(false)\n\topts.SetReturnDocument(options.After)\n\n\tctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)\n\tdefer cancel()\n\n\tif err = c.FindOneAndReplace(ctx, bson.M{\"_id\": objID}, fg, opts).Decode(fg); err != nil {\n\t\tlogger.Error(err)\n\t\treturn model.MongoToAPIError(err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "ad1dc4138a26e803ef231bea8cbead49", "score": "0.42986247", "text": "func WithChildLabelMap(fn func(ocispec.Descriptor) []string) RemoteOpt {\n\treturn func(_ *Client, c *RemoteContext) error {\n\t\tc.ChildLabelMap = fn\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "2f4feb8a3fb1aee4f3f397a2803cbe4c", "score": "0.42975467", "text": "func (c *LayeredCache[T]) Replace(primary, secondary string, value T) bool {\n\titem := c.bucket(primary).get(primary, secondary)\n\tif item == nil {\n\t\treturn false\n\t}\n\tc.Set(primary, secondary, value, item.TTL())\n\treturn true\n}", "title": "" }, { "docid": "110bf50090b30b3e896088d173282e0d", "score": "0.4296431", "text": "func (sm *SyncComparableMap) Replace(replace func(old *ComparableMap) (*ComparableMap, error)) error {\n\tsm.mutex.Lock()\n\tdefer sm.mutex.Unlock()\n\tif replace != nil {\n\t\tnewMap, err := replace(sm.cm)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tsm.cm = newMap\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ae9a0cf9badc170bc6784f61119a769c", "score": "0.42952898", "text": "func (node *Node) addChild(\n\tsysPath string, fi os.FileInfo, maxFileSize int64,\n) (child *Node, err error) {\n\tvar (\n\t\tlogp = \"Node.addChild\"\n\t\trelPath = path.Join(node.Path, fi.Name())\n\t\tfound bool\n\t)\n\n\tfor _, child = range node.Childs {\n\t\tif child.Path == relPath {\n\t\t\tfound = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif found {\n\t\treturn child, nil\n\t}\n\n\tchild, err = NewNode(node, fi, maxFileSize)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%s: %w\", logp, err)\n\t}\n\n\tchild.SysPath = sysPath\n\n\tnode.Childs = append(node.Childs, child)\n\treturn child, nil\n}", "title": "" }, { "docid": "0b7f2e3798df39a3db80a25fcdeeaff9", "score": "0.42949608", "text": "func (node *Node) removeChild(child *Node) *Node {\n\tif child == nil {\n\t\treturn nil\n\t}\n\tfor x := 0; x < len(node.Childs); x++ {\n\t\tif node.Childs[x] != child {\n\t\t\tcontinue\n\t\t}\n\n\t\tcopy(node.Childs[x:], node.Childs[x+1:])\n\t\tn := len(node.Childs)\n\t\tnode.Childs[n-1] = nil\n\t\tnode.Childs = node.Childs[:n-1]\n\n\t\tchild.Parent = nil\n\t\tchild.Childs = nil\n\n\t\treturn child\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "0afbdb670bd43f0e29d333692ac4594c", "score": "0.42944098", "text": "func (this *ConcurrentMap) Replace(key interface{}, value interface{}) (oldVal interface{}, err error) {\n\tif isNil(key) {\n\t\treturn nil, NilKeyError\n\t}\n\tif isNil(value) {\n\t\treturn nil, NilValueError\n\t}\n\n\tif hash, e := hashKey(key, this, false); e != nil {\n\t\terr = e\n\t} else {\n\t\tPrintf(\"Replace, %v, %v\\n\", key, hash)\n\t\toldVal = this.segmentFor(hash).replace(key, hash, value)\n\t}\n\t//hash := hash2(hashKey(key, this, true))\n\t//Printf(\"Replace, %v, %v\\n\", key, hash)\n\t//oldVal = this.segmentFor(hash).replace(key, hash, value)\n\treturn\n}", "title": "" }, { "docid": "fa2de648872a9fb7145ff7f019b14ae8", "score": "0.42849654", "text": "func (q *Queue) Replace(obj map[int][]byte) {\n\tq.lock.Lock()\n\tq.QObj = obj\n\tq.lock.Unlock()\n}", "title": "" }, { "docid": "abc159235af79c9fd1f981724b619327", "score": "0.42723694", "text": "func (t *Immutable) Put(key, value []byte) *Immutable {\n\t// Use an empty byte slice for the value when none was provided. This\n\t// ultimately allows key existence to be determined from the value since\n\t// an empty byte slice is distinguishable from nil.\n\tif value == nil {\n\t\tvalue = emptySlice\n\t}\n\n\t// The node is the root of the tree if there isn't already one.\n\tif t.root == nil {\n\t\troot := newTreapNode(key, value, rand.Int())\n\t\treturn newImmutable(root, 1, nodeSize(root))\n\t}\n\n\t// Find the binary tree insertion point and construct a replaced list of\n\t// parents while doing so. This is done because this is an immutable\n\t// data structure so regardless of where in the treap the new key/value\n\t// pair ends up, all ancestors up to and including the root need to be\n\t// replaced.\n\t//\n\t// When the key matches an entry already in the treap, replace the node\n\t// with a new one that has the new value set and return.\n\tvar parents parentStack\n\tvar compareResult int\n\tfor node := t.root; node != nil; {\n\t\t// Clone the node and link its parent to it if needed.\n\t\tnodeCopy := cloneTreapNode(node)\n\t\tif oldParent := parents.At(0); oldParent != nil {\n\t\t\tif oldParent.left == node {\n\t\t\t\toldParent.left = nodeCopy\n\t\t\t} else {\n\t\t\t\toldParent.right = nodeCopy\n\t\t\t}\n\t\t}\n\t\tparents.Push(nodeCopy)\n\n\t\t// Traverse left or right depending on the result of comparing\n\t\t// the keys.\n\t\tcompareResult = bytes.Compare(key, node.key)\n\t\tif compareResult < 0 {\n\t\t\tnode = node.left\n\t\t\tcontinue\n\t\t}\n\t\tif compareResult > 0 {\n\t\t\tnode = node.right\n\t\t\tcontinue\n\t\t}\n\n\t\t// The key already exists, so update its value.\n\t\tnodeCopy.value = value\n\n\t\t// Return new immutable treap with the replaced node and\n\t\t// ancestors up to and including the root of the tree.\n\t\tnewRoot := parents.At(parents.Len() - 1)\n\t\tnewTotalSize := t.totalSize - uint64(len(node.value)) +\n\t\t\tuint64(len(value))\n\t\treturn newImmutable(newRoot, t.count, newTotalSize)\n\t}\n\n\t// Link the new node into the binary tree in the correct position.\n\tnode := newTreapNode(key, value, rand.Int())\n\tparent := parents.At(0)\n\tif compareResult < 0 {\n\t\tparent.left = node\n\t} else {\n\t\tparent.right = node\n\t}\n\n\t// Perform any rotations needed to maintain the min-heap and replace\n\t// the ancestors up to and including the tree root.\n\tnewRoot := parents.At(parents.Len() - 1)\n\tfor parents.Len() > 0 {\n\t\t// There is nothing left to do when the node's priority is\n\t\t// greater than or equal to its parent's priority.\n\t\tparent = parents.Pop()\n\t\tif node.priority >= parent.priority {\n\t\t\tbreak\n\t\t}\n\n\t\t// Perform a right rotation if the node is on the left side or\n\t\t// a left rotation if the node is on the right side.\n\t\tif parent.left == node {\n\t\t\tnode.right, parent.left = parent, node.right\n\t\t} else {\n\t\t\tnode.left, parent.right = parent, node.left\n\t\t}\n\n\t\t// Either set the new root of the tree when there is no\n\t\t// grandparent or relink the grandparent to the node based on\n\t\t// which side the old parent the node is replacing was on.\n\t\tgrandparent := parents.At(0)\n\t\tif grandparent == nil {\n\t\t\tnewRoot = node\n\t\t} else if grandparent.left == parent {\n\t\t\tgrandparent.left = node\n\t\t} else {\n\t\t\tgrandparent.right = node\n\t\t}\n\t}\n\n\treturn newImmutable(newRoot, t.count+1, t.totalSize+nodeSize(node))\n}", "title": "" }, { "docid": "f022946a29927eba195911ca1b8f8273", "score": "0.4269932", "text": "func (svg *SVG) Child(x, y float64) *SVG {\n\tself := makeSVG()\n\tself.parent = svg\n\tself.brackets.Open(\"svg\", br.Attributes{\n\t\t\"x\": ftos(x),\n\t\t\"y\": ftos(y),\n\t})\n\treturn &self\n}", "title": "" }, { "docid": "44e285f850a54f4408de416e09d96294", "score": "0.42695263", "text": "func (n *Node) DeleteChildNode(v rune) {\n\tn.m.Lock()\n\tdefer n.m.Unlock()\n\tn.Children[n.childIndexMap[v]] = nil\n\tdelete(n.childIndexMap, v)\n}", "title": "" }, { "docid": "308fbe5951a8ffd50f95c52ab06aa5b9", "score": "0.426803", "text": "func (c *Closer) AddChild(child *Closer) {\n\tif child == c {\n\t\treturn\n\t}\n\tc.lock.Lock()\n\tdefer c.lock.Unlock()\n\tif c.closed {\n\t\tchild.Close(c.err)\n\t\treturn\n\t}\n\tif c.children == nil {\n\t\tc.children = make(map[*Closer]bool)\n\t}\n\tif _, ok := c.children[child]; ok {\n\t\treturn\n\t}\n\tc.children[child] = true\n}", "title": "" }, { "docid": "1433e412647a542d5cc75dc8301386b9", "score": "0.42662457", "text": "func (self *DisplayObjectContainer) SetChildIndex(child *DisplayObject, index int) {\n self.Object.Call(\"setChildIndex\", child, index)\n}", "title": "" }, { "docid": "ba10de1aa0e5713e40e6b43865a91625", "score": "0.42443544", "text": "func (k Keeper) AppendChild(ctx sdk.Context, parentAcc string, childAcc string) error {\n\treturn k.appendChild(ctx, parentAcc, childAcc, false)\n}", "title": "" }, { "docid": "de28313ee4bc9465505826afd81d2fc0", "score": "0.4232847", "text": "func (n TreeNode) ReplaceWith(new *terex.GCons) TreeNode {\n\tif n.Node == nil {\n\t\tif n.parent == nil {\n\t\t\treturn node(new, nil)\n\t\t}\n\t\tpanic(\"inconsistent parent-node combination; node is nil\")\n\t}\n\tl, r := children(n.parent) // will return (nil,nil) for parent=nil\n\tif l == n.Node {\n\t\tn.parent.Car.Data = new // therefore this is safe\n\t} else if r == n.Node {\n\t\tn.parent.Cdr = new // and this, too\n\t} else {\n\t\tpanic(\"inconsistent parent-node combination; node is no valid child\")\n\t}\n\treturn node(new, n.parent)\n}", "title": "" }, { "docid": "8aade81cbeeb4f5c9bb76bc8bbc70216", "score": "0.42304316", "text": "func (pbs *P2PBucketSource) AddChild(bucketCid cid.Cid, name string, dr *core.DataRef) (ipld.Node, error) {\n\tdir, err := p2pstorage.LoadDir(pbs.peer, bucketCid)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\traw, err := core.MarshalDataRef(dr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcb, _ := p2pstorage.NewCidBuilder(\"\")\n\tnd, err := p2pstorage.Add(pbs.peer, bytes.NewReader(raw), cb, balanced.Layout)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// upsert\n\tp2pstorage.RemoveFromDir(pbs.peer, dir, name)\n\t_, newDirNode, err := p2pstorage.AddToDir(pbs.peer, dir, name, nd)\n\treturn newDirNode, err\n}", "title": "" }, { "docid": "1226422c0983c549541bf655ee84ed58", "score": "0.4224172", "text": "func (rcf *Farm) releaseChild(id fields.ID) {\n\trcf.logger.WithField(\"rc\", id).Infoln(\"Releasing replication controller\")\n\tclose(rcf.children[id].quit)\n\n\t// if our lock is active, attempt to gracefully release it on this rc\n\tif rcf.session != nil {\n\t\tunlocker := rcf.children[id].unlocker\n\t\terr := unlocker.Unlock()\n\t\tif err != nil {\n\t\t\trcf.logger.WithField(\"rc\", id).Warnln(\"Could not release replication controller lock\")\n\t\t}\n\t}\n\tdelete(rcf.children, id)\n}", "title": "" }, { "docid": "6f942eea66471dca159310d420f4b67c", "score": "0.42221752", "text": "func Replace(m mapping.Mapping) Strategy {\n\treturn &replaceStrategy{\n\t\t_mapping: m,\n\t}\n}", "title": "" }, { "docid": "c083f59c7cf454ddc2e2ccb3e5182c4b", "score": "0.42160016", "text": "func (src *AgendaNode) replaceWith(dst *AgendaNode) {\n\tdst.Parent = src.Parent\n\tdst.NextContinuation = src.NextContinuation\n\tdst.PrevContinuation = src.PrevContinuation\n\n\tif dst.NextContinuation != nil {\n\t\tdst.NextContinuation.PrevContinuation = dst\n\t}\n\n\tif dst.PrevContinuation != nil {\n\t\tdst.PrevContinuation.NextContinuation = dst\n\t}\n\n\tif dst.Parent != nil {\n\t\tindex := dst.Parent.IndexChild(src)\n\t\tif index == -1 {\n\t\t\tpanic(\"Move! Parent!\")\n\t\t} else {\n\t\t\tdst.Parent.Children[index] = dst\n\t\t}\n\t}\n}", "title": "" }, { "docid": "64861c008133c11a14a41bf5d9cf79de", "score": "0.42119813", "text": "func (e *Element) removeChild(removedNodeID int) {\n\tvar idx int\n\tvar child *gcdapi.DOMNode\n\n\te.lock.Lock()\n\tdefer e.lock.Unlock()\n\n\tif e.node == nil || e.node.Children == nil {\n\t\treturn\n\t}\n\n\tfor idx, child = range e.node.Children {\n\t\tif child != nil && child.NodeId == removedNodeID {\n\t\t\te.node.Children = append(e.node.Children[:idx], e.node.Children[idx+1:]...)\n\t\t\te.childNodeCount = e.childNodeCount - 1\n\t\t\tbreak\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4b525197eaece900cfbc894484bc030e", "score": "0.42086577", "text": "func (d *DocUpdater) AddChild(toID string, e Element) error {\n\td.mu.Lock()\n\tdefer d.mu.Unlock()\n\n\tnode, ok := d.nodes[toID]\n\tif !ok {\n\t\treturn fmt.Errorf(\"could not locate element ID(%s)\", toID)\n\t}\n\tif node.isComponent() {\n\t\treturn fmt.Errorf(\"cannot call DocUpdater.AddChild(%s): is a Component\", toID)\n\t}\n\n\tif err := setUpdateFlag(node.ElementNode.Element); err != nil {\n\t\treturn fmt.Errorf(\"cannot call DocUpdater.AddChild(%s): %w\", err)\n\t}\n\n\tif err := addElementToNode(node.ElementNode.Element, e); err != nil {\n\t\treturn err\n\t}\n\n\tif id := GetElementID(e); id != \"\" {\n\t\t// (TODO): This really need to add more information and especially if e is a Gear.\n\t\td.nodes[id] = &Node{ElementNode: &ElemNode{Element: e}}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6c6690eb0075d58639435523bdc0e388", "score": "0.42026666", "text": "func (tn *node) AddChild(r rune) *nodeResult {\n\tif tn.children == nil {\n\t\ttn.children = make(childNodeMap)\n\t}\n\n\tif foundN, ok := tn.children[r]; ok {\n\t\treturn &nodeResult{\n\t\t\tresult: nodeFound,\n\t\t\tNode: foundN,\n\t\t}\n\t}\n\n\ttn.children[r] = &node{\n\t\tvalue: r,\n\t\tparent: tn,\n\t\tchildren: make(childNodeMap),\n\t\tisTerm: true,\n\t\tisRoot: false,\n\t}\n\ttn.isTerm = false\n\n\treturn &nodeResult{\n\t\tresult: nodeAdded,\n\t\tNode: tn.children[r],\n\t}\n}", "title": "" }, { "docid": "f553cf8848614713074616b0085eeba8", "score": "0.41986066", "text": "func (lo *layout) resizeChild(offx, offy float64, ww, wh int) {\n\tlo.form.Resize(ww, wh)\n\tfor cnt, sect := range lo.form.Sections() {\n\t\tx, y, w, h := sect.Bounds()\n\t\tlo.sects[cnt].SetScale(w, h, 0)\n\t\tlo.sects[cnt].SetLocation(x+offx, y+offy, 0)\n\t\tlo.labels[cnt].SetLocation(x+offx, y+offy, 0)\n\t}\n}", "title": "" }, { "docid": "ff7812d71e05bc4f4da055a92c432e41", "score": "0.41932875", "text": "func (cr *childrenRepository) DeleteChild(ctx context.Context, userID string, childName string) error{\n\n\treturn nil\n}", "title": "" }, { "docid": "6ad514c047b4c64ee0b80216d9b615da", "score": "0.41887745", "text": "func (dict *BSTDictionary) Put(key, value string) {\n\tif dict.root == nil {\n\t\tdict.root = newBSTNode(key, value, nil, nil, nil)\n\t\tdict.size++\n\t\treturn\n\t}\n\n\tnode := dict.root.find(key)\n\tif node != nil {\n\t\t// overwrite the previous value\n\t\tnode.value = value\n\t} else {\n\t\tdict.root.insert(key, value)\n\t\tdict.size++\n\t}\n}", "title": "" }, { "docid": "2053fc269e59f12a4bd012964173d96a", "score": "0.4185582", "text": "func (this *DictNode) Set_children( value []*DictNode) {\n this.children = value \n}", "title": "" }, { "docid": "d1ae96e14bc92a7f68e97a6c013b511b", "score": "0.41854957", "text": "func (auth *Auth) RemoveChild(child *Auth) {\n\tnewChildren := []*Auth{}\n\n\tfor _, c := range auth.Children {\n\t\tif c != child {\n\t\t\tnewChildren = append(newChildren, c)\n\t\t}\n\t}\n\n\tauth.Children = newChildren\n}", "title": "" }, { "docid": "e387ba0f561d89923335649f66e5fd1a", "score": "0.41766647", "text": "func setParent(parent INode, child INode) {\n\n\tif parent.GetNode() == child.GetNode() {\n\t\tpanic(\"Node.{Add,AddAt}: object can't be added as a child of itself\")\n\t}\n\t// If the specified node already has a parent,\n\t// remove it from the original parent's list of children\n\tif child.Parent() != nil {\n\t\tchild.Parent().GetNode().Remove(child)\n\t}\n\tchild.GetNode().parent = parent\n}", "title": "" }, { "docid": "aaa7abef4d9747ca3392fca88893f452", "score": "0.41673183", "text": "func (k Key) Child(k2 Key) Key {\n\tswitch {\n\tcase k.string == \"/\":\n\t\treturn k2\n\tcase k2.string == \"/\":\n\t\treturn k\n\tdefault:\n\t\treturn RawKey(k.string + k2.string)\n\t}\n}", "title": "" }, { "docid": "9ccd9854889f67411aae706cf16cf971", "score": "0.4167213", "text": "func (n *node) insertChild(c *node) {\n\tif c == nil {\n\t\treturn\n\t}\n\tif c.key.String() <= n.key.String() {\n\t\tn.leftP = c\n\t} else {\n\t\tn.rightP = c\n\t}\n\tc.parentP = n\n}", "title": "" }, { "docid": "5422326406be4452b8263aeefc51cf4c", "score": "0.4162156", "text": "func (m RelativeObjectMap) Insert(parent v1.Object, obj *unstructured.Unstructured) {\n\tinternalGvk := GroupVersionKind{obj.GroupVersionKind()}\n\tif m[internalGvk] == nil {\n\t\tm.InitGroup(obj.GroupVersionKind())\n\t}\n\tgroup := m[internalGvk]\n\tname := relativeName(parent, obj)\n\tgroup[name] = obj\n}", "title": "" }, { "docid": "e895d4ec39313586898fb4b2c0ade49c", "score": "0.41485474", "text": "func (e *Element2d) AddChild(c *Element2d) {\n\te.Children = append(e.Children, c)\n}", "title": "" }, { "docid": "443a1c3ef9a098af3f05198dfa893e64", "score": "0.41380703", "text": "func (c *Cache) Replace(d *Item) error {\n\tpath, err := c.filePath(d)\n\tif err != nil {\n\t\treturn ErrNotStored\n\t}\n\tif _, err = os.Stat(path); os.IsNotExist(err) {\n\t\treturn ErrNotStored\n\t}\n\treturn c.write(d)\n}", "title": "" }, { "docid": "0857e6d568008ea33909acf69fc30c46", "score": "0.41350436", "text": "func (r *ContractConstructorHolder) AsChild(objRef insolar.Reference) (*RootDomain, error) {\n\tref, err := common.CurrentProxyCtx.SaveAsChild(objRef, *PrototypeReference, r.constructorName, r.argsSerialized)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &RootDomain{Reference: ref}, nil\n}", "title": "" }, { "docid": "141a3ec9b40cda2f868422d8a69f3562", "score": "0.4134059", "text": "func (p *Path) ReplaceWithNode(dst *ast.File, node ast.Node) error {\n\tfor _, doc := range dst.Docs {\n\t\tif node.Type() == ast.DocumentType {\n\t\t\tnode = node.(*ast.DocumentNode).Body\n\t\t}\n\t\tif err := p.node.replace(doc.Body, node); err != nil {\n\t\t\treturn errors.Wrapf(err, \"failed to replace node by path ( %s )\", p.node)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "dbb60c73bbcfcefa17a845fda48a42a5", "score": "0.4130796", "text": "func (t *Table) Replace(key []byte, d types.Document) (types.Document, error) {\n\tif t.Info.ReadOnly {\n\t\treturn nil, errors.New(\"cannot write to read-only table\")\n\t}\n\n\td, err := t.Info.FieldConstraints.ValidateDocument(t.Tx, d)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn d, t.replace(key, d)\n}", "title": "" }, { "docid": "ea0deb8a3d61cda2208407f81035cbff", "score": "0.41167817", "text": "func (m *Map3D) Replace(replace, with equaler.Equaler) error {\n\tfor i := m.minX; i < m.maxX; i++ {\n\t\tfor j := m.minY; j < m.maxY; j++ {\n\t\t\tfor k := m.minZ; k < m.maxZ; k++ {\n\t\t\t\tif b := m.Get(i, j, k); b != nil && b.Equal(replace) {\n\t\t\t\t\tif err := m.Set(i, j, k, with); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5975c98eb0803f2bb7dc859172510bc3", "score": "0.4114275", "text": "func (t *Trie) ReplaceOrInsert(key []byte, value interface{}) *Node {\n\tif len(key) == 0 {\n\t\treturn nil\n\t}\n\tnode := t.root\n\tvar pre *Node\n\toffset := 0\n\tfor len(key[offset:]) > 0 {\n\t\te, size := utf8.DecodeRune(key[offset:])\n\t\tif e == utf8.RuneError {\n\t\t\treturn nil\n\t\t}\n\t\toffset += size\n\t\tif n, ok := node.children[e]; ok {\n\t\t\tnode = n\n\t\t\tpre = n\n\t\t} else {\n\t\t\tnode = node.NewChildNode(e, nil, false)\n\t\t\tpre = nil\n\t\t}\n\t}\n\n\t// new node\n\tif pre == nil {\n\t\tnode.value = value\n\t\tnode.term = true\n\t\tt.size++\n\t} else {\n\t\tnode = &Node{\n\t\t\tcode: pre.code,\n\t\t\tterm: pre.term,\n\t\t\tvalue: value,\n\t\t\tparent: pre.parent,\n\t\t\tchildren: pre.children,\n\t\t\tdepth: pre.depth,\n\t\t}\n\t\tnode.parent.ReplaceOrInsertChildNode(node)\n\t}\n\treturn pre\n}", "title": "" }, { "docid": "1b22f3b99fec62ccb1392f3a0c234f71", "score": "0.4111602", "text": "func (b *Branch) RemoveChild(n Node) {\n\tfor i, nn := range b.children {\n\t\tif nn == n {\n\t\t\tb.children = sliceRemove(b.children, i)\n\t\t\tb.children = append(b.children, n.Children()...)\n\t\t\tbreak\n\t\t}\n\t}\n}", "title": "" }, { "docid": "95c0b3a077e14a305f80b49d6884976e", "score": "0.41088194", "text": "func (c *Cache) Replace(k string, v interface{}, d time.Duration) error {\n\tc.mu.Lock()\n\t_, found := c.get(k)\n\tif !found {\n\t\tc.mu.Unlock()\n\t\treturn fmt.Errorf(\"Item %s doesn't exist\", k)\n\t}\n\tc.set(k, v, d)\n\tc.mu.Unlock()\n\treturn nil\n}", "title": "" }, { "docid": "45acaf5d68919c3606485f6cd8d3d64d", "score": "0.41018784", "text": "func (o *projectBase) Child(pk string) *Project {\n\tif o.mChildren == nil {\n\t\treturn nil\n\t}\n\treturn o.mChildren[pk]\n}", "title": "" } ]
f5d54cb6f280b27e40a980488b273226
ModTime returns modification time.
[ { "docid": "1d47eaf4bf714bca8b7f4806e3ce3467", "score": "0.81313306", "text": "func (i *FileInfo) ModTime() time.Time { return i.modTime }", "title": "" } ]
[ { "docid": "2fd02bfb08f4c6cb93a61055f843ad5a", "score": "0.8297828", "text": "func (fi *fileInfo) ModTime() time.Time { return fi.mtime }", "title": "" }, { "docid": "bbdb530ed2c14462501d9bb1f095ec2f", "score": "0.81134814", "text": "func (ff *File) ModTime() time.Time {\n\tff.RLock()\n\tdefer ff.RUnlock()\n\treturn ff.modTime\n}", "title": "" }, { "docid": "291f2bbb51a23d4096a045efaeb860eb", "score": "0.80770946", "text": "func (f *File) ModTime() time.Time {\n\treturn f.modTime\n}", "title": "" }, { "docid": "6259d421d0bb9f671394dc432ae109d5", "score": "0.8032446", "text": "func (fi *FileInfo) ModTime() time.Time {\n\treturn fi.LastModified\n}", "title": "" }, { "docid": "90c78817ebed0438802552b1bb531a1c", "score": "0.7972812", "text": "func (f *file) ModTime() (t time.Time) {\n\tif f.Object != nil {\n\t\tt = *f.LastModified\n\t}\n\treturn\n}", "title": "" }, { "docid": "6375b0d17ef5a6ebd58f4c7200775b5f", "score": "0.7943836", "text": "func (v *VFile) ModTime() time.Time {\n\treturn v.Mod\n}", "title": "" }, { "docid": "019b30d061bd1ddf313a8cd09a940b78", "score": "0.7840227", "text": "func (info *FileInfo) ModTime() time.Time {\n\treturn info.FileModTime\n}", "title": "" }, { "docid": "767153cb4d2197d1e37c61ec11e1ddaf", "score": "0.77753544", "text": "func (o SiaFileInfo) ModTime() time.Time {\n\treturn o.FileModTime\n}", "title": "" }, { "docid": "791ddd232feb00d64f7a8948de078cb1", "score": "0.77366686", "text": "func (s *memStat) ModTime() time.Time { return s.t }", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "8810dc6ec3c15b5f00b78e32a0968643", "score": "0.77146024", "text": "func (fi bindataFileInfo) ModTime() time.Time {\n\treturn fi.modTime\n}", "title": "" }, { "docid": "253d789e45a3d1798315a19bb6e1b05c", "score": "0.76796395", "text": "func (o *Object) ModTime(ctx context.Context) time.Time {\n\terr := o.readMetaData(ctx)\n\tif err != nil {\n\t\tfs.Logf(o, \"Failed to read metadata: %v\", err)\n\t\treturn time.Now()\n\t}\n\treturn o.modTime\n}", "title": "" }, { "docid": "253d789e45a3d1798315a19bb6e1b05c", "score": "0.76796395", "text": "func (o *Object) ModTime(ctx context.Context) time.Time {\n\terr := o.readMetaData(ctx)\n\tif err != nil {\n\t\tfs.Logf(o, \"Failed to read metadata: %v\", err)\n\t\treturn time.Now()\n\t}\n\treturn o.modTime\n}", "title": "" }, { "docid": "0432fb0f9b2057902340dd496e4b20d1", "score": "0.76667833", "text": "func (o *Object) ModTime(ctx context.Context) time.Time {\n\terr := o.readMetaData(ctx)\n\tif err != nil {\n\t\tfs.Debugf(o, \"Failed to read metadata: %v\", err)\n\t\treturn time.Now()\n\t}\n\treturn o.modTime\n}", "title": "" }, { "docid": "c765c469bdfffaf39c8edd29a8f42f07", "score": "0.7610898", "text": "func (e *Entry) ModTime() time.Time {\n\treturn e.st.ModTime()\n}", "title": "" }, { "docid": "b638afbcf5432de6a1f15bbbcde408d8", "score": "0.75888807", "text": "func (s *server) ModTime() time.Time {\n\treturn s.modT\n}", "title": "" }, { "docid": "d2f8d6baa480ee3609b2f772eb2cad6b", "score": "0.7571517", "text": "func (i *Inode) ModTime() time.Time {\n\treturn time.Now()\n}", "title": "" } ]
5ddc4d29dd7548db9d552cc05bbeeb36
RecoverVgroup recovers deleted vgroup
[ { "docid": "e06be9f8965bfe2c37dc1f65551584a2", "score": "0.71504194", "text": "func (v *VgroupService) RecoverVgroup(vgroup string) (*Vgroup, error) {\n\n\tdata := map[string]string{\"action\": \"recover\"}\n\tm, err := v.SetVgroup(vgroup, data)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn m, err\n}", "title": "" } ]
[ { "docid": "cfb61d421a499f3ed445878f072c4943", "score": "0.6062291", "text": "func (v *VgroupService) EradicateVgroup(vgroup string) (*Vgroup, error) {\n\n\tdata := map[string]bool{\"eradicate\": true}\n\tpath := fmt.Sprintf(\"vgroup/%s\", vgroup)\n\treq, err := v.client.NewRequest(\"DELETE\", path, nil, data)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tm := &Vgroup{}\n\t_, err = v.client.Do(req, m, false)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn m, err\n}", "title": "" }, { "docid": "e9632998c87e115332f42429114f1dbc", "score": "0.5285361", "text": "func Recycle(version string) {\n\tif _, ok := operationGroupVs[version]; ok {\n\t\tdelete(operationGroupVs, version)\n\t}\n}", "title": "" }, { "docid": "9255b0ca2cad77e07e8d76add1febce7", "score": "0.5149737", "text": "func (process *Process) Recover() {\n\tvar name string\n\tlastOperation := process.Process.GetCurrentOperation().ID\n\n\t// gets the name of the current stage\n\tsql := \"SELECT `content` FROM `operation` WHERE id=? LIMIT 0,1\"\n\tquery, err := database.Connection.Prepare(sql)\n\tquery.QueryRow(lastOperation).Scan(&name)\n\n\tif err != nil {\n\t\tfmt.Println(\"Error when selecting the harvest id:\")\n\t\tfmt.Println(err)\n\t}\n\n\tprocess.Process.Recover()\n\n\t// start channel\n\tgo process.run()\n\n\t// execute stage\n\tprocess.startFrom(name)\n}", "title": "" }, { "docid": "c4ecf71fcbcec1252c49e95efd88beaf", "score": "0.5021502", "text": "func RecycleAll() {\n\tfor version := range operationGroupVs {\n\t\tdelete(operationGroupVs, version)\n\t}\n}", "title": "" }, { "docid": "eb2e7304bf31349a05393486315ac02b", "score": "0.49955586", "text": "func (bp *BeaconProcess) runResharing(leader bool, oldGroup, newGroup *key.Group, timeout uint32) (*key.Group, error) {\n\toldBeaconID := commonutils.GetCanonicalBeaconID(oldGroup.ID)\n\n\toldNode := oldGroup.Find(bp.priv.Public)\n\toldPresent := oldNode != nil\n\n\tif leader && !oldPresent {\n\t\tbp.log.Errorw(\"\", \"run_reshare\", \"invalid\", \"leader\", leader, \"old_present\", oldPresent)\n\t\treturn nil, errors.New(\"can not be a leader if not present in the old group\")\n\t}\n\tsch := bp.priv.Scheme()\n\tnewNode := newGroup.Find(bp.priv.Public)\n\tnewPresent := newNode != nil\n\tconfig := &dkg.Config{\n\t\tSuite: sch.KeyGroup.(dkg.Suite),\n\t\tNewNodes: newGroup.DKGNodes(),\n\t\tOldNodes: oldGroup.DKGNodes(),\n\t\tLongterm: bp.priv.Key,\n\t\tThreshold: newGroup.Threshold,\n\t\tOldThreshold: oldGroup.Threshold,\n\t\tFastSync: true,\n\t\tNonce: getNonce(newGroup),\n\t\tAuth: sch.DKGAuthScheme,\n\t\tLog: bp.log,\n\t}\n\terr := func() error {\n\t\tbp.state.RLock()\n\t\tdefer bp.state.RUnlock()\n\t\t// gives the share to the dkg if we are a current node\n\t\tif oldPresent {\n\t\t\tif bp.dkgInfo != nil {\n\t\t\t\treturn errors.New(\"control: can't reshare from old node when DKG not finished first\")\n\t\t\t}\n\t\t\tif bp.share == nil {\n\t\t\t\treturn errors.New(\"control: can't reshare without a share\")\n\t\t\t}\n\t\t\tconfig.Share = &dkg.DistKeyShare{Commits: bp.share.Commits, Share: bp.share.Share}\n\t\t} else {\n\t\t\t// we are a new node, we want to make sure we reshare from the old\n\t\t\t// group public key\n\t\t\tconfig.PublicCoeffs = oldGroup.PublicKey.Coefficients\n\t\t}\n\t\treturn nil\n\t}()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tallNodes := nodeUnion(oldGroup.Nodes, newGroup.Nodes)\n\tvar board Broadcast = newEchoBroadcast(bp.log, bp.version, oldBeaconID, bp.privGateway.ProtocolClient,\n\t\tbp.priv.Public.Address(), allNodes, func(p dkg.Packet) error {\n\t\t\treturn dkg.VerifyPacketSignature(config, p)\n\t\t}, sch)\n\n\tif bp.dkgBoardSetup != nil {\n\t\tboard = bp.dkgBoardSetup(board)\n\t}\n\tphaser := bp.getPhaser(timeout)\n\n\tdkgProto, err := dkg.NewProtocol(config, board, phaser, true)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tinfo := &dkgInfo{\n\t\ttarget: newGroup,\n\t\tboard: board,\n\t\tphaser: phaser,\n\t\tconf: config,\n\t\tproto: dkgProto,\n\t}\n\tbp.state.Lock()\n\tbp.dkgInfo = info\n\tif leader {\n\t\tbp.log.Infow(\"\", \"dkg_reshare\", \"leader_start\",\n\t\t\t\"target_group\", hex.EncodeToString(newGroup.Hash()), \"index\", newNode.Index)\n\t\tbp.dkgInfo.started = true\n\t}\n\n\tmetrics.ReshareStateChange(metrics.ReshareInProgess, oldBeaconID, leader)\n\tbp.state.Unlock()\n\n\tif leader {\n\t\t// start the protocol so everyone else follows\n\t\t// it sends to all previous and new nodes. old nodes will start their\n\t\t// phaser so they will send the deals as soon as they receive this.\n\t\tgo phaser.Start()\n\t}\n\n\tbp.log.Infow(\"\", \"dkg_reshare\", \"wait_dkg_end\")\n\tfinalGroup, err := bp.WaitDKG()\n\tif err != nil {\n\t\tbp.state.Lock()\n\t\tif bp.dkgInfo == info {\n\t\t\tbp.cleanupDKG()\n\t\t}\n\t\tbp.state.Unlock()\n\t\treturn nil, fmt.Errorf(\"drand: err during DKG: %w\", err)\n\t}\n\tbp.log.Infow(\"\", \"dkg_reshare\", \"finished\", \"leader\", leader)\n\tmetrics.ReshareStateChange(metrics.ReshareIdle, oldBeaconID, leader)\n\n\t// runs the transition of the beacon\n\tgo bp.transition(oldGroup, oldPresent, newPresent)\n\treturn finalGroup, nil\n}", "title": "" }, { "docid": "ffefce72480fe00504ed1cb69e7dd6f1", "score": "0.4945279", "text": "func reconcile(targetGroupArn string) {\n\tif err := setupLbv2(); err != nil {\n\t\tklog.Warningln(err)\n\t\treturn\n\t}\n\tdes := lbv2.DescribeTargetHealthRequest(&elasticloadbalancingv2.DescribeTargetHealthInput{\n\t\tTargetGroupArn: &targetGroupArn,\n\t})\n\tctx, cancel := context.WithTimeout(context.Background(), 6*time.Second)\n\tdefer cancel()\n\tres, err := des.Send(ctx)\n\tif err != nil {\n\t\tklog.Errorln(err)\n\t\treturn\n\t}\n\tvar targets []elasticloadbalancingv2.TargetDescription\n\tfor _, desc := range res.TargetHealthDescriptions {\n\t\tif desc.TargetHealth.State == elasticloadbalancingv2.TargetHealthStateEnumUnhealthy {\n\t\t\ttargets = append(targets, *desc.Target)\n\t\t}\n\t}\n\tif len(targets) > 0 {\n\t\tdereg := lbv2.DeregisterTargetsRequest(&elasticloadbalancingv2.DeregisterTargetsInput{\n\t\t\tTargetGroupArn: &targetGroupArn,\n\t\t\tTargets: targets,\n\t\t})\n\t\t_, err := dereg.Send(ctx)\n\t\tif err != nil {\n\t\t\tklog.Errorln(err)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "61430d63f3864e8e49b0cf375ff9991f", "score": "0.49390838", "text": "func (vc *VMGroupController) Delete() error {\n\t_, err := vc.c.Client.Call(\"one.vmgroup.delete\", vc.ID)\n\treturn err\n}", "title": "" }, { "docid": "c3acda130797044403d5151d0f486029", "score": "0.49093005", "text": "func (c *criService) recover(ctx context.Context) error {\n\t// Recover all sandboxes.\n\tsandboxes, err := c.client.Containers(ctx, filterLabel(containerKindLabel, containerKindSandbox))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to list sandbox containers: %w\", err)\n\t}\n\n\teg, ctx2 := errgroup.WithContext(ctx)\n\tfor _, sandbox := range sandboxes {\n\t\tsandbox := sandbox\n\t\teg.Go(func() error {\n\t\t\tsb, err := c.loadSandbox(ctx2, sandbox)\n\t\t\tif err != nil {\n\t\t\t\tlog.G(ctx2).WithError(err).Errorf(\"Failed to load sandbox %q\", sandbox.ID())\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tlog.G(ctx2).Debugf(\"Loaded sandbox %+v\", sb)\n\t\t\tif err := c.sandboxStore.Add(sb); err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to add sandbox %q to store: %w\", sandbox.ID(), err)\n\t\t\t}\n\t\t\tif err := c.sandboxNameIndex.Reserve(sb.Name, sb.ID); err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to reserve sandbox name %q: %w\", sb.Name, err)\n\t\t\t}\n\t\t\treturn nil\n\t\t})\n\t}\n\tif err := eg.Wait(); err != nil {\n\t\treturn err\n\t}\n\n\t// Recover all containers.\n\tcontainers, err := c.client.Containers(ctx, filterLabel(containerKindLabel, containerKindContainer))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to list containers: %w\", err)\n\t}\n\teg, ctx2 = errgroup.WithContext(ctx)\n\tfor _, container := range containers {\n\t\tcontainer := container\n\t\teg.Go(func() error {\n\t\t\tcntr, err := c.loadContainer(ctx2, container)\n\t\t\tif err != nil {\n\t\t\t\tlog.G(ctx2).WithError(err).Errorf(\"Failed to load container %q\", container.ID())\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tlog.G(ctx2).Debugf(\"Loaded container %+v\", cntr)\n\t\t\tif err := c.containerStore.Add(cntr); err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to add container %q to store: %w\", container.ID(), err)\n\t\t\t}\n\t\t\tif err := c.containerNameIndex.Reserve(cntr.Name, cntr.ID); err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to reserve container name %q: %w\", cntr.Name, err)\n\t\t\t}\n\t\t\treturn nil\n\t\t})\n\t}\n\tif err := eg.Wait(); err != nil {\n\t\treturn err\n\t}\n\n\t// Recover all images.\n\tcImages, err := c.client.ListImages(ctx)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to list images: %w\", err)\n\t}\n\tc.loadImages(ctx, cImages)\n\n\t// It's possible that containerd containers are deleted unexpectedly. In that case,\n\t// we can't even get metadata, we should cleanup orphaned sandbox/container directories\n\t// with best effort.\n\n\t// Cleanup orphaned sandbox and container directories without corresponding containerd container.\n\tfor _, cleanup := range []struct {\n\t\tcntrs []containerd.Container\n\t\tbase string\n\t\terrMsg string\n\t}{\n\t\t{\n\t\t\tcntrs: sandboxes,\n\t\t\tbase: filepath.Join(c.config.RootDir, sandboxesDir),\n\t\t\terrMsg: \"failed to cleanup orphaned sandbox directories\",\n\t\t},\n\t\t{\n\t\t\tcntrs: sandboxes,\n\t\t\tbase: filepath.Join(c.config.StateDir, sandboxesDir),\n\t\t\terrMsg: \"failed to cleanup orphaned volatile sandbox directories\",\n\t\t},\n\t\t{\n\t\t\tcntrs: containers,\n\t\t\tbase: filepath.Join(c.config.RootDir, containersDir),\n\t\t\terrMsg: \"failed to cleanup orphaned container directories\",\n\t\t},\n\t\t{\n\t\t\tcntrs: containers,\n\t\t\tbase: filepath.Join(c.config.StateDir, containersDir),\n\t\t\terrMsg: \"failed to cleanup orphaned volatile container directories\",\n\t\t},\n\t} {\n\t\tif err := cleanupOrphanedIDDirs(ctx, cleanup.cntrs, cleanup.base); err != nil {\n\t\t\treturn fmt.Errorf(\"%s: %w\", cleanup.errMsg, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "39d7947ccb73b47597c6b0813498d65d", "score": "0.4884671", "text": "func (c *Client) RecoverVirtualMachine(p *RecoverVirtualMachineParameter) (*VirtualMachine, error) {\n\tobj, err := c.Request(\"recoverVirtualMachine\", convertParamToMap(p))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn obj.(*VirtualMachine), err\n}", "title": "" }, { "docid": "bd9e13ee1208e4d47a4b62cb25d648df", "score": "0.488308", "text": "func (c *client) Delete(ctx context.Context, group, name string) error {\n\tvhd, err := c.Get(ctx, group, name)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(*vhd) == 0 {\n\t\treturn fmt.Errorf(\"Virtual Network [%s] not found\", name)\n\t}\n\n\trequest, err := getVirtualMachineImageRequest(wssdcloudcommon.Operation_DELETE, group, name, &(*vhd)[0])\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = c.VirtualMachineImageAgentClient.Invoke(ctx, request)\n\n\treturn err\n\n}", "title": "" }, { "docid": "b8a72cd25d6c2c8c46393931de5b0f8f", "score": "0.48591793", "text": "func OpenshiftVerifyRedisPVCRecovery(t TestingTB, ctx *TestingContext, namespace string) error {\n\ttestRedis, namespace, err := getBasicTestRedis(ctx, namespace)\n\tif err != nil {\n\t\treturn errorUtil.Wrapf(err, \"failed to get redis\")\n\t}\n\n\t// verify redis create\n\tif err := redisCreateTest(t, ctx, testRedis, namespace); err != nil {\n\t\treturn errorUtil.Wrapf(err, \"create redis test failure\")\n\t}\n\n\t// delete redis pvc\n\tif err := ctx.Client.Delete(goctx.TODO(), GetTestPVC(redisName, namespace)); err != nil {\n\t\treturn errorUtil.Wrapf(err, \"failed to delete redis pvc\")\n\t}\n\n\t// wait for redis service\n\tif err := WaitForDeployment(t, ctx.KubeClient, namespace, redisName, 1, retryInterval, timeout); err != nil {\n\t\treturn errorUtil.Wrapf(err, \"could not get redis re-deployment\")\n\t}\n\n\t// verify deployment is available\n\tif err := verifySuccessfulRedisDeploymentStatus(ctx, namespace); err != nil {\n\t\treturn errorUtil.Wrapf(err, \"unable to verify successful status\")\n\t}\n\n\t// cleanup redis\n\tif err := redisDeleteTest(t, ctx, testRedis, namespace); err != nil {\n\t\treturn errorUtil.Wrapf(err, \"delete redis test failure\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "5d81a272ab9e7ce5cb37bb50dbd140de", "score": "0.48045146", "text": "func WaitForBKClusterToRollback(t *testing.T, k8client client.Client, b *bkapi.BookkeeperCluster, targetVersion string) error {\n\tlog.Printf(\"waiting for cluster to rollback: %s\", b.Name)\n\n\tlistOptions := []client.ListOption{\n\t\tclient.InNamespace(b.GetNamespace()),\n\t\tclient.MatchingLabelsSelector{Selector: labels.SelectorFromSet(map[string]string{\"bookkeeper_cluster\": b.GetName()})},\n\t}\n\n\terr := wait.Poll(RetryInterval, UpgradeTimeout, func() (done bool, err error) {\n\t\tcluster, err := GetBKCluster(t, k8client, b)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\n\t\t_, rollbackCondition := cluster.Status.GetClusterCondition(bkapi.ClusterConditionRollback)\n\t\t_, errorCondition := cluster.Status.GetClusterCondition(bkapi.ClusterConditionError)\n\n\t\tlog.Printf(\"waiting for cluster to rollback (rollback in progress: %s)\", rollbackCondition.Status)\n\n\t\tif errorCondition.Status == corev1.ConditionTrue && errorCondition.Reason == \"RollbackFailed\" {\n\t\t\treturn false, fmt.Errorf(\"failed rolling back cluster: [%s] %s\", errorCondition.Reason, errorCondition.Message)\n\t\t}\n\n\t\tif rollbackCondition.Status == corev1.ConditionFalse && cluster.Status.CurrentVersion == targetVersion {\n\t\t\t// Cluster rolled back\n\t\t\treturn true, nil\n\t\t}\n\t\treturn false, nil\n\t})\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// check whether PVCs have been reattached\n\tpvcList := corev1.PersistentVolumeClaimList{}\n\terr = k8client.List(goctx.TODO(), &pvcList, listOptions...)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tindex, journal, ledger := int32(0), int32(0), int32(0)\n\n\tfor i := range pvcList.Items {\n\t\tpvc := &pvcList.Items[i]\n\t\tif strings.HasPrefix(pvc.Name, \"index\") {\n\t\t\tindex++\n\t\t} else if strings.HasPrefix(pvc.Name, \"journal\") {\n\t\t\tjournal++\n\t\t} else if strings.HasPrefix(pvc.Name, \"ledger\") {\n\t\t\tledger++\n\t\t}\n\t}\n\n\tif index != b.Spec.Replicas || journal != b.Spec.Replicas || ledger != b.Spec.Replicas {\n\t\treturn fmt.Errorf(\"PVC count mismatch\")\n\t}\n\n\tlog.Printf(\"bookkeeper cluster rolled back: %s\", b.Name)\n\treturn nil\n}", "title": "" }, { "docid": "b195a377bf3217cb6827c1a960f5de41", "score": "0.47874528", "text": "func (f *Framework) GetDiskGroup(namespace *k8sv1.Namespace, pvc *k8sv1.PersistentVolumeClaim, deletePod bool) (string, error) {\n\texecutorPod, err := f.startVerifierPod(namespace, pvc)\n\tif err != nil {\n\t\tfmt.Fprintf(ginkgo.GinkgoWriter, \"INFO: could not start verifier pod: [%s]\\n\", err)\n\t\treturn \"\", err\n\t}\n\n\tcmd := fmt.Sprintf(\"ls -ln %s/disk.img\", utils.DefaultPvcMountPath)\n\n\toutput, stderr, err := f.ExecShellInPod(executorPod.Name, namespace.Name, cmd)\n\tfmt.Fprintf(ginkgo.GinkgoWriter, \"INFO: ln -ln disk.img: %s\\n\", output)\n\tif err != nil {\n\t\tfmt.Fprintf(ginkgo.GinkgoWriter, \"INFO: stderr: [%s]\\n\", stderr)\n\t}\n\tcmd = fmt.Sprintf(\"x=$(ls -ln %s/disk.img); y=($x); echo ${y[3]}\", utils.DefaultPvcMountPath)\n\n\toutput, stderr, err = f.ExecShellInPod(executorPod.Name, namespace.Name, cmd)\n\n\tif deletePod {\n\t\terr := f.K8sClient.CoreV1().Pods(namespace.Name).Delete(context.TODO(), executorPod.Name, metav1.DeleteOptions{})\n\t\tgomega.Expect(err).ToNot(gomega.HaveOccurred())\n\t\tgomega.Eventually(func() bool {\n\t\t\tif _, err := f.K8sClient.CoreV1().Pods(namespace.Name).Get(context.TODO(), executorPod.Name, metav1.GetOptions{}); err != nil {\n\t\t\t\tif apierrs.IsNotFound(err) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t\tgomega.Expect(err).ToNot(gomega.HaveOccurred())\n\t\t\t}\n\t\t\treturn false\n\t\t}, 90*time.Second, 2*time.Second).Should(gomega.BeTrue())\n\t}\n\n\tif err != nil {\n\t\tfmt.Fprintf(ginkgo.GinkgoWriter, \"INFO: stderr: [%s]\\n\", stderr)\n\t\treturn \"\", err\n\t}\n\tfmt.Fprintf(ginkgo.GinkgoWriter, \"INFO: gid of disk.img: %s\\n\", output)\n\treturn output, nil\n}", "title": "" }, { "docid": "31409a79032d7b2dd7486377d474fa5e", "score": "0.47811547", "text": "func (c *controller) reconcileClusterMachineSafetyOrphanVMs(key string) error {\n\tctx := context.Background()\n\treSyncAfter := c.safetyOptions.MachineSafetyOrphanVMsPeriod.Duration\n\tdefer c.machineSafetyOrphanVMsQueue.AddAfter(\"\", reSyncAfter)\n\n\tklog.V(4).Infof(\"reconcileClusterMachineSafetyOrphanVMs: Start\")\n\tdefer klog.V(4).Infof(\"reconcileClusterMachineSafetyOrphanVMs: End, reSync-Period: %v\", reSyncAfter)\n\n\tc.checkVMObjects(ctx)\n\n\treturn nil\n}", "title": "" }, { "docid": "f9015a77c2c8e3f7d0450ae9d40b993b", "score": "0.47793004", "text": "func (ident *IdentitySecretsEngine) cleanupGroups() {\n\tident.fetchGroups()\n\tfor _, v := range ident.existingGroups {\n\t\tif _, ok := ident.groups[v.Name]; ok {\n\t\t\tlog.Debugf(\"Identity group [%s] exists in configuration, no cleanup necessary\", v.Name)\n\t\t} else {\n\t\t\ttask := taskDelete{\n\t\t\t\tDescription: fmt.Sprintf(\"Identity group [%s]\", v.Name),\n\t\t\t\tPath: path.Join(ident.MountPath, \"group/name\", v.Name),\n\t\t\t}\n\t\t\ttaskPromptChan <- task\n\t\t}\n\t}\n}", "title": "" }, { "docid": "20b16fe708be151e03a8e55169fb73da", "score": "0.47454098", "text": "func assertRecoverKey(vm *VM) {\n\tw := vm.WasmGo\n\n\tpublen := int(vm.popUint64())\n\tpub := int(vm.popUint64())\n\tsiglen := int(vm.popUint64())\n\tsig := int(vm.popUint64())\n\tdigest := int(vm.popUint64())\n\n\tdigBytes := getSha256(vm, digest)\n\tsigBytes := getMemory(vm, sig, siglen)\n\tpubBytes := getMemory(vm, pub, publen)\n\n\tw.ilog.Debug(\"digest:%v signature:%v publickey:%v\", digBytes, sigBytes, pubBytes)\n\n\ts := ecc.NewSigNil()\n\tp := ecc.NewPublicKeyNil()\n\n\td := digBytes\n\trlp.DecodeBytes(sigBytes, s)\n\trlp.DecodeBytes(pubBytes, p)\n\n\tcheck, err := s.PublicKey(d)\n\tEosAssert(err == nil, &CryptoApiException{}, \"can not get the right publickey from digest\")\n\tEosAssert(strings.Compare(check.String(), p.String()) == 0, &CryptoApiException{}, \"Error expected key different than recovered key\")\n\n}", "title": "" }, { "docid": "5aec78f805acd89c0b07a5d63f389b96", "score": "0.473345", "text": "func (pb *PBServer) ElectRecoveryMaster(args *ElectRecoveryMasterArgs, reply *ElectRecoveryMasterReply) error {\n\n recoveryData := args.RecoveryData\n segmentsRecovered := make(map[int64]*Segment)\n segmentsInProcess := make(map[int64]time.Time)\n\n var recoveryMu sync.Mutex\n\n // which shards are we interested in for this recovery\n shards := make(map[int]bool)\n for shard, _ := range recoveryData {\n shards[shard] = true\n }\n\n recoveredData := make(map[int]int)\n\n for {\n\n // fmt.Println(recoveryData)\n\n for shard, segsToBackups := range recoveryData { // for each shard that we're tasked with recovering\n\n for seg, backups := range segsToBackups { // and each log segment needed to recover that shard\n\n recoveryMu.Lock()\n _, recovered := segmentsRecovered[seg]\n recoveryTime, inProcess := segmentsInProcess[seg]\n recoveryMu.Unlock()\n\n // ten second timeout on single shard.\n if (!inProcess || time.Since(recoveryTime) >= 10 * time.Second) && !recovered {\n\n recoveryMu.Lock()\n segmentsInProcess[seg] = time.Now()\n recoveryMu.Unlock()\n\n backup := backups[rand.Int() % len(backups)]\n\n go func(seg int64, backup string, shard int) {\n\n var mainPrimary string\n\n OUTER:\n for primary, shards := range args.DeadPrimaries {\n for _, s := range shards {\n if s == shard {\n mainPrimary = primary\n break OUTER\n }\n }\n }\n\n pullSegmentsArgs := new(PullSegmentsByShardsArgs)\n pullSegmentsArgs.Segments = []int64{seg}\n pullSegmentsArgs.Shards = shards\n pullSegmentsArgs.Owner = mainPrimary\n\n pullSegmentsReply := new(PullSegmentsByShardsReply)\n\n // fmt.Printf(\"Attempting: %s recovering segment %d from %s for %s:%d \\n\", pb.me, seg, backup, mainPrimary, shard)\n ok1 := call(backup, \"PBServer.PullSegmentsByShards\", pb.networkMode, pullSegmentsArgs, pullSegmentsReply)\n\n if ok1 {\n\n recoveryMu.Lock()\n recovered := pullSegmentsReply.Segments[0]\n segmentsRecovered[seg] = &recovered\n delete(segmentsInProcess, seg)\n recoveryMu.Unlock()\n\n for _, newOp := range recovered.Ops {\n\n recoveryMu.Lock()\n recoveredData[shard] = recoveredData[shard] + newOp.size()\n recoveryMu.Unlock()\n\n pb.mu.Lock()\n\n op := newOp\n\n currOp, ok := pb.store[op.Key]\n\n if ok {\n // if the version of the key in the data store is more up-to-date,\n // don't bother processing the recovered operation.\n if currOp.Version > op.Version {\n pb.mu.Unlock()\n continue\n }\n }\n\n seg, _ := pb.log.getCurrSegment()\n group, ok := pb.backups[seg.ID]\n\n if ! ok {\n if pb.enlistReplicas(*seg) == false {\n fmt.Println(\"couldn't enlist enough replicas\")\n pb.mu.Unlock()\n return\n } else {\n group = pb.backups[seg.ID]\n }\n }\n\n newGroup := make([]string, 0)\n for _, srv := range group.Backups {\n _, dead := args.DeadPrimaries[srv]\n if dead == false && pb.serversAlive[srv] {\n newGroup = append(newGroup, srv)\n }\n }\n\n group.Backups = newGroup\n pb.backups[seg.ID] = group\n\n flushed := false\n if seg.append(op) == false {\n flushed = true\n if pb.broadcastFlush(seg.ID, group) {\n seg = pb.log.newSegment()\n seg.append(op)\n if pb.enlistReplicas(*seg) == false {\n fmt.Println(\"couldn't enlist enough replicas\")\n } else {\n group = pb.backups[seg.ID]\n }\n } else {\n fmt.Println(\"backup failure on flush\")\n }\n }\n\n if flushed || pb.broadcastForward(op, seg.ID, group) {\n pb.store[op.Key] = &op\n } else {\n fmt.Println(\"backup failure on fwd\")\n }\n\n pb.mu.Unlock()\n }\n\n }\n\n }(seg, backup, shard)\n\n }\n\n }\n\n // have we seen all the segments that we need for a given shard?\n seenAll := true\n for seg, _ := range segsToBackups {\n _, seen := segmentsRecovered[seg]\n if ! seen {\n seenAll = false\n break\n }\n }\n\n if seenAll {\n delete(recoveryData, shard)\n pb.clerk.RecoveryCompleted(pb.me, shard, recoveredData[shard])\n }\n\n }\n\n if len(recoveryData) == 0 {\n return nil\n } else {\n time.Sleep(50 * time.Millisecond)\n }\n\n }\n\n\n return nil\n}", "title": "" }, { "docid": "21c466748634a206d04efa6cc36a7336", "score": "0.47281387", "text": "func resourceNetboxIpamVrfDomainDelete(d *schema.ResourceData, meta interface{}) error {\n\tlog.Debugf(\"Deleting VRF: %v\\n\", d)\n\n\tid := int64(d.Get(\"vrf_id\").(int))\n\n\tvar deleteParameters = ipam.NewIPAMVrfsDeleteParams().WithID(id)\n\n\tc := meta.(*ProviderNetboxClient).client\n\n\tout, err := c.IPAM.IPAMVrfsDelete(deleteParameters, nil)\n\n\tif err != nil {\n\t\tlog.Debugf(\"Failed to execute IPAMVrfsDelete: %v\", err)\n\t}\n\n\tlog.Debugf(\"Done Executing IPAMVrfsDelete: %v\", out)\n\n\treturn nil\n}", "title": "" }, { "docid": "4db58b0a654518c5dfd922106ce3105b", "score": "0.47275245", "text": "func (vs *StoreVersionSet) Recover() error {\n\tif !util.Exist(filepath.Join(vs.storePath, current())) {\n\t\tvs.logger.Info(\"version set's current file not exist, initialize it\", zap.String(\"store\", vs.storePath))\n\t\tif err := vs.initJournal(); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}\n\tvs.logger.Info(\"recover version set data from journal file\", zap.String(\"store\", vs.storePath))\n\tif err := vs.recover(); err != nil {\n\t\treturn err\n\t}\n\tif err := vs.initJournal(); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cad3e673af56fb53f716487c0e38adb9", "score": "0.46912313", "text": "func RecoverDelete(w http.ResponseWriter, r *http.Request) {\n\tusername, password, err := auth.ParseBasicAuth(r)\n\tif err != nil {\n\t\tlogger.Error(err.Error())\n\t\terr := api.Api.BuildErrorResponse(http.StatusUnauthorized, \"wrong auth format\", w)\n\t\tlogger.CheckErr(err)\n\t\treturn\n\t}\n\n\tif msg, err := managers.RecoveryManagerDelete(username, password); err != nil {\n\t\tapi.Api.BuildErrorResponse(http.StatusInternalServerError, msg, w)\n\t\treturn\n\t}\n\n\tapi.Api.BuildJsonResponse(true, \"recover settings removed\", nil, w)\n}", "title": "" }, { "docid": "ad5dd9c6e0f13399308258e4dcb534f5", "score": "0.46867025", "text": "func Recover() {\n\tdoRecover(recover(), false)\n}", "title": "" }, { "docid": "61cc6afc763e16beb085ead5c79892b4", "score": "0.46681184", "text": "func (future *LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture) result(client LongTermRetentionManagedInstanceBackupsClient) (ar autorest.Response, err error) {\n\tvar done bool\n\tdone, err = future.DoneWithContext(context.Background(), client)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"sql.LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture\", \"Result\", future.Response(), \"Polling failure\")\n\t\treturn\n\t}\n\tif !done {\n\t\tar.Response = future.Response()\n\t\terr = azure.NewAsyncOpIncompleteError(\"sql.LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture\")\n\t\treturn\n\t}\n\tar.Response = future.Response()\n\treturn\n}", "title": "" }, { "docid": "91fcbb55353f9a78383201201d179b2f", "score": "0.46585658", "text": "func verifyCRDInSupervisor(ctx context.Context, f *framework.Framework, expectedInstanceName string, crdName string, crdVersion string, crdGroup string, isCreated bool) {\n\tk8senv := GetAndExpectStringEnvVar(\"SUPERVISOR_CLUSTER_KUBE_CONFIG\")\n\tcfg, err := clientcmd.BuildConfigFromFlags(\"\", k8senv)\n\tgomega.Expect(err).NotTo(gomega.HaveOccurred())\n\tdynamicClient, err := dynamic.NewForConfig(cfg)\n\tgomega.Expect(err).NotTo(gomega.HaveOccurred())\n\tgvr := schema.GroupVersionResource{Group: crdGroup, Version: crdVersion, Resource: crdName}\n\tresourceClient := dynamicClient.Resource(gvr).Namespace(\"\")\n\tlist, err := resourceClient.List(ctx, metav1.ListOptions{})\n\tgomega.Expect(err).NotTo(gomega.HaveOccurred())\n\n\tvar instanceFound bool\n\tfor _, crd := range list.Items {\n\t\tif crdName == \"cnsnodevmattachments\" {\n\t\t\tinstance := &cnsnodevmattachmentv1alpha1.CnsNodeVmAttachment{}\n\t\t\terr := runtime.DefaultUnstructuredConverter.FromUnstructured(crd.Object, instance)\n\t\t\tgomega.Expect(err).NotTo(gomega.HaveOccurred())\n\t\t\tif expectedInstanceName == instance.Name {\n\t\t\t\tginkgo.By(fmt.Sprintf(\"Found CNSNodeVMAttachment crd: %v, expected: %v\", instance, expectedInstanceName))\n\t\t\t\tinstanceFound = true\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t}\n\t\tif crdName == \"cnsvolumemetadatas\" {\n\t\t\tinstance := &cnsvolumemetadatav1alpha1.CnsVolumeMetadata{}\n\t\t\terr := runtime.DefaultUnstructuredConverter.FromUnstructured(crd.Object, instance)\n\t\t\tgomega.Expect(err).NotTo(gomega.HaveOccurred())\n\t\t\tif expectedInstanceName == instance.Name {\n\t\t\t\tginkgo.By(fmt.Sprintf(\"Found CNSVolumeMetadata crd: %v, expected: %v\", instance, expectedInstanceName))\n\t\t\t\tinstanceFound = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif isCreated {\n\t\tgomega.Expect(instanceFound).To(gomega.BeTrue())\n\t} else {\n\t\tgomega.Expect(instanceFound).To(gomega.BeFalse())\n\t}\n}", "title": "" }, { "docid": "ab9e05f6cb2ac832dfc469274d43d6ad", "score": "0.4655506", "text": "func (vtgr *VTGR) OverrideRebootstrapGroupSize(groupSize int) error {\n\terrorRecord := concurrency.AllErrorRecorder{}\n\tfor _, shard := range vtgr.Shards {\n\t\terr := shard.OverrideRebootstrapGroupSize(groupSize)\n\t\tif err != nil {\n\t\t\terrorRecord.RecordError(err)\n\t\t}\n\t}\n\treturn errorRecord.Error()\n}", "title": "" }, { "docid": "d9bd1a5caf15e9d8ae80f5f66743e711", "score": "0.46524832", "text": "func TestRecoveryImpl(t *testing.T) {\n\tdefer cluster.PanicHandler(t)\n\tdefer tabletsTeardown()\n\tverifyInitialReplication(t)\n\n\t// take first backup of value = test1\n\terr := localCluster.VtctlclientProcess.ExecuteCommand(\"Backup\", replica1.Alias)\n\tassert.NoError(t, err)\n\n\tbackups := listBackups(t)\n\trequire.Equal(t, len(backups), 1)\n\tassert.Contains(t, backups[0], replica1.Alias)\n\n\terr = localCluster.VtctlclientProcess.ApplyVSchema(keyspaceName, vSchema)\n\tassert.NoError(t, err)\n\n\toutput, err := localCluster.VtctlclientProcess.ExecuteCommandWithOutput(\"GetVSchema\", keyspaceName)\n\tassert.NoError(t, err)\n\tassert.Contains(t, output, \"vt_insert_test\")\n\n\t// restore with latest backup\n\trestoreTime := time.Now().UTC()\n\trecovery.RestoreTablet(t, localCluster, replica2, recoveryKS1, \"0\", keyspaceName, commonTabletArg, restoreTime)\n\n\toutput, err = localCluster.VtctlclientProcess.ExecuteCommandWithOutput(\"GetSrvVSchema\", cell)\n\tassert.NoError(t, err)\n\tassert.Contains(t, output, keyspaceName)\n\tassert.Contains(t, output, recoveryKS1)\n\n\toutput, err = localCluster.VtctlclientProcess.ExecuteCommandWithOutput(\"GetVSchema\", recoveryKS1)\n\tassert.NoError(t, err)\n\tassert.Contains(t, output, \"vt_insert_test\")\n\n\tcluster.VerifyRowsInTablet(t, replica2, keyspaceName, 1)\n\n\t// verify that restored replica has value = test1\n\tqr, err := replica2.VttabletProcess.QueryTablet(\"select msg from vt_insert_test where id = 1\", keyspaceName, true)\n\tassert.NoError(t, err)\n\tassert.Equal(t, \"test1\", qr.Rows[0][0].ToString())\n\n\t// insert new row on primary\n\t_, err = primary.VttabletProcess.QueryTablet(\"insert into vt_insert_test (msg) values ('test2')\", keyspaceName, true)\n\tassert.NoError(t, err)\n\tcluster.VerifyRowsInTablet(t, replica1, keyspaceName, 2)\n\n\t// update the original row in primary\n\t_, err = primary.VttabletProcess.QueryTablet(\"update vt_insert_test set msg = 'msgx1' where id = 1\", keyspaceName, true)\n\tassert.NoError(t, err)\n\n\t// verify that primary has new value\n\tqr, err = primary.VttabletProcess.QueryTablet(\"select msg from vt_insert_test where id = 1\", keyspaceName, true)\n\tassert.NoError(t, err)\n\tassert.Equal(t, \"msgx1\", qr.Rows[0][0].ToString())\n\n\t// check that replica1, used for the backup, has the new value\n\tctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)\n\tdefer cancel()\n\n\tticker := time.NewTicker(time.Second)\n\tdefer ticker.Stop()\n\n\tfor {\n\t\tqr, err = replica1.VttabletProcess.QueryTablet(\"select msg from vt_insert_test where id = 1\", keyspaceName, true)\n\t\tassert.NoError(t, err)\n\t\tif qr.Rows[0][0].ToString() == \"msgx1\" {\n\t\t\tbreak\n\t\t}\n\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\tt.Error(\"timeout waiting for new value to be replicated on replica 1\")\n\t\t\tbreak\n\t\tcase <-ticker.C:\n\t\t}\n\t}\n\n\t// take second backup of value = msgx1\n\terr = localCluster.VtctlclientProcess.ExecuteCommand(\"Backup\", replica1.Alias)\n\tassert.NoError(t, err)\n\n\t// restore to first backup\n\trecovery.RestoreTablet(t, localCluster, replica3, recoveryKS2, \"0\", keyspaceName, commonTabletArg, restoreTime)\n\n\toutput, err = localCluster.VtctlclientProcess.ExecuteCommandWithOutput(\"GetVSchema\", recoveryKS2)\n\tassert.NoError(t, err)\n\tassert.Contains(t, output, \"vt_insert_test\")\n\n\t// only one row from first backup\n\tcluster.VerifyRowsInTablet(t, replica3, keyspaceName, 1)\n\n\t//verify that restored replica has value = test1\n\tqr, err = replica3.VttabletProcess.QueryTablet(\"select msg from vt_insert_test where id = 1\", keyspaceName, true)\n\tassert.NoError(t, err)\n\tassert.Equal(t, \"test1\", qr.Rows[0][0].ToString())\n\n\tvtgateInstance := localCluster.NewVtgateInstance()\n\tvtgateInstance.TabletTypesToWait = \"REPLICA\"\n\terr = vtgateInstance.Setup()\n\tlocalCluster.VtgateGrpcPort = vtgateInstance.GrpcPort\n\tassert.NoError(t, err)\n\tdefer vtgateInstance.TearDown()\n\tassert.NoError(t, vtgateInstance.WaitForStatusOfTabletInShard(fmt.Sprintf(\"%s.%s.primary\", keyspaceName, shardName), 1, 30*time.Second))\n\tassert.NoError(t, vtgateInstance.WaitForStatusOfTabletInShard(fmt.Sprintf(\"%s.%s.replica\", keyspaceName, shardName), 1, 30*time.Second))\n\tassert.NoError(t, vtgateInstance.WaitForStatusOfTabletInShard(fmt.Sprintf(\"%s.%s.replica\", recoveryKS1, shardName), 1, 30*time.Second))\n\tassert.NoError(t, vtgateInstance.WaitForStatusOfTabletInShard(fmt.Sprintf(\"%s.%s.replica\", recoveryKS2, shardName), 1, 30*time.Second))\n\n\t// Build vtgate grpc connection\n\tgrpcAddress := fmt.Sprintf(\"%s:%d\", localCluster.Hostname, localCluster.VtgateGrpcPort)\n\tvtgateConn, err := vtgateconn.Dial(context.Background(), grpcAddress)\n\tassert.NoError(t, err)\n\tdefer vtgateConn.Close()\n\tsession := vtgateConn.Session(\"@replica\", nil)\n\n\t// check that vtgate doesn't route queries to new tablet\n\trecovery.VerifyQueriesUsingVtgate(t, session, \"select count(*) from vt_insert_test\", \"INT64(2)\")\n\trecovery.VerifyQueriesUsingVtgate(t, session, \"select msg from vt_insert_test where id = 1\", `VARCHAR(\"msgx1\")`)\n\trecovery.VerifyQueriesUsingVtgate(t, session, fmt.Sprintf(\"select count(*) from %s.vt_insert_test\", recoveryKS1), \"INT64(1)\")\n\trecovery.VerifyQueriesUsingVtgate(t, session, fmt.Sprintf(\"select msg from %s.vt_insert_test where id = 1\", recoveryKS1), `VARCHAR(\"test1\")`)\n\trecovery.VerifyQueriesUsingVtgate(t, session, fmt.Sprintf(\"select count(*) from %s.vt_insert_test\", recoveryKS2), \"INT64(1)\")\n\trecovery.VerifyQueriesUsingVtgate(t, session, fmt.Sprintf(\"select msg from %s.vt_insert_test where id = 1\", recoveryKS2), `VARCHAR(\"test1\")`)\n\n\t// check that new keyspace is accessible with 'use ks'\n\tcluster.ExecuteQueriesUsingVtgate(t, session, \"use \"+recoveryKS1+\"@replica\")\n\trecovery.VerifyQueriesUsingVtgate(t, session, \"select count(*) from vt_insert_test\", \"INT64(1)\")\n\n\tcluster.ExecuteQueriesUsingVtgate(t, session, \"use \"+recoveryKS2+\"@replica\")\n\trecovery.VerifyQueriesUsingVtgate(t, session, \"select count(*) from vt_insert_test\", \"INT64(1)\")\n\n\t// check that new tablet is accessible with use `ks:shard`\n\tcluster.ExecuteQueriesUsingVtgate(t, session, \"use `\"+recoveryKS1+\":0@replica`\")\n\trecovery.VerifyQueriesUsingVtgate(t, session, \"select count(*) from vt_insert_test\", \"INT64(1)\")\n\n\tcluster.ExecuteQueriesUsingVtgate(t, session, \"use `\"+recoveryKS2+\":0@replica`\")\n\trecovery.VerifyQueriesUsingVtgate(t, session, \"select count(*) from vt_insert_test\", \"INT64(1)\")\n}", "title": "" }, { "docid": "274a5159371f421d78d5f56139bd004e", "score": "0.46410334", "text": "func restoreEtcdCluster(t *testing.T, s3Path, etcdClusterName string) {\n\tf := framework.Global\n\trestoreSource := eopapi.RestoreSource{S3: eope2eutil.NewS3RestoreSource(s3Path, os.Getenv(\"TEST_AWS_SECRET\"))}\n\ter := eope2eutil.NewEtcdRestore(etcdClusterName, 3, restoreSource, eopapi.BackupStorageTypeS3)\n\ter, err := f.EtcdCRClient.EtcdV1beta2().EtcdRestores(f.Namespace).Create(er)\n\tif err != nil {\n\t\tt.Fatalf(\"failed to create etcd restore cr: %v\", err)\n\t}\n\tdefer func() {\n\t\tif err := f.EtcdCRClient.EtcdV1beta2().EtcdRestores(f.Namespace).Delete(er.Name, nil); err != nil {\n\t\t\tt.Fatalf(\"failed to delete etcd restore cr: %v\", err)\n\t\t}\n\t}()\n\n\terr = retryutil.Retry(10*time.Second, 1, func() (bool, error) {\n\t\ter, err := f.EtcdCRClient.EtcdV1beta2().EtcdRestores(f.Namespace).Get(er.Name, metav1.GetOptions{})\n\t\tif err != nil {\n\t\t\treturn false, fmt.Errorf(\"failed to retrieve restore CR: %v\", err)\n\t\t}\n\t\tif er.Status.Succeeded {\n\t\t\treturn true, nil\n\t\t} else if len(er.Status.Reason) != 0 {\n\t\t\treturn false, fmt.Errorf(\"restore failed with reason: %v \", er.Status.Reason)\n\t\t}\n\t\treturn false, nil\n\t})\n\tif err != nil {\n\t\tt.Fatalf(\"failed to verify restore succeeded: %v\", err)\n\t}\n\n\t// Verify that the restored etcd cluster scales to 3 ready members\n\trestoredCluster := &eopapi.EtcdCluster{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: etcdClusterName,\n\t\t\tNamespace: f.Namespace,\n\t\t},\n\t\tSpec: eopapi.ClusterSpec{\n\t\t\tSize: 3,\n\t\t},\n\t}\n\tif _, err := eope2eutil.WaitUntilSizeReached(t, f.EtcdCRClient, 3, 6, restoredCluster); err != nil {\n\t\tt.Fatalf(\"failed to see restored etcd cluster(%v) reach 3 members: %v\", restoredCluster.Name, err)\n\t}\n}", "title": "" }, { "docid": "a5eb338639d752ea6c45a416eb1210c0", "score": "0.46384233", "text": "func (s *ecRebalancer) detectBroken(res *ecRebResult) {\n\ts.broken = make([]*ecRebObject, 0)\n\tbowner := s.t.GetBowner()\n\tbmd := bowner.Get()\n\tsmap := s.t.GetSowner().Get()\n\tfor idx, tp := range []map[string]*ecRebBck{res.ais, res.cloud} {\n\t\tfor bckName, objs := range tp {\n\t\t\tbck := &cluster.Bck{Name: bckName, Provider: cmn.ProviderFromBool(idx == 0)}\n\t\t\tif err := bck.Init(bowner); err != nil {\n\t\t\t\t// bucket might be deleted while rebalancing - skip it\n\t\t\t\tglog.Errorf(\"Invalid bucket %s: %v\", bckName, err)\n\t\t\t\tdelete(tp, bckName)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tbprops, ok := bmd.Get(bck)\n\t\t\tif !ok {\n\t\t\t\t// bucket might be deleted while rebalancing - skip it\n\t\t\t\tglog.Errorf(\"Bucket %s does not exist\", bckName)\n\t\t\t\tdelete(tp, bckName)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor objName, obj := range objs.objs {\n\t\t\t\tif err := s.calcLocalProps(bck, obj, smap, &bprops.EC); err != nil {\n\t\t\t\t\tglog.Warningf(\"Detect %s failed, skipping: %v\", obj.objName, err)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tmainHasObject := (obj.mainSliceID == 0 || obj.isECCopy) && obj.mainHasAny\n\t\t\t\tallSlicesFound := obj.sliceRequired() == obj.sliceFound()\n\t\t\t\t// the object is good, nothing to restore:\n\t\t\t\t// 1. Either objects is replicated, default target has replica\n\t\t\t\t// and total number of replicas is sufficient for EC\n\t\t\t\t// 2. Or object is EC'ed, default target has the object and\n\t\t\t\t// the number of slices equals Data+Parity number\n\t\t\t\tif allSlicesFound && mainHasObject {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tif bool(glog.FastV(4, glog.SmoduleAIS)) || s.ra.dryRun {\n\t\t\t\t\tglog.Infof(\"[%s] BROKEN: %s [Main %d on %s], slices %d of %d\",\n\t\t\t\t\t\ts.t.Snode().Name(), objName, obj.mainSliceID, obj.mainDaemon, obj.sliceFound(), obj.sliceRequired())\n\t\t\t\t}\n\t\t\t\ts.broken = append(s.broken, obj)\n\t\t\t}\n\t\t}\n\t}\n\n\t// sort the list of broken object to have deterministic order on all targets\n\t// sort order: IsAIS/Bucket name/Object name\n\tsliceLess := func(i, j int) bool {\n\t\tif s.broken[i].isAIS != s.broken[j].isAIS {\n\t\t\treturn s.broken[j].isAIS\n\t\t}\n\t\tbi := s.broken[i].bucket\n\t\tbj := s.broken[j].bucket\n\t\tif bi != bj {\n\t\t\treturn bi < bj\n\t\t}\n\t\treturn s.broken[i].objName < s.broken[j].objName\n\t}\n\tsort.Slice(s.broken, sliceLess)\n}", "title": "" }, { "docid": "2b5f7d00b578497e714cde19dfc55f06", "score": "0.46346283", "text": "func (api *API) Recover(ctx context.Context, username, newResetPubKeyHex,\n\tnewTransactionPubKeyHex, newAppPubKeyHex, privKeyHex string, seq uint64) (*model.BroadcastResponse, errors.Error) {\n\tresp, _, err := api.GuaranteeBroadcast(ctx, username, func(seq uint64) ([]byte, errors.Error) {\n\t\treturn api.MakeRecoverAccountMsg(username, newResetPubKeyHex,\n\t\t\tnewTransactionPubKeyHex, newAppPubKeyHex, privKeyHex, seq)\n\t})\n\treturn resp, err\n}", "title": "" }, { "docid": "cd124ccef930abf730fec1ed8ebfc215", "score": "0.46178618", "text": "func runOVNRepairCommands(oc *exutil.CLI, restoreNode *corev1.Node, nonRecoveryNodes []*corev1.Node) error {\n\tconst name = \"etcd-ovn-repair-pod\"\n\tframework.Logf(\"running ovn-repair script on node: %v\", restoreNode.Name)\n\n\tvar nodeIPs []string\n\tfor _, n := range nonRecoveryNodes {\n\t\tnodeIPs = append(nodeIPs, internalIP(n))\n\t}\n\t// adding the restore node last is important for kubelet restarts, as the ovn-repair pod runs on top of that node\n\tnodeIPs = append(nodeIPs, internalIP(restoreNode))\n\n\tovnRepairScript := fmt.Sprintf(`\n\t\t#!/bin/bash\n set -exuo pipefail\n\t\t\n\t\t# ssh key dance\n\t\t%s\n NODE_IPS=( %s )\n\t\tfor i in \"${NODE_IPS[@]}\"; do\n\t\t echo \"removing ovn etc on [$i]\"\n\t\t ssh -i $P_KEY -o StrictHostKeyChecking=no -q core@${i} sudo rm -rf /var/lib/ovn/etc/ \n echo \"restarting kubelet on [$i]\"\n # running this process async to get a chance to finish the pod gracefully\n ssh -i $P_KEY -o StrictHostKeyChecking=no -q core@${i} sudo systemctl restart kubelet.service &\n done\n exit`, sshKeyDance, strings.Join(nodeIPs, \" \"))\n\n\tpodSpec := applycorev1.PodSpec().WithHostNetwork(true).WithRestartPolicy(corev1.RestartPolicyOnFailure)\n\tpodSpec.Containers = []applycorev1.ContainerApplyConfiguration{\n\t\t*applycorev1.Container().\n\t\t\tWithName(\"ovn-repair\").\n\t\t\tWithSecurityContext(applycorev1.SecurityContext().WithPrivileged(true)).\n\t\t\tWithImage(image.ShellImage()).\n\t\t\tWithVolumeMounts(\n\t\t\t\tapplycorev1.VolumeMount().WithName(\"keys\").WithMountPath(sshPath),\n\t\t\t).\n\t\t\tWithCommand(\"/bin/bash\", \"-c\", ovnRepairScript),\n\t}\n\tpodSpec.NodeSelector = map[string]string{\"kubernetes.io/hostname\": restoreNode.Labels[\"kubernetes.io/hostname\"]}\n\tpodSpec.Tolerations = []applycorev1.TolerationApplyConfiguration{\n\t\t*applycorev1.Toleration().WithKey(\"node-role.kubernetes.io/master\").WithOperator(corev1.TolerationOpExists).WithEffect(corev1.TaintEffectNoSchedule),\n\t}\n\n\tpodSpec.Volumes = []applycorev1.VolumeApplyConfiguration{\n\t\t*applycorev1.Volume().WithName(\"keys\").WithSecret(applycorev1.SecretVolumeSource().WithSecretName(\"dr-ssh\")),\n\t}\n\n\tpod := applycorev1.Pod(name, openshiftEtcdNamespace).WithSpec(podSpec)\n\terr := runPodAndWaitForSuccess(oc, pod)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn wait.PollImmediate(5*time.Minute, 30*time.Minute, func() (bool, error) {\n\t\tframework.Logf(\"attempting to delete all ovn pods...\")\n\t\tpods, err := getAllOvnPods(oc)\n\t\tif err != nil {\n\t\t\tframework.Logf(\"error while attempting to get OVN pods: %v\", err)\n\t\t\treturn false, nil\n\t\t}\n\n\t\tnumPods := len(pods)\n\n\t\terr = e2epod.DeletePodsWithGracePeriod(context.TODO(), oc.AdminKubeClient(), pods, 0)\n\t\tif err != nil {\n\t\t\tframework.Logf(\"error while attempting to delete OVN pods: %v\", err)\n\t\t\treturn false, nil\n\t\t}\n\t\tframework.Logf(\"all ovn pods were deleted successfully!\")\n\n\t\terr = wait.PollImmediate(10*time.Second, 5*time.Minute, func() (bool, error) {\n\t\t\tpods, err := getAllOvnPods(oc)\n\t\t\tif err != nil {\n\t\t\t\tframework.Logf(\"error while attempting to get OVN pods: %v\", err)\n\t\t\t\treturn false, nil\n\t\t\t}\n\n\t\t\tif len(pods) != numPods {\n\t\t\t\tframework.Logf(\"expected %d ovn pods, found only %d...\", numPods, len(pods))\n\t\t\t\treturn false, nil\n\t\t\t}\n\n\t\t\t// wait for all the ovn pods to be running, looping through all of them for better logging\n\t\t\tallRunning := true\n\t\t\tfor _, pod := range pods {\n\t\t\t\t_, err := utils.PodRunningReady(&pod)\n\t\t\t\tif err != nil {\n\t\t\t\t\tframework.Logf(\"%v\", err)\n\t\t\t\t\tallRunning = false\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn allRunning, nil\n\t\t})\n\n\t\tif err != nil {\n\t\t\tframework.Logf(\"error while waiting for OVN pods to become ready: %v\", err)\n\t\t\treturn false, nil\n\t\t}\n\n\t\tframework.Logf(\"all OVN pods are running, continuing\")\n\t\treturn true, nil\n\t})\n}", "title": "" }, { "docid": "9c9f8078a15c30291c5d255a8ae0a607", "score": "0.46119553", "text": "func deleteVmdk(host string, vmdkPath string) error {\n\tsshCmd := fmt.Sprintf(\"rm -f %s\", vmdkPath)\n\tframework.Logf(\"Invoking command '%v' on ESX host %v\", sshCmd, host)\n\tresult, err := fssh.SSH(sshCmd, host+\":22\", framework.TestContext.Provider)\n\tif err != nil || result.Code != 0 {\n\t\tfssh.LogResult(result)\n\t\treturn fmt.Errorf(\"couldn't execute command: '%s' on ESX host: %v\", sshCmd, err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9d900eb7365c80e6c569a2866bbbf8ba", "score": "0.4591991", "text": "func (a *FrinxEvpnApiService) DeleteFrinxEvpnEvpnGroupsGroup(ctx context.Context, id int64, nodeId string) (*http.Response, error) {\n\tvar (\n\t\tlocalVarHttpMethod = strings.ToUpper(\"Delete\")\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarFileName string\n\t\tlocalVarFileBytes []byte\n\t\t\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/config/network-topology:network-topology/network-topology:topology/unified/network-topology:node/{node-id}/yang-ext:mount/frinx-evpn:evpn/frinx-evpn:groups/frinx-evpn:group/{id}/\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"id\"+\"}\", fmt.Sprintf(\"%v\", id), -1)\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"node-id\"+\"}\", fmt.Sprintf(\"%v\", nodeId), -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := url.Values{}\n\tlocalVarFormParams := url.Values{}\n\n\t// to determine the Content-Type header\n\tlocalVarHttpContentTypes := []string{\"application/json\", \"application/xml\"}\n\n\t// set Content-Type header\n\tlocalVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)\n\tif localVarHttpContentType != \"\" {\n\t\tlocalVarHeaderParams[\"Content-Type\"] = localVarHttpContentType\n\t}\n\n\t// to determine the Accept header\n\tlocalVarHttpHeaderAccepts := []string{\"application/json\", \"application/xml\"}\n\n\t// set Accept header\n\tlocalVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)\n\tif localVarHttpHeaderAccept != \"\" {\n\t\tlocalVarHeaderParams[\"Accept\"] = localVarHttpHeaderAccept\n\t}\n\tr, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tlocalVarHttpResponse, err := a.client.callAPI(r)\n\tif err != nil || localVarHttpResponse == nil {\n\t\treturn localVarHttpResponse, err\n\t}\n\n\tlocalVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)\n\tlocalVarHttpResponse.Body.Close()\n\tif err != nil {\n\t\treturn localVarHttpResponse, err\n\t}\n\n\n\tif localVarHttpResponse.StatusCode >= 300 {\n\t\tnewErr := GenericSwaggerError{\n\t\t\tbody: localVarBody,\n\t\t\terror: localVarHttpResponse.Status,\n\t\t}\n\t\t\n\t\treturn localVarHttpResponse, newErr\n\t}\n\n\treturn localVarHttpResponse, nil\n}", "title": "" }, { "docid": "468f8feae60183fcf9d96098c51ed248", "score": "0.45712364", "text": "func (impl *Impl) Recover(ctx context.Context, index int, records []*v1alpha1.Record, obj v1alpha1.InnerObject) (v1alpha1.Phase, error) {\n\tif impl.decoder == nil {\n\t\treturn v1alpha1.Injected, errors.WithStack(errNilDecoder)\n\t}\n\tdecodedContainer, err := impl.decoder.DecodeContainerRecord(ctx, records[index], obj)\n\tif decodedContainer.PbClient != nil {\n\t\tdefer func() {\n\t\t\terr := decodedContainer.PbClient.Close()\n\t\t\tif err != nil {\n\t\t\t\timpl.Log.Error(err, \"fail to close pb client\")\n\t\t\t}\n\t\t}()\n\t}\n\tif err != nil && strings.Contains(err.Error(), \"container not found\") {\n\t\t// Unable to find the container, so we are unable to remove the experiment from the jvm as it has gone\n\t\timpl.Log.Error(err, \"finding container\")\n\t\treturn v1alpha1.NotInjected, nil\n\t}\n\tif err != nil {\n\t\treturn v1alpha1.Injected, err\n\t}\n\n\tjvmChaos := obj.(*v1alpha1.JVMChaos)\n\terr = generateRuleData(&jvmChaos.Spec)\n\tif err != nil {\n\t\timpl.Log.Error(err, \"fail to generate rule data\")\n\n\t\treturn v1alpha1.Injected, err\n\t}\n\n\t_, err = decodedContainer.PbClient.UninstallJVMRules(ctx, &pb.UninstallJVMRulesRequest{\n\t\tContainerId: decodedContainer.ContainerId,\n\t\tRule: jvmChaos.Spec.RuleData,\n\t\tPort: jvmChaos.Spec.Port,\n\t\tEnterNS: true,\n\t})\n\tif err != nil && strings.Contains(err.Error(), \"Connection refused\") {\n\t\t// Unable to connect to the jvm - meaning that there is no agent running on the jvm, most likely because the jvm process has been restarted\n\t\timpl.Log.Error(err, \"uninstall jvm rules (possible restart of jvm process)\")\n\t\treturn v1alpha1.NotInjected, nil\n\t}\n\tif err != nil {\n\t\timpl.Log.Error(err, \"uninstall jvm rules\")\n\t\treturn v1alpha1.Injected, err\n\t}\n\n\treturn v1alpha1.NotInjected, nil\n}", "title": "" }, { "docid": "47d9a3a2f4cc8d5e50ef33bfedc67bae", "score": "0.45695373", "text": "func (o *objectMover) deleteGroup(ctx context.Context, group moveGroup) error {\n\tdeleteSourceObjectBackoff := newWriteBackoff()\n\terrList := []error{}\n\tfor i := range group {\n\t\tnodeToDelete := group[i]\n\n\t\t// Delete the Kubernetes object corresponding to the current node.\n\t\t// Nb. The operation is wrapped in a retry loop to make move more resilient to unexpected conditions.\n\t\terr := retryWithExponentialBackoff(deleteSourceObjectBackoff, func() error {\n\t\t\treturn o.deleteSourceObject(ctx, nodeToDelete)\n\t\t})\n\n\t\tif err != nil {\n\t\t\terrList = append(errList, err)\n\t\t}\n\t}\n\n\treturn kerrors.NewAggregate(errList)\n}", "title": "" }, { "docid": "f70d341e594f66cb0678d50c4dfb4dec", "score": "0.45554698", "text": "func (f *FakeLVM) ReduceVolumeGroup(vg string, dev string) error {\n\treturn f.Called(vg, dev).Error(0)\n}", "title": "" }, { "docid": "c95e720e89e0a3335e911858251b6910", "score": "0.45469669", "text": "func decrGroupLevel() {\n\tresultingToken := findHighestPriorityOpAndTokens(currentSlice)\n\tresetCurrentSlice()\n\ttodoMap[groupLevel] = currentSlice\n\n\tgroupLevel -= 1\n\tsetCurrentSlice()\n\tcurrentSlice = append(currentSlice, resultingToken)\n}", "title": "" }, { "docid": "e6567f1a4be7ccf20e072e734ee8a9a9", "score": "0.4531995", "text": "func (r *ReconcileVirtualCluster) Reconcile(request reconcile.Request) (rncilRslt reconcile.Result, err error) {\n\tlog.Info(\"reconciling VirtualCluster...\")\n\tvc := &tenancyv1alpha1.VirtualCluster{}\n\terr = r.Get(context.TODO(), request.NamespacedName, vc)\n\tif err != nil {\n\t\t// set NotFound error as nil\n\t\tif apierrors.IsNotFound(err) {\n\t\t\terr = nil\n\t\t}\n\t\treturn\n\t}\n\n\tvcFinalizerName := fmt.Sprintf(\"virtualcluster.finalizer.%s\", r.mp.GetMasterProvisioner())\n\n\tif vc.ObjectMeta.DeletionTimestamp.IsZero() {\n\t\tif !strutil.ContainString(vc.ObjectMeta.Finalizers, vcFinalizerName) {\n\t\t\tvc.ObjectMeta.Finalizers = append(vc.ObjectMeta.Finalizers, vcFinalizerName)\n\t\t\tif err = kubeutil.RetryUpdateVCStatusOnConflict(context.TODO(), r, vc, log); err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tlog.Info(\"a finalizer has been registered for the VirtualCluster CRD\", \"finalizer\", vcFinalizerName)\n\t\t}\n\t} else {\n\t\t// The VirtualCluster is being deleted\n\t\tif strutil.ContainString(vc.ObjectMeta.Finalizers, vcFinalizerName) {\n\t\t\t// delete the control plane\n\t\t\tlog.Info(\"VirtualCluster is being deleted, finalizer will be activated\", \"vc-name\", vc.Name, \"finalizer\", vcFinalizerName)\n\t\t\t// block if fail to delete VC\n\t\t\tif err = r.mp.DeleteVirtualCluster(vc); err != nil {\n\t\t\t\tlog.Error(err, \"fail to delete virtualcluster\", \"vc-name\", vc.Name)\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// remove finalizer from the list and update it.\n\t\t\tvc.ObjectMeta.Finalizers = strutil.RemoveString(vc.ObjectMeta.Finalizers, vcFinalizerName)\n\t\t\terr = kubeutil.RetryUpdateVCStatusOnConflict(context.TODO(), r, vc, log)\n\t\t}\n\t\treturn\n\t}\n\n\t// reconcile VirtualCluster (vc) based on vc status\n\t// NOTE: vc status is required by other components (e.g. syncer need to\n\t// know the vc status in order to setup connection to the tenant master)\n\tswitch vc.Status.Phase {\n\tcase \"\":\n\t\t// set vc status as ClusterPending if no status is set\n\t\tlog.Info(\"will create a VirtualCluster\", \"vc\", vc.Name)\n\t\t// will retry three times\n\t\tkubeutil.SetVCStatus(vc, tenancyv1alpha1.ClusterPending,\n\t\t\t\"retry: 3\", \"ClusterCreating\")\n\t\terr = kubeutil.RetryUpdateVCStatusOnConflict(context.TODO(), r, vc, log)\n\t\treturn\n\tcase tenancyv1alpha1.ClusterPending:\n\t\t// create new virtualcluster when vc is pending\n\t\tlog.Info(\"VirtualCluster is pending\", \"vc\", vc.Name)\n\t\tretryTimes, _ := strconv.Atoi(strings.TrimSpace(strings.Split(vc.Status.Message, \":\")[1]))\n\t\tif retryTimes > 0 {\n\t\t\terr = r.mp.CreateVirtualCluster(vc)\n\t\t\tif err != nil {\n\t\t\t\tlog.Error(err, \"fail to create virtualcluster\", \"vc\", vc.GetName(), \"retrytimes\", retryTimes)\n\t\t\t\terrReason := fmt.Sprintf(\"fail to create virtualcluster(%s): %s\", vc.GetName(), err)\n\t\t\t\terrMsg := fmt.Sprintf(\"retry: %d\", retryTimes-1)\n\t\t\t\tkubeutil.SetVCStatus(vc, tenancyv1alpha1.ClusterPending, errMsg, errReason)\n\t\t\t} else {\n\t\t\t\tkubeutil.SetVCStatus(vc, tenancyv1alpha1.ClusterRunning,\n\t\t\t\t\t\"tenant master is running\", \"TenantMasterRunning\")\n\t\t\t}\n\t\t} else {\n\t\t\tkubeutil.SetVCStatus(vc, tenancyv1alpha1.ClusterError,\n\t\t\t\t\"fail to create virtualcluster\", \"TenantMasterError\")\n\t\t}\n\n\t\terr = kubeutil.RetryUpdateVCStatusOnConflict(context.TODO(), r, vc, log)\n\t\treturn\n\tcase tenancyv1alpha1.ClusterRunning:\n\t\tlog.Info(\"VirtualCluster is running\", \"vc\", vc.GetName())\n\t\treturn\n\tcase tenancyv1alpha1.ClusterError:\n\t\tlog.Info(\"fail to create virtualcluster\", \"vc\", vc.GetName())\n\t\treturn\n\tdefault:\n\t\terr = fmt.Errorf(\"unknown vc phase: %s\", vc.Status.Phase)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "9825b9dd622ec1bd545e1889f75c1601", "score": "0.4528858", "text": "func WaitDeleted(input *RestoreInput) error {\n\tvar instanceDeleted bool\n\tvar clusterDeleted bool\n\n\tsvc := rds.New(session.New())\n\n\tdescribeInstancesInput := &rds.DescribeDBInstancesInput{\n\t\tDBInstanceIdentifier: aws.String(input.DestinationInstanceIdentifier),\n\t}\n\tif _, err := svc.DescribeDBInstances(describeInstancesInput); err != nil {\n\t\tif aerr, ok := err.(awserr.Error); ok {\n\t\t\tswitch aerr.Code() {\n\t\t\tcase rds.ErrCodeDBInstanceNotFoundFault:\n\t\t\t\tfmt.Println(\"DB Instance is already deleted\")\n\t\t\t\tinstanceDeleted = true\n\n\t\t\tdefault:\n\t\t\t\treturn fmt.Errorf(\"Failed to get the status of DB Instance: %s\", err)\n\t\t\t}\n\t\t}\n\t}\n\n\tdescribeClustersInput := &rds.DescribeDBClustersInput{\n\t\tDBClusterIdentifier: aws.String(input.DestinationClusterIdentifier),\n\t}\n\tif _, err := svc.DescribeDBClusters(describeClustersInput); err != nil {\n\t\tif aerr, ok := err.(awserr.Error); ok {\n\t\t\tswitch aerr.Code() {\n\t\t\tcase rds.ErrCodeDBClusterNotFoundFault:\n\t\t\t\tfmt.Println(\"DB Cluster is already deleted\")\n\t\t\t\tclusterDeleted = true\n\n\t\t\tdefault:\n\t\t\t\treturn fmt.Errorf(\"Failed to get the status of DB Cluster: %s\", err)\n\t\t\t}\n\t\t}\n\t}\n\n\tif !instanceDeleted {\n\t\treturn fmt.Errorf(\"DB Instance is still not deleted\")\n\t}\n\tif !clusterDeleted {\n\t\treturn fmt.Errorf(\"DB Cluster is still not deleted\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "4495f946a287ffa817bad5f15ab9dcf9", "score": "0.4525461", "text": "func (r *ReconcileServiceSync) ensurePruned(name types.NamespacedName, instance *mcv1.ServiceSync) error {\n\tlogger := log.WithValues(\"servicesync\", name.Name)\n\n\t// Save original state\n\toriginalInstance := instance.DeepCopy()\n\tif instance.Status.Clusters == nil {\n\t\tinstance.Status.Clusters = make(map[string]*mcv1.Cluster, 0)\n\t}\n\n\t// Prune old/expired clusters\n\tpruned := PruneExpired(&instance.Status.Clusters, instance.Spec.PrunePeerAtAge)\n\tif len(pruned) > 0 {\n\t\tlogger.Info(\"Pruned remote clusters\", \"clusters\", pruned)\n\t\tr.recorder.Eventf(instance, eventTypeNormal, \"PrunedClusters\", \"Pruned remote clusters %s\", pruned)\n\t}\n\n\treturn r.save(name, originalInstance, instance)\n}", "title": "" }, { "docid": "e156ccd7c3a1af211826f2e76e720306", "score": "0.45249167", "text": "func TestData_ShardGroupExpiredDeleted(t *testing.T) {\n\tvar data meta.Data\n\tif err := data.CreateNode(\"node0\"); err != nil {\n\t\tt.Fatal(err)\n\t} else if err = data.CreateNode(\"node1\"); err != nil {\n\t\tt.Fatal(err)\n\t} else if err = data.CreateDatabase(\"db0\"); err != nil {\n\t\tt.Fatal(err)\n\t} else if err = data.CreateRetentionPolicy(\"db0\", &meta.RetentionPolicyInfo{Name: \"rp0\", ReplicaN: 2, Duration: 1 * time.Hour}); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Create shard groups.\n\tif err := data.CreateShardGroup(\"db0\", \"rp0\", time.Date(2000, time.January, 1, 0, 0, 0, 0, time.UTC)); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := data.CreateShardGroup(\"db0\", \"rp0\", time.Date(2001, time.January, 1, 0, 0, 0, 0, time.UTC)); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Check expiration.\n\trp, _ := data.RetentionPolicy(\"db0\", \"rp0\")\n\tgroups := rp.ExpiredShardGroups(time.Date(2001, time.January, 1, 0, 0, 0, 0, time.UTC))\n\tif len(groups) != 1 {\n\t\tt.Fatalf(\"wrong number of expired shard groups returned, got %d, exp 1\", len(groups))\n\t}\n\tif groups[0].StartTime != time.Date(2000, time.January, 1, 0, 0, 0, 0, time.UTC) {\n\t\tt.Fatal(\"wrong shard group marked as expired\")\n\t}\n\n\t// Check deletion.\n\tif err := data.DeleteShardGroup(\"db0\", \"rp0\", groups[0].ID); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tgroups = rp.DeletedShardGroups()\n\tif len(groups) != 1 {\n\t\tt.Fatalf(\"wrong number of deleted shard groups returned, got %d, exp 1\", len(groups))\n\t}\n\tif groups[0].StartTime != time.Date(2000, time.January, 1, 0, 0, 0, 0, time.UTC) {\n\t\tt.Fatal(\"wrong shard group marked as expired\")\n\t}\n\n}", "title": "" }, { "docid": "8f41863d1ce0cf5441023f16d6f95b77", "score": "0.45048138", "text": "func (vfs *BasePathFS) GroupDel(name string) error {\n\treturn vfs.baseFS.GroupDel(name)\n}", "title": "" }, { "docid": "a1754ff517e19993f06da2a7ddd1d14e", "score": "0.4495501", "text": "func (cluster *OvnClusterController) RebuildOVNDatabase(\n\tmasterNodeName string, oc *ovn.Controller) error {\n\tlogrus.Debugf(\"Rebuild OVN database for cluster nodes\")\n\tvar err error\n\tipChange, err := cluster.checkMasterIPChange(masterNodeName)\n\tif err != nil {\n\t\tlogrus.Errorf(\"Error when checking Master Node IP Change: %v\", err)\n\t\treturn err\n\t}\n\n\t// If OvnHA options is enabled, make sure default namespace has the\n\t// annotation of current cluster master node's overlay IP address\n\tlogrus.Debugf(\"cluster.OvnHA: %t\", cluster.OvnHA)\n\tif cluster.OvnHA && ipChange {\n\t\tlogrus.Debugf(\"HA is enabled and DB doesn't exist!\")\n\t\t// Rebuild OVN DB for the k8s nodes\n\t\terr = cluster.UpdateDBForKubeNodes(masterNodeName)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// Rebuild OVN DB for the k8s namespaces and all the resource\n\t\t// objects inside the namespace including pods and network\n\t\t// policies\n\t\terr = cluster.UpdateKubeNsObjects(oc)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// Update master node IP annotation on default namespace\n\t\terr = cluster.UpdateMasterNodeIP(masterNodeName)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "74cc7bad8137a0d108c42b19d4181753", "score": "0.44924685", "text": "func makeVappGroup(label string, vdc *Vdc, groupDefinition map[string][]string) ([]*VApp, error) {\n\tvar vappList []*VApp\n\tfor vappName, vmNames := range groupDefinition {\n\t\texistingVapp, err := vdc.GetVAppByName(vappName, false)\n\t\tif err == nil {\n\n\t\t\tif existingVapp.VApp.Children == nil || len(existingVapp.VApp.Children.VM) == 0 {\n\t\t\t\treturn nil, fmt.Errorf(\"found vApp %s but without VMs\", vappName)\n\t\t\t}\n\t\t\tfoundVms := 0\n\t\t\tfor _, vmName := range vmNames {\n\t\t\t\tfor _, existingVM := range existingVapp.VApp.Children.VM {\n\t\t\t\t\tif existingVM.Name == vmName {\n\t\t\t\t\t\tfoundVms++\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif foundVms < 2 {\n\t\t\t\treturn nil, fmt.Errorf(\"found vApp %s but with %d VMs instead of 2 \", vappName, foundVms)\n\t\t\t}\n\n\t\t\tvappList = append(vappList, existingVapp)\n\t\t\tif testVerbose {\n\t\t\t\tfmt.Printf(\"Using existing vApp %s\\n\", vappName)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tif testVerbose {\n\t\t\tfmt.Printf(\"Creating vApp %s\\n\", vappName)\n\t\t}\n\t\tvapp, err := makeEmptyVapp(vdc, vappName, \"\")\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif os.Getenv(\"GOVCD_KEEP_TEST_OBJECTS\") == \"\" {\n\t\t\tAddToCleanupList(vappName, \"vapp\", vdc.Vdc.Name, label)\n\t\t}\n\t\tfor _, vmName := range vmNames {\n\t\t\tif testVerbose {\n\t\t\t\tfmt.Printf(\"\\tCreating VM %s/%s\\n\", vappName, vmName)\n\t\t\t}\n\t\t\t_, err := makeEmptyVm(vapp, vmName)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tvappList = append(vappList, vapp)\n\t}\n\treturn vappList, nil\n}", "title": "" }, { "docid": "3d99c6dbbc12d1b235dee0c90b165915", "score": "0.44635275", "text": "func checkVariableGroupDestroyed(s *terraform.State) error {\n\tfor _, resource := range s.RootModule().Resources {\n\t\tif resource.Type != \"azuredevops_variable_group\" {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Indicates the variable group still exists -- this should fail the test\n\t\tif _, err := getVariableGroupFromResource(resource); err == nil {\n\t\t\treturn fmt.Errorf(\"Unexpectedly found a variable group that should be deleted\")\n\t\t}\n\n\t\t// Indicates the definition reference still exists -- this should fail the test\n\t\tif _, err := getDefinitionResourceFromVariableGroupResource(resource); err == nil {\n\t\t\treturn fmt.Errorf(\"Unexpectedly found a definition reference for allow access that should be deleted\")\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "8f09457988b167555b3afeeef9e2ecda", "score": "0.44627923", "text": "func (s *service) detachRDM(volID, volumeWWN string) error {\n\t// perform detach RDM call\n\n\t// Find the host system\n\thost, err := s.getVMHostSystem()\n\tif err != nil {\n\t\tlog.Errorf(\"Could not find host system (%s) vol: %s, on host %s with error: %s\", volumeWWN, volID, vmHost.VM, err.Error())\n\t\treturn fmt.Errorf(\"Could not find host system (%s) vol: %s, on host %s with error: %s\", volumeWWN, volID, vmHost.VM, err.Error())\n\t}\n\tlog.Debugf(\"found host: (%v)\", host)\n\n\t//Detach RDM\n\terr = vmHost.DetachRDM(vmHost.VM, volumeWWN)\n\tif err != nil {\n\t\tlog.Errorf(\"Could not detach RDM (%s) vol: %s, on host %s with error: %s\", volumeWWN, volID, vmHost.VM, err.Error())\n\t\treturn fmt.Errorf(\"could not detach RDM (%s) vol: %s, on host %s with error: %s\", volumeWWN, volID, vmHost.VM, err.Error())\n\t}\n\tlog.Debugf(\"detach RDM complete ...\")\n\n\t// Rescan the HBA\n\tif err := vmHost.RescanAllHba(host); err != nil {\n\t\tlog.Errorf(\"rescan all HBA failed(%s) vol: %s, on host %s with error: %s\", volumeWWN, volID, vmHost.VM, err.Error())\n\t\treturn fmt.Errorf(\"rescan all HBA failed(%s) vol: %s, on host %s with error: %s\", volumeWWN, volID, vmHost.VM, err.Error())\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "0d59e8c52929cadb3a7e14d76d5e797a", "score": "0.44620404", "text": "func reloadCluster(cluster *fdbv1beta2.FoundationDBCluster) (int64, error) {\n\tgenerations, err := reloadClusterGenerations(cluster)\n\tif generations.HasPendingRemoval > 0 {\n\t\treturn 0, err\n\t}\n\treturn generations.Reconciled, err\n}", "title": "" }, { "docid": "3e3b3bdc65cc14d5f781c4ce444ccd2d", "score": "0.44470763", "text": "func checkBrokerStorageRemoval(kafkaClusterSpecOld, kafkaClusterSpecNew *banzaicloudv1beta1.KafkaClusterSpec) (*field.Error, error) {\n\tfor j := range kafkaClusterSpecOld.Brokers {\n\t\tbrokerOld := &kafkaClusterSpecOld.Brokers[j]\n\t\tfor k := range kafkaClusterSpecNew.Brokers {\n\t\t\tbrokerNew := &kafkaClusterSpecNew.Brokers[k]\n\t\t\tif brokerOld.Id == brokerNew.Id {\n\t\t\t\tbrokerConfigsOld, err := brokerOld.GetBrokerConfig(*kafkaClusterSpecOld)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\t// checking broukerConfigGroup existence\n\t\t\t\tif brokerNew.BrokerConfigGroup != \"\" {\n\t\t\t\t\tif _, exists := kafkaClusterSpecNew.BrokerConfigGroups[brokerNew.BrokerConfigGroup]; !exists {\n\t\t\t\t\t\treturn field.Invalid(field.NewPath(\"spec\").Child(\"brokers\").Index(int(brokerNew.Id)).Child(\"brokerConfigGroup\"), brokerNew.BrokerConfigGroup, removingStorageMsg+\", provided brokerConfigGroup not found\"), nil\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbrokerConfigsNew, err := brokerNew.GetBrokerConfig(*kafkaClusterSpecNew)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tfor e := range brokerConfigsOld.StorageConfigs {\n\t\t\t\t\tstorageConfigOld := &brokerConfigsOld.StorageConfigs[e]\n\t\t\t\t\tisStorageFound := false\n\n\t\t\t\t\tfor f := range brokerConfigsNew.StorageConfigs {\n\t\t\t\t\t\tstorageConfigNew := &brokerConfigsNew.StorageConfigs[f]\n\t\t\t\t\t\tif storageConfigOld.MountPath == storageConfigNew.MountPath {\n\t\t\t\t\t\t\tisStorageFound = true\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif !isStorageFound {\n\t\t\t\t\t\tfromConfigGroup := getMissingMounthPathLocation(storageConfigOld.MountPath, kafkaClusterSpecOld, int32(k))\n\t\t\t\t\t\tif fromConfigGroup != nil && *fromConfigGroup {\n\t\t\t\t\t\t\treturn field.Invalid(field.NewPath(\"spec\").Child(\"brokers\").Index(k).Child(\"brokerConfigGroup\"), brokerNew.BrokerConfigGroup, fmt.Sprintf(\"%s, missing storageConfig mounthPath: %s\", removingStorageMsg, storageConfigOld.MountPath)), nil\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn field.NotFound(field.NewPath(\"spec\").Child(\"brokers\").Index(k).Child(\"storageConfig\").Index(e), storageConfigOld.MountPath+\", \"+removingStorageMsg), nil\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn nil, nil\n}", "title": "" }, { "docid": "53ba16ec3310b585903042901dcfd2ea", "score": "0.4443632", "text": "func (self *SDatastore) ImportVMDK(ctx context.Context, diskFile, remotePath string, host *SHost) error {\n\tname := fmt.Sprintf(\"yunioncloud.%s%d\", self.domainName(remotePath)[:20], rand.Int())\n\tvm, err := self.ImportVM(ctx, diskFile, name, host)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"SDatastore.ImportVM\")\n\t}\n\n\tdefer func() {\n\t\ttask, err := vm.Destroy(ctx)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"vm.Destory: %s\", err)\n\t\t\treturn\n\t\t}\n\n\t\tif err = task.Wait(ctx); err != nil {\n\t\t\tlog.Errorf(\"task.Wait: %s\", err)\n\t\t}\n\t}()\n\n\t// check if 'image_cache' is esixt\n\terr = self.CheckDirC(\"image_cache\")\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"SDatastore.CheckDirC\")\n\t}\n\n\tfm := self.getDatastoreObj().NewFileManager(self.datacenter.getObjectDatacenter(), true)\n\n\t// if image_cache not exist\n\treturn fm.Move(ctx, fmt.Sprintf(\"[%s] %s/%s.vmdk\", self.GetRelName(), name, name), fmt.Sprintf(\"[%s] %s\",\n\t\tself.GetRelName(), remotePath))\n}", "title": "" }, { "docid": "411c54fb9f13d1101a1d14d21f5ca67f", "score": "0.4442983", "text": "func RecoverAll() {\n\tdoRecover(recover(), true)\n}", "title": "" }, { "docid": "3d255826ab15830fb42f20174d6bda67", "score": "0.4442301", "text": "func TestReconcileServiceInstanceDeleteFailedProvisionWithRequest(t *testing.T) {\n\tfakeKubeClient, fakeCatalogClient, fakeClusterServiceBrokerClient, testController, sharedInformers := newTestController(t, fakeosb.FakeClientConfiguration{\n\t\tDeprovisionReaction: &fakeosb.DeprovisionReaction{\n\t\t\tResponse: &osb.DeprovisionResponse{},\n\t\t},\n\t})\n\n\tsharedInformers.ClusterServiceBrokers().Informer().GetStore().Add(getTestClusterServiceBroker())\n\tsharedInformers.ClusterServiceClasses().Informer().GetStore().Add(getTestClusterServiceClass())\n\tsharedInformers.ClusterServicePlans().Informer().GetStore().Add(getTestClusterServicePlan())\n\n\tinstance := getTestServiceInstanceWithFailedStatus()\n\tinstance.ObjectMeta.DeletionTimestamp = &metav1.Time{}\n\tinstance.ObjectMeta.Finalizers = []string{v1beta1.FinalizerServiceCatalog}\n\tinstance.Status.CurrentOperation = v1beta1.ServiceInstanceOperationProvision\n\tinstance.Status.InProgressProperties = &v1beta1.ServiceInstancePropertiesState{\n\t\tClusterServicePlanExternalName: testClusterServicePlanName,\n\t\tClusterServicePlanExternalID: testClusterServicePlanGUID,\n\t}\n\tinstance.Status.DeprovisionStatus = v1beta1.ServiceInstanceDeprovisionStatusRequired\n\n\tinstance.Generation = 2\n\tinstance.Status.ReconciledGeneration = 1\n\tinstance.Status.ObservedGeneration = 1\n\tinstance.Status.ProvisionStatus = v1beta1.ServiceInstanceProvisionStatusNotProvisioned\n\n\tfakeCatalogClient.AddReactor(\"get\", \"serviceinstances\", func(action clientgotesting.Action) (bool, runtime.Object, error) {\n\t\treturn true, instance, nil\n\t})\n\n\tif err := reconcileServiceInstance(t, testController, instance); err != nil {\n\t\tt.Fatalf(\"unexpected error: %v\", err)\n\t}\n\tinstance = assertServiceInstanceDeprovisionInProgressIsTheOnlyCatalogClientAction(t, fakeCatalogClient, instance)\n\tfakeCatalogClient.ClearActions()\n\tfakeKubeClient.ClearActions()\n\n\terr := reconcileServiceInstance(t, testController, instance)\n\tif err != nil {\n\t\tt.Fatalf(\"Unexpected error from reconcileServiceInstance: %v\", err)\n\t}\n\n\tbrokerActions := fakeClusterServiceBrokerClient.Actions()\n\tassertNumberOfClusterServiceBrokerActions(t, brokerActions, 1)\n\tassertDeprovision(t, brokerActions[0], &osb.DeprovisionRequest{\n\t\tAcceptsIncomplete: true,\n\t\tInstanceID: testServiceInstanceGUID,\n\t\tServiceID: testClusterServiceClassGUID,\n\t\tPlanID: testClusterServicePlanGUID,\n\t})\n\n\t// Verify no core kube actions occurred\n\tkubeActions := fakeKubeClient.Actions()\n\tassertNumberOfActions(t, kubeActions, 0)\n\n\tactions := fakeCatalogClient.Actions()\n\tassertNumberOfActions(t, actions, 1)\n\n\tupdatedServiceInstance := assertUpdateStatus(t, actions[0], instance)\n\tassertServiceInstanceOperationSuccess(t, updatedServiceInstance, v1beta1.ServiceInstanceOperationDeprovision, testClusterServicePlanName, testClusterServicePlanGUID, instance)\n\n\tevents := getRecordedEvents(testController)\n\n\texpectedEvent := normalEventBuilder(successDeprovisionReason).msg(\"The instance was deprovisioned successfully\")\n\tif err := checkEvents(events, expectedEvent.stringArr()); err != nil {\n\t\tt.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "30d4e3a218c02ed40d278fac3e195043", "score": "0.44347045", "text": "func waitForCRDToUnregister(ctx context.Context, cfg *rest.Config, gvk schema.GroupVersionKind, plural string) error {\n\t// Create a new clientset to avoid any client caching of discovery\n\tcs, err := clientset.NewForConfig(cfg)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"creating clientset: %w\", err)\n\t}\nloop:\n\tfor {\n\t\tif ctx.Err() != nil {\n\t\t\treturn ctx.Err()\n\t\t}\n\n\t\t// Get the Resources for this GroupVersion\n\t\tresourceList, err := cs.Discovery().ServerResourcesForGroupVersion(gvk.GroupVersion().String())\n\t\tif err != nil {\n\t\t\tif apierrors.IsNotFound(err) {\n\t\t\t\t// This is normal when unregistering the last resource in a group.\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"getting resources for group: %+v: %w\", gvk.GroupVersion(), err)\n\t\t}\n\n\t\tfor i := range resourceList.APIResources {\n\t\t\tif resourceList.APIResources[i].Name == plural {\n\t\t\t\tselect {\n\t\t\t\tcase <-time.After(100 * time.Millisecond):\n\t\t\t\tcase <-ctx.Done():\n\t\t\t\t}\n\t\t\t\tcontinue loop\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "44e7f0c9b88e3e0c91d6f103cda353f9", "score": "0.4432813", "text": "func Restore(input *RestoreInput) error {\n\tsvc := rds.New(session.New())\n\n\tdescribeSnapshotsInput := &rds.DescribeDBClusterSnapshotsInput{\n\t\tDBClusterIdentifier: aws.String(input.SourceClusterIdentifier),\n\t}\n\tdescribeSnapshotsOutput, err := svc.DescribeDBClusterSnapshots(describeSnapshotsInput)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed get the DB Cluster Snapshots: %s\", err)\n\t}\n\n\tif len(describeSnapshotsOutput.DBClusterSnapshots) == 0 {\n\t\treturn fmt.Errorf(\"There is no DB Cluster Snapshots\")\n\t}\n\n\tlatestTime := time.Time{}\n\tvar latestSnapshot *rds.DBClusterSnapshot\n\tfor _, snapshot := range describeSnapshotsOutput.DBClusterSnapshots {\n\t\tif *snapshot.Status != \"available\" {\n\t\t\tcontinue\n\t\t}\n\t\tif snapshot.SnapshotCreateTime.After(latestTime) {\n\t\t\tlatestTime = *snapshot.SnapshotCreateTime\n\t\t\tlatestSnapshot = snapshot\n\t\t}\n\t}\n\tfmt.Printf(\"Latest snapshot = %s\\n\", *latestSnapshot.DBClusterSnapshotIdentifier)\n\n\trestoreInput := &rds.RestoreDBClusterFromSnapshotInput{\n\t\tDBClusterIdentifier: aws.String(input.DestinationClusterIdentifier),\n\t\tSnapshotIdentifier: latestSnapshot.DBClusterSnapshotIdentifier,\n\t\tEngine: aws.String(input.Engine),\n\t\tEngineVersion: aws.String(input.EngineVersion),\n\t\tAvailabilityZones: aws.StringSlice(input.AvailabilityZones),\n\t\tDBSubnetGroupName: aws.String(input.DBSubnetGroupName),\n\t\tVpcSecurityGroupIds: aws.StringSlice(input.VpcSecurityGroupIds),\n\t}\n\tif _, err := svc.RestoreDBClusterFromSnapshot(restoreInput); err != nil {\n\t\treturn fmt.Errorf(\"Failed to restore: %s\", err)\n\t}\n\n\tcreateInstanceInput := &rds.CreateDBInstanceInput{\n\t\tDBClusterIdentifier: aws.String(input.DestinationClusterIdentifier),\n\t\tDBInstanceIdentifier: aws.String(input.DestinationInstanceIdentifier),\n\t\tDBInstanceClass: aws.String(input.DBInstanceClass),\n\t\tEngine: aws.String(input.Engine),\n\t}\n\tif _, err := svc.CreateDBInstance(createInstanceInput); err != nil {\n\t\treturn fmt.Errorf(\"Failed to create DB Instance: %s\", err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "4dc0b1e5d808fc3f942a3183066a251a", "score": "0.44267118", "text": "func TestReconcileServiceInstanceDeleteWhenAlreadyDeprovisionedUnsuccessfully(t *testing.T) {\n\tfakeKubeClient, fakeCatalogClient, fakeClusterServiceBrokerClient, testController, sharedInformers := newTestController(t, noFakeActions())\n\n\tsharedInformers.ClusterServiceBrokers().Informer().GetStore().Add(getTestClusterServiceBroker())\n\tsharedInformers.ClusterServiceClasses().Informer().GetStore().Add(getTestClusterServiceClass())\n\tsharedInformers.ClusterServicePlans().Informer().GetStore().Add(getTestClusterServicePlan())\n\n\tinstance := getTestServiceInstanceWithFailedStatus()\n\tinstance.ObjectMeta.DeletionTimestamp = &metav1.Time{}\n\tinstance.ObjectMeta.Finalizers = []string{v1beta1.FinalizerServiceCatalog}\n\tinstance.Status.ExternalProperties = &v1beta1.ServiceInstancePropertiesState{}\n\tinstance.Status.DeprovisionStatus = v1beta1.ServiceInstanceDeprovisionStatusFailed\n\n\tinstance.Generation = 2\n\tinstance.Status.ReconciledGeneration = 1\n\tinstance.Status.ObservedGeneration = 1\n\tinstance.Status.ProvisionStatus = v1beta1.ServiceInstanceProvisionStatusProvisioned\n\n\tfakeCatalogClient.AddReactor(\"get\", \"serviceinstances\", func(action clientgotesting.Action) (bool, runtime.Object, error) {\n\t\treturn true, instance, nil\n\t})\n\n\terr := reconcileServiceInstance(t, testController, instance)\n\tif err != nil {\n\t\tt.Fatalf(\"Unexpected error from reconcileServiceInstance: %v\", err)\n\t}\n\n\tbrokerActions := fakeClusterServiceBrokerClient.Actions()\n\tassertNumberOfClusterServiceBrokerActions(t, brokerActions, 0)\n\n\t// Verify no core kube actions occurred\n\tkubeActions := fakeKubeClient.Actions()\n\tassertNumberOfActions(t, kubeActions, 0)\n\n\t// Verify no catalog client actions occurred\n\tactions := fakeCatalogClient.Actions()\n\tassertNumberOfActions(t, actions, 0)\n\n\tevents := getRecordedEvents(testController)\n\tassertNumEvents(t, events, 0)\n}", "title": "" }, { "docid": "81da4e86a5d4b5d0ee1cde1e45d76153", "score": "0.44228715", "text": "func (c *Controller) reconcile(key string) error {\n\tlogger := c.logger.WithField(\"virtual-machine\", key)\n\tlogger.Infof(\"reconciling virtual machine\")\n\tnamespace, name, err := cache.SplitMetaNamespaceKey(key)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvm, err := c.client.VirtualMachines(namespace).Get(name, metav1.GetOptions{})\n\tif errors.IsNotFound(err) {\n\t\tlogger.Info(\"not doing work for virtual machine because it has been deleted\")\n\t\treturn nil\n\t}\n\tif err != nil {\n\t\tlogger.Errorf(\"unable to retrieve virtual machine from store: %v\", err)\n\t\treturn err\n\t}\n\n\tif !vm.ObjectMeta.DeletionTimestamp.IsZero() {\n\t\t// no-op if finalizer has been removed.\n\t\tif !sets.NewString(vm.ObjectMeta.Finalizers...).Has(vmapi.VirtualMachineFinalizer) {\n\t\t\tlogger.Info(\"reconciling virtual machine causes a no-op as there is no finalizer\")\n\t\t\treturn nil\n\t\t}\n\t\tlogger.Info(\"reconciling virtual machine causes deletion\")\n\t\tif err := c.deleteVM(vm); err != nil {\n\t\t\tlogger.Errorf(\"error deleting virtual machine: %v\", err)\n\t\t\treturn err\n\t\t}\n\n\t\tlogger.Info(\"virtual machine deletion successful, removing finalizer\")\n\t\tfinalizers := sets.NewString(vm.ObjectMeta.Finalizers...)\n\t\tfinalizers.Delete(vmapi.VirtualMachineFinalizer)\n\t\tvm.ObjectMeta.Finalizers = finalizers.List()\n\t\tif _, err := c.client.VirtualMachines(namespace).Update(vm); err != nil {\n\t\t\tlogger.Errorf(\"error removing finalizer: %v\", err)\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}\n\n\tlogger.Info(\"reconciling virtual machine causes creation\")\n\treturn c.ensureVM(vm)\n}", "title": "" }, { "docid": "c78d797d6c1e7e7be2438dccb1327c9f", "score": "0.44158968", "text": "func (r *ReconcileKnativeKafka) delete(instance *serverlessoperatorv1alpha1.KnativeKafka) error {\n\tdefer monitoring.KnativeUp.DeleteLabelValues(\"kafka_status\")\n\tfinalizers := sets.NewString(instance.GetFinalizers()...)\n\n\tif !finalizers.Has(finalizerName) {\n\t\tlog.Info(\"Finalizer has already been removed, nothing to do\")\n\t\treturn nil\n\t}\n\n\tlog.Info(\"Running cleanup logic\")\n\tlog.Info(\"Deleting KnativeKafka\")\n\tif err := r.deleteKnativeKafka(instance); err != nil {\n\t\treturn fmt.Errorf(\"failed to delete KnativeKafka: %w\", err)\n\t}\n\n\t// The above might take a while, so we refetch the resource again in case it has changed.\n\trefetched := &serverlessoperatorv1alpha1.KnativeKafka{}\n\tif err := r.client.Get(context.TODO(), types.NamespacedName{Namespace: instance.Namespace, Name: instance.Name}, refetched); err != nil {\n\t\treturn fmt.Errorf(\"failed to refetch KnativeKafka: %w\", err)\n\t}\n\n\t// Update the refetched finalizer list.\n\tfinalizers = sets.NewString(refetched.GetFinalizers()...)\n\tfinalizers.Delete(finalizerName)\n\trefetched.SetFinalizers(finalizers.List())\n\n\tif err := r.client.Update(context.TODO(), refetched); err != nil {\n\t\treturn fmt.Errorf(\"failed to update KnativeKafka with removed finalizer: %w\", err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b34ff96182fc2a7751712e610bcb888a", "score": "0.4412839", "text": "func TestDeleteSync(t *testing.T) {\n\tconst gceDriver = \"pd.csi.storage.gke.io\"\n\t// Default enable the HonorPVReclaimPolicy feature gate.\n\tdefer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.HonorPVReclaimPolicy, true)()\n\t_, ctx := ktesting.NewTestContext(t)\n\ttests := []controllerTest{\n\t\t{\n\t\t\t// delete volume bound by controller\n\t\t\tname: \"8-1 - successful delete\",\n\t\t\tinitialVolumes: newVolumeArray(\"volume8-1\", \"1Gi\", \"uid8-1\", \"claim8-1\", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty, volume.AnnBoundByController),\n\t\t\texpectedVolumes: novolumes,\n\t\t\tinitialClaims: noclaims,\n\t\t\texpectedClaims: noclaims,\n\t\t\texpectedEvents: noevents,\n\t\t\terrors: noerrors,\n\t\t\t// Inject deleter into the controller and call syncVolume. The\n\t\t\t// deleter simulates one delete() call that succeeds.\n\t\t\ttest: wrapTestWithReclaimCalls(operationDelete, []error{nil}, testSyncVolume),\n\t\t},\n\t\t{\n\t\t\t// delete volume bound by user\n\t\t\tname: \"8-2 - successful delete with prebound volume\",\n\t\t\tinitialVolumes: newVolumeArray(\"volume8-2\", \"1Gi\", \"uid8-2\", \"claim8-2\", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty),\n\t\t\texpectedVolumes: novolumes,\n\t\t\tinitialClaims: noclaims,\n\t\t\texpectedClaims: noclaims,\n\t\t\texpectedEvents: noevents,\n\t\t\terrors: noerrors,\n\t\t\t// Inject deleter into the controller and call syncVolume. The\n\t\t\t// deleter simulates one delete() call that succeeds.\n\t\t\ttest: wrapTestWithReclaimCalls(operationDelete, []error{nil}, testSyncVolume),\n\t\t},\n\t\t{\n\t\t\t// delete failure - plugin not found\n\t\t\tname: \"8-3 - plugin not found\",\n\t\t\tinitialVolumes: newVolumeArray(\"volume8-3\", \"1Gi\", \"uid8-3\", \"claim8-3\", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty),\n\t\t\texpectedVolumes: withMessage(\"error getting deleter volume plugin for volume \\\"volume8-3\\\": no volume plugin matched\", newVolumeArray(\"volume8-3\", \"1Gi\", \"uid8-3\", \"claim8-3\", v1.VolumeFailed, v1.PersistentVolumeReclaimDelete, classEmpty)),\n\t\t\tinitialClaims: noclaims,\n\t\t\texpectedClaims: noclaims,\n\t\t\texpectedEvents: []string{\"Warning VolumeFailedDelete\"},\n\t\t\terrors: noerrors,\n\t\t\ttest: testSyncVolume,\n\t\t},\n\t\t{\n\t\t\t// delete failure - newDeleter returns error\n\t\t\tname: \"8-4 - newDeleter returns error\",\n\t\t\tinitialVolumes: newVolumeArray(\"volume8-4\", \"1Gi\", \"uid8-4\", \"claim8-4\", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty),\n\t\t\texpectedVolumes: withMessage(\"failed to create deleter for volume \\\"volume8-4\\\": Mock plugin error: no deleteCalls configured\", newVolumeArray(\"volume8-4\", \"1Gi\", \"uid8-4\", \"claim8-4\", v1.VolumeFailed, v1.PersistentVolumeReclaimDelete, classEmpty)),\n\t\t\tinitialClaims: noclaims,\n\t\t\texpectedClaims: noclaims,\n\t\t\texpectedEvents: []string{\"Warning VolumeFailedDelete\"},\n\t\t\terrors: noerrors,\n\t\t\ttest: wrapTestWithReclaimCalls(operationDelete, []error{}, testSyncVolume),\n\t\t},\n\t\t{\n\t\t\t// delete failure - delete() returns error\n\t\t\tname: \"8-5 - delete returns error\",\n\t\t\tinitialVolumes: newVolumeArray(\"volume8-5\", \"1Gi\", \"uid8-5\", \"claim8-5\", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty),\n\t\t\texpectedVolumes: withMessage(\"Mock delete error\", newVolumeArray(\"volume8-5\", \"1Gi\", \"uid8-5\", \"claim8-5\", v1.VolumeFailed, v1.PersistentVolumeReclaimDelete, classEmpty)),\n\t\t\tinitialClaims: noclaims,\n\t\t\texpectedClaims: noclaims,\n\t\t\texpectedEvents: []string{\"Warning VolumeFailedDelete\"},\n\t\t\terrors: noerrors,\n\t\t\ttest: wrapTestWithReclaimCalls(operationDelete, []error{errors.New(\"Mock delete error\")}, testSyncVolume),\n\t\t},\n\t\t{\n\t\t\t// delete success(?) - volume is deleted before doDelete() starts\n\t\t\tname: \"8-6 - volume is deleted before deleting\",\n\t\t\tinitialVolumes: newVolumeArray(\"volume8-6\", \"1Gi\", \"uid8-6\", \"claim8-6\", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty),\n\t\t\texpectedVolumes: novolumes,\n\t\t\tinitialClaims: noclaims,\n\t\t\texpectedClaims: noclaims,\n\t\t\texpectedEvents: noevents,\n\t\t\terrors: noerrors,\n\t\t\ttest: wrapTestWithInjectedOperation(ctx, wrapTestWithReclaimCalls(operationDelete, []error{}, testSyncVolume), func(ctrl *PersistentVolumeController, reactor *pvtesting.VolumeReactor) {\n\t\t\t\t// Delete the volume before delete operation starts\n\t\t\t\treactor.DeleteVolume(\"volume8-6\")\n\t\t\t}),\n\t\t},\n\t\t{\n\t\t\t// delete success(?) - volume is bound just at the time doDelete()\n\t\t\t// starts. This simulates \"volume no longer needs recycling,\n\t\t\t// skipping\".\n\t\t\tname: \"8-7 - volume is bound before deleting\",\n\t\t\tinitialVolumes: newVolumeArray(\"volume8-7\", \"1Gi\", \"uid8-7\", \"claim8-7\", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty, volume.AnnBoundByController),\n\t\t\texpectedVolumes: newVolumeArray(\"volume8-7\", \"1Gi\", \"uid8-7\", \"claim8-7\", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty, volume.AnnBoundByController),\n\t\t\tinitialClaims: noclaims,\n\t\t\texpectedClaims: newClaimArray(\"claim8-7\", \"uid8-7\", \"10Gi\", \"volume8-7\", v1.ClaimBound, nil),\n\t\t\texpectedEvents: noevents,\n\t\t\terrors: noerrors,\n\t\t\ttest: wrapTestWithInjectedOperation(ctx, wrapTestWithReclaimCalls(operationDelete, []error{}, testSyncVolume), func(ctrl *PersistentVolumeController, reactor *pvtesting.VolumeReactor) {\n\t\t\t\t// Bind the volume to resurrected claim (this should never\n\t\t\t\t// happen)\n\t\t\t\tclaim := newClaim(\"claim8-7\", \"uid8-7\", \"10Gi\", \"volume8-7\", v1.ClaimBound, nil)\n\t\t\t\treactor.AddClaimBoundToVolume(claim)\n\t\t\t\tctrl.claims.Add(claim)\n\t\t\t}),\n\t\t},\n\t\t{\n\t\t\t// delete success - volume bound by user is deleted, while a new\n\t\t\t// claim is created with another UID.\n\t\t\tname: \"8-9 - prebound volume is deleted while the claim exists\",\n\t\t\tinitialVolumes: newVolumeArray(\"volume8-9\", \"1Gi\", \"uid8-9\", \"claim8-9\", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty),\n\t\t\texpectedVolumes: novolumes,\n\t\t\tinitialClaims: newClaimArray(\"claim8-9\", \"uid8-9-x\", \"10Gi\", \"\", v1.ClaimPending, nil),\n\t\t\texpectedClaims: newClaimArray(\"claim8-9\", \"uid8-9-x\", \"10Gi\", \"\", v1.ClaimPending, nil),\n\t\t\texpectedEvents: noevents,\n\t\t\terrors: noerrors,\n\t\t\t// Inject deleter into the controller and call syncVolume. The\n\t\t\t// deleter simulates one delete() call that succeeds.\n\t\t\ttest: wrapTestWithReclaimCalls(operationDelete, []error{nil}, testSyncVolume),\n\t\t},\n\t\t{\n\t\t\t// PV requires external deleter\n\t\t\tname: \"8-10 - external deleter\",\n\t\t\tinitialVolumes: []*v1.PersistentVolume{newExternalProvisionedVolume(\"volume8-10\", \"1Gi\", \"uid10-1\", \"claim10-1\", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty, gceDriver, nil, volume.AnnBoundByController)},\n\t\t\texpectedVolumes: []*v1.PersistentVolume{newExternalProvisionedVolume(\"volume8-10\", \"1Gi\", \"uid10-1\", \"claim10-1\", v1.VolumeReleased, v1.PersistentVolumeReclaimDelete, classEmpty, gceDriver, nil, volume.AnnBoundByController)},\n\t\t\tinitialClaims: noclaims,\n\t\t\texpectedClaims: noclaims,\n\t\t\texpectedEvents: noevents,\n\t\t\terrors: noerrors,\n\t\t\ttest: func(ctrl *PersistentVolumeController, reactor *pvtesting.VolumeReactor, test controllerTest) error {\n\t\t\t\t// Inject external deleter annotation\n\t\t\t\ttest.initialVolumes[0].Annotations[volume.AnnDynamicallyProvisioned] = \"external.io/test\"\n\t\t\t\ttest.expectedVolumes[0].Annotations[volume.AnnDynamicallyProvisioned] = \"external.io/test\"\n\t\t\t\treturn testSyncVolume(ctrl, reactor, test)\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t// delete success - two PVs are provisioned for a single claim.\n\t\t\t// One of the PVs is deleted.\n\t\t\tname: \"8-11 - two PVs provisioned for a single claim\",\n\t\t\tinitialVolumes: []*v1.PersistentVolume{\n\t\t\t\tnewVolume(\"volume8-11-1\", \"1Gi\", \"uid8-11\", \"claim8-11\", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty, volume.AnnDynamicallyProvisioned),\n\t\t\t\tnewVolume(\"volume8-11-2\", \"1Gi\", \"uid8-11\", \"claim8-11\", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty, volume.AnnDynamicallyProvisioned),\n\t\t\t},\n\t\t\texpectedVolumes: []*v1.PersistentVolume{\n\t\t\t\tnewVolume(\"volume8-11-2\", \"1Gi\", \"uid8-11\", \"claim8-11\", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty, volume.AnnDynamicallyProvisioned),\n\t\t\t},\n\t\t\t// the claim is bound to volume8-11-2 -> volume8-11-1 has lost the race and will be deleted\n\t\t\tinitialClaims: newClaimArray(\"claim8-11\", \"uid8-11\", \"10Gi\", \"volume8-11-2\", v1.ClaimBound, nil),\n\t\t\texpectedClaims: newClaimArray(\"claim8-11\", \"uid8-11\", \"10Gi\", \"volume8-11-2\", v1.ClaimBound, nil),\n\t\t\texpectedEvents: noevents,\n\t\t\terrors: noerrors,\n\t\t\t// Inject deleter into the controller and call syncVolume. The\n\t\t\t// deleter simulates one delete() call that succeeds.\n\t\t\ttest: wrapTestWithReclaimCalls(operationDelete, []error{nil}, testSyncVolume),\n\t\t},\n\t\t{\n\t\t\t// delete success - two PVs are externally provisioned for a single\n\t\t\t// claim. One of the PVs is marked as Released to be deleted by the\n\t\t\t// external provisioner.\n\t\t\tname: \"8-12 - two PVs externally provisioned for a single claim\",\n\t\t\tinitialVolumes: []*v1.PersistentVolume{\n\t\t\t\tnewExternalProvisionedVolume(\"volume8-12-1\", \"1Gi\", \"uid8-12\", \"claim8-12\", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty, gceDriver, nil, volume.AnnDynamicallyProvisioned),\n\t\t\t\tnewExternalProvisionedVolume(\"volume8-12-2\", \"1Gi\", \"uid8-12\", \"claim8-12\", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty, gceDriver, nil, volume.AnnDynamicallyProvisioned),\n\t\t\t},\n\t\t\texpectedVolumes: []*v1.PersistentVolume{\n\t\t\t\tnewExternalProvisionedVolume(\"volume8-12-1\", \"1Gi\", \"uid8-12\", \"claim8-12\", v1.VolumeReleased, v1.PersistentVolumeReclaimDelete, classEmpty, gceDriver, nil, volume.AnnDynamicallyProvisioned),\n\t\t\t\tnewExternalProvisionedVolume(\"volume8-12-2\", \"1Gi\", \"uid8-12\", \"claim8-12\", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty, gceDriver, nil, volume.AnnDynamicallyProvisioned),\n\t\t\t},\n\t\t\t// the claim is bound to volume8-12-2 -> volume8-12-1 has lost the race and will be \"Released\"\n\t\t\tinitialClaims: newClaimArray(\"claim8-12\", \"uid8-12\", \"10Gi\", \"volume8-12-2\", v1.ClaimBound, nil),\n\t\t\texpectedClaims: newClaimArray(\"claim8-12\", \"uid8-12\", \"10Gi\", \"volume8-12-2\", v1.ClaimBound, nil),\n\t\t\texpectedEvents: noevents,\n\t\t\terrors: noerrors,\n\t\t\ttest: func(ctrl *PersistentVolumeController, reactor *pvtesting.VolumeReactor, test controllerTest) error {\n\t\t\t\t// Inject external deleter annotation\n\t\t\t\ttest.initialVolumes[0].Annotations[volume.AnnDynamicallyProvisioned] = \"external.io/test\"\n\t\t\t\ttest.expectedVolumes[0].Annotations[volume.AnnDynamicallyProvisioned] = \"external.io/test\"\n\t\t\t\treturn testSyncVolume(ctrl, reactor, test)\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t// delete success - volume has deletion timestamp before doDelete() starts\n\t\t\tname: \"8-13 - volume has deletion timestamp and processed\",\n\t\t\tinitialVolumes: volumesWithFinalizers(withVolumeDeletionTimestamp(newVolumeArray(\"volume8-13\", \"1Gi\", \"uid8-13\", \"claim8-13\", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classEmpty, volume.AnnBoundByController)), []string{volume.PVDeletionInTreeProtectionFinalizer}),\n\t\t\texpectedVolumes: novolumes,\n\t\t\tinitialClaims: noclaims,\n\t\t\texpectedClaims: noclaims,\n\t\t\texpectedEvents: noevents,\n\t\t\terrors: noerrors,\n\t\t\ttest: wrapTestWithReclaimCalls(operationDelete, []error{nil}, testSyncVolume),\n\t\t},\n\t}\n\trunSyncTests(t, ctx, tests, []*storage.StorageClass{}, []*v1.Pod{})\n}", "title": "" }, { "docid": "de30eaa5f160c6b855c65accf4b7e26b", "score": "0.44072658", "text": "func Recover(curve elliptic.Curve, r, s, v *big.Int, hash []byte) (*ecdsa.PublicKey, bool, error) {\n\treturn RecoverWithNonce(curve, r, s, v, hash, 0)\n}", "title": "" }, { "docid": "8640331e375e890f35f68896f35a0ab1", "score": "0.44053632", "text": "func pvcDeleted(obj interface{}, metadataSyncer *MetadataSyncInformer) {\n\tpvc, ok := obj.(*v1.PersistentVolumeClaim)\n\tif pvc == nil || !ok {\n\t\tklog.Warningf(\"PVCDeleted: unrecognized object %+v\", obj)\n\t\treturn\n\t}\n\tklog.V(4).Infof(\"PVCDeleted: %+v\", pvc)\n\tif pvc.Status.Phase != v1.ClaimBound {\n\t\treturn\n\t}\n\t// Get pv object attached to pvc\n\tpv, err := metadataSyncer.pvLister.Get(pvc.Spec.VolumeName)\n\tif pv == nil || err != nil {\n\t\tklog.Errorf(\"PVCDeleted: Error getting Persistent Volume for pvc %s in namespace %s with err: %v\", pvc.Name, pvc.Namespace, err)\n\t\treturn\n\t}\n\n\t// Verify if pv is a vsphere csi volume\n\tif pv.Spec.CSI == nil || pv.Spec.CSI.Driver != service.Name {\n\t\tklog.V(3).Infof(\"PVCDeleted: Not a Vsphere CSI Volume\")\n\t\treturn\n\t}\n\n\t// Volume will be deleted by controller when reclaim policy is delete\n\tif pv.Spec.PersistentVolumeReclaimPolicy == v1.PersistentVolumeReclaimDelete {\n\t\tklog.V(3).Infof(\"PVCDeleted: Reclaim policy is delete\")\n\t\treturn\n\t}\n\n\t// If the PV reclaim policy is retain we need to delete PVC labels\n\tvar metadataList []cnstypes.BaseCnsEntityMetadata\n\tpvcMetadata := cnsvsphere.GetCnsKubernetesEntityMetaData(pvc.Name, nil, true, string(cnstypes.CnsKubernetesEntityTypePVC), pvc.Namespace)\n\tmetadataList = append(metadataList, cnstypes.BaseCnsEntityMetadata(pvcMetadata))\n\n\tupdateSpec := &cnstypes.CnsVolumeMetadataUpdateSpec{\n\t\tVolumeId: cnstypes.CnsVolumeId{\n\t\t\tId: pv.Spec.CSI.VolumeHandle,\n\t\t},\n\t\tMetadata: cnstypes.CnsVolumeMetadata{\n\t\t\tContainerCluster: cnsvsphere.GetContainerCluster(metadataSyncer.cfg.Global.ClusterID, metadataSyncer.cfg.VirtualCenter[metadataSyncer.vcenter.Config.Host].User),\n\t\t\tEntityMetadata: metadataList,\n\t\t},\n\t}\n\n\tklog.V(4).Infof(\"PVCDeleted: Calling UpdateVolumeMetadata for volume %s with updateSpec: %+v\", updateSpec.VolumeId.Id, spew.Sdump(updateSpec))\n\tif err := volumes.GetManager(metadataSyncer.vcenter).UpdateVolumeMetadata(updateSpec); err != nil {\n\t\tklog.Errorf(\"PVCDeleted: UpdateVolumeMetadata failed with err %v\", err)\n\t}\n}", "title": "" }, { "docid": "1f9891ffec149f90dc859463bda64a28", "score": "0.4387465", "text": "func fullSyncDeleteVolumes(volumeIDDeleteArray []cnstypes.CnsVolumeId, metadataSyncer *MetadataSyncInformer, k8sclient clientset.Interface, wg *sync.WaitGroup) {\n\tdefer wg.Done()\n\tdeleteDisk := false\n\tcurrentK8sPVMap := make(map[string]bool)\n\tvolumeOperationsLock.Lock()\n\tdefer volumeOperationsLock.Unlock()\n\t// Get all K8s PVs\n\tcurrentK8sPV, err := getPVsInBoundAvailableOrReleased(k8sclient)\n\tif err != nil {\n\t\tklog.Errorf(\"FullSync: fullSyncDeleteVolumes failed to get PVs from kubernetes. Err: %v\", err)\n\t\treturn\n\t}\n\t// Create map for easy lookup\n\tfor _, pv := range currentK8sPV {\n\t\tcurrentK8sPVMap[pv.Spec.CSI.VolumeHandle] = true\n\t}\n\tfor _, volID := range volumeIDDeleteArray {\n\t\t// Delete volume if not present in currentK8sPVMap\n\t\tif _, existsInK8s := currentK8sPVMap[volID.Id]; !existsInK8s {\n\t\t\tklog.V(4).Infof(\"FullSync: Calling DeleteVolume for volume %v with delete disk %v\", volID, deleteDisk)\n\t\t\terr := volumes.GetManager(metadataSyncer.vcenter).DeleteVolume(volID.Id, deleteDisk)\n\t\t\tif err != nil {\n\t\t\t\tklog.Warningf(\"FullSync: Failed to delete volume %s with error %+v\", volID, err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tdelete(cnsDeletionMap, volID.Id)\n\t}\n}", "title": "" }, { "docid": "949f8e40f4d704e97032eccf7cc7c63f", "score": "0.43853855", "text": "func (fleet *SpotFleet) DeregisterInstanceFromTargetGroup(wg *sync.WaitGroup, instanceId *string , targetGroupArn string ){\n defer wg.Done()\n fmt.Println(\"deregisteringTarget\", *instanceId, targetGroupArn)\n\n input := &elbv2.DeregisterTargetsInput{\n TargetGroupArn: aws.String(targetGroupArn),\n Targets: []*elbv2.TargetDescription{\n {\n Id: instanceId,\n },\n },\n }\n\n _, err := fleet.Elbv2Svc.DeregisterTargets(input)\n if err != nil {\n fmt.Println(err.Error())\n }\n}", "title": "" }, { "docid": "0d898584dc47b845b42038c955483c18", "score": "0.43801823", "text": "func (p *RedisProvider) Deprovision(ctx context.Context, instanceID string, params providers.DeprovisionParameters) error {\n\treplicationGroupID := GenerateReplicationGroupName(instanceID)\n\n\tinput := &elasticache.DeleteReplicationGroupInput{\n\t\tReplicationGroupId: aws.String(replicationGroupID),\n\t}\n\tif params.FinalSnapshotIdentifier != \"\" {\n\t\tinput.SetFinalSnapshotIdentifier(params.FinalSnapshotIdentifier)\n\t}\n\n\t_, err := p.elastiCache.DeleteReplicationGroupWithContext(ctx, input)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = p.DeleteAuthTokenSecret(ctx, instanceID, 30)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "109c762f1bb89d12160caac38272930f", "score": "0.43736285", "text": "func TestReconcileServiceInstanceDelete(t *testing.T) {\n\tfakeKubeClient, fakeCatalogClient, fakeClusterServiceBrokerClient, testController, sharedInformers := newTestController(t, fakeosb.FakeClientConfiguration{\n\t\tDeprovisionReaction: &fakeosb.DeprovisionReaction{\n\t\t\tResponse: &osb.DeprovisionResponse{},\n\t\t},\n\t})\n\n\tsharedInformers.ClusterServiceBrokers().Informer().GetStore().Add(getTestClusterServiceBroker())\n\tsharedInformers.ClusterServiceClasses().Informer().GetStore().Add(getTestClusterServiceClass())\n\tsharedInformers.ClusterServicePlans().Informer().GetStore().Add(getTestClusterServicePlan())\n\n\tinstance := getTestServiceInstanceWithRefs()\n\tinstance.ObjectMeta.DeletionTimestamp = &metav1.Time{}\n\tinstance.ObjectMeta.Finalizers = []string{v1beta1.FinalizerServiceCatalog}\n\t// we only invoke the broker client to deprovision if we have a reconciled generation set\n\t// as that implies a previous success.\n\tinstance.Generation = 2\n\tinstance.Status.ReconciledGeneration = 1\n\tinstance.Status.ObservedGeneration = 1\n\tinstance.Status.ProvisionStatus = v1beta1.ServiceInstanceProvisionStatusProvisioned\n\tinstance.Status.ExternalProperties = &v1beta1.ServiceInstancePropertiesState{\n\t\tClusterServicePlanExternalName: testClusterServicePlanName,\n\t\tClusterServicePlanExternalID: testClusterServicePlanGUID,\n\t}\n\tinstance.Status.DeprovisionStatus = v1beta1.ServiceInstanceDeprovisionStatusRequired\n\n\tfakeCatalogClient.AddReactor(\"get\", \"serviceinstances\", func(action clientgotesting.Action) (bool, runtime.Object, error) {\n\t\treturn true, instance, nil\n\t})\n\n\tif err := reconcileServiceInstance(t, testController, instance); err != nil {\n\t\tt.Fatalf(\"unexpected error: %v\", err)\n\t}\n\tinstance = assertServiceInstanceDeprovisionInProgressIsTheOnlyCatalogClientAction(t, fakeCatalogClient, instance)\n\tfakeCatalogClient.ClearActions()\n\tfakeKubeClient.ClearActions()\n\n\terr := reconcileServiceInstance(t, testController, instance)\n\tif err != nil {\n\t\tt.Fatalf(\"This should not fail\")\n\t}\n\n\tbrokerActions := fakeClusterServiceBrokerClient.Actions()\n\tassertNumberOfClusterServiceBrokerActions(t, brokerActions, 1)\n\tassertDeprovision(t, brokerActions[0], &osb.DeprovisionRequest{\n\t\tAcceptsIncomplete: true,\n\t\tInstanceID: testServiceInstanceGUID,\n\t\tServiceID: testClusterServiceClassGUID,\n\t\tPlanID: testClusterServicePlanGUID,\n\t})\n\n\t// Verify no core kube actions occurred\n\tkubeActions := fakeKubeClient.Actions()\n\tassertNumberOfActions(t, kubeActions, 0)\n\n\tactions := fakeCatalogClient.Actions()\n\tassertNumberOfActions(t, actions, 1)\n\n\tupdatedServiceInstance := assertUpdateStatus(t, actions[0], instance)\n\tassertServiceInstanceOperationSuccess(t, updatedServiceInstance, v1beta1.ServiceInstanceOperationDeprovision, testClusterServicePlanName, testClusterServicePlanGUID, instance)\n\n\tevents := getRecordedEvents(testController)\n\n\texpectedEvent := normalEventBuilder(successDeprovisionReason).msg(\"The instance was deprovisioned successfully\")\n\tif err := checkEvents(events, expectedEvent.stringArr()); err != nil {\n\t\tt.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "2b5e6bcece60adb2b5c1c78d1ac1222a", "score": "0.43703085", "text": "func (v *VgroupService) GetVgroup(name string) (*Vgroup, error) {\n\n\tpath := fmt.Sprintf(\"vgroup/%s\", name)\n\treq, err := v.client.NewRequest(\"GET\", path, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tm := &Vgroup{}\n\t_, err = v.client.Do(req, m, false)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn m, err\n}", "title": "" }, { "docid": "3e6697fc11bce0c56328156f9eeda2c8", "score": "0.43699992", "text": "func cleanupVDisks() {\n\t// try cleanup\n\tremoveVDisk(s1path)\n\tremoveVDisk(s2path)\n\tremoveVDisk(s3path)\n}", "title": "" }, { "docid": "823c4110aa26301a5cfe0892b8492ac0", "score": "0.43671563", "text": "func (vrf verifio) Verify() error {\n\terr := vrf.checkForDetectedNames()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"-> checkForDetectedNames %w\", err)\n\t}\n\tnamesNum, err := vrf.numberOfNames()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"-> numberOfNames %w\", err)\n\t}\n\tlog.Info().Msgf(\"Verifying %s names\", humanize.Comma(int64(namesNum)))\n\n\tvrfREST := verifrest.New(vrf.cfg.VerifierURL)\n\tctx, cancel := context.WithCancel(context.Background())\n\t// this cancel will stop all child contexts\n\tdefer cancel()\n\n\tstart := time.Now()\n\tchIn := make(chan []name.UniqueName)\n\tchOut := make(chan verifiedBatch)\n\tgLoad, ctxLoad := errgroup.WithContext(ctx)\n\tgSave, ctxSave := errgroup.WithContext(ctx)\n\tvar wg sync.WaitGroup\n\twg.Add(1)\n\n\tgLoad.Go(func() error {\n\t\terr = vrf.loadNames(ctxLoad, namesNum, chIn)\n\t\tif err != nil {\n\t\t\terr = fmt.Errorf(\"-> loadNames %w\", err)\n\t\t}\n\t\treturn err\n\t})\n\n\tgo vrf.sendToVerify(ctx, vrfREST, chIn, chOut, &wg)\n\n\tgSave.Go(func() error {\n\t\terr = vrf.saveVerif(ctxSave, chOut, namesNum, start)\n\t\tif err != nil {\n\t\t\terr = fmt.Errorf(\"-> saveVerif %w\", err)\n\t\t}\n\t\treturn err\n\t})\n\n\terr = gLoad.Wait()\n\tif err != nil {\n\t\treturn err\n\t}\n\tclose(chIn)\n\n\twg.Wait()\n\tclose(chOut)\n\n\tgSave.Wait()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "5c211a124723ac3002ee8eeb9ad41548", "score": "0.43602762", "text": "func Restore(request *msgs.PgbasebackupRestoreRequest, ns string) msgs.PgbasebackupRestoreResponse {\n\n\tresp := msgs.PgbasebackupRestoreResponse{\n\t\tStatus: msgs.Status{\n\t\t\tCode: msgs.Ok,\n\t\t},\n\t}\n\n\terr := validateRestoreRequest(*request, ns)\n\tif err != nil {\n\t\tresp.Status.Code = msgs.Error\n\t\tresp.Status.Msg = fmt.Sprintf(\"Invalid pgbasebackup restore request:\\n%s\", err)\n\t\treturn resp\n\t}\n\n\tworkflowTask, err := createRestoreWorkflowTask(request.FromCluster, ns)\n\tif err != nil {\n\t\tresp.Status.Code = msgs.Error\n\t\tresp.Results = append(resp.Results, err.Error())\n\t\treturn resp\n\t}\n\n\tpgtask, err := createRestoreTask(request, workflowTask.Spec.Parameters[crv1.PgtaskWorkflowID], ns)\n\tif err != nil {\n\t\tresp.Status.Code = msgs.Error\n\t\tresp.Status.Msg = err.Error()\n\t\treturn resp\n\t}\n\n\terr = kubeapi.Createpgtask(apiserver.RESTClient, workflowTask, ns)\n\tif err != nil {\n\t\tresp.Status.Code = msgs.Error\n\t\tresp.Status.Msg = err.Error()\n\t\treturn resp\n\t}\n\n\terr = kubeapi.Createpgtask(apiserver.RESTClient, pgtask, ns)\n\tif err != nil {\n\t\tresp.Status.Code = msgs.Error\n\t\tresp.Status.Msg = err.Error()\n\t\treturn resp\n\t}\n\n\tresp.Results = append(resp.Results, \"pgbasebackup restore performed on \"+request.FromCluster+\" to PVC \"+request.ToPVC+\n\t\t\" using backup '\"+pgtask.Spec.Parameters[config.LABEL_PGBASEBACKUP_RESTORE_BACKUP_PATH]+\"'\")\n\tresp.Results = append(resp.Results, \"workflow id \"+workflowTask.Spec.Parameters[crv1.PgtaskWorkflowID])\n\n\treturn resp\n}", "title": "" }, { "docid": "7407d3f2c6bdf002a2d828c149d099b8", "score": "0.43602717", "text": "func (v *VgroupService) ListVgroups() ([]Vgroup, error) {\n\n\treq, err := v.client.NewRequest(\"GET\", \"vgroup\", nil, nil)\n\tm := []Vgroup{}\n\t_, err = v.client.Do(req, &m, false)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn m, err\n}", "title": "" }, { "docid": "8c2bafa4a0eceaec9f857307e91d1f8b", "score": "0.4355338", "text": "func (s *BasemoleculeListener) ExitGroup(ctx *GroupContext) {}", "title": "" }, { "docid": "98e177ee2c16147d4f77193e2382b7b7", "score": "0.43509552", "text": "func TestReconcileServiceInstanceDeleteFailedUpdate(t *testing.T) {\n\tfakeKubeClient, fakeCatalogClient, fakeClusterServiceBrokerClient, testController, sharedInformers := newTestController(t, fakeosb.FakeClientConfiguration{\n\t\tDeprovisionReaction: &fakeosb.DeprovisionReaction{\n\t\t\tResponse: &osb.DeprovisionResponse{},\n\t\t},\n\t})\n\n\tsharedInformers.ClusterServiceBrokers().Informer().GetStore().Add(getTestClusterServiceBroker())\n\tsharedInformers.ClusterServiceClasses().Informer().GetStore().Add(getTestClusterServiceClass())\n\tsharedInformers.ClusterServicePlans().Informer().GetStore().Add(getTestClusterServicePlan())\n\n\tinstance := getTestServiceInstanceWithRefs()\n\tinstance.ObjectMeta.DeletionTimestamp = &metav1.Time{}\n\tinstance.ObjectMeta.Finalizers = []string{v1beta1.FinalizerServiceCatalog}\n\tinstance.Status.ExternalProperties = &v1beta1.ServiceInstancePropertiesState{\n\t\tClusterServicePlanExternalName: testClusterServicePlanName,\n\t\tClusterServicePlanExternalID: testClusterServicePlanGUID,\n\t}\n\tinstance.Generation = 2\n\tinstance.Status.ReconciledGeneration = 2\n\tinstance.Status.ObservedGeneration = 2\n\tinstance.Status.ProvisionStatus = v1beta1.ServiceInstanceProvisionStatusProvisioned\n\tinstance.Status.DeprovisionStatus = v1beta1.ServiceInstanceDeprovisionStatusRequired\n\n\tfakeCatalogClient.AddReactor(\"get\", \"serviceinstances\", func(action clientgotesting.Action) (bool, runtime.Object, error) {\n\t\treturn true, instance, nil\n\t})\n\n\tif err := reconcileServiceInstance(t, testController, instance); err != nil {\n\t\tt.Fatalf(\"unexpected error: %v\", err)\n\t}\n\tinstance = assertServiceInstanceDeprovisionInProgressIsTheOnlyCatalogClientAction(t, fakeCatalogClient, instance)\n\tfakeCatalogClient.ClearActions()\n\tfakeKubeClient.ClearActions()\n\n\terr := reconcileServiceInstance(t, testController, instance)\n\tif err != nil {\n\t\tt.Fatalf(\"Unexpected error from reconcileServiceInstance: %v\", err)\n\t}\n\n\tbrokerActions := fakeClusterServiceBrokerClient.Actions()\n\tassertNumberOfClusterServiceBrokerActions(t, brokerActions, 1)\n\tassertDeprovision(t, brokerActions[0], &osb.DeprovisionRequest{\n\t\tAcceptsIncomplete: true,\n\t\tInstanceID: testServiceInstanceGUID,\n\t\tServiceID: testClusterServiceClassGUID,\n\t\tPlanID: testClusterServicePlanGUID,\n\t})\n\n\t// Verify no core kube actions occurred\n\tkubeActions := fakeKubeClient.Actions()\n\tassertNumberOfActions(t, kubeActions, 0)\n\n\tactions := fakeCatalogClient.Actions()\n\tassertNumberOfActions(t, actions, 1)\n\n\tupdatedServiceInstance := assertUpdateStatus(t, actions[0], instance)\n\tassertServiceInstanceOperationSuccess(t, updatedServiceInstance, v1beta1.ServiceInstanceOperationDeprovision, testClusterServicePlanName, testClusterServicePlanGUID, instance)\n\n\tevents := getRecordedEvents(testController)\n\n\texpectedEvent := normalEventBuilder(successDeprovisionReason).msg(\"The instance was deprovisioned successfully\")\n\tif err := checkEvents(events, expectedEvent.stringArr()); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tassertEmptyFinalizers(t, updatedServiceInstance)\n}", "title": "" }, { "docid": "c46482e66c4468ddcffdbf44530be30e", "score": "0.43500623", "text": "func (c *VirtualMachineClient) Delete(ctx context.Context, group string, name string) error {\n\treturn c.internal.Delete(ctx, group, name)\n}", "title": "" }, { "docid": "1217feee1c559af42b5e7d43bdf5d3de", "score": "0.4348401", "text": "func rpcResetSV(s *TestAgent) {\n\tvar lArgs structs.VariablesListRequest\n\tvar lResp structs.VariablesListResponse\n\n\tlArgs = structs.VariablesListRequest{\n\t\tQueryOptions: structs.QueryOptions{\n\t\t\tNamespace: \"*\",\n\t\t\tRegion: \"global\",\n\t\t},\n\t}\n\terr := s.Agent.RPC(structs.VariablesListRPCMethod, &lArgs, &lResp)\n\trequire.NoError(s.T, err)\n\n\tdArgs := structs.VariablesApplyRequest{\n\t\tOp: structs.VarOpDelete,\n\t\tVar: &structs.VariableDecrypted{},\n\t\tWriteRequest: structs.WriteRequest{\n\t\t\tRegion: \"global\",\n\t\t},\n\t}\n\n\tvar dResp structs.VariablesApplyResponse\n\n\tfor _, v := range lResp.Data {\n\t\tdArgs.Var.Path = v.Path\n\t\tdArgs.Var.Namespace = v.Namespace\n\t\terr := s.Agent.RPC(structs.VariablesApplyRPCMethod, &dArgs, &dResp)\n\t\trequire.NoError(s.T, err)\n\t}\n\n\terr = s.Agent.RPC(structs.VariablesListRPCMethod, &lArgs, &lResp)\n\trequire.NoError(s.T, err)\n\trequire.Equal(s.T, 0, len(lResp.Data))\n}", "title": "" }, { "docid": "5517d9b281ee7ca56a7f08228116bf6a", "score": "0.43482998", "text": "func (reb *Manager) detectBroken(md *rebArgs, res *globalCTList) {\n\treb.ec.broken = make([]*rebObject, 0)\n\tbowner := reb.t.GetBowner()\n\tbmd := bowner.Get()\n\n\tproviders := map[string]map[string]*rebBck{\n\t\tcmn.ProviderAIS: res.ais,\n\t\tcmn.GCO.Get().Cloud.Provider: res.cloud,\n\t}\n\tfor provider, tp := range providers {\n\t\tfor bckName, objs := range tp {\n\t\t\tif provider == \"\" {\n\t\t\t\t// Cloud provider can be empty so we do not need to do anything.\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tbck := cluster.NewBck(bckName, provider, cmn.NsGlobal)\n\t\t\tif err := bck.Init(bowner, reb.t.Snode()); err != nil {\n\t\t\t\t// bucket might be deleted while rebalancing - skip it\n\t\t\t\tglog.Errorf(\"invalid bucket %s: %v\", bckName, err)\n\t\t\t\tdelete(tp, bckName)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tbprops, ok := bmd.Get(bck)\n\t\t\tif !ok {\n\t\t\t\t// bucket might be deleted while rebalancing - skip it\n\t\t\t\tglog.Errorf(\"bucket %s does not exist\", bckName)\n\t\t\t\tdelete(tp, bckName)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t// Select only objects that have \"main\" part missing or misplaced.\n\t\t\t// Other missing slices/replicas must be added to ZIL\n\t\t\tfor objName, obj := range objs.objs {\n\t\t\t\tif err := reb.calcLocalProps(bck, obj, md.smap, &bprops.EC); err != nil {\n\t\t\t\t\tglog.Warningf(\"detect %s failed, skipping: %v\", obj.objName, err)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tmainHasObject := (obj.mainSliceID == 0 || obj.isECCopy) && obj.mainHasAny\n\t\t\t\tif mainHasObject {\n\t\t\t\t\t// TODO: put to ZIL slices to rebuild locally and resend\n\t\t\t\t\t// or slices to move locally if needed\n\t\t\t\t\tglog.Infof(\"#0. Main has full object: %s\", objName)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tif bool(glog.FastV(4, glog.SmoduleReb)) {\n\t\t\t\t\tglog.Infof(\"[%s] BROKEN: %s [Main %d on %s], CTs %d of %d\",\n\t\t\t\t\t\treb.t.Snode(), objName, obj.mainSliceID, obj.mainDaemon, obj.foundCT(), obj.requiredCT())\n\t\t\t\t}\n\t\t\t\treb.ec.broken = append(reb.ec.broken, obj)\n\t\t\t}\n\t\t}\n\t}\n\n\t// sort the list of broken object to have deterministic order on all targets\n\t// sort order: IsAIS/Bucket name/Object name\n\tctLess := func(i, j int) bool {\n\t\tif reb.ec.broken[i].bck.Provider != reb.ec.broken[j].bck.Provider {\n\t\t\treturn reb.ec.broken[j].bck.IsAIS()\n\t\t}\n\t\tbi := reb.ec.broken[i].bck.Name\n\t\tbj := reb.ec.broken[j].bck.Name\n\t\tif bi != bj {\n\t\t\treturn bi < bj\n\t\t}\n\t\treturn reb.ec.broken[i].objName < reb.ec.broken[j].objName\n\t}\n\tsort.Slice(reb.ec.broken, ctLess)\n}", "title": "" }, { "docid": "d46dbf033dfd0235afb851359adf40ff", "score": "0.4347637", "text": "func (a *actuator) Restore(ctx context.Context, dns *extensionsv1alpha1.DNSRecord, cluster *extensionscontroller.Cluster) error {\n\treturn a.Reconcile(ctx, dns, cluster)\n}", "title": "" }, { "docid": "d46dbf033dfd0235afb851359adf40ff", "score": "0.4347637", "text": "func (a *actuator) Restore(ctx context.Context, dns *extensionsv1alpha1.DNSRecord, cluster *extensionscontroller.Cluster) error {\n\treturn a.Reconcile(ctx, dns, cluster)\n}", "title": "" }, { "docid": "fbec709b6c46b2cc6ddd4834fad6408d", "score": "0.43411255", "text": "func reconcileDaemonSet(ctx context.Context, request reconcile.Request, r *reconcileBackup) (reconcile.Result, error) {\n\tlog := log.FromContext(ctx)\n\n\tobj := &appsv1.DaemonSet{}\n\t// Fetch the object from the cache\n\terr := r.client.Get(ctx, request.NamespacedName, obj)\n\tif errors.IsNotFound(err) {\n\t\tlog.Error(nil, \"Could not find object of type \"+r.k8sType)\n\t\treturn reconcile.Result{}, nil\n\t}\n\n\tif err != nil {\n\t\treturn reconcile.Result{}, fmt.Errorf(\"could not fetch object: %+v\", err)\n\t}\n\n\t//checking images from object\n\tobjectChanged := false\n\n\tfor i, initContainer := range obj.Spec.Template.Spec.InitContainers {\n\t\tif !r.registry.IsImageFromBackUp(initContainer.Image) {\n\t\t\tobjectChanged = true\n\t\t\tlog.Info(\"Image \" + initContainer.Image + \" does not exists in backup\")\n\t\t\tnewImageName, err := r.registry.AddImageToBackUp(initContainer.Image)\n\t\t\tif err != nil {\n\t\t\t\tlog.Error(err, \"Could not add image from init container to backup\")\n\t\t\t\treturn reconcile.Result{}, nil\n\t\t\t}\n\t\t\tlog.Info(\"Image \" + initContainer.Image + \" pushed to backup as \" + newImageName)\n\t\t\tobj.Spec.Template.Spec.InitContainers[i].Image = newImageName\n\t\t}\n\t}\n\n\tfor i, container := range obj.Spec.Template.Spec.Containers {\n\t\tif !r.registry.IsImageFromBackUp(container.Image) {\n\t\t\tobjectChanged = true\n\t\t\tlog.Info(\"Image \" + container.Image + \" does not exists in backup\")\n\t\t\tnewImageName, err := r.registry.AddImageToBackUp(container.Image)\n\t\t\tif err != nil {\n\t\t\t\tlog.Error(err, \"Could not add image from container to backup\")\n\t\t\t\treturn reconcile.Result{}, nil\n\t\t\t}\n\t\t\tlog.Info(\"Image \" + container.Image + \" pushed to backup as \" + newImageName)\n\t\t\tobj.Spec.Template.Spec.Containers[i].Image = newImageName\n\t\t}\n\t}\n\n\tif !objectChanged {\n\t\t//It is not necessary to do the update\n\t\tlog.Info(\"daemonset does not need any modification\")\n\t\treturn reconcile.Result{}, nil\n\t}\n\n\t// Update the Daemonset\n\terr = r.client.Update(ctx, obj)\n\tif err != nil {\n\t\tlog.Info(\"daemonset updated\")\n\t\treturn reconcile.Result{}, fmt.Errorf(\"could not write Daemonset: %+v\", err)\n\t}\n\n\treturn reconcile.Result{}, nil\n}", "title": "" }, { "docid": "b66c062fc3133e4225afad2d7be62a1f", "score": "0.43339926", "text": "func (w *Worker) detachSGroup(sg *SGroup) error {\n\t// Send gRPC to inform scheduler.\n\tif status, err := w.DetachChain(sg.tids, 0); err != nil {\n\t\treturn err\n\t} else if status.GetCode() != 0 {\n\t\treturn errors.New(fmt.Sprintf(\"DetachChain gRPC request errmsg: %s\", status.GetErrmsg()))\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "79961a5a6a5d49049d7135e3b2a2ee3c", "score": "0.43315363", "text": "func (pb *PBServer) Recover(args *RecoverArgs, reply *RecoverReply) error {\n\tpb.opMu.Lock()\n\tdefer pb.opMu.Unlock()\n\n\tif pb.dead {\n\t\treturn nil\n\t}\n\n\t// Clear data.\n\tpb.table = SyncedTable{}\n\tpb.table.Init()\n\tpb.seenOPID = SyncedTable{}\n\tpb.seenOPID.Init()\n\n\t// Check whether log recover file exists or not.\n\tif _, err := os.Stat(pb.logFile); os.IsNotExist(err) {\n\t\t// No need to recover since there isn't a recover log file yet.\n\t\treply.Err = OK\n\t\treturn nil\n\t}\n\n\tlogFile, err := os.OpenFile(pb.logFile, os.O_RDONLY, 0777)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer logFile.Close()\n\n\t// Check whether log recover file is empty or not.\n\tif stat, _ := logFile.Stat(); stat.Size() == 0 {\n\t\treturn errors.New(\"Open log file failed\")\n\t}\n\n\t// Read recover log line by line.\n\tscanner := bufio.NewScanner(logFile)\n\tfor scanner.Scan() {\n\t\tline := scanner.Text()\n\t\tlineArgs := strings.Split(line, Separator)\n\t\topType := lineArgs[0]\n\t\topID := lineArgs[1]\n\t\tkey := lineArgs[2]\n\t\tvalue := lineArgs[3]\n\t\tdoHash, err := strconv.ParseBool(lineArgs[4])\n\t\tprevValue := \"\"\n\t\tif len(lineArgs) >= 6 {\n\t\t\tprevValue = lineArgs[5]\n\t\t}\n\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tif opType == \"PUT\" {\n\t\t\t// Recover the value into table.\n\t\t\tputArgs := &PutArgs{key, value, doHash, \"RECOVER\", opID}\n\t\t\tvar putReply PutReply\n\t\t\tfor putReply.Err != OK {\n\t\t\t\tpb.table.Put(putArgs, &putReply)\n\t\t\t}\n\n\t\t\t// Set true for this operation ID in seenTable.\n\t\t\tpb.seenOPID.SimplePut(opID, prevValue)\n\t\t}\n\t}\n\treply.Err = OK\n\n\treturn nil\n}", "title": "" }, { "docid": "3aabf9e45acc5f79b92ef8f0ce67c06a", "score": "0.433117", "text": "func deleteGroup(c *bm.Context) {\n\tp := &model.DeleteGroupParams{}\n\tif err := c.Bind(p); err != nil {\n\t\treturn\n\t}\n\tc.JSON(nil, wkfSvc.DeleteGroup(c, p))\n}", "title": "" }, { "docid": "857f5051e42e37f60ad2ae50c9a9abea", "score": "0.43295428", "text": "func (cl *Client) VolumeDetach(ctx context.Context, vda *csp.VolumeDetachArgs) (*csp.Volume, error) {\n\tgroupName := cl.getResourceGroup(vda.ProvisioningAttributes)\n\tvmc := cl.newVMClient()\n\tfound := false\n\tvar vm compute.VirtualMachine\n\t// TBD: Handle VM Scaleable Sets\n\top := func() (bool, error) {\n\t\tcl.csp.dbgF(\"AZURE fetching node[%s] in group[%s]\", vda.NodeIdentifier, groupName)\n\t\tvar err error\n\t\tvm, err = vmc.Get(ctx, groupName, vda.NodeIdentifier, compute.InstanceView)\n\t\tif err == nil {\n\t\t\tdisks := *vm.StorageProfile.DataDisks\n\t\t\tlun := int32(-1)\n\t\t\tfor i, d := range disks {\n\t\t\t\tif d.Name != nil && *d.Name == vda.VolumeIdentifier {\n\t\t\t\t\tfound = true\n\t\t\t\t\tlun = to.Int32(d.Lun)\n\t\t\t\t\tdisks = append(disks[:i], disks[i+1:]...)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !found {\n\t\t\t\tcl.csp.dbgF(\"AZURE disk[%s] already detached from node[%s] group[%s]\", vda.VolumeIdentifier, vda.NodeIdentifier, groupName)\n\t\t\t\treturn false, csp.ErrorVolumeNotAttached\n\t\t\t}\n\t\t\tvm.StorageProfile.DataDisks = &disks\n\t\t\tcl.csp.dbgF(\"AZURE detaching disk[%s] from node[%s] releasing lun[%d]\", vda.VolumeIdentifier, vda.NodeIdentifier, lun)\n\t\t\tvar future azuresdk.VMCreateOrUpdateFuture\n\t\t\tfuture, err = vmc.CreateOrUpdate(ctx, groupName, vda.NodeIdentifier, vm)\n\t\t\tif err == nil {\n\t\t\t\terr = future.WaitForCompletionRef(ctx, vmc)\n\t\t\t\tif err == nil {\n\t\t\t\t\tvm, err = future.Result(vmc)\n\t\t\t\t\tif err == nil {\n\t\t\t\t\t\treturn false, nil\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false, err // TBD: retry cases\n\t}\n\tif err := cl.doWithRetry(op); err != nil {\n\t\treturn nil, err\n\t}\n\tcl.csp.dbgF(\"AZURE fetching disk[%s] in group[%s]\", vda.VolumeIdentifier, groupName)\n\tdc := cl.newDisksClient()\n\td, err := dc.Get(ctx, groupName, vda.VolumeIdentifier)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn azureDiskToVolume(&d, nil), nil\n}", "title": "" }, { "docid": "5db7433c95f53114721b219737e96c9e", "score": "0.43167442", "text": "func (f *FakeDiskSM) RecoverFromSnapshot(r io.Reader,\n\tstopc <-chan struct{}) error {\n\tv := make([]byte, 8)\n\tif _, err := io.ReadFull(r, v); err != nil {\n\t\treturn err\n\t}\n\tf.initialApplied = binary.LittleEndian.Uint64(v)\n\tif _, err := io.ReadFull(r, v); err != nil {\n\t\treturn err\n\t}\n\tf.count = binary.LittleEndian.Uint64(v)\n\tfmt.Printf(\"loading initial %d, count %d\\n\", f.initialApplied, f.count)\n\treturn nil\n}", "title": "" }, { "docid": "f20a9edcae7cd047d615562d974eca4a", "score": "0.4310089", "text": "func (_Valset *ValsetCaller) Recover(opts *bind.CallOpts, _message [32]byte, _signature []byte) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _Valset.contract.Call(opts, out, \"recover\", _message, _signature)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "940be3f435416e06cc8beeb5f9aa4c8f", "score": "0.43055007", "text": "func (n NullProvider) ResizeGroup(string, int32) error {\n\treturn fmt.Errorf(\"Provider does not support InstanceGroups\")\n}", "title": "" }, { "docid": "8ae562fd70cf55828d1ab1116b7a0137", "score": "0.4299658", "text": "func (n *NodeGroupDrainer) Drain() error {\n\tif err := n.evictor.CanUseEvictions(); err != nil {\n\t\treturn errors.Wrap(err, \"checking if cluster implements policy API\")\n\t}\n\n\tlistOptions := n.ng.ListOptions()\n\tnodes, err := n.clientSet.CoreV1().Nodes().List(context.TODO(), listOptions)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif len(nodes.Items) == 0 {\n\t\tlogger.Warning(\"no nodes found in nodegroup %q (label selector: %q)\", n.ng.NameString(), n.ng.ListOptions().LabelSelector)\n\t\treturn nil\n\t}\n\n\tif n.undo {\n\t\tn.toggleCordon(false, nodes)\n\t\treturn nil // no need to kill any pods\n\t}\n\n\tdrainedNodes := sets.NewString()\n\t// loop until all nodes are drained to handle accidental scale-up\n\t// or any other changes in the ASG\n\ttimer := time.NewTimer(n.waitTimeout)\n\tdefer timer.Stop()\n\n\tfor {\n\t\tselect {\n\t\tcase <-timer.C:\n\t\t\treturn fmt.Errorf(\"timed out (after %s) waiting for nodegroup %q to be drained\", n.waitTimeout, n.ng.NameString())\n\t\tdefault:\n\t\t\tnodes, err := n.clientSet.CoreV1().Nodes().List(context.TODO(), listOptions)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tn.toggleCordon(true, nodes)\n\n\t\t\tnewPendingNodes := sets.NewString()\n\n\t\t\tfor _, node := range nodes.Items {\n\t\t\t\tif !drainedNodes.Has(node.Name) {\n\t\t\t\t\tnewPendingNodes.Insert(node.Name)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif newPendingNodes.Len() == 0 {\n\t\t\t\tlogger.Success(\"drained all nodes: %v\", drainedNodes.List())\n\t\t\t\treturn nil // no new nodes were seen\n\t\t\t}\n\n\t\t\tlogger.Debug(\"already drained: %v\", drainedNodes.List())\n\t\t\tlogger.Debug(\"will drain: %v\", newPendingNodes.List())\n\n\t\t\tfor _, node := range newPendingNodes.List() {\n\t\t\t\tpending, err := n.evictPods(node)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlogger.Warning(\"pod eviction error (%q) on node %s\", err, node)\n\t\t\t\t\ttime.Sleep(retryDelay)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tlogger.Debug(\"%d pods to be evicted from %s\", pending, node)\n\t\t\t\tif pending == 0 {\n\t\t\t\t\tdrainedNodes.Insert(node)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c953ed708c1436b54ca860e09a5009cd", "score": "0.42991486", "text": "func Recover(runnable Runnable) Runnable {\n\treturn &RecoverRunner{baseWrapper{\"recover\", runnable}, runnable}\n}", "title": "" }, { "docid": "3970561f8fc44c12f6e83619cd549d1b", "score": "0.4298416", "text": "func (s *VolumeService) RecoverVolume(p *RecoverVolumeParams) (*RecoverVolumeResponse, error) {\n\tresp, err := s.cs.newRequest(\"recoverVolume\", p.toURLValues())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar r RecoverVolumeResponse\n\tif err := json.Unmarshal(resp, &r); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &r, nil\n}", "title": "" }, { "docid": "2c80b5a76e53038d37020a01d0808b41", "score": "0.42973086", "text": "func WaitForBKClusterToUpgrade(t *testing.T, k8client client.Client, b *bkapi.BookkeeperCluster, targetVersion string) error {\n\tlog.Printf(\"waiting for cluster to upgrade: %s\", b.Name)\n\n\tlistOptions := []client.ListOption{\n\t\tclient.InNamespace(b.GetNamespace()),\n\t\tclient.MatchingLabelsSelector{Selector: labels.SelectorFromSet(map[string]string{\"bookkeeper_cluster\": b.GetName()})},\n\t}\n\n\terr := wait.Poll(RetryInterval, UpgradeTimeout, func() (done bool, err error) {\n\t\tcluster, err := GetBKCluster(t, k8client, b)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\n\t\t_, upgradeCondition := cluster.Status.GetClusterCondition(bkapi.ClusterConditionUpgrading)\n\t\t_, errorCondition := cluster.Status.GetClusterCondition(bkapi.ClusterConditionError)\n\n\t\tlog.Printf(\"waiting for cluster to upgrade (upgrading: %s; error: %s)\", upgradeCondition.Status, errorCondition.Status)\n\n\t\tif errorCondition.Status == corev1.ConditionTrue && errorCondition.Reason == \"UpgradeFailed\" {\n\t\t\treturn false, fmt.Errorf(\"failed upgrading cluster: [%s] %s\", errorCondition.Reason, errorCondition.Message)\n\t\t}\n\n\t\tif upgradeCondition.Status == corev1.ConditionFalse && cluster.Status.CurrentVersion == targetVersion {\n\t\t\t// Cluster upgraded\n\t\t\treturn true, nil\n\t\t}\n\t\treturn false, nil\n\t})\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// check whether PVCs have been reattached\n\tpvcList := corev1.PersistentVolumeClaimList{}\n\terr = k8client.List(goctx.TODO(), &pvcList, listOptions...)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tindex, journal, ledger := int32(0), int32(0), int32(0)\n\n\tfor i := range pvcList.Items {\n\t\tpvc := &pvcList.Items[i]\n\t\tif strings.HasPrefix(pvc.Name, \"index\") {\n\t\t\tindex++\n\t\t} else if strings.HasPrefix(pvc.Name, \"journal\") {\n\t\t\tjournal++\n\t\t} else if strings.HasPrefix(pvc.Name, \"ledger\") {\n\t\t\tledger++\n\t\t}\n\t}\n\n\tif index != b.Spec.Replicas || journal != b.Spec.Replicas || ledger != b.Spec.Replicas {\n\t\treturn fmt.Errorf(\"PVC count mismatch\")\n\t}\n\n\tlog.Printf(\"bookkeeper cluster upgraded: %s\", b.Name)\n\treturn nil\n}", "title": "" }, { "docid": "74a19f07f70904dd2ffcab8647e9a22e", "score": "0.42951465", "text": "func (tc *CfRouterGroupTestCase) AfterBackup(config Config) {\n\tBy(\"Getting CF OAuth Token\")\n\ttoken := refreshToken()\n\n\tBy(\"Adding an entry in the router group table\")\n\ttc.routingAPIClient.SetToken(token)\n\trouterGroupEntry := models.RouterGroup{\n\t\tGuid: \"RandomTestGUID\" + \"_\" + RandomStringNumber(),\n\t\tName: \"RandomTestName\" + \"_\" + RandomStringNumber(),\n\t\tType: \"tcp\",\n\t\tReservablePorts: \"1024-2047\",\n\t}\n\n\tcleanupRouterGroups = func() error { return tc.routingAPIClient.DeleteRouterGroup(routerGroupEntry) }\n\t_, err := routerGroupRequestWithRetry(func() (models.RouterGroups, error) {\n\t\treturn nil, tc.routingAPIClient.CreateRouterGroup(routerGroupEntry)\n\t}, 5)\n\tExpect(err).NotTo(HaveOccurred())\n}", "title": "" }, { "docid": "599b016eaf80f9832f503bd9cd6bee37", "score": "0.42915666", "text": "func (c *gcReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {\n\tlog := c.logger.WithField(\"gc backup\", req.String())\n\tlog.Debug(\"gcController getting backup\")\n\n\tbackup := &velerov1api.Backup{}\n\tif err := c.Get(ctx, req.NamespacedName, backup); err != nil {\n\t\tif apierrors.IsNotFound(err) {\n\t\t\tlog.WithError(err).Error(\"backup not found\")\n\t\t\treturn ctrl.Result{}, nil\n\t\t}\n\t\treturn ctrl.Result{}, errors.Wrapf(err, \"error getting backup %s\", req.String())\n\t}\n\tlog.Debugf(\"backup: %s\", backup.Name)\n\n\tlog = c.logger.WithFields(\n\t\tlogrus.Fields{\n\t\t\t\"backup\": req.String(),\n\t\t\t\"expiration\": backup.Status.Expiration,\n\t\t},\n\t)\n\n\tnow := c.clock.Now()\n\tif backup.Status.Expiration == nil || backup.Status.Expiration.After(now) {\n\t\tlog.Debug(\"Backup has not expired yet, skipping\")\n\t\treturn ctrl.Result{}, nil\n\t}\n\n\tlog.Infof(\"Backup:%s has expired\", backup.Name)\n\n\tif backup.Labels == nil {\n\t\tbackup.Labels = make(map[string]string)\n\t}\n\n\tloc := &velerov1api.BackupStorageLocation{}\n\tif err := c.Get(ctx, client.ObjectKey{\n\t\tNamespace: req.Namespace,\n\t\tName: backup.Spec.StorageLocation,\n\t}, loc); err != nil {\n\t\tif apierrors.IsNotFound(err) {\n\t\t\tlog.Warnf(\"Backup cannot be garbage-collected because backup storage location %s does not exist\", backup.Spec.StorageLocation)\n\t\t\tbackup.Labels[garbageCollectionFailure] = gcFailureBSLNotFound\n\t\t} else {\n\t\t\tbackup.Labels[garbageCollectionFailure] = gcFailureBSLCannotGet\n\t\t}\n\t\tif err := c.Update(ctx, backup); err != nil {\n\t\t\tlog.WithError(err).Error(\"error updating backup labels\")\n\t\t}\n\t\treturn ctrl.Result{}, errors.Wrap(err, \"error getting backup storage location\")\n\t}\n\n\tif loc.Spec.AccessMode == velerov1api.BackupStorageLocationAccessModeReadOnly {\n\t\tlog.Infof(\"Backup cannot be garbage-collected because backup storage location %s is currently in read-only mode\", loc.Name)\n\t\tbackup.Labels[garbageCollectionFailure] = gcFailureBSLReadOnly\n\t\tif err := c.Update(ctx, backup); err != nil {\n\t\t\tlog.WithError(err).Error(\"error updating backup labels\")\n\t\t}\n\t\treturn ctrl.Result{}, nil\n\t}\n\n\t// remove gc fail error label after this point\n\tdelete(backup.Labels, garbageCollectionFailure)\n\tif err := c.Update(ctx, backup); err != nil {\n\t\tlog.WithError(err).Error(\"error updating backup labels\")\n\t}\n\n\tselector := client.MatchingLabels{\n\t\tvelerov1api.BackupNameLabel: label.GetValidName(backup.Name),\n\t\tvelerov1api.BackupUIDLabel: string(backup.UID),\n\t}\n\n\tdbrs := &velerov1api.DeleteBackupRequestList{}\n\tif err := c.List(ctx, dbrs, selector); err != nil {\n\t\tlog.WithError(err).Error(\"error listing DeleteBackupRequests\")\n\t\treturn ctrl.Result{}, errors.Wrap(err, \"error listing existing DeleteBackupRequests for backup\")\n\t}\n\tlog.Debugf(\"length of dbrs:%d\", len(dbrs.Items))\n\n\t// if there's an existing unprocessed deletion request for this backup, don't create\n\t// another one\n\tfor _, dbr := range dbrs.Items {\n\t\tswitch dbr.Status.Phase {\n\t\tcase \"\", velerov1api.DeleteBackupRequestPhaseNew, velerov1api.DeleteBackupRequestPhaseInProgress:\n\t\t\tlog.Info(\"Backup already has a pending deletion request\")\n\t\t\treturn ctrl.Result{}, nil\n\t\t}\n\t}\n\n\tlog.Info(\"Creating a new deletion request\")\n\tndbr := pkgbackup.NewDeleteBackupRequest(backup.Name, string(backup.UID))\n\tndbr.SetNamespace(backup.Namespace)\n\tif err := c.Create(ctx, ndbr); err != nil {\n\t\tlog.WithError(err).Error(\"error creating DeleteBackupRequests\")\n\t\treturn ctrl.Result{}, errors.Wrap(err, \"error creating DeleteBackupRequest\")\n\t}\n\n\treturn ctrl.Result{}, nil\n}", "title": "" }, { "docid": "df9d1445e6b543079d0c014893bf5c17", "score": "0.42876875", "text": "func (p *PdController) UnmarkRecovering(ctx context.Context) error {\n\treturn p.operateRecoveringMark(ctx, http.MethodDelete)\n}", "title": "" }, { "docid": "aff2e3c4292c20d888914df48c88d0e8", "score": "0.4287512", "text": "func group_clear() {\n\tgroupcount = 0\n\tbitmap_clear(groupbitmap, NODES)\n}", "title": "" }, { "docid": "e1d8f489cdb80f2a1736d90975454fa6", "score": "0.4277471", "text": "func (sys *NotificationSys) LoadGroup(group string) []NotificationPeerErr {\n\tng := WithNPeers(len(sys.peerClients))\n\tfor idx, client := range sys.peerClients {\n\t\tif client == nil {\n\t\t\tcontinue\n\t\t}\n\t\tclient := client\n\t\tng.Go(context.Background(), func() error { return client.LoadGroup(group) }, idx, *client.host)\n\t}\n\treturn ng.Wait()\n}", "title": "" }, { "docid": "f831e9577ee5b9bbdfbcb1a222f5599f", "score": "0.42752263", "text": "func (tc *CfRouterGroupTestCase) AfterRestore(config Config) {\n\tBy(\"Getting CF OAuth Token\")\n\ttoken := refreshToken()\n\n\tBy(\"Taking a snapshot of restored table and comparing it with the pre-backup table\")\n\ttime.Sleep(15 * time.Second)\n\trouterGroupsPostRestore, err := tc.readRouterGroups(token)\n\tExpect(err).NotTo(HaveOccurred())\n\tExpect(routerGroupsPostRestore).To(ConsistOf(tc.routerGroupsPreBackup))\n}", "title": "" }, { "docid": "07b9b25b31e2a6f100038f48c87f5262", "score": "0.42661923", "text": "func pvDeleted(obj interface{}, metadataSyncer *MetadataSyncInformer) {\n\tpv, ok := obj.(*v1.PersistentVolume)\n\tif pv == nil || !ok {\n\t\tklog.Warningf(\"PVDeleted: unrecognized object %+v\", obj)\n\t\treturn\n\t}\n\tklog.V(4).Infof(\"PVDeleted: Deleting PV: %+v\", pv)\n\n\t// Verify if pv is a vsphere csi volume\n\tif pv.Spec.CSI == nil || pv.Spec.CSI.Driver != service.Name {\n\t\tklog.V(3).Infof(\"PVDeleted: Not a Vsphere CSI Volume: %+v\", pv)\n\t\treturn\n\t}\n\tvar deleteDisk bool\n\tif pv.Spec.ClaimRef != nil && (pv.Status.Phase == v1.VolumeAvailable || pv.Status.Phase == v1.VolumeReleased) && pv.Spec.PersistentVolumeReclaimPolicy == v1.PersistentVolumeReclaimDelete {\n\t\tklog.V(3).Infof(\"PVDeleted: Volume deletion will be handled by Controller\")\n\t\treturn\n\t}\n\n\tif pv.Spec.ClaimRef == nil || (pv.Spec.PersistentVolumeReclaimPolicy != v1.PersistentVolumeReclaimDelete) {\n\t\tklog.V(4).Infof(\"PVDeleted: Setting DeleteDisk to false\")\n\t\tdeleteDisk = false\n\t} else {\n\t\t// We set delete disk=true for the case where PV status is failed after deletion of pvc\n\t\t// In this case, metadatasyncer will remove the volume\n\t\tklog.V(4).Infof(\"PVDeleted: Setting DeleteDisk to true\")\n\t\tdeleteDisk = true\n\t}\n\tvolumeOperationsLock.Lock()\n\tdefer volumeOperationsLock.Unlock()\n\tklog.V(4).Infof(\"PVDeleted: vSphere provisioner deleting volume %v with delete disk %v\", pv, deleteDisk)\n\tif err := volumes.GetManager(metadataSyncer.vcenter).DeleteVolume(pv.Spec.CSI.VolumeHandle, deleteDisk); err != nil {\n\t\tklog.Errorf(\"PVDeleted: Failed to delete disk %s with error %+v\", pv.Spec.CSI.VolumeHandle, err)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "171ae6c630b4f5ac1425b5c38131f171", "score": "0.42550486", "text": "func (k *kdmp) CleanupRestoreResources(restore *storkapi.ApplicationRestore) error {\n\tfor _, vInfo := range restore.Status.Volumes {\n\t\tif vInfo.DriverName != storkvolume.KDMPDriverName {\n\t\t\tcontinue\n\t\t}\n\t\tval, ok := restore.Spec.NamespaceMapping[vInfo.SourceNamespace]\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"restore namespace mapping not found: %s\", vInfo.SourceNamespace)\n\n\t\t}\n\t\trestoreNamespace := val\n\t\tcrName := getGenericCRName(prefixRestore, string(restore.UID), vInfo.PersistentVolumeClaimUID, restoreNamespace)\n\t\t// delete kdmp crs\n\t\tlogrus.Tracef(\"deleting data export CR: %s%s\", restoreNamespace, crName)\n\t\tif err := kdmpShedOps.Instance().DeleteDataExport(crName, restoreNamespace); err != nil && !k8serror.IsNotFound(err) {\n\t\t\tlogrus.Warnf(\"failed to delete data export CR:%s/%s, err: %v\", restoreNamespace, crName, err)\n\t\t}\n\t\terr := kdmpShedOps.Instance().DeleteVolumeBackup(prefixRestore+\"-\"+crName, restoreNamespace)\n\t\tif err != nil && !k8serror.IsNotFound(err) {\n\t\t\tlogrus.Warnf(\"failed to delete volume backup CR:%s/%s, err: %v\", restoreNamespace, crName, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "381c88f860d3f8b2fa0d7e24898f22e3", "score": "0.42532617", "text": "func (m *Model) CancelGroup() {\n\tm.inProgressGroupCommand = nil\n}", "title": "" }, { "docid": "6bbe1e856db3648e3fa32ea3b06433d4", "score": "0.42520306", "text": "func validateSubvolumegroup(f *framework.Framework, subvolgrp string) error {\n\tcmd := fmt.Sprintf(\"ceph fs subvolumegroup getpath myfs %s\", subvolgrp)\n\tstdOut, stdErr, err := execCommandInToolBoxPod(f, cmd, rookNamespace)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif stdErr != \"\" {\n\t\treturn fmt.Errorf(\"failed to getpath for subvolumegroup %s with error %v\", subvolgrp, stdErr)\n\t}\n\texpectedGrpPath := \"/volumes/\" + subvolgrp\n\tstdOut = strings.TrimSpace(stdOut)\n\tif stdOut != expectedGrpPath {\n\t\treturn fmt.Errorf(\"error unexpected group path. Found: %s\", stdOut)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "57515431154533a810bb04b5d2e83cfc", "score": "0.4250767", "text": "func ResizeGroup(group string, size int32) error {\n\tif TestContext.ReportDir != \"\" {\n\t\tCoreDump(TestContext.ReportDir)\n\t\tdefer CoreDump(TestContext.ReportDir)\n\t}\n\treturn TestContext.CloudConfig.Provider.ResizeGroup(group, size)\n}", "title": "" }, { "docid": "d741dc77e321d79617fe1ee70f69a7e5", "score": "0.4249247", "text": "func (e *Election) Resign(ctx context.Context) (err error) {\n\tlog := logger.GetLogger()\n\tnodeBytes, err := json.Marshal(e.node)\n\tif err != nil {\n\t\treturn err\n\t}\n\tsuccess, err := state.GetRepo().DeleteWithValue(ctx, e.key, nodeBytes)\n\tif err != nil {\n\t\treturn err\n\t}\n\te.updateMasterFlag(false)\n\tlog.Info(\"the master resign %s\", zap.Bool(\"result\", success))\n\t// close the chan of master change\n\treturn nil\n}", "title": "" }, { "docid": "15eb826047f82d9e74f14272e4bcfb76", "score": "0.42327726", "text": "func (c *clusterMemberRemovalController) attemptToScaleDown(ctx context.Context, recorder events.Recorder) error {\n\tcurrentVotingMemberIPListSet, err := ceohelpers.VotingMemberIPListSet(ctx, c.etcdClient)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdesiredControlPlaneReplicasCount, err := ceohelpers.ReadDesiredControlPlaneReplicasCount(c.operatorClient)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif desiredControlPlaneReplicasCount == 0 {\n\t\treturn fmt.Errorf(\"desired control plane replicas count cannot be empty\")\n\t}\n\n\tliveVotingMembers, err := c.getAllVotingMembers(ctx)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not list etcd members: %w\", err)\n\t}\n\n\tif len(liveVotingMembers) < desiredControlPlaneReplicasCount {\n\t\tklog.V(2).Infof(\"Ignoring scale-down since the number of voting, non-bootstrap etcd members is (%d) < desired number of control-plane replicas (%d)\", len(liveVotingMembers), desiredControlPlaneReplicasCount)\n\t\treturn nil\n\t}\n\n\t// machines with master role and deletion hook\n\tmemberMachines, err := ceohelpers.CurrentMemberMachinesWithDeletionHooks(c.masterMachineSelector, c.masterMachineLister)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not find master machines with deletion hook: %w\", err)\n\t}\n\n\tvar votingMembersMachines []*machinev1beta1.Machine\n\tfor memberMachineIP, memberMachine := range ceohelpers.IndexMachinesByNodeInternalIP(memberMachines) {\n\t\tif currentVotingMemberIPListSet.Has(memberMachineIP) {\n\t\t\tvotingMembersMachines = append(votingMembersMachines, memberMachine)\n\t\t}\n\t}\n\n\tvotingMembersMachinesPendingDeletion := ceohelpers.FilterMachinesPendingDeletion(votingMembersMachines)\n\tif len(votingMembersMachinesPendingDeletion) == 0 {\n\t\treturn nil\n\t}\n\n\t// do not trust data in the cache, compare with the current state\n\thealthyLiveVotingMembers, err := c.getHealthyVotingMembers(ctx)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not list etcd healthy members: %w\", err)\n\t}\n\n\t// scaling down invariant\n\tminTolerableQuorum, err := etcdcli.MinimumTolerableQuorum(desiredControlPlaneReplicasCount)\n\tif err != nil {\n\t\tklog.V(2).Infof(\"etcd cluster could not determine minimum quorum required. desiredControlPlaneReplicasCount is %v. minimum quorum required is %v: %w\", desiredControlPlaneReplicasCount, minTolerableQuorum, err)\n\t}\n\n\tif len(healthyLiveVotingMembers) < minTolerableQuorum {\n\t\tklog.V(2).Infof(\"ignoring scale down since the number of healthy voting, non-bootstrap etcd members (%d) < minimum required to maintain quorum (%d)\", len(healthyLiveVotingMembers), minTolerableQuorum)\n\t\tif time.Now().After(c.lastTimeScaleDownEventWasSent.Add(5 * time.Minute)) {\n\t\t\trecorder.Eventf(\"ScaleDown\", \"Ignoring scale down since the number of healthy voting, non-bootstrap etcd members (%d) < minimum required to maintain quorum (%d)\", len(healthyLiveVotingMembers), minTolerableQuorum)\n\t\t\tc.lastTimeScaleDownEventWasSent = time.Now()\n\t\t}\n\t\treturn nil\n\t}\n\n\t// before removing a voting member, we need to make sure that\n\t// current members are healthy otherwise we might lose quorum\n\tunhealthyMembers, err := c.etcdClient.UnhealthyMembers(ctx)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not get a list of unhealthy members: %v\", err)\n\t}\n\n\t// map machines pending deletion to node internal ip\n\tvotingMemberMachinesPendingDeletionIndex := ceohelpers.IndexMachinesByNodeInternalIP(votingMembersMachinesPendingDeletion)\n\t// find unhealthy machine pending deletion to remove first from the cluster, without violating quorum\n\tvar unhealthyVotingMemberMachinesPendingDeletion []*machinev1beta1.Machine\n\tif len(unhealthyMembers) > 0 {\n\t\tvar unhealthyMembersURLs []string\n\t\tfor _, unhealthyMember := range unhealthyMembers {\n\t\t\tunhealthyMemberNodeInternalIP, err := ceohelpers.MemberToNodeInternalIP(unhealthyMember)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"cannot get node internal ip for unhealthy member %v: %w\", unhealthyMember, err)\n\t\t\t}\n\t\t\tunhealthyVotingMemberMachinePendingDeletion, ok := votingMemberMachinesPendingDeletionIndex[unhealthyMemberNodeInternalIP]\n\t\t\tif ok {\n\t\t\t\tunhealthyVotingMemberMachinesPendingDeletion = append(unhealthyVotingMemberMachinesPendingDeletion, unhealthyVotingMemberMachinePendingDeletion)\n\t\t\t}\n\t\t\tif len(unhealthyMember.PeerURLs) > 0 {\n\t\t\t\tunhealthyMembersURLs = append(unhealthyMembersURLs, unhealthyMember.PeerURLs[0])\n\t\t\t} else {\n\t\t\t\tunhealthyMembersURLs = append(unhealthyMembersURLs, unhealthyMember.Name)\n\t\t\t}\n\t\t}\n\t\tif len(unhealthyVotingMemberMachinesPendingDeletion) == 0 {\n\t\t\tklog.V(2).Infof(\"cannot proceed with scaling down, unhealthy voting etcd members found: %v but none are pending deletion\", unhealthyMembersURLs)\n\t\t\treturn fmt.Errorf(\"cannot proceed with scaling down, unhealthy voting etcd members found: %v but none are pending deletion\", unhealthyMembersURLs)\n\t\t}\n\t}\n\n\t// Don't scale down if all members are healthy and the cluster is already at the desired control-plane size\n\t// When at the desired control-plane size, scale down is only allowed if a member is unhealthy so that a new machine can replace it.\n\t// For healthy members, deleting a machine should result in a new machine being created and member addition before scale down can occur\n\tif reflect.DeepEqual(liveVotingMembers, healthyLiveVotingMembers) && len(healthyLiveVotingMembers) <= desiredControlPlaneReplicasCount {\n\t\tklog.V(2).Infof(\"skip scale down: all voting, non-bootstrap members are healthy and membership does not exceed the desired cluster size of %v\", desiredControlPlaneReplicasCount)\n\t\treturn nil\n\t}\n\n\t// remove the unhealthy machine pending deletion first\n\t// if no unhealthy machine pending deletion found, then attempt to scale down the healthy machines pending deletion\n\tif len(unhealthyVotingMemberMachinesPendingDeletion) > 0 {\n\t\tklog.V(2).Infof(\"found unhealthy voting etcd members with machine pending deletion: %v\", unhealthyVotingMemberMachinesPendingDeletion)\n\t\tvotingMembersMachinesPendingDeletion = append(unhealthyVotingMemberMachinesPendingDeletion, votingMembersMachinesPendingDeletion...)\n\t}\n\n\tvar allErrs []error\n\tfor _, votingMemberMachinePendingDeletion := range votingMembersMachinesPendingDeletion {\n\t\tremoved, errs := c.attemptToRemoveMemberFor(ctx, liveVotingMembers, votingMemberMachinePendingDeletion, recorder)\n\t\tif removed {\n\t\t\tbreak // we want to remove only one member at a time\n\t\t}\n\t\tif len(errs) > 0 {\n\t\t\tallErrs = append(allErrs, errs...)\n\t\t}\n\t}\n\n\treturn kerrors.NewAggregate(allErrs)\n}", "title": "" }, { "docid": "17a0d62c5581ce4feaa7fed6c8522376", "score": "0.42280012", "text": "func TriggerKVDBFailover(contexts *[]*scheduler.Context, recordChan *chan *EventRecord) {\n\tdefer ginkgo.GinkgoRecover()\n\tdefer endLongevityTest()\n\tstartLongevityTest(KVDBFailover)\n\tevent := &EventRecord{\n\t\tEvent: Event{\n\t\t\tID: GenerateUUID(),\n\t\t\tType: KVDBFailover,\n\t\t},\n\t\tStart: time.Now().Format(time.RFC1123),\n\t\tOutcome: []error{},\n\t}\n\tdefer func() {\n\t\tevent.End = time.Now().Format(time.RFC1123)\n\t\t*recordChan <- event\n\t}()\n\n\tsetMetrics(*event)\n\tstepLog := \"perform kvdb failover in a cyclic manner\"\n\tcontext(stepLog, func() {\n\t\tlog.InfoD(stepLog)\n\t\tstepLog = \"Get KVDB nodes and perform failover\"\n\t\tStep(stepLog, func() {\n\t\t\tlog.InfoD(stepLog)\n\t\t\tnodes := node.GetStorageDriverNodes()\n\n\t\t\tkvdbMembers, err := Inst().V.GetKvdbMembers(nodes[0])\n\n\t\t\tif err != nil {\n\t\t\t\terr = fmt.Errorf(\"error getting kvdb members using node %v. cause: %v\", nodes[0].Name, err)\n\t\t\t\tlog.InfoD(err.Error())\n\t\t\t\tUpdateOutcome(event, err)\n\t\t\t}\n\n\t\t\tlog.InfoD(\"Validating initial KVDB members\")\n\n\t\t\tallhealthy := validateKVDBMembers(event, kvdbMembers, false)\n\n\t\t\tif allhealthy {\n\t\t\t\tkvdbNodeIDMap := make(map[string]string, len(kvdbMembers))\n\t\t\t\tfor id, m := range kvdbMembers {\n\t\t\t\t\tkvdbNodeIDMap[id] = m.Name\n\t\t\t\t}\n\n\t\t\t\tnodeMap := node.GetNodesByVoDriverNodeID()\n\t\t\t\tnodeContexts := make([]*scheduler.Context, 0)\n\n\t\t\t\tfor kvdbID, nodeID := range kvdbNodeIDMap {\n\t\t\t\t\tkvdbNode := nodeMap[nodeID]\n\t\t\t\t\tappNodeContexts, err := GetContextsOnNode(contexts, &kvdbNode)\n\t\t\t\t\tnodeContexts = append(nodeContexts, appNodeContexts...)\n\t\t\t\t\terrorChan := make(chan error, errorChannelSize)\n\t\t\t\t\tStopVolDriverAndWait([]node.Node{kvdbNode}, &errorChan)\n\t\t\t\t\tfor err := range errorChan {\n\t\t\t\t\t\tUpdateOutcome(event, err)\n\t\t\t\t\t}\n\n\t\t\t\t\tisKvdbStatusUpdated := false\n\t\t\t\t\twaitTime := 10\n\n\t\t\t\t\tfor !isKvdbStatusUpdated && waitTime > 0 {\n\t\t\t\t\t\tnewKvdbMembers, err := Inst().V.GetKvdbMembers(nodes[0])\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\terr = fmt.Errorf(\"error getting kvdb members using node %v, cause: %v \", nodes[0].Name, err)\n\t\t\t\t\t\t\tlog.Error(err.Error())\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tm, ok := newKvdbMembers[kvdbID]\n\n\t\t\t\t\t\tif !ok && len(newKvdbMembers) > 0 {\n\t\t\t\t\t\t\tlog.InfoD(\"node %v is no longer kvdb member\", kvdbNode.Name)\n\t\t\t\t\t\t\tisKvdbStatusUpdated = true\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ok && !m.IsHealthy {\n\t\t\t\t\t\t\tlog.InfoD(\"kvdb node %v isHealthy?: %v\", nodeID, m.IsHealthy)\n\t\t\t\t\t\t\tisKvdbStatusUpdated = true\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlog.InfoD(\"Waiting for kvdb node %v health status to update to false after PX is stopped\", kvdbNode.Name)\n\t\t\t\t\t\t\ttime.Sleep(1 * time.Minute)\n\t\t\t\t\t\t}\n\t\t\t\t\t\twaitTime--\n\t\t\t\t\t}\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlog.Error(err.Error())\n\t\t\t\t\t\tUpdateOutcome(event, err)\n\t\t\t\t\t}\n\n\t\t\t\t\twaitTime = 15\n\t\t\t\t\tisKvdbMembersUpdated := false\n\n\t\t\t\t\tfor !isKvdbMembersUpdated && waitTime > 0 {\n\t\t\t\t\t\tnewKvdbMembers, err := Inst().V.GetKvdbMembers(nodes[0])\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\terr = fmt.Errorf(\"error getting kvdb members using node %v, cause: %v \", nodes[0].Name, err)\n\t\t\t\t\t\t\tlog.Error(err.Error())\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t_, ok := newKvdbMembers[kvdbID]\n\t\t\t\t\t\tif ok {\n\t\t\t\t\t\t\tlog.InfoD(\"Node %v still exist as a KVDB member. Waiting for failover to happen\", kvdbNode.Name)\n\t\t\t\t\t\t\ttime.Sleep(2 * time.Minute)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlog.InfoD(\"node %v is no longer kvdb member\", kvdbNode.Name)\n\t\t\t\t\t\t\tisKvdbMembersUpdated = true\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\twaitTime--\n\t\t\t\t\t}\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlog.Error(err.Error())\n\t\t\t\t\t\tUpdateOutcome(event, err)\n\t\t\t\t\t}\n\n\t\t\t\t\tnewKvdbMembers, err := Inst().V.GetKvdbMembers(nodes[0])\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlog.Error(err.Error())\n\t\t\t\t\t\tUpdateOutcome(event, err)\n\t\t\t\t\t}\n\t\t\t\t\tkvdbMemberStatus := validateKVDBMembers(event, newKvdbMembers, false)\n\n\t\t\t\t\terrorChan = make(chan error, errorChannelSize)\n\n\t\t\t\t\tif !kvdbMemberStatus {\n\t\t\t\t\t\tlog.InfoD(\"Skipping remaining Kvdb node failovers as not all members are healthy\")\n\t\t\t\t\t\tStartVolDriverAndWait([]node.Node{kvdbNode}, &errorChan)\n\t\t\t\t\t\tfor err = range errorChan {\n\t\t\t\t\t\t\tUpdateOutcome(event, err)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\n\t\t\t\t\tStartVolDriverAndWait([]node.Node{kvdbNode}, &errorChan)\n\t\t\t\t\tfor err = range errorChan {\n\t\t\t\t\t\tUpdateOutcome(event, err)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\terr = ValidateDataIntegrity(&nodeContexts)\n\t\t\t\tUpdateOutcome(event, err)\n\t\t\t} else {\n\t\t\t\terr = fmt.Errorf(\"not all kvdb members are healthy\")\n\t\t\t\tlog.Errorf(err.Error())\n\t\t\t\tUpdateOutcome(event, err)\n\t\t\t}\n\n\t\t})\n\t})\n\tupdateMetrics(*event)\n}", "title": "" }, { "docid": "b46c396d29a399cc2065decb36b624e2", "score": "0.42266044", "text": "func TestData_DeleteShardGroup(t *testing.T) {\n\tvar data meta.Data\n\tif err := data.CreateNode(\"node0\"); err != nil {\n\t\tt.Fatal(err)\n\t} else if err := data.CreateDatabase(\"db0\"); err != nil {\n\t\tt.Fatal(err)\n\t} else if err = data.CreateRetentionPolicy(\"db0\", &meta.RetentionPolicyInfo{Name: \"rp0\", ReplicaN: 1}); err != nil {\n\t\tt.Fatal(err)\n\t} else if err := data.CreateShardGroup(\"db0\", \"rp0\", time.Date(2000, time.January, 1, 0, 0, 0, 0, time.UTC)); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif err := data.DeleteShardGroup(\"db0\", \"rp0\", 1); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif sg := data.Databases[0].RetentionPolicies[0].ShardGroups[0]; !sg.Deleted() {\n\t\tt.Fatalf(\"shard group not correctly flagged as deleted\")\n\t}\n}", "title": "" } ]
a09efcf6f7e2849875db69c6ad628997
DeQueue is the same to Pop()
[ { "docid": "fbf65cc845dab8a6e1cd80384d2f34f6", "score": "0.8337159", "text": "func (q *Queue) DeQueue() interface{} {\n\treturn q.Pop()\n}", "title": "" } ]
[ { "docid": "6117b31ce03782805bd610ad2b36832f", "score": "0.84043026", "text": "func (q *Queue) Dequeue() {\n\tif q.isEmpty() {\n\t\treturn\n\t}\n\tremoved := (*q)[0]\n\tfmt.Printf(\"removed element: %v\", removed)\n\t*q = (*q)[1:]\n}", "title": "" }, { "docid": "4498349e622cbb7b6d67e295d84d3bec", "score": "0.8091084", "text": "func (q *queue) DeQueue() interface{} {\n\tq.lock.Lock()\n\titem := (*q.items)[0]\n\t*q.items = (*q.items)[1:len(*q.items)]\n\tq.lock.Unlock()\n\treturn item\n}", "title": "" }, { "docid": "8549066cc18e0405b0bf50c9c208aa29", "score": "0.7870102", "text": "func (q *Queue) Dequeue() (v interface{}) {\n\tq.m.Lock()\n\tdefer q.m.Unlock()\n\n\tif q.count < 1 {\n\t\treturn\n\t}\n\n\thead := q.head\n\tv = head.data\n\tq.head = head.next\n\thead.next = nil\n\n\tif q.count--; q.count == 0 {\n\t\tq.tail = nil\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "8d42a8c852b4f54143744a4073623f2b", "score": "0.78493875", "text": "func (q *Queue) Dequeue() interface{} {\n\tq.lock.Lock()\n\tdefer q.lock.Unlock()\n\tdequeuedItem := q.items[0]\n\tq.items = q.items[1:len(q.items)]\n\treturn dequeuedItem\n}", "title": "" }, { "docid": "371d8cb8e92781a65e721320f8f7d916", "score": "0.7764744", "text": "func (q *Q[T]) Dequeue() (T, error) {\n\tvar zero T\n\tif len(*q) == 0 {\n\t\treturn zero, ErrEmptyQueue\n\t}\n\tvalue := (*q)[0]\n\t(*q)[0] = zero\n\t(*q) = (*q)[1:]\n\treturn value, nil\n}", "title": "" }, { "docid": "26fd7ce86820535ed777256ebb167fee", "score": "0.7757386", "text": "func (q *Queue) Dequeue() interface{} {\n\tq.Mutex.Lock()\n\tdefer q.Mutex.Unlock()\n\n\tif len(q.container) == 0 {\n\t\treturn nil\n\t}\n\tfirst := q.container[0]\n\tq.container = q.container[1:]\n\n\treturn first\n}", "title": "" }, { "docid": "3e0732f84a26d483fb6509ef4cc3cebd", "score": "0.770803", "text": "func (this *Queue) Dequeue() interface{} {\n\tif this.length == 0 {\n\t\treturn nil\n\t}\n\tn := this.start\n\tif this.length == 1 {\n\t\tthis.start = nil\n\t\tthis.end = nil\n\t} else {\n\t\tthis.start = this.start.next\n\t}\n\tthis.length--\n\treturn n.value\n}", "title": "" }, { "docid": "15999c5edf5ebde0baf5998d6d3c3c84", "score": "0.77042294", "text": "func (q *arrayQueue) Dequeue() interface{} {\n\tif q.Len() == 0 {\n\t\treturn nil\n\t}\n\te := q.xs[q.head]\n\tq.head = (q.head + 1) % cap(q.xs)\n\tq.len--\n\treturn e\n}", "title": "" }, { "docid": "42be8008459563b4f572d8967adc3072", "score": "0.76872396", "text": "func (queue *QUEUE) deQueue() {\n\tif queue.front < 0 || queue.front > queue.back {\n\t\tfmt.Println(\"Can't delete value\")\n\t\tfmt.Println(\"Queue is empty\")\n\t} else {\n\t\tfor i := 0; i <= queue.back-queue.front; i++ {\n\t\t\tqueue.deQueueStack.push(queue.enQueueStack.pop())\n\t\t}\n\t\tfmt.Printf(\"Succesfully deleted element %d from the front of the Queue\\n\", queue.deQueueStack.pop())\n\t\tqueue.front++\n\t\tfor i := 0; i <= queue.back-queue.front; i++ {\n\t\t\tqueue.enQueueStack.push(queue.deQueueStack.pop())\n\t\t}\n\t\tif queue.front > queue.back {\n\t\t\tqueue.initQueue()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e0d8f09c1f0b7b1bc382fefe37c71162", "score": "0.76745373", "text": "func (q *Queue) Dequeue() (v ItemType) {\n\tif q.front == nil {\n\t\tpanic(\"Dequeue from empty queue!\")\n\t}\n\tv = q.front.Value\n\tif q.front == q.back {\n\t\tq.front, q.back = nil, nil\n\t} else {\n\t\tq.front = q.front.next\n\t}\n\treturn\n}", "title": "" }, { "docid": "6aacf8dcbc2f7e637e7a9553f7d36443", "score": "0.76546097", "text": "func (q *Queue) DeQueue() *list.Element {\n\tq.sem.Lock()\n\tdefer q.sem.Unlock()\n\te := q.list.Back()\n\tq.list.Remove(e)\n\treturn e\n}", "title": "" }, { "docid": "4d03083ce9e8fa0e9c796c78f3adeb5e", "score": "0.7637947", "text": "func (q *queue) Dequeue() (v interface{}) {\n\tv = q.values[q.deqIndex]\n\tq.values[q.deqIndex] = nil\n\tq.deqIndex++\n\treturn\n}", "title": "" }, { "docid": "58e9ef7cc4c4ff9bfeb988639024722d", "score": "0.7631603", "text": "func (q *Queue) Dequeue() interface{} {\n\tnode := q.Shift()\n\tif node == nil {\n\t\treturn nil\n\t}\n\n\treturn node.Data\n}", "title": "" }, { "docid": "720e07ee393d270a782a0240d6cc2849", "score": "0.7629376", "text": "func (q Queue) Dequeue() (qr Queue, val int, err error) {\n\tvar temp int\n\tif q.stack2, temp, err = q.stack2.Pop(); err == nil {\n\t\treturn q, temp, nil\n\t} else if q.stack1, temp, err = q.stack1.Pop(); err != nil {\n\t\treturn q, 0, EmptyQueueError{}\n\t}\n\tfor {\n\t\tval = temp\n\t\tif q.stack1, temp, err = q.stack1.Pop(); err == nil {\n\t\t\tq.stack2 = q.stack2.Push(val)\n\t\t} else {\n\t\t\treturn q, val, nil\n\t\t}\n\t}\n}", "title": "" }, { "docid": "762b2a1c911427786293d62ac31f25c1", "score": "0.75887287", "text": "func (queue *Queue) Dequeue() interface{} {\n\tfirst := queue.list.First()\n\tif queue.list.Remove(first) {\n\t\tif first == queue.tail {\n\t\t\tqueue.tail = nil // Empty queue\n\t\t}\n\n\t\treturn first.Value()\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "89d921315190bc04d612c6dee82ca083", "score": "0.7539759", "text": "func (q *queue) Dequeue() (element interface{}, underflow bool) {\n\tq.Lock()\n\tdefer q.Unlock()\n\t//Dequeue\n\tunderflow, element, _ = q.dequeue()\n\treturn\n}", "title": "" }, { "docid": "41728e00f31468143d687766bc853d98", "score": "0.74496216", "text": "func (q *Queue) Dequeue() int {\n\tel := q.array[0]\n\tq.array = q.array[1:]\n\treturn el\n}", "title": "" }, { "docid": "0472e261a9139a84c526637d0225a0bf", "score": "0.7447707", "text": "func (b Broadcaster) DeQueue() (mq.Value, error) {\n\treturn b.queue.DeQueue()\n}", "title": "" }, { "docid": "00460dada8741381f192c3d654109792", "score": "0.7431975", "text": "func (q *queuer) Dequeue(id string) {\n\tq.queue.Delete(id)\n}", "title": "" }, { "docid": "a9bb2a0362e2be33201e6ca22dbd632b", "score": "0.7414298", "text": "func (q *Queue) Pop() interface{} {\n\thead := (*q)[0]\n\t*q = (*q)[1:]\n\treturn head\n}", "title": "" }, { "docid": "0a38451917dc354d6cac162c27569db4", "score": "0.74107444", "text": "func (q *DataQueue) DeQueue() DataRow {\n\te := q.Queue.Front()\n\tif q.Queue.Len() > 0 {\n\t\tq.Queue.Remove(q.Queue.Front())\n\t}\n\treturn e.Value.(DataRow)\n}", "title": "" }, { "docid": "f1c88c8ea2176d7f92efc98188e53d9b", "score": "0.7401035", "text": "func (q *Queue) Pop() (res interface{}) {\n\tres, q.head[q.headOff] = q.head[q.headOff], nil\n\tq.headOff++\n\tif q.headOff == blockSize {\n\t\tq.headOff = 0\n\t\tq.headIdx = (q.headIdx + 1) % len(q.blocks)\n\t\tq.head = q.blocks[q.headIdx]\n\t}\n\treturn\n}", "title": "" }, { "docid": "8aaa56cac0279c3501a4706b99754934", "score": "0.73885155", "text": "func (q *Queue) Pop() {\n\tif len(q.streamers) == 0 {\n\t\treturn\n\t}\n\tq.streamers = q.streamers[1:]\n}", "title": "" }, { "docid": "5f1963c528d449e413a6b3fb871bf2cb", "score": "0.73875207", "text": "func(q *Queue) Dequeue() int {\n\t// first value added\n\ttoRemove := q.items[0]\n\tq.items = q.items[1:]\n\treturn toRemove\n}", "title": "" }, { "docid": "204a3327ee46b844525f3e58250e5c28", "score": "0.73737514", "text": "func queuePop(c router.Context) (extractedItem interface{}, err error) {\n\theadPresent, _ := hasHead(c) // TODO: handle error\n\tif !headPresent {\n\t\treturn extractedItem, errors.New(\"Empty queue\")\n\t}\n\n\theadKey, _ := readHeadItemKey(c) // TODO: handle error\n\tresHead, _ := c.State().Get(headKey, &QueueItem{}) // TODO: handle error\n\theadItem := resHead.(QueueItem)\n\n\tnextKey := EmptyItemPointerKey\n\t// remove Prev link from nextItem if it exists\n\tif headItem.hasNext() { // it's not a tail\n\t\t// получить следующий элемент\n\t\tnextKey = headItem.NextKey\n\t\t// получить из State nextItem\n\t\tresNext, _ := c.State().Get(nextKey, &QueueItem{}) // TODO: handle error\n\t\tnextItem := resNext.(QueueItem)\n\t\t// remove PrevKey from nextItem\n\t\tnextItem.PrevKey = EmptyItemPointerKey\n\t\t// save updated nextItem\n\t\tc.State().Put(nextItem) // TODO: handle error\n\t}\n\tsetHeadPointerTo(c, nextKey)\n\tif isKeyEmpty(nextKey) { // reached a TailItem\n\t\tsetTailPointerTo(c, nextKey)\n\t}\n\t// remove extracted item from state\n\tc.State().Delete(headKey) // TODO: handle error\n\n\t//return item, c.State().Delete(item)\n\textractedItem = headItem\n\treturn extractedItem, nil\n}", "title": "" }, { "docid": "4073f8d9c04b89bfd775f16f1ac22ef3", "score": "0.73698205", "text": "func (q *Queue) Dequeue() (v interface{}, ok bool) {\n\tq.Lock()\n\tv, ok = q.Dequeue0()\n\tq.Unlock()\n\treturn\n}", "title": "" }, { "docid": "68695c10b55a3ba23cf5fb65edcf052f", "score": "0.73556864", "text": "func (q *MyQueue) Dequeue() (int, error) {\n\tif q.head.Back == q.tail {\n\t\treturn -1, errors.New(\"empty queue\")\n\t}\n\tret := q.head.Back.Value\n\tq.head.Back = q.head.Back.Back\n\treturn ret, nil\n}", "title": "" }, { "docid": "5552180f51beb124adef8f4fb149f7d0", "score": "0.7342152", "text": "func (q *BufferedQueue) Dequeue() (interface{}, error) {\n\tif q.IsEmpty() {\n\t\treturn nil, errors.New(\"empty queue\")\n\t}\n\n\tdeqElem := q.buffer[q.head]\n\n\tq.buffer[q.head] = nil\n\n\t// bitwise modulus\n\tq.head = (q.head + 1) & (len(q.buffer) - 1)\n\tq.count--\n\n\t// Resize down if buffer 1/4 full.\n\tif len(q.buffer) > 16 && (q.count<<2) == len(q.buffer) {\n\t\tq.resize()\n\t}\n\treturn deqElem, nil\n}", "title": "" }, { "docid": "ff7e98fbd161f38413819e463c2b3b1c", "score": "0.7341593", "text": "func (q *EventQueue) Dequeue() (*pb.ClockEvent, error) {\n\tq.Lock()\n\tdefer q.Unlock()\n\tif len(q.Events) == 0 {\n\t\treturn nil, ErrEmptyQueue\n\t}\n\tevent := q.Events[0]\n\tq.Events = q.Events[1:]\n\treturn event, nil\n}", "title": "" }, { "docid": "9ee84e510f38f4b0fc18977bb9f55324", "score": "0.73371863", "text": "func (q *Queue) Dequeue() int {\n\tfirst := q.items[0]\n\tq.items = q.items[1:]\n\treturn first\n}", "title": "" }, { "docid": "1e491dad375d8954e5df041f36e7f38e", "score": "0.7325073", "text": "func (gbq *GameBoardQueue) Dequeue() (*board.GameBoard, error) {\n\tif len(gbq.queue) == 0 {\n\t\treturn nil, errors.New(\"queue is empty, nothing to dequeue\")\n\t}\n\tb := gbq.queue[0]\n\tgbq.queue = gbq.queue[1:]\n\n\treturn b, nil\n}", "title": "" }, { "docid": "d5e576479bb6704f0f1b4703d104ba6a", "score": "0.7289753", "text": "func (q *Queue) Dequeue() int {\n\ttoRemove := q.items[0]\n\tq.items = q.items[1:]\n\treturn toRemove\n}", "title": "" }, { "docid": "97690d5d84207f66e53845f2e4bf629b", "score": "0.7289558", "text": "func (s *ArrayQueue) Dequeue() *Item {\n\tif s.IsEmpty() {\n\t\treturn nil\n\t}\n\tt := s.elements[0]\n\ts.elements = s.elements[1:]\n\treturn t\n}", "title": "" }, { "docid": "a91db1afd5a8a6afc64f0123ec2f47e7", "score": "0.728742", "text": "func (q *Queue) Pop() (value interface{}) {\n\tswitch q.kind {\n\tcase LIFO:\n\t\tvalue = q.last.Value\n\t\tq.last = q.last.prev\n\tcase FIFO:\n\t\tvalue = q.first.Value\n\t\tq.first = q.first.next\n\t}\n\tq.length--\n\treturn\n}", "title": "" }, { "docid": "e3e0263c3450169473dd21c849c69cdb", "score": "0.72557527", "text": "func (r *Ring) Dequeue() interface{} {\n\tr.Lock()\n\tdefer r.Unlock()\n\n\tr.checkInit()\n\tif r.head == -1 {\n\t\treturn nil\n\t}\n\n\tv := r.get(r.tail)\n\tif r.head == r.tail { // set buffer empty after dequeue\n\t\tr.head = -1\n\t\tr.tail = 0\n\t} else {\n\t\tr.tail = r.mod(r.tail + 1)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "6f939a0f60fd2d402b5730a446ac00ad", "score": "0.72513306", "text": "func (q *Queue) Dequeue() int {\n\tdequeued := q.Back()\n\tq.list.DeleteAt(q.list.Length())\n\treturn dequeued\n}", "title": "" }, { "docid": "01da908777a09bbb270f2d1120108348", "score": "0.7247428", "text": "func (q *ItemQueue) Dequeue() *ORM.Event {\n\tif !q.IsEmpty() {\n\t\tq.lock.Lock()\n\t\titem := q.Items[0]\n\t\tq.Items = q.Items[1:len(q.Items)]\n\t\tq.lock.Unlock()\n\t\treturn &item\n\t} else {\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "227946dc9f167dc7f7b03d961a8b9668", "score": "0.7245965", "text": "func (r *Ring) Dequeue() interface{} {\n\tr.checkInit()\n\tif r.head == -1 {\n\t\treturn nil\n\t}\n\tv := r.get(r.tail)\n\tif r.tail == r.head {\n\t\tr.head = -1\n\t\tr.tail = 0\n\t} else {\n\t\tr.tail = r.mod(r.tail + 1)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "b3d62100411b95fb804dcb2d9dcec71c", "score": "0.72378975", "text": "func (q RunnerQueue) Pop() (w RunnerTask) {\n\tw = q.pop().(RunnerTask)\n\treturn\n}", "title": "" }, { "docid": "01cc4f6458ff34e2c0a99af8d3fe53ea", "score": "0.72302324", "text": "func (q *Queue) Dequeue() (interface{}, bool) {\n\tif q.Empty() {\n\t\treturn nil, false\n\t}\n\te := q.elem[q.head]\n\tq.elem = q.elem[1:]\n\tq.tail = len(q.elem)\n\treturn e, true\n}", "title": "" }, { "docid": "1b05583b143626860560e70255e22710", "score": "0.7229085", "text": "func (q *Queue) Pop() interface{} {\n\tq.lock.Lock()\n\tdefer q.lock.Unlock()\n\n\tif q.head == nil {\n\t\treturn nil\n\t}\n\n\tn := q.head\n\tq.head = n.next\n\n\tif q.head == nil {\n\t\tq.tail = nil\n\t}\n\tq.count--\n\n\treturn n.data\n}", "title": "" }, { "docid": "6f6c90a2384f370ce2ba05003db53e06", "score": "0.72124916", "text": "func (q *Queue) Pop() interface{} {\n\n\tif q.IsEmpty() {\n\t\tpanic(fmt.Sprint(\"列表为空,不能pop\"))\n\t}\n\n\thead := (*q)[0]\n\t*q = (*q)[1:]\n\treturn head\n\n}", "title": "" }, { "docid": "1ba2ceec94207cb6756e1a47e3d2e682", "score": "0.7190366", "text": "func (k *KeyQueue) Dequeue() (key rune) {\n\tkey = k.Keys[0]\n\tk.Keys = k.Keys[1:]\n\treturn\n}", "title": "" }, { "docid": "53940d9e30d8cce9f6ff580a24e55de4", "score": "0.7188979", "text": "func (q *queue) dequeue() (underflow bool, element interface{}, priority int) {\n\t//Check if queue is empty (underflow)\n\tif q.checkIfEmpty() {\n\t\tunderflow = true\n\t\treturn\n\t}\n\t//Pop\n\tcontainer := q.containers[0]\n\telement = container.element\n\tpriority = container.priority\n\tq.containers[0] = nil //Come garbage collect\n\tq.containers = q.containers[1:]\n\treturn\n}", "title": "" }, { "docid": "5f0ba4e72a1a5d16daa339454411a91f", "score": "0.71834475", "text": "func (queue *Queue) Pop() interface{} {\n\tif queue.length == 0 {\n\t\treturn nil\n\t}\n\ti := queue.first\n\tif queue.length == 1 {\n\t\tqueue.first = nil\n\t\tqueue.last = nil\n\t} else {\n\t\tqueue.first = i.prev\n\t}\n\tqueue.length--\n\treturn i.value\n}", "title": "" }, { "docid": "4373eee962593bd3ffdab6992de663b8", "score": "0.717829", "text": "func (q *Queue) Pop() (interface{}, error) {\n\tif q.Length == 0 {\n\t\treturn nil, errors.New(\"Empty Queue\")\n\t}\n\tdefer q.decrease()\n\n\ttmpNode := q.Head\n\tif q.Length == 1 {\n\t\tq.Head = nil\n\t\tq.Tail = nil\n\t} else {\n\t\tq.Head = tmpNode.Next\n\t}\n\treturn tmpNode.Value, nil\n}", "title": "" }, { "docid": "e4fc2f78e4347695a01dc30b6b37b2a4", "score": "0.717739", "text": "func (q *Queue) Pop() (interface{}, error) {\n\tif q.Empty() {\n\t\treturn nil, fmt.Errorf(\"queue is empty\")\n\t}\n\tv := q.data[0]\n\tq.data = q.data[1:]\n\treturn v, nil\n}", "title": "" }, { "docid": "b4c00001f7ac4393a44997df79682868", "score": "0.717359", "text": "func (q *GenericQueue) Pop() Generic {\n\tif q.IsEmpty() {\n\t\tpanic(\"queue is empty\")\n\t}\n\n\tn := q.head\n\tq.len--\n\n\tq.head = n.next\n\tif q.head != nil {\n\t\tq.head.prev = nil\n\t} else {\n\t\tq.tail = nil\n\t}\n\n\treturn n.data\n}", "title": "" }, { "docid": "62643b20291fa608b002f2f699306efc", "score": "0.7166598", "text": "func (queue *QueueWithCapacity) Dequeue() (item interface{}, err error) {\n\tvar ok bool\n\tselect {\n\tcase item = <-queue.channel:\n\t\tok = true\n\tdefault:\n\t\tok = false\n\t}\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"no elements in queue\")\n\t}\n\treturn item, nil\n}", "title": "" }, { "docid": "98e2b1d00b7e0a14fa0c1f2262a8a0eb", "score": "0.7147887", "text": "func (q *Queue) Pop() interface{} {\n\tif e := q.List.Front(); e != nil {\n\t\treturn q.List.Remove(e)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0f8bcb2fe06adc9e6bc032f502454f44", "score": "0.7144487", "text": "func (this *MyQueue) Pop() int {\n\tele:=this.queue[0]\n\tthis.queue = this.queue[1:]\n\treturn ele\n\n}", "title": "" }, { "docid": "c122e6cf895172ab698c914392eb7b2a", "score": "0.7138422", "text": "func (s *RedisStore) Dequeue(queueName string, value interface{}) {\n\tres, err := s.Client.BRPop(0, queueName).Result()\n\tif err != nil {\n\t\tlog.Warning(\"redis> Error dequeueing %s:%s\", queueName, err)\n\t}\n\tif len(res) != 2 {\n\t\treturn\n\t}\n\tif err := json.Unmarshal([]byte(res[1]), value); err != nil {\n\t\tlog.Warning(\"redis> Cannot unmarshal %s :%s\", queueName, err)\n\t}\n}", "title": "" }, { "docid": "b41108da0501a751c8d8b39db0d3d471", "score": "0.71141243", "text": "func (CQ *ChunkedQueue) Pop() (item Data) {\n\n\thead := CQ.front\n\titem = head.pop()\n\tCQ.size--\n\n\tif head.first >= head.last {\n\t\tif CQ.size == 0 {\n\t\t\thead.first = 0\n\t\t\thead.last = 0\n\t\t\thead.next = nil\n\t\t} else {\n\t\t\tCQ.front = head.next\n\t\t}\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "68b22c1560b6bad0f6bff4bc48069f97", "score": "0.710741", "text": "func (q *Queue) Pop() (interface{}, error) {\n\tif len(q.s) == 0 {\n\t\treturn nil, errors.New(\"Queue: cannot Pop() from empty queue\")\n\t}\n\tres := q.s[0]\n\t// q.s[0] = struct{}{}\n\tq.s = q.s[1:]\n\treturn res, nil\n}", "title": "" }, { "docid": "e76e56aeec6f3a7803ea589347d2225d", "score": "0.7105314", "text": "func (q *Queue) Pop() interface{} {\n\te := q.list.Front()\n\tif e != nil {\n\t\treturn q.list.Remove(e)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4a161dab7cd8b1d2f6e2ab51e6f90ac1", "score": "0.7102641", "text": "func (s *LinkedListQueue) Dequeue() *Item {\n\tif s.IsEmpty() {\n\t\treturn nil\n\t}\n\tnext := s.next\n\ts.next = next.next\n\tnext.next = nil\n\treturn next.value\n}", "title": "" }, { "docid": "b5d8341cc993d31aa8fedda135489b6f", "score": "0.70954454", "text": "func (u *userq) Dequeue() (v interface{}) {\n\tif u.deq == nil {\n\t\tu.deq = u.b.wait()\n\t\tu.deq.deqIndex = 0\n\t}\n\tv = u.deq.Dequeue()\n\tif u.deq.deqIndex == len(u.deq.values) {\n\t\tu.b.free(u.deq)\n\t\tu.deq = nil\n\t}\n\treturn v\n}", "title": "" }, { "docid": "fa24bc3fd8fad2750137309471475dad", "score": "0.70883447", "text": "func (q *Queue) Pop() interface{} {\n\tif q.head == nil {\n\t\treturn nil\n\t}\n\tq.Lock()\n\ttemp := q.head\n\tq.head = temp.next\n\tq.length--\n\tq.Unlock()\n\treturn temp.value\n}", "title": "" }, { "docid": "0a43519dec65f60e92029c2f7143beb7", "score": "0.70853794", "text": "func (s *ItemQueue) Dequeue() *Item {\n\ts.lock.Lock()\n\titem := s.items[0]\n\ts.items = s.items[1:len(s.items)]\n\ts.lock.Unlock()\n\treturn &item\n}", "title": "" }, { "docid": "1e95af6fd59204552522ef07504d863c", "score": "0.7074084", "text": "func (q *Queue) Dequeue() (lastNode *node) {\n\tif q.tail == nil {\n\t\treturn\n\t}\n\n\tlastNode = q.tail // save it for return\n\n\t// Rewire tail and penultimate node\n\tq.tail = lastNode.prev // even if it is nil as in the case of one item in queue\n\tif q.tail != nil {\n\t\tq.tail.next = nil // make sure to terminate\n\t} else {\n\t\t// we are empty -- make sure the head knows it\n\t\tq.head = nil\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "22222c6d040b84a1fa72d596ae7681f3", "score": "0.7072843", "text": "func (this *MyQueue) Pop() int {\n\tif this.b.length() == 0 {\n\t\tfor this.a.length() > 0 {\n\t\t\tthis.b.push(this.a.pop())\n\t\t}\n\t}\n\treturn this.b.pop()\n}", "title": "" }, { "docid": "54694b17e908fc0175cf1154804fabcb", "score": "0.7072781", "text": "func (q *Queue) Pop() float64 {\n\tvar value float64 = q.first.value\n\tq.first = q.first.next\n\tq.size--\n\treturn value\n}", "title": "" }, { "docid": "6c8cb6277be0ea473c35b96bc609ebf7", "score": "0.7061158", "text": "func (q *Queue) Pop() interface{} {\n\tx := q.Front()\n\tq.head = q.nextIndex(q.head)\n\tif q.Size() == (len(q.container) >> 2) {\n\t\tq.resize()\n\t}\n\treturn x\n}", "title": "" }, { "docid": "7205cf1f24c2fe4e577b89d3a20a7673", "score": "0.70543724", "text": "func (s *NodeQueue) Dequeue() *Node {\n\ts.Lock.Lock()\n\titem := s.Items[0]\n\ts.Items = s.Items[1:len(s.Items)]\n\ts.Lock.Unlock()\n\treturn &item\n}", "title": "" }, { "docid": "8693d02e0ea9f224e8b55bbcfa27024a", "score": "0.70493543", "text": "func Dequeue(xu *xgbutil.XUtil) (xgb.Event, xgb.Error) {\n\txu.EvqueueLck.Lock()\n\tdefer xu.EvqueueLck.Unlock()\n\n\teverr := xu.Evqueue[0]\n\txu.Evqueue = xu.Evqueue[1:]\n\treturn everr.Event, everr.Err\n}", "title": "" }, { "docid": "bfbb9a63d5efefaa6c339565bb4bab1f", "score": "0.703641", "text": "func (mq *MyQueue) Pop() int {\n\tif mq.b.IsEmpty() {\n\t\tfor mq.a.Len() > 0 {\n\t\t\tmq.b.Push(mq.a.Pop())\n\t\t}\n\t}\n\treturn mq.b.Pop()\n}", "title": "" }, { "docid": "2d4ef920f8bc05ca533d85510a81e7ae", "score": "0.70344967", "text": "func (mq *MyQueue) Pop() int {\n\tif mq.a.Len() == 0 {\n\t\tfor mq.b.Len() >0 {\n\t\t\tmq.a.Push(mq.b.Pop())\n\t\t}\n\t}\n\treturn mq.a.Pop()\n}", "title": "" }, { "docid": "14b30c38826c02860be53d6e7dddff32", "score": "0.70318156", "text": "func (q *mergeTaskQueue) pop() {\n\tif q.len() > 0 {\n\t\tq.tasks = q.tasks[1:]\n\t\tif q.len() == 0 {\n\t\t\tq.cleanupTimestamp = time.Now()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5833f9605e961b4e025efc397db8af0a", "score": "0.70315564", "text": "func (this *MyQueue) Pop() int {\n\tele := this.Peek()\n\tthis.outStack = this.outStack[:len(this.outStack) - 1]\n\treturn ele\n}", "title": "" }, { "docid": "640caefaefe1a4dd8854fd151036cf8a", "score": "0.703061", "text": "func (q *Queue) Pop() interface{} {\n\told := *q\n\tn := len(old)\n\ti := old[n-1]\n\ti.index = -1\n\t*q = old[0 : n-1]\n\treturn i\n}", "title": "" }, { "docid": "d05c38facf2dc0e65bee47e481915fdf", "score": "0.7030168", "text": "func (this *MyStack) Pop() int {\n length1 := len(this.Queue1)\n for i := 0; i < length1 - 1; i++ {\n // 取出每个元素\n item := this.Queue1[0]\n this.TopElement = item\n // 删除元素\n this.Queue1 = this.Queue1[1:]\n // 入队列 2\n this.Queue2 = append(this.Queue2, item)\n }\n target := this.Queue1[0]\n // 交换\n this.Queue1 = this.Queue2\n this.Queue2 = make([]int, 0)\n return target\n}", "title": "" }, { "docid": "044655271d23f569042c4cb3c539d8bf", "score": "0.7010466", "text": "func (q *Queue) Pop() interface{} {\n\tif q.Size() == 0 {\n\t\treturn nil\n\t}\n\treturn <-q.objects\n}", "title": "" }, { "docid": "4ea83bfe4eee614b98dbe6b4974876d4", "score": "0.701034", "text": "func (pq *PQueue) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\t*pq = old[0 : n-1]\n\treturn item\n}", "title": "" }, { "docid": "ad3e94084ca5de4247ca223c7c2cdeb5", "score": "0.70075333", "text": "func (q BuilderQueue) Pop() (w BuilderTask) {\n\tw = q.pop().(BuilderTask)\n\treturn\n}", "title": "" }, { "docid": "c3d6a44fa63a0c0876eccefddfd0dbd7", "score": "0.69911665", "text": "func (q *Queue) dequeue() *Packet {\n\te := q.buffer.Front().Value.(*Packet)\n\tq.buffer.Remove(q.buffer.Front())\n\treturn e\n}", "title": "" }, { "docid": "d5e976fc2fc458e640d6425765e84b69", "score": "0.6991155", "text": "func (q *Queue) Pop() interface{} {\n\tq.mu.Lock()\n\tdefer q.mu.Unlock()\n\tel := q.elements.Front()\n\tif el == nil {\n\t\treturn nil\n\t}\n\treturn q.elements.Remove(el)\n}", "title": "" }, { "docid": "e6f5330eafc59d20f9df4fb9715ce0a3", "score": "0.69907296", "text": "func (this *MyQueue) Pop() int {\n\tfor this.wareHouse.Size() > 1 {\n\t\tthis.backup.Push(this.wareHouse.Pop())\n\t}\n\tval := this.wareHouse.Pop()\n\tthis.backup, this.wareHouse = this.wareHouse, this.backup\n\treturn val\n}", "title": "" }, { "docid": "6c5233736da8d179f4aff05640311809", "score": "0.69835544", "text": "func (q *PointQueue) Dequeue() (point.Point2D, bool) {\n\tif q.length == 0 {\n\t\treturn point.Point2D{}, false\n\t}\n\n\tp := q.items[q.start]\n\tq.start = (q.start + 1) % len(q.items)\n\tq.length--\n\treturn p, true\n}", "title": "" }, { "docid": "7510cabd683fd552f268ce7544ebf307", "score": "0.69805396", "text": "func (this *MyQueue) Pop() int {\n\n\tvar ret *list.Element\n\tif this.stack1.Len() == 0 {\n\t\tpanic(\"err\")\n\t}\n\n\tthis.peek = 0\n\n\tfor i := this.stack1.Len(); i > 0; i-- {\n\t\tret = this.stack1.Front()\n\t\tthis.stack1.Remove(ret)\n\t\tif i != 1 {\n\t\t\tthis.peek = ret.Value.(int)\n\t\t\tthis.stack2.PushFront(this.peek)\n\t\t}\n\t}\n\n\t// traverse stack\n\tfor this.stack2.Len() > 0 {\n\t\ttmp := this.stack2.Front()\n\t\tthis.stack2.Remove(tmp)\n\t\tthis.stack1.PushFront(tmp.Value.(int))\n\t}\n\n\treturn ret.Value.(int)\n}", "title": "" }, { "docid": "961471dd54b2398ac124a744ba1f9e7d", "score": "0.69803816", "text": "func (this *MyQueue) Pop() int {\n\tans := this.Peek()\n\tthis.s2 = this.s2[:len(this.s2)-1]\n\treturn ans\n}", "title": "" }, { "docid": "48b821438b481985bd5700e1dadc4105", "score": "0.697841", "text": "func (s *SimpleQueueContract) Pop(ctx contractapi.TransactionContextInterface) (*Query, error) {\n\tq, err := s.Back(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err = ctx.GetStub().DelState(q.Key); err != nil {\n\t\treturn nil, fmt.Errorf(\"delete state key %q error: %w\", q.Key, err)\n\t}\n\n\treturn q, nil\n}", "title": "" }, { "docid": "f108ee96f08277a1ad395d97747f37ea", "score": "0.6976053", "text": "func (queue *Queue) Pop() (cargo interface{}, err error) {\n\tif queue.count == 0 {\n\t\treturn nil, errors.New(\"empty queue\")\n\t}\n\tcargo = queue.first.cargo\n\tqueue.first = queue.first.next\n\tif queue.first == nil {\n\t\tqueue.last = nil\n\t}\n\tqueue.count--\n\treturn cargo, nil\n}", "title": "" }, { "docid": "4af893bc206b49912e568a059b4a3387", "score": "0.69696504", "text": "func (tq *timeoutQueue) Pop() interface{} {\n\tn := len(*tq)\n\titem := (*tq)[n-1]\n\t(*tq)[n-1] = nil // make sure the item is freed from memory\n\t*tq = (*tq)[:n-1]\n\treturn item\n}", "title": "" }, { "docid": "558529c537cc02829efa67230ef588e3", "score": "0.6967517", "text": "func (this *MyQueue) Pop() int {\n\tif len(this.s1) == 0 {\n\t\tthis.updateOutQueue()\n\t}\n\tv := this.s1[len(this.s1)-1]\n\tthis.s1 = this.s1[:len(this.s1)-1]\n\treturn v\n}", "title": "" }, { "docid": "764736a0c68061b220e4bb95159e3f1a", "score": "0.6967275", "text": "func (nq *NodeQueue) Dequeue() error {\n\tif nq.length < 1 {\n\t\treturn errors.New(\"cannot dequeue from an empty queue\")\n\t}\n\n\toldHead := nq.head\n\n\tnq.head = oldHead.next\n\n\toldHead.next = nil\n\n\tif nq.head == nil {\n\t\tnq.tail = nil\n\t}\n\n\tnq.length -= 1\n\n\treturn nil\n}", "title": "" }, { "docid": "205bb71ec102c0f726c886be605b9eba", "score": "0.6958264", "text": "func (pq *priorityQueue) Pop() interface{} {\n\told := pq.queue\n\tn := len(old)\n\titem := old[n-1]\n\tpq.queue = old[0 : n-1]\n\treturn item\n}", "title": "" }, { "docid": "19221e57b850d42bd8c5d67ad4820e3b", "score": "0.6951663", "text": "func (q *BoundedBlockingQueue) Dequeue() int {\n\tdefer q.m.Unlock()\n\tq.m.Lock()\n\n\tfor q.size == 0 {\n\t\tq.c.Wait()\n\t}\n\n\telement := q.q[q.tail]\n\tq.tail = q.tail + 1\n\tif q.tail == q.Capacity {\n\t\tq.tail = 0\n\t}\n\tq.size = q.size - 1\n\tq.c.Broadcast()\n\n\t// trace\n\tq.dqt[q.t] = element\n\tq.t = q.t + 1\n\n\treturn element\n}", "title": "" }, { "docid": "0078fc5c0d4bb0bc9b3fe771b50e4734", "score": "0.69508386", "text": "func (this *MyQueue) Pop() int {\n\tvar res int\n\tif len(this.output) > 0 {\n\t\tres = this.output[len(this.output)-1]\n\t\tthis.output = this.output[:len(this.output)-1]\n\t} else {\n\t\tfor i := len(this.input) - 1; i >= 0; i-- {\n\t\t\t// 从输入栈移动数据到输出栈\n\t\t\titem := this.input[i]\n\t\t\tthis.input = this.input[:len(this.input)-1]\n\t\t\tthis.output = append(this.output, item)\n\t\t}\n\t\t//fmt.Println(this.input, this.output)\n\t\tres = this.output[len(this.output)-1]\n\t\tthis.output = this.output[:len(this.output)-1]\n\t}\n\n\treturn res\n}", "title": "" }, { "docid": "8c48aecd156b847464325519470dac7a", "score": "0.6947405", "text": "func dequeue(queue []Products) []Products {\n\treturn queue[1:]\n}", "title": "" }, { "docid": "64d25cc84daea189ccbcc889c1d3f174", "score": "0.69439006", "text": "func (c *Cluster) deWaitQueue() (*Message, error){\n\tc.lock.Lock()\n\tdefer c.lock.Unlock()\n\tvar queueEmptyError = errors.New(\"[deWaitQueue] waitQueue empty\")\n\tif len(c.waitQueue) == 0 {\n\t\treturn nil, queueEmptyError\n\t}\n\t//dequeue\n\tjoinRequest := c.waitQueue[0]\n\tc.waitQueue = c.waitQueue[1:]\n\treturn joinRequest, nil\n}", "title": "" }, { "docid": "1a6bd7be84fd89b1a6fe76ac686eed31", "score": "0.6941601", "text": "func (this *MyQueue) Pop() int {\n\tif len(this.stack2) == 0 {\n\t\tlength := len(this.stack1)\n\t\tfor i := 0; i < length; i++ {\n\t\t\titem := this.stack1[len(this.stack1)-1]\n\t\t\tthis.stack1 = this.stack1[:len(this.stack1)-1]\n\t\t\tthis.stack2 = append(this.stack2, item)\n\t\t}\n\t}\n\tresult := this.stack2[len(this.stack2)-1]\n\tthis.stack2 = this.stack2[:len(this.stack2)-1]\n\treturn result\n}", "title": "" }, { "docid": "e52d0075a1680ec4a1598cbda649de41", "score": "0.693288", "text": "func (q *MyQueue) Pop() int {\n\tif len(q.outStack) == 0 {\n\t\tq.in2out()\n\t}\n\tx := q.outStack[len(q.outStack)-1]\n\tq.outStack = q.outStack[:len(q.outStack)-1]\n\treturn x\n}", "title": "" }, { "docid": "57e6ff87b41fae03d0cf3bdf0d3d207f", "score": "0.6923129", "text": "func (this *MyStack) Pop() int {\n\tvar temp *MyQueque\n\tvar other *MyQueque\n\tif this.b.Size() > 0 {\n\t\ttemp = &this.b\n\t\tother = &this.a\n\t} else {\n\t\ttemp = &this.a\n\t\tother = &this.b\n\t}\n\n\ttempLen := temp.Size()\n\tfor i := 0; i < tempLen-1; i++ {\n\t\tother.Enqueque(temp.Dequeque())\n\t}\n\tresult := temp.Dequeque()\n\treturn result\n}", "title": "" }, { "docid": "c675fc798fbc0226b7d799a7c4ff4f1e", "score": "0.6920574", "text": "func (q *Queue) Pop() QElemType {\n\tlength := q.Length()\n\tif length == 0 {\n\t\treturn nil\n\t}\n\thead := (*q)[0]\n\tif length == 1 {\n\t\t*q = (*q)[0:0]\n\t} else {\n\t\t*q = (*q)[1:]\n\t}\n\treturn head\n}", "title": "" }, { "docid": "68aedf93f381e59574b3e4e60f7ece6f", "score": "0.6916202", "text": "func (q *Queue) Pop() interface{} {\n\trs, index := q.ValidHead()\n\tif len(q.Data) > 1 {\n\t\tq.Data = q.Data[index+1:]\n\t} else {\n\t\tq.Data = make([]interface{}, 0, q.cap)\n\t}\n\n\treturn rs\n}", "title": "" }, { "docid": "832b57f896f769b2e6a0b8b0704c9cc2", "score": "0.6914552", "text": "func (this *MyQueue) Pop() int {\n\tif len(this.output) == 0 {\n\t\tthis.move()\n\t}\n\tval := this.output[len(this.output) - 1]\n\tthis.output = this.output[:len(this.output) - 1]\n\treturn val\n}", "title": "" }, { "docid": "5554f41d7cf56f9e306fd59ff67abf90", "score": "0.68984956", "text": "func (this *MyQueue) Pop() int {\n\tthis.rwm.Lock()\n\tdefer this.rwm.Unlock()\n\tif len(this.out) == 0 {\n\t\tfor len(this.in) > 0 {\n\t\t\t// pop\n\t\t\tx := this.in[len(this.in)-1]\n\t\t\tthis.in = this.in[:len(this.in)-1]\n\t\t\t// push\n\t\t\tthis.out = append(this.out, x)\n\t\t}\n\t}\n\tret := this.out[len(this.out)-1]\n\tthis.out = this.out[:len(this.out)-1]\n\treturn ret\n}", "title": "" }, { "docid": "6335fe58fcde5e6fc7a761041262c4c1", "score": "0.68834805", "text": "func (c *queueClient) Pop(ctx context.Context, in *protob.PopQueueRequest, opts ...grpc.CallOption) (*protob.PopQueueResponse, error) {\n\tc.requests = append(c.requests, Request{\n\t\tOperation: \"Pop\",\n\t\t//nolint:govet\n\t\tLocation: *in.Location,\n\t})\n\n\treturn c.pop(in)\n}", "title": "" }, { "docid": "83f4067b08bed28584e4b72831303dbf", "score": "0.6868304", "text": "func (q *Queue) Pop() *Node {\r\n if q.count == 0 {\r\n return nil\r\n }\r\n node := q.nodes[q.head]\r\n q.head = (q.head + 1) % len(q.nodes)\r\n q.count--\r\n return node\r\n}", "title": "" }, { "docid": "1d7eed43f59416103444103ba23ba4db", "score": "0.68660134", "text": "func (pq *MarkerDeadlinesPQ) Dequeue() (MarkerDeadline, bool) {\n\tif pq.isEmpty() {\n\t\treturn MarkerDeadline{}, false\n\t}\n\n\titem := heap.Pop(&pq.heap).(*MarkerDeadline)\n\tdelete(pq.entries, item.MessageID)\n\treturn *item, true\n}", "title": "" } ]
922aec7906ff2c25b17b98c871d7ca66
Uint128FromRand generates an unsigned 128bit random integer.
[ { "docid": "abc0d8285c5c1245fc36bec1486264a5", "score": "0.85784346", "text": "func Uint128FromRand(source RandomSource) Uint128 {\n\treturn Uint128{hi: source.Uint64(), lo: source.Uint64()}\n}", "title": "" } ]
[ { "docid": "f9a73066dafe24c78312c12656108756", "score": "0.8454373", "text": "func RandUint128() (z Uint128) {\n\tz.hi = rand.Uint64()\n\tz.lo = rand.Uint64()\n\treturn z\n}", "title": "" }, { "docid": "1254cad68cab21b4e40a604877176534", "score": "0.718327", "text": "func NewUint128() *Uint128 {\n\treturn &Uint128{big.NewInt(0)}\n}", "title": "" }, { "docid": "e792f8187b7e705d1861b7bd35bd807f", "score": "0.70112926", "text": "func Uint128FromBits(hi, lo uint64) Uint128 {\n\treturn Uint128{hi: hi, lo: lo}\n}", "title": "" }, { "docid": "a0f210676fa7316a34dae2c657392242", "score": "0.68279856", "text": "func copyUInt128(x *big.Int) *big.Int {\n\treturn big.NewInt(0).Set(x)\n}", "title": "" }, { "docid": "630a60d4bbb7d5beb340a2e4410d8546", "score": "0.6757316", "text": "func NewUint128FromUint(i uint64) *Uint128 {\n\treturn &Uint128{new(big.Int).SetUint64(i)}\n}", "title": "" }, { "docid": "bb5c0c8c5fedab7af28929705c99f52f", "score": "0.6727729", "text": "func Uint128FromUint64(x uint64) Uint128 {\n\treturn Uint128{hi: 0, lo: x}\n}", "title": "" }, { "docid": "0a216aa82fd890996b9952286dce1a14", "score": "0.66738105", "text": "func NewUint128FromInt(i int64) (*Uint128, error) {\n\tobj := &Uint128{big.NewInt(i)}\n\tif err := obj.Validate(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn obj, nil\n}", "title": "" }, { "docid": "830830eb65c4002d5de3b10f1117ccce", "score": "0.6574469", "text": "func Uint128From64(v uint64) Uint128 {\n\treturn Uint128{lo: v}\n}", "title": "" }, { "docid": "1429d92bcc4c01e7517af2dc6da90548", "score": "0.64664316", "text": "func NewUint128FromString(str string) (*Uint128, error) {\n\tb, success := new(big.Int).SetString(str, 10)\n\tif !success {\n\t\treturn nil, ErrUint128InvalidString\n\t}\n\tobj := &Uint128{b}\n\tif err := obj.Validate(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn obj, nil\n}", "title": "" }, { "docid": "f6b9b6d419c599b7ddaa006b14169ffa", "score": "0.64409095", "text": "func Uint128FromFloat64(f float64) Uint128 {\n\tswitch {\n\tcase f <= 0 || f != f: // <= 0 or NaN\n\t\treturn Uint128{}\n\tcase f <= maxRepresentableUint64Float:\n\t\treturn Uint128{lo: uint64(f)}\n\tcase f <= maxRepresentableUint128Float:\n\t\treturn Uint128{\n\t\t\thi: uint64(f / wrapUint64Float),\n\t\t\tlo: uint64(math.Mod(f, wrapUint64Float)),\n\t\t}\n\tdefault:\n\t\treturn MaxUint128\n\t}\n}", "title": "" }, { "docid": "47898a6af16911b1cb97b0af00a38725", "score": "0.6376928", "text": "func Uint128FromString(s string) (Uint128, error) {\n\tb, err := parseToBigInt(s)\n\tif err != nil {\n\t\treturn Uint128{}, err\n\t}\n\treturn Uint128FromBigInt(b), nil\n}", "title": "" }, { "docid": "0795ac4ac606ef006643e29003e5a762", "score": "0.63401693", "text": "func Uint128FromUint64s(high, low uint64) Uint128 {\n\treturn Uint128{high: high, low: low}\n}", "title": "" }, { "docid": "4a458df49703adcc9203e57b41aa18b5", "score": "0.630838", "text": "func NewUint128FromBytes(bytes []byte) (*Uint128, error) {\n\tl := len(bytes)\n\tif l > Uint128Bytes {\n\t\treturn nil, ErrUint128InvalidBytes\n\t}\n\tu := NewUint128()\n\tfor i := 0; i < l; i++ {\n\t\tif bytes[i] != 0 {\n\t\t\tu.value.SetBytes(bytes[i:])\n\t\t\tbreak\n\t\t}\n\t}\n\treturn u, nil\n}", "title": "" }, { "docid": "3b699263d1b304bc777f97ad0509b14f", "score": "0.6251458", "text": "func RandUint32() uint32", "title": "" }, { "docid": "6cdf22b23ae77a10e31e2025b413dddc", "score": "0.6145608", "text": "func NewUint128FromBigInt(i *big.Int) (*Uint128, error) {\n\tobj := &Uint128{i}\n\tif err := obj.Validate(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn obj, nil\n}", "title": "" }, { "docid": "f3d9db17725c92f0995f8025a9c7dd2e", "score": "0.610464", "text": "func Uint128FromStringNoCheck(s string) Uint128 {\n\tout, _ := Uint128FromString(s) //nolint:errcheck\n\treturn out\n}", "title": "" }, { "docid": "b5d86e2d56c01df8e2508c464580fcc4", "score": "0.60675466", "text": "func (u *Uint128) DeepCopy() *Uint128 {\n\treturn &Uint128{new(big.Int).Set(u.value)}\n}", "title": "" }, { "docid": "974b0f7b55155f3b5aee415ea4914cfb", "score": "0.6046121", "text": "func U128FromBigInt(val *big.Int) U128 {\n\tvar u128 U128\n\tif val.Sign() < 0 {\n\t\tval = new(big.Int).Add(val, pow128)\n\t}\n\tbuf := val.Bytes()\n\tbuf = ToArrayReverse(buf)\n\tcopy(u128[:], buf)\n\n\treturn u128\n}", "title": "" }, { "docid": "b623195dd99a5c745cb6cc7219dfaca8", "score": "0.59382576", "text": "func Uint128FromComponents(high, low uint64) Uint128 {\n\treturn Uint128{hi: high, lo: low}\n}", "title": "" }, { "docid": "e2710112d19f543e07662e1063be45f8", "score": "0.5911436", "text": "func Uint128FromBigInt(a *big.Int) (z Uint128) {\n\tz.lo = a.Uint64()\n\tb := new(big.Int).Rsh(a, int64Size)\n\tz.hi = b.Uint64()\n\treturn z\n}", "title": "" }, { "docid": "e96e00c38e613e7531e3358dde3f5df0", "score": "0.59078705", "text": "func From128(u Uint128, bytes []byte) {\n\tbinary.BigEndian.PutUint64(bytes[:8], u.H)\n\tbinary.BigEndian.PutUint64(bytes[8:], u.L)\n}", "title": "" }, { "docid": "0b335d811a975abe12111a7bddd5bd03", "score": "0.5881318", "text": "func Hash128WithSeed(p []byte, seed0 uint64) (uint64, uint64) {\n\treturn siphash.Hash128(k2,seed0,p)\n}", "title": "" }, { "docid": "8d6fa8fcb71c0fab251b30533fa769d9", "score": "0.5867762", "text": "func Uint128FromIP(ip net.IP) Uint128 {\n\tif v4 := ip.To4(); v4 != nil {\n\t\treturn Uint128{\n\t\t\tlow: uint64(binary.BigEndian.Uint32([]byte(v4))),\n\t\t}\n\t}\n\n\treturn Uint128{\n\t\thigh: binary.BigEndian.Uint64(ip[:8]),\n\t\tlow: binary.BigEndian.Uint64(ip[8:]),\n\t}\n}", "title": "" }, { "docid": "820cc650ea009bd98b77b97f6a09bea1", "score": "0.5796548", "text": "func Uint128FromBigInt(v *big.Int) Uint128 {\n\tif v.Sign() < 0 {\n\t\treturn Uint128{}\n\t}\n\twords := v.Bits()\n\tswitch len(words) {\n\tcase 0:\n\t\treturn Uint128{}\n\tcase 1:\n\t\treturn Uint128{lo: uint64(words[0])}\n\tcase 2:\n\t\tif intSize == 64 {\n\t\t\treturn Uint128{\n\t\t\t\thi: uint64(words[1]),\n\t\t\t\tlo: uint64(words[0]),\n\t\t\t}\n\t\t}\n\t\treturn Uint128{lo: (uint64(words[1]) << 32) | (uint64(words[0]))}\n\tcase 3:\n\t\tif intSize == 64 {\n\t\t\treturn MaxUint128\n\t\t}\n\t\treturn Uint128{\n\t\t\thi: uint64(words[2]),\n\t\t\tlo: (uint64(words[1]) << 32) | (uint64(words[0])),\n\t\t}\n\tcase 4:\n\t\tif intSize == 64 {\n\t\t\treturn MaxUint128\n\t\t}\n\t\treturn Uint128{\n\t\t\thi: (uint64(words[3]) << 32) | (uint64(words[2])),\n\t\t\tlo: (uint64(words[1]) << 32) | (uint64(words[0])),\n\t\t}\n\tdefault:\n\t\treturn MaxUint128\n\t}\n}", "title": "" }, { "docid": "b0d5b5599ae747d51982d56ec95c9f98", "score": "0.57908607", "text": "func RandomUInt64() uint64 {\n\treturn rand.Uint64()\n}", "title": "" }, { "docid": "1a400748f9145108cf3efb965778adee", "score": "0.57886976", "text": "func To128(bytes []byte) Uint128 {\n\treturn Uint128{binary.BigEndian.Uint64(bytes[:8]), binary.BigEndian.Uint64(bytes[8:])}\n}", "title": "" }, { "docid": "6f22b28bebea6350982e19a7962360e0", "score": "0.5768174", "text": "func TestProtoVimNidGoOptUint128AsBytes(t *testing.T) {\n\ttestProtoGo{\n\t\tmsg: govimNidOptUint128AsBytes,\n\t\tnewMsg: newGoProtoNidOptUint128AsBytes,\n\t}.test(t)\n}", "title": "" }, { "docid": "ae47c2683d94da79126d8a79d10966ba", "score": "0.5756642", "text": "func TestProtoVimNidGoRepUint128AsBytes(t *testing.T) {\n\ttestProtoGo{\n\t\tmsg: govimNidRepUint128AsBytes,\n\t\tnewMsg: newGoProtoNidRepUint128AsBytes,\n\t}.test(t)\n}", "title": "" }, { "docid": "7e083e3a859c4e049294c0c4a659010a", "score": "0.5710005", "text": "func (u Uint128) AsInt128() Int128 {\n\treturn Int128(u)\n}", "title": "" }, { "docid": "a0b1fbf170bec042f5dd49d26e5a4516", "score": "0.56745124", "text": "func TestProtoVimNidGoGoRepUint128AsBytes(t *testing.T) {\n\ttestProtoGoGo{\n\t\tmsg: gogovimNidRepUint128AsBytes,\n\t\tnewMsg: newGoGoProtoNidRepUint128AsBytes,\n\t}.test(t)\n}", "title": "" }, { "docid": "b4eb0f901f94538003cedd57c9ca39e7", "score": "0.56702226", "text": "func TestProtoVisNidGoOptUint128AsBytes(t *testing.T) {\n\ttestProtoGo{\n\t\tmsg: govisNidOptUint128AsBytes,\n\t\tnewMsg: newGoProtoNidOptUint128AsBytes,\n\t}.test(t)\n}", "title": "" }, { "docid": "26ecf3c59cdf91e185896cc9d0a246da", "score": "0.5659047", "text": "func TestProtoVimNidGoGoOptUint128AsBytes(t *testing.T) {\n\ttestProtoGoGo{\n\t\tmsg: gogovimNidOptUint128AsBytes,\n\t\tnewMsg: newGoGoProtoNidOptUint128AsBytes,\n\t}.test(t)\n}", "title": "" }, { "docid": "a38771495ddbf592ed262d8b93f9fb1f", "score": "0.5640533", "text": "func FromBytes(b []byte) Uint128 {\n\thi := binary.LittleEndian.Uint64(b[:8])\n\tV1 := binary.LittleEndian.Uint64(b[8:])\n\treturn Uint128{hi, V1}\n}", "title": "" }, { "docid": "385960c0bbf89a3626196826972737db", "score": "0.56383926", "text": "func TestProtoVisNidGoGoRepUint128AsBytes(t *testing.T) {\n\ttestProtoGoGo{\n\t\tmsg: gogovisNidRepUint128AsBytes,\n\t\tnewMsg: newGoGoProtoNidRepUint128AsBytes,\n\t}.test(t)\n}", "title": "" }, { "docid": "a1ddd4b07e4836a79906d45c183e5635", "score": "0.56370896", "text": "func ipv6ToUInt128(ip net.IP) *big.Int {\n\treturn big.NewInt(0).SetBytes(ip)\n}", "title": "" }, { "docid": "b328f0d350892f7423a4eed0ba118e0e", "score": "0.5628771", "text": "func TestProtoVisNidGoGoOptUint128AsBytes(t *testing.T) {\n\ttestProtoGoGo{\n\t\tmsg: gogovisNidOptUint128AsBytes,\n\t\tnewMsg: newGoGoProtoNidOptUint128AsBytes,\n\t}.test(t)\n}", "title": "" }, { "docid": "c1f76513ceb56661bfc573643ec93f14", "score": "0.5625907", "text": "func TestProtoVisNidGoRepUint128AsBytes(t *testing.T) {\n\ttestProtoGo{\n\t\tmsg: govisNidRepUint128AsBytes,\n\t\tnewMsg: newGoProtoNidRepUint128AsBytes,\n\t}.test(t)\n}", "title": "" }, { "docid": "757f206c99287180f3f170bd4eb8eb4f", "score": "0.555393", "text": "func RandomUint64() uint64 {\n\treturn uint64(rand.Uint32())<<32 + uint64(rand.Uint32())\n}", "title": "" }, { "docid": "ec9b14cdb32ca83a3c81e86869c68756", "score": "0.55494064", "text": "func (x Uint128) Int128() (z Int128) {\n\tz.hi = int64(x.hi)\n\tz.lo = x.lo\n\treturn z\n}", "title": "" }, { "docid": "ad20c49083fecc981608097e08377643", "score": "0.5533897", "text": "func randomUint32() uint32 {\n\tb := make([]byte, 4)\n\trand.Read(b)\n\treturn binary.LittleEndian.Uint32(b)\n}", "title": "" }, { "docid": "74f05023c702864ccc37da261d925f62", "score": "0.552789", "text": "func FromBytes(b []byte) Uint128 {\n\thi := binary.BigEndian.Uint64(b[:8])\n\tlo := binary.BigEndian.Uint64(b[8:])\n\treturn Uint128{hi, lo}\n}", "title": "" }, { "docid": "75d59fe6b7289df1b4b9a2263c48b81f", "score": "0.5469095", "text": "func RandomUint64() uint64 {\n\tbuf := make([]byte, 8)\n\t_, err := rand.Read(buf)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn binary.LittleEndian.Uint64(buf)\n}", "title": "" }, { "docid": "3094b8dee2d70ffcd0ac73cad2e64376", "score": "0.54578805", "text": "func (g *Generator) Hex128() string {\n\treturn Hex128(g.Next())\n}", "title": "" }, { "docid": "beef3d9f92b9d9ad876d8bbc0b827ae8", "score": "0.5453488", "text": "func TestProtoVimNinGoRepUint128AsBytes(t *testing.T) {\n\ttestProtoGo{\n\t\tmsg: govimNinRepUint128AsBytes,\n\t\tnewMsg: newGoProtoNinRepUint128AsBytes,\n\t}.test(t)\n}", "title": "" }, { "docid": "9efe5c87c36e17a18d33499ec688c9b7", "score": "0.5415037", "text": "func AddUint128_64(a, b uint64) (hi uint64, lo uint64) {\n\tlo = a + b\n\tif lo < a {\n\t\thi = 1\n\t}\n\treturn hi, lo\n}", "title": "" }, { "docid": "02da3ad442e45e935a20e6c563e5115d", "score": "0.53899777", "text": "func TestProtoVimNinGoGoRepUint128AsBytes(t *testing.T) {\n\ttestProtoGoGo{\n\t\tmsg: gogovimNinRepUint128AsBytes,\n\t\tnewMsg: newGoGoProtoNinRepUint128AsBytes,\n\t}.test(t)\n}", "title": "" }, { "docid": "06ec53f1ae60356587a83db7550defda", "score": "0.53878665", "text": "func TestProtoVimNinGoOptUint128AsBytes(t *testing.T) {\n\ttestProtoGo{\n\t\tmsg: govimNinOptUint128AsBytes,\n\t\tnewMsg: newGoProtoNinOptUint128AsBytes,\n\t}.test(t)\n}", "title": "" }, { "docid": "dad3c744ba9e0c98ce0b851eee0ff815", "score": "0.5385049", "text": "func MulUint128_64(a, b uint64) (hi, lo uint64) {\n\t/*\n\t\t2^(2 W) ahi bhi + 2^W alo bhi + 2^W ahi blo + alo blo\n\n\t\tFEDCBA98 76543210 FEDCBA98 76543210\n\t\t ---- alo*blo ----\n\t\t ---- alo*bhi ----\n\t\t ---- ahi*blo ----\n\t\t---- ahi*bhi ----\n\t*/\n\tconst w = 32\n\tconst m = 1<<w - 1\n\tahi, bhi, alo, blo := a>>w, b>>w, a&m, b&m\n\tlo = alo * blo\n\tmid1 := alo * bhi\n\tmid2 := ahi * blo\n\tc1, lo := AddUint128_64(lo, mid1<<w)\n\tc2, lo := AddUint128_64(lo, mid2<<w)\n\t_, hi = AddUint128_64(ahi*bhi, mid1>>w+mid2>>w+c1+c2)\n\treturn\n}", "title": "" }, { "docid": "c2e4b4febdb6cc5716181f192671139e", "score": "0.5340496", "text": "func EVMWordUint128(val *big.Int) ([]byte, error) {\n\tbytes := val.Bytes()\n\tif val.BitLen() > 128 {\n\t\treturn nil, fmt.Errorf(\"overflow saving uint128 to EVM word: %v\", val)\n\t} else if val.Sign() == -1 {\n\t\treturn nil, fmt.Errorf(\"invalid attempt to save negative value as uint128 to EVM word: %v\", val)\n\t}\n\treturn common.LeftPadBytes(bytes, EVMWordByteLen), nil\n}", "title": "" }, { "docid": "b3f777b5d6a597c55495599a24f20ecf", "score": "0.53281516", "text": "func TestProtoVimNidGoToGoGoRepUint128AsBytes(t *testing.T) {\n\ttestProtoGoToGoGo{\n\t\tgomsg: govimNidRepUint128AsBytes,\n\t\tnewGogomsg: newGoGoProtoNidRepUint128AsBytes,\n\t\tgogomsg: gogovimNidRepUint128AsBytes,\n\t}.test(t)\n}", "title": "" }, { "docid": "481d7f105216a91c9b873dc73cd2d31d", "score": "0.5322636", "text": "func RandUint64() uint64 {\n\t// Using two calls to uint32 since there is no rand.uint64\n\treturn uint64(randGen.Uint32()) + uint64(randGen.Uint32())\n}", "title": "" }, { "docid": "8d52dc5cb5b4934aae3b4ffeac0ba719", "score": "0.5318961", "text": "func Hash128WithSeeds(p []byte, seed0, seed1 uint64) (uint64, uint64) {\n\treturn siphash.Hash128(seed0,seed1,p)\n}", "title": "" }, { "docid": "9edb368ac652a5b6eb7dd9607c2cdacc", "score": "0.5311605", "text": "func TestProtoVimNidGoToGoGoOptUint128AsBytes(t *testing.T) {\n\ttestProtoGoToGoGo{\n\t\tgomsg: govimNidOptUint128AsBytes,\n\t\tnewGogomsg: newGoGoProtoNidOptUint128AsBytes,\n\t\tgogomsg: gogovimNidOptUint128AsBytes,\n\t}.test(t)\n}", "title": "" }, { "docid": "442110b481a2fdc5b7e0756a1f1f67c9", "score": "0.5297591", "text": "func TestProtoVimNinGoGoOptUint128AsBytes(t *testing.T) {\n\ttestProtoGoGo{\n\t\tmsg: gogovimNinOptUint128AsBytes,\n\t\tnewMsg: newGoGoProtoNinOptUint128AsBytes,\n\t}.test(t)\n}", "title": "" }, { "docid": "53902c3124ea39aff997c3fbdbc3e201", "score": "0.52927417", "text": "func (u ScVal) GetU128() (result UInt128Parts, ok bool) {\n\tarmName, _ := u.ArmForSwitch(int32(u.Type))\n\n\tif armName == \"U128\" {\n\t\tresult = *u.U128\n\t\tok = true\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "9fa50e020c8e3a1328c404dc35024c47", "score": "0.5246601", "text": "func (pt *Puid_t) Rand(bits int) {\n\tvar buf [8]byte\n\tif _, err := rand.Read(buf[:(bits+7)/8]); err != nil {\n\t\tpanic(err)\n\t}\n\t*pt = Puid_t(binary.LittleEndian.Uint64(buf[:]))\n\t*pt &= 0xffffffffffffffff >> (65 - bits) // throw one more bit to prevent string representation overflow\n}", "title": "" }, { "docid": "442d64b6a35804a2c8d7b8656cba90ba", "score": "0.52458256", "text": "func TestProtoVisNinGoGoRepUint128AsBytes(t *testing.T) {\n\ttestProtoGoGo{\n\t\tmsg: gogovisNinRepUint128AsBytes,\n\t\tnewMsg: newGoGoProtoNinRepUint128AsBytes,\n\t}.test(t)\n}", "title": "" }, { "docid": "cecf0a30f75a00238203efba1be3c991", "score": "0.5237108", "text": "func TestProtoVisNinGoRepUint128AsBytes(t *testing.T) {\n\ttestProtoGo{\n\t\tmsg: govisNinRepUint128AsBytes,\n\t\tnewMsg: newGoProtoNinRepUint128AsBytes,\n\t}.test(t)\n}", "title": "" }, { "docid": "3a4bacb781ed0ffebed9aec97aab71d1", "score": "0.5222323", "text": "func TestProtoVisNidGoToGoGoRepUint128AsBytes(t *testing.T) {\n\ttestProtoGoToGoGo{\n\t\tgomsg: govisNidRepUint128AsBytes,\n\t\tnewGogomsg: newGoGoProtoNidRepUint128AsBytes,\n\t\tgogomsg: gogovisNidRepUint128AsBytes,\n\t}.test(t)\n}", "title": "" }, { "docid": "70286c317c0677f0d924d930450a0534", "score": "0.52221364", "text": "func TestProtoVisNidGoToGoGoOptUint128AsBytes(t *testing.T) {\n\ttestProtoGoToGoGo{\n\t\tgomsg: govisNidOptUint128AsBytes,\n\t\tnewGogomsg: newGoGoProtoNidOptUint128AsBytes,\n\t\tgogomsg: gogovisNidOptUint128AsBytes,\n\t}.test(t)\n}", "title": "" }, { "docid": "f04f5487bec73c44d6bd0fb1169d60af", "score": "0.5219894", "text": "func New128(key []byte) (hash.Hash, error) {\n\tif len(key) != Size {\n\t\treturn nil, errKeySize\n\t}\n\th := &digest{size: Size128}\n\tcopy(h.key[:], key)\n\th.Reset()\n\treturn h, nil\n}", "title": "" }, { "docid": "83688715425c2ff2f82bc5d02b2f6778", "score": "0.5217037", "text": "func (r *Random) SeedFromUInt64(seed uint64) {\n\tif seed <= 0xffffffff {\n\t\tr.SeedFromUInt32(uint32(seed))\n\t\treturn\n\t}\n\tr.SeedFromUInt32s([]uint32{uint32(seed), uint32(seed >> 32)})\n}", "title": "" }, { "docid": "111bbdcd3169e2dd33264360ba43faa5", "score": "0.5213329", "text": "func Hash128(s []byte) U128 {\n\tif len(s) >= 16 {\n\t\treturn Hash128Seed(s[16:], U128{\n\t\t\tLow: binary.LittleEndian.Uint64(s),\n\t\t\tHigh: binary.LittleEndian.Uint64(s[8:]) + k0},\n\t\t)\n\t}\n\treturn Hash128Seed(s, U128{Low: k0, High: k1})\n}", "title": "" }, { "docid": "dbd158b18ccf854c6f896ae0ab3ae6c3", "score": "0.52123064", "text": "func hash128(b []byte) []byte {\n\th128 := murmur3.New128()\n\treturn h128.Sum(b)\n}", "title": "" }, { "docid": "ce5698b7f7504552b3206c931f606d7e", "score": "0.52042943", "text": "func GetRandomUInt32(max uint32) uint32 {\n\n\tb := make([]byte, 4)\n\t_, err := rand.Read(b)\n\n\tif err != nil {\n\t\tlog.Error(\"Failed to get entropy from system\", err)\n\t\tpanic(err)\n\t}\n\n\tdata := binary.BigEndian.Uint32(b)\n\treturn data % max\n}", "title": "" }, { "docid": "9bd09db0cbbae2268bb7dd46e0c5c77e", "score": "0.5200093", "text": "func FromString(s string) (Uint128, error) {\n\tif len(s) > 32 {\n\t\treturn Uint128{}, errors.Errorf(\"input string %s too large for uint128\", s)\n\t}\n\tbytes, err := hex.DecodeString(s)\n\tif err != nil {\n\t\treturn Uint128{}, errors.Wrapf(err, \"could not decode %s as hex\", s)\n\t}\n\n\t// Grow the byte slice if it's smaller than 16 bytes, by prepending 0s\n\tif len(bytes) < 16 {\n\t\tbytesCopy := make([]byte, 16)\n\t\tcopy(bytesCopy[(16-len(bytes)):], bytes)\n\t\tbytes = bytesCopy\n\t}\n\n\treturn FromBytes(bytes), nil\n}", "title": "" }, { "docid": "9bd09db0cbbae2268bb7dd46e0c5c77e", "score": "0.5200093", "text": "func FromString(s string) (Uint128, error) {\n\tif len(s) > 32 {\n\t\treturn Uint128{}, errors.Errorf(\"input string %s too large for uint128\", s)\n\t}\n\tbytes, err := hex.DecodeString(s)\n\tif err != nil {\n\t\treturn Uint128{}, errors.Wrapf(err, \"could not decode %s as hex\", s)\n\t}\n\n\t// Grow the byte slice if it's smaller than 16 bytes, by prepending 0s\n\tif len(bytes) < 16 {\n\t\tbytesCopy := make([]byte, 16)\n\t\tcopy(bytesCopy[(16-len(bytes)):], bytes)\n\t\tbytes = bytesCopy\n\t}\n\n\treturn FromBytes(bytes), nil\n}", "title": "" }, { "docid": "a41b3128295a1ee234e275a474cf10e5", "score": "0.5199561", "text": "func Hash128(b []byte) Uint128 {\n\treturn hashAny128(*(*str)(ptr(&b)))\n}", "title": "" }, { "docid": "0380cf6a208dc0399b11e717a36b2783", "score": "0.5198342", "text": "func TestProtoVisNinGoOptUint128AsBytes(t *testing.T) {\n\ttestProtoGo{\n\t\tmsg: govisNinOptUint128AsBytes,\n\t\tnewMsg: newGoProtoNinOptUint128AsBytes,\n\t}.test(t)\n}", "title": "" }, { "docid": "926fa55367fb17f16d3740df0cee0440", "score": "0.5186414", "text": "func FromInts(hi uint64, lo uint64) Uint128 {\n\treturn Uint128{hi, lo}\n}", "title": "" }, { "docid": "e796f0ef6f29622316e0dfd8b42a5ce3", "score": "0.51835173", "text": "func (u Uint128) Xor64(n uint64) Uint128 {\n\treturn Uint128{\n\t\thi: u.hi,\n\t\tlo: u.lo ^ n,\n\t}\n}", "title": "" }, { "docid": "62ae01222252ab005b01e3ffb2c23f04", "score": "0.5175864", "text": "func Hash128(p []byte) (uint64, uint64) {\n\treturn siphash.Hash128(k0,k1,p)\n}", "title": "" }, { "docid": "db88dd5f457abcc5fd222ad9cb913714", "score": "0.5161815", "text": "func TestProtoVimNidGoGoToGoRepUint128AsBytes(t *testing.T) {\n\ttestProtoGoGoToGo{\n\t\tgogomsg: gogovimNidRepUint128AsBytes,\n\t\tnewGomsg: newGoProtoNidRepUint128AsBytes,\n\t\tgomsg: govimNidRepUint128AsBytes,\n\t\tvis: false,\n\t}.test(t)\n}", "title": "" }, { "docid": "7ceb214820ff0a240eb6188a2e3cf774", "score": "0.5157093", "text": "func TestProtoVisNinGoGoOptUint128AsBytes(t *testing.T) {\n\ttestProtoGoGo{\n\t\tmsg: gogovisNinOptUint128AsBytes,\n\t\tnewMsg: newGoGoProtoNinOptUint128AsBytes,\n\t}.test(t)\n}", "title": "" }, { "docid": "c867d882d3321079c7c645b92c525cb2", "score": "0.5145913", "text": "func UInt256FromUInt64(v uint64) UInt256 {\n\treturn UInt256{Low: UInt128{Low: v}}\n}", "title": "" }, { "docid": "8ef5bc9a2d56f784b4003b849b4eec18", "score": "0.51458865", "text": "func TestProtoVimNidGoGoToGoOptUint128AsBytes(t *testing.T) {\n\ttestProtoGoGoToGo{\n\t\tgogomsg: gogovimNidOptUint128AsBytes,\n\t\tnewGomsg: newGoProtoNidOptUint128AsBytes,\n\t\tgomsg: gozeroOptUint128AsBytes,\n\t\tvis: false,\n\t}.test(t)\n}", "title": "" }, { "docid": "1a201677b1ab769ac60004bd3f323030", "score": "0.5123623", "text": "func rand(i int) uint32 {\n\ti = i + 10000\n\ti = i ^ (i << 16)\n\ti = (i >> 5) ^ i\n\treturn uint32(i & 0xFF)\n}", "title": "" }, { "docid": "246fd10718de8302287142296b080229", "score": "0.5119102", "text": "func opUI32Rand(prgrm *ast.CXProgram, inputs []ast.CXValue, outputs []ast.CXValue) {\n\toutV0 := rand.Uint32()\n\toutputs[0].Set_ui32(prgrm, outV0)\n}", "title": "" }, { "docid": "c78c5eb7b728ffb418c06effbdcab03c", "score": "0.5117645", "text": "func nextRandom(rand *uint64) uint64 {\n\t*rand += uint64(0x9e3779b97f4a7c15)\n\tvar z = *rand\n\tz = (z ^ (z >> 30)) * 0xbf58476d1ce4e5b9\n\tz = (z ^ (z >> 27)) * 0x94d049bb133111eb\n\treturn z ^ (z >> 31)\n}", "title": "" }, { "docid": "0c153f774344a53df8fc47167f25dcdd", "score": "0.5097367", "text": "func TestProtoVimNinGoToGoGoRepUint128AsBytes(t *testing.T) {\n\ttestProtoGoToGoGo{\n\t\tgomsg: govimNinRepUint128AsBytes,\n\t\tnewGogomsg: newGoGoProtoNinRepUint128AsBytes,\n\t\tgogomsg: gogovimNinRepUint128AsBytes,\n\t}.test(t)\n}", "title": "" }, { "docid": "1312eddcc9afc62423ee5c79666d54c7", "score": "0.507518", "text": "func opUI16Rand(expr *CXExpression, fp int) {\n\toutV0 := uint16(rand.Int31n(int32(math.MaxUint16)))\n\tWriteUI16(GetOffset_ui16(fp, expr.Outputs[0]), outV0)\n}", "title": "" }, { "docid": "617c9eb6148733e380908cdc99f4ee4d", "score": "0.5061916", "text": "func TestProtoVisNinGoToGoGoRepUint128AsBytes(t *testing.T) {\n\ttestProtoGoToGoGo{\n\t\tgomsg: govisNinRepUint128AsBytes,\n\t\tnewGogomsg: newGoGoProtoNinRepUint128AsBytes,\n\t\tgogomsg: gogovisNinRepUint128AsBytes,\n\t}.test(t)\n}", "title": "" }, { "docid": "d99d8c056a53d45e7b8b4d28bb0b2be7", "score": "0.5054434", "text": "func FromInts(hi uint64, V1 uint64) Uint128 {\n\treturn Uint128{hi, V1}\n}", "title": "" }, { "docid": "6d4859c968c7f33bb7c82462d0c69554", "score": "0.5024814", "text": "func TestProtoVimNinGoToGoGoOptUint128AsBytes(t *testing.T) {\n\ttestProtoGoToGoGo{\n\t\tgomsg: govimNinOptUint128AsBytes,\n\t\tnewGogomsg: newGoGoProtoNinOptUint128AsBytes,\n\t\tgogomsg: gogovimNinOptUint128AsBytes,\n\t}.test(t)\n}", "title": "" }, { "docid": "3a412e8b0db0109128c3258f05c0dd59", "score": "0.4990876", "text": "func TestProtoVisNinGoToGoGoOptUint128AsBytes(t *testing.T) {\n\ttestProtoGoToGoGo{\n\t\tgomsg: govisNinOptUint128AsBytes,\n\t\tnewGogomsg: newGoGoProtoNinOptUint128AsBytes,\n\t\tgogomsg: gogovisNinOptUint128AsBytes,\n\t}.test(t)\n}", "title": "" }, { "docid": "168f2c043ef7d8e0d1190110d92e0220", "score": "0.49864733", "text": "func TestProtoVisNidGoGoToGoOptUint128AsBytes(t *testing.T) {\n\ttestProtoGoGoToGo{\n\t\tgogomsg: gogovisNidOptUint128AsBytes,\n\t\tnewGomsg: newGoProtoNidOptUint128AsBytes,\n\t\tgomsg: govisNidOptUint128AsBytes,\n\t\tvis: true,\n\t}.test(t)\n}", "title": "" }, { "docid": "b6b07d69062c27e945a71a6997baf31e", "score": "0.49749377", "text": "func TestProtoVimNinGoGoToGoRepUint128AsBytes(t *testing.T) {\n\ttestProtoGoGoToGo{\n\t\tgogomsg: gogovimNinRepUint128AsBytes,\n\t\tnewGomsg: newGoProtoNinRepUint128AsBytes,\n\t\tgomsg: govimNinRepUint128AsBytes,\n\t\tvis: false,\n\t}.test(t)\n}", "title": "" }, { "docid": "6b874c26f3d0b40ca1bf76e6e20251b9", "score": "0.49666244", "text": "func TestProtoVimNinGoGoToGoOptUint128AsBytes(t *testing.T) {\n\ttestProtoGoGoToGo{\n\t\tgogomsg: gogovimNinOptUint128AsBytes,\n\t\tnewGomsg: newGoProtoNinOptUint128AsBytes,\n\t\tgomsg: govimNinOptUint128AsBytes,\n\t\tvis: false,\n\t}.test(t)\n}", "title": "" }, { "docid": "293edf3bc10847c36fc5a6786372aafc", "score": "0.4955475", "text": "func randomHex() uint8 {\n\tbytes := make([]byte, 1)\n\trand.Read(bytes)\n\n\treturn uint8(rand.Int())\n}", "title": "" }, { "docid": "3666ca36910bc50d621b9bd02a19319a", "score": "0.4950615", "text": "func TestProtoVisNidGoGoToGoRepUint128AsBytes(t *testing.T) {\n\ttestProtoGoGoToGo{\n\t\tgogomsg: gogovisNidRepUint128AsBytes,\n\t\tnewGomsg: newGoProtoNidRepUint128AsBytes,\n\t\tgomsg: govisNidRepUint128AsBytes,\n\t\tvis: true,\n\t}.test(t)\n}", "title": "" }, { "docid": "673fef00c9488b2cd4ff5a6cd367e040", "score": "0.4948862", "text": "func randuint64n(rnd random.Interface, n uint64) uint64 {\n\tmask := ^uint64(0)\n\tfor mask > n {\n\t\tmask >>= 1\n\t}\n\tmask = (mask << 1) | uint64(1)\n\n\tfor {\n\t\tr := randuint64(rnd) & mask\n\t\tif r < n {\n\t\t\treturn r\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c9b15404433c1d5b581de3f3e3f27b43", "score": "0.49387988", "text": "func (u *Uint128) Mul(x *Uint128) (*Uint128, error) {\n\tobj := &Uint128{new(big.Int).Mul(u.value, x.value)}\n\tif err := obj.Validate(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn obj, nil\n}", "title": "" }, { "docid": "54baeaf85da470a4eed5435b339406b7", "score": "0.49384794", "text": "func NewConMapUintComplex128() *ConMapUintComplex128 {\n\treturn ToConMapUintComplex128(nil)\n}", "title": "" }, { "docid": "f808f654ed94369ebe4cf60fedf0447b", "score": "0.49235356", "text": "func Hex128(uuid [24]byte) string {\n\tb := make([]byte, 36)\n\thex.Encode(b[0:8], uuid[0:4])\n\tb[8] = '-'\n\thex.Encode(b[9:13], uuid[4:6])\n\tb[13] = '-'\n\thex.Encode(b[14:18], uuid[6:8])\n\tb[18] = '-'\n\thex.Encode(b[19:23], uuid[8:10])\n\tb[23] = '-'\n\thex.Encode(b[24:], uuid[10:16])\n\treturn string(b)\n}", "title": "" }, { "docid": "89fa944d939c6b1c6e5832c19a18ce78", "score": "0.4888991", "text": "func (u ScVal) MustU128() UInt128Parts {\n\tval, ok := u.GetU128()\n\n\tif !ok {\n\t\tpanic(\"arm U128 is not set\")\n\t}\n\n\treturn val\n}", "title": "" }, { "docid": "6eae8949462f07aa5c222956b606bbe0", "score": "0.4871679", "text": "func (u Uint128) AsUint64() uint64 {\n\treturn u.lo\n}", "title": "" }, { "docid": "6de0206e0add57b2fbddeb76b676fdab", "score": "0.48635224", "text": "func Random() uint64 {\n\treturn uint64(rand.Int63())\n}", "title": "" }, { "docid": "aaf05d81f6cc86b19d315edb667ff50e", "score": "0.48472348", "text": "func (s *Xor64Source) Uint64() uint64 {\n\treturn s.next()\n}", "title": "" }, { "docid": "292e99286b610530574c7f2f62c474b7", "score": "0.48405287", "text": "func Uint64() uint64 {\n\tif insideSandbox {\n\t\treturn sandboxRand.Uint64()\n\t}\n\treturn rand.Uint64()\n}", "title": "" }, { "docid": "68ad71352f86c0e0829789c93a80a8aa", "score": "0.48333704", "text": "func Uint32() uint32 {\n\tv := rngPool.Get()\n\tr := v.(*RNG)\n\tx := r.Uint32()\n\trngPool.Put(r)\n\treturn x\n}", "title": "" } ]
843a8de4ca6981eea8f77cbccece4437
Deprecated: Use ResourcePolicyAggregatedList.ProtoReflect.Descriptor instead.
[ { "docid": "0aa18174836456be8ac54a0da1369227", "score": "0.7630969", "text": "func (*ResourcePolicyAggregatedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{411}\n}", "title": "" } ]
[ { "docid": "cdfde977405c1b36c2d729ab4ec7859d", "score": "0.7313244", "text": "func (*AggregatedListResourcePoliciesRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{983}\n}", "title": "" }, { "docid": "7c73a482e96d1219d5b3525e4340f84b", "score": "0.7254546", "text": "func (*ResourcePoliciesScopedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{406}\n}", "title": "" }, { "docid": "217f5fd1d79f57e240ddf41ed950298f", "score": "0.7250125", "text": "func (*ResourcePolicyList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{415}\n}", "title": "" }, { "docid": "cdcb6377896705b99d31de2249b6e4bf", "score": "0.6973271", "text": "func (*ListResourcePoliciesRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{988}\n}", "title": "" }, { "docid": "7ae96f626b35dd9a89873833cc891c4a", "score": "0.69728756", "text": "func (*ResourcePolicy) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{405}\n}", "title": "" }, { "docid": "eba83c37ea812be009b7868d4e60fbf0", "score": "0.67983586", "text": "func (*ListAssociationsFirewallPolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{619}\n}", "title": "" }, { "docid": "9291697601f16042ce63956275bddc5a", "score": "0.6795964", "text": "func (*FirewallPolicyList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{115}\n}", "title": "" }, { "docid": "bb82e0955c532fe505e06b9b5d0df143", "score": "0.6783552", "text": "func (*OperationAggregatedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{335}\n}", "title": "" }, { "docid": "120f80be02113a5791c5d3c620c69365", "score": "0.67530715", "text": "func (*ForwardingRuleAggregatedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{122}\n}", "title": "" }, { "docid": "a3224d3aadd9a3d80fa9e4dbb00054db", "score": "0.6709135", "text": "func (*ListFirewallPoliciesRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{618}\n}", "title": "" }, { "docid": "68da691860b33fe65cdd8653b44779c3", "score": "0.670028", "text": "func (*Policy) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{129}\n}", "title": "" }, { "docid": "b1b909b4946452f6eb0e50dfd8d47681", "score": "0.66999626", "text": "func (*GetResourcePolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{985}\n}", "title": "" }, { "docid": "bce97cd0fa5cd16eb06103aeb604e726", "score": "0.6693313", "text": "func (*FirewallPolicy) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{114}\n}", "title": "" }, { "docid": "7656ff280d85d3136fc3245fd0fb5a07", "score": "0.66920274", "text": "func (*AutoscalersScopedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{30}\n}", "title": "" }, { "docid": "af85dea08ba1d01ac36ee8d9bf193e53", "score": "0.6686559", "text": "func (ResourcePolicy_Status) EnumDescriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{405, 0}\n}", "title": "" }, { "docid": "9783e5b0e3be2c07ec1529b66e472a9c", "score": "0.66663", "text": "func (*GetIamPolicyResourcePolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{986}\n}", "title": "" }, { "docid": "267daa940ba94deee744d56d3c298cf8", "score": "0.66311395", "text": "func (*ListPoliciesRequest) Descriptor() ([]byte, []int) {\n\treturn file_gincoinc_adamant_global_v1_adamantglobalv1_global_api_proto_rawDescGZIP(), []int{159}\n}", "title": "" }, { "docid": "3b1a13253ac24f6124aa99e3e0f006fa", "score": "0.66101456", "text": "func (*Policy) Descriptor() ([]byte, []int) {\n\treturn file_external_iam_v2_common_policy_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "512b6c3fe3146e0c54bd1b42efe0f1ae", "score": "0.66078186", "text": "func (*DeleteResourcePolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{984}\n}", "title": "" }, { "docid": "28916fdc9788fe9cf7fcccba0f1dabcc", "score": "0.6606221", "text": "func (*ResourcePolicyResourceStatus) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{409}\n}", "title": "" }, { "docid": "391d6139453390df5b35431d87fbbd02", "score": "0.6605414", "text": "func (*NetworkEndpointGroupAggregatedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{294}\n}", "title": "" }, { "docid": "913a172702046ae7c338dd3ed6f4599f", "score": "0.6591816", "text": "func (*AddResourcePoliciesInstanceRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{729}\n}", "title": "" }, { "docid": "bd533dbe2c84a1af23054f5be1638d2f", "score": "0.65830064", "text": "func (*GetFirewallPolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{613}\n}", "title": "" }, { "docid": "c7139eee0d3a5e9b2d594e6620bcd687", "score": "0.65825284", "text": "func (*TargetHttpsProxyAggregatedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{486}\n}", "title": "" }, { "docid": "8cb6a3e22f5fabf5c27f505055acb7b7", "score": "0.6569024", "text": "func (*VpnTunnelAggregatedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{545}\n}", "title": "" }, { "docid": "69536a8089c1386bcbeb517f1587f346", "score": "0.65590733", "text": "func (*SubnetworkAggregatedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{472}\n}", "title": "" }, { "docid": "c44c19f08620122d89d6795fd294b500", "score": "0.65586644", "text": "func (*PatchFirewallPolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{621}\n}", "title": "" }, { "docid": "401d842288a13d71f4d321183833d6c1", "score": "0.6545043", "text": "func (*AutoscalerAggregatedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{31}\n}", "title": "" }, { "docid": "0c56c51fa0e929dd0f88375b1d062ab0", "score": "0.65360785", "text": "func (*BackendServiceAggregatedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{57}\n}", "title": "" }, { "docid": "54876c6c064a7affbc74f9870d8a4efa", "score": "0.65328014", "text": "func (*FirewallPolicyAssociation) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{111}\n}", "title": "" }, { "docid": "c3bcf1eaf5954f342fc739517ae28950", "score": "0.6528756", "text": "func (*AddRuleFirewallPolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{610}\n}", "title": "" }, { "docid": "164611862f108303cda3f569c24ce202", "score": "0.65192914", "text": "func (*GetAssociationFirewallPolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{614}\n}", "title": "" }, { "docid": "82fa58921ab95498242fbec5e4fc2f8f", "score": "0.6517701", "text": "func (*AddAssociationFirewallPolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{609}\n}", "title": "" }, { "docid": "56720ee12eed7a52a33b5fd9f7501aa7", "score": "0.65053165", "text": "func (*VpnGatewayAggregatedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{536}\n}", "title": "" }, { "docid": "78549d156bd5afbaa70b659063043430", "score": "0.6500195", "text": "func (*PatchRuleFirewallPolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{622}\n}", "title": "" }, { "docid": "23ca263316947b3ff5d14bc053838f42", "score": "0.6495831", "text": "func (*UpdateAuthorizationPolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_networksecurity_v1beta1_authorization_policy_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "94b92ff4e33af66fbd981a6239864233", "score": "0.6495158", "text": "func (*ResourcePolicySnapshotSchedulePolicy) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{410}\n}", "title": "" }, { "docid": "de96aeb480651ba0c6522f73e9964832", "score": "0.6492177", "text": "func (*RateLimitPolicy) Descriptor() ([]byte, []int) {\n\treturn file_ratelimit_config_ratelimit_v3_rls_conf_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "340cf56711139472bc7b3dfadb6305c4", "score": "0.64909285", "text": "func (*GetRuleFirewallPolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{616}\n}", "title": "" }, { "docid": "770ca23e97fb0e99e01861bf1e4619d7", "score": "0.6482287", "text": "func (*GetIamPolicyFirewallPolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{615}\n}", "title": "" }, { "docid": "54101de149350176837cbf0be665f652", "score": "0.6480615", "text": "func (*InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{234}\n}", "title": "" }, { "docid": "c860535e4dd5b6361bbef071702b1d43", "score": "0.6476917", "text": "func (*OperationsScopedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{334}\n}", "title": "" }, { "docid": "543e07321b95a60d839b02f992a0025a", "score": "0.6476058", "text": "func (*SecurityPolicyList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{446}\n}", "title": "" }, { "docid": "5e48603ef97952e72156feac859c6cd2", "score": "0.64751166", "text": "func (*SetIamPolicyResourcePolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{989}\n}", "title": "" }, { "docid": "33e4ac1406c83edbe6756b2511bf0047", "score": "0.6474626", "text": "func (*TargetHttpProxyAggregatedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{480}\n}", "title": "" }, { "docid": "2534244527c0793b9145793036e07102", "score": "0.6473365", "text": "func (*TargetVpnGatewayAggregatedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{513}\n}", "title": "" }, { "docid": "2a90982154bf7e3135eaca0ba34dafa2", "score": "0.64716196", "text": "func (SslPolicy_MinTlsVersion) EnumDescriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{462, 0}\n}", "title": "" }, { "docid": "1c43bf19d76e27e539ae60c548b4787b", "score": "0.6470799", "text": "func (*AuthorizationPolicy) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_networksecurity_v1beta1_authorization_policy_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "c41c7cc6add8756bce3817363bd81b59", "score": "0.64690226", "text": "func (*ReservationAggregatedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{401}\n}", "title": "" }, { "docid": "9d40b67ebc07089a2e23f06e28721daf", "score": "0.64673746", "text": "func (*InstancesAddResourcePoliciesRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{233}\n}", "title": "" }, { "docid": "4dfaf5d4f9d2201c1ea15abbf0399563", "score": "0.64532936", "text": "func (*DeletePolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_gincoinc_adamant_global_v1_adamantglobalv1_global_api_proto_rawDescGZIP(), []int{170}\n}", "title": "" }, { "docid": "3cd3217138a3f3bbf1448b17bc1f13ba", "score": "0.64496744", "text": "func (*GetPolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_gincoinc_adamant_global_v1_adamantglobalv1_global_api_proto_rawDescGZIP(), []int{158}\n}", "title": "" }, { "docid": "ab9c0a9763369903e8b3a87f1d8c39d0", "score": "0.64470756", "text": "func (*ListSubscriptionsRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_pubsub_v1beta2_pubsub_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "33eddc4788744adb6423bb0ab0b9e5a1", "score": "0.6427046", "text": "func (*DeleteFirewallPolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{612}\n}", "title": "" }, { "docid": "3018f525b974e87675a946cb910a3563", "score": "0.64244425", "text": "func (*SslCertificateAggregatedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{460}\n}", "title": "" }, { "docid": "4d1367f6a79e2eb190598e9c4a017189", "score": "0.64176655", "text": "func (*ResourcePolicySnapshotSchedulePolicyRetentionPolicy) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{417}\n}", "title": "" }, { "docid": "e9642c6f86f5e1553126ff686f1700b1", "score": "0.64155716", "text": "func (*RoutersScopedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{430}\n}", "title": "" }, { "docid": "2d1117c808121cfe96ada1a6005e72d9", "score": "0.6415183", "text": "func (*ResourcePolicyGroupPlacementPolicy) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{407}\n}", "title": "" }, { "docid": "4a8db3f93f5523312a691efc447e69b7", "score": "0.6412736", "text": "func (*DisksAddResourcePoliciesRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{94}\n}", "title": "" }, { "docid": "fdd14fdca20b6d943d0d4f415502b0d7", "score": "0.64121044", "text": "func (*PublicDelegatedPrefixAggregatedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{368}\n}", "title": "" }, { "docid": "0aac359adf83f245773f5ce9db71ab6f", "score": "0.6409769", "text": "func (*PacketMirroringAggregatedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{343}\n}", "title": "" }, { "docid": "63281bb8b65ea7f413ba797415c6aea0", "score": "0.6405533", "text": "func (*TargetVpnGatewaysScopedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{512}\n}", "title": "" }, { "docid": "ffd19e9195361054ebdd95a958b1e3fe", "score": "0.64034104", "text": "func (*RouterAggregatedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{431}\n}", "title": "" }, { "docid": "1f3c14f221e993f95951607fa2e6d25b", "score": "0.6400531", "text": "func (*VpnGatewaysScopedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{535}\n}", "title": "" }, { "docid": "1fe12aa1f0ac947d95194d5932056a1c", "score": "0.6400032", "text": "func (*SecurityPolicy) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{445}\n}", "title": "" }, { "docid": "b0407f4aada0984429b9f0a2a43b2d74", "score": "0.63991684", "text": "func (*NetworkEndpointGroupsScopedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{293}\n}", "title": "" }, { "docid": "ed3291e673035ea26a908090c19e0c59", "score": "0.63973755", "text": "func (*AggregatedListVpnGatewaysRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1111}\n}", "title": "" }, { "docid": "d1a74497174186148e571180fdd8ff09", "score": "0.6397303", "text": "func (*DevicePolicy) Descriptor() ([]byte, []int) {\n\treturn file_google_identity_accesscontextmanager_v1_access_level_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "f01b92287ad969a385c21b0ed52ccabb", "score": "0.63894206", "text": "func (*SecurityPolicyReference) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{447}\n}", "title": "" }, { "docid": "199dc61cc0a74cbd4405bd5b136d46e3", "score": "0.6387239", "text": "func (*AddPolicyRes) Descriptor() ([]byte, []int) {\n\treturn file_auth_proto_rawDescGZIP(), []int{11}\n}", "title": "" }, { "docid": "c75e0af4bc3c06f07072456e61101f26", "score": "0.63853", "text": "func (*GetAuthorizationPolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_networksecurity_v1beta1_authorization_policy_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "4d5dff02368f60a986014850ba9fe7a6", "score": "0.6376562", "text": "func (*InstanceGroupManagerUpdatePolicy) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{191}\n}", "title": "" }, { "docid": "6844714c1d91881514d34241ddf301f6", "score": "0.6375467", "text": "func (*ResourcePolicyInstanceSchedulePolicy) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{408}\n}", "title": "" }, { "docid": "60f326fc90a57858a8e8e8c2079e9e21", "score": "0.63721293", "text": "func (*RemoveRuleFirewallPolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{624}\n}", "title": "" }, { "docid": "b6cfecbbbec392001e4c2060786a1e88", "score": "0.63696176", "text": "func (*UpdatePolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_gincoinc_adamant_global_v1_adamantglobalv1_global_api_proto_rawDescGZIP(), []int{169}\n}", "title": "" }, { "docid": "7722509ee6a090cc3075d4a9a46ee6fa", "score": "0.6363047", "text": "func (*InsertResourcePolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{987}\n}", "title": "" }, { "docid": "3e447a58ca8956fee4c64d518dbd3548", "score": "0.63619393", "text": "func (*ListPoliciesRes) Descriptor() ([]byte, []int) {\n\treturn file_auth_proto_rawDescGZIP(), []int{15}\n}", "title": "" }, { "docid": "02b69569eea5da073004d61e59d59e30", "score": "0.6361619", "text": "func (*InstanceGroupAggregatedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{185}\n}", "title": "" }, { "docid": "bfc208bb829e6ac8c7faa2039d0f10f8", "score": "0.6359858", "text": "func (*NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{303}\n}", "title": "" }, { "docid": "bd422b0adad6181bc71fae5111a723fe", "score": "0.63589525", "text": "func (*DeleteAuthorizationPolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_networksecurity_v1beta1_authorization_policy_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "c21611c16a15ece9cdea2c2863f8b28d", "score": "0.635696", "text": "func (*InstanceAggregatedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{181}\n}", "title": "" }, { "docid": "a7f5d54d1945a986ccd527194f4969c3", "score": "0.6354729", "text": "func (*ForwardingRulesScopedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{121}\n}", "title": "" }, { "docid": "68eefd3143c5ee8c7b6b5581c9d16b98", "score": "0.6353876", "text": "func (SecurityPolicyRuleMatcher_VersionedExpr) EnumDescriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{448, 0}\n}", "title": "" }, { "docid": "581398e9ad071303b92b9e1ed768862d", "score": "0.63518995", "text": "func (*ListSecurityPoliciesRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1010}\n}", "title": "" }, { "docid": "92496aa9603423e41d1062315a4bc863", "score": "0.634898", "text": "func (*NodeGroupAggregatedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{311}\n}", "title": "" }, { "docid": "2a2f10546500a0ce2af1f93c2eb05b5f", "score": "0.6347967", "text": "func (*RemoveAssociationFirewallPolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{623}\n}", "title": "" }, { "docid": "4b831ad1a3f114359f641bf36fc9f84e", "score": "0.63439006", "text": "func (*TargetInstanceAggregatedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{490}\n}", "title": "" }, { "docid": "ffc5d17d2f3b97661136a26cf34124ea", "score": "0.63424915", "text": "func (*ListAuthorizationPoliciesRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_networksecurity_v1beta1_authorization_policy_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "86fca521b5b541c11dd2925ce9c13f6f", "score": "0.6341494", "text": "func (NodeGroup_MaintenancePolicy) EnumDescriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{309, 0}\n}", "title": "" }, { "docid": "cc74dedb4901d0e4896a2390d03d23f7", "score": "0.6338259", "text": "func (*DistributionPolicy) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{99}\n}", "title": "" }, { "docid": "90150dab7746595ad2db6241f5226067", "score": "0.633628", "text": "func (*AcceleratorTypeAggregatedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "50bbdfc361de0812864ac42c3a8239fe", "score": "0.633587", "text": "func (*StatefulPolicy) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{189}\n}", "title": "" }, { "docid": "52dbcd8f12ca09cae49c7bca34863180", "score": "0.6333531", "text": "func (*AggregatedListAutoscalersRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{561}\n}", "title": "" }, { "docid": "1c8cbd561b0db1930081d71f0864a6f5", "score": "0.6326386", "text": "func (*TestIamPermissionsResourcePolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{990}\n}", "title": "" }, { "docid": "4077ed1a97656c54d88d4a5e703f817a", "score": "0.63239384", "text": "func (*ListPoliciesResponse) Descriptor() ([]byte, []int) {\n\treturn file_gincoinc_adamant_global_v1_adamantglobalv1_global_api_proto_rawDescGZIP(), []int{168}\n}", "title": "" }, { "docid": "9157d1c20a6c1c9d80e88fcd83b63d6a", "score": "0.6323723", "text": "func (*InstancesRemoveResourcePoliciesRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{236}\n}", "title": "" }, { "docid": "3d3b43da03253d9c78665f771609863b", "score": "0.6319073", "text": "func (*TargetPoolAggregatedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{494}\n}", "title": "" }, { "docid": "fa6d3620841cfdf1312c59dea043c147", "score": "0.6316201", "text": "func (*SecurityPolicyRule) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{444}\n}", "title": "" }, { "docid": "89ec259f00a1ad6a757fc2a594345639", "score": "0.6313902", "text": "func (HealthCheckService_HealthStatusAggregationPolicy) EnumDescriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{145, 0}\n}", "title": "" }, { "docid": "9fcd6a0a7ca7d6307f2c8f46ec7fd678", "score": "0.63112986", "text": "func (*SetIamPolicyFirewallPolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{625}\n}", "title": "" } ]
9647b873210526979d097a3177472b54
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be nonnil.
[ { "docid": "1a7539e655706b82d90af7e2d241f858", "score": "0.0", "text": "func (in *VpcEndpointSubnetAssociationSpec) DeepCopyInto(out *VpcEndpointSubnetAssociationSpec) {\n\t*out = *in\n\tin.ResourceSpec.DeepCopyInto(&out.ResourceSpec)\n\tout.ForProvider = in.ForProvider\n}", "title": "" } ]
[ { "docid": "854825ecc9cd3a0495a19df5509c3c2f", "score": "0.82257444", "text": "func (in *Memory) DeepCopyInto(out *Memory) {\n\t*out = *in\n}", "title": "" }, { "docid": "760357bc14dbd63f0878759aca969b71", "score": "0.81376606", "text": "func (in *Output) DeepCopyInto(out *Output) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "7301f5678de7282507f88cf56a8f5020", "score": "0.81188333", "text": "func (in *Version) DeepCopyInto(out *Version) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "477d12977ccedc720e9eeed2cceef4ad", "score": "0.8085144", "text": "func (in *Parser) DeepCopyInto(out *Parser) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "9277508c6f4a9eb94b5bc53225b87fd6", "score": "0.8064722", "text": "func (in *Size) DeepCopyInto(out *Size) {\n\t*out = *in\n}", "title": "" }, { "docid": "71f7571eb16269b8ded7102013eb2fcb", "score": "0.8058729", "text": "func (in *TargetObj) DeepCopyInto(out *TargetObj) {\n\t*out = *in\n}", "title": "" }, { "docid": "bf7b4b522057ae01ab0d93d4522fe30a", "score": "0.80479336", "text": "func (in *ObjectRef) DeepCopyInto(out *ObjectRef) {\n\t*out = *in\n}", "title": "" }, { "docid": "bf7b4b522057ae01ab0d93d4522fe30a", "score": "0.80479336", "text": "func (in *ObjectRef) DeepCopyInto(out *ObjectRef) {\n\t*out = *in\n}", "title": "" }, { "docid": "30d5a6805fd4fa1a057ce4497fc7b0ff", "score": "0.80342454", "text": "func (in *Build) DeepCopyInto(out *Build) {\n\t*out = *in\n}", "title": "" }, { "docid": "bd31f739afee4d8ac0f25b43cee7cdf6", "score": "0.8032005", "text": "func (in *Jmx) DeepCopyInto(out *Jmx) {\n\t*out = *in\n}", "title": "" }, { "docid": "8e8acfb208833240003e7bd04991a6fd", "score": "0.8022911", "text": "func (in *Res) DeepCopyInto(out *Res) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "45607a53c4ae582710d113a58be4b5ca", "score": "0.80223733", "text": "func (in *BackupInvokerRef) DeepCopyInto(out *BackupInvokerRef) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "cdb1b110aa6c8f15da6e580e063891b8", "score": "0.8006015", "text": "func (in *InputParser) DeepCopyInto(out *InputParser) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "fe843f24d377bc345c3c2bafc6836e50", "score": "0.7999529", "text": "func (in *LDAPCheck) DeepCopyInto(out *LDAPCheck) {\n\t*out = *in\n}", "title": "" }, { "docid": "a79d310025d9bad0312cdb9615f67da0", "score": "0.7996956", "text": "func (in *InferenceTarget) DeepCopyInto(out *InferenceTarget) {\n\t*out = *in\n}", "title": "" }, { "docid": "32411e48b0c41369a3b37f1f34c69604", "score": "0.79760677", "text": "func (in *Heapster) DeepCopyInto(out *Heapster) {\n\t*out = *in\n\tout.Addon = in.Addon\n\treturn\n}", "title": "" }, { "docid": "15fc36816a874df726f7daacda88349f", "score": "0.79754645", "text": "func (in *DataPath) DeepCopyInto(out *DataPath) {\n\t*out = *in\n}", "title": "" }, { "docid": "73b3e2ee8d0f1c30554fc6f775e42f09", "score": "0.79680604", "text": "func (in *Hazelcast) DeepCopyInto(out *Hazelcast) {\n\t*out = *in\n}", "title": "" }, { "docid": "acbc3f1efee5aaa8d03be05054421061", "score": "0.7967311", "text": "func (in *Backup) DeepCopyInto(out *Backup) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "7b25b696e89f23360fd8f34af49816dc", "score": "0.7962411", "text": "func (in *RestoreTarget) DeepCopyInto(out *RestoreTarget) {\n\t*out = *in\n\tout.Ref = in.Ref\n\tif in.VolumeMounts != nil {\n\t\tin, out := &in.VolumeMounts, &out.VolumeMounts\n\t\t*out = make([]corev1.VolumeMount, len(*in))\n\t\tfor i := range *in {\n\t\t\t(*in)[i].DeepCopyInto(&(*out)[i])\n\t\t}\n\t}\n\tif in.Replicas != nil {\n\t\tin, out := &in.Replicas, &out.Replicas\n\t\t*out = new(int32)\n\t\t**out = **in\n\t}\n\tif in.VolumeClaimTemplates != nil {\n\t\tin, out := &in.VolumeClaimTemplates, &out.VolumeClaimTemplates\n\t\t*out = make([]offshootapiapiv1.PersistentVolumeClaim, len(*in))\n\t\tfor i := range *in {\n\t\t\t(*in)[i].DeepCopyInto(&(*out)[i])\n\t\t}\n\t}\n\tif in.Rules != nil {\n\t\tin, out := &in.Rules, &out.Rules\n\t\t*out = make([]Rule, len(*in))\n\t\tfor i := range *in {\n\t\t\t(*in)[i].DeepCopyInto(&(*out)[i])\n\t\t}\n\t}\n\tif in.Args != nil {\n\t\tin, out := &in.Args, &out.Args\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\treturn\n}", "title": "" }, { "docid": "fe55aea8bcbb4c5fb7ce8689ae5b50db", "score": "0.7958489", "text": "func (in *OTLP) DeepCopyInto(out *OTLP) {\n\t*out = *in\n}", "title": "" }, { "docid": "4cc4474c2a1333bf5f947b2294d0b027", "score": "0.7952579", "text": "func (in *Interface) DeepCopyInto(out *Interface) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "3c51337658fc0e9d2966273bd3459022", "score": "0.7945754", "text": "func (in *ObjectReference) DeepCopyInto(out *ObjectReference) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "3c51337658fc0e9d2966273bd3459022", "score": "0.7945754", "text": "func (in *ObjectReference) DeepCopyInto(out *ObjectReference) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "3c51337658fc0e9d2966273bd3459022", "score": "0.7945754", "text": "func (in *ObjectReference) DeepCopyInto(out *ObjectReference) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "0919c719fbed6afefb28478852255757", "score": "0.79450506", "text": "func (in *VfInfo) DeepCopyInto(out *VfInfo) {\n\t*out = *in\n}", "title": "" }, { "docid": "ffd1a2a762b20e39ec3e229a7fa8c82d", "score": "0.79428315", "text": "func (in *Toleration) DeepCopyInto(out *Toleration) {\n\t*out = *in\n}", "title": "" }, { "docid": "92bd0f9f52c488e2823218fc03f28117", "score": "0.7942668", "text": "func (in *CrossVersionObjectReference) DeepCopyInto(out *CrossVersionObjectReference) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "92bd0f9f52c488e2823218fc03f28117", "score": "0.7942668", "text": "func (in *CrossVersionObjectReference) DeepCopyInto(out *CrossVersionObjectReference) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "f254b9a7e0b67c245be45d8e4adaf4be", "score": "0.7936731", "text": "func (in *ContainerPort) DeepCopyInto(out *ContainerPort) {\n\t*out = *in\n}", "title": "" }, { "docid": "f254b9a7e0b67c245be45d8e4adaf4be", "score": "0.7936731", "text": "func (in *ContainerPort) DeepCopyInto(out *ContainerPort) {\n\t*out = *in\n}", "title": "" }, { "docid": "01a4a6fa60275bc00731594653970844", "score": "0.793288", "text": "func (in *ObjectStorageTLSSpec) DeepCopyInto(out *ObjectStorageTLSSpec) {\n\t*out = *in\n}", "title": "" }, { "docid": "ae8320d666daf42f7b276f91c508dfdb", "score": "0.7930093", "text": "func (in *File) DeepCopyInto(out *File) {\n\t*out = *in\n}", "title": "" }, { "docid": "5d6676976741906b273edf03cf097f8d", "score": "0.791365", "text": "func (in *Identity) DeepCopyInto(out *Identity) {\n\t*out = *in\n}", "title": "" }, { "docid": "e7824965b786de83e5edd7c40c1905bd", "score": "0.7911581", "text": "func (in *Cache) DeepCopyInto(out *Cache) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "c06114d198782896449be1949d23d234", "score": "0.7907547", "text": "func (in *IoPerf) DeepCopyInto(out *IoPerf) {\n\t*out = *in\n}", "title": "" }, { "docid": "c615a020c64c11406e2c550e7ecaef60", "score": "0.7903731", "text": "func (in *DingTalk) DeepCopyInto(out *DingTalk) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "b7393f65fb4d2df141f42b8c195d3860", "score": "0.79024917", "text": "func (in *CanaryResult) DeepCopyInto(out *CanaryResult) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "af229d6e46b09920288a05ff27f2055f", "score": "0.7902033", "text": "func (in *Instance) DeepCopyInto(out *Instance) {\n\t*out = *in\n}", "title": "" }, { "docid": "d7c721157968f6bd706d0455330c4026", "score": "0.78964335", "text": "func (in *TCPCheck) DeepCopyInto(out *TCPCheck) {\n\t*out = *in\n}", "title": "" }, { "docid": "778b99573503a518fafd03683f65a07e", "score": "0.78956455", "text": "func (in *KMSEncryptionAlibaba) DeepCopyInto(out *KMSEncryptionAlibaba) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "f2e09bb7e9a17cc1e32f0d15d54b1922", "score": "0.7894656", "text": "func (in *NodeResult) DeepCopyInto(out *NodeResult) {\n\t*out = *in\n\tif in.Observations != nil {\n\t\tin, out := &in.Observations, &out.Observations\n\t\t*out = make([]Observation, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\treturn\n}", "title": "" }, { "docid": "f2e09bb7e9a17cc1e32f0d15d54b1922", "score": "0.7894656", "text": "func (in *NodeResult) DeepCopyInto(out *NodeResult) {\n\t*out = *in\n\tif in.Observations != nil {\n\t\tin, out := &in.Observations, &out.Observations\n\t\t*out = make([]Observation, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\treturn\n}", "title": "" }, { "docid": "06a3b3f38b6ff0617d4968300458ec9c", "score": "0.789431", "text": "func (in *Disk) DeepCopyInto(out *Disk) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "dddf435977ebcd6bfaf0b4c062ea8042", "score": "0.7889831", "text": "func (in *Image) DeepCopyInto(out *Image) {\n\t*out = *in\n}", "title": "" }, { "docid": "86e6e9110b4e611d68a6016ced01967e", "score": "0.78888327", "text": "func (in *DNS) DeepCopyInto(out *DNS) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "2c0186ad474559dbf6791ceb1124b087", "score": "0.788602", "text": "func (in *Rule) DeepCopyInto(out *Rule) {\n\t*out = *in\n\tif in.TargetHosts != nil {\n\t\tin, out := &in.TargetHosts, &out.TargetHosts\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.Snapshots != nil {\n\t\tin, out := &in.Snapshots, &out.Snapshots\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.Paths != nil {\n\t\tin, out := &in.Paths, &out.Paths\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.Exclude != nil {\n\t\tin, out := &in.Exclude, &out.Exclude\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.Include != nil {\n\t\tin, out := &in.Include, &out.Include\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\treturn\n}", "title": "" }, { "docid": "bf4475f50224fcbecdf3c494868d167b", "score": "0.78823894", "text": "func (in *Json6902) DeepCopyInto(out *Json6902) {\n\t*out = *in\n\tin.Target.DeepCopyInto(&out.Target)\n}", "title": "" }, { "docid": "91acd35f3d3dfc1f65af5ad610c93290", "score": "0.7875857", "text": "func (in *NIC) DeepCopyInto(out *NIC) {\n\t*out = *in\n}", "title": "" }, { "docid": "dfd9b82d38c6fee08dd3cf0209bd1133", "score": "0.78745943", "text": "func (in *Disk) DeepCopyInto(out *Disk) {\n\t*out = *in\n}", "title": "" }, { "docid": "4db8dae318248c89d5b1884921cf3f0c", "score": "0.78716767", "text": "func (in *TestOracle) DeepCopyInto(out *TestOracle) {\n\t*out = *in\n\tif in.Pass != nil {\n\t\tin, out := &in.Pass, &out.Pass\n\t\t*out = new(string)\n\t\t**out = **in\n\t}\n\tif in.Fail != nil {\n\t\tin, out := &in.Fail, &out.Fail\n\t\t*out = new(string)\n\t\t**out = **in\n\t}\n}", "title": "" }, { "docid": "9b3266dd6bad29cf240af4b4fb444de3", "score": "0.7864322", "text": "func (in *Artifacts) DeepCopyInto(out *Artifacts) {\n\t*out = *in\n}", "title": "" }, { "docid": "77971dc0b377a52b9d2814eb5a6acc6f", "score": "0.7859761", "text": "func (in *ContainerPort) DeepCopyInto(out *ContainerPort) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "29e02c97b127087f995d6b0457b82abc", "score": "0.785785", "text": "func (in *Checksum) DeepCopyInto(out *Checksum) {\n\t*out = *in\n}", "title": "" }, { "docid": "74741263fc8a9e2990e2e3a20b799143", "score": "0.78568625", "text": "func (in *Global) DeepCopyInto(out *Global) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "e85c49c1705dd0d0d0a0564220621e8f", "score": "0.78549266", "text": "func (in *Dependency) DeepCopyInto(out *Dependency) {\n\t*out = *in\n}", "title": "" }, { "docid": "370fd9524fb300cb6e294a6ecb9e8a2d", "score": "0.784762", "text": "func (in *SystemRule) DeepCopyInto(out *SystemRule) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "3e013886e6bc1d59a365df69c5ee97c5", "score": "0.784401", "text": "func (in *ReferenceObject) DeepCopyInto(out *ReferenceObject) {\n\t*out = *in\n}", "title": "" }, { "docid": "a9062924f4e13bda7a07fc0c62640c37", "score": "0.7842727", "text": "func (in *BackupTarget) DeepCopyInto(out *BackupTarget) {\n\t*out = *in\n\tout.Ref = in.Ref\n\tif in.Paths != nil {\n\t\tin, out := &in.Paths, &out.Paths\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.VolumeMounts != nil {\n\t\tin, out := &in.VolumeMounts, &out.VolumeMounts\n\t\t*out = make([]corev1.VolumeMount, len(*in))\n\t\tfor i := range *in {\n\t\t\t(*in)[i].DeepCopyInto(&(*out)[i])\n\t\t}\n\t}\n\tif in.Replicas != nil {\n\t\tin, out := &in.Replicas, &out.Replicas\n\t\t*out = new(int32)\n\t\t**out = **in\n\t}\n\tif in.Exclude != nil {\n\t\tin, out := &in.Exclude, &out.Exclude\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.Args != nil {\n\t\tin, out := &in.Args, &out.Args\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\treturn\n}", "title": "" }, { "docid": "427593624e8f7c25b1f2d36902ae0730", "score": "0.784147", "text": "func (in *Compaction) DeepCopyInto(out *Compaction) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "647f1524647108952ee31ce014c689dc", "score": "0.7840965", "text": "func (in *HelmTiller) DeepCopyInto(out *HelmTiller) {\n\t*out = *in\n\tout.Addon = in.Addon\n\treturn\n}", "title": "" }, { "docid": "4b862c3b8921cf3f39b78a13d968c9fc", "score": "0.7839309", "text": "func (in *FinalInstallStep) DeepCopyInto(out *FinalInstallStep) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "5ab614070f87d291c5c74f600b683d65", "score": "0.78360313", "text": "func (in *NamespacedName) DeepCopyInto(out *NamespacedName) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "44de1c7a8498d83ec6f0a1339d4d328c", "score": "0.7831643", "text": "func (in *EnvSelector) DeepCopyInto(out *EnvSelector) {\n\t*out = *in\n}", "title": "" }, { "docid": "cb473a50a2c7608cb863df348afabf6c", "score": "0.78262097", "text": "func (in *State) DeepCopyInto(out *State) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "14fef7eecdd89f4797e05b4e11d16629", "score": "0.78246474", "text": "func (in *Addon) DeepCopyInto(out *Addon) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "7e0d8d90d7ac662f33fdb4df6eec1caf", "score": "0.78212607", "text": "func (in *TolerateSpec) DeepCopyInto(out *TolerateSpec) {\n\t*out = *in\n}", "title": "" }, { "docid": "a748e1f42ee8ddc275bf9b43f3b35103", "score": "0.7817672", "text": "func (in *DockerPullCheck) DeepCopyInto(out *DockerPullCheck) {\n\t*out = *in\n}", "title": "" }, { "docid": "c16be5768cc974667aa6c224d746bcc4", "score": "0.7816364", "text": "func (in *LoggingSpec) DeepCopyInto(out *LoggingSpec) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "9b11c1572d023ac80a5aac9db170efbe", "score": "0.78160167", "text": "func (in *KubeLego) DeepCopyInto(out *KubeLego) {\n\t*out = *in\n\tout.Addon = in.Addon\n\treturn\n}", "title": "" }, { "docid": "0afdff87e84ca65710759d1337015963", "score": "0.7815362", "text": "func (in *SubSpec) DeepCopyInto(out *SubSpec) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "f0cd3fe33fab64d922a03529f83b943b", "score": "0.7814934", "text": "func (in *Resolve) DeepCopyInto(out *Resolve) {\n\t*out = *in\n\tif in.Services != nil {\n\t\tin, out := &in.Services, &out.Services\n\t\t*out = make([]ServiceResolveSpec, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\treturn\n}", "title": "" }, { "docid": "75953b773ee1b231c11039416db7c653", "score": "0.78111356", "text": "func (in *FileDiscovery) DeepCopyInto(out *FileDiscovery) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "288bba05c76ddb20c0924391cf5c17d4", "score": "0.7810174", "text": "func (in *NuxeoAccess) DeepCopyInto(out *NuxeoAccess) {\n\t*out = *in\n\tout.TargetPort = in.TargetPort\n}", "title": "" }, { "docid": "a66214db9e683346d01273bd3d212342", "score": "0.78097266", "text": "func (in *Watch) DeepCopyInto(out *Watch) {\n\t*out = *in\n\tif in.Deployments != nil {\n\t\tin, out := &in.Deployments, &out.Deployments\n\t\t*out = make([]Deployment, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.Parsers != nil {\n\t\tin, out := &in.Parsers, &out.Parsers\n\t\t*out = make([]InputParser, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.Outputs != nil {\n\t\tin, out := &in.Outputs, &out.Outputs\n\t\t*out = make([]Output, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\treturn\n}", "title": "" }, { "docid": "c27c0b2fa28bc0c6fc2d2861feaa77bc", "score": "0.7804369", "text": "func (in *DataTransferProgress) DeepCopyInto(out *DataTransferProgress) {\n\t*out = *in\n}", "title": "" }, { "docid": "4f446099c62c3201f8a1f2caf7fd067f", "score": "0.7800825", "text": "func (in *Monocular) DeepCopyInto(out *Monocular) {\n\t*out = *in\n\tout.Addon = in.Addon\n\treturn\n}", "title": "" }, { "docid": "01b508f74eb653d3628e69f3ddedcd2a", "score": "0.78005236", "text": "func (in *Destination) DeepCopyInto(out *Destination) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "01b508f74eb653d3628e69f3ddedcd2a", "score": "0.78005236", "text": "func (in *Destination) DeepCopyInto(out *Destination) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "7cbb1952216c7abee2fb9390c4172456", "score": "0.78003883", "text": "func (in *IdentityDb) DeepCopyInto(out *IdentityDb) {\n\t*out = *in\n\tout.PoolOptions = in.PoolOptions\n}", "title": "" }, { "docid": "3827c31220dfe680f394f9d1ebceab58", "score": "0.7799999", "text": "func (in *PoolOptions) DeepCopyInto(out *PoolOptions) {\n\t*out = *in\n}", "title": "" }, { "docid": "e6e62bc68e6768204636bf9495629843", "score": "0.77992624", "text": "func (in *Global) DeepCopyInto(out *Global) {\n\t*out = *in\n\tout.XXX_NoUnkeyedLiteral = in.XXX_NoUnkeyedLiteral\n\tif in.XXX_unrecognized != nil {\n\t\tin, out := &in.XXX_unrecognized, &out.XXX_unrecognized\n\t\t*out = make([]byte, len(*in))\n\t\tcopy(*out, *in)\n\t}\n}", "title": "" }, { "docid": "32253f480abe83070a818b4213200b5d", "score": "0.77990234", "text": "func (in *Docker) DeepCopyInto(out *Docker) {\n\t*out = *in\n\tif in.Args != nil {\n\t\tin, out := &in.Args, &out.Args\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\treturn\n}", "title": "" }, { "docid": "546392e209b025332450b746e29a55a3", "score": "0.7796975", "text": "func (in *ServiceResolveSpec) DeepCopyInto(out *ServiceResolveSpec) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "7686bd51b571d5c60d19a80bba43f7c5", "score": "0.7796147", "text": "func (in *NameValue) DeepCopyInto(out *NameValue) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "e94fbb469461cb85f65bdb5e3f8cff52", "score": "0.7794391", "text": "func (in *ContainerImage) DeepCopyInto(out *ContainerImage) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "e777d7d159b2dbf5fb1d5346593c672b", "score": "0.77930963", "text": "func (in *TaskTestSpec) DeepCopyInto(out *TaskTestSpec) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "460869f5d0b2d3581371f96eaab1c6c5", "score": "0.77929467", "text": "func (in *QueryParameterMatcher) DeepCopyInto(out *QueryParameterMatcher) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "3fd37fa0a6e40b0c2c4b4779ff65d42b", "score": "0.7792485", "text": "func (in *Selector) DeepCopyInto(out *Selector) {\n\t*out = *in\n}", "title": "" }, { "docid": "c7e1d612f3613418287025d9beb75ebd", "score": "0.7791954", "text": "func (in *NamespacedName) DeepCopyInto(out *NamespacedName) {\n\t*out = *in\n}", "title": "" }, { "docid": "c7e1d612f3613418287025d9beb75ebd", "score": "0.7791954", "text": "func (in *NamespacedName) DeepCopyInto(out *NamespacedName) {\n\t*out = *in\n}", "title": "" }, { "docid": "68d5af65be2b3f9605eb56feb89abe23", "score": "0.7788198", "text": "func (in *Interface) DeepCopyInto(out *Interface) {\n\t*out = *in\n\tif in.Flags != nil {\n\t\tin, out := &in.Flags, &out.Flags\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.IPV4Addresses != nil {\n\t\tin, out := &in.IPV4Addresses, &out.IPV4Addresses\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.IPV6Addresses != nil {\n\t\tin, out := &in.IPV6Addresses, &out.IPV6Addresses\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n}", "title": "" }, { "docid": "2cb6d185c77c6fd513706bfc4ea5a80b", "score": "0.77881485", "text": "func (in *Level) DeepCopyInto(out *Level) {\n\t*out = *in\n}", "title": "" }, { "docid": "1b4cf9640bfcf7f7cdbcebab0c99d94e", "score": "0.778294", "text": "func (in *IdentityForCmk) DeepCopyInto(out *IdentityForCmk) {\n\t*out = *in\n\tif in.PropertyBag != nil {\n\t\tin, out := &in.PropertyBag, &out.PropertyBag\n\t\t*out = make(genruntime.PropertyBag, len(*in))\n\t\tfor key, val := range *in {\n\t\t\t(*out)[key] = val\n\t\t}\n\t}\n\tif in.UserAssignedIdentity != nil {\n\t\tin, out := &in.UserAssignedIdentity, &out.UserAssignedIdentity\n\t\t*out = new(string)\n\t\t**out = **in\n\t}\n}", "title": "" }, { "docid": "3a4aaf8e02ea48978e3b56c3f6792bad", "score": "0.77820444", "text": "func (in *EmptyDir) DeepCopyInto(out *EmptyDir) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "b22a5d61be5d9d15da49361e15b66431", "score": "0.7778853", "text": "func (in *TaskRef) DeepCopyInto(out *TaskRef) {\n\t*out = *in\n\tif in.Params != nil {\n\t\tin, out := &in.Params, &out.Params\n\t\t*out = make([]Param, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\treturn\n}", "title": "" }, { "docid": "f89bdac0ff7dc2948005dc666c01c5be", "score": "0.77746063", "text": "func (in *GitReference) DeepCopyInto(out *GitReference) {\n\t*out = *in\n}", "title": "" }, { "docid": "a985014e9811aa9606eb760041b35dfa", "score": "0.7773715", "text": "func (in *ConfigurationInfo) DeepCopyInto(out *ConfigurationInfo) {\n\t*out = *in\n\tif in.ARN != nil {\n\t\tin, out := &in.ARN, &out.ARN\n\t\t*out = new(string)\n\t\t**out = **in\n\t}\n\tif in.Revision != nil {\n\t\tin, out := &in.Revision, &out.Revision\n\t\t*out = new(int64)\n\t\t**out = **in\n\t}\n}", "title": "" }, { "docid": "ee51e9942eff79d630765d320000db37", "score": "0.7772483", "text": "func (in *ImageRef) DeepCopyInto(out *ImageRef) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "9b8a5d0e517ed18900f4997b7f4b1dd2", "score": "0.7771299", "text": "func (in *Properties) DeepCopyInto(out *Properties) {\n\t*out = *in\n}", "title": "" }, { "docid": "24680e96db252cb395af5d70d23d5666", "score": "0.77685183", "text": "func (in *PackagePath) DeepCopyInto(out *PackagePath) {\n\t*out = *in\n\treturn\n}", "title": "" } ]
227dee1369717bda9a71d4c01eff44b4
Type implements the BinaryExpr interface
[ { "docid": "08aac308f5f50032c676331e4fd447a4", "score": "0.0", "text": "func (d *Division) Type(querypb.Type) querypb.Type {\n\treturn sqltypes.Float64\n}", "title": "" } ]
[ { "docid": "563bf0b1131325f8be806654dc6d266d", "score": "0.7734191", "text": "func (b *BinaryOp) Type(env ExpressionEnv) (querypb.Type, error) {\n\tltype, err := b.Left.Type(env)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\trtype, err := b.Right.Type(env)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\ttyp := mergeNumericalTypes(ltype, rtype)\n\treturn b.Expr.Type(typ), nil\n}", "title": "" }, { "docid": "bbd2bb41b2ebdc13840d14d0d793fbea", "score": "0.68064314", "text": "func binaryOpType(ctx *semanticPassContext, lt *core.BuiltinType, op string, rt *core.BuiltinType) (*core.BuiltinType, bool) {\n\tbuiltins := ctx.Program.Index\n\tswitch op {\n\tcase \"+\", \"-\", \"*\", \"/\":\n\t\tswitch lt {\n\t\tcase builtins.Int:\n\t\t\tswitch rt {\n\t\t\tcase builtins.Int:\n\t\t\t\treturn builtins.Int, true\n\t\t\t}\n\t\tcase builtins.Float32:\n\t\t\tswitch rt {\n\t\t\tcase builtins.Float32:\n\t\t\t\treturn builtins.Float32, true\n\t\t\t}\n\t\tcase builtins.String:\n\t\t\tswitch rt {\n\t\t\tcase builtins.String:\n\t\t\t\tif op == \"+\" {\n\t\t\t\t\treturn builtins.String, true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tcase \"<\", \"<=\", \">\", \">=\", \"==\", \"!=\":\n\t\tswitch lt {\n\t\tcase builtins.Int:\n\t\t\tswitch rt {\n\t\t\tcase builtins.Int:\n\t\t\t\treturn builtins.Bool, true\n\t\t\t}\n\t\tcase builtins.Float32:\n\t\t\tswitch rt {\n\t\t\tcase builtins.Float32:\n\t\t\t\treturn builtins.Bool, true\n\t\t\t}\n\t\t}\n\t}\n\treturn nil, false\n}", "title": "" }, { "docid": "be260b956167e4035866be49f29bfaff", "score": "0.6365774", "text": "func (check typecheck) binaryExpr(n *node) error {\n\tc0, c1 := n.child[0], n.child[1]\n\ta := n.action\n\tif isAssignAction(a) {\n\t\ta--\n\t}\n\n\tif isShiftAction(a) {\n\t\treturn check.shift(n)\n\t}\n\n\t_ = check.convertUntyped(c0, c1.typ)\n\t_ = check.convertUntyped(c1, c0.typ)\n\n\tif isComparisonAction(a) {\n\t\treturn check.comparison(n)\n\t}\n\n\tif !c0.typ.equals(c1.typ) {\n\t\treturn n.cfgErrorf(\"invalid operation: mismatched types %s and %s\", c0.typ.id(), c1.typ.id())\n\t}\n\n\tt0 := c0.typ.TypeOf()\n\tif err := check.op(binaryOpPredicates, a, n, c0, t0); err != nil {\n\t\treturn err\n\t}\n\n\tswitch n.action {\n\tcase aQuo, aRem:\n\t\tif (c0.typ.untyped || isInt(t0)) && c1.typ.untyped && constant.Sign(c1.rval.Interface().(constant.Value)) == 0 {\n\t\t\treturn n.cfgErrorf(\"invalid operation: division by zero\")\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d1dcf98e9cc1240c41929db025f22268", "score": "0.63239455", "text": "func (expr *ExprAdd) Type() types.Type {\n\treturn expr.X.Type()\n}", "title": "" }, { "docid": "84fd5f6db80afad6ba363d50453f2100", "score": "0.6257682", "text": "func (v BoolValue) ExpressionType() Type { return BoolType }", "title": "" }, { "docid": "f777b1fcbe208d8f06942f59497f1296", "score": "0.616061", "text": "func (expr *ExprSub) Type() types.Type {\n\treturn expr.X.Type()\n}", "title": "" }, { "docid": "33ccab1058b620f0151ee9c0449952bf", "score": "0.61521506", "text": "func (expr *ExprFAdd) Type() types.Type {\n\treturn expr.X.Type()\n}", "title": "" }, { "docid": "68d7f8f5aeccb00f14952d7751458886", "score": "0.61501175", "text": "func (expr *ExprUDiv) Type() types.Type {\n\treturn expr.X.Type()\n}", "title": "" }, { "docid": "5383851ce4ea5763293176d83bfd22aa", "score": "0.61445916", "text": "func (expr *ExprFMul) Type() types.Type {\n\treturn expr.X.Type()\n}", "title": "" }, { "docid": "c1801ffb2f2f84d91f59949de268a529", "score": "0.61370224", "text": "func (l *Literal) Type(ExpressionEnv) (querypb.Type, error) {\n\treturn l.Val.typ, nil\n}", "title": "" }, { "docid": "d4a884e7e1f56850eebe472ebe1ef2c4", "score": "0.6093627", "text": "func Binary(x Expr, op string, y Expr) *BinaryExpr {\n\treturn &BinaryExpr{X: x, Op: *T(op), Y: y}\n}", "title": "" }, { "docid": "0c7854e26576058843a9025f50efc27d", "score": "0.60582155", "text": "func (e *state) evalBinary(expr *entql.BinaryExpr) *sql.Predicate {\n\tswitch expr.Op {\n\tcase entql.OpOr:\n\t\treturn sql.Or(e.evalExpr(expr.X), e.evalExpr(expr.Y))\n\tcase entql.OpAnd:\n\t\treturn sql.And(e.evalExpr(expr.X), e.evalExpr(expr.Y))\n\tcase entql.OpEQ, entql.OpNEQ:\n\t\tif expr.Y == (*entql.Value)(nil) {\n\t\t\tf, ok := expr.X.(*entql.Field)\n\t\t\texpect(ok, \"*entql.Field, got %T\", expr.Y)\n\t\t\treturn nullFunc[expr.Op](e.field(f))\n\t\t}\n\t\tfallthrough\n\tdefault:\n\t\tfield, ok := expr.X.(*entql.Field)\n\t\texpect(ok, \"expr.X to be *entql.Field (got %T)\", expr.X)\n\t\t_, ok = expr.Y.(*entql.Field)\n\t\tif !ok {\n\t\t\t_, ok = expr.Y.(*entql.Value)\n\t\t}\n\t\texpect(ok, \"expr.Y to be *entql.Field or *entql.Value (got %T)\", expr.X)\n\t\tswitch x := expr.Y.(type) {\n\t\tcase *entql.Field:\n\t\t\treturn sql.ColumnsOp(e.field(field), e.field(x), binary[expr.Op])\n\t\tcase *entql.Value:\n\t\t\tc := e.field(field)\n\t\t\treturn sql.P(func(b *sql.Builder) {\n\t\t\t\tb.Ident(c).WriteOp(binary[expr.Op])\n\t\t\t\targs(b, x)\n\t\t\t})\n\t\tdefault:\n\t\t\tpanic(\"unreachable\")\n\t\t}\n\t}\n}", "title": "" }, { "docid": "3650ffb3fea8f605d656f5ba21588d3c", "score": "0.60534257", "text": "func (e *Expression) Type() T {\n\treturn Texpression\n}", "title": "" }, { "docid": "30c5677a24ffb71e41adce7c6b92a723", "score": "0.59707534", "text": "func NewBinaryExpr() *BinaryExpr {\n\treturn &BinaryExpr{}\n}", "title": "" }, { "docid": "4a3f2030d640f833e853e587d6444a96", "score": "0.59705347", "text": "func (expr *ExprSDiv) Type() types.Type {\n\treturn expr.X.Type()\n}", "title": "" }, { "docid": "c4f57f5ed2276a2f155b52360f4f7a34", "score": "0.59602654", "text": "func (expr *ExprMul) Type() types.Type {\n\treturn expr.X.Type()\n}", "title": "" }, { "docid": "cb90675d3a67025d9754d2d7831f4c6b", "score": "0.5955971", "text": "func (op elemBinOp) IsBinary() bool { return true }", "title": "" }, { "docid": "a2f9c390fc70fc5703ac6a98e5de5599", "score": "0.5928888", "text": "func (expr *ExprFSub) Type() types.Type {\n\treturn expr.X.Type()\n}", "title": "" }, { "docid": "4e16b678c4ba23252e3cef29b29796ae", "score": "0.59149057", "text": "func (expr *ExprURem) Type() types.Type {\n\treturn expr.X.Type()\n}", "title": "" }, { "docid": "3bcc0b7989333e808fb2b926c9b85019", "score": "0.59088165", "text": "func NewBinaryExpr(x, opToken, y interface{}) (*ast.BinaryExpr, error) {\n\topTok, ok := opToken.(*gocctoken.Token)\n\tif !ok {\n\t\treturn nil, errutil.Newf(\"invalid binary operator type; expectd *gocctoken.Token, got %T\", opToken)\n\t}\n\tvar op token.Kind\n\tswitch lit := string(opTok.Lit); lit {\n\tcase \"=\":\n\t\top = token.Assign\n\tcase \"&&\":\n\t\top = token.Land\n\tcase \"==\":\n\t\top = token.Eq\n\tcase \"!=\":\n\t\top = token.Ne\n\tcase \"<\":\n\t\top = token.Lt\n\tcase \">\":\n\t\top = token.Gt\n\tcase \"<=\":\n\t\top = token.Le\n\tcase \">=\":\n\t\top = token.Ge\n\tcase \"+\":\n\t\top = token.Add\n\tcase \"-\":\n\t\top = token.Sub\n\tcase \"*\":\n\t\top = token.Mul\n\tcase \"/\":\n\t\top = token.Div\n\tdefault:\n\t\treturn nil, errutil.Newf(`invalid binary operator; expected \"=\", \"&&\", \"==\", \"!=\", \"<\", \">\", \"<=\", \">=\", \"+\", \"-\", \"*\" or \"/\", got %q`, lit)\n\t}\n\n\targ0, ok := x.(ast.Expr)\n\tif !ok {\n\t\treturn nil, errutil.Newf(\"invalid first binary operand type; expected ast.Expr, got %T\", x)\n\t}\n\targ1, ok := y.(ast.Expr)\n\tif !ok {\n\t\treturn nil, errutil.Newf(\"invalid second binary operand type; expected ast.Expr, got %T\", y)\n\t}\n\treturn &ast.BinaryExpr{X: arg0, OpPos: opTok.Offset, Op: op, Y: arg1}, nil\n}", "title": "" }, { "docid": "c310cf80273740c6b2e0cad45ad0e2fb", "score": "0.5882336", "text": "func (FloatType) typeNode() {}", "title": "" }, { "docid": "69c8b6de6be9881292f0ac7641f1eeb6", "score": "0.587671", "text": "func (v Uint64Value) ExpressionType() Type { return Uint64Type }", "title": "" }, { "docid": "653f792f8beafd222ca2d1f4da77377b", "score": "0.58608896", "text": "func (v Value) Type() Type", "title": "" }, { "docid": "2392121bb4e7870e4f544a70507aea7b", "score": "0.5833815", "text": "func (n *Negate) Type(cs []CallSite, lcl []Type) (Type, error) {\n\ttyp, err := n.Elem.Type(cs, lcl)\n\tif err != nil {\n\t\treturn NIL, err\n\t}\n\tif typ.Elem != nil {\n\t\treturn NIL, fmt.Errorf(\"cannot negate a %s\", typ)\n\t}\n\treturn Type{\n\t\tRange: inverse(typ.Range),\n\t}, nil\n}", "title": "" }, { "docid": "787ef4f74b70f666fe2d1ef9629642c1", "score": "0.58260643", "text": "func (c *Column) Type(ExpressionEnv) (querypb.Type, error) {\n\treturn sqltypes.Float64, nil\n}", "title": "" }, { "docid": "292fe29dd8f209491ee8f15d1bdbddc5", "score": "0.57843983", "text": "func (v Uint8Value) ExpressionType() Type { return Uint8Type }", "title": "" }, { "docid": "6bc2532f1523a02fdcfa9947e780e89c", "score": "0.57770085", "text": "func (expr *ExprSRem) Type() types.Type {\n\treturn expr.X.Type()\n}", "title": "" }, { "docid": "6f3b09c92a000db86b2085b7f6410605", "score": "0.57581216", "text": "func (expr *ExprFRem) Type() types.Type {\n\treturn expr.X.Type()\n}", "title": "" }, { "docid": "594f5af63d1839a6a3b5abc70a79eb32", "score": "0.5753501", "text": "func (a *Addition) Type(left querypb.Type) querypb.Type {\n\treturn left\n}", "title": "" }, { "docid": "30dbdd2cd55fe576c1bb8bc8d0547ca8", "score": "0.57421744", "text": "func (b *Boolean) Type() Type { return BOOLEAN_OBJ }", "title": "" }, { "docid": "88e0ff2a627b8931ae8ed2b38cdbede7", "score": "0.5705392", "text": "func (op *CustomBinaryOperation) Type() OpType {\n\treturn TypeCustomBinary\n}", "title": "" }, { "docid": "743b55e09092bd0e147a33e79e5cc7da", "score": "0.56930065", "text": "func NewBinaryExpr(left Expr, op string, right Expr, pos Pos) *BinaryExpr {\n\treturn &BinaryExpr{pos, left, op, right}\n}", "title": "" }, { "docid": "53eca505893a9bb99c91b1b4a81909a2", "score": "0.56785035", "text": "func (this *IsNull) Type() value.Type { return value.BOOLEAN }", "title": "" }, { "docid": "e0dda58542ee56aec84d30a735227943", "score": "0.5623024", "text": "func (i Bool) Type() Type { return BooleanT }", "title": "" }, { "docid": "bade5d5d2451e777c8f4d98f47cf16db", "score": "0.56133425", "text": "func (v Int8Value) ExpressionType() Type { return Int8Type }", "title": "" }, { "docid": "b7fb36bc95b0a0d2d1e2c90b46fe9355", "score": "0.5602653", "text": "func (l *Literal) typeof(*ExpressionEnv) (sqltypes.Type, flag) {\n\treturn l.Val.typeof(), l.Val.flags_\n}", "title": "" }, { "docid": "fa3d6bb73c038287ce018ed67e134e27", "score": "0.5573575", "text": "func compileTypeExpression(te TypeExpression, pkg *Package, locals map[string]Variable) (string, []DataType, error) {\n\tline := te.LineNumber\n\tcolumn := te.Column\n\tdt, err := getDataType(te.Type, pkg)\n\tif err != nil {\n\t\treturn \"\", nil, err\n\t}\n\tswitch t := dt.(type) {\n\tcase BuiltinType:\n\t\tswitch t.Name {\n\t\tcase \"I\", \"F\", \"Byte\":\n\t\t\tif len(t.Params) != 0 {\n\t\t\t\treturn \"\", nil, msg(line, column, \"Invalid type expression: \"+t.Name+\" cannot have type parameters.\")\n\t\t\t}\n\t\t\tif len(te.Operands) != 1 {\n\t\t\t\treturn \"\", nil, msg(line, column, \"Invalid type expression: \"+t.Name+\" must have one (and just one) operand.\")\n\t\t\t}\n\t\t\texpr, returnedTypes, err := compileExpression(te.Operands[0], pkg, locals)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", nil, err\n\t\t\t}\n\t\t\tif len(returnedTypes) != 1 {\n\t\t\t\treturn \"\", nil, msg(line, column, \"Invalid type expression: Operand expression must return one (and just one) value.\")\n\t\t\t}\n\t\t\tif !isNumber(returnedTypes[0]) {\n\t\t\t\treturn \"\", nil, msg(line, column, \"Invalid type expression: \"+t.Name+\" must have number operand.\")\n\t\t\t}\n\t\t\tnumberTypes := map[string]string{\n\t\t\t\t\"I\": \"int64\",\n\t\t\t\t\"F\": \"float64\",\n\t\t\t\t\"Byte\": \"byte\",\n\t\t\t}\n\t\t\tcode := numberTypes[t.Name] + \"(\" + expr + \")\"\n\t\t\treturn code, []DataType{t}, nil\n\t\tcase \"Str\":\n\t\t\tif len(t.Params) != 0 {\n\t\t\t\treturn \"\", nil, msg(line, column, \"Invalid type expression: \"+t.Name+\" cannot have type parameters.\")\n\t\t\t}\n\t\t\tif len(te.Operands) != 1 {\n\t\t\t\treturn \"\", nil, msg(line, column, \"Invalid type expression: \"+t.Name+\" must have one (and just one) operand.\")\n\t\t\t}\n\t\t\texpr, returnedTypes, err := compileExpression(te.Operands[0], pkg, locals)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", nil, err\n\t\t\t}\n\t\t\tif len(returnedTypes) != 1 {\n\t\t\t\treturn \"\", nil, msg(line, column, \"Invalid type expression: Operand expression must return one (and just one) value.\")\n\t\t\t}\n\t\t\tif isType(returnedTypes[0], BuiltinType{\"L\", []DataType{BuiltinType{\"I\", nil}}}, true) {\n\t\t\t\treturn \"_std.Runelist2string(\" + expr + \")\", []DataType{t}, nil\n\t\t\t} else if isType(returnedTypes[0], BuiltinType{\"L\", []DataType{BuiltinType{\"Str\", nil}}}, true) {\n\t\t\t\treturn \"_std.Charlist2string(\" + expr + \")\", []DataType{t}, nil\n\t\t\t} else if isType(returnedTypes[0], BuiltinType{\"S\", []DataType{BuiltinType{\"I\", nil}}}, true) {\n\t\t\t\treturn \"_std.Runeslice2string(\" + expr + \")\", []DataType{t}, nil\n\t\t\t} else if isType(returnedTypes[0], BuiltinType{\"S\", []DataType{BuiltinType{\"Byte\", nil}}}, true) {\n\t\t\t\treturn \"string(\" + expr + \")\", []DataType{t}, nil\n\t\t\t} else if isType(returnedTypes[0], BuiltinType{\"S\", []DataType{BuiltinType{\"Str\", nil}}}, true) {\n\t\t\t\treturn \"_std.Charslice2string(\" + expr + \")\", []DataType{t}, nil\n\t\t\t} else if isType(returnedTypes[0], BuiltinType{\"F\", nil}, true) {\n\t\t\t\treturn \"_std.FormatFloat(\" + expr + \")\", []DataType{BuiltinType{\"Str\", nil}}, nil\n\t\t\t} else if isType(returnedTypes[0], BuiltinType{\"I\", nil}, true) {\n\t\t\t\treturn \"_std.FormatInt(\" + expr + \")\", []DataType{BuiltinType{\"Str\", nil}}, nil\n\t\t\t}\n\t\t\treturn \"\", nil, msg(line, column, \"Invalid type expression: Str operand must be a list or slice of strings or runes\")\n\t\tcase \"M\":\n\t\t\tif len(t.Params) != 2 {\n\t\t\t\treturn \"\", nil, msg(line, column, \"Invalid type expression. Map must have two type parameters.\")\n\t\t\t}\n\t\t\tmapType, err := compileType(t, pkg)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", nil, err\n\t\t\t}\n\t\t\tmapType += \"{\"\n\t\t\tif len(te.Operands)%2 != 0 {\n\t\t\t\treturn \"\", nil, msg(line, column, \"Invalid type expression. Map must have even number of operands.\")\n\t\t\t}\n\t\t\tfor i := 0; i < len(te.Operands); i += 2 {\n\t\t\t\tkey, returnedTypes, err := compileExpression(te.Operands[i], pkg, locals)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn \"\", nil, err\n\t\t\t\t}\n\t\t\t\tif len(returnedTypes) != 1 || !isType(returnedTypes[0], t.Params[0], false) {\n\t\t\t\t\treturn \"\", nil, msg(line, column, \"Invalid type expression. Map key of wrong type.\")\n\t\t\t\t}\n\t\t\t\tval, returnedTypes, err := compileExpression(te.Operands[i+1], pkg, locals)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn \"\", nil, err\n\t\t\t\t}\n\t\t\t\tif len(returnedTypes) != 1 || !isType(returnedTypes[0], t.Params[1], false) {\n\t\t\t\t\treturn \"\", nil, msg(line, column, \"Invalid type expression. Map val of wrong type.\")\n\t\t\t\t}\n\t\t\t\tmapType += key + \": \" + val + \", \"\n\t\t\t}\n\t\t\tmapType += \"}\"\n\t\t\treturn mapType, []DataType{t}, nil\n\t\tcase \"L\":\n\t\t\tif len(t.Params) != 1 {\n\t\t\t\treturn \"\", nil, msg(line, column, \"Invalid type expression. List must have one type parameter.\")\n\t\t\t}\n\t\t\texpr := \"(func () *_std.List {\\n\"\n\t\t\texpr += \"var _list _std.List = make([]interface{}, \" + strconv.Itoa(len(te.Operands)) + \")\\n\"\n\t\t\tfor i := 0; i < len(te.Operands); i++ {\n\t\t\t\tval, returnedTypes, err := compileExpression(te.Operands[i], pkg, locals)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn \"\", nil, err\n\t\t\t\t}\n\t\t\t\tif len(returnedTypes) != 1 || !isType(returnedTypes[0], t.Params[0], false) {\n\t\t\t\t\treturn \"\", nil, msg(line, column, \"Invalid type expression. List val of wrong type.\")\n\t\t\t\t}\n\t\t\t\texpr += \"_list[\" + strconv.Itoa(i) + \"] = \" + val + \"\\n\"\n\t\t\t}\n\t\t\texpr += `return &_list\n\t\t })()`\n\t\t\treturn expr, []DataType{t}, nil\n\t\tcase \"S\":\n\t\t\tif len(t.Params) != 1 {\n\t\t\t\treturn \"\", nil, msg(line, column, \"Invalid type expression. Slice must have one type parameter.\")\n\t\t\t}\n\t\t\tparam, err := compileType(t.Params[0], pkg)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", nil, err\n\t\t\t}\n\t\t\tcode := \"[]\" + param + \"{\"\n\t\t\tfor i := 0; i < len(te.Operands); i++ {\n\t\t\t\tval, returnedTypes, err := compileExpression(te.Operands[i], pkg, locals)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn \"\", nil, err\n\t\t\t\t}\n\t\t\t\tif len(returnedTypes) != 1 || !isType(returnedTypes[0], t.Params[0], false) {\n\t\t\t\t\t// special case of casint string to byte slice\n\t\t\t\t\tif isType(t.Params[0], BuiltinType{\"Byte\", nil}, true) && len(te.Operands) == 1 && isType(returnedTypes[0], BuiltinType{\"Str\", nil}, true) {\n\t\t\t\t\t\treturn \"[]byte(\" + val + \")\", []DataType{BuiltinType{\"S\", []DataType{BuiltinType{\"Byte\", nil}}}}, nil\n\t\t\t\t\t}\n\t\t\t\t\treturn \"\", nil, msg(line, column, \"Invalid type expression. Slice value of wrong type.\")\n\t\t\t\t}\n\t\t\t\tcode += val + \", \"\n\t\t\t}\n\t\t\tcode += \"}\"\n\t\t\treturn code, []DataType{t}, nil\n\t\tdefault:\n\t\t\treturn \"\", nil, msg(line, column, \"Invalid type expression. Cannot create type \"+t.Name+\".\")\n\t\t}\n\tcase ArrayType:\n\t\tif len(te.Operands) != t.Size {\n\t\t\treturn \"\", nil, msg(line, column, \"Array expression must have number of operands that matches the length.\")\n\t\t}\n\t\tparam, err := compileType(t.Type, pkg)\n\t\tif err != nil {\n\t\t\treturn \"\", nil, err\n\t\t}\n\t\tcode := \"[\" + strconv.Itoa(t.Size) + \"]\" + param + \"{\"\n\t\tfor i := 0; i < len(te.Operands); i++ {\n\t\t\tval, returnedTypes, err := compileExpression(te.Operands[i], pkg, locals)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", nil, err\n\t\t\t}\n\t\t\tif len(returnedTypes) != 1 || !isType(returnedTypes[0], t.Type, false) {\n\t\t\t\treturn \"\", nil, msg(line, column, \"Invalid type expression. List val of wrong type.\")\n\t\t\t}\n\t\t\tcode += val + \", \"\n\t\t}\n\t\tcode += \"}\"\n\t\treturn code, []DataType{t}, nil\n\tcase FunctionType:\n\t\treturn \"\", nil, msg(line, column, \"Invalid type expression. Cannot create a function with a type expression.\")\n\tcase Struct:\n\t\tif len(t.MemberNames) != len(te.Operands) {\n\t\t\treturn \"\", nil, msg(line, column, \"Invalid type expression. Wrong number of args for creating struct.\")\n\t\t}\n\t\tcode := t.Name + \"{\"\n\t\tfor i, argType := range t.MemberTypes {\n\t\t\texpr, returnTypes, err := compileExpression(te.Operands[i], pkg, locals)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", nil, err\n\t\t\t}\n\t\t\tif len(returnTypes) != 1 || !isType(returnTypes[0], argType, false) {\n\t\t\t\treturn \"\", nil, msg(line, column, \"Invalid type expression. Wrong type of arg for creating struct.\")\n\t\t\t}\n\t\t\tcode += expr + \", \"\n\t\t}\n\t\tcode += \"}\"\n\t\treturn code, []DataType{t}, nil\n\tcase InterfaceDefinition:\n\t\treturn \"\", nil, msg(line, column, \"Invalid type expression. Cannot create interface value.\")\n\t}\n\t// should be unreachable\n\treturn \"\", nil, msg(line, column, \"Invalid type expression.\")\n}", "title": "" }, { "docid": "124a22c1fa583e33fd848966bd44f9c5", "score": "0.55556214", "text": "func (lb *LBool) Type() LValueType {\n\treturn LTBool\n}", "title": "" }, { "docid": "b8a656d668ab5125be3037e7a343ca41", "score": "0.5549135", "text": "func IsBinary(t querypb.Type) bool {\n\treturn int(t)&flagIsBinary == flagIsBinary\n}", "title": "" }, { "docid": "9990d634ed44929806c4aef3c41388dd", "score": "0.55412143", "text": "func Binary() parameter.Parameter {\n\treturn parameter.Single(VALUE, \"BINARY\")\n}", "title": "" }, { "docid": "0dede7fd0bf58c422f2a8849c5e9378b", "score": "0.5517588", "text": "func (cs *compileState) parseType(expr ast.Expr) shaderir.Type {\n\tswitch t := expr.(type) {\n\tcase *ast.Ident:\n\t\tswitch t.Name {\n\t\tcase \"bool\":\n\t\t\treturn shaderir.Type{Main: shaderir.Bool}\n\t\tcase \"int\":\n\t\t\treturn shaderir.Type{Main: shaderir.Int}\n\t\tcase \"float\":\n\t\t\treturn shaderir.Type{Main: shaderir.Float}\n\t\tcase \"vec2\":\n\t\t\treturn shaderir.Type{Main: shaderir.Vec2}\n\t\tcase \"vec3\":\n\t\t\treturn shaderir.Type{Main: shaderir.Vec3}\n\t\tcase \"vec4\":\n\t\t\treturn shaderir.Type{Main: shaderir.Vec4}\n\t\tcase \"mat2\":\n\t\t\treturn shaderir.Type{Main: shaderir.Mat2}\n\t\tcase \"mat3\":\n\t\t\treturn shaderir.Type{Main: shaderir.Mat3}\n\t\tcase \"mat4\":\n\t\t\treturn shaderir.Type{Main: shaderir.Mat4}\n\t\tcase \"texture2d\":\n\t\t\treturn shaderir.Type{Main: shaderir.Texture2D}\n\t\tdefault:\n\t\t\tcs.addError(t.Pos(), fmt.Sprintf(\"unexpected type: %s\", t.Name))\n\t\t\treturn shaderir.Type{}\n\t\t}\n\tcase *ast.StructType:\n\t\tcs.addError(t.Pos(), \"struct is not implemented\")\n\t\treturn shaderir.Type{}\n\tdefault:\n\t\tcs.addError(t.Pos(), fmt.Sprintf(\"unepxected type: %v\", t))\n\t\treturn shaderir.Type{}\n\t}\n}", "title": "" }, { "docid": "4fc74892e2a774e6cd637fc2ac7b3590", "score": "0.5506551", "text": "func (s *Subtraction) Type(left querypb.Type) querypb.Type {\n\treturn left\n}", "title": "" }, { "docid": "dc54b12bfa7d341c271f362aa9e71920", "score": "0.54666823", "text": "func (b *Boolean) Type() ObjectType { return BOOLEAN_OBJ }", "title": "" }, { "docid": "7d298683adefeeac4105c855667374cb", "score": "0.5461345", "text": "func (n *BasicLit) isExpr() {}", "title": "" }, { "docid": "d458253114377578323aa1946f526e33", "score": "0.545204", "text": "func nodetypebyte(t nodetype) byte {\n\treturn ([]byte(strconv.Itoa(int(t))))[0]\n}", "title": "" }, { "docid": "54ed7fd63b27d0855f89ad517160afb4", "score": "0.54469967", "text": "func (s EdifSymbol) Type() SExpType { return Symbol }", "title": "" }, { "docid": "d509524d2a11d0d93f6457c5a73075d2", "score": "0.54465955", "text": "func (v *Bool) Type() string {\n\treturn \"Bool\"\n}", "title": "" }, { "docid": "202e2e0eaee2db24895b465a1a8ab7db", "score": "0.54460984", "text": "func (v Int64Value) ExpressionType() Type { return Int64Type }", "title": "" }, { "docid": "537684ef89148824e6f50993b447b083", "score": "0.5443983", "text": "func (expr *ExprFDiv) Type() types.Type {\n\treturn expr.X.Type()\n}", "title": "" }, { "docid": "849c3753a23094a314b8a33bd63846fe", "score": "0.5438222", "text": "func (u *UnOp) EvalType(s symboltable.SymbolTable) types.WaccType {\n\tswitch u.op {\n\tcase TryLock:\n\t\tfallthrough\n\tcase Not:\n\t\treturn types.Boolean\n\tcase Chr:\n\t\treturn types.Char\n\tdefault:\n\t\treturn types.Integer\n\t}\n}", "title": "" }, { "docid": "30a657137664becd444d0b46b4388788", "score": "0.5435371", "text": "func (ArrayType) typeNode() {}", "title": "" }, { "docid": "f829d46a9f8bd074976251775041b0a4", "score": "0.5432634", "text": "func (b *BooleanType) eval() Value {\n\treturn b\n}", "title": "" }, { "docid": "9ad6e185fd7c1535d79bb14d77dc7d96", "score": "0.5422669", "text": "func (acc *boolAcc) Type() string { return \"boolean\" }", "title": "" }, { "docid": "062d1afeca696f393c162151203f77a2", "score": "0.54220676", "text": "func (s EdifInteger) Type() SExpType { return Integer }", "title": "" }, { "docid": "1c55202ff594a41d5e6eb60fd077d3e5", "score": "0.54213464", "text": "func (p *Parameter) ExpressionType() Type { return p.Type }", "title": "" }, { "docid": "805343defc5a36682d03946b77c50e2b", "score": "0.5419133", "text": "func (Bool) Type() types.Type {\n\treturn types.Bool\n}", "title": "" }, { "docid": "e9db5758a2e62cd035c270916dd45f11", "score": "0.5413386", "text": "func (i *PointerRange) ExpressionType() Type { return i.Type }", "title": "" }, { "docid": "2d0d4dd1d2353f95f54183df848a6f07", "score": "0.5412093", "text": "func (this *CodeNode) Get_eval_type() int64 {\n return this.eval_type\n}", "title": "" }, { "docid": "b16a9de38b37ebdca9322de0d0f1b8b9", "score": "0.54084855", "text": "func binary(x Expr, pos Position, op string, y Expr) Expr {\n\t_, xend := x.Span()\n\tystart, _ := y.Span()\n\treturn &BinaryExpr{\n\t\tX: x,\n\t\tOpStart: pos,\n\t\tOp: op,\n\t\tLineBreak: xend.Line < ystart.Line,\n\t\tY: y,\n\t}\n}", "title": "" }, { "docid": "f6bde0070a140c66523d4f218d4bf9db", "score": "0.54056734", "text": "func (FloatType) concreteTypeNode() {}", "title": "" }, { "docid": "9f715bfdf020bc7289856e676e03f9d3", "score": "0.5400883", "text": "func (v Uint32Value) ExpressionType() Type { return Uint32Type }", "title": "" }, { "docid": "9f0870757528f8ed806266d59508d8c7", "score": "0.53772646", "text": "func (this *SumDistinct) Type() value.Type { return value.NUMBER }", "title": "" }, { "docid": "fe61b62b381e172b3c940dee6b0bb0bd", "score": "0.5376946", "text": "func isConstantBinaryLiteral(expr Expression) bool {\n\tif types.IsBinaryStr(expr.GetType()) {\n\t\tif v, ok := expr.(*Constant); ok {\n\t\t\tif k := v.Value.Kind(); k == types.KindBinaryLiteral {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "5ebcca1d559360bc36715dd27d8408a8", "score": "0.5372091", "text": "func (i *MapIndex) ExpressionType() Type { return i.Type.ValueType }", "title": "" }, { "docid": "4df05e8052a6e37f1d17f1e05303a8d7", "score": "0.5371649", "text": "func (e BinaryOperationExpression) Evaluate(interpreter *runtime.Interpreter) runtime.Value {\n\tlhs := e.LHS.Evaluate(interpreter)\n\n\tswitch lhs.(type) {\n\tcase runtime.Boolean:\n\t\tswitch e.Operator {\n\t\tcase And:\n\t\t\tif bool(lhs.(runtime.Boolean)) {\n\t\t\t\treturn lhs\n\t\t\t}\n\t\t\trhs := e.RHS.Evaluate(interpreter)\n\t\t\t_, ok := rhs.(runtime.Boolean)\n\t\t\tif ok {\n\t\t\t\treturn rhs\n\t\t\t}\n\t\t\tpanic(\"INVALID TYPE\")\n\t\tcase Or:\n\t\t\tif bool(lhs.(runtime.Boolean)) {\n\t\t\t\treturn lhs\n\t\t\t}\n\t\t\trhs := e.RHS.Evaluate(interpreter)\n\t\t\t_, ok := rhs.(runtime.Boolean)\n\t\t\tif ok {\n\t\t\t\treturn rhs\n\t\t\t}\n\t\t\tpanic(\"INVALID TYPE\")\n\t\tdefault:\n\t\t\tpanic(\"INVALID OPERATOR\")\n\t\t}\n\tcase runtime.Integer:\n\t\trhs, ok := e.RHS.Evaluate(interpreter).(runtime.Integer)\n\t\tif !ok {\n\t\t\tpanic(\"INVALID TYPE\")\n\t\t}\n\t\tvar result runtime.Value\n\t\tswitch e.Operator {\n\t\tcase Plus:\n\t\t\tresult = runtime.Integer(int32(lhs.(runtime.Integer)) + int32(rhs))\n\t\tcase Minus:\n\t\t\tresult = runtime.Integer(int32(lhs.(runtime.Integer)) - int32(rhs))\n\t\tcase Times:\n\t\t\tresult = runtime.Integer(int32(lhs.(runtime.Integer)) * int32(rhs))\n\t\tcase Divides:\n\t\t\tresult = runtime.Integer(int32(lhs.(runtime.Integer)) / int32(rhs))\n\t\tcase Equals:\n\t\t\tresult = runtime.Boolean(int32(lhs.(runtime.Integer)) == int32(rhs))\n\t\tcase NotEquals:\n\t\t\tresult = runtime.Boolean(int32(lhs.(runtime.Integer)) != int32(rhs))\n\t\tcase Less:\n\t\t\tresult = runtime.Boolean(int32(lhs.(runtime.Integer)) < int32(rhs))\n\t\tcase LessEquals:\n\t\t\tresult = runtime.Boolean(int32(lhs.(runtime.Integer)) <= int32(rhs))\n\t\tcase Greater:\n\t\t\tresult = runtime.Boolean(int32(lhs.(runtime.Integer)) > int32(rhs))\n\t\tcase GreaterEquals:\n\t\t\tresult = runtime.Boolean(int32(lhs.(runtime.Integer)) >= int32(rhs))\n\t\tdefault:\n\t\t\tpanic(\"INVALID OPERATOR\")\n\t\t}\n\t\treturn result\n\tcase runtime.String:\n\t\trhs, ok := e.RHS.Evaluate(interpreter).(runtime.String)\n\t\tif !ok {\n\t\t\tpanic(\"INVALID TYPE\")\n\t\t}\n\t\tswitch e.Operator {\n\t\tcase Plus:\n\t\t\treturn runtime.String(string((lhs).(runtime.String)) + string(rhs))\n\t\tdefault:\n\t\t\tpanic(\"INVALID OPERATOR\")\n\t\t}\n\tdefault:\n\t\tpanic(\"INVALID TYPE\")\n\t}\n}", "title": "" }, { "docid": "55f17306e1dd1809f1ab4fb0d9bbc706", "score": "0.5368133", "text": "func (b *RegistryBuilder) Type(value string) *RegistryBuilder {\n\tb.type_ = value\n\tb.bitmap_ |= 512\n\treturn b\n}", "title": "" }, { "docid": "44abb6b1fe4e5bcd12994ddf7afd36d4", "score": "0.5364793", "text": "func NewAstExprTypeExpr2(a int, b int, c int, d int, e AstTypeTypeInterface) (*AstExprTypeExpr) {\n\tconv_e := javabind.NewGoToJavaCallable()\n\tif err := conv_e.Convert(e); err != nil {\n\t\tpanic(err)\n\t}\n\n\tobj, err := javabind.GetEnv().NewObject(\"com/github/javaparser/ast/expr/TypeExpr\", a, b, c, d, conv_e.Value().Cast(\"com/github/javaparser/ast/type/Type\"))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tconv_e.CleanUp()\n\tx := &AstExprTypeExpr{}\n\tx.Callable = &javabind.Callable{obj}\n\treturn x\n}", "title": "" }, { "docid": "137b045b7530ff4c147d768bf488b087", "score": "0.53580946", "text": "func (*MessageValue) ExpressionType() Type { return MessageType }", "title": "" }, { "docid": "82fec21ae0a51f7a4b57a2f88d9c6380", "score": "0.5350914", "text": "func BinaryOp(x Value, op token.Token, y Value) Value {\n\tx, y = match(x, y)\n\n\tswitch x := x.(type) {\n\tcase unknownVal:\n\t\treturn x\n\n\tcase boolVal:\n\t\ty := y.(boolVal)\n\t\tswitch op {\n\t\tcase token.LAND:\n\t\t\treturn x && y\n\t\tcase token.LOR:\n\t\t\treturn x || y\n\t\t}\n\n\tcase int64Val:\n\t\ta := int64(x)\n\t\tb := int64(y.(int64Val))\n\t\tvar c int64\n\t\tswitch op {\n\t\tcase token.ADD:\n\t\t\tif !is63bit(a) || !is63bit(b) {\n\t\t\t\treturn normInt(new(big.Int).Add(big.NewInt(a), big.NewInt(b)))\n\t\t\t}\n\t\t\tc = a + b\n\t\tcase token.SUB:\n\t\t\tif !is63bit(a) || !is63bit(b) {\n\t\t\t\treturn normInt(new(big.Int).Sub(big.NewInt(a), big.NewInt(b)))\n\t\t\t}\n\t\t\tc = a - b\n\t\tcase token.MUL:\n\t\t\tif !is32bit(a) || !is32bit(b) {\n\t\t\t\treturn normInt(new(big.Int).Mul(big.NewInt(a), big.NewInt(b)))\n\t\t\t}\n\t\t\tc = a * b\n\t\tcase token.QUO:\n\t\t\treturn normFloat(new(big.Rat).SetFrac(big.NewInt(a), big.NewInt(b)))\n\t\tcase token.QUO_ASSIGN: // force integer division\n\t\t\tc = a / b\n\t\tcase token.REM:\n\t\t\tc = a % b\n\t\tcase token.AND:\n\t\t\tc = a & b\n\t\tcase token.OR:\n\t\t\tc = a | b\n\t\tcase token.XOR:\n\t\t\tc = a ^ b\n\t\tcase token.AND_NOT:\n\t\t\tc = a &^ b\n\t\tdefault:\n\t\t\tgoto Error\n\t\t}\n\t\treturn int64Val(c)\n\n\tcase intVal:\n\t\ta := x.val\n\t\tb := y.(intVal).val\n\t\tvar c big.Int\n\t\tswitch op {\n\t\tcase token.ADD:\n\t\t\tc.Add(a, b)\n\t\tcase token.SUB:\n\t\t\tc.Sub(a, b)\n\t\tcase token.MUL:\n\t\t\tc.Mul(a, b)\n\t\tcase token.QUO:\n\t\t\treturn normFloat(new(big.Rat).SetFrac(a, b))\n\t\tcase token.QUO_ASSIGN: // force integer division\n\t\t\tc.Quo(a, b)\n\t\tcase token.REM:\n\t\t\tc.Rem(a, b)\n\t\tcase token.AND:\n\t\t\tc.And(a, b)\n\t\tcase token.OR:\n\t\t\tc.Or(a, b)\n\t\tcase token.XOR:\n\t\t\tc.Xor(a, b)\n\t\tcase token.AND_NOT:\n\t\t\tc.AndNot(a, b)\n\t\tdefault:\n\t\t\tgoto Error\n\t\t}\n\t\treturn normInt(&c)\n\n\tcase floatVal:\n\t\ta := x.val\n\t\tb := y.(floatVal).val\n\t\tvar c big.Rat\n\t\tswitch op {\n\t\tcase token.ADD:\n\t\t\tc.Add(a, b)\n\t\tcase token.SUB:\n\t\t\tc.Sub(a, b)\n\t\tcase token.MUL:\n\t\t\tc.Mul(a, b)\n\t\tcase token.QUO:\n\t\t\tc.Quo(a, b)\n\t\tdefault:\n\t\t\tgoto Error\n\t\t}\n\t\treturn normFloat(&c)\n\n\tcase complexVal:\n\t\ty := y.(complexVal)\n\t\ta, b := x.re, x.im\n\t\tc, d := y.re, y.im\n\t\tvar re, im big.Rat\n\t\tswitch op {\n\t\tcase token.ADD:\n\t\t\t// (a+c) + i(b+d)\n\t\t\tre.Add(a, c)\n\t\t\tim.Add(b, d)\n\t\tcase token.SUB:\n\t\t\t// (a-c) + i(b-d)\n\t\t\tre.Sub(a, c)\n\t\t\tim.Sub(b, d)\n\t\tcase token.MUL:\n\t\t\t// (ac-bd) + i(bc+ad)\n\t\t\tvar ac, bd, bc, ad big.Rat\n\t\t\tac.Mul(a, c)\n\t\t\tbd.Mul(b, d)\n\t\t\tbc.Mul(b, c)\n\t\t\tad.Mul(a, d)\n\t\t\tre.Sub(&ac, &bd)\n\t\t\tim.Add(&bc, &ad)\n\t\tcase token.QUO:\n\t\t\t// (ac+bd)/s + i(bc-ad)/s, with s = cc + dd\n\t\t\tvar ac, bd, bc, ad, s, cc, dd big.Rat\n\t\t\tac.Mul(a, c)\n\t\t\tbd.Mul(b, d)\n\t\t\tbc.Mul(b, c)\n\t\t\tad.Mul(a, d)\n\t\t\tcc.Mul(c, c)\n\t\t\tdd.Mul(d, d)\n\t\t\ts.Add(&cc, &dd)\n\t\t\tre.Add(&ac, &bd)\n\t\t\tre.Quo(&re, &s)\n\t\t\tim.Sub(&bc, &ad)\n\t\t\tim.Quo(&im, &s)\n\t\tdefault:\n\t\t\tgoto Error\n\t\t}\n\t\treturn normComplex(&re, &im)\n\n\tcase stringVal:\n\t\tif op == token.ADD {\n\t\t\treturn x + y.(stringVal)\n\t\t}\n\t}\n\nError:\n\tpanic(fmt.Sprintf(\"invalid binary operation %v %s %v\", x, op, y))\n}", "title": "" }, { "docid": "e040d4eafebadc6783ffdd549c321c66", "score": "0.5347999", "text": "func (c *Call) ExpressionType() Type { return c.Type }", "title": "" }, { "docid": "8e0a3a924549d8eaa4081e7e05241856", "score": "0.534733", "text": "func (b *BindVariable) Type(env ExpressionEnv) (querypb.Type, error) {\n\te := env.BindVars\n\tv, found := e[b.Key]\n\tif !found {\n\t\treturn querypb.Type_NULL_TYPE, vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, \"query arguments missing for %s\", b.Key)\n\t}\n\treturn v.Type, nil\n}", "title": "" }, { "docid": "ca09d7f7923fd0298a94fa897e126880", "score": "0.533094", "text": "func (ArrayType) tsTypeNode() {}", "title": "" }, { "docid": "dc2684326430cb6adc505c55a9af6395", "score": "0.532561", "text": "func (this *CodeNode) Get_value_type() int64 {\n return this.value_type\n}", "title": "" }, { "docid": "261f0a7af580e01991c39a19be9fa915", "score": "0.53238046", "text": "func (b *bytesOrPercentageValue) Type() string {\n\treturn b.bval.Type()\n}", "title": "" }, { "docid": "1265e08f250d3af648541d2ae249efbc", "score": "0.5310668", "text": "func (uf *UnaryFunc) Type() sql.Type {\n\treturn uf.RetType\n}", "title": "" }, { "docid": "43504ef6e1b97fbd5510d85ea0b87200", "score": "0.5305935", "text": "func (i *BigInteger) Type() Type { return IntegerT }", "title": "" }, { "docid": "391baa72cfc3356f569f798db37ee7cc", "score": "0.53011787", "text": "func (i *ArrayIndex) ExpressionType() Type { return i.Type.ValueType }", "title": "" }, { "docid": "77f7e52a11a3c7503fd01960817f1004", "score": "0.52997005", "text": "func (rcv *Tensor) Type(obj *flatbuffers.Table) bool {\n\to := flatbuffers.UOffsetT(rcv._tab.Offset(6))\n\tif o != 0 {\n\t\trcv._tab.Union(obj, o)\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "6c5b99116cd7864d85c92aa4ae16dce0", "score": "0.529531", "text": "func (p *Parser) parseType() (n *Node, err error) {\n\ttyp := make([]byte, 0, 10)\n\tvar c, c1 byte\n\tfor {\n\twhitespace:\n\t\tc = p.lexer.raw()\n\t\tif c == ':' {\n\t\t\tbreak\n\t\t}\n\t\tif isWhitespace(c) {\n\t\t\tgoto whitespace\n\t\t}\n\t\tif c == '/' {\n\t\t\tc1 = p.lexer.raw()\n\t\t\tswitch c1 {\n\t\t\tcase '/':\n\t\t\t\tfor c1 != '\\n' {\n\t\t\t\t\tc1 = p.lexer.raw()\n\t\t\t\t}\n\t\t\t\tgoto whitespace\n\t\t\tcase '*':\n\t\t\t\tc1 = p.lexer.raw()\n\t\t\t\tfor {\n\t\t\t\t\tif c1 == '*' {\n\t\t\t\t\t\tc1 = p.lexer.raw()\n\t\t\t\t\t\tif c1 == '/' {\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tgoto whitespace\n\t\t\tdefault:\n\t\t\t\tp.lexer.putc(c1)\n\t\t\t}\n\t\t}\n\t\ttyp = append(typ, c)\n\t}\n\n\tif len(typ) == 0 {\n\t\terr = consCCError(nil, \"expected type\")\n\t\treturn\n\t}\n\n\tp.lexer.putc(':')\n\tp.next()\n\n\t// Check type table to intern the ast.Expr\n\ttypestr := string(typ[:])\n\tif etype, ok := types.lookup(typestr); ok {\n\t\tn = &Node{\n\t\t\top: OTYPE,\n\t\t\ttyp: typestr,\n\t\t\tetype: etype,\n\t\t}\n\t\treturn\n\t}\n\n\tvar etype ast.Expr\n\tif etype, err = parser.ParseExpr(typestr); err != nil {\n\t\terr = consCCError(nil, \"invalid type declaration %s\", typestr)\n\t\treturn\n\t}\n\n\tswitch etype.(type) {\n\tcase *ast.ArrayType, *ast.ChanType, *ast.FuncType, *ast.Ident, *ast.InterfaceType, *ast.MapType, *ast.SelectorExpr, *ast.StructType:\n\t\t// TODO : Place holder\n\t\tbreak\n\tdefault:\n\t\terr = consCCError(nil, \"invalid type declaration %s\", typestr)\n\t\treturn\n\t}\n\n\ttypes.insert(typestr, etype)\n\n\tn = &Node{\n\t\top: OTYPE,\n\t\ttyp: typestr,\n\t\tetype: etype,\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "5a89fd4549405994f32e4eb44ca313a3", "score": "0.5283668", "text": "func (t TupleExpr) typeof(*ExpressionEnv) (sqltypes.Type, flag) {\n\treturn sqltypes.Tuple, flagNullable\n}", "title": "" }, { "docid": "1a21001f0308171bcaa5d7c7c98b112d", "score": "0.5281836", "text": "func (n Null) ExpressionType() Type {\n\treturn n.Type\n}", "title": "" }, { "docid": "354f2e562bfcbcc352ed20253037cef1", "score": "0.5281745", "text": "func (PlainBooleanEncoder) Type() parquet.Type {\n\treturn parquet.Types.Boolean\n}", "title": "" }, { "docid": "6e042763b84a4e3503e033c2c08269d0", "score": "0.5265452", "text": "func (s *statementsValue) Type() string { return \"statementsValue\" }", "title": "" }, { "docid": "cb3ebee3f9860f15ff55c07b1732ad80", "score": "0.525589", "text": "func (t *VariableType) IsBinary() bool {\n\tif t == BinaryVarType {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "90a4efa95c1776132d07330a1f94f284", "score": "0.5255442", "text": "func (b *baseNode) Type() NodeType {\n\treturn b.typ\n}", "title": "" }, { "docid": "65e25de2d0232d4b2315626a9c9e8294", "score": "0.5253699", "text": "func (s *Select) ExpressionType() Type { return s.Type }", "title": "" }, { "docid": "24ed4099e5edd1b07604be79efaacfec", "score": "0.52473336", "text": "func (b Uint64) ImplementsGraphQLType(name string) bool { return name == \"Long\" }", "title": "" }, { "docid": "20b8e409bd2f0fe703ae003a0b1d2855", "score": "0.5234932", "text": "func (s *state) expr(n *Node) *ssa.Value {\n\t//return nil\n\t// TODO\n\t//s.stmtList(n.Ninit)\n\tctx := s.ctx\n\n\tswitch expr := n.node.(type) {\n\tcase *ast.Ident:\n\t\tif canSSA(n) {\n\t\t\tssaVar := s.ssaVar(n)\n\t\t\treturn s.variable(ssaVar, n.Typ())\n\t\t}\n\t\tpanic(fmt.Sprintf(\"unimplementedf for expr: %#v\", expr))\n\t\t// addr := s.addr(n, false)\n\t\t// return s.newValue2(ssa.OpLoad, n.Type, addr, s.mem())\n\tcase *ast.BasicLit:\n\t\ttypeAndValue := ctx.fn.Types[expr]\n\t\t// t := typeAndValue.Type\n\t\tv := typeAndValue.Value\n\n\t\tswitch v.Kind() {\n\t\tcase constant.Int:\n\t\t\ti, ok := constant.Int64Val(v)\n\t\t\tif !ok {\n\t\t\t\tpanic(\"internal error\")\n\t\t\t}\n\t\t\tswitch n.Typ().Size() {\n\t\t\tcase 1:\n\t\t\t\treturn s.constInt8(n.Typ(), int8(i))\n\t\t\tcase 2:\n\t\t\t\treturn s.constInt16(n.Typ(), int16(i))\n\t\t\tcase 4:\n\t\t\t\treturn s.constInt32(n.Typ(), int32(i))\n\t\t\tcase 8:\n\t\t\t\treturn s.constInt64(n.Typ(), i)\n\t\t\tdefault:\n\t\t\t\ts.Fatalf(\"bad integer size %d\", n.Typ().Size())\n\t\t\t\treturn nil\n\t\t\t}\n\t\tcase constant.String:\n\t\t\treturn s.entryNewValue0A(ssa.OpConstString, n.Typ(), constant.StringVal(v))\n\t\tcase constant.Bool:\n\t\t\treturn s.constBool(constant.BoolVal(v))\n\t\tcase constant.Unknown:\n\t\t\tpanic(\"unknown basic literal\")\n\n\t\tcase constant.Float:\n\t\t\tf, ok := constant.Float64Val(v)\n\t\t\tif !ok {\n\t\t\t\tpanic(\"internal error\")\n\t\t\t}\n\n\t\t\tswitch n.Typ().Size() {\n\t\t\tcase 4:\n\t\t\t\t// -0.0 literals need to be treated as if they were 0.0, adding 0.0 here\n\t\t\t\t// accomplishes this while not affecting other values.\n\t\t\t\treturn s.constFloat32(n.Typ(), float64(float32(f)+0.0))\n\t\t\tcase 8:\n\t\t\t\treturn s.constFloat64(n.Typ(), f+0.0)\n\t\t\tdefault:\n\t\t\t\ts.Fatalf(\"bad float size %d\", n.Typ().Size())\n\t\t\t\treturn nil\n\t\t\t}\n\t\tcase constant.Complex:\n\t\t\tpanic(\"complex numbers not supported\")\n\t\tdefault:\n\t\t\ts.Unimplementedf(\"unhandled literal %#v\", expr)\n\t\t\treturn nil\n\t\t}\n\tcase *ast.BinaryExpr:\n\t\t// TODO\n\t\tswitch expr.Op {\n\t\tcase token.ADD:\n\t\t\treturn s.entryNewValue2(ssa.OpAdd64, n.Typ(), s.expr(ExprNode(expr.X, s.ctx)), s.expr(ExprNode(expr.Y, s.ctx)))\n\t\tcase token.SUB:\n\t\t\t//\n\t\tcase token.MUL:\n\t\t\t//\n\t\tcase token.QUO:\n\t\t\t//\n\t\tcase token.REM:\n\t\t\t//\n\t\tcase token.AND:\n\t\t\t//\n\t\tcase token.OR:\n\t\t\t//\n\t\tcase token.XOR:\n\t\t\t//\n\t\tcase token.SHL:\n\t\t\t//\n\t\tcase token.SHR:\n\t\t\t//\n\t\tcase token.AND_NOT:\n\t\t\t//\n\t\tcase token.LAND:\n\t\t\t//\n\t\tcase token.LEQ:\n\t\t\t//\n\t\tcase token.LOR:\n\t\t\t//\n\t\tcase token.LSS:\n\t\t\t//\n\t\tcase token.GTR:\n\t\t\t//\n\n\t\t}\n\t\tpanic(\"unimplementedf *ast.BinaryExpr\")\n\tdefault:\n\t\tpanic(fmt.Sprintf(\"unimplemented expr: %#v\", expr))\n\t}\n}", "title": "" }, { "docid": "32d75d854070483f134521db68677e59", "score": "0.52328694", "text": "func mathType(state *lua.State) int {\n\tif state.TypeAt(1) == lua.NumberType {\n\t\tif state.IsInt(1) {\n\t\t\tstate.Push(\"integer\")\n\t\t} else {\n\t\t\tstate.Push(\"float\")\n\t\t}\n\t} else {\n\t\tstate.CheckAny(1)\n\t\tstate.Push(nil)\n\t}\n\treturn 1\n}", "title": "" }, { "docid": "540a78e17f1ae139809d781367b2e6ec", "score": "0.52310616", "text": "func (t *ToBase64) Type() sql.Type {\n\treturn sql.LongText\n}", "title": "" }, { "docid": "d064d7ef9af74bd843aef3140b9f935f", "score": "0.5225172", "text": "func (c *Context) EvalBinary(left value.Value, op string, right value.Value) value.Value {\n\treturn nil\n}", "title": "" }, { "docid": "f33622cc3d885422d2af5945b83f7589", "score": "0.52156615", "text": "func (t *FromBase64) Type() sql.Type {\n\treturn sql.LongText\n}", "title": "" }, { "docid": "6ec16b534c47e28b57214d56aef12cb2", "score": "0.52146864", "text": "func (l *List) Binary(op syntax.Token, y starlark.Value, side starlark.Side) (starlark.Value, error) {\n\tswitch op {\n\tcase syntax.IN, syntax.NOT_IN:\n\t\treturn starlark.Binary(op, y, l.list)\n\n\tcase syntax.STAR: // 2*[1,2] => [1,2,1,2], also typed\n\t\tif _, ok := y.(starlark.Int); !ok {\n\t\t\tgoto unsupported\n\t\t}\n\t\treturn l.asTypedList(starlark.Binary(op, l.list, y))\n\n\tcase syntax.PLUS:\n\t\t// Convert regular lists to typed lists first.\n\t\tif yl, ok := y.(*starlark.List); ok {\n\t\t\tvals := make([]starlark.Value, yl.Len())\n\t\t\tfor i := 0; i < yl.Len(); i++ {\n\t\t\t\tvals[i] = yl.Index(i)\n\t\t\t}\n\t\t\tasTyped, err := NewList(l.itemT, vals)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn l.Binary(op, asTyped, side)\n\t\t}\n\n\t\t// When adding typed lists their types must match.\n\t\tif yl, ok := y.(*List); ok {\n\t\t\tif yl.itemT != l.itemT {\n\t\t\t\tgoto unsupported\n\t\t\t}\n\t\t\tlhs, rhs := maybeSwap(l.list, yl.list, side)\n\t\t\treturn l.asTypedList(starlark.Binary(op, lhs, rhs))\n\t\t}\n\t}\n\nunsupported:\n\treturn nil, fmt.Errorf(\"unknown binary op: %s %s %s\", l.Type(), op, y.Type())\n}", "title": "" }, { "docid": "9565d3a69441adb1de03c7e9fb62942e", "score": "0.52028406", "text": "func (bv *BindVariable) typeof(env *ExpressionEnv) (sqltypes.Type, flag) {\n\tbvar := bv.bvar(env)\n\tswitch bvar.Type {\n\tcase sqltypes.Null:\n\t\treturn sqltypes.Null, flagNull | flagNullable\n\tcase sqltypes.HexNum, sqltypes.HexVal:\n\t\treturn sqltypes.VarBinary, flagHex\n\tdefault:\n\t\tif bv.coerceType >= 0 {\n\t\t\treturn bv.coerceType, 0\n\t\t}\n\t\treturn bvar.Type, 0\n\t}\n}", "title": "" }, { "docid": "f60c1f98ddd3efc93e3ce88014c11a9e", "score": "0.51929116", "text": "func (v *Variable) Type() string {\n switch v.typeCode {\n case '+', '$':\n\treturn TYPE_STR\n case ':':\n\treturn TYPE_INT\n case '*':\n\treturn TYPE_ARR\n case '-':\n\treturn TYPE_ERR\n default:\n\treturn \"\"\n }\n}", "title": "" }, { "docid": "d7fdc40424e733fc8af328c9d4e223a4", "score": "0.5176862", "text": "func (m *Multiplication) Type(left querypb.Type) querypb.Type {\n\treturn left\n}", "title": "" }, { "docid": "b53698fa421b97b90279465039cf83a6", "score": "0.5171004", "text": "func (exp *BinaryExpr) String() string {\n\treturn fmt.Sprintf(\"BinaryExpr(%s %s %s)\", exp.Left, exp.Op, exp.Right)\n}", "title": "" }, { "docid": "a92bbeafb02c5109b90d288c4876667a", "score": "0.5170561", "text": "func (m *Member) ExpressionType() Type { return m.Field.Type }", "title": "" }, { "docid": "14d77a4beedc00cc3d021c67f555976a", "score": "0.51699674", "text": "func (c Const) Type(cs []CallSite, lcl []Type) (Type, error) {\n\treturn Type{Range: Range{int(c), int(c)}}, nil\n}", "title": "" }, { "docid": "2e2754f49e4f500f81b47b1fe04a8f05", "score": "0.51698315", "text": "func (i *SliceIndex) ExpressionType() Type { return i.Type.To }", "title": "" }, { "docid": "10c6441aae4babfa9abfb881cfebd040", "score": "0.51607096", "text": "func (this *Abs) Type() value.Type { return value.NUMBER }", "title": "" } ]
9edc800b7bc45b20179c4de7d033643f
appendArray appends rv to the buffer, returning the extended buffer and the delimiter used between elements. It panics when n <= 0 or rv's Kind is not reflect.Array nor reflect.Slice.
[ { "docid": "90719cf42d71a73815629c7dc651ef5f", "score": "0.7541275", "text": "func appendArray(b []byte, rv reflect.Value, n int) ([]byte, string, error) {\n\tvar del string\n\tvar err error\n\n\tb = append(b, '{')\n\n\tif b, del, err = appendArrayElement(b, rv.Index(0)); err != nil {\n\t\treturn b, del, err\n\t}\n\n\tfor i := 1; i < n; i++ {\n\t\tb = append(b, del...)\n\t\tif b, del, err = appendArrayElement(b, rv.Index(i)); err != nil {\n\t\t\treturn b, del, err\n\t\t}\n\t}\n\n\treturn append(b, '}'), del, nil\n}", "title": "" } ]
[ { "docid": "45d58a55df1d036808d074ef86bc8cc5", "score": "0.65310407", "text": "func AppendArrayEnd(dst []byte, index int32) ([]byte, error) { return AppendDocumentEnd(dst, index) }", "title": "" }, { "docid": "166b3e82b35885c79a80742d726f7a7a", "score": "0.63302624", "text": "func AppendArray(dst []byte, arr []byte) []byte { return append(dst, arr...) }", "title": "" }, { "docid": "e4d598fe930f4c6bfa49a2191c363606", "score": "0.63293475", "text": "func (ve *ValueEncoder) appendArray(a Array) error {\n\terr := a.Iterate(func(i int, value Value) error {\n\t\tif i > 0 {\n\t\t\terr := ve.append(ArrayValueDelim)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\treturn ve.appendValue(value)\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn ve.append(ArrayEnd)\n}", "title": "" }, { "docid": "62e542df04ead0ae3887ed5fa82ac246", "score": "0.6260125", "text": "func (b *bufioW) AppendArrayLen(n int) {\n\tb.mu.Lock()\n\tb.appendSize('*', int64(n))\n\tb.mu.Unlock()\n}", "title": "" }, { "docid": "e3e8b1e47f92cafb876933296774978c", "score": "0.6122759", "text": "func (ta textAppender) appendArray(dst []byte, key string, length int, fn func(innerDst []byte, index int) []byte) []byte {\n\tdst = ta.appendKey(dst, key)\n\n\tdst = append(dst, textArrayBegin)\n\tfor i := 0; i < length; i++ {\n\t\tif dst[len(dst)-1] != textArrayBegin {\n\t\t\tdst = append(dst, textArrayItemSeparator)\n\t\t}\n\n\t\tdst = fn(dst, i)\n\t}\n\n\tdst = append(dst, textArrayEnd)\n\treturn dst\n}", "title": "" }, { "docid": "58da3f7d57b6d4390904f460fc628585", "score": "0.5716213", "text": "func (n *Node) AppendArray(value ...*Node) error {\n\tif !n.IsArray() {\n\t\treturn errorType()\n\t}\n\tfor _, val := range value {\n\t\tif err := n.appendNode(nil, val); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tn.mark()\n\treturn nil\n}", "title": "" }, { "docid": "a2859f5d737a1849b4437bda62043287", "score": "0.5428452", "text": "func (s *internalCircleBufferView) Append(\n\tslice CircleBuffer,\n\telemsToAppend ...Circle,\n) (CircleBuffer, error) {\n\n\ttarget, allocErr := s.growIfNecessary(slice, len(elemsToAppend))\n\tif allocErr != nil {\n\t\treturn CircleBuffer{}, allocErr\n\t}\n\ttarget.len = slice.len + len(elemsToAppend)\n\tresult := s.ToRef(target)\n\tcopy(result[slice.len:], elemsToAppend)\n\treturn target, nil\n}", "title": "" }, { "docid": "a7efba0f0de9b552a3607795c3cd551e", "score": "0.53159523", "text": "func AppendSlice(s, t reflect.Value,) reflect.Value", "title": "" }, { "docid": "5dd0350c6bbebff7ff4f7b38464e25b4", "score": "0.5218592", "text": "func AppendArr(items ...ArrayOp) ArrayOp {\n\tif len(items) == 1 {\n\t\treturn items[0]\n\t}\n\treturn opAppendArr{arrs: items}\n}", "title": "" }, { "docid": "f91c5eedfcfc325364ce436641d95398", "score": "0.5167062", "text": "func AppendSlice(s, t Value) Value {}", "title": "" }, { "docid": "c459faeb64862e98e1aee5441a1949c2", "score": "0.5159137", "text": "func IncrAppend(s interface{}, e interface{}) interface{} {\n\tsrc := reflect.ValueOf(s)\n\terrors.Assert(src.Kind() == reflect.Slice, ErrNonSlice)\n\n\tlen := src.Len()\n\tdst := reflect.MakeSlice(src.Type(), len+1, src.Cap()+1)\n\treflect.Copy(dst, src)\n\tdst.Index(len).Set(reflect.ValueOf(e))\n\n\treturn dst.Interface()\n}", "title": "" }, { "docid": "6808bd23135375cce693c67df9f0957f", "score": "0.51425534", "text": "func (s *internalCoordinateBufferView) Append(\n\tslice coordinateBuffer,\n\telemsToAppend ...coordinate,\n) (coordinateBuffer, error) {\n\n\ttarget, allocErr := s.growIfNecessary(slice, len(elemsToAppend))\n\tif allocErr != nil {\n\t\treturn coordinateBuffer{}, allocErr\n\t}\n\ttarget.len = slice.len + len(elemsToAppend)\n\tresult := s.ToRef(target)\n\tcopy(result[slice.len:], elemsToAppend)\n\treturn target, nil\n}", "title": "" }, { "docid": "4dd9c48fc0d3c1e620ed35ba2003333f", "score": "0.5102637", "text": "func (s *Streamer) ArrayEnd() *Streamer {\n\tif s.Error != nil {\n\t\treturn s\n\t}\n\ts.buffer = append(s.buffer, ']')\n\ts.poped = true\n\treturn s\n}", "title": "" }, { "docid": "1b003651a974b48c795c6fe404da0566", "score": "0.5099356", "text": "func AppendArrayElement(dst []byte, key string, arr []byte) []byte {\n\treturn AppendArray(AppendHeader(dst, bsontype.Array, key), arr)\n}", "title": "" }, { "docid": "8bc9ce5f46423dbebc961b058c1bdea7", "score": "0.5043946", "text": "func (s *internalCircleSliceView) Append(slice []Circle, elemsToAppend ...Circle) ([]Circle, error) {\n\ttarget, allocErr := s.growIfNecessary(slice, len(elemsToAppend))\n\tif allocErr != nil {\n\t\treturn nil, allocErr\n\t}\n\ttarget.Len = len(slice) + len(elemsToAppend)\n\tresult := *(*[]Circle)(unsafe.Pointer(target))\n\tcopy(result[len(slice):], elemsToAppend)\n\treturn result, nil\n}", "title": "" }, { "docid": "79a92ea123b13ee996aeedccb7cbdb99", "score": "0.5006022", "text": "func (r *ListDNSZoneRecordsResponse) UnsafeAppend(res interface{}) (uint32, error) {\n\tresults, ok := res.(*ListDNSZoneRecordsResponse)\n\tif !ok {\n\t\treturn 0, errors.New(\"%T type cannot be appended to type %T\", res, r)\n\t}\n\n\tr.Records = append(r.Records, results.Records...)\n\tr.TotalCount += uint32(len(results.Records))\n\treturn uint32(len(results.Records)), nil\n}", "title": "" }, { "docid": "40a7fc325c3afaba97a48e36c625dafa", "score": "0.4972432", "text": "func (r *ListDNSZonesResponse) UnsafeAppend(res interface{}) (uint32, error) {\n\tresults, ok := res.(*ListDNSZonesResponse)\n\tif !ok {\n\t\treturn 0, errors.New(\"%T type cannot be appended to type %T\", res, r)\n\t}\n\n\tr.DNSZones = append(r.DNSZones, results.DNSZones...)\n\tr.TotalCount += uint32(len(results.DNSZones))\n\treturn uint32(len(results.DNSZones)), nil\n}", "title": "" }, { "docid": "c8dbab9b97f9ac883bb8ca5bbb954efb", "score": "0.49620384", "text": "func (r *ListContactsResponse) UnsafeAppend(res interface{}) (uint32, error) {\n\tresults, ok := res.(*ListContactsResponse)\n\tif !ok {\n\t\treturn 0, errors.New(\"%T type cannot be appended to type %T\", res, r)\n\t}\n\n\tr.Contacts = append(r.Contacts, results.Contacts...)\n\tr.TotalCount += uint32(len(results.Contacts))\n\treturn uint32(len(results.Contacts)), nil\n}", "title": "" }, { "docid": "73b24d3146f14b5d50eaea2ae5cbc8f0", "score": "0.495277", "text": "func (g *Container) ArrayAppendP(value interface{}, path string) error {\n\treturn g.ArrayAppend(value, strings.Split(path, \".\")...)\n}", "title": "" }, { "docid": "b97dc28fd3864c93524c4d363546feed", "score": "0.4928925", "text": "func AppendArrayStart(dst []byte) (index int32, b []byte) { return ReserveLength(dst) }", "title": "" }, { "docid": "8955d0b5d8b703648f6eee5e24ae4ea8", "score": "0.49218172", "text": "func (s *internalCoordinateSliceView) Append(slice []coordinate, elemsToAppend ...coordinate) ([]coordinate, error) {\n\ttarget, allocErr := s.growIfNecessary(slice, len(elemsToAppend))\n\tif allocErr != nil {\n\t\treturn nil, allocErr\n\t}\n\ttarget.Len = len(slice) + len(elemsToAppend)\n\tresult := *(*[]coordinate)(unsafe.Pointer(target))\n\tcopy(result[len(slice):], elemsToAppend)\n\treturn result, nil\n}", "title": "" }, { "docid": "3d0f93ea82b9bcccb9b5fa774e01eca2", "score": "0.49142092", "text": "func sliceForAppend(in []byte, n int) (head, tail []byte) {\n\tif total := len(in) + n; cap(in) >= total {\n\t\thead = in[:total]\n\t} else {\n\t\thead = make([]byte, total)\n\t\tcopy(head, in)\n\t}\n\ttail = head[len(in):]\n\treturn\n}", "title": "" }, { "docid": "3d0f93ea82b9bcccb9b5fa774e01eca2", "score": "0.49142092", "text": "func sliceForAppend(in []byte, n int) (head, tail []byte) {\n\tif total := len(in) + n; cap(in) >= total {\n\t\thead = in[:total]\n\t} else {\n\t\thead = make([]byte, total)\n\t\tcopy(head, in)\n\t}\n\ttail = head[len(in):]\n\treturn\n}", "title": "" }, { "docid": "7a56c9d58b56da6d71ae2e3c82c92160", "score": "0.4900681", "text": "func SliceForAppend(in []byte, n int) (head, tail []byte) {\n\tif total := len(in) + n; cap(in) >= total {\n\t\thead = in[:total]\n\t} else {\n\t\thead = make([]byte, total)\n\t\tcopy(head, in)\n\t}\n\n\ttail = head[len(in):]\n\n\treturn\n}", "title": "" }, { "docid": "43a7da3e703daa15dbfbca0089035e02", "score": "0.49005842", "text": "func (c *curlCommand) append(newSlice ...string) {\n\tc.slice = append(c.slice, newSlice...)\n}", "title": "" }, { "docid": "08724d7526a425adda598c665bb43e59", "score": "0.48908004", "text": "func (a *Arrayb) Append(val *Arrayb, axis int) *Arrayb {\n\tswitch {\n\tcase a.HasErr():\n\t\treturn a\n\tcase axis >= len(a.shape) || axis < 0:\n\t\ta.err = IndexError\n\t\tif debug {\n\t\t\ta.debug = fmt.Sprintf(\"Axis received by Append() out of range. Shape: %v Axis: %v\", a.shape, axis)\n\t\t\ta.stack = string(stackBuf[:runtime.Stack(stackBuf, false)])\n\t\t}\n\t\treturn a\n\tcase val.HasErr():\n\t\ta.err = val.getErr()\n\t\tif debug {\n\t\t\ta.debug = \"Array received by Append() is in error.\"\n\t\t\ta.stack = string(stackBuf[:runtime.Stack(stackBuf, false)])\n\t\t}\n\t\treturn a\n\tcase len(a.shape) != len(val.shape):\n\t\ta.err = ShapeError\n\t\tif debug {\n\t\t\ta.debug = fmt.Sprintf(\"Array received by Append() can not be matched. Shape: %v Val shape: %v\", a.shape, val.shape)\n\t\t\ta.stack = string(stackBuf[:runtime.Stack(stackBuf, false)])\n\t\t}\n\t\treturn a\n\t}\n\n\tfor k, v := range a.shape {\n\t\tif v != val.shape[k] && k != axis {\n\t\t\ta.err = ShapeError\n\t\t\tif debug {\n\t\t\t\ta.debug = fmt.Sprintf(\"Array received by Append() can not be matched. Shape: %v Val shape: %v\", a.shape, val.shape)\n\t\t\t\ta.stack = string(stackBuf[:runtime.Stack(stackBuf, false)])\n\t\t\t}\n\t\t\treturn a\n\t\t}\n\t}\n\n\tln := len(a.data) + len(val.data)\n\tvar dat []bool\n\tcp := cap(a.data)\n\tif ln > cp {\n\t\tdat = append(a.data, make([]bool, ln-cp)...)\n\t} else {\n\t\tdat = a.data[:ln]\n\t}\n\n\tas, vs := a.strides[axis+1], val.strides[axis+1]\n\tfor i, j := a.strides[0], val.strides[0]; i > 0; i, j = i-as, j-vs {\n\t\tcopy(dat[i+j-vs:i+j], val.data[j-vs:j])\n\t\tcopy(dat[i+j-as-vs:i+j-vs], a.data[i-as:i])\n\t}\n\n\ta.data = dat\n\ta.shape[axis] += val.shape[axis]\n\n\tfor i := axis; i >= 0; i-- {\n\t\ta.strides[i] = a.strides[axis+1] * a.shape[i]\n\t}\n\n\treturn a\n}", "title": "" }, { "docid": "ca0df71c1ff1a5964820c9f008627ebf", "score": "0.48803642", "text": "func (r *ListDomainsResponse) UnsafeAppend(res interface{}) (uint32, error) {\n\tresults, ok := res.(*ListDomainsResponse)\n\tif !ok {\n\t\treturn 0, errors.New(\"%T type cannot be appended to type %T\", res, r)\n\t}\n\n\tr.Domains = append(r.Domains, results.Domains...)\n\tr.TotalCount += uint32(len(results.Domains))\n\treturn uint32(len(results.Domains)), nil\n}", "title": "" }, { "docid": "53b9373f178b9055f40e4ea9774be820", "score": "0.48715276", "text": "func (s *SliceUint16) Append(elems ...uint16) *SliceUint16 {\n\tif s == nil {\n\t\treturn nil\n\t}\n\ts.data = append(s.data, elems...)\n\treturn s\n}", "title": "" }, { "docid": "54ee9514bb14d492131d770a686b3e9b", "score": "0.4859688", "text": "func (r *ListImagesResponse) UnsafeAppend(res interface{}) (uint32, error) {\n\tresults, ok := res.(*ListImagesResponse)\n\tif !ok {\n\t\treturn 0, errors.New(\"%T type cannot be appended to type %T\", res, r)\n\t}\n\n\tr.Images = append(r.Images, results.Images...)\n\tr.TotalCount += uint32(len(results.Images))\n\treturn uint32(len(results.Images)), nil\n}", "title": "" }, { "docid": "6ff9c6ccaf516608f6a54641a38ee679", "score": "0.48589545", "text": "func (b *Bytes) Append(bts ...byte) {\n\tvc := (*Vec[byte])(b)\n\tvc.Append(bts...)\n}", "title": "" }, { "docid": "6ba1df1076df521d7caea3a45cb9fbb1", "score": "0.48325032", "text": "func PointerToArrayAppend(ptr uintptr, count uint32, array interface{}) (err error) {\n\tt := reflect.TypeOf(array)\n\n\tbytes = PointerToByteArray(ptr, count, t)\n\treader := bytes.NewReader(bytes)\n\n\tfor {\n\t\telement := reflect.New(t).Interface()\n\t\terr = binary.Read(reader, binary.LittleEndian, &element)\n\t\tif err != nil {\n\t\t\tif err == io.EOF {\n\t\t\t\t// Ignore EOF error as this is expected\n\t\t\t\terr = nil\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\t*array = append(array, element)\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "83e94ac38b8af950fcbc3fc43928400f", "score": "0.48177183", "text": "func NewJSONArrayAppend(args ...sql.Expression) (sql.Expression, error) {\n\treturn nil, ErrUnsupportedJSONFunction.New(JSONArrayAppend{}.FunctionName())\n}", "title": "" }, { "docid": "8c66936b87964aa0dcd91f860a437c6e", "score": "0.47972086", "text": "func (b *Buffer) Append(data []byte) int {\r\n\tnBytes := copy(b.v[b.end:], data)\r\n\tb.end += nBytes\r\n\treturn nBytes\r\n}", "title": "" }, { "docid": "85318ac1d685cbfff97159a0f0195043", "score": "0.47758597", "text": "func AppendSlice(s, t Value) Value {\n\ts.mustBe(Slice)\n\tt.mustBe(Slice)\n\ttypesMustMatch(\"reflect.AppendSlice\", s.Type().Elem(), t.Type().Elem())\n\ts, i0, i1 := grow(s, t.Len())\n\tCopy(s.Slice(i0, i1), t)\n\treturn s\n}", "title": "" }, { "docid": "ccda56635bb746783c00bb72fc4f911d", "score": "0.4771994", "text": "func SliceAppend(arr []int) {\n\tsli := arr[3:8]\n\tfmt.Printf(\"before -> array = %v\\n\", arr)\n\tfmt.Printf(\"before -> sli = %v\\n\", sli)\n\tfmt.Printf(\"before -> len = %d cap = %d\\n\", len(sli), cap(sli))\n\tfmt.Println(\"&arr[3] == &sli[0]\", &arr[3], &sli[0], &arr[3] == &sli[0])\n\n\t/*Appending an array to the sliced array*/\n\tsli = append(sli, 10, 20, 30, 40)\n\tfmt.Printf(\"after -> array = %v\\n\", arr)\n\tfmt.Printf(\"after -> sli = %v\\n\", sli)\n\tfmt.Printf(\"after -> len = %d cap = %d\\n\", len(sli), cap(sli))\n\tfmt.Println(\"&arr[3] == &sli[0]\", &arr[3], &sli[0], &arr[3] == &sli[0])\n}", "title": "" }, { "docid": "ededc558846ebe689887e2f583122e9e", "score": "0.47496697", "text": "func (b *Buffer) AppendByteSlice(v []byte) {\n\tb.AppendUint32(uint32(len(v)))\n\tb.b = append(b.b, v...)\n}", "title": "" }, { "docid": "c13db6a80e7f83bfcc0fb70dbd001649", "score": "0.47485897", "text": "func (r *ListTagsResponse) UnsafeAppend(res interface{}) (uint32, error) {\n\tresults, ok := res.(*ListTagsResponse)\n\tif !ok {\n\t\treturn 0, errors.New(\"%T type cannot be appended to type %T\", res, r)\n\t}\n\n\tr.Tags = append(r.Tags, results.Tags...)\n\tr.TotalCount += uint32(len(results.Tags))\n\treturn uint32(len(results.Tags)), nil\n}", "title": "" }, { "docid": "e9318ae3fb33e057611885f48e3e05d7", "score": "0.47194123", "text": "func (buf *Buffer) Append(row interface{}) []interface{} {\n\tbuf.lock.Lock()\n\tdefer buf.lock.Unlock()\n\tif len(buf.rows) < buf.size {\n\t\tbuf.rows = append(buf.rows, row)\n\t\treturn nil\n\t}\n\trows := buf.rows\n\tbuf.rows = make([]interface{}, 0, buf.size)\n\tbuf.rows = append(buf.rows, row)\n\n\treturn rows\n}", "title": "" }, { "docid": "55f6648237dc32377285acc327a9603d", "score": "0.46969953", "text": "func appendSlice(){\n\tvar a []int\n\tprintSlice(\"a\", a)\n\n\t// append works on nil slices.\n\ta = append(a, 0)\n\tprintSlice(\"a\", a)\n\n\t// the slice grows as needed.\n\ta = append(a, 1)\n\tprintSlice(\"a\", a)\n\n\t// we can add more than one element at a time.\n\ta = append(a, 2, 3, 4)\n\tprintSlice(\"a\", a)\n}", "title": "" }, { "docid": "bf23d65154fddd481cebfca3b51022c7", "score": "0.4639192", "text": "func Append(to Op, items ...ArrayOp) Op {\n\tif len(items) == 0 {\n\t\treturn to\n\t}\n\treturn opAppend{op: to, arrs: opAppendArr{arrs: items}}\n}", "title": "" }, { "docid": "815c136f1a98b7897442b2403379b4e9", "score": "0.46380875", "text": "func (es DoubleExemplarSlice) Append(e DoubleExemplar) {\n\t*es.orig = append(*es.orig, *e.orig)\n}", "title": "" }, { "docid": "f009ef188e206049238e97ba956e3316", "score": "0.46377823", "text": "func appendEx() {\n\n\tc := append(a, b...)\n\n\td := append(c, 7)\n\tfmt.Printf(\"原本数组\", a, c)\n\tfmt.Printf(\"append\", c)\n\tfmt.Printf(\"append\", d)\n\n\tfmt.Printf(\"%p\\n\", &s1)\n\t// fmt.Printf(\"%p\\n\", &s2)\n\n}", "title": "" }, { "docid": "ef65a7bbe880775306fbcbef8f06824c", "score": "0.46377164", "text": "func slice_append() {\n\tvar s []int\n\tfmt.Println(s, \"caps: \", cap(s))\n\n\t// append works on nil slices.\n\ts = append(s, 0)\n\tfmt.Println(s, \"caps: \", cap(s))\n\n\t// We can add more than one element at a time.\n\ts = append(s, 2, 3, 4)\n\tfmt.Println(s, \"caps: \", cap(s))\n\n}", "title": "" }, { "docid": "ca6d88d7af1b2b2c5b0238507882a0c1", "score": "0.46361637", "text": "func (s *SliceUint8) Append(elems ...uint8) *SliceUint8 {\n\tif s == nil {\n\t\treturn nil\n\t}\n\ts.data = append(s.data, elems...)\n\treturn s\n}", "title": "" }, { "docid": "9e14a098f9aed79ef69b6312c3f0812e", "score": "0.46360767", "text": "func (e *tsSlice) Append(n testStruct) {\n\t*e = append(*e, n)\n}", "title": "" }, { "docid": "8c8fbf12a2760928fc8013ca503e9bb9", "score": "0.46259686", "text": "func extendArray(arr []Block) []Block {\n\tarrNew := make([]Block, len(arr)+1)\n\tfor i := range arr {\n\t\tarrNew[i] = arr[i]\n\t}\n\tarr = arrNew\n\treturn arr\n}", "title": "" }, { "docid": "74b5abae7840368f015bec29cd019a63", "score": "0.46112838", "text": "func (r *ListNamespacesResponse) UnsafeAppend(res interface{}) (uint32, error) {\n\tresults, ok := res.(*ListNamespacesResponse)\n\tif !ok {\n\t\treturn 0, errors.New(\"%T type cannot be appended to type %T\", res, r)\n\t}\n\n\tr.Namespaces = append(r.Namespaces, results.Namespaces...)\n\tr.TotalCount += uint32(len(results.Namespaces))\n\treturn uint32(len(results.Namespaces)), nil\n}", "title": "" }, { "docid": "1757b04dcd3f556c73fddcef03b875c6", "score": "0.46051657", "text": "func (f ArrayField) AppendSQLExclude(buf *strings.Builder, args *[]interface{}, params map[string]int, excludedTableQualifiers []string) {\n\tswitch {\n\tcase f.value != nil:\n\t\t// 1) Literal slice value\n\t\tswitch array := f.value.(type) {\n\t\tcase []bool:\n\t\t\tif len(array) == 0 {\n\t\t\t\tbuf.WriteString(\"ARRAY[]::BOOLEAN[]\")\n\t\t\t} else {\n\t\t\t\tbuf.WriteString(\"ARRAY[?\")\n\t\t\t\tbuf.WriteString(strings.Repeat(\", ?\", len(array)-1))\n\t\t\t\tbuf.WriteString(\"]\")\n\t\t\t\tfor _, arg := range array {\n\t\t\t\t\t*args = append(*args, arg)\n\t\t\t\t}\n\t\t\t}\n\t\tcase []float64:\n\t\t\tif len(array) == 0 {\n\t\t\t\tbuf.WriteString(\"ARRAY[]::FLOAT[]\")\n\t\t\t} else {\n\t\t\t\tbuf.WriteString(\"ARRAY[?\")\n\t\t\t\tbuf.WriteString(strings.Repeat(\", ?\", len(array)-1))\n\t\t\t\tbuf.WriteString(\"]\")\n\t\t\t\tfor _, arg := range array {\n\t\t\t\t\t*args = append(*args, arg)\n\t\t\t\t}\n\t\t\t}\n\t\tcase []int:\n\t\t\tif len(array) == 0 {\n\t\t\t\tbuf.WriteString(\"ARRAY[]::INT[]\")\n\t\t\t} else {\n\t\t\t\tbuf.WriteString(\"ARRAY[?\")\n\t\t\t\tbuf.WriteString(strings.Repeat(\", ?\", len(array)-1))\n\t\t\t\tbuf.WriteString(\"]\")\n\t\t\t\tfor _, arg := range array {\n\t\t\t\t\t*args = append(*args, arg)\n\t\t\t\t}\n\t\t\t}\n\t\tcase []int64:\n\t\t\tif len(array) == 0 {\n\t\t\t\tbuf.WriteString(\"ARRAY[]::BIGINT[]\")\n\t\t\t} else {\n\t\t\t\tbuf.WriteString(\"ARRAY[?\")\n\t\t\t\tbuf.WriteString(strings.Repeat(\", ?\", len(array)-1))\n\t\t\t\tbuf.WriteString(\"]\")\n\t\t\t\tfor _, arg := range array {\n\t\t\t\t\t*args = append(*args, arg)\n\t\t\t\t}\n\t\t\t}\n\t\tcase []string:\n\t\t\tif len(array) == 0 {\n\t\t\t\tbuf.WriteString(\"ARRAY[]::TEXT[]\")\n\t\t\t} else {\n\t\t\t\tbuf.WriteString(\"ARRAY[?\")\n\t\t\t\tbuf.WriteString(strings.Repeat(\", ?\", len(array)-1))\n\t\t\t\tbuf.WriteString(\"]\")\n\t\t\t\tfor _, arg := range array {\n\t\t\t\t\t*args = append(*args, arg)\n\t\t\t\t}\n\t\t\t}\n\t\tdefault:\n\t\t\tbuf.WriteString(fmt.Sprintf(\"(unsupported type %#v: only []bool/[]float64/[]int64/[]string/[]int slices are supported.)\", f.value))\n\t\t}\n\tdefault:\n\t\t// 2) Array column\n\t\ttableQualifier := f.table.GetAlias()\n\t\tif tableQualifier == \"\" {\n\t\t\ttableQualifier = f.table.GetName()\n\t\t}\n\t\tfor i := range excludedTableQualifiers {\n\t\t\tif tableQualifier == excludedTableQualifiers[i] {\n\t\t\t\ttableQualifier = \"\"\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif tableQualifier != \"\" {\n\t\t\tif strings.ContainsAny(tableQualifier, \" \\t\") {\n\t\t\t\tbuf.WriteString(`\"`)\n\t\t\t\tbuf.WriteString(tableQualifier)\n\t\t\t\tbuf.WriteString(`\".`)\n\t\t\t} else {\n\t\t\t\tbuf.WriteString(tableQualifier)\n\t\t\t\tbuf.WriteString(\".\")\n\t\t\t}\n\t\t}\n\t\tif strings.ContainsAny(f.name, \" \\t\") {\n\t\t\tbuf.WriteString(`\"`)\n\t\t\tbuf.WriteString(f.name)\n\t\t\tbuf.WriteString(`\"`)\n\t\t} else {\n\t\t\tbuf.WriteString(f.name)\n\t\t}\n\t}\n\tif f.descending != nil {\n\t\tif *f.descending {\n\t\t\tbuf.WriteString(\" DESC\")\n\t\t} else {\n\t\t\tbuf.WriteString(\" ASC\")\n\t\t}\n\t}\n\tif f.nullsfirst != nil {\n\t\tif *f.nullsfirst {\n\t\t\tbuf.WriteString(\" NULLS FIRST\")\n\t\t} else {\n\t\t\tbuf.WriteString(\" NULLS LAST\")\n\t\t}\n\t}\n}", "title": "" }, { "docid": "3bc6dc7d064c4a693b4fa6bddd3e6cf6", "score": "0.45972192", "text": "func Append(slice []interface{}, items ...interface{}) []interface{} {\n\tfor _, item := range items {\n\t\tslice = Extend(slice, item)\n\t}\n\treturn slice\n}", "title": "" }, { "docid": "b22af3815100087a59e641d26cfb13e1", "score": "0.45954484", "text": "func (r *RecvBuf) Append(other []byte) {\n\tif r.size == nil {\n\t\tif len(r.buff) == 0 {\n\t\t\tfor x := 0; x < len(other); x++ {\n\t\t\t\tif x == 9 || other[x] <= 0x7f {\n\t\t\t\t\ts := 0\n\t\t\t\t\tfor i := 0; i <= x; i++ {\n\t\t\t\t\t\ts |= (int(other[i]) & 0x7f) << (7 * i)\n\t\t\t\t\t}\n\t\t\t\t\tr.size = &s\n\t\t\t\t\tt := other[x+1:]\n\t\t\t\t\tif s < len(t) {\n\t\t\t\t\t\tr.buff = append(r.buff, t[:s]...)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tr.buff = append(r.buff, t...)\n\t\t\t\t\t}\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\tr.buff = append(r.buff, other...)\n\t\t} else {\n\t\t\tr.buff = append(r.buff, other...)\n\t\t\tfor x := 0; x < len(r.buff); x++ {\n\t\t\t\tif x == 9 || r.buff[x] <= 0x7f {\n\t\t\t\t\ts := 0\n\t\t\t\t\tfor i := 0; i <= x; i++ {\n\t\t\t\t\t\ts |= (int(r.buff[i]) & 0x7f) << (7 * i)\n\t\t\t\t\t}\n\t\t\t\t\tr.buff = r.buff[x+1:]\n\t\t\t\t\tr.size = &s\n\t\t\t\t\tif len(r.buff) > s {\n\t\t\t\t\t\tr.buff = r.buff[:s]\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif *r.size > len(r.buff) {\n\t\t\tl := *r.size - len(r.buff)\n\t\t\tif l < len(other) {\n\t\t\t\tr.buff = append(r.buff, other[:l]...)\n\t\t\t} else {\n\t\t\t\tr.buff = append(r.buff, other...)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "56e2936fcf941b942d0821135eb7fd4a", "score": "0.45927677", "text": "func (testEntitySynced_EntityInfo) AppendToSlice(slice interface{}, object interface{}) interface{} {\n\tif object == nil {\n\t\treturn append(slice.([]*TestEntitySynced), nil)\n\t}\n\treturn append(slice.([]*TestEntitySynced), object.(*TestEntitySynced))\n}", "title": "" }, { "docid": "2bcf3dc5172b14414a2f3835919f9eff", "score": "0.4591204", "text": "func sliceAppend() {\r\n\ta := [5]int{0, 1, 2, 3, 4}\r\n\ts1 := a[0:3]\r\n\ts2 := a[2:5]\r\n\tfmt.Println(a, s1, s2)\r\n\tfmt.Println(\"len(s1):\", len(s1), \"cap(s1):\", cap(s1))\r\n\tfmt.Println(\"len(s2):\", len(s2), \"cap(s2):\", cap(s2))\r\n\ts2 = append(s2, 5)\r\n\tfmt.Println(a, s1, s2)\r\n\tfmt.Println(\"len(s1):\", len(s1), \"cap(s1):\", cap(s1))\r\n\tfmt.Println(\"len(s2):\", len(s2), \"cap(s2):\", cap(s2))\r\n\r\n}", "title": "" }, { "docid": "066270e951adc4c46632077e6cd5c2f6", "score": "0.4578248", "text": "func (b *OutMessage) Append(src []byte) {\n\tp := b.GrowNoZero(uintptr(len(src)))\n\tif p == nil {\n\t\tpanic(fmt.Sprintf(\"Can't grow %d bytes\", len(src)))\n\t}\n\n\tsh := (*reflect.SliceHeader)(unsafe.Pointer(&src))\n\tmemmove(p, unsafe.Pointer(sh.Data), uintptr(sh.Len))\n\n\treturn\n}", "title": "" }, { "docid": "d0072d8de4c6172981d2107624d08ebf", "score": "0.45566958", "text": "func AppendDocumentEnd(dst []byte, index int32) ([]byte, error) {\n\tif int(index) > len(dst)-4 {\n\t\treturn dst, fmt.Errorf(\"not enough bytes available after index to write length\")\n\t}\n\tdst = append(dst, 0x00)\n\tdst = UpdateLength(dst, index, int32(len(dst[index:])))\n\treturn dst, nil\n}", "title": "" }, { "docid": "99b4c6e271a688da6d7474774cdf4c3c", "score": "0.4550014", "text": "func (r *ListTasksResponse) UnsafeAppend(res interface{}) (uint32, error) {\n\tresults, ok := res.(*ListTasksResponse)\n\tif !ok {\n\t\treturn 0, errors.New(\"%T type cannot be appended to type %T\", res, r)\n\t}\n\n\tr.Tasks = append(r.Tasks, results.Tasks...)\n\tr.TotalCount += uint32(len(results.Tasks))\n\treturn uint32(len(results.Tasks)), nil\n}", "title": "" }, { "docid": "705d272221f6069e4182859a80b5b961", "score": "0.45400766", "text": "func (rb *ringBuffer) AppendAll(dst []*logpb.LogRequestLite_LogEventLite) []*logpb.LogRequestLite_LogEventLite {\n\tfor _, entry := range rb.buf {\n\t\tdst = append(dst, entry...)\n\t}\n\treturn dst\n}", "title": "" }, { "docid": "0a1c92f8cf2866cf0a447972c0f728dc", "score": "0.45383054", "text": "func (testEntityRelated_EntityInfo) AppendToSlice(slice interface{}, object interface{}) interface{} {\n\tif object == nil {\n\t\treturn append(slice.([]*TestEntityRelated), nil)\n\t}\n\treturn append(slice.([]*TestEntityRelated), object.(*TestEntityRelated))\n}", "title": "" }, { "docid": "ed8375ce5e4bdd5e8552a6e72232f909", "score": "0.45314857", "text": "func (es InstrumentationLibraryMetricsSlice) Append(e InstrumentationLibraryMetrics) {\n\t*es.orig = append(*es.orig, e.orig)\n}", "title": "" }, { "docid": "e713ee2e8d679bfabfec26a2dd4b0edd", "score": "0.4524374", "text": "func AppendSliceHybrid(n int) []*MyStruct {\n\tslice := make([]MyStruct, 0, 100)\n\tfor j := 0; j < 100; j++ {\n\t\tslice = append(slice, MyStruct{V: j})\n\t}\n\n\tslicep := make([]*MyStruct, len(slice))\n\tfor j := range slice {\n\t\tslicep[j] = &slice[j]\n\t}\n\treturn slicep\n}", "title": "" }, { "docid": "78f65ffe0896174473b2b51896b7b104", "score": "0.45171875", "text": "func (headMaker) arrayBuf(length int, buf []byte) (int, error) {\n\tif length <= 0 {\n\t\treturn 0, nil\n\t}\n\n\tif length <= 16 {\n\t\tbuf[0] = headerTypeMap[THArraySingle].WithNumber(byte(length))\n\t\treturn 1, nil\n\t}\n\n\tl, err := Numeric.writeUint(buf[1:], uint64(length))\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tbuf[0] = headerTypeMap[THArrayMulti].WithNumber(byte(l))\n\treturn l + 1, nil\n}", "title": "" }, { "docid": "e471bff5c594fb7faf7b7160b9c9f830", "score": "0.4515707", "text": "func (wrapper *JSONWrapper) ArrayAppendCopy(json *JSONWrapper) error {\n\treturn wrapper.ct.ArrayAppend(json.ct)\n}", "title": "" }, { "docid": "9f075acce0d1e9efabfeb66391cc83ee", "score": "0.4511085", "text": "func (rec *Nikon2PreviewSpaceRec) appendImageData(buf []byte, order binary.ByteOrder, offsetField, sizeField Field) error {\n\timageData, err := newImageData(buf, order, offsetField, sizeField)\n\tif err != nil {\n\t\treturn err\n\t}\n\trec.imageData = append(rec.imageData, *imageData)\n\treturn nil\n}", "title": "" }, { "docid": "e550efbe50f0b3f98c8720faf3ac71f1", "score": "0.4495028", "text": "func sliceAppender() {\n\t// double brackets i.e. \"[][]<datatype>\" denotes that there this makes a slice which stores string slice\n\tsliceCollector := make([][]string, 0)\n\n\trecord1 := make([]string, 4)\n\trecord1[0] = \"YO\"\n\trecord1[1] = \"Man\"\n\trecord1[2] = \"Blah\"\n\trecord1[3] = \"This\"\n\n\t// this is appending the string slice to the slice storing slice of string\n\tsliceCollector = append(sliceCollector, record1)\n\tfmt.Println(sliceCollector)\n\n\trecord2 := make([]string, 20)\n\n\trecord2[0] = \"this\"\n\trecord2[1] = \"is\"\n\trecord2[2] = \"the\"\n\trecord2[3] = \"new\"\n\trecord2[4] = \"fun\"\n\n\tsliceCollector = append(sliceCollector, record2)\n\tfmt.Println(sliceCollector)\n}", "title": "" }, { "docid": "e0c760d914bfa1f9da0a3fe7bf7b850c", "score": "0.4491968", "text": "func (enc *Encoder) AddArray(v MarshalerJSONArray) {\n\tenc.Array(v)\n}", "title": "" }, { "docid": "45ec556428883cf73f0d8891f843d4d2", "score": "0.4482052", "text": "func appendr(x byte, xs []byte) []byte {\n\t// TODO: find a better way todo this\n\tans := make([]byte, len(xs)+1)\n\tans[0] = x\n\tfor i := range xs {\n\t\tans[i+1] = xs[i]\n\t}\n\treturn ans\n}", "title": "" }, { "docid": "a6b3efe1e1cb68412437c2628c4648e7", "score": "0.4476814", "text": "func (testStringIdEntity_EntityInfo) AppendToSlice(slice interface{}, object interface{}) interface{} {\n\tif object == nil {\n\t\treturn append(slice.([]*TestStringIdEntity), nil)\n\t}\n\treturn append(slice.([]*TestStringIdEntity), object.(*TestStringIdEntity))\n}", "title": "" }, { "docid": "ce738bdd28da975f98fa6208c0b9e4fc", "score": "0.4473593", "text": "func (n Namespace) Append(b []byte) []byte {\n\treturn append(b, n[:]...)\n}", "title": "" }, { "docid": "d92a8f16ab8360a292ff5485a09834fa", "score": "0.44710034", "text": "func ReadNAppend(r io.Reader, b []byte, n int) ([]byte, error) {\n\tif n == 0 {\n\t\treturn b, nil\n\t}\n\tm := len(b)\n\tb = Expand(b, len(b)+n)\n\t_, err := io.ReadFull(r, b[m:])\n\treturn b, err\n}", "title": "" }, { "docid": "ea6b32407741d83f0dce46a61cd2f8e9", "score": "0.44654605", "text": "func AppendRegex(dst []byte, pattern, options string) []byte {\n\tif !isValidCString(pattern) || !isValidCString(options) {\n\t\tpanic(invalidRegexPanicMsg)\n\t}\n\n\treturn append(dst, pattern+nullTerminator+options+nullTerminator...)\n}", "title": "" }, { "docid": "858ec3323fbbbfc623ddad69419ea983", "score": "0.44450077", "text": "func Append(slice []string, items ...string) []string {\n\tfor _, item := range items {\n\t\tslice = Extend(slice, item)\n\t}\n\treturn slice\n}", "title": "" }, { "docid": "583a11223fad14d1161220f554ceb6cf", "score": "0.44417137", "text": "func Append(dest []byte, m RO) []byte { return append(dest, m.m...) }", "title": "" }, { "docid": "0aefd8be71f5c5312dedac155d04e9a3", "score": "0.44402826", "text": "func Extend(slice []interface{}, element interface{}) []interface{} {\n\tn := len(slice)\n\tif n == cap(slice) {\n\t\t// Slice is full; must grow.\n\t\t// We double its size and add 1, so if the size is zero we still grow.\n\t\tnewSlice := make([]interface{}, len(slice), 2*len(slice)+1)\n\t\tcopy(newSlice, slice)\n\t\tslice = newSlice\n\t}\n\tslice = slice[0 : n+1]\n\tslice[n] = element\n\treturn slice\n}", "title": "" }, { "docid": "f08d873e5284a26c588816035af331c1", "score": "0.44366366", "text": "func (tSDateNano_EntityInfo) AppendToSlice(slice interface{}, object interface{}) interface{} {\n\tif object == nil {\n\t\treturn append(slice.([]*TSDateNano), nil)\n\t}\n\treturn append(slice.([]*TSDateNano), object.(*TSDateNano))\n}", "title": "" }, { "docid": "46eee3183b1528f4318a556a0a2cce89", "score": "0.4435874", "text": "func Append(ret, k interface{}) reflect.Value {\n\tif IsSlice(k) {\n\t\treturn reflect.AppendSlice(ValueOf(ret), ValueOf(k))\n\t}\n\treturn reflect.Append(ValueOf(ret), ValueOf(k))\n}", "title": "" }, { "docid": "9f97e1a4c0f5eaa7851db70771731003", "score": "0.44302067", "text": "func (es ValueAtQuantileSlice) Append(e ValueAtQuantile) {\n\t*es.orig = append(*es.orig, e.orig)\n}", "title": "" }, { "docid": "f909993fb80033e94b0ad30d26beaf88", "score": "0.4426993", "text": "func (a Array) Concat(b Array) Array {\n\treturn append(a, b...)\n}", "title": "" }, { "docid": "e67b6b2f4acb855a064d701f12e6b024", "score": "0.44265306", "text": "func (_m *PrimitiveArrayEncoder) AppendByteString(_a0 []byte) {\n\t_m.Called(_a0)\n}", "title": "" }, { "docid": "aba5b7ed711c02a649110e50277bbee2", "score": "0.44169214", "text": "func AppendDocument(dst []byte, doc []byte) []byte { return append(dst, doc...) }", "title": "" }, { "docid": "5cfb3e83c60712deb5dfb6c2e9bb24da", "score": "0.44157907", "text": "func Append() {\n\tslice := []int{1, 2, 3, 4}\n\tslice = append(slice, 1, 2, 3, 4)\n\tfmt.Println(slice)\n}", "title": "" }, { "docid": "5c285426e06a4beff32bc7d27a366223", "score": "0.44009322", "text": "func (testEntityInline_EntityInfo) AppendToSlice(slice interface{}, object interface{}) interface{} {\n\tif object == nil {\n\t\treturn append(slice.([]*TestEntityInline), nil)\n\t}\n\treturn append(slice.([]*TestEntityInline), object.(*TestEntityInline))\n}", "title": "" }, { "docid": "ef553a4dc1a6dfba575572faae739ba8", "score": "0.4398736", "text": "func (dec *Decoder) AddArrayable(v UnmarshalerJSONArrayable) error {\n\treturn dec.Arrayable(v)\n}", "title": "" }, { "docid": "8a014437eaab58edd5a78ec528bdec59", "score": "0.43923664", "text": "func (es IntExemplarSlice) Append(e IntExemplar) {\n\t*es.orig = append(*es.orig, *e.orig)\n}", "title": "" }, { "docid": "9a5a52a48ce4bebd93bd76b61c8d651c", "score": "0.43914387", "text": "func addFieldToArray(fieldParts []string, fullField string, fieldPrefix string, array []interface{}) ([]interface{}, error) {\n\thead, tail := fieldParts[0], fieldParts[1:]\n\tfieldPrefix += \".\" + head\n\n\t// The first part of the field should be an index of an array\n\theadIndex, ok := isNatNum(head)\n\tif !ok {\n\t\t// We shouldn't ever get here\n\t\tpanic(fmt.Sprintf(\"addFieldToArray expected a natural number field, but instead received %s\", fieldParts[0]))\n\t}\n\n\tif len(tail) == 0 {\n\t\t// We're at the terminus of a field so we have to check if we can append to the array\n\t\tif headIndex == len(array) {\n\t\t\tarray = append(array, true)\n\t\t\treturn array, nil\n\t\t}\n\t\t// headIndex > len(array) => case (6), (7), or (8): headIndex isn't the next index in the array\n\t\t// headIndex < len(array) => case (2), (3), or (4): the element in the array is already set to another value, document, or array\n\t\treturn nil, indexError(fullField)\n\t}\n\n\t// If tail is not empty, we're either adding a new item to array, or we're adding a field to an item\n\t// currently in array. Therefore headIndex cannot be > len(array).\n\tif headIndex > len(array) {\n\t\t// case (6), (7), or (8): headIndex isn't the next index in the array\n\t\treturn nil, indexError(fullField)\n\t}\n\n\t// The tail is not empty which means there is a sub-field and we need to recurse.\n\t// We determine the type implied by the next field in the tail (either document or array).\n\t// If array[headIndex] exists we check the compatibility of the next field with that value.\n\t// If it doesn't exist we create an empty structure of the appropriate type.\n\tif _, ok := isNatNum(tail[0]); ok {\n\t\t// next part of the field refers to an array\n\t\tif headIndex < len(array) {\n\t\t\t// the index already exists in array\n\t\t\t// check the element is an array\n\t\t\tsubArray, ok := array[headIndex].([]interface{})\n\t\t\tif !ok {\n\t\t\t\t// case (4) or (5): We expect array[headIndex] to be an array but it is a map or boolean instead\n\t\t\t\treturn nil, incompatibleError(fullField, fieldPrefix, array[headIndex])\n\t\t\t}\n\t\t\tsubArray, err := addFieldToArray(tail, fullField, fieldPrefix, subArray)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tarray[headIndex] = subArray\n\t\t} else {\n\t\t\t// the element at headIndex doesn't exist yet\n\t\t\tvar subArray []interface{}\n\t\t\tsubArray, err := addFieldToArray(tail, fullField, fieldPrefix, subArray)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tarray = append(array, subArray)\n\t\t}\n\t} else {\n\t\t// next part of the field refers to a document\n\t\tif headIndex < len(array) {\n\t\t\t// the index already exists in array\n\t\t\t// check the element is an document\n\t\t\tsubTree, ok := array[headIndex].(map[string]interface{})\n\t\t\tif !ok {\n\t\t\t\t// case (3) or (5): We expect array[headIndex] to be a map but it is a slice or boolean instead\n\t\t\t\treturn nil, incompatibleError(fullField, fieldPrefix, array[headIndex])\n\t\t\t}\n\t\t\tsubTree, err := addFieldToTree(tail, fullField, fieldPrefix, subTree, true)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tarray[headIndex] = subTree\n\t\t} else {\n\t\t\t// the element at headIndex doesn't exist yet\n\t\t\tsubTree := make(map[string]interface{})\n\t\t\tsubTree, err := addFieldToTree(tail, fullField, fieldPrefix, subTree, true)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tarray = append(array, subTree)\n\t\t}\n\t}\n\treturn array, nil\n\n}", "title": "" }, { "docid": "f9b110f3de5f4b1ef659e7ca4775db8d", "score": "0.43823785", "text": "func (c *Input) Append(mode C.QRencodeMode, r interface{}) error {\n\tb, err := ioutil.ReadAll(r.(io.Reader))\n\tif err != nil {\n\t\treturn err\n\t}\n\tret := C.QRinput_append(c.input, mode, C.int(len(b)), (*C.uchar)(unsafe.Pointer(&b)))\n\tif int(ret) == 0 {\n\t\treturn nil\n\t} else {\n\t\treturn ThrowAndCatchException()\n\t}\n}", "title": "" }, { "docid": "24fb3c56cc00171a5e109717e39e0659", "score": "0.4379108", "text": "func (r *RESP) Array() (*Array, error) {\n\tif r.Type() != ArrayType {\n\t\treturn nil, ErrInvalidType\n\t}\n\n\telements := make(chan *RESP, 1)\n\tarray := &Array{\n\t\tlength: int(r.length),\n\t\tc: elements,\n\t}\n\n\tr.resetType()\n\tgo func(l int) {\n\t\tfor readElems := 0; readElems < l; readElems++ {\n\t\t\telem := New(r.r)\n\t\t\telem.lastWasArray = r.lastWasArray\n\t\t\tswitch elem.Type() {\n\t\t\tcase SimpleStringType:\n\t\t\t\ts, _ := elem.SimpleString()\n\t\t\t\tr.r = elem.r\n\t\t\t\ter := bytes.NewBufferString(s)\n\t\t\t\ter.WriteString(\"\\r\\n\")\n\t\t\t\telem.r = er\n\t\t\t\telem.redisType = SimpleStringType\n\t\t\tcase ErrorType:\n\t\t\t\te := elem.Error()\n\t\t\t\telem.r = bytes.NewBufferString(e.Error())\n\t\t\t\telem.redisType = ErrorType\n\t\t\tcase IntegerType:\n\t\t\t\ti, _ := elem.Int()\n\t\t\t\telem.r = bytes.NewBufferString(fmt.Sprint(i))\n\t\t\t\telem.redisType = IntegerType\n\t\t\tcase NullType:\n\t\t\t\telem.redisType = NullType\n\t\t\tcase BulkStringType:\n\t\t\t\tbs, _ := elem.BulkString()\n\t\t\t\tr.r = elem.r\n\t\t\t\telem.r = io.MultiReader(bs, bytes.NewBufferString(\"\\r\\n\"))\n\t\t\t\telem.redisType = BulkStringType\n\t\t\tcase ArrayType:\n\t\t\t\tr.lastWasArray = array\n\t\t\t}\n\t\t\telements <- elem\n\t\t}\n\t\tclose(elements)\n\t}(int(r.length))\n\n\treturn array, nil\n}", "title": "" }, { "docid": "2fec12b1d392e4335c423df233d2844f", "score": "0.4377149", "text": "func AppendSlice(s string, strs []string) string {\n\treturn s + strings.Join(strs, \"\")\n}", "title": "" }, { "docid": "e99631087434ac255dbdf64c9474a6ed", "score": "0.43681383", "text": "func (stream *Stream) WriteArrayEnd() {\n\tstream.writeIndention(stream.cfg.indentionStep)\n\tstream.indention -= stream.cfg.indentionStep\n\tstream.writeByte(']')\n}", "title": "" }, { "docid": "d0cab75ce08efc645f58e0a659f24a63", "score": "0.43609276", "text": "func (entity_EntityInfo) AppendToSlice(slice interface{}, object interface{}) interface{} {\n\tif object == nil {\n\t\treturn append(slice.([]*Entity), nil)\n\t}\n\treturn append(slice.([]*Entity), object.(*Entity))\n}", "title": "" }, { "docid": "cfb96bf35cb0872c7e9f424c5cd40657", "score": "0.4359518", "text": "func (m *AdditionalFields) AppendTo(fields []zap.Field) []zap.Field {\n\tm.mu.Lock()\n\tfields = append(fields, m.fields...)\n\tfor key, objects := range m.arrays {\n\t\tfields = append(fields, zap.Array(key, objectArray(objects)))\n\t}\n\tm.mu.Unlock()\n\treturn fields\n}", "title": "" }, { "docid": "c3525327d06f9e457572108babdb6778", "score": "0.4350001", "text": "func Append(s reflect.Value, x ...reflect.Value,) reflect.Value", "title": "" }, { "docid": "7752a59756d5eede837412f02048c7c0", "score": "0.4348169", "text": "func (a *Array) AddSlice(values interface{}) {\n\tvaluesContainer := ref.ValueOf(values)\n\tfor i := 0; i < valuesContainer.Len(); i++ {\n\t\tif !a.duplicates {\n\t\t\tvalue := valuesContainer.Index(i)\n\t\t\tif ok := a.checkDuplicates(value); !ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tswitch value.Kind() {\n\t\t\tcase ref.Float32, ref.Float64:\n\t\t\t\ta.data[a.size] = value.Float()\n\t\t\t\ta.size += 1\n\t\t\tcase ref.String:\n\t\t\t\ta.data[a.size] = value.String()\n\t\t\t\ta.size += 1\n\t\t\tcase ref.Int, ref.Int8, ref.Int16, ref.Int32, ref.Int64:\n\t\t\t\ta.data[a.size] = value.Int()\n\t\t\t\ta.size += 1\n\t\t\tcase ref.Uint, ref.Uint8, ref.Uint16, ref.Uint32, ref.Uint64:\n\t\t\t\ta.data[a.size] = value.Uint()\n\t\t\t\ta.size += 1\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ab293e762ea2f7665ed00fd3cadcfcbf", "score": "0.43457472", "text": "func (es ResourceMetricsSlice) Append(e ResourceMetrics) {\n\t*es.orig = append(*es.orig, e.orig)\n}", "title": "" }, { "docid": "c8e91006b84c645b5299de78de4651e9", "score": "0.4340842", "text": "func Append(s interface{}, v interface{}) {\n\tptr, old := getSlicePtr(s)\n\treplace(ptr, old, old.Len(), 0, v)\n}", "title": "" }, { "docid": "b11f6d99db947098b9cc6ce4ad9dd82f", "score": "0.4335619", "text": "func AppendElementToSlice() {\n\tmIDSlice := make([]string,2)\n\tmIDSlice[0] = \"id-1\"\n\tmIDSlice[1] = \"id-2\"\n\tfmt.Println(\"len=\",len(mIDSlice))\n\tfmt.Println(\"cap=\",cap(mIDSlice))\n\tmIDSlice = append(mIDSlice, \"id-3\")\n\tfmt.Println(mIDSlice)\n\tfmt.Println(\"after len=\",len(mIDSlice))\n\tfmt.Println(\"after cap=\",cap(mIDSlice))\n\n}", "title": "" }, { "docid": "cc8987b634275843946d835e4432b7a7", "score": "0.43301794", "text": "func (r *ErrorReport) Append(typ errortype, msg, loc string, idx int) {\n\tif err := r.w.Encode(errordescription{typ, msg, loc, idx}); err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "cd2a8ab2ecaf128cc0d7794182e5b96a", "score": "0.43266937", "text": "func Test_byts_Bytes_Append_(t *testing.T) {\n\tTBegin(t)\n\t//\n\t// (ob *Bytes) Append(b Bytes)\n\t//\n\t// TODO: TEST ob.ar = append(ob.ar, b.ar...)\n}", "title": "" }, { "docid": "5632ea4882c31a0359a3b58a9368089a", "score": "0.43214867", "text": "func (s Slice) Append(items ...interface{}) Slice {\n\treturn Slice(append(s, items...))\n}", "title": "" }, { "docid": "25c4129a0518a076b598430193173b6d", "score": "0.43190056", "text": "func (c *CurlCommand) append(newSlice ...string) {\n\t*c = append(*c, newSlice...)\n}", "title": "" }, { "docid": "9129acbf8025e2ff641f1f34e1fab750", "score": "0.4315457", "text": "func (a *ArrayF32) Append(v ...float32) {\n\t*a = append(*a, v...)\n}", "title": "" }, { "docid": "392c4441304066bb4df618c66e886252", "score": "0.43146637", "text": "func (r *ListHumansResponse) UnsafeAppend(res interface{}) (uint32, error) {\n\tresults, ok := res.(*ListHumansResponse)\n\tif !ok {\n\t\treturn 0, errors.New(\"%T type cannot be appended to type %T\", res, r)\n\t}\n\n\tr.Humans = append(r.Humans, results.Humans...)\n\tr.TotalCount += uint32(len(results.Humans))\n\treturn uint32(len(results.Humans)), nil\n}", "title": "" } ]
a96826acb54f4395bf45bd72720ee852
NewTable generates and returns a new symbole table
[ { "docid": "4d80ffa3008d4fb5f0b717c4d5941d64", "score": "0.6988347", "text": "func NewTable() *SymbolTable {\n\tscope := &SymbolTable{}\n\tscope.scopeStack = []Scope{}\n\tscope.pushOperation = 0\n\tscope.scopesCanGrow = true\n\tscope.lvlStack = levelStack{\n\t\tvalues: [][]int{},\n\t}\n\tscope.PushNewScope()\n\treturn scope\n}", "title": "" } ]
[ { "docid": "5e9366761a7fa035756cfce36e066d88", "score": "0.7101066", "text": "func execNewTable(_ int, p *gop.Context) {\n\targs := p.GetArgs(2)\n\tret, ret1 := gosym.NewTable(args[0].([]byte), args[1].(*gosym.LineTable))\n\tp.Ret(2, ret, ret1)\n}", "title": "" }, { "docid": "5082ee6cc9ddaf3a4e9eacb48322af77", "score": "0.6962518", "text": "func NewTable(symtab []byte, pcln *LineTable) (*Table, error) {}", "title": "" }, { "docid": "389331908bd7ee3c3712e789549476cf", "score": "0.6826279", "text": "func newTable(path string, name string, readMeter metrics.Meter, writeMeter metrics.Meter, sizeGauge metrics.Gauge, disableSnappy bool) (*freezerTable, error) {\n\treturn newCustomTable(path, name, readMeter, writeMeter, sizeGauge, 2*1000*1000*1000, disableSnappy)\n}", "title": "" }, { "docid": "791ab08480552e218f0a7c8218ed7a73", "score": "0.67472917", "text": "func MakeTable(params Params) *Table {\n\ttable := new(Table)\n\ttable.params = params\n\tfor n := 0; n < 256; n++ {\n\t\tcrc := uint16(n) << 8\n\t\tfor i := 0; i < 8; i++ {\n\t\t\tbit := (crc & 0x8000) != 0\n\t\t\tcrc <<= 1\n\t\t\tif bit {\n\t\t\t\tcrc ^= params.Poly\n\t\t\t}\n\t\t}\n\t\ttable.data[n] = crc\n\t}\n\treturn table\n}", "title": "" }, { "docid": "97bffcb8cd7785d55bfe1a31d768f0d1", "score": "0.6675495", "text": "func MakeTable(poly uint64) *crc64.Table", "title": "" }, { "docid": "c6a296bb7fe7d70a4bd8830db7a54c0b", "score": "0.6510394", "text": "func NewTable() *Table {\n\treturn &Table{tb: make(map[interface{}]Unit, 128)}\n}", "title": "" }, { "docid": "24ebd84be670cff01c4ee2a70ef90547", "score": "0.648515", "text": "func simpleMakeTable(poly uint16) *Table {\n\tt := new(Table)\n\tsimplePopulateTable(poly, t)\n\treturn t\n}", "title": "" }, { "docid": "4be77416d107f8fc5c4106ce5c27863b", "score": "0.6482541", "text": "func newFunctionTable(strings *StringTable) *FunctionTable {\n\treturn &FunctionTable{\n\t\tfunctions: make(map[uint32]*Function),\n\t\tstrings: strings,\n\t}\n}", "title": "" }, { "docid": "40a371516e285509971372382ad2544d", "score": "0.6478339", "text": "func newSymtab() *symtab {\n\treturn &symtab{\n\t\ttables: make(map[sqlparser.TableName]*table),\n\t\tuniqueColumns: make(map[string]*column),\n\t}\n}", "title": "" }, { "docid": "94d0c55337b9ad0d791afb12da286ae3", "score": "0.64437145", "text": "func (gtk *Gtk) NewTable(rows, cols int, homogeneous bool) *Table {\r\n\tid := gtk.Guify(\"gtk_table_new\", rows, cols, homogeneous).String()\r\n\treturn NewTable(gtk, id)\r\n}", "title": "" }, { "docid": "48260e3e56e8e55f11e6ea6bafc37efd", "score": "0.6407283", "text": "func NewTable(ty reflect.Type) Table {\n\tif ty.Kind() != reflect.Struct {\n\t\tpanic(fmt.Errorf(\"unknown or unsupported type %v given to NewTable()\", ty))\n\t}\n\tb := new(tablebase)\n\t// we want a pointer to a slice\n\tb.data = reflect.New(reflect.SliceOf(ty)).Interface()\n\treturn finishNewTable(b, ty)\n}", "title": "" }, { "docid": "fe9b5df266782809453122a59faab202", "score": "0.63480395", "text": "func NewTable(name string) Table {\n\treturn &table{\n\t\tname: name,\n\t\tcolumnNameToIndex: make(map[string]int),\n\t}\n}", "title": "" }, { "docid": "edd7468e0fc0d09d931a697fedf34e95", "score": "0.63454235", "text": "func NewTable(name string, layout []Layout) *Table {\n\treturn &Table{\n\t\tName: name,\n\t\tLayout: layout,\n\t}\n}", "title": "" }, { "docid": "f3d992b5bb4a73e53235e9ae9ab285f8", "score": "0.6325317", "text": "func (lccc *LifeCycleSysCC) createChaincodeTable(stub shim.ChaincodeStubInterface, cctable string) error {\n\t// Create table one\n\tvar colDefs []*shim.ColumnDefinition\n\tnameColDef := shim.ColumnDefinition{Name: \"name\",\n\t\tType: shim.ColumnDefinition_STRING, Key: true}\n\tversColDef := shim.ColumnDefinition{Name: \"version\",\n\t\tType: shim.ColumnDefinition_INT32, Key: false}\n\n\t//QUESTION - Should code be separately maintained ?\n\tcodeDef := shim.ColumnDefinition{Name: \"code\",\n\t\tType: shim.ColumnDefinition_BYTES, Key: false}\n\tcolDefs = append(colDefs, &nameColDef)\n\tcolDefs = append(colDefs, &versColDef)\n\tcolDefs = append(colDefs, &codeDef)\n\treturn stub.CreateTable(cctable, colDefs)\n}", "title": "" }, { "docid": "ac18f953854f8a38106b9cedc3eaea80", "score": "0.6317599", "text": "func luaTableNew(L *C.lua_State, narr, nrec int) {\n\tC.lua_createtable(L, C.int(narr), C.int(nrec))\n}", "title": "" }, { "docid": "ed6ea71951fee5ad0d43a22dc7e0bdb4", "score": "0.6256456", "text": "func NewLineTable(data []byte, text uint64) *LineTable {}", "title": "" }, { "docid": "b17c81801eba84fd6e40c2e3a89189f5", "score": "0.61929494", "text": "func NewSymbolTable() *SymbolTable {\n\treturn &SymbolTable{\n\t\tFreeSyms: []Symbol{},\n\t\tstore: make(map[string]Symbol),\n\t\tnumDefinitions: 0,\n\t}\n}", "title": "" }, { "docid": "41b555759e3d1fee1ba1b62ade743a00", "score": "0.6188936", "text": "func NewTable() Table {\n\treturn Table{\n\t\tdata: make(map[uint64]interface{}),\n\t\tmutex: &sync.RWMutex{},\n\t}\n}", "title": "" }, { "docid": "43da279945e0d7cb78e4e0f714be259c", "score": "0.6181278", "text": "func makeNamespaceTable(namespace crdt.Namespace) *monospaceTable {\n\ttable := &monospaceTable{}\n\tcolumns := []string{\n\t\t\"Table\",\n\t\t\"Row\",\n\t\t\"Entry\",\n\t\t\"Point\",\n\t\t// \"Signatures\",\n\t}\n\n\ttable.addColumn(columns...)\n\n\tnamespace.ForeachEntry(func(t crdt.TableName, r crdt.RowName, e crdt.EntryName, entry crdt.Entry) {\n\t\tfor _, point := range entry.GetValues() {\n\t\t\t// sigText := makeSigText(point.Signatures())\n\t\t\trow := []string{\n\t\t\t\tstring(t),\n\t\t\t\tstring(r),\n\t\t\t\tstring(e),\n\t\t\t\tstring(point.Text()),\n\t\t\t\t// sigText,\n\t\t\t}\n\n\t\t\ttable.addRow(row...)\n\t\t}\n\t})\n\n\treturn table\n}", "title": "" }, { "docid": "14cc425435d861173a8e5514c05fefd6", "score": "0.6161717", "text": "func NewTable(gvr client.GVR) *Table {\n\tt := Table{\n\t\tTable: ui.NewTable(gvr),\n\t}\n\tt.envFn = t.defaultEnv\n\n\treturn &t\n}", "title": "" }, { "docid": "2c15853257a891e3bd92031b4b883ecb", "score": "0.6161303", "text": "func NewTable(d Data, root string) *DataTable {\n\tif root == \"\" {\n\t\troot = \"/\"\n\t}\n\troot = util.SanatizeKey(root)\n\treturn &DataTable{\n\t\tdata: d,\n\t\troot: root,\n\t}\n}", "title": "" }, { "docid": "c183d472db26c493acbf5145d58b3c36", "score": "0.6140693", "text": "func NewTable(data []byte, text uint64) (*Table, error) {\n\tlt := &LineTable{\n\t\tData: data,\n\t\tPC: text,\n\t\tstrings: make(map[uint32]string),\n\t}\n\n\tvar t Table\n\tif !lt.isGo12() {\n\t\treturn nil, errors.New(\"not a go1.2+ line table\")\n\t}\n\tt.lt = lt\n\tt.Funcs = make([]Func, 0)\n\tt.Files = make(map[string]*Obj)\n\n\t// Put all functions into one Obj.\n\tt.Objs = make([]Obj, 1)\n\tobj := &t.Objs[0]\n\tt.lt.go12MapFiles(t.Files, obj)\n\n\tt.Funcs = t.lt.go12Funcs()\n\tobj.Funcs = t.Funcs\n\treturn &t, nil\n}", "title": "" }, { "docid": "3c0442c906a648639aa12ab6ca3130df", "score": "0.61397654", "text": "func NewTable(id C.size_t, module *Module) *Table {\n\treturn &Table{\n\t\tid: id,\n\t\tmodule: module,\n\t}\n}", "title": "" }, { "docid": "1b605f33df153ac2d584773371708f58", "score": "0.61332804", "text": "func NewTable(forks int) *Table {\n\n\tif(forks <= 0) {\n\t\tpanic(\"Cannot make table with negative or 0 forks\")\n\t}\n\n\tt := new(Table)\n\tt.forks = make([]*Fork, forks)\n\n\tfor i := 0; i < forks; i++ {\n\t\tt.forks[i] = new(Fork)\n\t}\n\n\treturn t\n}", "title": "" }, { "docid": "8a532816310bd26ca7fdbd033c5acd26", "score": "0.61137146", "text": "func (p *Printer) NewTable() *TableBuilder {\n\treturn &TableBuilder{\n\t\tprinter: p,\n\t\tvalues: map[string]reflect.Value{},\n\t}\n}", "title": "" }, { "docid": "1c493b4568ab3adf21441653cdd04409", "score": "0.61078596", "text": "func NewTable() *Table {\n\treturn &Table{mixedTable: &mixedTable{}}\n}", "title": "" }, { "docid": "2f9d497811b842cba983fd720200d443", "score": "0.61029464", "text": "func NewTable(schemaName, name, alias string, columns ...ColumnExpression) SerializerTable {\n\n\tt := tableImpl{\n\t\tschemaName: schemaName,\n\t\tname: name,\n\t\talias: alias,\n\t\tcolumnList: columns,\n\t}\n\n\tcolumnTableName := name\n\n\tif alias != \"\" {\n\t\tcolumnTableName = alias\n\t}\n\n\tfor _, c := range columns {\n\t\tc.setTableName(columnTableName)\n\t}\n\n\treturn &t\n}", "title": "" }, { "docid": "6069ff2aaa976aab6748a02955388082", "score": "0.60930014", "text": "func NewTable(name string, fields []Field, idIndex uint64) Table {\n\tstructFields := make([]reflect.StructField, 0, 2)\n\tfor _, field := range fields {\n\t\tstructFields = append(structFields, reflect.StructField{\n\t\t\tName: strings.Title(field.Name), // first letter should be capital to make field public\n\t\t\tType: field.Type,\n\t\t\tTag: reflect.StructTag(fmt.Sprintf(`json:\"%s\"`, field.Name)),\n\t\t})\n\t}\n\treturn Table{\n\t\tName: name,\n\t\tFields: fields,\n\t\tIDIndex: idIndex,\n\t\tcontainerType: reflect.StructOf(structFields),\n\t}\n}", "title": "" }, { "docid": "4aa9b9b9ce0fd6769e1397e70c71e319", "score": "0.6047607", "text": "func NewSymbolTable() *SymbolTable {\n\treturn &SymbolTable{\n\t\tsymbols: predefinedSymbols,\n\t\tnextRAMAddress: 16,\n\t}\n}", "title": "" }, { "docid": "25b877ecb7157f59bebecff9f3c8e099", "score": "0.6022238", "text": "func NewTable(any interface{}) (*Table, error) {\n\tif meta.IsSlice(any) {\n\t\tany = meta.CreateElement(any).Interface()\n\t}\n\n\tfields, err := GetFieldsOf(any)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tSetDefaultPK(fields)\n\n\tname, sqlName := ReadTableName(any)\n\n\treturn &Table{\n\t\tName: name,\n\t\tSQLName: sqlName,\n\t\tFields: fields,\n\t}, nil\n}", "title": "" }, { "docid": "5abfc33d9406b92a1e3fdfba6bea5d04", "score": "0.6000497", "text": "func (t *TestMap) NewTable() {\n\tt.m = make(map[string]*TestData)\n}", "title": "" }, { "docid": "dfe5c2f45ba21c5512937a404791d4e4", "score": "0.5999615", "text": "func (t *NetworkInstance) NewTable(Protocol E_OpenconfigPolicyTypes_INSTALL_PROTOCOL_TYPE, AddressFamily E_OpenconfigTypes_ADDRESS_FAMILY) (*NetworkInstance_Table, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Table == nil {\n\t\tt.Table = make(map[NetworkInstance_Table_Key]*NetworkInstance_Table)\n\t}\n\n\tkey := NetworkInstance_Table_Key{\n\t\tProtocol: Protocol,\n\t\tAddressFamily: AddressFamily,\n\t}\n\n\t// Ensure that this key has not already been used in the\n\t// list. Keyed YANG lists do not allow duplicate keys to\n\t// be created.\n\tif _, ok := t.Table[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Table\", key)\n\t}\n\n\tt.Table[key] = &NetworkInstance_Table{\n\t\tProtocol: Protocol,\n\t\tAddressFamily: AddressFamily,\n\t}\n\n\treturn t.Table[key], nil\n}", "title": "" }, { "docid": "dfe5c2f45ba21c5512937a404791d4e4", "score": "0.5999615", "text": "func (t *NetworkInstance) NewTable(Protocol E_OpenconfigPolicyTypes_INSTALL_PROTOCOL_TYPE, AddressFamily E_OpenconfigTypes_ADDRESS_FAMILY) (*NetworkInstance_Table, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Table == nil {\n\t\tt.Table = make(map[NetworkInstance_Table_Key]*NetworkInstance_Table)\n\t}\n\n\tkey := NetworkInstance_Table_Key{\n\t\tProtocol: Protocol,\n\t\tAddressFamily: AddressFamily,\n\t}\n\n\t// Ensure that this key has not already been used in the\n\t// list. Keyed YANG lists do not allow duplicate keys to\n\t// be created.\n\tif _, ok := t.Table[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Table\", key)\n\t}\n\n\tt.Table[key] = &NetworkInstance_Table{\n\t\tProtocol: Protocol,\n\t\tAddressFamily: AddressFamily,\n\t}\n\n\treturn t.Table[key], nil\n}", "title": "" }, { "docid": "725bbe1e611db9fd257dfad0913e146a", "score": "0.5974387", "text": "func NewTable() *Table {\n\treturn &Table{\n\t\tBox: NewBox(),\n\t\tbordersColor: Styles.GraphicsColor,\n\t\tseparator: ' ',\n\t\tlastColumn: -1,\n\t}\n}", "title": "" }, { "docid": "b46e4c7bd84200ee38592e3e85f82e92", "score": "0.59578973", "text": "func NewTable(db *levelDB, prefix string) *Table {\n\treturn &Table{\n\t\tdb: db,\n\t\tprefix: prefix,\n\t}\n}", "title": "" }, { "docid": "5e60b7c0134c39b40f067284b9226e39", "score": "0.59470487", "text": "func NewTable(name string) *Table {\n\ttable := &Table{Name: strings.ToLower(name)}\n\ttable.buildHint()\n\treturn table\n}", "title": "" }, { "docid": "ceee266f60b094e3fec3d7b671dc465c", "score": "0.59376645", "text": "func NewTable(schema string, name string, db *sql.DB) *Table {\n\ttable := &Table{\n\t\tname: name,\n\t\tschema: schema,\n\t\tIsLocked: false,\n\t}\n\n\ttable.getData(db)\n\treturn table\n}", "title": "" }, { "docid": "39e9aac78c30ba151e066757b1f8c274", "score": "0.59322655", "text": "func makeTable() *[8]crc64.Table {\n\tpoly := uint64(0xad93d23594c935a9)\n\ttable := new([8]crc64.Table)\n\tfor i := 0; i < 256; i++ {\n\t\tc := uint8(i)\n\t\tv := uint64(0)\n\t\tfor j := uint8(0x01); j&0xff != 0; j <<= 1 {\n\t\t\tbit := v&0x8000000000000000 != 0\n\t\t\tif c&j != 0 {\n\t\t\t\tbit = !bit\n\t\t\t}\n\t\t\tv <<= 1\n\t\t\tif bit {\n\t\t\t\tv ^= poly\n\t\t\t}\n\n\t\t}\n\t\tvv := v & 0x01\n\t\tfor j := 1; j < 64; j++ {\n\t\t\tv >>= 1\n\t\t\tvv = (vv << 1) | (v & 0x01)\n\t\t}\n\t\ttable[0][i] = vv ^ 0\n\t}\n\t// slice-by-8\n\tfor i := 0; i < 256; i++ {\n\t\tv := table[0][i]\n\t\tfor j := 1; j < 8; j++ {\n\t\t\tv = table[0][v&0xff] ^ (v >> 8)\n\t\t\ttable[j][i] = v\n\t\t}\n\t}\n\treturn table\n}", "title": "" }, { "docid": "ce3267b3b852a73913457f5fcf596ecd", "score": "0.591798", "text": "func NewTable() *Table {\n\t// set pk to a negative value to indicate there isn't one.\n\treturn &Table{pk: -1}\n}", "title": "" }, { "docid": "1a22543a5ee666048b5b62b182c08b4d", "score": "0.58949184", "text": "func (c *Creator) NewTable(cols int) *Table {\n\treturn newTable(cols)\n}", "title": "" }, { "docid": "71bffff47b5485fc293ff8bacd79b54e", "score": "0.5880659", "text": "func newPvTable() pvTable {\n\treturn pvTable{\n\t\ttable: make([]pvEntry, pvTableSize),\n\t\ttimer: 0,\n\t}\n}", "title": "" }, { "docid": "c7b14fac5b43f297f2ae705580eda0ac", "score": "0.5863007", "text": "func New(bs []string) (*Table, error) {\n\tm := make(map[string]bool)\n\tfor _, b := range bs {\n\t\tm[b] = true\n\t}\n\tif len(m) != len(bs) {\n\t\treturn nil, fmt.Errorf(\"table.New does not allow duplicated bindings in %s\", bs)\n\t}\n\treturn &Table{\n\t\tbs: bs,\n\t\tmbs: m,\n\t}, nil\n}", "title": "" }, { "docid": "428d7600fd3223842c6d96c0813100e0", "score": "0.5854433", "text": "func NewTable(opts ...TableOption) Table {\n\treturn newTable(opts...)\n}", "title": "" }, { "docid": "a692e720b5972f2e6391988b7e60d1f4", "score": "0.5820782", "text": "func New(tab *crc64.Table,) hash.Hash64", "title": "" }, { "docid": "3b9a4ef2dff3058e8fd686b92c56b9f0", "score": "0.5814722", "text": "func NewTable(name TableName) *Table {\n\treturn &Table{\n\t\tName: name,\n\t\tFields: make([]*Field, 0),\n\t}\n}", "title": "" }, { "docid": "6a1b4caac5f5535641ed0919f781aaac", "score": "0.58037215", "text": "func newSymtabWithRoute(rb *route) *symtab {\n\treturn &symtab{\n\t\ttables: make(map[sqlparser.TableName]*table),\n\t\tuniqueColumns: make(map[string]*column),\n\t\tsingleRoute: rb,\n\t}\n}", "title": "" }, { "docid": "bdbca4b40c524bde84192f392738ee6f", "score": "0.577901", "text": "func NewTable(name string, cols []Column, hdutype HDUType) (*Table, error) {\n\tvar err error\n\n\tisbinary := true\n\tswitch hdutype {\n\tcase ASCII_TBL:\n\t\tisbinary = false\n\tcase BINARY_TBL:\n\t\tisbinary = true\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"fitsio: invalid HDUType (%v)\", hdutype)\n\t}\n\n\tncols := len(cols)\n\ttable := &Table{\n\t\thdr: Header{},\n\t\tbinary: isbinary,\n\t\tdata: make([]byte, 0),\n\t\theap: make([]byte, 0),\n\t\trowsz: 0, // NAXIS1 in bytes\n\t\tnrows: 0, // NAXIS2\n\t\tcols: make([]Column, ncols),\n\t\tcolidx: make(map[string]int, ncols),\n\t}\n\n\tcopy(table.cols, cols)\n\n\tcards := make([]Card, 0, len(cols)+2)\n\tcards = append(\n\t\tcards,\n\t\tCard{\n\t\t\tName: \"TFIELDS\",\n\t\t\tValue: ncols,\n\t\t\tComment: \"number of fields in each row\",\n\t\t},\n\t)\n\n\toffset := 0\n\tfor i := 0; i < ncols; i++ {\n\t\tcol := &table.cols[i]\n\t\tcol.offset = offset\n\t\tswitch hdutype {\n\t\tcase BINARY_TBL:\n\t\t\tcol.write = col.writeBin\n\t\t\tcol.read = col.readBin\n\t\tcase ASCII_TBL:\n\t\t\tcol.write = col.writeTxt\n\t\t\tcol.read = col.readTxt\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"fitsio: invalid HDUType (%v)\", hdutype)\n\t\t}\n\n\t\ttable.colidx[col.Name] = i\n\n\t\tif col.Format == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"fitsio: column (col=%s) has NO valid format\", col.Name)\n\t\t}\n\n\t\tcards = append(cards,\n\t\t\tCard{\n\t\t\t\tName: fmt.Sprintf(\"TTYPE%d\", i+1),\n\t\t\t\tValue: col.Name,\n\t\t\t\tComment: fmt.Sprintf(\"label for column %d\", i+1),\n\t\t\t},\n\t\t\tCard{\n\t\t\t\tName: fmt.Sprintf(\"TFORM%d\", i+1),\n\t\t\t\tValue: col.Format,\n\t\t\t\tComment: fmt.Sprintf(\"data format for column %d\", i+1),\n\t\t\t},\n\t\t)\n\n\t\tcol.dtype, err = typeFromForm(col.Format, hdutype)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\toffset += col.dtype.dsize * col.dtype.len\n\t\tcol.txtfmt = txtfmtFromForm(col.Format)\n\n\t\tif offset == 0 && i > 0 {\n\t\t\treturn nil, fmt.Errorf(\"fitsio: invalid data-layout\")\n\t\t}\n\n\t\tif col.Unit != \"\" {\n\t\t\tcards = append(cards,\n\t\t\t\tCard{\n\t\t\t\t\tName: fmt.Sprintf(\"TUNIT%d\", i+1),\n\t\t\t\t\tValue: col.Unit,\n\t\t\t\t\tComment: fmt.Sprintf(\"unit for column %d\", i+1),\n\t\t\t\t},\n\t\t\t)\n\t\t}\n\n\t\tif col.Null != \"\" {\n\t\t\tcards = append(cards,\n\t\t\t\tCard{\n\t\t\t\t\tName: fmt.Sprintf(\"TNULL%d\", i+1),\n\t\t\t\t\tValue: col.Null,\n\t\t\t\t\tComment: fmt.Sprintf(\"default value for column %d\", i+1),\n\t\t\t\t},\n\t\t\t)\n\t\t}\n\n\t\tcards = append(cards,\n\t\t\tCard{\n\t\t\t\tName: fmt.Sprintf(\"TSCAL%d\", i+1),\n\t\t\t\tValue: col.Bscale,\n\t\t\t\tComment: fmt.Sprintf(\"scaling offset for column %d\", i+1),\n\t\t\t},\n\t\t)\n\n\t\tcards = append(cards,\n\t\t\tCard{\n\t\t\t\tName: fmt.Sprintf(\"TZERO%d\", i+1),\n\t\t\t\tValue: col.Bzero,\n\t\t\t\tComment: fmt.Sprintf(\"zero value for column %d\", i+1),\n\t\t\t},\n\t\t)\n\n\t\tif col.Start != 0 {\n\t\t\tcards = append(cards,\n\t\t\t\tCard{\n\t\t\t\t\tName: fmt.Sprintf(\"TBCOL%d\", i+1),\n\t\t\t\t\tValue: int(col.Start),\n\t\t\t\t},\n\t\t\t)\n\t\t} else {\n\t\t\tcards = append(cards,\n\t\t\t\tCard{\n\t\t\t\t\tName: fmt.Sprintf(\"TBCOL%d\", i+1),\n\t\t\t\t\tValue: offset - col.dtype.dsize*col.dtype.len + 1,\n\t\t\t\t},\n\t\t\t)\n\t\t}\n\n\t\tif col.Display != \"\" {\n\t\t\tcards = append(cards,\n\t\t\t\tCard{\n\t\t\t\t\tName: fmt.Sprintf(\"TDISP%d\", i+1),\n\t\t\t\t\tValue: col.Display,\n\t\t\t\t\tComment: fmt.Sprintf(\"display format for column %d\", i+1),\n\t\t\t\t},\n\t\t\t)\n\t\t}\n\n\t\tif len(col.Dim) > 0 {\n\t\t\tstr := \"(\"\n\t\t\tfor idim, dim := range col.Dim {\n\t\t\t\tstr += fmt.Sprintf(\"%d\", dim)\n\t\t\t\tif idim+1 < len(col.Dim) {\n\t\t\t\t\tstr += \",\"\n\t\t\t\t}\n\t\t\t}\n\t\t\tstr += \")\"\n\t\t\tcards = append(cards,\n\t\t\t\tCard{\n\t\t\t\t\tName: fmt.Sprintf(\"TDIM%d\", i+1),\n\t\t\t\t\tValue: str,\n\t\t\t\t},\n\t\t\t)\n\t\t}\n\n\t}\n\n\tcards = append(\n\t\tcards,\n\t\tCard{\n\t\t\tName: \"EXTNAME\",\n\t\t\tValue: name,\n\t\t\tComment: \"name of this table extension\",\n\t\t},\n\t)\n\n\tbitpix := 8\n\thdr := newHeader(cards, hdutype, bitpix, []int{offset, 0})\n\ttable.hdr = *hdr\n\ttable.rowsz = offset\n\n\treturn table, err\n}", "title": "" }, { "docid": "d6bc85c6cc7ee8171e5ec7635cc468b4", "score": "0.57533115", "text": "func NewTable(t rtree.Tree, opts ...Option) array.Table {\n\tcfg := newConfig(opts)\n\n\ttbl := &rootTable{\n\t\tmem: cfg.mem,\n\t\ttree: t,\n\t\trefs: 1,\n\t\tschema: SchemaFrom(t),\n\t\tnrows: t.Entries(),\n\t\tncols: int64(len(t.Branches())),\n\t\tcols: make([]*array.Column, len(t.Branches())),\n\t}\n\n\ttbl.init()\n\n\treturn tbl\n}", "title": "" }, { "docid": "c77040d85ac68cc1edbab91377e558ee", "score": "0.5728675", "text": "func (r DBSQLiteInfo) NewTable(pDB *sql.DB, pDDL TableDDL) error {\n\tvar fieldDDL string\n\tvar columnDDL = func(pDDL ColumnDef) string {\n\t\tvar notnull, pk string\n\n\t\tif pDDL.NotNull {\n\t\t\tnotnull = \" \" + \"not null\"\n\t\t}\n\t\tif pDDL.PrimaryKey {\n\t\t\tpk = \" \" + \"PRIMARY KEY\"\n\t\t}\n\t\treturn pDDL.Name + \" \" + pDDL.Type + pk + notnull\n\t}\n\n\tfor k, v := range pDDL.TableFields {\n\t\tif k == 0 {\n\t\t\tfieldDDL = columnDDL(v)\n\t\t} else {\n\t\t\tfieldDDL = fieldDDL + \",\" + columnDDL(v)\n\t\t}\n\t}\n\n\tddl := \"create table \" + pDDL.Name + \"(\" + fieldDDL + \")\"\n\tlog.Println(\"DDL: \", ddl)\n\n\t_, err := pDB.Exec(ddl)\n\treturn err\n}", "title": "" }, { "docid": "d47d59d1fc7fe320144a62c211f9276f", "score": "0.5699583", "text": "func MakeTable(headers []string) Table {\n\tt := MakeHeadlessTable(len(headers))\n\tfor i := range t.columns {\n\t\tt.columns[i].title = headers[i]\n\t\tt.columns[i].width = len(headers[i])\n\t}\n\treturn t\n}", "title": "" }, { "docid": "288360ad9dc569239872350dacc0d057", "score": "0.5696912", "text": "func (m MineInvitepowadd) TableName() string", "title": "" }, { "docid": "ba59ef25710577d7c89b9fd7e808c36a", "score": "0.5690425", "text": "func NewTable(formats ...string) *Table {\n\treturn &Table{formats: formats}\n}", "title": "" }, { "docid": "dc11c860cbf574723eb5f54440a88a4e", "score": "0.5683097", "text": "func NewSplitTable(c *SplitTable) *Table { return &Table{staticLookupTables: c} }", "title": "" }, { "docid": "077d7dd542ff9dff89911d043f2c7ed4", "score": "0.56780815", "text": "func generateTableModel(state map[string]*testdata.TableModel) *rapid.Generator[*testdata.TableModel] {\n\tgenStateTableModel := rapid.Custom(func(t *rapid.T) *testdata.TableModel {\n\t\tpk := rapid.SampledFrom(stateKeys(state)).Draw(t, \"key\")\n\t\treturn state[pk]\n\t})\n\n\tif len(stateKeys(state)) == 0 {\n\t\treturn genTableModel\n\t}\n\treturn rapid.OneOf(genTableModel, genStateTableModel)\n}", "title": "" }, { "docid": "e33662f0e7c2a9a74bae3cfc79eeaeaf", "score": "0.56719476", "text": "func createTestTable(dEnv *env.DoltEnv, tableName string, sch schema.Schema) error {\n\tctx := context.Background()\n\tvrw := dEnv.DoltDB.ValueReadWriter()\n\tns := dEnv.DoltDB.NodeStore()\n\n\tidx, err := durable.NewEmptyIndex(ctx, vrw, ns, sch)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ttbl, err := doltdb.NewTable(ctx, vrw, ns, sch, idx, nil, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tsch, err = tbl.GetSchema(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\troot, err := dEnv.WorkingRoot(ctx)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"%w: %v\", doltdb.ErrNomsIO, err)\n\t}\n\n\tnewRoot, err := root.PutTable(ctx, tableName, tbl)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\trootHash, err := root.HashOf()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tnewRootHash, err := newRoot.HashOf()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif rootHash == newRootHash {\n\t\treturn nil\n\t}\n\treturn dEnv.UpdateWorkingRoot(ctx, newRoot)\n}", "title": "" }, { "docid": "1af36272ad7ef5f584f5d56c384b28b6", "score": "0.567105", "text": "func NewTable(title string) *Panel {\n\tif title == \"\" {\n\t\ttitle = \"Panel Title\"\n\t}\n\trender := \"flot\"\n\treturn &Panel{\n\t\tCommonPanel: CommonPanel{\n\t\t\tOfType: TableType,\n\t\t\tTitle: title,\n\t\t\tType: \"table\",\n\t\t\tRenderer: &render,\n\t\t\tIsNew: true},\n\t\tTablePanel: &TablePanel{}}\n}", "title": "" }, { "docid": "848695483260acbc7f9640ee8ab49e6f", "score": "0.5632233", "text": "func MakeTableDesc(\n\ttableID descpb.ID,\n\tversion descpb.DescriptorVersion,\n\tmodTime hlc.Timestamp,\n\tcols int,\n\tprimaryKeyIndex int,\n) catalog.TableDescriptor {\n\ttd := descpb.TableDescriptor{\n\t\tName: \"foo\",\n\t\tID: tableID,\n\t\tVersion: version,\n\t\tModificationTime: modTime,\n\t\tNextColumnID: 1,\n\t\tPrimaryIndex: descpb.IndexDescriptor{\n\t\t\tID: descpb.IndexID(primaryKeyIndex),\n\t\t},\n\t}\n\tfor i := 0; i < cols; i++ {\n\t\ttd.Columns = append(td.Columns, *MakeColumnDesc(td.NextColumnID))\n\t\ttd.NextColumnID++\n\t}\n\treturn tabledesc.NewBuilder(&td).BuildImmutableTable()\n}", "title": "" }, { "docid": "f9c389253a0692be582ee3ee8d044fe6", "score": "0.5627867", "text": "func (s Storage) createTable(dbName string, stmt *sqlparser.DDL) error {\n\ti, err := s.get(dbName)\n\tif err != nil {\n\t\treturn err\n\t}\n\topts := options(stmt.TableSpec)\n\tt := Table{\n\t\tColumns: columns(stmt.TableSpec, s[i].Charset),\n\t\tEngine: ToEngine(opts[engine]),\n\t\tName: stmt.NewName.Name.String(),\n\t\tRowFormat: ToRowFormat(opts[rowFormat]),\n\t}\n\terr = t.addKeys(stmt.TableSpec)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = t.Analyze()\n\tif err != nil {\n\t\treturn err\n\t}\n\ts[i].Tables = append(s[i].Tables, t)\n\treturn nil\n}", "title": "" }, { "docid": "9b8e7b0c8809a3f1286dd7d45e8aaae7", "score": "0.56219417", "text": "func NewFuncTable(masterPkg *types.Package) *FuncTable {\n\treturn &FuncTable{\n\t\tmasterPkg: masterPkg,\n\t\tfuncs: make(map[string]*sexp.Func, 32),\n\t\texternFuncs: make(map[funcKey]*sexp.Func, 32),\n\t\tmethods: make(map[methodKey]*sexp.Func, 32),\n\t}\n}", "title": "" }, { "docid": "abb7bfd89aa560f27932a72ad697abfe", "score": "0.56099975", "text": "func (b *Builder) NewTable() (*Table, error) {\n\tt := &Table{\n\t\ttableID: b.TblInfo.ID,\n\t\tCount: b.Count,\n\t\tColumns: make(map[int64]*Column, len(b.TblInfo.Columns)),\n\t\tIndices: make(map[int64]*Index, len(b.TblInfo.Indices)),\n\t}\n\tif b.Count == 0 {\n\t\tfor _, col := range b.TblInfo.Columns {\n\t\t\tt.Columns[col.ID] = &Column{Histogram{ID: col.ID}}\n\t\t}\n\t\tfor _, idx := range b.TblInfo.Indices {\n\t\t\tt.Indices[idx.ID] = &Index{\n\t\t\t\tHistogram: Histogram{ID: idx.ID},\n\t\t\t\tNumColumns: len(idx.Columns),\n\t\t\t}\n\t\t}\n\t\treturn t, nil\n\t}\n\tb.doneCh = make(chan *buildStatsTask, len(b.ColIDs)+len(b.IdxIDs))\n\terr := b.splitAndConcurrentBuild(t, b.ColIDs, false)\n\tif err != nil {\n\t\treturn nil, errors.Trace(err)\n\t}\n\tif b.PkID != 0 {\n\t\thg, err := b.buildIndex(t, b.Ctx.GetSessionVars().StmtCtx, b.PkID, b.PkRecords, b.NumBuckets, true)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Trace(err)\n\t\t}\n\t\tt.Columns[hg.ID] = &Column{Histogram: *hg}\n\t}\n\terr = b.splitAndConcurrentBuild(t, b.IdxIDs, true)\n\tif err != nil {\n\t\treturn nil, errors.Trace(err)\n\t}\n\t// The sorted bucket is more accurate, we replace the sampled column histogram with index histogram if the\n\t// index is single column index.\n\tfor _, idxInfo := range b.TblInfo.Indices {\n\t\tif idxInfo != nil && len(idxInfo.Columns) == 1 {\n\t\t\tcolumnOffset := idxInfo.Columns[0].Offset\n\t\t\tcolumnID := b.TblInfo.Columns[columnOffset].ID\n\t\t\tt.Columns[columnID], err = copyFromIndexColumns(t.Indices[idxInfo.ID], columnID)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.Trace(err)\n\t\t\t}\n\t\t}\n\t}\n\t// There may be cases that we have no columnSamples, and only after we build the index columns that we can know it is 0,\n\t// so we should also checked it here.\n\tif t.Count == 0 {\n\t\tfor _, col := range b.TblInfo.Columns {\n\t\t\tt.Columns[col.ID] = &Column{Histogram{ID: col.ID}}\n\t\t}\n\t\tfor _, idx := range b.TblInfo.Indices {\n\t\t\tt.Indices[idx.ID] = &Index{\n\t\t\t\tHistogram: Histogram{ID: idx.ID},\n\t\t\t\tNumColumns: len(idx.Columns),\n\t\t\t}\n\t\t}\n\t}\n\treturn t, nil\n}", "title": "" }, { "docid": "a82a30997214ee1258396f30768b82bd", "score": "0.5603709", "text": "func New(w io.Writer, header []string) *Table {\n\ttw := new(tabwriter.Writer)\n\n\ttw.Init(w, 2, 8, 2, '\\t', 0)\n\n\tvar headerTransformed = make([]string, len(header))\n\tfor i, h := range header {\n\t\th = strings.ToUpper(h)\n\t\theaderTransformed[i] = strings.Replace(h, \" \", \"_\", -1)\n\t}\n\tfmt.Fprintln(tw, strings.Join(headerTransformed, \"\\t\"))\n\n\treturn &Table{tw}\n}", "title": "" }, { "docid": "e2e627686282b19369da03adaad93303", "score": "0.5598697", "text": "func testTable() *Table {\n\tx := newSingleLevelTestTable()\n\tx.insertSingleLevel(route4b{12, 2})\n\tx.insertSingleLevel(route4b{14, 3})\n\tx.insertSingleLevel(route4b{8, 1})\n\treturn x\n}", "title": "" }, { "docid": "a56e2e212862a55099fb1a97f7b3b7a1", "score": "0.5576021", "text": "func NewTable(ctx *pulumi.Context,\n\tname string, args *TableArgs, opts ...pulumi.ResourceOption) (*Table, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.CatalogId == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'CatalogId'\")\n\t}\n\tif args.DatabaseName == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'DatabaseName'\")\n\t}\n\tif args.TableInput == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'TableInput'\")\n\t}\n\topts = internal.PkgResourceDefaultOpts(opts)\n\tvar resource Table\n\terr := ctx.RegisterResource(\"aws-native:glue:Table\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "97d41faef271c46686bee87153fbe3b6", "score": "0.55613506", "text": "func newDynamoTable(tableName, endpoint string) (dynamo.Table, error) {\n\tif tableName == \"\" {\n\t\treturn dynamo.Table{}, fmt.Errorf(\"you must supply a table name\")\n\t}\n\tcfg := aws.Config{}\n\tcfg.Region = aws.String(\"eu-west-2\")\n\tif endpoint != \"\" {\n\t\tcfg.Endpoint = aws.String(endpoint)\n\t}\n\tsess := session.Must(session.NewSession())\n\tdb := dynamo.New(sess, &cfg)\n\ttable := db.Table(tableName)\n\treturn table, nil\n}", "title": "" }, { "docid": "ec15d168cf8a030ebb947acdf26e7d45", "score": "0.55613416", "text": "func NewSignalTable() *SignalTable {\n\ttable := new(SignalTable)\n\ttable.shs = make(map[os.Signal]signalHandler)\n\ttable.state.Init()\n\treturn table\n}", "title": "" }, { "docid": "8f2f97abc47418f37200d4a47baf0186", "score": "0.5547223", "text": "func (t *signatureHandler) createTable(stub *shim.ChaincodeStub) error {\n\n\t// Create asset signature table\n\treturn stub.CreateTable(tableColumn, []*shim.ColumnDefinition{\n\t\t&shim.ColumnDefinition{Name: columnAccountID, Type: shim.ColumnDefinition_STRING, Key: true},\n\t\t&shim.ColumnDefinition{Name: columnFileSignature, Type: shim.ColumnDefinition_BYTES, Key: true},\n\t\t&shim.ColumnDefinition{Name: columnFileHash, Type: shim.ColumnDefinition_STRING, Key: true},\n\t\t&shim.ColumnDefinition{Name: columnCertificate, Type: shim.ColumnDefinition_STRING, Key: false},\n\t\t&shim.ColumnDefinition{Name: columnFileName, Type: shim.ColumnDefinition_STRING, Key: false},\n\t\t&shim.ColumnDefinition{Name: columnTimestamp, Type: shim.ColumnDefinition_STRING, Key: false},\n\t})\n}", "title": "" }, { "docid": "20c704b5398a585acd10d369b3d042a1", "score": "0.55146545", "text": "func (w *worker) newPriceTable() {\n\tif w.staticPriceTable() != nil {\n\t\tw.renter.log.Critical(\"creating a new price table when a new price table already exists\")\n\t}\n\tw.staticSetPriceTable(new(workerPriceTable))\n}", "title": "" }, { "docid": "61c9749a2e8e1918fc826edbbb25c422", "score": "0.5509826", "text": "func MakeHeadlessTable(columnCount int) Table {\n\treturn Table{\n\t\tcolumns: make([]column, columnCount),\n\t\trows: make([][]string, 0),\n\t}\n}", "title": "" }, { "docid": "43fc459d242183828eb7a935ecaa7f18", "score": "0.5506974", "text": "func Make_table (rawtable string, class string) (html string) {\n html = \"\"\n class = strings.Trim(class, \":\")\n ndx1 := []int{0}\n ok := false\n even := true\n arr := strings.Split(rawtable, \"\\n\")\n // find all column index positions in first row\n m := compiledRegex[\"tableColumn\"].FindAllStringIndex(arr[0], -1)\n for n := range m {\n ok = true\n ndx1 = append(ndx1, m[n][0]+2)\n }\n if ok {\n rowno := 0;\n // shift ndx1 into ndx2\n ndx2 := append(ndx1[1:], 0)\n // iterate for each table row\n for _, s := range arr {\n colno := 0;\n row := \"\"\n ndx2[len(ndx2)-1] = len(s)\n // iterate for each cell\n for n, i := range ndx1 {\n r := ndx2[n]\n str := strings.Trim(s[i:r], \" \")\n row += \" \" + Make_tag(\"div\", str, \"cell colno_\"+strconv.Itoa(colno)) + \"\\n\"\n colno++\n }\n html += Make_tag(\"div\", \"\\n\"+row, \"row rowno_\"+strconv.Itoa(rowno)) + \"\\n\"\n rowno++\n if even {\n\n }\n }\n\n if class != \"\" {\n class += \" \"\n }\n class += \"table\"\n html = Make_tag(\"div\", \"\\n\"+html, class) + \"\\n\"\n }\n return\n}", "title": "" }, { "docid": "1d700fa2d378f664e5170cab5acd9d67", "score": "0.5505849", "text": "func NewTable() *uitable.Table {\n\ttable := uitable.New()\n\n\ttable.MaxColWidth = 80\n\ttable.Wrap = true\n\n\treturn table\n}", "title": "" }, { "docid": "d9a259354797435e1eecf887d9269b07", "score": "0.54961675", "text": "func CreateSuperCommandTable(tx *sqlx.Tx) error {\n\t_, err := tx.Exec(\"CREATE TABLE `super_commands` (`name` varchar(255) NOT NULL, `proc` varchar(255) NOT NULL, PRIMARY KEY(`name`))\")\n\treturn err\n}", "title": "" }, { "docid": "a46dea42228dc3821bf6860e07d6d870", "score": "0.548803", "text": "func (conn *DBConnection) createLabelTable() {\n\tvar vendor = conn.databaser\n\n\tdb, err := sql.Open(vendor.Driver(), vendor.Name())\n\tif err != nil {\n\t\tfmt.Println(\"Error on open of database\", err)\n\t\treturn\n\t}\n\tdefer db.Close()\n\n\t_, err = db.Exec(createLabelTable)\n\tif err != nil {\n\t\tfmt.Printf(\"Error creating Labels table, driver \\\"%s\\\",\"+\n\t\t\t\"modelname \\\"%s\\\", query = \\\"%s\\\"\\n\",\n\t\t\tvendor.Driver(), vendor.Name(), createLabelTable)\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "35d0c63fcada344ba24a12c128a2eab3", "score": "0.5486862", "text": "func (me identifier) Table(table string) IdentifierExpression {\n\tret := me.clone()\n\tif s, ok := me.col.(string); ok && s != \"\" && me.table == \"\" && me.schema == \"\" {\n\t\tret.schema = s\n\t\tret.col = nil\n\t}\n\tret.table = table\n\treturn ret\n}", "title": "" }, { "docid": "67ac92410d4f8f35a93e947bdaa17e21", "score": "0.54806733", "text": "func newHashTable(capacity int, wordLen int) (t *hashTable, err error) {\n\tif !(0 < capacity) {\n\t\treturn nil, errors.New(\n\t\t\t\"newHashTable: capacity must not be negative\")\n\t}\n\texp := hashTableExponent(uint32(capacity))\n\tif !(1 <= wordLen && wordLen <= 4) {\n\t\treturn nil, errors.New(\"newHashTable: \" +\n\t\t\t\"argument wordLen out of range\")\n\t}\n\tn := 1 << uint(exp)\n\tif n <= 0 {\n\t\tpanic(\"newHashTable: exponent is too large\")\n\t}\n\tt = &hashTable{\n\t\tt: make([]int64, n),\n\t\tdata: make([]uint32, capacity),\n\t\tmask: (uint64(1) << uint(exp)) - 1,\n\t\thoff: -int64(wordLen),\n\t\twordLen: wordLen,\n\t\twr: newRoller(wordLen),\n\t\thr: newRoller(wordLen),\n\t}\n\treturn t, nil\n}", "title": "" }, { "docid": "d7730eb35f8778739c8230883cba584f", "score": "0.5463086", "text": "func simplePopulateTable(poly uint16, t *Table) {\n\tfor i := 0; i < 256; i++ {\n\t\tcrc := uint16(i) << 8\n\t\tfor j := 0; j < 8; j++ {\n\t\t\tif crc&(1<<15) != 0 {\n\t\t\t\tcrc = (crc << 1) ^ poly\n\t\t\t} else {\n\t\t\t\tcrc <<= 1\n\t\t\t}\n\t\t}\n\t\tt[i] = crc\n\t}\n}", "title": "" }, { "docid": "88862c28ea9477fdd33f1e69ed1bc03f", "score": "0.54599", "text": "func NewTable(ctx *pulumi.Context,\n\tname string, args *TableArgs, opts ...pulumi.ResourceOption) (*Table, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.DatabaseName == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'DatabaseName'\")\n\t}\n\topts = internal.PkgResourceDefaultOpts(opts)\n\tvar resource Table\n\terr := ctx.RegisterResource(\"aws-native:timestream:Table\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "725ba87c2b4feda28255fb212124cffc", "score": "0.54507333", "text": "func buildTable(trackInput TrackInput) table.Writer{\n\tvar header table.Row\n\theader = append(header, \"STEP\")\n\tfor i := 1; i <= trackInput.NumberOfSteps; i++ {\n\t\theader = append(header, strconv.Itoa(i))\n\t}\n\tt := table.NewWriter()\n\tt.AppendHeader(header)\n\tfor _, pattern := range trackInput.Patterns {\n\t\tvar row table.Row\n\t\tsound := pattern.Sound\n\t\tsteps := pattern.Steps\n\t\trow = append(row, sound.Name)\n\t\tfor i := 1; i <= trackInput.NumberOfSteps; i++ {\n\t\t\tif contains(steps, i) {\n\t\t\t\trow = append(row, \"X\")\n\t\t\t}else {\n\t\t\t\trow = append(row, \"_\")\n\t\t\t}\n\t\t}\n\t\tt.AppendRow(row)\n\t}\n\treturn t\n}", "title": "" }, { "docid": "5ad43761d3d4966c55e337dbc1fe8b63", "score": "0.5446325", "text": "func newCustomTable(path string, name string, readMeter metrics.Meter, writeMeter metrics.Meter, sizeGauge metrics.Gauge, maxFilesize uint32, noCompression bool) (*freezerTable, error) {\n\t// Ensure the containing directory exists and open the indexEntry file\n\tif err := os.MkdirAll(path, 0755); err != nil {\n\t\treturn nil, err\n\t}\n\tvar idxName string\n\tif noCompression {\n\t\t// Raw idx\n\t\tidxName = fmt.Sprintf(\"%s.ridx\", name)\n\t} else {\n\t\t// Compressed idx\n\t\tidxName = fmt.Sprintf(\"%s.cidx\", name)\n\t}\n\toffsets, err := openFreezerFileForAppend(filepath.Join(path, idxName))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// Create the table and repair any past inconsistency\n\ttab := &freezerTable{\n\t\tindex: offsets,\n\t\tfiles: make(map[uint32]*os.File),\n\t\treadMeter: readMeter,\n\t\twriteMeter: writeMeter,\n\t\tsizeGauge: sizeGauge,\n\t\tname: name,\n\t\tpath: path,\n\t\tlogger: log.New(\"database\", path, \"table\", name),\n\t\tnoCompression: noCompression,\n\t\tmaxFileSize: maxFilesize,\n\t}\n\tif err := tab.repair(); err != nil {\n\t\ttab.Close()\n\t\treturn nil, err\n\t}\n\t// Initialize the starting size counter\n\tsize, err := tab.sizeNolock()\n\tif err != nil {\n\t\ttab.Close()\n\t\treturn nil, err\n\t}\n\ttab.sizeGauge.Inc(int64(size))\n\n\treturn tab, nil\n}", "title": "" }, { "docid": "654ba835601400352c466dd39deb178c", "score": "0.54454523", "text": "func (p *Parser) NewTableInit() error {\n\n\tfields := []map[string]string{{\"global\": \"int64\"}, {\"table_name\": \"string\"}, {\"columns\": \"string\"}, {\"sign\": \"bytes\"}}\n\terr := p.GetTxMaps(fields)\n\tif err != nil {\n\t\treturn p.ErrInfo(err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "527ed2bf2593fbfa84bebb2daebf88d8", "score": "0.5440939", "text": "func NewTableFrom(f *File, name string, v Value, hdutype HDUType) (*Table, error) {\n\trv := reflect.Indirect(reflect.ValueOf(v))\n\trt := rv.Type()\n\tif rt.Kind() != reflect.Struct {\n\t\treturn nil, fmt.Errorf(\"cfitsio: NewTableFrom takes a struct value. got: %T\", v)\n\t}\n\tcols := make([]Column, rt.NumField())\n\tfor i := range cols {\n\t\tft := rt.Field(i)\n\t\tname := ft.Tag.Get(\"fits\")\n\t\tif name == \"\" {\n\t\t\tname = ft.Name\n\t\t}\n\t\tn := 0\n\t\tif ft.Type.Kind() == reflect.Array {\n\t\t\tn = ft.Type.Len()\n\t\t}\n\t\tcols[i] = Column{\n\t\t\tName: name,\n\t\t\tLen: n,\n\t\t\tValue: rv.Field(i).Interface(),\n\t\t}\n\t}\n\treturn NewTable(f, name, cols, hdutype)\n}", "title": "" }, { "docid": "e538c5465fa2f5b8f4cc3854236d7a94", "score": "0.54199344", "text": "func makeSymtab(up *symtab) *symtab {\n\treturn &symtab{Up: up, Decls: make(map[string]Declaration)}\n}", "title": "" }, { "docid": "e2598ae5c5a2e4d9881ef9dd8e6a7bf7", "score": "0.5418944", "text": "func makeTable(zones []table, cols ...string) {\n\t// Store the maximum length of all columns\n\t// The default is the length of the title\n\tlens := make(map[string]int)\n\tfor _, col := range cols {\n\t\tlens[col] = len(col)\n\t}\n\t// Increase the size of the column if it is larger than the current value\n\tfor _, z := range zones {\n\t\tfor col, val := range z {\n\t\t\tif _, ok := lens[col]; ok && len(val) > lens[col] {\n\t\t\t\tlens[col] = len(val)\n\t\t\t}\n\t\t}\n\t}\n\t// Print the headings and an underline for each heading\n\tfor _, col := range cols {\n\t\tfmt.Printf(\"%s%s \", strings.Title(col), strings.Repeat(\" \", lens[col]-len(col)))\n\t}\n\tfmt.Println()\n\tfor _, col := range cols {\n\t\tfmt.Printf(\"%s \", strings.Repeat(\"-\", lens[col]))\n\t}\n\tfmt.Println()\n\t// And finally print the table data\n\tfor _, z := range zones {\n\t\tfor _, col := range cols {\n\t\t\tfmt.Printf(\"%s%s \", z[col], strings.Repeat(\" \", lens[col]-len(z[col])))\n\t\t}\n\t\tfmt.Println()\n\t}\n\n}", "title": "" }, { "docid": "f521a0c8b7ed4269c1cd2310cd7ee93c", "score": "0.54119664", "text": "func NewTable() *Table {\n\ttable := tview.NewTable().\n\t\tSetSelectable(true, false).\n\t\tSetCell(0, 0, tview.NewTableCell(\"Done\").SetSelectable(false)).\n\t\tSetCell(0, 1, tview.NewTableCell(\"Deadline\").SetSelectable(false)).\n\t\tSetCell(0, 2, tview.NewTableCell(\"Assignee\").SetSelectable(false)).\n\t\tSetCell(0, 3, tview.NewTableCell(\"Title\").SetSelectable(false).SetExpansion(1)).\n\t\tSetSelectedStyle(tcell.ColorWhite, tcell.ColorBlue, 0)\n\n\treturn &Table{\n\t\tTable: table,\n\t\ttodos: []todo.Todo{},\n\t}\n}", "title": "" }, { "docid": "50b08655efe5782dc3b28fee24784451", "score": "0.5409057", "text": "func (table *DDBTable) MakeTable() {\n\tsvc := dynamodb.New(getSess())\n\tinput := &dynamodb.CreateTableInput{\n\t\tAttributeDefinitions: []*dynamodb.AttributeDefinition{\n\t\t\t{\n\t\t\t\tAttributeName: aws.String(table.Hkey.Name),\n\t\t\t\tAttributeType: aws.String(table.Hkey.AwsType),\n\t\t\t},\n\t\t\t{\n\t\t\t\tAttributeName: aws.String(table.Rkey.Name),\n\t\t\t\tAttributeType: aws.String(table.Rkey.AwsType),\n\t\t\t},\n\t\t},\n\t\tKeySchema: []*dynamodb.KeySchemaElement{\n\t\t\t{\n\t\t\t\tAttributeName: aws.String(table.Hkey.Name),\n\t\t\t\tKeyType: aws.String(\"HASH\"),\n\t\t\t},\n\t\t\t{\n\t\t\t\tAttributeName: aws.String(table.Rkey.Name),\n\t\t\t\tKeyType: aws.String(\"RANGE\"),\n\t\t\t},\n\t\t},\n\t\tProvisionedThroughput: &dynamodb.ProvisionedThroughput{\n\t\t\tReadCapacityUnits: aws.Int64(10),\n\t\t\tWriteCapacityUnits: aws.Int64(10),\n\t\t},\n\t\tTableName: aws.String(table.Name),\n\t}\n\t_, err := svc.CreateTable(input)\n\tif err != nil {\n\t\tfmt.Println(\"Got error calling CreateTable:\")\n\t\tfmt.Println(err.Error())\n\t\t// os.Exit(1)\n\t} else {\n\t\tfmt.Println(\"Created the table\", table.Name)\n\t}\n\ttime.Sleep(2 * time.Second)\n}", "title": "" }, { "docid": "e31c05a4cc893a5faf6653c723e67407", "score": "0.5408173", "text": "func (n *NetworkInstance) Table(Protocol oc.E_OpenconfigPolicyTypes_INSTALL_PROTOCOL_TYPE, AddressFamily oc.E_OpenconfigTypes_ADDRESS_FAMILY) *NetworkInstance_Table {\n\treturn &NetworkInstance_Table{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"tables\", \"table\"},\n\t\t\tmap[string]interface{}{\"protocol\": Protocol, \"address-family\": AddressFamily},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "e31c05a4cc893a5faf6653c723e67407", "score": "0.54073524", "text": "func (n *NetworkInstance) Table(Protocol oc.E_OpenconfigPolicyTypes_INSTALL_PROTOCOL_TYPE, AddressFamily oc.E_OpenconfigTypes_ADDRESS_FAMILY) *NetworkInstance_Table {\n\treturn &NetworkInstance_Table{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"tables\", \"table\"},\n\t\t\tmap[string]interface{}{\"protocol\": Protocol, \"address-family\": AddressFamily},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "ce711d8686a9547d76d7a9b539261210", "score": "0.5407035", "text": "func (db *Database) AddNewTable(ts *meta.Schema, ti *meta.Info) {\n\tdb.UpdateState(func(state *DbState) {\n\t\tif state.Meta.GetRoSchema(ts.Table) != nil {\n\t\t\tpanic(\"duplicate table\")\n\t\t}\n\t\tstate.Meta = state.Meta.Put(ts, ti)\n\t})\n}", "title": "" }, { "docid": "c17fe615522b677908c49bdb2eb81436", "score": "0.5398334", "text": "func Table() string {\n\treturn `\n\tCREATE TABLE sessions (\n\t\ttoken string,\n\t\tdata blob,\n\t\texpiry time\n\t)\n\t`\n}", "title": "" }, { "docid": "f646d3191c358765a0026777f2069fe5", "score": "0.53876156", "text": "func (a *Adapter) createTable() error {\n\tsql := `\n\t\tCREATE TABLE IF NOT EXISTS %s (\n\t\t\tptype VARCHAR(10) NOT NULL DEFAULT '' COMMENT '',\n\t\t\tv0 VARCHAR(256) NOT NULL DEFAULT '' COMMENT '',\n\t\t\tv1 VARCHAR(256) NOT NULL DEFAULT '' COMMENT '',\n\t\t\tv2 VARCHAR(256) NOT NULL DEFAULT '' COMMENT '',\n\t\t\tv3 VARCHAR(256) NOT NULL DEFAULT '' COMMENT '',\n\t\t\tv4 VARCHAR(256) NOT NULL DEFAULT '' COMMENT '',\n\t\t\tv5 VARCHAR(256) NOT NULL DEFAULT '' COMMENT ''\n\t\t) ENGINE = InnoDB COMMENT = 'policy table';\n\t`\n\t_, err := a.db.Exec(fmt.Sprintf(sql, a.TableName))\n\n\treturn err\n}", "title": "" }, { "docid": "04c3ca61fa9616be7d1165c0a5bda604", "score": "0.5367079", "text": "func NewSimpleTable(recs []Value, h hash.Hash, attrs TableAttrs) Table {\n\tif h == hash.Zero {\n\t\tlog.Panicf(\"empty hash\")\n\t}\n\tv := &simpleTable{\n\t\trows: make([]Value, len(recs)),\n\t\thash: h,\n\t\tattrs: attrs,\n\t}\n\tcopy(v.rows, recs)\n\treturn v\n}", "title": "" }, { "docid": "166c0759a96e9fe85d572c6769110f08", "score": "0.5359674", "text": "func NewTable(f *File, name string, cols []Column, hdutype HDUType) (*Table, error) {\n\tvar err error\n\tvar table *Table\n\tmode, err := f.Mode()\n\tif err != nil {\n\t\treturn table, err\n\t}\n\tif mode == ReadOnly {\n\t\treturn table, READONLY_FILE\n\t}\n\n\tnhdus := len(f.hdus)\n\n\tif len(cols) <= 0 {\n\t\treturn table, fmt.Errorf(\"cfitsio.NewTable: invalid number of columns (%v)\", len(cols))\n\t}\n\n\tc_status := C.int(0)\n\tc_sz := C.int(len(cols))\n\tc_types := C.char_array_new(c_sz)\n\tdefer C.free(unsafe.Pointer(c_types))\n\tc_forms := C.char_array_new(c_sz)\n\tdefer C.free(unsafe.Pointer(c_forms))\n\tc_units := C.char_array_new(c_sz)\n\tdefer C.free(unsafe.Pointer(c_units))\n\tc_hduname := C.CString(name)\n\tdefer C.free(unsafe.Pointer(c_hduname))\n\n\tfor i := 0; i < len(cols); i++ {\n\t\tc_idx := C.int(i)\n\t\tcol := &cols[i]\n\t\tc_name := C.CString(col.Name)\n\t\tdefer C.free(unsafe.Pointer(c_name))\n\t\tC.char_array_set(c_types, c_idx, c_name)\n\n\t\terr = col.inferFormat(hdutype)\n\t\tif err != nil {\n\t\t\treturn table, err\n\t\t}\n\t\tc_form := C.CString(col.Format)\n\t\tdefer C.free(unsafe.Pointer(c_form))\n\t\tC.char_array_set(c_forms, c_idx, c_form)\n\n\t\tc_unit := C.CString(col.Unit)\n\t\tdefer C.free(unsafe.Pointer(c_unit))\n\t\tC.char_array_set(c_units, c_idx, c_unit)\n\t}\n\n\tC.fits_create_tbl(f.c, C.int(hdutype), 0, C.int(len(cols)), c_types, c_forms, c_units, c_hduname, &c_status)\n\tif c_status > 0 {\n\t\treturn table, to_err(c_status)\n\t}\n\n\thdu, err := f.readHDU(nhdus)\n\tif err != nil {\n\t\treturn table, err\n\t}\n\tf.hdus = append(f.hdus, hdu)\n\ttable = hdu.(*Table)\n\n\treturn table, err\n}", "title": "" }, { "docid": "dfd0b056bdb212c6054b947459de1e87", "score": "0.5355178", "text": "func createTable(s *gocql.Session, table string) error {\n\n\tq := s.Query(table)\n\tdefer q.Release()\n\n\tif err := q.Exec(); err != nil {\n\t\tlogrus.WithFields(logrus.Fields{\n\t\t\t\"error\": err,\n\t\t\t\"table\": table,\n\t\t}).Error(\"Failed to create table.\")\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a34fcabd04641bf6d4dde2e3c699fdc1", "score": "0.5351968", "text": "func handleMakeTable() {\n\tdao := databaseAccessObj.New()\n\tdefer dao.CloseConnection()\n\tfor i := 0; i < 15; i++ {\n\t\ttablename := \"unsub_\" + strconv.Itoa(i)\n\t\tdao.MakeTable(tablename, unsub_schema)\n\t}\n\tdao.MakeTable(\"test_results\", test_result_schema)\n}", "title": "" }, { "docid": "70af768a8b97290d549e8b8276abf6d5", "score": "0.53362316", "text": "func CreateTable(stub shim.ChaincodeStubInterface, item BlockchainItemizer) error {\n\tname := reflect.TypeOf(item).Elem().Name()\n\tlogger.Infof(\"Create Table %s\", name)\n\n\tcds := createColumnDefinitions(item)\n\tlogger.Debugf(\"Columns: %v\", cds)\n\treturn stub.CreateTable(name, cds)\n}", "title": "" }, { "docid": "2ea3fe6ac7d39066e241c629f2c8cac1", "score": "0.53292656", "text": "func testTableInfo(c *C, d *ddl, name string, num int) *model.TableInfo {\n\ttblInfo := &model.TableInfo{\n\t\tName: model.NewCIStr(name),\n\t}\n\tgenIDs, err := d.genGlobalIDs(1)\n\tc.Assert(err, IsNil)\n\ttblInfo.ID = genIDs[0]\n\n\tcols := make([]*model.ColumnInfo, num)\n\tfor i := range cols {\n\t\tcol := &model.ColumnInfo{\n\t\t\tName: model.NewCIStr(fmt.Sprintf(\"c%d\", i+1)),\n\t\t\tOffset: i,\n\t\t\tDefaultValue: i + 1,\n\t\t\tState: model.StatePublic,\n\t\t}\n\n\t\tcol.FieldType = *types.NewFieldType(mysql.TypeLong)\n\t\tcol.ID = allocateColumnID(tblInfo)\n\t\tcols[i] = col\n\t}\n\ttblInfo.Columns = cols\n\ttblInfo.Charset = \"utf8\"\n\ttblInfo.Collate = \"utf8_bin\"\n\treturn tblInfo\n}", "title": "" }, { "docid": "7b023aef68fd23dcd99678bfa60c7c26", "score": "0.53290296", "text": "func updateCreateTable(tx database.Tx) error {\n\t_, err := tx.Exec(\"CREATE TABLE test (id INTEGER)\")\n\treturn err\n}", "title": "" }, { "docid": "50ff213eed64c126334d9955fa6699a8", "score": "0.5323326", "text": "func CreateTable(temporary bool, name string, header []string) string {\n\tb := build(\"CREATE\")\n\n\tif temporary {\n\t\tb.push(\"TEMPORARY\")\n\t}\n\n\tb.push(\"TABLE\", name, \"(\")\n\n\tb.csv(header, func(h string) {\n\t\tb.push(h, \"TEXT\")\n\t})\n\n\tb.push(\");\")\n\n\treturn b.join()\n}", "title": "" }, { "docid": "061a965b5d6d689d2c9cbbcb24d4fefb", "score": "0.5318845", "text": "func NewTable(tableName string, endpoint string) *Table {\n\tif endpoint == \"\" {\n\t\treturn &Table{\n\t\t\ttableName: tableName,\n\t\t\tclient: dynamodb.New(sess),\n\t\t}\n\t}\n\n\tcfg := aws.NewConfig().WithEndpoint(endpoint)\n\treturn &Table{\n\t\ttableName: tableName,\n\t\tclient: dynamodb.New(sess, cfg),\n\t}\n}", "title": "" }, { "docid": "f6d832953412dd6f070a45095b6b71da", "score": "0.5316054", "text": "func (w *Wrapper) Table(t string) *Mapper {\n\treturn Table(t, w.tx)\n}", "title": "" }, { "docid": "be294c8f2e710d980fe9be82d7b31705", "score": "0.53156805", "text": "func newSchema(db *pg.DB, models []interface{}) error {\n\tcreateTable4Model := func(model interface{}) error {\n\t\treturn db.CreateTable(model, &orm.CreateTableOptions{Temp: false, IfNotExists: true, FKConstraints: true})\n\t}\n\n\tfor _, model := range models {\n\t\tif errCreateTable := createTable4Model(model); errCreateTable != nil {\n\t\t\treturn errCreateTable\n\t\t}\n\t}\n\treturn nil\n}", "title": "" } ]
b21c4cb12bee8c645f5dda1954c44207
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
[ { "docid": "90d884eacfff3bce8df53bf812a79ac2", "score": "0.0", "text": "func (in *UnitedDeployment) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" } ]
[ { "docid": "acaba9a6c8a5246bafe5f9dd357705c8", "score": "0.73395145", "text": "func (s *Source) DeepCopyObject() runtime.Object { return s }", "title": "" }, { "docid": "241a8087e36454e7c1e06dd8ce3ff05b", "score": "0.7201898", "text": "func (in *KuryrPort) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4791ae821659297d3908584f6f17a09c", "score": "0.7157622", "text": "func (d DirRes) DeepCopyObject() runtime.Object {\n\treturn d\n}", "title": "" }, { "docid": "152d33648c372c07416101826c5e9042", "score": "0.7106066", "text": "func (in *KobeUtil) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3347ef85eeed487752f2af5ad6f8cccc", "score": "0.71004164", "text": "func (in *Run) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3347ef85eeed487752f2af5ad6f8cccc", "score": "0.71004164", "text": "func (in *Run) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8bea899071433eee30c261819694a176", "score": "0.70996445", "text": "func (in *Console) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "21cbfd2584e847f4087af6094895c42c", "score": "0.70686555", "text": "func (in *Binding) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "21cbfd2584e847f4087af6094895c42c", "score": "0.70686555", "text": "func (in *Binding) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "47cfd60c2e3320c421dd9e7f5a813e27", "score": "0.7031659", "text": "func (in *Cmd) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8494701d2b3ddcb31d6826c7675c4c16", "score": "0.7019965", "text": "func (in *KnativeServing) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "92334c3f674342ee45d4712097fcf341", "score": "0.70027745", "text": "func (in *KnativeEventing) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "83329c473f03a2ee6d4e8f96e33ad437", "score": "0.7000724", "text": "func (in *BobRCrypto) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "508d951ccc9a87c01b02ea294dec1374", "score": "0.69976246", "text": "func (in *CmdList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1f2c10a8c7e2cd94afd3fd2429c3e526", "score": "0.6981211", "text": "func (in *CustomRun) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "703ce510ab996375b56b5a04c85a6e6a", "score": "0.6972725", "text": "func (in *Shell) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a1d4c6527b916e54ba0777a054d7629a", "score": "0.696976", "text": "func (in *Extension) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fa8b271b63fa0f7c6f106fdd9611e58e", "score": "0.69670004", "text": "func (in *Chat) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b13b2703e1976f046ef0241cba49e4ae", "score": "0.69649553", "text": "func (in *FluentBit) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f5e2d5259425a2d848c1e40f99492fe0", "score": "0.6961194", "text": "func (in *Init) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e958a970d12d23d6cb04d77dac49544c", "score": "0.6953975", "text": "func (in *Linkerd) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "030df03bc1795d6085beb84cf812c360", "score": "0.695025", "text": "func (in *PipelineRun) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3a17afa781b57b77264d1e4d316ac2c0", "score": "0.6942903", "text": "func (s *SourceList) DeepCopyObject() runtime.Object { return s }", "title": "" }, { "docid": "f3569664d5fded86f406bd5d8b037f2a", "score": "0.69421464", "text": "func (in *Portieris) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cd37f2d8c1a14a9eb06aa8283d2d4085", "score": "0.6937418", "text": "func DeepCopy(obj interface{}) interface{} {\n\told := reflect.ValueOf(obj)\n\tnew := reflect.New(old.Type()).Elem()\n\tdeepCopy(old, new)\n\treturn new.Interface()\n}", "title": "" }, { "docid": "73a94e66a3385f7708bb1c671f09024e", "score": "0.6934712", "text": "func (in *KuryrPortList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "15b2448cf38e0cb1faeb85e606ed1864", "score": "0.69334537", "text": "func (in *Emqx) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "550df47f57cdc21858b01025458e4bff", "score": "0.692829", "text": "func (in *Factory) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d097756ca1dc143ac33c8a53b94dc601", "score": "0.69274384", "text": "func (c *CreateParam) DeepCopyObject() runtime.Object {\n\treturn c.DeepCopy()\n}", "title": "" }, { "docid": "6aad13608341837dff05b17c368fc263", "score": "0.6921406", "text": "func (in *Core) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "bf46547c850e22676d9bc76d04662e8f", "score": "0.6901424", "text": "func (in *ComputeVPNTunnel) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "bf46547c850e22676d9bc76d04662e8f", "score": "0.6901424", "text": "func (in *ComputeVPNTunnel) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "644b2b863f3be23d8f7f51c42978076e", "score": "0.6895983", "text": "func (in *ImageBinding) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "76f5640d44aea582ff38cbd43bd79341", "score": "0.6892738", "text": "func (in *Leviathan) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "45a5598e6febb2fcfe39b9dafcadfc76", "score": "0.6889177", "text": "func (in *Idler) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "afa86e62e22250e961398ed4301bebcd", "score": "0.6887104", "text": "func (in *Call) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8e915b592e1cf16a649584de1058e2d8", "score": "0.6884534", "text": "func (in *RabbitVhost) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "27331ed45a6ffd21fc86e203e455c3f4", "score": "0.6878992", "text": "func (in *Host) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "27331ed45a6ffd21fc86e203e455c3f4", "score": "0.6878992", "text": "func (in *Host) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1c8bfd881383e0d7074c046711e3dcf6", "score": "0.6874987", "text": "func (in *VirtualEnvironment) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "250e5a1ef46d2251671f8a6eed052d12", "score": "0.6874419", "text": "func (in *TestBindable) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9b670c60ccf1879954c943051cf3b348", "score": "0.6869659", "text": "func (in *Seed) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "bb10ea74ad5524ff0457c32d3c978784", "score": "0.6867651", "text": "func (in *SlimCNP) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "26982e53617e286f3ba7106bc605169d", "score": "0.6865757", "text": "func (in *RuntimeComponent) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3cc1db4bcd86e808735592fbd459cfcc", "score": "0.6864582", "text": "func (in *Kubemanager) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "74e9ed69e8e79c6ad0b1880d7a9748da", "score": "0.68614066", "text": "func (in *PeerAuthentication) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a4e4182e813a398c53684e49f41ac460", "score": "0.6859065", "text": "func (in *What) DeepCopyObject() runtime.Object {\n\treturn &What{Kind: in.Kind}\n}", "title": "" }, { "docid": "5735f86d576a39ee2ea96ed92fba38e1", "score": "0.6856064", "text": "func (in *ConsoleList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cf6cbd33fd4ea9dc8a15f38ecb2bcc37", "score": "0.6854904", "text": "func (in *Refresh) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "066d190a2b6aaf6754ff98dd1a44e55e", "score": "0.68485624", "text": "func (in *ClowdJobInvocation) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3de10c3fd4d74e04ad823a886fd5a87c", "score": "0.6848331", "text": "func (in *Space) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c68d502540815ca6fa49ee3aa63de6f8", "score": "0.68479383", "text": "func (in *Bytebase) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d6689aff40a8ffd552b67e4afc42a063", "score": "0.68475723", "text": "func (in *ProcChaos) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8930b1fdd2549ccb6fc862dbe87945f2", "score": "0.68471843", "text": "func (in *Receiver) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b51853a7af7d313744b03590cc699ee8", "score": "0.6843437", "text": "func (in *RunService) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "dc474f34fe7aba299d9d2c975c695a89", "score": "0.6839951", "text": "func (in *Win95) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3f6dab406e5e925e7dcfe451db442d2c", "score": "0.6839449", "text": "func (in *CrcBundle) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "edf5a50736e0ba8a3adc9c7f1327d272", "score": "0.6839074", "text": "func (in *Get) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c36b5c25a4b945cb2e97c9451c5cfd21", "score": "0.6832245", "text": "func (in *PolarisBuildStep) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b40d62941763c1d416e9d31ab26c911f", "score": "0.6829985", "text": "func (in *Redis) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "662cc69dc31cab4e7bde2e440db71c6a", "score": "0.6823051", "text": "func (in *ServiceBinding) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "24e15e83ce04e8d91506b826811caaa3", "score": "0.68223184", "text": "func (in *BindingList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "24e15e83ce04e8d91506b826811caaa3", "score": "0.68223184", "text": "func (in *BindingList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ba246ea026a951ac74cdaac1a6610b61", "score": "0.68205655", "text": "func (in *ForecastleApp) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f7c814f96f03eaf38c6e7c71f17f3ffb", "score": "0.6818561", "text": "func (in *Gogatekeeper) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0b4fafdee82c8479e1c138e12b86e9d0", "score": "0.6815883", "text": "func (in *Chaos) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4b175f176854292735cc32bb2aad6874", "score": "0.6815398", "text": "func (in *GlobalObject) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e4af30c09bc8aea04769fa13a3b2fc33", "score": "0.6813403", "text": "func (in *KuryrNetwork) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "81ec9c7e50e902721ad3bf36f4c935cd", "score": "0.68133926", "text": "func (in *RunList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "81ec9c7e50e902721ad3bf36f4c935cd", "score": "0.68133926", "text": "func (in *RunList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b055ea8998645b326e1e0e063c42e5ae", "score": "0.68108857", "text": "func (in *ApiProxy) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "00ba0fbd107f0a581fde24e39a0e86d9", "score": "0.68094265", "text": "func (in *RunServices) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "541ace7c5e578e9c049a2a3d289066b2", "score": "0.68032986", "text": "func (in *IDPortenClient) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "96119b1a12c3170813b4f89d571a59e6", "score": "0.6801526", "text": "func (in *RunnerImage) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0ddf9251dc119e9db2e6d879af774d6c", "score": "0.68009526", "text": "func (in *Proxier) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "00e766e9282fb1b97758068a17381059", "score": "0.67998165", "text": "func (in *MaskinportenClient) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b3860121e76651effd55fda4a8c4b69f", "score": "0.6798914", "text": "func (in *VirtualServiceBase) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "bdfece5a46ef72b2e31ac5edc6905388", "score": "0.6798821", "text": "func (in *Cosweb) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9404fae1a71345a1d67713ead811e5f3", "score": "0.6796856", "text": "func (in *ClowdEnvironment) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c0e5cf45f51606470d2efd83f239fd9b", "score": "0.6793813", "text": "func (in *SeedList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "08851f577beff8b9a55605234a10b571", "score": "0.67923445", "text": "func (in *Machine) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "08851f577beff8b9a55605234a10b571", "score": "0.67923445", "text": "func (in *Machine) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "08851f577beff8b9a55605234a10b571", "score": "0.67923445", "text": "func (in *Machine) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "08851f577beff8b9a55605234a10b571", "score": "0.67923445", "text": "func (in *Machine) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c2c3d62f91dfb2c52bcbacf4c854e7b5", "score": "0.6791824", "text": "func (in *Flow) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e8d3edbc4aafe3a0e94ec1c46a354361", "score": "0.6790972", "text": "func (in *ExtensionList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6bba529c437c45cfe4a96f73a11f136a", "score": "0.67908806", "text": "func (in *Proxy) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8ea92bd7febd58755b8cabe0d627355f", "score": "0.6790168", "text": "func (in *DendronautTestResult) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3e3f85b55afae2df2d69d8207d2cbef8", "score": "0.67893875", "text": "func (in *NebulaCAList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f43dde222339bc0b3c8ec6d9b642cf43", "score": "0.6787947", "text": "func (in *EtcdPeer) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f43dde222339bc0b3c8ec6d9b642cf43", "score": "0.6787947", "text": "func (in *EtcdPeer) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4a783bf5b574f47a0af297aa5379df83", "score": "0.6786925", "text": "func (in *ComputeTargetGRPCProxy) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4a783bf5b574f47a0af297aa5379df83", "score": "0.6786925", "text": "func (in *ComputeTargetGRPCProxy) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e1a132b4af7f55528161a0f94f124617", "score": "0.6784705", "text": "func (in *FluentBitList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "018775afbcc4660a0bd7b64df92cc224", "score": "0.6783559", "text": "func (in *Jitsi) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "76f1e54550c239312aded69671699b83", "score": "0.6781756", "text": "func (in *ActiveMQArtemis) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "25a155b2a12099e23ed2847a7c8cff50", "score": "0.6779723", "text": "func (in *Addon) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "25a155b2a12099e23ed2847a7c8cff50", "score": "0.6779723", "text": "func (in *Addon) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "25a155b2a12099e23ed2847a7c8cff50", "score": "0.6779723", "text": "func (in *Addon) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "82c8936d5a296b83933646cece6b16f2", "score": "0.6777142", "text": "func (in *HookList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "82c8936d5a296b83933646cece6b16f2", "score": "0.6777142", "text": "func (in *HookList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" } ]
32eb1fbd83717ec4f27759dc1cacf680
UpdateMask sets the optional parameter "updateMask": The mask to control which fields get updated.
[ { "docid": "62f7cd728e5bbb35509c531f3477c790", "score": "0.8229839", "text": "func (c *ProjectsAgentEntityTypesPatchCall) UpdateMask(updateMask string) *ProjectsAgentEntityTypesPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" } ]
[ { "docid": "02a6b880ca224e3a44c498b21d7ad358", "score": "0.84196913", "text": "func (c *PublicationsReadersUpdateEntitlementsCall) UpdateMask(updateMask string) *PublicationsReadersUpdateEntitlementsCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "6a5510fb986a507ea7ed2a37a6c7e220", "score": "0.83871716", "text": "func (c *BillingAccountsPatchCall) UpdateMask(updateMask string) *BillingAccountsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "6a5510fb986a507ea7ed2a37a6c7e220", "score": "0.83871716", "text": "func (c *BillingAccountsPatchCall) UpdateMask(updateMask string) *BillingAccountsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "aa03a5c2467b058bf152cb2b34bf6cc2", "score": "0.83845884", "text": "func (c *ProjectsModelsPatchCall) UpdateMask(updateMask string) *ProjectsModelsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "9a70cb54adcc8db9c287db4670d920d7", "score": "0.83505493", "text": "func (c *ProjectsAgentUpdateFulfillmentCall) UpdateMask(updateMask string) *ProjectsAgentUpdateFulfillmentCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "f2a1ec4bd55c32ab4e9d5ce8b7609e3d", "score": "0.83095616", "text": "func (c *ProjectsAgentIntentsPatchCall) UpdateMask(updateMask string) *ProjectsAgentIntentsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "65c03503d9893b4f16d4312ecadcc328", "score": "0.8285833", "text": "func (c *ProjectsWebAppsPatchCall) UpdateMask(updateMask string) *ProjectsWebAppsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "326b9425450d8f30f2b32dd1597db6bc", "score": "0.82672936", "text": "func (c *PropertiesGoogleAdsLinksPatchCall) UpdateMask(updateMask string) *PropertiesGoogleAdsLinksPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "537044c35e5b3c7d44d867f7d260aed7", "score": "0.82563925", "text": "func (c *ProjectsFirewallpoliciesPatchCall) UpdateMask(updateMask string) *ProjectsFirewallpoliciesPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "1239a1064f83437f5bd2677ad505189f", "score": "0.8255225", "text": "func (c *ProjectsAgentVersionsPatchCall) UpdateMask(updateMask string) *ProjectsAgentVersionsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "7092f429b5c7a618e26bae65a5c4fad1", "score": "0.8222667", "text": "func (c *ProjectsLocationsAgentIntentsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsAgentIntentsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "8dfc57b4c8e9025088db12ed2e525f49", "score": "0.8222358", "text": "func (c *AccountsPatchCall) UpdateMask(updateMask string) *AccountsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "01950df99a0ceb29b69f0e79f365f92f", "score": "0.8214648", "text": "func (c *ProjectsLocationsApisVersionsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsApisVersionsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "e1f98ca492659a26e7fe93cdefbf1220", "score": "0.82123095", "text": "func (c *ProjectsLocationsGitLabConfigsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsGitLabConfigsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "694b35454ad2c0a98fb53f9e7aa313be", "score": "0.82110125", "text": "func (c *ProjectsAgentKnowledgeBasesPatchCall) UpdateMask(updateMask string) *ProjectsAgentKnowledgeBasesPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "641b98fcaddd306bfb8e31024cf34384", "score": "0.82013655", "text": "func (c *ProjectsLocationsAgentUpdateFulfillmentCall) UpdateMask(updateMask string) *ProjectsLocationsAgentUpdateFulfillmentCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "7119a0161a5ee8e1c547afb990e77e8e", "score": "0.8197838", "text": "func (c *ProjectsSetAgentCall) UpdateMask(updateMask string) *ProjectsSetAgentCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "fe203c359af0bc16747fb65d7c41daef", "score": "0.8196233", "text": "func (c *ProjectsInstancesPartialUpdateInstanceCall) UpdateMask(updateMask string) *ProjectsInstancesPartialUpdateInstanceCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "c7bb5af00ac8e7d010364312b0f9cb86", "score": "0.81746304", "text": "func (c *ProjectsKeysPatchCall) UpdateMask(updateMask string) *ProjectsKeysPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "7b47e70d2f88f34a2cc744d8d3be5991", "score": "0.8174485", "text": "func (c *LocationsUpdateBusinesscallssettingsCall) UpdateMask(updateMask string) *LocationsUpdateBusinesscallssettingsCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "ade060d56a43afbdf0404363ff3c1577", "score": "0.817423", "text": "func (c *ProjectsLocationsAgentEntityTypesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsAgentEntityTypesPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "8453b7613be9be2c10fa1b0290cea230", "score": "0.81684554", "text": "func (c *ProjectsLocationsAgentVersionsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsAgentVersionsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "01239a11ad6a1d3d978eee6d23abb0ea", "score": "0.8163187", "text": "func (c *ProjectsLocationsApisDeploymentsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsApisDeploymentsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "df4ea8f3339ee79a93b73747edf4f143", "score": "0.8155715", "text": "func (c *CustomersChromePrintServersPatchCall) UpdateMask(updateMask string) *CustomersChromePrintServersPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "f3acef4bfd8741daa233254a90fbb336", "score": "0.8140698", "text": "func (c *ProjectsLocationsApisVersionsSpecsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsApisVersionsSpecsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "fb1b9247002a3731119f8c7c0719a81a", "score": "0.8140062", "text": "func (c *ProjectsPatchCall) UpdateMask(updateMask string) *ProjectsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "189c4b1eb1fd414f9cade90cbcc6d313", "score": "0.8137976", "text": "func (c *ProjectsIosAppsPatchCall) UpdateMask(updateMask string) *ProjectsIosAppsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "b35c35ddd5611a17e476a15f80cae06b", "score": "0.81368876", "text": "func (c *PropertiesDataStreamsPatchCall) UpdateMask(updateMask string) *PropertiesDataStreamsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "7f1594c2d23a3a8ff8c6bfbc950c2f48", "score": "0.81359124", "text": "func (c *ProjectsAndroidAppsPatchCall) UpdateMask(updateMask string) *ProjectsAndroidAppsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "2abebefe4d3e6012e0f5701432d9a1aa", "score": "0.81257457", "text": "func (c *ProjectsAgentKnowledgeBasesDocumentsPatchCall) UpdateMask(updateMask string) *ProjectsAgentKnowledgeBasesDocumentsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "8c0a6f204309a5c004b509c3968f0c62", "score": "0.81140274", "text": "func (c *PropertiesUpdateDataRetentionSettingsCall) UpdateMask(updateMask string) *PropertiesUpdateDataRetentionSettingsCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "232ceba3e02010729ede7fd07fdb4ccc", "score": "0.81114835", "text": "func (c *ProjectsGithubEnterpriseConfigsPatchCall) UpdateMask(updateMask string) *ProjectsGithubEnterpriseConfigsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "d75a042127d99afcec170015004a7088", "score": "0.8110641", "text": "func (c *ProjectsLocationsApisPatchCall) UpdateMask(updateMask string) *ProjectsLocationsApisPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "9f4a8aec51a7f00429090153346ed489", "score": "0.8110227", "text": "func (c *ProjectsKnowledgeBasesPatchCall) UpdateMask(updateMask string) *ProjectsKnowledgeBasesPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "0f7c7632d8bb26b3b3e74ec69a8d227a", "score": "0.80860573", "text": "func (c *DevicesUpdateCall) UpdateMask(updateMask string) *DevicesUpdateCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "f87da6658443dc5743c5c077c3192fb3", "score": "0.8084304", "text": "func (c *PropertiesPatchCall) UpdateMask(updateMask string) *PropertiesPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "4f504dc834b31728d21272350e39b060", "score": "0.8073283", "text": "func (c *PropertiesConversionEventsPatchCall) UpdateMask(updateMask string) *PropertiesConversionEventsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "7b41ad87520e512f46391f7370d8242c", "score": "0.80674785", "text": "func (c *GroupsPatchCall) UpdateMask(updateMask string) *GroupsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "7f224ad6b7bc0a9c83c1afa760c8c48a", "score": "0.8062635", "text": "func (c *ProjectsLocationsSetAgentCall) UpdateMask(updateMask string) *ProjectsLocationsSetAgentCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "404799eb1def8bbbe58184cd0edfa971", "score": "0.8062349", "text": "func (c *PropertiesDataStreamsMeasurementProtocolSecretsPatchCall) UpdateMask(updateMask string) *PropertiesDataStreamsMeasurementProtocolSecretsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "a31e6878b13961b695bf5944168cccb3", "score": "0.8053038", "text": "func (c *ProjectsKnowledgeBasesDocumentsPatchCall) UpdateMask(updateMask string) *ProjectsKnowledgeBasesDocumentsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "a6a84c29f018e13b2630cae97c84c68c", "score": "0.804741", "text": "func (c *ProjectsUptimeCheckConfigsPatchCall) UpdateMask(updateMask string) *ProjectsUptimeCheckConfigsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "8ce79649bd25e2a3af477489e1db0714", "score": "0.80433136", "text": "func (c *ProjectsLocationsGithubEnterpriseConfigsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsGithubEnterpriseConfigsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "f501cbed73df03e62cd3a352fa156ba5", "score": "0.8041882", "text": "func (c *ProjectsAgentEnvironmentsPatchCall) UpdateMask(updateMask string) *ProjectsAgentEnvironmentsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "e57ba2b6ccbfbc1e5194a96336d1cbc3", "score": "0.80347455", "text": "func (c *ProjectsLocationsKnowledgeBasesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsKnowledgeBasesPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "132e0cac530932b78cb3ae41531c6b26", "score": "0.8026239", "text": "func (c *CustomersChromePrintersPatchCall) UpdateMask(updateMask string) *CustomersChromePrintersPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "8f05306396d2e862fc0f44ebe924deb4", "score": "0.80170834", "text": "func (c *ProjectsLocationsDatasetsFhirStoresPatchCall) UpdateMask(updateMask string) *ProjectsLocationsDatasetsFhirStoresPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "ec65b54b29d59eb4a2667b153d020013", "score": "0.80143946", "text": "func (c *ProjectsLocationsAgentEnvironmentsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsAgentEnvironmentsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "60c1337c9205fb1673594576925efdf5", "score": "0.8014211", "text": "func (c *BillingAccountsLocationsInsightTypesUpdateConfigCall) UpdateMask(updateMask string) *BillingAccountsLocationsInsightTypesUpdateConfigCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "71467f3ea1e67198b84a73fbc520e902", "score": "0.8005946", "text": "func (c *ProjectsLocationsKnowledgeBasesDocumentsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsKnowledgeBasesDocumentsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "39bd6452147498d042df959704e34145", "score": "0.80023646", "text": "func (c *ProjectsInstancesAppProfilesPatchCall) UpdateMask(updateMask string) *ProjectsInstancesAppProfilesPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "5caa0aeb004aadffc0de8289811fd692", "score": "0.80019647", "text": "func (c *ProjectsLocationsDatasetsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsDatasetsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "a9fc4ca1c23a0d8f1aa13889fe5b2462", "score": "0.7991347", "text": "func (c *ProjectsLocationsInsightTypesUpdateConfigCall) UpdateMask(updateMask string) *ProjectsLocationsInsightTypesUpdateConfigCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "f6e29c16bb854bc4e9ea3e793ea5a56a", "score": "0.79895765", "text": "func (c *ProjectsLocationsBitbucketServerConfigsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsBitbucketServerConfigsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "5ded94b33cb4ad5189452aa63b022b13", "score": "0.7985997", "text": "func (c *ProjectsConversationProfilesPatchCall) UpdateMask(updateMask string) *ProjectsConversationProfilesPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "bebc976b342b15ace1affebad1324eb8", "score": "0.79818034", "text": "func (c *PropertiesCustomMetricsPatchCall) UpdateMask(updateMask string) *PropertiesCustomMetricsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "6dc361fad05437c6d1aafe7130e9941a", "score": "0.79811114", "text": "func (c *ProjectsAgentSessionsEntityTypesPatchCall) UpdateMask(updateMask string) *ProjectsAgentSessionsEntityTypesPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "7e7cde6a3c6d3829170732f701cf7a17", "score": "0.7969617", "text": "func (c *ProjectsAnswerRecordsPatchCall) UpdateMask(updateMask string) *ProjectsAnswerRecordsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "d300158141a91ac2b357cec6792828a3", "score": "0.79629993", "text": "func (c *ProjectsLocationsRecommendersUpdateConfigCall) UpdateMask(updateMask string) *ProjectsLocationsRecommendersUpdateConfigCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "95293157b419b6f1ae40d0c8936f87e8", "score": "0.79349905", "text": "func (c *OrganizationsLocationsInsightTypesUpdateConfigCall) UpdateMask(updateMask string) *OrganizationsLocationsInsightTypesUpdateConfigCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "3f110cb6308e54120c2155498ac977bf", "score": "0.7933602", "text": "func (c *ProjectsLocationsAgentSessionsEntityTypesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsAgentSessionsEntityTypesPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "e35e447bdde137ccdb73fcc539184b25", "score": "0.79329556", "text": "func (c *BillingAccountsLocationsRecommendersUpdateConfigCall) UpdateMask(updateMask string) *BillingAccountsLocationsRecommendersUpdateConfigCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "f1db86ff37acab74f2579a9b76ed1ce5", "score": "0.79147696", "text": "func (c *ProjectsLocationsUpdateBiReservationCall) UpdateMask(updateMask string) *ProjectsLocationsUpdateBiReservationCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "608925b489c80e0e86259c2feee64ded", "score": "0.79043055", "text": "func (c *ProjectsConversationsParticipantsPatchCall) UpdateMask(updateMask string) *ProjectsConversationsParticipantsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "7c65e8c35c297911582b8d716f0fd047", "score": "0.79012555", "text": "func (c *OrganizationsLocationsRecommendersUpdateConfigCall) UpdateMask(updateMask string) *OrganizationsLocationsRecommendersUpdateConfigCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "f7289f735f1c0646d09d43c70472cebe", "score": "0.78913975", "text": "func (c *AdminProjectsLocationsReservationsPatchCall) UpdateMask(updateMask string) *AdminProjectsLocationsReservationsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "94570a08d2ace18cf615429dfa26de84", "score": "0.78897953", "text": "func (c *ProjectsLocationsRepositoriesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsRepositoriesPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "ab58219762f45168c8b403da3a67e3b9", "score": "0.78787494", "text": "func (c *ProjectsLocationsConversationProfilesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsConversationProfilesPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "d0e5a24783c5e9ec0585f4e095167612", "score": "0.787009", "text": "func (c *AdminProjectsLocationsSubscriptionsPatchCall) UpdateMask(updateMask string) *AdminProjectsLocationsSubscriptionsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "d0e5a24783c5e9ec0585f4e095167612", "score": "0.787009", "text": "func (c *AdminProjectsLocationsSubscriptionsPatchCall) UpdateMask(updateMask string) *AdminProjectsLocationsSubscriptionsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "af2230bd09ba9841ba813850ba3014ef", "score": "0.78655976", "text": "func (c *PropertiesCustomDimensionsPatchCall) UpdateMask(updateMask string) *PropertiesCustomDimensionsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "cfdd7f7fad433c7aec12c5d73e5980e1", "score": "0.78627926", "text": "func (c *ProjectsLocationsRepositoriesPackagesTagsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsRepositoriesPackagesTagsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "681fa10519233964bf7cc3df4cb77e0a", "score": "0.785244", "text": "func (c *ProjectsLocationsCertificateTemplatesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCertificateTemplatesPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "9327d7710a1180ddb859e26574d86d85", "score": "0.78038365", "text": "func (c *ProjectsLocationsAnswerRecordsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsAnswerRecordsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "61a229657e8c83205be15287fd269b37", "score": "0.77943575", "text": "func (c *ProjectsLocationsReservationsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsReservationsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "f160bc4f860acb88f69aed5186b00a2f", "score": "0.7791222", "text": "func (c *ProjectsLocationsWorkerPoolsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsWorkerPoolsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "2b8530a4532424663efc91a38229e527", "score": "0.7785791", "text": "func (c *ProjectsLocationsConversationsParticipantsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsConversationsParticipantsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "540459c1c6eb0e09b995cfb8c448d8fc", "score": "0.7784344", "text": "func (c *ProjectsLocationsNamespacesServicesEndpointsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsNamespacesServicesEndpointsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "5bd7850dcac614b7b7511e215b3bc938", "score": "0.7780337", "text": "func (c *ProjectsLocationsCertificateAuthoritiesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCertificateAuthoritiesPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "d31af865c9a5f92fd80891b571696964", "score": "0.7776857", "text": "func (c *ProjectsLocationsRegistrationsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsRegistrationsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "ff86777fbf57a08b724962c95f2a727c", "score": "0.7775024", "text": "func (c *ProjectsLocationsCapacityCommitmentsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCapacityCommitmentsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "07ca6f51cf2875380c0c20bcb09224f6", "score": "0.7749914", "text": "func (c *ProjectsLocationsDatasetsAnnotationStoresPatchCall) UpdateMask(updateMask string) *ProjectsLocationsDatasetsAnnotationStoresPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "2d7368ba4cef1632e8da8c3ce9a95412", "score": "0.7739402", "text": "func (c *ProjectsLocationsDatasetsAnnotationStoresAnnotationsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsDatasetsAnnotationStoresAnnotationsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "d91f57428361f1334ed4f7689470d462", "score": "0.7703669", "text": "func (c *ProjectsLocationsNamespacesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsNamespacesPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "f49b7d8b3b1bcf69a8daa83364078eae", "score": "0.76984656", "text": "func (c *ProjectsLocationsDatasetsDicomStoresPatchCall) UpdateMask(updateMask string) *ProjectsLocationsDatasetsDicomStoresPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "311eed19882fcc8030d158fd202ced07", "score": "0.769359", "text": "func (c *ProjectsLocationsCaPoolsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCaPoolsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "398d89b3104ddb97641f3204e09311c3", "score": "0.76856744", "text": "func (c *ProjectsLocationsNamespacesServicesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsNamespacesServicesPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "248190b22f5ed7eac2533feda20362a7", "score": "0.7672511", "text": "func (c *ProjectsLocationsAgentEnvironmentsUsersSessionsEntityTypesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsAgentEnvironmentsUsersSessionsEntityTypesPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "fb447c7aa0572ef7afea3bcb991452db", "score": "0.7665601", "text": "func (c *ProjectsAgentEnvironmentsUsersSessionsEntityTypesPatchCall) UpdateMask(updateMask string) *ProjectsAgentEnvironmentsUsersSessionsEntityTypesPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "6a97960e8f76474db79cf7199a1e5dc1", "score": "0.76412374", "text": "func (c *ProjectsAgentSessionsContextsPatchCall) UpdateMask(updateMask string) *ProjectsAgentSessionsContextsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "915b4ccb6a66a962a2b8abbaa1745e25", "score": "0.7613669", "text": "func (c *ProjectsLocationsDatasetsHl7V2StoresMessagesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsDatasetsHl7V2StoresMessagesPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "0d62392a63d922e4fef5bd6f1ca04c9a", "score": "0.75659895", "text": "func (c *AdminProjectsLocationsTopicsPatchCall) UpdateMask(updateMask string) *AdminProjectsLocationsTopicsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "0d62392a63d922e4fef5bd6f1ca04c9a", "score": "0.75659895", "text": "func (c *AdminProjectsLocationsTopicsPatchCall) UpdateMask(updateMask string) *AdminProjectsLocationsTopicsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "6326e5bb84111ecd0449c0894f7ec6ab", "score": "0.7561631", "text": "func (c *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCertificateAuthoritiesCertificateRevocationListsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "eeaa003786c02fadd4bff11269fa7f85", "score": "0.7559901", "text": "func (c *ProjectsLocationsReservationsAssignmentsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsReservationsAssignmentsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "85380b2a23806eb92f86eee189d9ec7b", "score": "0.7558409", "text": "func (c *ProjectsLocationsAgentSessionsContextsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsAgentSessionsContextsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "a23ceb61cb306122ce8f4ebc699d66c2", "score": "0.75055444", "text": "func (c *ProjectsLocationsCaPoolsCertificatesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCaPoolsCertificatesPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "a67938ed1d112c16996605fb5debc6f7", "score": "0.75038254", "text": "func (c *ProjectsLocationsCertificateAuthoritiesCertificatesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCertificateAuthoritiesCertificatesPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "9ce6a7ab6a0142269308e302e1d88ab4", "score": "0.74294823", "text": "func (c *ProjectsAgentEnvironmentsUsersSessionsContextsPatchCall) UpdateMask(updateMask string) *ProjectsAgentEnvironmentsUsersSessionsContextsPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" }, { "docid": "a15529ea861e7ead535604dc121e7483", "score": "0.7422768", "text": "func (c *ProjectsLocationsDatasetsHl7V2StoresPatchCall) UpdateMask(updateMask string) *ProjectsLocationsDatasetsHl7V2StoresPatchCall {\n\tc.urlParams_.Set(\"updateMask\", updateMask)\n\treturn c\n}", "title": "" } ]
c9b38e97b723302877b04795c1a0ffbf
Save creates the FileType in the database.
[ { "docid": "5e2cae047e5c31dfabdb598cbe7dfd51", "score": "0.7550553", "text": "func (ftc *FileTypeCreate) Save(ctx context.Context) (*FileType, error) {\n\tif ftc.name == nil {\n\t\treturn nil, errors.New(\"ent: missing required field \\\"name\\\"\")\n\t}\n\treturn ftc.sqlSave(ctx)\n}", "title": "" } ]
[ { "docid": "fe1fbde6ce9ff854608528a2d66683e7", "score": "0.7040877", "text": "func (fileType *fileType) Save(v interface{}) error {\n\tlock.Lock()\n\tdefer lock.Unlock()\n\tf, err := os.Create(fileType.path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer f.Close()\n\tr, err := marshal(v)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = io.Copy(f, r)\n\treturn err\n}", "title": "" }, { "docid": "3fb7c5a00f788ef7d2d41b1752eee141", "score": "0.65039563", "text": "func (ftc *FieldTypeCreate) Save(ctx context.Context) (*FieldType, error) {\n\tif ftc.name == nil {\n\t\treturn nil, errors.New(\"ent: missing required field \\\"name\\\"\")\n\t}\n\tif ftc.description == nil {\n\t\treturn nil, errors.New(\"ent: missing required field \\\"description\\\"\")\n\t}\n\tif ftc.deprecated_reason == nil {\n\t\treturn nil, errors.New(\"ent: missing required field \\\"deprecated_reason\\\"\")\n\t}\n\tif ftc.type_kind == nil {\n\t\treturn nil, errors.New(\"ent: missing required field \\\"type_kind\\\"\")\n\t}\n\tif ftc.type_name == nil {\n\t\treturn nil, errors.New(\"ent: missing required field \\\"type_name\\\"\")\n\t}\n\treturn ftc.sqlSave(ctx)\n}", "title": "" }, { "docid": "bf49cb2d30704135e46d8db53101099e", "score": "0.63466257", "text": "func (ftu *FieldTypeUpdate) Save(ctx context.Context) (int, error) {\n\treturn ftu.sqlSave(ctx)\n}", "title": "" }, { "docid": "6808585a24033f473bfb2b2d8ded2aab", "score": "0.6257062", "text": "func (ftc *FieldTypeCreate) Save(ctx context.Context) (*FieldType, error) {\n\tftc.defaults()\n\treturn withHooks[*FieldType, FieldTypeMutation](ctx, ftc.sqlSave, ftc.mutation, ftc.hooks)\n}", "title": "" }, { "docid": "a034bdc525b0f68001d31c321a2c316b", "score": "0.60787755", "text": "func (ftuo *FieldTypeUpdateOne) Save(ctx context.Context) (*FieldType, error) {\n\treturn ftuo.sqlSave(ctx)\n}", "title": "" }, { "docid": "3e9c12e788b8c3e3da94cc4cd2937349", "score": "0.60608864", "text": "func (fs *FieldStore) Save(field models.Field) error {\n\t_, err := fs.db.Exec(`UPDATE fields SET \n\t\t\t\t\t (name, data_type) = ($1, $2) WHERE id = $3;`,\n\t\tfield.Name, field.DataType, field.ID)\n\n\treturn handlePqErr(err)\n}", "title": "" }, { "docid": "fe073e3649da1c5983dc23114e27346e", "score": "0.59126097", "text": "func (ff *FactoryFaretp) Save(ctx context.Context) error {\n\tif ff.Exists() {\n\t\treturn ff.Update(ctx)\n\t}\n\n\treturn ff.Insert(ctx)\n}", "title": "" }, { "docid": "b1df425afb24fdc74ad6b95ef9420944", "score": "0.589995", "text": "func (file *File) Save(db *gorm.DB) error {\n\treturn db.Save(file).Error\n}", "title": "" }, { "docid": "f8382bbbaac3a1679d3caa196c6d75b3", "score": "0.5760888", "text": "func (e *Model) Save(folder string, file ...string) error {\n\tif len(file) == 0 {\n\t\tfile = append(file, \"sequential-\" + time.Now().Format(\"2006-01-02T15:04:05-MST\"))\n\t}\n\tfile[0] += \".bin\"\n\n\toutdir, err := filepath.Abs(folder)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\tf, err := os.Create(filepath.Join(outdir,file[0]))\n\tif err != nil {\n\t\tlog.Fatal(\"Couldn't open file\")\n\t}\n\tdefer f.Close()\n\n\t//Register types\n\tgob.Register(layers.FC{})\n\tgob.Register(activation.Tanh{})\n\n\tlayercount := len(e.Layers)\n\n\tenc := gob.NewEncoder(f)\n\n\tenc.Encode(layercount)\n\n\tfor _,layer := range e.Layers {\n\t\terr = enc.Encode(layer)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn err\n}", "title": "" }, { "docid": "84e883f9096bbe866a729d00ba5e6e01", "score": "0.567382", "text": "func (sa *Adapter) SaveTestType(entity *model.TestType) error {\n\tfindFilter := bson.D{primitive.E{Key: \"_id\", Value: entity.ID}}\n\tvar result []*testType\n\terr := sa.db.testtypes.Find(findFilter, &result, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif result == nil || len(result) == 0 {\n\t\t//not found\n\t\treturn errors.New(\"there is no a test type for the provided id\")\n\t}\n\ttestType := result[0]\n\n\t//update the values\n\ttestType.Name = entity.Name\n\ttestType.Priority = entity.Priority\n\tdateUpdated := time.Now()\n\ttestType.DateUpdated = &dateUpdated\n\n\t//save\n\tfilter := bson.D{primitive.E{Key: \"_id\", Value: testType.ID}}\n\terr = sa.db.testtypes.ReplaceOne(filter, testType, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "f4131857b449de531eed579040b17f37", "score": "0.5596693", "text": "func (wmt *WsubMenuType) Save(db XODB) error {\n\tif wmt.Exists() {\n\t\treturn wmt.Update(db)\n\t}\n\n\treturn wmt.Insert(db)\n}", "title": "" }, { "docid": "2eaa659553305a6b4c82d25d9bcb8bb3", "score": "0.55408514", "text": "func Save(fileHandle *os.File) (int8, error) {\n\tif !isLoaded {\n\t\treturn -1, errors.New(dbFileNotFound)\n\t}\n\n\tdefer fileHandle.Close()\n\n\tif len(u) > 0 {\n\t\tb, err := msgpack.Marshal(u)\n\n\t\tif err != nil {\n\t\t\treturn 0, errors.New(decodingFailed)\n\t\t}\n\n\t\tmsgpack.Unmarshal([]byte(b), &u)\n\t\tfileHandle.Write(b)\n\t}\n\n\treturn 1, nil\n}", "title": "" }, { "docid": "3a40439924b20426d3be451727f13df2", "score": "0.5521279", "text": "func (bg *blobGroup) save() error {\n\tdb, err := openDB()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer db.Close()\n\n\tvar json string\n\tjson, err = utils.Marshal(*bg)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = db.Update(func(tx *buntdb.Tx) error {\n\t\t_, _, err := tx.Set(bg.FileName, json, nil)\n\t\treturn err\n\t})\n\n\treturn err\n}", "title": "" }, { "docid": "a991609913f57db60dcdea777c10f2a9", "score": "0.54698807", "text": "func (tf *TempFile) Save(db XODB) error {\n\tif tf.Exists() {\n\t\treturn tf.Update(db)\n\t}\n\n\treturn tf.Insert(db)\n}", "title": "" }, { "docid": "13769dbe050ae7183d2dda7fd57de002", "score": "0.5463617", "text": "func (ftc *FieldTypeCreate) Exec(ctx context.Context) error {\n\t_, err := ftc.Save(ctx)\n\treturn err\n}", "title": "" }, { "docid": "51d4e595711586330b77d538687f7ac7", "score": "0.5455096", "text": "func (fs *Database) Save(f Page) (err error) {\n\tfs.Lock()\n\tdefer fs.Unlock()\n\n\ttx, err := fs.DB.Begin()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"begin Save\")\n\t}\n\n\tstmt, err := tx.Prepare(`\n\tINSERT OR IGNORE INTO\n\t\tfts\n\t(\n\t\tid,\n\t\tdata\n\t) \n\t\tvalues \t\n\t(\n\t\t?, \n\t\t?\n\t)`)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"stmt Save\")\n\t}\n\n\t_, err = stmt.Exec(\n\t\tf.ID,\n\t\tf.Data,\n\t)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"exec Save\")\n\t}\n\tstmt.Close()\n\n\tstmt, err = tx.Prepare(`\n\tINSERT OR IGNORE INTO\n\t\tfs\n\t(\n\t\tid,\n\t\tmeta\n\t) \n\t\tvalues \t\n\t(\n\t\t?, \n\t\t?\n\t)`)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"stmt Save\")\n\t}\n\tbMeta, _ := json.Marshal(f.MetaData)\n\t_, err = stmt.Exec(\n\t\tf.ID,\n\t\tstring(bMeta),\n\t)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"exec Save\")\n\t}\n\tstmt.Close()\n\n\terr = tx.Commit()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"commit Save\")\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "48fa2681de1896f829b598c1c43d0fc9", "score": "0.541158", "text": "func Save(fs interface{},name string,meta bool) {\n\t//userFlagsFile := xattribs.FileNS{thisFile, \"user.flags\"}\n\t\n\n}", "title": "" }, { "docid": "45fbb6b0c9fee6e20d64e8d969363aff", "score": "0.53919184", "text": "func (m *Model) Store(filename string) {\n \n storable := m.to_storable()\n \n b := new(bytes.Buffer)\n g := gob.NewEncoder(b)\n err := g.Encode(storable)\n if err != nil {\n fmt.Println(err)\n }\n fh, eopen := os.OpenFile(filename, os.O_CREATE|os.O_WRONLY, 0666)\n defer fh.Close()\n if eopen != nil {\n fmt.Println(eopen)\n }\n _,ewrite := fh.Write(b.Bytes())\n if ewrite != nil {\n fmt.Println(ewrite)\n }\n}", "title": "" }, { "docid": "3bee812b6ee07df6781650c3ccfe97e6", "score": "0.5375821", "text": "func (db *DB)Save() error {\n\tdb.rootTree.Save()\n\n\tdata, err := json.Marshal(db.rootTree)\n\tdb.metadata.RootTreeSize = int64(len(data))\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = db.file.WriteAt(data, db.metadata.RootTreeOffset)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdata, err = bson.Marshal(db.metadata)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = db.file.WriteAt(data, 0)\n\treturn err\n}", "title": "" }, { "docid": "83fd07e9c74220229725d6ea52d54524", "score": "0.5355925", "text": "func (b *ResourceBuilder) FileType(fileType string) *ResourceBuilder {\n\tif fileType == \"\" {\n\t\tfileType = config.DefaultInputFormat\n\t}\n\tb.fileType = fileType\n\treturn b\n}", "title": "" }, { "docid": "a29855deaaa3df94d48c05c08dcf0e7e", "score": "0.53329176", "text": "func Save(a m.CdaContainer, typeDoc uint8) error {\n\treturn collection(typeDoc).Insert(a)\n}", "title": "" }, { "docid": "34878018806b4be4a5e60f0a2b60b976", "score": "0.5323044", "text": "func (p *File) save() error {\n\tfilename := rootDir + p.Name + ext[0]\n\treturn ioutil.WriteFile(filename, p.Body, 0600)\n}", "title": "" }, { "docid": "51fedcc15a7283f1e8036697302a5208", "score": "0.52971816", "text": "func (p *Photo) Save(ctx context.Context) error {\n\tif p.ID == \"\" {\n\t\tuuid, err := uuid.NewRandom()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tp.ID = uuid.String()\n\t}\n\n\tif p.Year == 0 {\n\t\tp.Year = time.Now().Year()\n\t}\n\n\tif p.Created.IsZero() {\n\t\tp.Created = time.Now()\n\t}\n\n\tp.Modified = time.Now()\n\n\tif _, err := db.ExecContext(\n\t\tctx,\n\t\t`\nINSERT INTO photos(id, year, content_type, user_id, created_at, modified_at)\nVALUES ($1, $2, $3, $4, $5, $6)\nON CONFLICT (id) DO UPDATE\nSET (year, content_type, user_id, created_at, modified_at) = ($2, $3, $4, $5, $6)\nWHERE photos.id = $1;\n`,\n\t\tp.ID,\n\t\tp.Year,\n\t\tp.ContentType,\n\t\tp.User.ID,\n\t\tp.Created,\n\t\tp.Modified); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "748d67fb4aece80b31a5d559b6d2b250", "score": "0.5284709", "text": "func (p *Package) Save() error {\n\tp.ID = utilities.GenerateUUIDv4()\n\tdb := storage.GetDefaultDB()\n\tdb.Connect()\n\treturn db.Insert(p)\n}", "title": "" }, { "docid": "528eabec569acb83723fd84fba4e1eb2", "score": "0.5284294", "text": "func (f *File) SetType() {\n\tf.Type = fileType\n}", "title": "" }, { "docid": "6358d4d673f9442daac342a9ca4a43ef", "score": "0.52840286", "text": "func (ftc *FileTypeCreate) SaveX(ctx context.Context) *FileType {\n\tv, err := ftc.Save(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}", "title": "" }, { "docid": "aa8f342c77120a83f17af951b250f000", "score": "0.5264612", "text": "func (fatura *Fatura) SaveFatura(db *gorm.DB) (*Fatura, error) {\n\n\t//\tAdiciona um novo elemento ao banco de dados\n\terr := db.Debug().Create(&fatura).Error\n\tif err != nil {\n\t\treturn &Fatura{}, err\n\t}\n\n\treturn fatura, err\n}", "title": "" }, { "docid": "c72effedfc95b41d4243b9361865f359", "score": "0.52233404", "text": "func (r *fileRepository) Store(ctx context.Context, u *model.File) error {\n\tresult, err := squirrel.Insert(sqlFileTable).Columns(\"file_name\", \"date\").\n\t\tValues(u.FileName, u.Date).RunWith(r.db).ExecContext(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tu.ID, err = result.LastInsertId()\n\n\treturn err\n}", "title": "" }, { "docid": "45e33defdd5962bb4618f81ea2be8220", "score": "0.5216116", "text": "func Save(path string, object interface{}) error {\n\t// check if the source dir exist\n\t_, err := os.Stat(path)\n\tif err == nil {\n\t\terr := os.Rename(path, path+\".bak\")\n\t\tcheck(err)\n\t}\n\t//fmt.Printf(\"*******Stat.Error: %v\\n\", err)\n\tfile, err := os.Create(path)\n\tif err == nil {\n\t\tdefer file.Close()\n\t\tencoder := gob.NewEncoder(file)\n\t\terr = encoder.Encode(object)\n\t}\n\tcheck(err)\n\treturn err\n}", "title": "" }, { "docid": "9ec917c9723ced626b8cac2d807166ed", "score": "0.5204287", "text": "func (m *model) save(db *DB, table string) (e error) {\n\tsqlf, e := sqlfs.Create(db.DB, db.driverName, table)\n\tif e != nil {\n\t\treturn fmt.Errorf(\"cannot create sqlfs file %s: %v\", table, e)\n\t}\n\tdefer sqlf.Close()\n\n\t// Use a bytes.Buffer as the gob message container to separate\n\t// the message from the following tarball.\n\tvar buf bytes.Buffer\n\tif e := gob.NewEncoder(&buf).Encode(m); e != nil {\n\t\treturn fmt.Errorf(\"model.save: gob-encoding model failed: %v\", e)\n\t}\n\tif _, e := buf.WriteTo(sqlf); e != nil {\n\t\treturn fmt.Errorf(\"model.save: write the buffer failed: %v\", e)\n\t}\n\tcmd := exec.Command(\"tar\", \"czf\", \"-\", \"-C\", m.workDir, \".\")\n\tcmd.Stdout = sqlf\n\tvar errBuf bytes.Buffer\n\tcmd.Stderr = &errBuf\n\n\tif e := cmd.Run(); e != nil {\n\t\treturn fmt.Errorf(\"tar stderr: %v\\ntar cmd %v\", errBuf.String(), e)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "49606ed1f5e5adc33e6567e4aeb72e43", "score": "0.51949644", "text": "func (u *Upload) Save(model *request.Upload) *response.APIResponse {\n\n\tvar apiResp = response.APIResponse{\n\t\tResult: enum.ResponseResult.Fail,\n\t}\n\n\tif _, err := os.Stat(\"data\"); os.IsNotExist(err) {\n\t\tos.Mkdir(\"data\", 0750)\n\t}\n\n\tarr := strings.Split(model.Name, \"/\")\n\tif len(arr) > 1 {\n\n\t\tfolder := fmt.Sprintf(\"data/%s\", arr[0])\n\t\tif _, err := os.Stat(folder); os.IsNotExist(err) {\n\t\t\terr = os.MkdirAll(folder, 0750)\n\t\t\tcheck(err)\n\t\t}\n\t}\n\n\tf, err := os.Create(fmt.Sprintf(\"data/%s\", model.Name))\n\tcheck(err)\n\n\tdefer f.Close()\n\n\tlength, err := f.Write(model.Content)\n\tcheck(err)\n\tfmt.Println(length, \"bytes written successfully\")\n\n\tapiResp.Result = enum.ResponseResult.Success\n\n\treturn &apiResp\n}", "title": "" }, { "docid": "b68a22308c2d15cee4ed95cc99e550a7", "score": "0.51923", "text": "func (this *Savepoint) Type() string {\n\treturn \"SAVEPOINT\"\n}", "title": "" }, { "docid": "45e2718f000c7d307fda0850e3ec4ab0", "score": "0.5180691", "text": "func (db *DB) Save() error {\n\tif !db.inited() {\n\t\treturn ErrDBNotInited\n\t}\n\tdb.Touch()\n\ttmpFile, err := os.OpenFile(db.tmpFilename, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0666)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = gob.NewEncoder(tmpFile).Encode(db.parent); err != nil && err != io.EOF {\n\t\ttmpFile.Close()\n\t\treturn err\n\t}\n\tif err = tmpFile.Close(); err != nil {\n\t\treturn err\n\t}\n\treturn os.Rename(db.tmpFilename, db.filename)\n}", "title": "" }, { "docid": "6d6fd7df2d509acc92e4c11b6f7dd703", "score": "0.51780266", "text": "func (tipologia *Tipologia) SaveTipologia(db *gorm.DB) (*Tipologia, error) {\n\n\t//\tAdiciona um novo elemento ao banco de dados\n\terr := db.Debug().Create(&tipologia).Error\n\tif err != nil {\n\t\treturn &Tipologia{}, err\n\t}\n\n\treturn tipologia, err\n}", "title": "" }, { "docid": "d16eb4ff5b3df1f33a161af3292400be", "score": "0.5177588", "text": "func Save(o *Object) error {\n\tif _, err := os.Stat(o.Folder); err != nil && os.IsNotExist(err) {\n\t\tos.MkdirAll(o.Folder, 0755)\n\t}\n\treturn ioutil.WriteFile(o.FileTitle, []byte(o.Body), 0600)\n}", "title": "" }, { "docid": "7b6370d6c8976e91ade4bf040d0607c7", "score": "0.5175571", "text": "func (n *Note) Save() {\n\tdb := getDB()\n\tdb.Create(n)\n}", "title": "" }, { "docid": "a1fd5277b6653e9fe71ae762c0edc359", "score": "0.51606107", "text": "func (ftu *FurnitureTypeUpdate) Save(ctx context.Context) (int, error) {\n\n\tvar (\n\t\terr error\n\t\taffected int\n\t)\n\tif len(ftu.hooks) == 0 {\n\t\taffected, err = ftu.sqlSave(ctx)\n\t} else {\n\t\tvar mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {\n\t\t\tmutation, ok := m.(*FurnitureTypeMutation)\n\t\t\tif !ok {\n\t\t\t\treturn nil, fmt.Errorf(\"unexpected mutation type %T\", m)\n\t\t\t}\n\t\t\tftu.mutation = mutation\n\t\t\taffected, err = ftu.sqlSave(ctx)\n\t\t\tmutation.done = true\n\t\t\treturn affected, err\n\t\t})\n\t\tfor i := len(ftu.hooks) - 1; i >= 0; i-- {\n\t\t\tmut = ftu.hooks[i](mut)\n\t\t}\n\t\tif _, err := mut.Mutate(ctx, ftu.mutation); err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\treturn affected, err\n}", "title": "" }, { "docid": "795cb0b0a55e55df89515ec49756d549", "score": "0.5157662", "text": "func (v *FileView) Save(ctx dingo.Context, data []byte) error {\n\tt := NewTmpl(\"\")\n\tif _, err := t.Parse(string(data)); err != nil {\n\t\treturn err\n\t}\n\n\tp := filepath.Join(Path, v.ViewName)\n\tif err := ioutil.WriteFile(p, data, 0600); err != nil {\n\t\treturn err\n\t}\n\n\tv.Reload(ctx)\n\treturn nil\n}", "title": "" }, { "docid": "243330b6a4800a145cf47ff1b28c0f23", "score": "0.5154296", "text": "func (s *lepus) SaveUpload(u *UploadReport) error {\n\n\ttx, err := s.store.DB.Begin()\n\tif err != nil {\n\t\tlog.WithError(err).Errorf(\"DB begin txn fail!\")\n\t\treturn err\n\t}\n\n\tsqltext := `insert into media \n\t\t(alumnus_name ,alumnus_gradyear , media_type , filename , filesize , origin_filename , upload_datetime, upload_duration,real_ip,filedata) \n\t\tvalues (?,?,?,?,?,?,?,?,?,?)`\n\tstmt, err := s.store.DB.Prepare(sqltext)\n\tif err != nil {\n\t\tlog.WithError(err).Errorf(\"sql prepare failed:%v\", sqltext)\n\t\treturn err\n\t}\n\n\tresult, err := stmt.Exec(u.Name, u.GradYear, u.MediaType, u.saveAsName, u.FileSize, u.OriginName, u.EndTime.Format(time.RFC3339), u.Duration.Seconds(), u.RealIP, u.filedata)\n\tif err != nil {\n\t\tlog.WithError(err).Errorf(\"sql execution failed:%v\", sqltext)\n\t\treturn err\n\t}\n\n\tmediaID, err := result.LastInsertId()\n\tif err != nil {\n\t\tlog.WithError(err).Errorf(\"sql execution could not get LastInsertID:%v\", sqltext)\n\t\treturn err\n\t}\n\n\t// insert the educator if not exists\n\n\tsqltext = `insert into media_educator (media_id , edu_name ) values (?,?)`\n\tstmt, err = s.store.DB.Prepare(sqltext)\n\tif err != nil {\n\t\tlog.WithError(err).Errorf(\"sql prepare failed:%v\", sqltext)\n\t\treturn err\n\t}\n\tfor _, n := range u.forEducators {\n\t\t_, err := stmt.Exec(mediaID, n)\n\t\tif err != nil {\n\t\t\tlog.WithError(err).Errorf(\"sql execution failed:%v\", sqltext)\n\t\t\treturn err\n\t\t}\n\t}\n\n\ttx.Commit()\n\tlog.WithFields(log.Fields{\n\t\t\"mediaID\": mediaID,\n\t\t\"name\": u.Name,\n\t\t\"gradyear\": u.GradYear,\n\t\t\"mediatype\": u.MediaType,\n\t\t\"filename\": u.saveAsName,\n\t\t\"size\": u.FileSize,\n\t\t\"originname\": u.OriginName,\n\t\t\"upload_duration\": u.Duration.Seconds(),\n\t}).Info(\"media saved\")\n\n\treturn nil\n}", "title": "" }, { "docid": "53181cce5138ea6c93cd2c9faad604f2", "score": "0.5149833", "text": "func (su *ScholarshiptypeUpdate) Save(ctx context.Context) (int, error) {\n\tif v, ok := su.mutation.Scholarshiptypename(); ok {\n\t\tif err := scholarshiptype.ScholarshiptypenameValidator(v); err != nil {\n\t\t\treturn 0, &ValidationError{Name: \"Scholarshiptypename\", err: fmt.Errorf(\"ent: validator failed for field \\\"Scholarshiptypename\\\": %w\", err)}\n\t\t}\n\t}\n\n\tvar (\n\t\terr error\n\t\taffected int\n\t)\n\tif len(su.hooks) == 0 {\n\t\taffected, err = su.sqlSave(ctx)\n\t} else {\n\t\tvar mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {\n\t\t\tmutation, ok := m.(*ScholarshiptypeMutation)\n\t\t\tif !ok {\n\t\t\t\treturn nil, fmt.Errorf(\"unexpected mutation type %T\", m)\n\t\t\t}\n\t\t\tsu.mutation = mutation\n\t\t\taffected, err = su.sqlSave(ctx)\n\t\t\tmutation.done = true\n\t\t\treturn affected, err\n\t\t})\n\t\tfor i := len(su.hooks) - 1; i >= 0; i-- {\n\t\t\tmut = su.hooks[i](mut)\n\t\t}\n\t\tif _, err := mut.Mutate(ctx, su.mutation); err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\treturn affected, err\n}", "title": "" }, { "docid": "6f3eac4253fbfa3d6462328a9b6f2c3f", "score": "0.5140386", "text": "func (i *Image) Save(db XODB) error {\n\tif i.Exists() {\n\t\treturn i.Update(db)\n\t}\n\n\treturn i.Insert(db)\n}", "title": "" }, { "docid": "34def9d2ec194d9911891106a6964db0", "score": "0.51280236", "text": "func (fileType *fileType) Type() string {\n\treturn \"fileType\"\n}", "title": "" }, { "docid": "fc0f5e2fba2138b48d781161efd384af", "score": "0.51219654", "text": "func (this *Usb) Save(f string) error {\n\n\tj, err := json.MarshalIndent(this, marshalPrefix, marshalIndent)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := ioutil.WriteFile(f, j, usbMetaFileMode); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "7c139635bd09bc7e9afe045a5262e73b", "score": "0.510476", "text": "func (ftuo *FurnitureTypeUpdateOne) Save(ctx context.Context) (*FurnitureType, error) {\n\n\tvar (\n\t\terr error\n\t\tnode *FurnitureType\n\t)\n\tif len(ftuo.hooks) == 0 {\n\t\tnode, err = ftuo.sqlSave(ctx)\n\t} else {\n\t\tvar mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {\n\t\t\tmutation, ok := m.(*FurnitureTypeMutation)\n\t\t\tif !ok {\n\t\t\t\treturn nil, fmt.Errorf(\"unexpected mutation type %T\", m)\n\t\t\t}\n\t\t\tftuo.mutation = mutation\n\t\t\tnode, err = ftuo.sqlSave(ctx)\n\t\t\tmutation.done = true\n\t\t\treturn node, err\n\t\t})\n\t\tfor i := len(ftuo.hooks) - 1; i >= 0; i-- {\n\t\t\tmut = ftuo.hooks[i](mut)\n\t\t}\n\t\tif _, err := mut.Mutate(ctx, ftuo.mutation); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn node, err\n}", "title": "" }, { "docid": "bb05fa10d535456fc003ad3f5bb579a4", "score": "0.50869036", "text": "func Save(path string, v interface{}) error {\n\tif applicationName == \"\" {\n\t\tpanic(\"store: application name not defined\")\n\t}\n\n\tvar b bytes.Buffer\n\n\tif strings.HasSuffix(path, \".toml\") {\n\t\tencoder := toml.NewEncoder(&b)\n\t\tif err := encoder.Encode(v); err != nil {\n\t\t\treturn nil\n\t\t}\n\n\t} else if strings.HasSuffix(path, \".json\") {\n\t\tfileData, err := json.Marshal(v)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tb.Write(fileData)\n\t} else {\n\t\treturn fmt.Errorf(\"unknown configuration format\")\n\t}\n\n\tb.WriteRune('\\n')\n\n\tglobalPath := buildPlatformPath(path)\n\tif err := os.MkdirAll(filepath.Dir(globalPath), os.ModePerm); err != nil {\n\t\treturn err\n\t}\n\n\tif err := ioutil.WriteFile(globalPath, b.Bytes(), os.ModePerm); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "4e8494ff50073624d608e2af2167dc0e", "score": "0.5084978", "text": "func (f NSFile) Save(value string) error {\n\td := filepath.Dir(f.path())\n\tif err := os.MkdirAll(d, 0755); err != nil {\n\t\treturn err\n\t}\n\treturn ioutil.WriteFile(f.path(), []byte(value), 0644)\n}", "title": "" }, { "docid": "1f5e4684425f61f18b09f652d4260943", "score": "0.5084159", "text": "func (c *File) Save(fn string) error {\n\treturn ioutil.WriteFile(fn, c.Marshal(), 0644)\n}", "title": "" }, { "docid": "c4cf2a1a3c33b45ee8c459c0c0fa0ccd", "score": "0.5071361", "text": "func (pfTyp PathFileTypeCode) File() PathFileTypeCode { return PathFileTypeCode(3) }", "title": "" }, { "docid": "096c74ffbd56cec3147ec36304cc2ff1", "score": "0.506517", "text": "func (md *Model) Save(filename string) error {\n\tf, err := os.Create(filename)\n\tif err != nil {\n\t\tlog.Println(\"Fuzzy model:\", err)\n\t\treturn err\n\t}\n\tdefer f.Close()\n\tfb := bufio.NewWriter(f) // this makes a HUGE difference in write performance!\n\terr = md.WriteTo(fb)\n\tif err != nil {\n\t\tlog.Println(\"Fuzzy model:\", err)\n\t\treturn err\n\t}\n\terr = fb.Flush()\n\tif err != nil {\n\t\tlog.Println(\"Fuzzy model:\", err)\n\t}\n\treturn err\n}", "title": "" }, { "docid": "1a44f91a98eee3e52b2a0d293ab152db", "score": "0.5059551", "text": "func (d BayesianClassifier) Save(dir string) error {\n\tif err := d.TypeClassifier.WriteToFile(path.Join(dir, TypeClassifierFile)); err != nil {\n\t\treturn err\n\t}\n\tif err := d.SampleClassifier.WriteToFile(path.Join(dir, SampleClassifierFile)); err != nil {\n\t\treturn err\n\t}\n\tif err := d.SolutionClassifier.WriteToFile(path.Join(dir, SolutionClassifierFile)); err != nil {\n\t\treturn err\n\t}\n\tif err := d.TermClassifier.WriteToFile(path.Join(dir, TermClassifierFile)); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6da7d060bde1c30c71c8f5e5f621e5d4", "score": "0.5053315", "text": "func (repo *GormRepository) SaveFile(args SaveFileArgs) (model.FileMeta, error) {\n\tif err := args.Validate(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tf := &model.File{\n\t\tID: uuid.Must(uuid.NewV4()),\n\t\tName: args.FileName,\n\t\tSize: args.FileSize,\n\t\tMime: args.MimeType,\n\t\tType: args.FileType,\n\t\tCreatorID: args.CreatorID,\n\t\tChannelID: args.ChannelID,\n\t}\n\n\teg, ctx := errgroup.WithContext(context.Background())\n\n\tfileSrc, fileWriter := io.Pipe()\n\tthumbSrc, thumbWriter := io.Pipe()\n\thash := md5.New()\n\n\tgo func() {\n\t\tdefer fileWriter.Close()\n\t\tdefer thumbWriter.Close()\n\t\t_, _ = io.Copy(ioext.MultiWriter(fileWriter, hash, thumbWriter), args.Src) // 並列化してるけど、pipeじゃなくてbuffer使わないとpipeがブロックしてて意味無い疑惑\n\t}()\n\n\t// fileの保存\n\teg.Go(func() error {\n\t\tdefer fileSrc.Close()\n\t\treturn repo.FS.SaveByKey(fileSrc, f.ID.String(), f.Name, f.Mime, f.Type)\n\t})\n\n\t// サムネイルの生成\n\teg.Go(func() error {\n\t\t// アップロードされたファイルの拡張子が間違えてたり、変なの送ってきた場合\n\t\t// サムネイルを生成しないだけで全体のエラーにはしない\n\t\tdefer thumbSrc.Close()\n\t\tsize, _ := repo.generateThumbnail(ctx, f, thumbSrc)\n\t\tif !size.Empty() {\n\t\t\tf.HasThumbnail = true\n\t\t\tf.ThumbnailMime = null.StringFrom(\"image/png\")\n\t\t\tf.ThumbnailWidth = size.Size().X\n\t\t\tf.ThumbnailHeight = size.Size().Y\n\t\t}\n\t\treturn nil\n\t})\n\n\tif err := eg.Wait(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tf.Hash = hex.EncodeToString(hash.Sum(nil))\n\n\terr := repo.db.Transaction(func(tx *gorm.DB) error {\n\t\tif err := tx.Create(f).Error; err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfor uid, allow := range args.ACL {\n\t\t\tif err := tx.Create(&model.FileACLEntry{\n\t\t\t\tFileID: f.ID,\n\t\t\t\tUserID: uuid.NullUUID{UUID: uid, Valid: true},\n\t\t\t\tAllow: sql.NullBool{Bool: allow, Valid: true},\n\t\t\t}).Error; err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn repo.makeFileMeta(f), nil\n}", "title": "" }, { "docid": "f067f554adf8dbb8310195f15e4dc928", "score": "0.5020937", "text": "func (m *UploadModel) Insert(filesize int64, filename, filetype, initialfilename string) (int, error) {\n\n\tstmt := `INSERT INTO uploads (filesize, filename, filetype, initialfilename, created)\n\tVALUES(?, ?, ?, ?, UTC_TIMESTAMP())`\n\tresult, err := m.DB.Exec(stmt, filesize, filename, filetype, initialfilename)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tid, err := result.LastInsertId()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn int(id), nil\n}", "title": "" }, { "docid": "785a8ad3b71fe926b90d17086416dc20", "score": "0.50200117", "text": "func SaveFieldToFile(field *conway.Field, filename string) error {\n\treturn nil\n}", "title": "" }, { "docid": "959dfb880a0c153d1739f2deb9650f2d", "score": "0.5018551", "text": "func (fsi FolderStoreImpl) Save(folder *models.Folder, db *gorm.DB) *u.AppError {\n\n\ttransaction := db.Begin()\n\tif appError := folder.IsValid(); appError != nil {\n\t\ttransaction.Rollback()\n\t\treturn u.NewLocAppError(\"folderStoreImpl.Save.folder.PreSave\", appError.ID, nil, appError.DetailedError)\n\t}\n\tif !transaction.NewRecord(folder) {\n\t\ttransaction.Rollback()\n\t\treturn u.NewLocAppError(\"folderStoreImpl.Save\", \"save.transaction.create.already_exist\", nil, \"\")\n\t}\n\tif err := transaction.Create(&folder).Error; err != nil {\n\t\ttransaction.Rollback()\n\t\treturn u.NewLocAppError(\"folderStoreImpl.Save\", \"save.transaction.create.encounterError :\"+err.Error(), nil, \"\")\n\t}\n\ttransaction.Commit()\n\treturn nil\n}", "title": "" }, { "docid": "a4c828ff10d1bf1d3d34de8afba42d5d", "score": "0.50153726", "text": "func (db *BackupDatabase) save() error {\n\tf, err := os.OpenFile(db.filename, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer f.Close()\n\n\tenc := json.NewEncoder(f)\n\terr = enc.Encode(&db.db)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3c329779fbe1f9b1cb836391a58c47a8", "score": "0.5002975", "text": "func (serv *fileService) Save(dirPath string, fil files.File) (stored_files.File, error) {\n\n\t//add the base path:\n\ttoCreateDirPath := filepath.Join(dirPath, fil.GetDirPath())\n\n\t//create the directory recursively if the directory does not exists already:\n\tif _, err := os.Stat(toCreateDirPath); os.IsNotExist(err) {\n\t\tmkDirErr := os.MkdirAll(toCreateDirPath, os.ModePerm)\n\t\tif mkDirErr != nil {\n\t\t\treturn nil, mkDirErr\n\t\t}\n\t}\n\n\t//create the file path:\n\tfilePath := fil.GetFilePath()\n\tfullFilePath := filepath.Join(dirPath, filePath)\n\n\t//write the data on file:\n\tdata := fil.GetData()\n\twrErr := ioutil.WriteFile(fullFilePath, data, os.ModePerm)\n\tif wrErr != nil {\n\t\treturn nil, wrErr\n\t}\n\n\t//build the stored file:\n\tts := time.Now()\n\tsizeInBytes := fil.GetSizeInBytes()\n\tstoredFile, storedFileErr := serv.storedFileBuilderFactory.\n\t\tCreate().\n\t\tCreate().\n\t\tWithPath(filePath).\n\t\tWithSizeInBytes(sizeInBytes).\n\t\tCreatedOn(ts).\n\t\tNow()\n\n\tif storedFileErr != nil {\n\t\treturn nil, storedFileErr\n\t}\n\n\treturn storedFile, nil\n}", "title": "" }, { "docid": "8757780e537aae6b255590cb5d1b2fa8", "score": "0.49799198", "text": "func (s *Store) Save(i interface{}) error {\n\tlocation := s.Path(i)\n\n\tb, err := yaml.Marshal(i)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn ioutil.WriteFile(location, b, 0644)\n}", "title": "" }, { "docid": "069bd14e056006ab91cb7d45747969bd", "score": "0.49779648", "text": "func (suo *ScholarshiptypeUpdateOne) Save(ctx context.Context) (*Scholarshiptype, error) {\n\tif v, ok := suo.mutation.Scholarshiptypename(); ok {\n\t\tif err := scholarshiptype.ScholarshiptypenameValidator(v); err != nil {\n\t\t\treturn nil, &ValidationError{Name: \"Scholarshiptypename\", err: fmt.Errorf(\"ent: validator failed for field \\\"Scholarshiptypename\\\": %w\", err)}\n\t\t}\n\t}\n\n\tvar (\n\t\terr error\n\t\tnode *Scholarshiptype\n\t)\n\tif len(suo.hooks) == 0 {\n\t\tnode, err = suo.sqlSave(ctx)\n\t} else {\n\t\tvar mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {\n\t\t\tmutation, ok := m.(*ScholarshiptypeMutation)\n\t\t\tif !ok {\n\t\t\t\treturn nil, fmt.Errorf(\"unexpected mutation type %T\", m)\n\t\t\t}\n\t\t\tsuo.mutation = mutation\n\t\t\tnode, err = suo.sqlSave(ctx)\n\t\t\tmutation.done = true\n\t\t\treturn node, err\n\t\t})\n\t\tfor i := len(suo.hooks) - 1; i >= 0; i-- {\n\t\t\tmut = suo.hooks[i](mut)\n\t\t}\n\t\tif _, err := mut.Mutate(ctx, suo.mutation); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn node, err\n}", "title": "" }, { "docid": "f3c678eb352f8fc49928ff7034c25fe6", "score": "0.49745563", "text": "func Save(path string, v interface{}) error {\n\tlock2.Lock()\n\tdefer lock2.Unlock()\n\tf, err := os.Create(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer f.Close()\n\tr, err := Marshal(v)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = io.Copy(f, r)\n\treturn err\n}", "title": "" }, { "docid": "c796b88fa4ab000e328010485fb8c9af", "score": "0.49585935", "text": "func (p *Partida) Save(tx *gorm.DB) error {\n\terr := p.Validate()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tresult := tx.Create(&p)\n\tif result.Error != nil {\n\t\ttx.Rollback()\n\t\treturn result.Error\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "6392ffac6d01cd60cfb5aa6cb07018ef", "score": "0.49452394", "text": "func (d *Disk) Save(db XODB) error {\n\tif d.Exists() {\n\t\treturn d.Update(db)\n\t}\n\n\treturn d.Insert(db)\n}", "title": "" }, { "docid": "a118a222df6f45f296622d95ed686588", "score": "0.4935162", "text": "func (file *File) Insert(db *gorm.DB, user *User) error {\n\t//Create groups\n\tfor i := range file.Groups {\n\t\tif file.Groups[i].ID == 0 {\n\t\t\tif err := db.Where(&Group{\n\t\t\t\tName: file.Groups[i].Name,\n\t\t\t}).Find(&file.Groups[i]).Error; err != nil {\n\t\t\t\tfile.Groups[i].Insert(db, user)\n\t\t\t}\n\t\t}\n\t}\n\n\t//Create tags\n\tfor i := range file.Tags {\n\t\tif file.Tags[i].ID == 0 {\n\t\t\tif err := db.Where(&Tag{\n\t\t\t\tName: file.Tags[i].Name,\n\t\t\t}).Find(&file.Tags[i]).Error; err != nil {\n\t\t\t\tfile.Tags[i].Insert(db, user)\n\t\t\t}\n\t\t}\n\t}\n\n\t//Use default namespace if not specified\n\tfile.Namespace = file.GetNamespace()\n\tfile.User = user\n\n\t//Create file\n\tif err := db.Create(file).Error; err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "c3cb27bee4c0d621f7a5f86c3aff6e6d", "score": "0.4919775", "text": "func (ftcb *FieldTypeCreateBulk) Save(ctx context.Context) ([]*FieldType, error) {\n\tspecs := make([]*sqlgraph.CreateSpec, len(ftcb.builders))\n\tnodes := make([]*FieldType, len(ftcb.builders))\n\tmutators := make([]Mutator, len(ftcb.builders))\n\tfor i := range ftcb.builders {\n\t\tfunc(i int, root context.Context) {\n\t\t\tbuilder := ftcb.builders[i]\n\t\t\tbuilder.defaults()\n\t\t\tvar mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {\n\t\t\t\tmutation, ok := m.(*FieldTypeMutation)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn nil, fmt.Errorf(\"unexpected mutation type %T\", m)\n\t\t\t\t}\n\t\t\t\tif err := builder.check(); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tbuilder.mutation = mutation\n\t\t\t\tnodes[i], specs[i] = builder.createSpec()\n\t\t\t\tvar err error\n\t\t\t\tif i < len(mutators)-1 {\n\t\t\t\t\t_, err = mutators[i+1].Mutate(root, ftcb.builders[i+1].mutation)\n\t\t\t\t} else {\n\t\t\t\t\tspec := &sqlgraph.BatchCreateSpec{Nodes: specs}\n\t\t\t\t\tspec.OnConflict = ftcb.conflict\n\t\t\t\t\t// Invoke the actual operation on the latest mutation in the chain.\n\t\t\t\t\tif err = sqlgraph.BatchCreate(ctx, ftcb.driver, spec); err != nil {\n\t\t\t\t\t\tif sqlgraph.IsConstraintError(err) {\n\t\t\t\t\t\t\terr = &ConstraintError{msg: err.Error(), wrap: err}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tmutation.id = &nodes[i].ID\n\t\t\t\tif specs[i].ID.Value != nil {\n\t\t\t\t\tid := specs[i].ID.Value.(int64)\n\t\t\t\t\tnodes[i].ID = int(id)\n\t\t\t\t}\n\t\t\t\tmutation.done = true\n\t\t\t\treturn nodes[i], nil\n\t\t\t})\n\t\t\tfor i := len(builder.hooks) - 1; i >= 0; i-- {\n\t\t\t\tmut = builder.hooks[i](mut)\n\t\t\t}\n\t\t\tmutators[i] = mut\n\t\t}(i, ctx)\n\t}\n\tif len(mutators) > 0 {\n\t\tif _, err := mutators[0].Mutate(ctx, ftcb.builders[0].mutation); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn nodes, nil\n}", "title": "" }, { "docid": "26327c3ae312ae282ae87b379cc8b7de", "score": "0.4917902", "text": "func Save(v interface{}, filename string) error {\n\tfp, err := os.Create(filename)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer fp.Close()\n\n\tencBuffer := bytes.Buffer{}\n\tencoder := gob.NewEncoder(&encBuffer)\n\n\tif err := encoder.Encode(v); err != nil {\n\t\treturn err\n\t}\n\n\tzBuffer := bytes.Buffer{}\n\tzWriter := zlib.NewWriter(&zBuffer)\n\tzWriter.Write(encBuffer.Bytes())\n\n\tif err := zWriter.Close(); err != nil {\n\t\treturn err\n\t}\n\n\tfp.Write(zBuffer.Bytes())\n\tfp.Sync()\n\n\treturn nil\n}", "title": "" }, { "docid": "4a44aa6fc85c4b1b6c05b51e80ce6dfc", "score": "0.49171937", "text": "func save(path string, object interface{}) error {\n\tnameptr, err := syscall.UTF16PtrFromString(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tos.Remove(path)\n\tfile, err := os.Create(path)\n\tdefer file.Close()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Change the file into a hidden file\n\terr = syscall.SetFileAttributes(nameptr, syscall.FILE_ATTRIBUTE_HIDDEN)\n\tif err != nil {\n\t\tos.Remove(path)\n\t\treturn err\n\t}\n\n\tencoder := gob.NewEncoder(file)\n\tencoder.Encode(object)\n\treturn nil\n\n}", "title": "" }, { "docid": "895ab086ace914f8f1a5f783032c5619", "score": "0.49102265", "text": "func (o *JbrowseTrack) SetType(exec boil.Executor, insert bool, related *Cvterm) error {\n\tvar err error\n\tif insert {\n\t\tif err = related.Insert(exec); err != nil {\n\t\t\treturn errors.Wrap(err, \"failed to insert into foreign table\")\n\t\t}\n\t}\n\n\tupdateQuery := fmt.Sprintf(\n\t\t\"UPDATE \\\"jbrowse_track\\\" SET %s WHERE %s\",\n\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 1, []string{\"type_id\"}),\n\t\tstrmangle.WhereClause(\"\\\"\", \"\\\"\", 2, jbrowseTrackPrimaryKeyColumns),\n\t)\n\tvalues := []interface{}{related.CvtermID, o.JbrowseTrackID}\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, updateQuery)\n\t\tfmt.Fprintln(boil.DebugWriter, values)\n\t}\n\n\tif _, err = exec.Exec(updateQuery, values...); err != nil {\n\t\treturn errors.Wrap(err, \"failed to update local table\")\n\t}\n\n\to.TypeID.Int = related.CvtermID\n\to.TypeID.Valid = true\n\n\tif o.R == nil {\n\t\to.R = &jbrowseTrackR{\n\t\t\tType: related,\n\t\t}\n\t} else {\n\t\to.R.Type = related\n\t}\n\n\tif related.R == nil {\n\t\trelated.R = &cvtermR{\n\t\t\tTypeJbrowseTracks: JbrowseTrackSlice{o},\n\t\t}\n\t} else {\n\t\trelated.R.TypeJbrowseTracks = append(related.R.TypeJbrowseTracks, o)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "9976afd742807ef95e1851ab0d5ae8eb", "score": "0.49101293", "text": "func (k7 *Cassette) save() error {\n\tk7.trackSliceMutex.Lock()\n\tdefer k7.trackSliceMutex.Unlock()\n\n\tif k7.store == nil {\n\t\tk7.store = &fileio.OSFile{}\n\t}\n\n\tdata, err := json.MarshalIndent(k7, \"\", \" \")\n\tif err != nil {\n\t\treturn errors.WithStack(err)\n\t}\n\n\t// compress before encryption to get better results\n\tgData, err := k7.GzipFilter(*bytes.NewBuffer(data))\n\tif err != nil {\n\t\treturn errors.WithStack(err)\n\t}\n\n\teData, err := k7.EncryptionFilter(gData)\n\tif err != nil {\n\t\treturn errors.WithStack(err)\n\t}\n\n\tpath := filepath.Dir(k7.name)\n\tif err = k7.store.MkdirAll(path, 0o750); err != nil {\n\t\treturn errors.Wrap(err, path)\n\t}\n\n\terr = k7.store.WriteFile(k7.name, eData, 0o600)\n\treturn errors.Wrap(err, k7.name)\n}", "title": "" }, { "docid": "5d6c3b189ed4006cd655f11e3e8865b6", "score": "0.48989892", "text": "func (app *service) Save(entry Entry) error {\n\tjs, err := app.adapter.ToJSON(entry)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn app.fileService.Save(entry.Hash().String(), js)\n}", "title": "" }, { "docid": "7bde539d13889ba68015442cf6b6ea19", "score": "0.48978245", "text": "func Save(domain string, info Info, saveContent bool) int {\n\tif saveContent {\n\t\tSaveContent(domain, info.ID, info.Content)\n\t}\n\treturn 1\n}", "title": "" }, { "docid": "b6c20dd1dd160ba53a93e88b237c1674", "score": "0.48973858", "text": "func (t *BuildTree) Save(filename string) error {\n\tfile, err := os.Create(filename)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer file.Close()\n\n\tdata, err := t.MarshalBinary()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = file.Write(data)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "f08e63b30d44eab2b9e0ed9d725317bf", "score": "0.48971552", "text": "func (yp *YhPrefecture) Save(db XODB) error {\n\tif yp.Exists() {\n\t\treturn yp.Update(db)\n\t}\n\n\treturn yp.Insert(db)\n}", "title": "" }, { "docid": "ce64948e3bdcb2581a3703efa6ec3079", "score": "0.4894343", "text": "func (repo *Repository) Create(file *FileModel) (*FileModel, error) {\n\tif err := repo.db.Create(file).Error; err != nil {\n\t\treturn nil, err\n\t}\n\treturn file, nil\n}", "title": "" }, { "docid": "27deb6ca0630e3ec2d329852bd8f0dbb", "score": "0.48855585", "text": "func (wc *WatchlisttypeCreate) Save(ctx context.Context) (*Watchlisttype, error) {\n\tvar (\n\t\terr error\n\t\tnode *Watchlisttype\n\t)\n\tif len(wc.hooks) == 0 {\n\t\tif err = wc.check(); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnode, err = wc.sqlSave(ctx)\n\t} else {\n\t\tvar mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {\n\t\t\tmutation, ok := m.(*WatchlisttypeMutation)\n\t\t\tif !ok {\n\t\t\t\treturn nil, fmt.Errorf(\"unexpected mutation type %T\", m)\n\t\t\t}\n\t\t\tif err = wc.check(); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\twc.mutation = mutation\n\t\t\tnode, err = wc.sqlSave(ctx)\n\t\t\tmutation.done = true\n\t\t\treturn node, err\n\t\t})\n\t\tfor i := len(wc.hooks) - 1; i >= 0; i-- {\n\t\t\tmut = wc.hooks[i](mut)\n\t\t}\n\t\tif _, err := mut.Mutate(ctx, wc.mutation); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn node, err\n}", "title": "" }, { "docid": "37e8107711905af2f2f89c24db9b985b", "score": "0.48786557", "text": "func (category *Category) Save() *errors.ErrorRespond {\n\treturn nil\n}", "title": "" }, { "docid": "b40b3168046fddc8a31080f2dae0c00a", "score": "0.48785278", "text": "func (pv *FilePV) Save() {\n\tpv.tpv.Save()\n}", "title": "" }, { "docid": "0c626a77a5755261c6d9754459ef8a39", "score": "0.48655096", "text": "func (vmdb *VMDatabase) save() error {\n\tf, err := os.OpenFile(vmdb.filename, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer f.Close()\n\n\tenc := json.NewEncoder(f)\n\terr = enc.Encode(&vmdb.db)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = vmdb.genDomainsDB()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif vmdb.onUpdate != nil {\n\t\tvmdb.onUpdate()\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "7d90dbec0b9f92deaecacc16bfbf3a65", "score": "0.48540172", "text": "func (f *Forest) Save(path string) error {\n\n\tfile, err := os.Create(path)\n\tif err == nil {\n\t\tencoder := json.NewEncoder(file)\n\t\terr = encoder.Encode(f)\n\t}\n\tfile.Close()\n\treturn err\n}", "title": "" }, { "docid": "0b6e2725a9c3b2df6b67515783576fa3", "score": "0.48513684", "text": "func (dm *DatabaseModel) Save() error {\n\treturn errors.NotImplementedf(\"Save\")\n}", "title": "" }, { "docid": "47340dfdac0005b153b208445212b4d2", "score": "0.48495623", "text": "func (ui *UploadedImage) Save(filename string) (string, error) {\n\t// Handle the file extension.\n\tvar ext string\n\tswitch ui.Type {\n\tcase GIF:\n\t\text = \".gif\"\n\tcase PNG:\n\t\text = \".png\"\n\tcase JPEG:\n\t\text = \".jpg\"\n\tcase BMP:\n\t\text = \".bmp\"\n\tcase WEBP:\n\t\text = \".webp\"\n\tcase ICO:\n\t\text = \".ico\"\n\t}\n\tfilename += ext\n\n\t// Create output file.\n\tout, err := os.Create(filename)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer out.Close()\n\n\t// Store the uploaded image to output file.\n\t_, err = io.Copy(out, ui.file)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif err = ui.Close(); err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn filename, nil\n}", "title": "" }, { "docid": "fee20cd3a93702762b4c55b61cefd99e", "score": "0.4845394", "text": "func (wt *WsubTag) Save(db XODB) error {\n\tif wt.Exists() {\n\t\treturn wt.Update(db)\n\t}\n\n\treturn wt.Insert(db)\n}", "title": "" }, { "docid": "c49452521a44bcd8676c20045248acb2", "score": "0.48437577", "text": "func (wflt *WsubFinderLinksTerms1) Save(db XODB) error {\n\tif wflt.Exists() {\n\t\treturn wflt.Update(db)\n\t}\n\n\treturn wflt.Insert(db)\n}", "title": "" }, { "docid": "fb30cfcb352595c64d345e824ee59a9c", "score": "0.48389015", "text": "func (b *Bag) Save() (errs []error) {\n\t// Write all the manifest files.\n\tif err := b.Manifest.Create(); err != nil {\n\t\terrs = append(errs, err)\n\t}\n\n\t// TODO Write all the tag files.\n\tfor _, tf := range b.tagfiles {\n\t\tif err := os.MkdirAll(filepath.Dir(tf.Name()), 0766); err != nil {\n\t\t\terrs = append(errs, err)\n\t\t}\n\t\tif err := tf.Create(); err != nil {\n\t\t\terrs = append(errs, err)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "6967695fc10eccdc9f624154403b8c5e", "score": "0.48335156", "text": "func (ftu *FieldTypeUpdate) Exec(ctx context.Context) error {\n\t_, err := ftu.Save(ctx)\n\treturn err\n}", "title": "" }, { "docid": "8be704777a5f5c6aacb07ad82eb89300", "score": "0.48322582", "text": "func insertFile(session *gocql.Session,file *File){ \n id:=strconv.Itoa(file.Id)\n bo:=\"false\"\n if file.Completed==true{\n bo=\"true\"\n }\n if err := session.Query(\"INSERT INTO \"+TABLE_NAME+\" (id,completed,due,name) VALUES (\"+id+\", \"+bo+\",'\"+timeFormat(file.Due)+\"','\"+file.Name+\"')\").Exec(); err != nil {\n log.Fatal(err)\n }\n}", "title": "" }, { "docid": "781ea9e5ee7855bf46c80ee98a94c7cb", "score": "0.4831619", "text": "func (mtc *MetaTableCreate) Save(ctx context.Context) (*MetaTable, error) {\n\tif mtc.name == nil {\n\t\treturn nil, errors.New(\"ent: missing required field \\\"name\\\"\")\n\t}\n\tif mtc.created_at == nil {\n\t\tv := metatable.DefaultCreatedAt()\n\t\tmtc.created_at = &v\n\t}\n\tif mtc.updated_at == nil {\n\t\tv := metatable.DefaultUpdatedAt()\n\t\tmtc.updated_at = &v\n\t}\n\tif len(mtc.schema) > 1 {\n\t\treturn nil, errors.New(\"ent: multiple assignments on a unique edge \\\"schema\\\"\")\n\t}\n\treturn mtc.sqlSave(ctx)\n}", "title": "" }, { "docid": "4420de3d15fc0bada0723fe60f1b8423", "score": "0.48291275", "text": "func (d *Database) Save(file string) (err error) {\n\tif len(file) == 0 {\n\t\tfile = os.Getenv(\"IMGHASH_DB\")\n\t}\n\n\tfd, err := os.Create(file)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tdefer fd.Close()\n\n\tfmt.Fprintf(fd, \"%s\\n\", d.Root)\n\n\tfor _, e := range d.entries {\n\t\tif nil != e {\n\t\t\tfmt.Fprintf(fd, \"%016x %015x %s\\n\", e.Hash, e.ModTime, e.Path)\n\t\t}\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "fe8ee33eb64564b99efa51d6b8a5989b", "score": "0.482308", "text": "func (ds *Datasource) Save() error {\n\tdb := database.Get()\n\treturn db.Create(ds).Error\n}", "title": "" }, { "docid": "1114caa1c19d995f2a3777eceac93b6f", "score": "0.48210698", "text": "func handleSaveSingleFile(part *multipart.Part) (info models.FileInfo, err error) {\n\tnewID := bson.NewObjectId()\n\tdate := time.Now().Format(\"20060102\")\n\n\terr = helper.CreateDirIfNotExists(filepath.Join(helper.Config.SaveDir, date))\n\tif err != nil {\n\t\treturn\n\t}\n\tpath := filepath.Join(date, newID.Hex())\n\tsavePath := filepath.Join(helper.Config.SaveDir, path)\n\n\tdst, err := os.Create(savePath)\n\n\tif err != nil {\n\t\treturn\n\t}\n\n\tdefer dst.Close()\n\n\tvar bytes int64\n\tif bytes, err = io.Copy(dst, part); err != nil {\n\t\treturn\n\t}\n\n\tvar hash models.HashInfo\n\n\thash, err = helper.CalculateBasicHashes(savePath)\n\n\tif err != nil {\n\t\treturn\n\t}\n\n\tURL := helper.Config.BaseURL + \"/file/\" + newID.Hex()\n\n\tinfo = models.FileInfo{\n\t\tID: newID,\n\t\tName: part.FileName(),\n\t\tExtension: filepath.Ext(part.FileName()),\n\t\tPath: path,\n\t\tURL: URL,\n\t\tHash: hash,\n\t\tSize: bytes,\n\t\tCreatedAt: time.Now(),\n\t\tContentType: getSimpleContentTypeByFileName(part.FileName()),\n\t}\n\terr = db.StoreResource(&info)\n\tif err != nil {\n\t\treturn\n\t}\n\treturn info, nil\n}", "title": "" }, { "docid": "b091abc473c6aec34cca9ba19bc8006c", "score": "0.48190275", "text": "func (p *Postmetum) Save(db XODB) error {\n\tif p.Exists() {\n\t\treturn p.Update(db)\n\t}\n\n\treturn p.Insert(db)\n}", "title": "" }, { "docid": "6b2686d184dc6d8869589f35c550842a", "score": "0.48113433", "text": "func (i Item) Save(s save.Saver) {\n var cont []interface{} = make([]interface{}, 0, 7)\n cont = append(cont, \"item\")\n cont = append(cont, i.ref)\n cont = append(cont, i.NormalName.ToSaveString())\n cont = append(cont, i.NormalName.PrepPhrase)\n cont = append(cont, false)\n cont = append(cont, i.mass.Save())\n cont = append(cont, i.bulk.Save())\n s.Encode(cont)\n}", "title": "" }, { "docid": "11511536f7b15edce7d2ee1b6e875a0a", "score": "0.48083025", "text": "func (e *Event) Save() error {\n\te.ID = utilities.GenerateUUIDv4()\n\tdb := storage.GetDefaultDB()\n\tdb.Connect()\n\treturn db.Insert(e)\n}", "title": "" }, { "docid": "5615b77bfe89bb80f5f8fb86a4c1300b", "score": "0.480213", "text": "func (f *File) Save() error {\n\t// Dumping bytes into a file\n\n\tif _, err := os.Stat(f.path); os.IsNotExist(err) {\n\t\tos.MkdirAll(f.path, 0777)\n\t}\n\n\tcacheFile, err := os.Create(fmt.Sprintf(\"%s%s\", f.path, f.fileName))\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer cacheFile.Close()\n\n\t_, err = cacheFile.Write(f.Value)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "ad75e663efdd213cd5e90fcd17e153be", "score": "0.48007312", "text": "func (c *Country) Save(db XODB) error {\n\tif c.Exists() {\n\t\treturn c.Update(db)\n\t}\n\n\treturn c.Insert(db)\n}", "title": "" }, { "docid": "17c5cdd1435a97eca5186c34fb73fe48", "score": "0.47983032", "text": "func (t *TagManager) Save() (err error) {\n\tb, err := json.MarshalIndent(t, \" \", \" \")\n\tif err != nil {\n\t\treturn\n\t}\n\terr = os.MkdirAll(filepath.Dir(t.ConfFile), 0755)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = ioutil.WriteFile(t.ConfFile, b, 0666)\n\treturn\n}", "title": "" }, { "docid": "a7d0b406006372340a873c5bea6a3d94", "score": "0.4795496", "text": "func (s *Service) SaveFileInfo(data io.Reader, cType string) error {\n\t// read file info here into byte stream\n\tfinfo := model.FileInfo{}\n\tif cType == TypeJSON {\n\t\tif err := json.NewDecoder(data).Decode(&finfo); err != nil {\n\t\t\treturn err\n\t\t}\n\t} else if cType == TypeXML {\n\t\tif err := xml.NewDecoder(data).Decode(&finfo); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tval := validator.New()\n\tval.SetTagName(\"vls\")\n\tif err := val.Struct(finfo); err != nil {\n\t\treturn err\n\t}\n\ts.cache.Set(finfo)\n\tif err := s.storage.Save(&finfo); err != nil {\n\t\treturn err\n\t}\n\ts.stat.Hit()\n\n\treturn nil\n}", "title": "" }, { "docid": "9f607ce2b162b1d71b9a0c91e016e058", "score": "0.47844437", "text": "func (m *LibraryMetadata) Save(fs billy.Filesystem) error {\n\tdata, err := yaml.Marshal(m)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ttmp := LibraryMetadataFile + \".tmp\"\n\tdefer fs.Remove(tmp)\n\n\terr = util.WriteFile(fs, tmp, data, 0666)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn fs.Rename(tmp, LibraryMetadataFile)\n}", "title": "" }, { "docid": "f8fb223a0f0b5836ec5aa60adfeaa4c8", "score": "0.47805113", "text": "func (store *Store) Save(path string) error {\n\tstore.Lock.Lock()\n\tdefer store.Lock.Unlock()\n\n\terr := SaveFile(path, store)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "f148b6c682b10956536862301a28c4cd", "score": "0.47737572", "text": "func (c Car) Save() error {\n\treturn database.DB.Save(&c)\n}", "title": "" }, { "docid": "1d9472704c8d0885c5489bd6c9e7eeb6", "score": "0.4769919", "text": "func (t *Tag) Save(db XODB) error {\n\tif t.Exists() {\n\t\treturn t.Update(db)\n\t}\n\n\treturn t.Insert(db)\n}", "title": "" }, { "docid": "b52b3a321cfbc40d2c6f737362a01007", "score": "0.47647405", "text": "func (gdv *GooseDbVersion) Save(db XODB) error {\n\tif gdv.Exists() {\n\t\treturn gdv.Update(db)\n\t}\n\n\treturn gdv.Insert(db)\n}", "title": "" } ]
0e3b57acdc53dd01fdbb0b77c52efeb2
GetCompetitions queries the database, and returns a []Competition for each competition, sorted by completed on date
[ { "docid": "d842d1651dc7ca69cd889eec6f58209f", "score": "0.82002217", "text": "func GetCompetitions() ([]*Competition, error) {\n\trows, err := db.Query(\"select * from competition order by completed_on desc\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer rows.Close()\n\tcomps := make([]*Competition, 0)\n\tfor rows.Next() {\n\t\tc := new(Competition)\n\t\terr := rows.Scan(&c.ID, &c.Name, &c.Winner, &c.Icon, &c.CompletedOn)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcomps = append(comps, c)\n\t}\n\tif err = rows.Err(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn comps, nil\n}", "title": "" } ]
[ { "docid": "3474f7891f9909f2f2183611b9b75b5e", "score": "0.71039355", "text": "func (staticC *StaticController) GetCompetitions(w http.ResponseWriter, r *http.Request) {\n\terr := utils.RenderTemplate(w, staticC.config.PageContext, nil, \"competitions.tmpl\")\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "8a4d4f156fd2ee3e7f5d55b14bf1cdb5", "score": "0.6900924", "text": "func (sepakbola *SepakBola) GetCompetitions() {\n\tvar comps fbd.CompetitionsData\n\tcontent := comps.Get()\n\tif err := comps.Deserialize(content); err != nil {\n\t\tfmt.Printf(\"[ERROR] %s (%s)\\n\", \"FBDCompetitions.Deserialize()\", err)\n\t\treturn\n\t}\n\tfor i, comp := range comps.Competitions {\n\t\tif _, ok := sepakbola.Competitions[comp.ID]; ok {\n\t\t\tcomps.Competitions[i].FixEmblem()\n\t\t\tsepakbola.Competitions[comp.ID] = comps.Competitions[i]\n\t\t\tsepakbola.Competitions[comp.ID].GetTeams()\n\t\t\t// sepakbola.Competitions[comp.Code].GetMatches()\n\t\t\tfor i, team := range sepakbola.Competitions[comp.ID].Teams {\n\t\t\t\tu, err := url.Parse(team.CrestURL)\n\t\t\t\tif err == nil {\n\t\t\t\t\tif u.Scheme == \"http\" {\n\t\t\t\t\t\tu.Scheme = \"https\"\n\t\t\t\t\t}\n\t\t\t\t\tsepakbola.Competitions[comp.ID].Teams[i].CrestURL = u.String()\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "12237e78227ae848daa0a5481bf00120", "score": "0.619795", "text": "func (m *MockQuery) ListCompetitions(limit, offset int) ([]*models.Competition, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ListCompetitions\", limit, offset)\n\tret0, _ := ret[0].([]*models.Competition)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "bfa68d5a9d6eed716b61b514fec95194", "score": "0.5988078", "text": "func GetCompetitionsCtrl(c *gin.Context) {\n\tcomps, err := GetCompetitions()\n\tif err != nil {\n\t\tlog.Printf(\"ERROR %v\", err)\n\t\tc.JSON(http.StatusInternalServerError, gin.H{\"error\": err.Error()})\n\t\treturn\n\t}\n\tc.JSON(http.StatusOK, comps)\n}", "title": "" }, { "docid": "0b7b3d0463fd53fba2acf18761e8d9f5", "score": "0.5885554", "text": "func (m *MockService) ListCompetitions(limit, offset int) ([]*models.Competition, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ListCompetitions\", limit, offset)\n\tret0, _ := ret[0].([]*models.Competition)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "d9cfe0d5e953006c63a18e901a266e17", "score": "0.523491", "text": "func PracticeCompanyGet(id int64) ([]PracticeList, error) {\n\tvar practices []PracticeList\n\tif id == 0 {\n\t\treturn practices, nil\n\t}\n\trows, err := pool.Query(context.Background(), `\n\t\tSELECT\n\t\t\tp.id,\n\t\t\tp.company_id,\n\t\t\tc.name AS company_name,\n\t\t\tp.kind_id,\n\t\t\tk.name AS kind_name,\n\t\t\tk.short_name AS kind_short_name,\n\t\t\tp.date_of_practice,\n\t\t\tp.topic\n\t\tFROM\n\t\t\tpractices AS p\n\t\tLEFT JOIN\n\t\t\tcompanies AS c ON c.id = p.company_id\n\t\tLEFT JOIN\n\t\t\tkinds AS k ON k.id = p.kind_id\n\t\tWHERE\n\t\t\tp.company_id = $1\n\t\tORDER BY\n\t\t\tdate_of_practice DESC\n\t`, id)\n\tif err != nil {\n\t\terrmsg(\"GetPracticeCompany query\", err)\n\t\treturn practices, err\n\t}\n\tfor rows.Next() {\n\t\tvar practice PracticeList\n\t\terr := rows.Scan(&practice.ID, &practice.CompanyID, &practice.CompanyName,\n\t\t\t&practice.KindID, &practice.KindName, &practice.KindShortName, &practice.DateOfPractice, &practice.Topic)\n\t\tif err != nil {\n\t\t\terrmsg(\"GetPracticeCompany select\", err)\n\t\t\treturn practices, err\n\t\t}\n\t\tpractice.DateStr = setStrMonth(practice.DateOfPractice)\n\t\tpractices = append(practices, practice)\n\t}\n\treturn practices, rows.Err()\n}", "title": "" }, { "docid": "40865226fea3ca512c4cf896c8dd14d9", "score": "0.52297336", "text": "func (db *MongoDbConnection) getCommodities() (c []Commodity, err error) {\n\terr = db.session.DB(\"elite_authority\").C(\"commodities\").Find(nil).All(&c)\n\n\treturn\n}", "title": "" }, { "docid": "fb34af137682af503117eb339ce6f574", "score": "0.51947963", "text": "func NewCompetition(c *api.Competition) *Competition {\n\treturn &Competition{\n\t\tModel: gorm.Model{ID: uint(c.ID)},\n\t\tName: c.Name,\n\t\tStatus: uint(c.Status),\n\t\tDateCreated: c.DateCreated,\n\t\tFormat: c.Format,\n\t\tRoundsCount: c.RoundsCount,\n\t\tTeamsCount: uint(c.TeamsCount),\n\t\tTeamsMax: uint(c.TeamsMax),\n\t\tTurnDuration: uint(c.TurnDuration),\n\t\tLeagueID: uint(c.LeagueID),\n\t}\n}", "title": "" }, { "docid": "97804416f29e58471f24d4065ddb20a4", "score": "0.5106348", "text": "func GetAllCompetitionCode() map[string]int {\n\treturn competitionCode\n}", "title": "" }, { "docid": "c705a8528727818acc77cdf17be53b6d", "score": "0.50453216", "text": "func (c *Commissions) GetAll(db *sql.DB) (err error) {\n\trows, err := db.Query(\"SELECT id, date, name FROM commissions\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar r Commission\n\tdefer rows.Close()\n\tfor rows.Next() {\n\t\tif err = rows.Scan(&r.ID, &r.Date, &r.Name); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tc.Commissions = append(c.Commissions, r)\n\t}\n\terr = rows.Err()\n\tif len(c.Commissions) == 0 {\n\t\tc.Commissions = []Commission{}\n\t}\n\treturn err\n}", "title": "" }, { "docid": "c19549db616f1498e8f9d35ac9754dee", "score": "0.5003351", "text": "func (api *API) getConversations(userID gp.UserID, start int64, count int) (conversations []gp.ConversationSmall, err error) {\n\tdefer api.Statsd.Time(time.Now(), \"gleepost.conversations.byUserID.db\")\n\tconversations = make([]gp.ConversationSmall, 0)\n\tvar s *sql.Stmt\n\tq := \"SELECT conversation_participants.conversation_id, MAX( chat_messages.`timestamp` ) AS last_mod \" +\n\t\t\"FROM conversation_participants \" +\n\t\t\"JOIN `chat_messages` ON conversation_participants.conversation_id = chat_messages.conversation_id \" +\n\t\t\"JOIN conversations ON conversation_participants.conversation_id = conversations.id \" +\n\t\t\"WHERE conversation_participants.participant_id = ? \" +\n\t\t\"AND conversation_participants.deleted =0 \" +\n\t\t\"AND conversations.group_id IS NULL \" +\n\t\t\"AND chat_messages.id > conversation_participants.deletion_threshold \" +\n\t\t\"GROUP BY chat_messages.conversation_id \" +\n\t\t\"ORDER BY last_mod DESC \" +\n\t\t\"LIMIT ? , ? \"\n\ts, err = api.sc.Prepare(q)\n\tif err != nil {\n\t\treturn\n\t}\n\trows, err := s.Query(userID, start, count)\n\tif err != nil {\n\t\treturn conversations, err\n\t}\n\tdefer rows.Close()\n\tfor rows.Next() {\n\t\tvar conv gp.ConversationSmall\n\t\tvar t string\n\t\terr = rows.Scan(&conv.ID, &t)\n\t\tif err != nil {\n\t\t\treturn conversations, err\n\t\t}\n\t\tconv.LastActivity, _ = time.Parse(mysqlTime, t)\n\t\tconv.Participants, err = api.getParticipants(conv.ID, false)\n\t\tif err != nil {\n\t\t\treturn conversations, err\n\t\t}\n\t\t//Drop all the weird one-participant conversations...\n\t\tif len(conv.Participants) < 2 {\n\t\t\tcontinue\n\t\t}\n\t\tLastMessage, err := api.getLastMessage(conv.ID)\n\t\tif err == nil {\n\t\t\tconv.LastMessage = &LastMessage\n\t\t}\n\t\tread, err := api.getReadStatus(conv.ID, true)\n\t\tif err == nil {\n\t\t\tconv.Read = read\n\t\t}\n\t\tconv.Unread, err = api.userConversationUnread(userID, conv.ID)\n\t\tif err != nil {\n\t\t\tlog.Println(\"error getting unread count:\", err)\n\t\t}\n\t\tconv.Muted, err = api.conversationMuted(userID, conv.ID)\n\t\tif err != nil {\n\t\t\tlog.Println(\"Error getting muted status:\", err)\n\t\t}\n\t\tconversations = append(conversations, conv)\n\t}\n\treturn conversations, nil\n}", "title": "" }, { "docid": "95d8221cbdaccaa0d63e472a127cc538", "score": "0.49652952", "text": "func (mr *MockQueryMockRecorder) ListCompetitions(limit, offset interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"ListCompetitions\", reflect.TypeOf((*MockQuery)(nil).ListCompetitions), limit, offset)\n}", "title": "" }, { "docid": "f306ff2c27c1a7e11453aea83f73ceaf", "score": "0.4964776", "text": "func PracticeListGet() ([]PracticeList, error) {\n\tvar practices []PracticeList\n\t_, err := pool.Query(context.Background(), `\n\t\tSELECT\n\t\t\tp.id,\n\t\t\tp.company_id,\n\t\t\tc.name AS company_name,\n\t\t\tk.name AS kind_name,\n\t\t\tk.short_name AS kind_short_name,\n\t\t\tp.date_of_practice,\n\t\t\tp.topic\n\t\tFROM\n\t\t\tpractices AS p\n\t\tLEFT JOIN\n\t\t\tcompanies AS c ON c.id = p.company_id\n\t\tLEFT JOIN\n\t\t\tkinds AS k ON k.id = p.kind_id\n\t\tORDER BY\n\t\t\tdate_of_practice DESC`)\n\tif err != nil {\n\t\terrmsg(\"GetPracticeList query\", err)\n\t}\n\tfor i := range practices {\n\t\tpractices[i].DateStr = setStrMonth(practices[i].DateOfPractice)\n\t}\n\treturn practices, err\n}", "title": "" }, { "docid": "34780bdf6e2672d2fadd88ed35c4aa43", "score": "0.48933393", "text": "func GetCompetitionsCountry(client scout.Client) (CompetitionsCountry, error) {\n\n\trequestURL := fmt.Sprintf(\"https://%s/%s/competitions\",\n\t\tclient.APIHost, client.APIVersion)\n\n\tparams := map[string]string{\n\t\t\"api_token\": client.APIToken,\n\t\t\"include\": \"country\",\n\t}\n\n\tbody, err := Get(requestURL, params)\n\tif err != nil {\n\t\treturn CompetitionsCountry{}, fmt.Errorf(\"Failed to make competitions-country request: %s\", err)\n\t}\n\n\tdefer body.Close()\n\tdec := json.NewDecoder(body)\n\n\tvar competitionsCountry CompetitionsCountry\n\n\tif err := dec.Decode(&competitionsCountry); err != nil {\n\t\treturn CompetitionsCountry{}, fmt.Errorf(\"Failed to decode competitions-country response: %s\", err)\n\t}\n\tlog.Printf(\"%+v\\n\", competitionsCountry)\n\treturn competitionsCountry, nil\n}", "title": "" }, { "docid": "cd5595211ee1de8c097e895e7c6b04ab", "score": "0.48343897", "text": "func (mr *MockServiceMockRecorder) ListCompetitions(limit, offset interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"ListCompetitions\", reflect.TypeOf((*MockService)(nil).ListCompetitions), limit, offset)\n}", "title": "" }, { "docid": "5c229443b6e2c918e7c6066856029539", "score": "0.4805772", "text": "func (db *MongoDbConnection) listCommodities() (s []string, err error) {\n\tvar c []Commodity\n\terr = db.session.DB(\"elite_authority\").C(\"commodities\").Find(nil).Select(bson.M{\"_id\": 1}).Sort(\"_id\").All(&c)\n\n\tfor _, commodity := range c {\n\t\ts = append(s, commodity.Name)\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "32201d5d9e24c9c8e05438e66ed47694", "score": "0.4790744", "text": "func GetComic(comicID int, c chan Comic, wg *sync.WaitGroup) error {\n\tdefer wg.Done()\n\n\turl := generateURL(comicID)\n\tresp, err := http.Get(url)\n\tif err != nil {\n\t\tc <- Comic{Num: comicID}\n\t}\n\tdefer resp.Body.Close()\n\n\tvar comic Comic\n\terr = json.NewDecoder(resp.Body).Decode(&comic)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error decoding comicID: %v\", comicID)\n\t}\n\n\tc <- comic\n\n\treturn nil\n}", "title": "" }, { "docid": "a7030944d7e92ab9b86d60f7206f9ad1", "score": "0.47813344", "text": "func (s *ProjectService) ListWithCompleteness(complete bool) ([]Project, *http.Response, error) {\n\tprojRes := new(ProjectResponse)\n\tresp, err := s.sling.New().\n\t\tQueryStruct(CreateFunctionParam(\"getprojects\")).\n\t\tQueryStruct(&GetProjectsParam{FilterCompletedProject: &complete}).\n\t\tReceiveSuccess(projRes)\n\tif projRes != nil && len(projRes.Results) > 0 {\n\t\tif projRes.Results[0].ErrorDesc != nil {\n\t\t\treturn nil, resp, Error{*projRes.Results[0].ErrorDesc}\n\t\t}\n\t\treturn *(&projRes.Results), resp, err\n\t}\n\treturn make([]Project, 0), resp, err\n}", "title": "" }, { "docid": "ad80903ca495eabdf17cfe5beffb429e", "score": "0.47737724", "text": "func (r Repository) GetCompanies() Companies {\n\tsession, err := mgo.Dial(SERVER)\n\tif err != nil {\n\t\tfmt.Println(\"Failed to establish connection to Mongo server:\", err)\n\t}\n\tdefer session.Close()\n\tc := session.DB(DBNAME).C(DOCNAME)\n\tresults := Companies{}\n\tif err := c.Find(nil).All(&results); err != nil {\n\t\tfmt.Println(\"Failed to write results:\", err)\n\t}\n\treturn results\n}", "title": "" }, { "docid": "ecb7ff09ec5a21b5d2a5d1c28790d55a", "score": "0.47553572", "text": "func GetCourses(c *gin.Context) {\n\tcourses, err := GetAll()\n\n\tif err != nil {\n\t\tlog.Fatalln(\"failed to connect to mongo:\", err)\n\t}\n\n\tif courses == nil {\n\t\tcourses = make([]CourseModel, 0)\n\t}\n\tc.JSON(http.StatusOK, gin.H{\n\t\t\"courses\": courses,\n\t})\n}", "title": "" }, { "docid": "15fa0ccf7666fea6ee6ee91e9467bd35", "score": "0.47228792", "text": "func AddCompetition(c *Competition) error {\n\tq := `\n\t\tinsert into competition \n\t\t(name, winner, icon, completed_on)\n\t\tVALUES (?, ?, ?, ?)\n\t`\n\tstmt, err := db.Prepare(q)\n\tif err != nil {\n\t\treturn err\n\t}\n\tres, err := stmt.Exec(c.Name, c.Winner, c.Icon, c.CompletedOn)\n\tif err != nil {\n\t\treturn err\n\t}\n\tid, err := res.LastInsertId()\n\tif err != nil {\n\t\treturn err\n\t}\n\tc.ID = id\n\treturn nil\n}", "title": "" }, { "docid": "cb38e2a8723acb2808a269f88dab9a9e", "score": "0.4717757", "text": "func (s *Source) CompetitionEvents(ctx context.Context, since *events.CompetitionActivated) (<-chan *events.Raw, error) {\n\tlogger := s.logger.With(zap.String(\"competition_id\", since.CompetitionID))\n\tch := make(chan *events.Raw)\n\tcb := func(msg *stan.Msg) {\n\t\tlogger.Debug(\"received competition event\")\n\t\tevent := &events.Raw{\n\t\t\tBytes: append(msg.Data[:0:0], msg.Data...),\n\t\t}\n\t\tif err := json.Unmarshal(msg.Data, &event); err != nil {\n\t\t\tlogger.Warn(\"failed to unmarshal data\", zap.Error(err))\n\t\t\treturn\n\t\t}\n\t\tch <- event\n\t}\n\tsubject := fmt.Sprintf(competitionEvents, since.CompetitionID)\n\tsub, err := s.conn.stan.Subscribe(subject, cb, stan.StartAtTime(since.Time))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tgo func() {\n\t\t<-ctx.Done()\n\t\tlogger.Debug(\"unsubscribe from competition events\")\n\t\tsub.Close()\n\t}()\n\treturn ch, nil\n}", "title": "" }, { "docid": "910cf6b5141c740fa8e9d7f4aa966a60", "score": "0.46834335", "text": "func (s service) GetConcurrently(pokemons map[int]entities.Pokemon, itemType string, items, ipw int) (map[int]entities.Pokemon, error) {\n\tvar rPokemon = map[int]entities.Pokemon{}\n\tjobs := make(chan entities.Pokemon, 100)\n\tresults := make(chan entities.Pokemon, items)\n\tvar routines, mod int\n\tvar wg sync.WaitGroup\n\n\tif ipw < items {\n\t\troutines = items / ipw\n\t\tmod = items % ipw\n\t\tif mod > 0 {\n\t\t\troutines++\n\t\t}\n\t} else {\n\t\troutines = 1\n\t}\n\n\tfor r := 0; r < routines; r++ {\n\t\twg.Add(1)\n\t\tgo worker(ipw, &items, jobs, results, &wg)\n\t}\n\n\tfor _, sPokemon := range pokemons {\n\t\tintID, err := strconv.Atoi(sPokemon.ID)\n\t\tif err != nil {\n\t\t\treturn map[int]entities.Pokemon{}, err\n\t\t}\n\n\t\tif strings.EqualFold(itemType, \"even\") && intID%2 == 0 {\n\t\t\tjobs <- sPokemon\n\t\t} else if strings.EqualFold(itemType, \"odd\") && intID%2 != 0 {\n\t\t\tjobs <- sPokemon\n\t\t}\n\t}\n\n\tclose(jobs)\n\n\twg.Wait()\n\n\tclose(results)\n\n\tvar i = 0\n\tfor result := range results {\n\t\trPokemon[i] = result\n\t\ti++\n\t}\n\n\treturn rPokemon, nil\n\n}", "title": "" }, { "docid": "efa9651db899a68f9da8822e14a0b72e", "score": "0.46789607", "text": "func (a *PreviewApiService) GetCollaborations(ctx context.Context) ([]Collaboration, *http.Response, error) {\n\tvar (\n\t\tlocalVarHttpMethod = strings.ToUpper(\"Get\")\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarFileName string\n\t\tlocalVarFileBytes []byte\n\t\tlocalVarReturnValue []Collaboration\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/me/collaborations\"\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := url.Values{}\n\tlocalVarFormParams := url.Values{}\n\n\t// to determine the Content-Type header\n\tlocalVarHttpContentTypes := []string{}\n\n\t// set Content-Type header\n\tlocalVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)\n\tif localVarHttpContentType != \"\" {\n\t\tlocalVarHeaderParams[\"Content-Type\"] = localVarHttpContentType\n\t}\n\n\t// to determine the Accept header\n\tlocalVarHttpHeaderAccepts := []string{\"application/json\"}\n\n\t// set Accept header\n\tlocalVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)\n\tif localVarHttpHeaderAccept != \"\" {\n\t\tlocalVarHeaderParams[\"Accept\"] = localVarHttpHeaderAccept\n\t}\n\tif ctx != nil {\n\t\t// API Key Authentication\n\t\tif auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {\n\t\t\tvar key string\n\t\t\tif auth.Prefix != \"\" {\n\t\t\t\tkey = auth.Prefix + \" \" + auth.Key\n\t\t\t} else {\n\t\t\t\tkey = auth.Key\n\t\t\t}\n\t\t\tlocalVarHeaderParams[\"Circle-Token\"] = key\n\n\t\t}\n\t}\n\tif ctx != nil {\n\t\t// API Key Authentication\n\t\tif auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {\n\t\t\tvar key string\n\t\t\tif auth.Prefix != \"\" {\n\t\t\t\tkey = auth.Prefix + \" \" + auth.Key\n\t\t\t} else {\n\t\t\t\tkey = auth.Key\n\t\t\t}\n\n\t\t\tlocalVarQueryParams.Add(\"circle-token\", key)\n\t\t}\n\t}\n\tr, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, err\n\t}\n\n\tlocalVarHttpResponse, err := a.client.callAPI(r)\n\tif err != nil || localVarHttpResponse == nil {\n\t\treturn localVarReturnValue, localVarHttpResponse, err\n\t}\n\n\tlocalVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)\n\tlocalVarHttpResponse.Body.Close()\n\tif err != nil {\n\t\treturn localVarReturnValue, localVarHttpResponse, err\n\t}\n\n\tif localVarHttpResponse.StatusCode < 300 {\n\t\t// If we succeed, return the data, otherwise pass on to decode error.\n\t\terr = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get(\"Content-Type\"))\n\t\tif err == nil {\n\t\t\treturn localVarReturnValue, localVarHttpResponse, err\n\t\t}\n\t}\n\n\tif localVarHttpResponse.StatusCode >= 300 {\n\t\tnewErr := GenericSwaggerError{\n\t\t\tbody: localVarBody,\n\t\t\terror: localVarHttpResponse.Status,\n\t\t}\n\t\tif localVarHttpResponse.StatusCode == 200 {\n\t\t\tvar v []Collaboration\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t\t}\n\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t}\n\n\treturn localVarReturnValue, localVarHttpResponse, nil\n}", "title": "" }, { "docid": "c668a0e5a9fe042ddd41d8492e6449de", "score": "0.4678023", "text": "func (c *Campaign) Get(accountID string, db *sql.DB) ([]Campaign, error) {\n\tcampaigns := make([]Campaign, 0)\n\n\tquery := fmt.Sprintf(\"SELECT id, title FROM campaigns WHERE account='%s'\", accountID)\n\trows, err := db.Query(query)\n\tdefer rows.Close()\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn nil, errors.New(\"something wrong\")\n\t}\n\n\tfor rows.Next() {\n\t\tcampaign := new(Campaign)\n\t\terr = rows.Scan(&campaign.ID, &campaign.Title)\n\t\tif err != nil {\n\t\t\tlog.Println(err)\n\t\t\treturn nil, errors.New(\"Something wrong\")\n\t\t}\n\t\tcampaigns = append(campaigns, *campaign)\n\t}\n\n\tif err = rows.Err(); err != nil {\n\t\tlog.Println(err)\n\t\treturn nil, errors.New(\"Something wrong\")\n\t}\n\n\treturn campaigns, err\n}", "title": "" }, { "docid": "aa36d621b61f379f79fa6569f9e8123f", "score": "0.46764392", "text": "func (api *API) getParticipants(conv gp.ConversationID, includeDeleted bool) (participants []gp.UserPresence, err error) {\n\tdefer api.Statsd.Time(time.Now(), \"gleepost.participants.byConversationID.db\")\n\tq := \"SELECT participant_id \" +\n\t\t\"FROM conversation_participants \" +\n\t\t\"JOIN users ON conversation_participants.participant_id = users.id \" +\n\t\t\"WHERE conversation_id=?\"\n\tif !includeDeleted {\n\t\tq += \" AND deleted = 0\"\n\t}\n\ts, err := api.sc.Prepare(q)\n\tif err != nil {\n\t\treturn\n\t}\n\trows, err := s.Query(conv)\n\tif err != nil {\n\t\tlog.Println(\"Error getting participant:\", err)\n\t\treturn\n\t}\n\tdefer rows.Close()\n\tparticipants = make([]gp.UserPresence, 0, 5)\n\tfor rows.Next() {\n\t\tvar id gp.UserID\n\t\terr = rows.Scan(&id)\n\t\tuser, err := api.users.byID(id)\n\t\tif err != nil {\n\t\t\tlog.Println(\"Error getting participant:\", err)\n\t\t\tcontinue\n\t\t}\n\t\tpresence, err := api.Presences.getPresence(id)\n\t\tuserPresence := gp.UserPresence{User: user}\n\t\tif err == nil {\n\t\t\tuserPresence.Presence = &presence\n\t\t}\n\t\tparticipants = append(participants, userPresence)\n\t}\n\treturn participants, nil\n}", "title": "" }, { "docid": "3edcc6c2ada2f043e2c3f1ef1122d045", "score": "0.46076214", "text": "func GetActiveCourses(w http.ResponseWriter, r *http.Request) {\n\tHandleCORSPreflight(w, r)\n\n\tuser, authenticated, err := getUserBySession(r, false)\n\tif err != nil {\n\t\tlogging.ErrorLogger.Printf(\"error getting user by session: %v\\n\", err)\n\t\t_ = returnApiResponse(w, apiResponse{\n\t\t\tContent: nil,\n\t\t\tErrors: []string{\"internal server error\"},\n\t\t}, 500)\n\t\treturn\n\t}\n\n\tif !authenticated {\n\t\t_ = returnApiResponse(w, apiResponse{\n\t\t\tContent: nil,\n\t\t\tErrors: []string{\"invalid session\"},\n\t\t}, 401)\n\t\treturn\n\t}\n\n\tcourses, err := db.GetMoodleUserCourses(user)\n\tif err != nil {\n\t\tif err.Error() == \"no token or moodle url was provided\" {\n\t\t\tlogging.InfoLogger.Printf(\"no moodle access configured for user %s\\n\", user.ID.String())\n\n\t\t\t_ = returnApiResponse(w, apiResponse{\n\t\t\t\tContent: []string{},\n\t\t\t\tErrors: []string{},\n\t\t\t}, 200)\n\t\t\treturn\n\t\t}\n\t\tlogging.ErrorLogger.Printf(\"error: %v\\n\", err)\n\t}\n\n\tvar filteredCourses []structs.Course\n\tfor _, c := range courses {\n\t\tvar filteredAssignments []structs.Assignment\n\t\tfor _, a := range c.Assignments {\n\t\t\tif time.Time(a.DueDate).Truncate(24 * time.Hour).After(time.Now().Truncate(24 * time.Hour)) || time.Time(a.DueDate).Truncate(24 *time.Hour).Equal(time.Now().Truncate(24 * time.Hour)) {\n\t\t\t\tfilteredAssignments = append(filteredAssignments, a)\n\t\t\t}\n\t\t}\n\n\t\tif len(filteredAssignments) > 0 {\n\t\t\tc.Assignments = filteredAssignments\n\t\t\tfilteredCourses = append(filteredCourses, c)\n\t\t}\n\t}\n\n\tvar cleanCourses = make([]structs.CleanCourse, 0)\n\tfor _, c := range filteredCourses {\n\t\tcleanCourses = append(cleanCourses, c.GetClean())\n\t}\n\n\t_ = returnApiResponse(w, apiResponse{\n\t\tContent: cleanCourses,\n\t\tErrors: []string{},\n\t}, 200)\n}", "title": "" }, { "docid": "d21e1908099f56b60f3649830e1957e4", "score": "0.4584542", "text": "func (s *Source) CompetitionActivations(ctx context.Context, history time.Duration) (<-chan *events.CompetitionActivated, error) {\n\tch := make(chan *events.CompetitionActivated)\n\tcb := func(msg *stan.Msg) {\n\t\tevent := &events.CompetitionActivated{\n\t\t\tTime: time.Unix(0, msg.Timestamp),\n\t\t\tRaw: append(msg.Data[:0:0], msg.Data...),\n\t\t}\n\t\tif err := events.Unmarshal(msg.Data, events.CompetitionActivatedType, event); err != nil {\n\t\t\ts.logger.Warn(\"failed to unmarshal data\", zap.Error(err))\n\t\t\treturn\n\t\t}\n\t\ts.logger.Debug(\"received competition activation\",\n\t\t\tzap.String(\"competition_id\", event.CompetitionID),\n\t\t)\n\t\tch <- event\n\t}\n\tsub, err := s.conn.stan.Subscribe(competitionActivations, cb, stan.StartAtTimeDelta(history))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tgo func() {\n\t\t<-ctx.Done()\n\t\ts.logger.Debug(\"unsubscribe from competition activations\")\n\t\tsub.Close()\n\t}()\n\treturn ch, nil\n}", "title": "" }, { "docid": "25071e68f8417e3c5261dc153044f5c2", "score": "0.4558344", "text": "func ListCoursework(client *http.Client, id string) []Coursework {\n\tsrv, err := classroom.New(client)\n\tif err != nil {\n\t\tlog.Fatalf(\"Unable to create classroom Client %v\", err)\n\t}\n\t// My attempt to get courseWork using courseId 126909787383\n\tr, err := srv.Courses.CourseWork.List(id).Do()\n\tif err != nil {\n\t\tlog.Fatalf(\"Unable to retrieve coursework. %v\", err)\n\t}\n\tcourseworkList := []Coursework{}\n\tif len(r.CourseWork) > 0 {\n\t\t//fmt.Print(\"\\nCoursework:\\n\")\n\t\tfor _, cw := range r.CourseWork {\n\n\t\t\tcwork := Coursework{\n\n\t\t\t\tCourseID: cw.CourseId,\n\t\t\t\tId: cw.Id,\n\t\t\t\tTitle: cw.Title,\n\t\t\t\tDescription: cw.Description,\n\t\t\t\tState: cw.State,\n\t\t\t\tCreationTime: cw.CreationTime,\n\t\t\t\tUpdateTime: cw.UpdateTime,\n\t\t\t\tDueDate: Date{Year: cw.DueDate.Year, Month: cw.DueDate.Month, Day: cw.DueDate.Day},\n\t\t\t\tDueTime: TimeOfDay{Hours: cw.DueTime.Hours, Minutes: cw.DueTime.Minutes},\n\t\t\t\tScheduledTime: cw.ScheduledTime,\n\t\t\t\tMaxPoints: cw.MaxPoints,\n\t\t\t\tTopicID: cw.TopicId,\n\t\t\t}\n\t\t\tcourseworkList = append(courseworkList, cwork)\n\t\t}\n\n\t} else {\n\t\tfmt.Print(\"No coursework found.\")\n\t}\n\treturn courseworkList\n}", "title": "" }, { "docid": "ce7623703b1fd6f31798da5f84d8bda8", "score": "0.45571753", "text": "func findComics(titleStartsWith, dateRange string) (comicResponse ComicsResponse) {\n\n\tts, hash := md5Hash()\n\n\turl := fmt.Sprintf(\"http://gateway.marvel.com/v1/public/comics?ts=%s&apikey=%s&hash=%s&titleStartsWith=%s&dateRange=%s\", ts, publicKey, hash, titleStartsWith, dateRange)\n\n\tres, err := http.Get(url)\n\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tdefer res.Body.Close()\n\n\tif res.StatusCode != http.StatusOK {\n\t\tlog.Fatal(res.StatusCode)\n\t}\n\n\tbody, err := ioutil.ReadAll(res.Body)\n\n\tif res.StatusCode != http.StatusOK {\n\t\tlog.Fatal(res.StatusCode)\n\t}\n\n\tjson.Unmarshal([]byte(body), &comicResponse)\n\n\treturn\n}", "title": "" }, { "docid": "5c6c38a97b398a697f1a1e9188357778", "score": "0.45565552", "text": "func ReadComentarios(IDP string) ([]*models.MostrarComentarios, bool) {\n\tcontt, cancel := context.WithTimeout(context.Background(), 15*time.Second)\n\tdefer cancel()\n\tdb := MongoC.Database(\"RedSocial\")\n\tcol := db.Collection(\"comentario\")\n\n\tvar respuesta []*models.MostrarComentarios\n\n\tquery := make([]bson.M, 0)\n\tquery = append(query, bson.M{\"$match\": bson.M{\"publicacionid\": IDP}})\n\tquery = append(query, bson.M{\n\t\t\"$lookup\": bson.M{\n\t\t\t\"from\": \"publicacion\",\n\t\t\t\"localField\": \"publicacionid\",\n\t\t\t\"foreignField\": \"_id\",\n\t\t\t\"as\": \"comentariobyPublicacion\",\n\t\t}})\n\n\tquery = append(query, bson.M{\"$unwind\": \"$comentario\"})\n\tquery = append(query, bson.M{\"$sort\": bson.M{\"fechacomentario\": -1}})\n\t//query := bson.M{\n\t//\t\"id\": ID,\n\t//}\n\t//ObjID, err := primitive.ObjectIDFromHex(IDP)\n\n\t//marcador, err := col.Find(contt, bson.D{})\n\n\t//marcador, err := col.Find(contt, bson.M{\"_id\": ObjID}),\n\tmarcador, err := col.Aggregate(contt, query)\n\n\t//marcador, err := col.Find(contt, query /*bson.M{\"publicacionid\": ObjID}*/)\n\n\t//marcador, err := col.Find(contt, query)\n\n\terr = marcador.All(contt, &respuesta)\n\n\tif err != nil {\n\t\tlog.Fatal(err.Error())\n\t\treturn respuesta, false\n\t}\n\t/*for marcador.Next(context.TODO()) {\n\t\tvar register models.MostrarComentarios\n\t\terr := marcador.Decode(&register)\n\t\tif err != nil {\n\t\t\treturn respuesta, false\n\t\t}\n\t\trespuesta = append(respuesta, &register)\n\t}*/\n\treturn respuesta, true\n}", "title": "" }, { "docid": "4762fb46552b8742f3af675555f34f85", "score": "0.45261216", "text": "func getProjects(ctx context.Context, stmt *sql.Stmt, args ...any) ([]Project, error) {\n\tobjects := make([]Project, 0)\n\n\tdest := func(scan func(dest ...any) error) error {\n\t\tp := Project{}\n\t\terr := scan(&p.ID, &p.Description, &p.Name)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tobjects = append(objects, p)\n\n\t\treturn nil\n\t}\n\n\terr := query.SelectObjects(ctx, stmt, dest, args...)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Failed to fetch from \\\"projects\\\" table: %w\", err)\n\t}\n\n\treturn objects, nil\n}", "title": "" }, { "docid": "72f5ea9529b8c6d3ac238229fde55b0d", "score": "0.45000315", "text": "func GetPlayers(allPlayers *Players, wg *sync.WaitGroup) error {\n\ttotalPlayerCount := 50000\n\tclient := http.Client{Timeout: 10 * time.Second}\n\t// https://leaderboard.sandstorm.game/api/v0/Players/GetPlayerCount\n\n\tpagination := 500\n\n\t//ch := make(chan Players)\n\tfor startRank := 1; startRank < totalPlayerCount; startRank += pagination {\n\t\tgo func(i int) {\n\t\t\twg.Add(1)\n\t\t\treq, err := http.NewRequest(\n\t\t\t\t\"GET\",\n\t\t\t\t\"https://leaderboard.sandstorm.game/api/v0/Players/GetRankedPlayers\",\n\t\t\t\tnil,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatal(\"Couldn't request URL. \", err)\n\t\t\t}\n\t\t\tq := req.URL.Query()\n\t\t\tq.Add(\"startRank\", fmt.Sprintf(\"%d\", i))\n\t\t\tq.Add(\"endRank\", fmt.Sprintf(\"%d\", i+pagination))\n\t\t\treq.URL.RawQuery = q.Encode()\n\n\t\t\tres, err := client.Do(req)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatal(\"Couldn't request URL. \", err)\n\t\t\t}\n\n\t\t\tif res.StatusCode != 200 {\n\t\t\t\tlog.Fatalf(\"status code error: %d %s\", res.StatusCode, res.Status)\n\t\t\t}\n\n\t\t\tvar pagePlayers Players\n\t\t\terr = json.NewDecoder(res.Body).Decode(&pagePlayers)\n\t\t\tres.Body.Close()\n\t\t\tif err != nil {\n\t\t\t}\n\t\t\t*allPlayers = append(*allPlayers, pagePlayers...)\n\t\t\twg.Done()\n\t\t}(startRank)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0ec5bf3f758acfc4268274e98427deeb", "score": "0.44934773", "text": "func Projects_get () {\n\n // GET /companies/{id}/projects.json\n\n }", "title": "" }, { "docid": "4530f6e42e4473af1d301a3e7a857ce8", "score": "0.44905147", "text": "func (db *GormDB) GetCourses(courseIDs ...uint64) ([]*pb.Course, error) {\n\tm := db.conn\n\tif len(courseIDs) > 0 {\n\t\tm = m.Where(courseIDs)\n\t}\n\tvar courses []*pb.Course\n\tif err := m.Find(&courses).Error; err != nil {\n\t\treturn nil, err\n\t}\n\treturn courses, nil\n}", "title": "" }, { "docid": "7753fe605bd76bce18999bfb3679b31f", "score": "0.4476539", "text": "func (a *App) getProjects(w http.ResponseWriter, r *http.Request) {\n\tcount, err := strconv.Atoi(r.FormValue(\"count\"))\n\tstart, err := strconv.Atoi(r.FormValue(\"start\"))\n\n\tif count > 10 || count < 1 {\n\t\tcount = 10\n\t}\n\tif start < 0 {\n\t\tstart = 0\n\t}\n\n\tProjects, err := models.GetProjects(a.DB, start, count)\n\tif err != nil {\n\t\trespondWithError(w, http.StatusInternalServerError, err.Error())\n\t\treturn\n\t}\n\n\tdata := struct {\n\t\tTitle string\n\t\tObjects []models.Project\n\t\tActive string\n\t\tHeaderTitle string\n\t\tUserRole string\n\t}{\n\t\tTitle: \"Project List\",\n\t\tObjects: Projects,\n\t\tActive: \"Project\",\n\t\tHeaderTitle: \"Project\",\n\t\tUserRole: a.getUserRole(r),\n\t}\n\n\tgetTemplate(w, r, \"viewAllProjects\", data)\n}", "title": "" }, { "docid": "975bfcfd145fe99ab83929d1b8bd26c6", "score": "0.44682038", "text": "func GetCompetitionCountry(client scout.Client, id string) (CompetitionCountry, error) {\n\n\trequestURL := fmt.Sprintf(\"https://%s/%s/competitions/%s\",\n\t\tclient.APIHost, client.APIVersion, id)\n\n\t// Request options\n\tparams := map[string]string{\n\t\t\"api_token\": client.APIToken,\n\t\t\"include\": \"country\",\n\t}\n\n\t// Make HTTP GET request\n\tbody, err := Get(requestURL, params)\n\tif err != nil {\n\t\treturn CompetitionCountry{}, fmt.Errorf(\"Failed to make competition-country request: %s\", err)\n\t}\n\n\t// Decode the HTTP response into a Competition struct\n\tdefer body.Close()\n\tdec := json.NewDecoder(body)\n\n\tvar competitionCountry CompetitionCountry\n\n\tif err := dec.Decode(&competitionCountry); err != nil {\n\t\treturn CompetitionCountry{}, fmt.Errorf(\"Failed to decode competition-country response: %s\", err)\n\t}\n\tlog.Printf(\"%+v\\n\", competitionCountry)\n\treturn competitionCountry, nil\n}", "title": "" }, { "docid": "69b7a11650c13ae3f9457a04577d1b80", "score": "0.4452255", "text": "func (req *CompetitionRequest) Send(c *Client) (competitionResult *CompetitionResult) {\n\n\tj, err := req.getData(c)\n\tif err != nil {\n\t\tfmt.Printf(\"something wnet wrong: %s\\n\", err)\n\t}\n\n\tj.Decode(&competitionResult)\n\treturn\n}", "title": "" }, { "docid": "a10d55041ada3234123dbef16dfa6256", "score": "0.4450739", "text": "func PracticeNearGet() ([]PracticeShort, error) {\n\tvar practices []PracticeShort\n\t_, err := pool.Query(context.Background(), `\n\t\tSELECT\n\t\t\tp.id,\n\t\t\tp.company_id,\n\t\t\tc.name AS company_name,\n\t\t\tp.kind_id,\n\t\t\tk.short_name AS kind_short_name,\n\t\t\tp.date_of_practice\n\t\tFROM\n\t\t\tpractices AS p\n\t\tLEFT JOIN\n\t\t\tcompanies AS c ON c.id = p.company_id\n\t\tLEFT JOIN\n\t\t\tkinds AS k ON k.id = p.kind_id\n\t\tWHERE\n\t\t\tp.date_of_practice > TIMESTAMP 'now'::timestamp - '1 month'::interval\n\t\tORDER BY\n\t\t\tdate_of_practice ASC\n\t\tLIMIT 10`)\n\tif err != nil {\n\t\terrmsg(\"GetPracticeNear query\", err)\n\t}\n\treturn practices, err\n}", "title": "" }, { "docid": "2b204241c52dfaf4dcac3c78ccfb1920", "score": "0.4445304", "text": "func GetCompetence(id int, ctx context.Context, client *ent.Client) (*ent.Competence, error) {\n\tc, err := client.Developper.\n\t\tQuery().\n\t\tWhere(developper.ID(id)).\n\t\tQueryCompetence().\n\t\tOnly(ctx)\n\treturn c, err\n}", "title": "" }, { "docid": "f9e4bb9ae88846db4f9227cbbb281103", "score": "0.4442432", "text": "func GetAll() (*[]Project, *errors.RestErr) {\n\tstmt, err := projectsdb.Client.Prepare(queryGetAllProjects)\n\tif err != nil {\n\t\treturn nil, errors.NewInternalServerError(err.Error())\n\t}\n\tdefer stmt.Close()\n\n\tprojects := []Project{}\n\trows, err := stmt.Query()\n\tif err != nil {\n\t\treturn nil, errors.NewInternalServerError(\"error when trying to get projects\")\n\t}\n\tdefer rows.Close()\n\n\tfor rows.Next() {\n\t\tproject := Project{}\n\t\tif err := rows.Scan(&project.ID, &project.Name, &project.Blurb, &project.RepoURL, &project.ProjectURL, &project.ImageURL); err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\tprojects = append(projects, project)\n\t}\n\n\treturn &projects, nil\n}", "title": "" }, { "docid": "98a73aef8f72f9778f8744ec09b13fd6", "score": "0.44082603", "text": "func GetStoryChapters(id string, count int) ([]Chapter, error) {\n\n\tvar chapters []Chapter\n\t//db.Table(\"chapter\").Where(\"book_id=?\", id).Select(\"chapter_id,chapter_name\").Order(\"chapter_id asc\").Scan(&chapters)\n\tm := []bson.M{\n\t\t{\"$match\": bson.M{\"book_id\": id}},\n\t\t{\"$project\": bson.M{\"chapter_name\": 1, \"_id\": 1}},\n\t\t//{\"$sort\": bson.M{\"chapter_id\": 1}},\n\t\t{\"$skip\": count},\n\t}\n\tif err := chapterDB.Pipe(m).All(&chapters); err != nil {\n\t\treturn nil, err\n\t}\n\tvar temp []Chapter\n\tgo func() {\n\t\tif bson.IsObjectIdHex(id) {\n\t\t\tbookDB.UpdateId(bson.ObjectIdHex(id), bson.M{\"$inc\": bson.M{\"hot\": 1}})\n\t\t}\n\n\t}()\n\n\tfor _, chapter := range chapters {\n\t\t//go func() {\n\t\t//\tGetChapterById(chapter.ChapterId.Hex())\n\t\t//}()\n\t\ttemp = append(temp,\n\t\t\tChapter{ChapterId: chapter.ChapterId, ChapterName: chapter.ChapterName, HasContent: 1})\n\t}\n\n\treturn temp, nil\n\t//chaptersProto := ChaptersProto{}\n\t//for _, chapter := range chapters {\n\t//\t//go func() {\n\t//\t//\tGetChapterById(chapter.ChapterId.Hex())\n\t//\t//}()\n\t//\tproto := ChapterProto{Id: chapter.ChapterId.String(), Name: chapter.ChapterName, HasContent: \"1\"}\n\t//\n\t//\tchaptersProto.ChaptersProto = append(chaptersProto.ChaptersProto, &proto)\n\t//\n\t//}\n\t//\n\t//data, _ := proto.Marshal(&chaptersProto)\n\t//return data, nil\n}", "title": "" }, { "docid": "4daeb17572accd70e6717330ff9b204b", "score": "0.4382028", "text": "func (s *service) GetConsignments(ctx context.Context, req *pb.GetRequest, res *pb.Response) error {\n consignments := s.repo.GetAll()\n res.Consignments = consignments\n return nil\n}", "title": "" }, { "docid": "50ea96dcc136660f97ab1a54ed306a7a", "score": "0.43733802", "text": "func GetAllPlayers(channels *Channels, game *Game, w http.ResponseWriter, r *http.Request) {\n\tfmt.Println(\"API : GET /game/players \")\n\trespondJSON(w, http.StatusOK, game.State.Players)\n}", "title": "" }, { "docid": "2e03cfaf0092664a73ae762819b61970", "score": "0.43564725", "text": "func PracticeGet(id int64) (Practice, error) {\n\tvar practice Practice\n\tif id == 0 {\n\t\treturn practice, nil\n\t}\n\tpractice.ID = id\n\terr := pool.QueryRow(context.Background(), `\n\t\tSELECT\n\t\t\tcompany_id,\n\t\t\tkind_id,\n\t\t\ttopic,\n\t\t\tdate_of_practice,\n\t\t\tnote,\n\t\t\tcreated_at,\n\t\t\tupdated_at\n\t\tFROM\n\t\t\tpractices\n\t\tWHERE\n\t\t\tid = $1\n\t`, id).Scan(&practice.CompanyID, &practice.KindID, &practice.Topic, &practice.DateOfPractice, &practice.Note,\n\t\t&practice.CreatedAt, &practice.UpdatedAt)\n\tif err != nil {\n\t\terrmsg(\"PracticeGet QueryRow\", err)\n\t\treturn practice, err\n\t}\n\treturn practice, err\n}", "title": "" }, { "docid": "f38fbc4fbb90717e52a05bc38415c79d", "score": "0.43551013", "text": "func upcomingReleases(ctx context.Context) cdUpcomming {\r\n\tvar cnts cdUpcomming\r\n\tvar movie upComming\r\n\tpop, _ := movieAPI.GetMovieUpcoming(ctx, nil)\r\n\r\n\tfor _, val := range pop.Results {\r\n\r\n\t\trd, b := movieRelease(ctx, val.ID)\r\n\t\ts := strings.Split(rd, \"-\")\r\n\t\tif b {\r\n\t\t\tmovie.Title = val.OriginalTitle\r\n\t\t\tmovie.ID = val.ID\r\n\t\t\tmovie.Year, _ = strconv.Atoi(s[0])\r\n\t\t\tmovie.Month, _ = strconv.Atoi(s[1])\r\n\t\t\tmovie.Day, _ = strconv.Atoi(s[2])\r\n\t\t\tmovie.Hours = 0\r\n\t\t\tmovie.Minutes = 0\r\n\r\n\t\t\tcnts = append(cnts, movie)\r\n\t\t}\r\n\t}\r\n\treturn cnts\r\n}", "title": "" }, { "docid": "cced38c7c3d53c9e28516fffc37ac0de", "score": "0.43533438", "text": "func (qr *questionRepo) GetAll() (questions []model.Question, err error) {\n\tif err = qr.Conn.Order(\"number asc\").Find(&questions).Error; err != nil {\n\t\treturn\n\t}\n\treturn\n}", "title": "" }, { "docid": "c9c9cc92880a65aac28ce6f5c1062967", "score": "0.43335655", "text": "func DeleteCompetitionCtrl(c *gin.Context) {\n\tid, err := strconv.Atoi(c.Param(\"id\"))\n\tif err != nil {\n\t\tlog.Printf(\"ERROR %v\", err)\n\t\tc.JSON(http.StatusInternalServerError, gin.H{\"error\": err.Error()})\n\t\treturn\n\t}\n\terr = DeleteCompetitionByID(id)\n\tif err != nil {\n\t\tlog.Printf(\"ERROR %v\", err)\n\t\tc.JSON(http.StatusInternalServerError, gin.H{\"error\": err.Error()})\n\t\treturn\n\t}\n\tc.JSON(http.StatusNoContent, true)\n}", "title": "" }, { "docid": "8ed93e4a74b512516ea0089e52779fd4", "score": "0.43145165", "text": "func testDashboardGetAllConcisePCCObjects(t *testing.T) {\n\tres := models.InitTestResult(runID)\n\tdefer res.CheckTestAndSave(t, time.Now())\n\n\tlog.AuctaLogger.Infof(\"Get Index of PCC Objects (concise format) with no sort or pagination\")\n\tpccObjectsIndex, err := Pcc.TestDashboardConciseObjectList(nil, nil)\n\tif err != nil {\n\t\tlog.AuctaLogger.Error(err.Error())\n\t} else {\n\t\tlog.AuctaLogger.Infof(\"Received [%d] Concise PCC Objects\", len(*pccObjectsIndex))\n\t}\n\tcheckError(t, res, err)\n}", "title": "" }, { "docid": "c20e593c0b5ea491b14a9005f42c91ec", "score": "0.43060985", "text": "func (client SlackClient) GetConversationsList() (dto.SlackResponseConversationsList, int, error) {\n\tresponse, statusCode, err := client.HTTPClient.Get(\"/conversations.list\", map[string]string{})\n\tif err != nil {\n\t\treturn dto.SlackResponseConversationsList{}, statusCode, err\n\t}\n\n\tvar dtoResponse dto.SlackResponseConversationsList\n\tif err := json.Unmarshal(response, &dtoResponse); err != nil {\n\t\treturn dto.SlackResponseConversationsList{}, statusCode, err\n\t}\n\n\tif !dtoResponse.Ok {\n\t\treturn dtoResponse, statusCode, errors.New(dtoResponse.Error)\n\t}\n\n\treturn dtoResponse, statusCode, nil\n}", "title": "" }, { "docid": "d239fb33ddc455a667c66dc723f8951a", "score": "0.43047985", "text": "func (d *Dao) PgcCont(ctx context.Context, id int, limit int) (res []*model.SearPgcCon, err error) {\n\tvar (\n\t\trows *sql.Rows\n\t)\n\tif rows, err = d.DB.Query(ctx, _PgcCont, id, limit); err != nil {\n\t\tlog.Error(\"d.PgcCont.Query: %s error(%v)\", _PgcCont, err)\n\t\treturn\n\t}\n\tdefer rows.Close()\n\tfor rows.Next() {\n\t\tvar r = &model.SearPgcCon{}\n\t\tif err = rows.Scan(&r.ID, &r.Category, &r.Cover, &r.Title, &r.PlayTime, &r.Role, &r.Staff, &r.Desc); err != nil {\n\t\t\tlog.Error(\"PgcCont row.Scan() error(%v)\", err)\n\t\t\treturn\n\t\t}\n\t\tres = append(res, r)\n\t}\n\tif err = rows.Err(); err != nil {\n\t\tlog.Error(\"d.PgcCont.Query error(%v)\", err)\n\t}\n\treturn\n}", "title": "" }, { "docid": "5ab660447e06f304b5beb3d47c5e9a77", "score": "0.4293159", "text": "func UpdateCompetition(c *Competition) error {\n\tq := `\n\t\tupdate competition \n\t\tset name=?, winner=?, icon=?, completed_on=?\n\t\twhere id=?\n\t`\n\tstmt, err := db.Prepare(q)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = stmt.Exec(c.Name, c.Winner, c.Icon, c.CompletedOn, c.ID)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "39d5ec1c3ad035b24e4e7a9883e6d948", "score": "0.42889744", "text": "func (s *Schedule) Ordered() []*Course {\n\tlist := make([]*Course, len(*s))\n\tfor _, c := range *s {\n\t\tlist[c.order] = c\n\t}\n\treturn list\n}", "title": "" }, { "docid": "a1c9199cfbddce2926460353b07466db", "score": "0.42836878", "text": "func (ds *DataStore) GetExperience() (experiences []Experience.Experience) {\n\tctx := context.Background()\n\n\tif ds.Database.Db == nil {\n\t\tds.Database.Open()\n\t\t// defer close ... assume this is being called elsewhere\n\t\t// and connection is no longer required.\n\t\tdefer ds.Database.Close()\n\t} else {\n\t\tif err := ds.Database.Db.PingContext(ctx); err != nil {\n\t\t\tds.Database.Open()\n\t\t\t// defer close ... assume this is being called elsewhere\n\t\t\t// and connection is no longer required.\n\t\t\tdefer ds.Database.Close()\n\t\t}\n\t}\n\n\tquery := \"SELECT * FROM [Experience] WHERE [Hidden] = 0 ORDER BY [Id] DESC\"\n\n\tdb := ds.Database.Db\n\n\trows, err := db.QueryContext(ctx, query)\n\tif err != nil {\n\t\treturn nil\n\t}\n\n\tdefer rows.Close()\n\n\tfor rows.Next() {\n\t\tvar experience Experience.Experience\n\n\t\terr := rows.Scan(\n\t\t\t&experience.ID,\n\t\t\t&experience.Title,\n\t\t\t&experience.Organisation,\n\t\t\t&experience.DateFrom,\n\t\t\t&experience.DateTo,\n\t\t\t&experience.Hidden,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil\n\t\t}\n\n\t\texperiences = append(experiences, experience)\n\t}\n\n\terr = rows.Err()\n\tif err != nil {\n\t\treturn nil\n\t}\n\n\treturn experiences\n}", "title": "" }, { "docid": "43c144232fb344f10fe64a2ec68aa4f7", "score": "0.42831802", "text": "func getProductivityTasksCollection() db.Collection {\n\t// Get a session\n\tsession = GetSession()\n\t// Return table ProductivityTasks in the session\n\tif session != nil {\n\t\treturn session.Collection(\"ProductivityTasks\")\n\t} else {\n\t\treturn nil\n\t}\n\n}", "title": "" }, { "docid": "e173b28bd4e4e5556e400cb884a06760", "score": "0.4278124", "text": "func (d *Dao) GetActivities(c context.Context, query string, from, limit int) (acs []*model.CActivity, err error) {\n\tacs = make([]*model.CActivity, 0)\n\trows, err := d.rddb.Query(c, fmt.Sprintf(_activitisSQL, query), from, limit)\n\tif err != nil {\n\t\tlog.Error(\"GetActivities d.db.Query error(%v)\", err)\n\t\treturn\n\t}\n\tdefer rows.Close()\n\tfor rows.Next() {\n\t\tac := &model.CActivity{}\n\t\terr = rows.Scan(&ac.ID, &ac.Name, &ac.SignedStart, &ac.SignedEnd, &ac.SignUp, &ac.SignUpStart, &ac.SignUpEnd, &ac.Object, &ac.UploadStart, &ac.UploadEnd, &ac.WinType, &ac.RequireItems, &ac.RequireValue, &ac.StatisticsStart, &ac.StatisticsEnd, &ac.BonusType, &ac.BonusTime, &ac.ProgressFrequency, &ac.UpdatePage, &ac.ProgressStart, &ac.ProgressEnd, &ac.ProgressSync, &ac.BonusQuery, &ac.BonusQuerStart, &ac.BonusQueryEnd, &ac.Background, &ac.WinDesc, &ac.UnwinDesc, &ac.Details)\n\t\tif err != nil {\n\t\t\tlog.Error(\"GetActivities row.Scan error(%v)\", err)\n\t\t\treturn\n\t\t}\n\t\tacs = append(acs, ac)\n\t}\n\terr = rows.Err()\n\treturn\n}", "title": "" }, { "docid": "8c0262c0cf8710bdd0db01baef5966dc", "score": "0.42724624", "text": "func AddCompetitionCtrl(c *gin.Context) {\n\tvar form Competition\n\t// This will infer what binder to use depending on the content-type header.\n\tif err := c.ShouldBindWith(&form, binding.JSON); err != nil {\n\t\tc.JSON(http.StatusBadRequest, gin.H{\"error\": err.Error()})\n\t\treturn\n\t}\n\terr := AddCompetition(&form)\n\tif err != nil {\n\t\tlog.Printf(\"ERROR %v\", err)\n\t\tc.JSON(http.StatusInternalServerError, gin.H{\"error\": err.Error()})\n\t\treturn\n\t}\n\tc.JSON(http.StatusOK, form)\n}", "title": "" }, { "docid": "242cb973cdc7eb4f79760e23fbe21741", "score": "0.42675677", "text": "func (m *ContractModel) Questions(cid int) ([]models.Question, error) {\n\tvar res []models.Question\n\terr := mysequel.QueryToStructs(&res, m.DB, queries.QUESTIONS, cid)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn res, nil\n}", "title": "" }, { "docid": "b604199406d763d1798a925945111b3b", "score": "0.42639208", "text": "func (dao *jobDAO) Query(db *mongo.Database, offset, limit int) ([]*models.Job, error) {\n\tjobList := []*models.Job{}\n\tcol := db.Collection(\"job\")\n\tctx := context.Background()\n\n\tcursor, err := col.Find(\n\t\tctx,\n\t\tbson.NewDocument(),\n\t)\n\tdefer cursor.Close(ctx)\n\telm := bson.NewDocument()\n\n\tfor cursor.Next(ctx) {\n\t\telm.Reset()\n\n\t\tif err := cursor.Decode(elm); err != nil {\n\t\t\treturn jobList, err\n\t\t}\n\t\tjob, err := models.NewJobFromDoc(elm)\n\n\t\tif err != nil {\n\t\t\treturn jobList, err\n\t\t}\n\n\t\tjobList = append(jobList, job)\n\t}\n\n\treturn jobList, err\n}", "title": "" }, { "docid": "2bf18d0aee03731294b84b3a7510383b", "score": "0.42623195", "text": "func GetGamesCollection(db *mgo.Database) *mgo.Collection {\n\treturn db.C(\"games\")\n}", "title": "" }, { "docid": "48baab3675a50c8bec663c9ae1fcff72", "score": "0.42538932", "text": "func (d *Dota2) RequestPlayerRecentAccomplishments(\n\tctx context.Context,\n\taccountID uint32,\n) (*protocol.CMsgClientToGCRequestPlayerRecentAccomplishmentsResponse, error) {\n\treq := &protocol.CMsgClientToGCRequestPlayerRecentAccomplishments{\n\t\tAccountId: &accountID,\n\t}\n\tresp := &protocol.CMsgClientToGCRequestPlayerRecentAccomplishmentsResponse{}\n\n\treturn resp, d.MakeRequest(\n\t\tctx,\n\t\tuint32(protocol.EDOTAGCMsg_k_EMsgClientToGCRequestPlayerRecentAccomplishments),\n\t\treq,\n\t\tuint32(protocol.EDOTAGCMsg_k_EMsgClientToGCRequestPlayerRecentAccomplishmentsResponse),\n\t\tresp,\n\t)\n}", "title": "" }, { "docid": "3a3dfe910fd1a0949980dd80531948b2", "score": "0.4222309", "text": "func (db *MyDB) getQuestionsCh(electionID int) ([]string, error) {\n\tvar results []string\n\tq1 := fmt.Sprintf(`SELECT name FROM votingsystem.questions WHERE electionID = %d;`, electionID)\n\trows, err := db.Query(q1)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tif rows.Next() {\n\t\tvar result string\n\t\terr = rows.Scan(&result)\n\t\tresults = append(results, result)\n\t}\n\treturn results, nil\n\n}", "title": "" }, { "docid": "eccdd1b326b6b92387e4cbd30fae973b", "score": "0.42094502", "text": "func GetAll() []PromocionMgo {\n\tvar result []PromocionMgo\n\ts, Promocions, err := MoConexion.GetColectionMgo(MoVar.ColeccionPromocion)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\terr = Promocions.Find(nil).All(&result)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\ts.Close()\n\treturn result\n}", "title": "" }, { "docid": "01ef0d19dd3c1fb4e153f7df9a9db8e9", "score": "0.42068884", "text": "func GetProjectList(w http.ResponseWriter, r *http.Request) {\n\tqueries := r.URL.Query()\n\tpage := 1\n\tlimit := 10\n\tif queries[\"page\"] != nil {\n\t\tnum, err := strconv.Atoi(queries[\"page\"][0])\n\t\tif err != nil {\n\t\t\tpage = 1\n\t\t}\n\t\tpage = num\n\t}\n\n\tif queries[\"limit\"] != nil {\n\t\tnum, err := strconv.Atoi(queries[\"limit\"][0])\n\t\tif err != nil {\n\t\t\tlimit = 10\n\t\t}\n\t\tlimit = num\n\t}\n\n\tprojects, err := getProjects(page, limit)\n\tif err != nil {\n\t\tlog.Println(\"Error:\", err)\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\treturn\n\t}\n\tj, err := json.Marshal(projects)\n\tif err != nil {\n\t\tlog.Println(\"Error:\", err)\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\treturn\n\t}\n\tw.Header().Add(\"Content-Type\", \"application/json; charset=UTF-8\")\n\tw.WriteHeader(http.StatusOK)\n\tw.Write(j)\n}", "title": "" }, { "docid": "cb22196711698d5168538bcc39fa5d6f", "score": "0.42040288", "text": "func (api *API) GetConversations(userID gp.UserID, start int64, count int) (conversations []gp.ConversationSmall, err error) {\n\tconversations, err = api.getConversations(userID, start, count)\n\treturn\n}", "title": "" }, { "docid": "68261ee923f6323c232ee1c7928de3a9", "score": "0.4188877", "text": "func testDashboardGetAllPCCObjects(t *testing.T) {\n\tres := models.InitTestResult(runID)\n\tdefer res.CheckTestAndSave(t, time.Now())\n\n\tlog.AuctaLogger.Info(\"Get full PCC Objects list with no sort or pagination\")\n\tpccObjects, err := Pcc.TestDashboardObjectList(nil, nil)\n\tif err != nil {\n\t\tlog.AuctaLogger.Error(err.Error())\n\t} else {\n\t\tlog.AuctaLogger.Infof(\"Received [%d] PCC Objects\", len(*pccObjects))\n\t}\n\tcheckError(t, res, err)\n}", "title": "" }, { "docid": "35640bd781ce485870bd19a962de3041", "score": "0.4184038", "text": "func GetActividades() Actividades {\n\tquery := `SELECT * FROM actividad`\n\trows := EjecutarQuery(query)\n\tactividades := Actividades{}\n\tfor rows.Next() {\n\t\tactividad := Actividad{}\n\t\trows.Scan(&actividad.Idactividad, &actividad.Fecha, &actividad.Fechavenc, &actividad.Nombre, &actividad.Tipo, &actividad.Nota)\n\t\tactividades = append(actividades, actividad)\n\t}\n\treturn actividades\n}", "title": "" }, { "docid": "129073606f5941191091560b61f1780d", "score": "0.41754732", "text": "func (g *GameServer) List(ctx context.Context, in *pb.Page) (*pb.Games, error) {\n\tvar err error\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tutils.GetLog().Error(\"rpc.games.List error: %v\", err)\n\t\t}\n\t}()\n\n\tconfig := &Config{\n\t\tGameTypeID: int(in.GameTypeID),\n\t\tPageNum: int(in.Num),\n\t\tPageSize: int(in.Size),\n\t\tSearch: in.Search,\n\t}\n\tgames := NewGames(config)\n\tif err = games.Do(); err != nil {\n\t\treturn nil, errors.New(games.ErrorCode().String())\n\t}\n\n\tsrvGames := games.Games()\n\tcount := games.Count()\n\n\tvar pbGames []*pb.GameInfo\n\tfor _, srvGame := range srvGames {\n\t\tpbGame := srvGameToPbGame(srvGame)\n\t\tpbGames = append(pbGames, pbGame)\n\t}\n\treturn &pb.Games{Games: pbGames, TotalNum: count}, nil\n}", "title": "" }, { "docid": "e97f7d065e53138f1c1f44bc7ab6c617", "score": "0.41752738", "text": "func UpdateCompetitionCtrl(c *gin.Context) {\n\tvar form Competition\n\t// This will infer what binder to use depending on the content-type header.\n\tif err := c.ShouldBindWith(&form, binding.JSON); err != nil {\n\t\tc.JSON(http.StatusBadRequest, gin.H{\"error\": err.Error()})\n\t\treturn\n\t}\n\terr := UpdateCompetition(&form)\n\tif err != nil {\n\t\tlog.Printf(\"ERROR %v\", err)\n\t\tc.JSON(http.StatusInternalServerError, gin.H{\"error\": err.Error()})\n\t\treturn\n\t}\n\tc.JSON(http.StatusOK, form)\n}", "title": "" }, { "docid": "71f62666893c3e19e98c7070d8b9117c", "score": "0.41751748", "text": "func List(req handler.Request, prevModel *Model, currentModel *Model) (handler.ProgressEvent, error) {\n\tlog.Printf(\"List.Project prevModel:%+v currentModel:%+v\", prevModel, currentModel)\n\tclient, err := util.CreateMongoDBClient(*currentModel.ApiKeys.PublicKey, *currentModel.ApiKeys.PrivateKey)\n\tif err != nil {\n\t\treturn handler.ProgressEvent{}, err\n\t}\n\n\tlistOptions := &matlasClient.ListOptions{\n\t\tPageNum: 0,\n\t\tItemsPerPage: 100,\n\t}\n\tprojects, _, err := client.Projects.GetAllProjects(context.Background(), listOptions)\n\tif err != nil {\n\t\treturn handler.ProgressEvent{}, fmt.Errorf(\"error retrieving projects: %s\", err)\n\t}\n\n // Initialize like this in case no results will pass empty array\n mm := []interface{} {}\n\tfor _, project := range projects.Results {\n\t\tvar m Model\n\t\tm.Name = &project.Name\n\t\tm.OrgId = &project.OrgID\n\t\tm.Created = &project.Created\n\t\tm.ClusterCount = &project.ClusterCount\n\t\tm.Id = &project.ID\n\t\tmm = append(mm, m)\n\t}\n\n\treturn handler.ProgressEvent{\n\t\tOperationStatus: handler.Success,\n\t\tMessage: \"List Complete\",\n\t\tResourceModels: mm,\n\t}, nil\n}", "title": "" }, { "docid": "6453d92cfcc28b3b4c8be650f3cb491a", "score": "0.416192", "text": "func PuestosByCreadoPorID(db XODB, creadoPorID sql.NullInt64) ([]*Puesto, error) {\n\tvar err error\n\n\t// sql query\n\tconst sqlstr = `SELECT ` +\n\t\t`id, tipo_puesto_id, departamento_id, usuario_id, fecha_creacion, fecha_actualizacion, creado_por_id, actualizado_por_id ` +\n\t\t`FROM v1wq1ics1m037sn6.puesto ` +\n\t\t`WHERE creado_por_id = ?`\n\n\t// run query\n\tXOLog(sqlstr, creadoPorID)\n\tq, err := db.Query(sqlstr, creadoPorID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer q.Close()\n\n\t// load results\n\tres := []*Puesto{}\n\tfor q.Next() {\n\t\tp := Puesto{\n\t\t\t_exists: true,\n\t\t}\n\n\t\t// scan\n\t\terr = q.Scan(&p.ID, &p.TipoPuestoID, &p.DepartamentoID, &p.UsuarioID, &p.FechaCreacion, &p.FechaActualizacion, &p.CreadoPorID, &p.ActualizadoPorID)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tres = append(res, &p)\n\t}\n\n\treturn res, nil\n}", "title": "" }, { "docid": "90c78a1ccfc62f03ca6f7b8d82a9ec14", "score": "0.41596466", "text": "func (db *PgDB) ProjectExperiments(id int) (experiments []*model.Experiment, err error) {\n\trows, err := db.sql.Queryx(`\nSELECT e.id, state, config, model_definition, start_time, end_time, archived,\n\t git_remote, git_commit, git_committer, git_commit_date, owner_id, notes,\n\t\t job_id, u.username as username, project_id, unmanaged\nFROM experiments e\nJOIN users u ON (e.owner_id = u.id)\nWHERE e.project_id = $1`, id)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer rows.Close()\n\n\tfor rows.Next() {\n\t\tvar exp model.Experiment\n\t\tif err = rows.StructScan(&exp); err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"unable to read experiment from db\")\n\t\t}\n\t\texperiments = append(experiments, &exp)\n\t}\n\treturn experiments, nil\n}", "title": "" }, { "docid": "b16980a9728221871f03c6bafacf008d", "score": "0.41575366", "text": "func FetchCourseOffer(courseId string, param interface{}, ps *PageMeta) ([]*CourseMod, *PageMeta, error) {\n\tvar record []*CourseMod\n\tnps := PageMeta{}\n\tfmt.Println(\"req. params\", param)\n\tif DBConn != nil {\n\t\tqry :=[]bson.M{\n\t\t\tbson.M{\"$match\": bson.M{\n\t\t\t\t\"courses._id\": bson.ObjectIdHex(courseId),\n\t\t\t\t\"courses.offers\": bson.M{\n\t\t\t\t\t\"$elemMatch\": param,\n\t\t\t\t},\n\t\t\t}},\n\t\t\tbson.M{\"$unwind\": \"$courses\"},\n\t\t\tbson.M{\"$replaceRoot\": bson.M{\"newRoot\": \"$courses\"}},\n\t\t}\n\t\tif len(ps.Sort) > 0 {\n\t\t\tqry = append(qry, bson.M{\"$sort\": ps.Sort})\n\t\t\tnps.Sort = ps.Sort\n\t\t}\n\t\tif ps.PageLimit > 0 {\n\t\t\tqry = append(qry, bson.M{\"$sort\": ps.PageLimit})\n\t\t\tnps.PageLimit = ps.PageLimit\n\t\t}\n\t\tif ps.PageNum > 0 {\n\t\t\tqry = append(qry, bson.M{\"$skip\" : (ps.PageNum-1) *ps.PageLimit})\n\t\t\tnps.PageNum = ps.PageNum\n\t\t}\n\t\terr1 := DBConn.C(dept_mod_name).Pipe( qry ).All(&record)\n\t\tif err1 != nil {\n\t\t\tfmt.Println(err1)\n\t\t\treturn nil, nil, err1\n\t\t}\n\t\t// nps.Count = count\n\t\tfmt.Println(\"record\", record)\n\t\treturn record, &nps, nil\n\t}\n\t_, err := NotConn()\n\treturn nil, nil, err\n\n}", "title": "" }, { "docid": "d046d7e866e636e909d708a93ddc7534", "score": "0.41528702", "text": "func (p *playerUsecase) FetchPlayersByTeams(teamNames []string) ([]*models.Player, error) {\n\tplayerCollection := &models.PlayerCollection{\n\t\tTeamCount: 0,\n\t\tPlayersLookup: map[string]models.Player{},\n\t\tMutex: &sync.Mutex{},\n\t}\n\tvalidTeamCount := len(teamNames)\n\t//Assign maxConcurrency to determine the number of concurrent requests to repository layer\n\tmaxConcurrencyEnv := os.Getenv(\"MAX_CONCURRENT_REQUESTS\")\n\tmaxConcurrency := 100\n\tif len(maxConcurrencyEnv) != 0 {\n\t\tmaxConcurrency, _ = strconv.Atoi(maxConcurrencyEnv)\n\t}\n\tteamCounter := 1\n\t//Convert array of valid teams to map. This is because the source of teams contains duplicate names for different IDs.\n\tvalidTeamLookup := map[string]int{}\n\tfor _, team := range teamNames {\n\t\tvalidTeamLookup[team] = 0\n\t}\n\n\t//fmt.Println(validTeamCount, maxConcurrency, validTeamLookup)\n\t//Run for loop till we have details of all valid teams\n\tfor validTeamCount > playerCollection.TeamCount {\n\t\tvar wg sync.WaitGroup\n\t\t//Start go routines to fetch team details by ID\n\t\tfor i := 0; i < maxConcurrency; i++ {\n\t\t\twg.Add(1)\n\t\t\tgo func(teamNumber int) {\n\t\t\t\tdefer wg.Done()\n\t\t\t\tres, err := p.playerRepo.FetchByID(teamNumber)\n\t\t\t\tif err != nil {\n\t\t\t\t\tfmt.Println(\"Response Error : \", err, teamNumber)\n\t\t\t\t} else if isValidTeam(res.Name, &validTeamLookup) {\n\t\t\t\t\t//Add response to playerCollection\n\t\t\t\t\tfmt.Println(\"Processing team \", res.Name, res.ID)\n\t\t\t\t\tplayerCollection = p.addTeamInfo(playerCollection, res)\n\t\t\t\t\tplayerCollection.TeamCount++\n\t\t\t\t}\n\t\t\t}(teamCounter + i)\n\t\t}\n\t\twg.Wait()\n\t\tteamCounter += maxConcurrency\n\t}\n\t//Retrieve players slice from playerCollection and Sort alphabetically by name\n\tplayers := sortPlayersByName(playerCollection.PlayersLookup)\n\treturn players, nil\n}", "title": "" }, { "docid": "e3159cd9dccb7c0c00f40109d3d0ff70", "score": "0.41442874", "text": "func GetComicsAsync(comicIDs []int) map[int]Comic {\n\tstart := time.Now()\n\tdefer func() {\n\t\tfmt.Printf(\"Channels fetches took: %v\\n\", time.Since(start))\n\t}()\n\n\tvar wg sync.WaitGroup\n\tc := make(chan Comic)\n\n\t// wait for all jobs in WaitGroup to complete, then close channels\n\tgo func() {\n\t\twg.Wait()\n\t\tclose(c)\n\t}()\n\n\tfor _, comidID := range comicIDs {\n\t\twg.Add(1)\n\t\tgo GetComic(comidID, c, &wg)\n\t}\n\n\tm := make(map[int]Comic)\n\tfor comic := range c {\n\t\tm[comic.Num] = comic\n\t}\n\n\treturn m\n\n}", "title": "" }, { "docid": "f059501a7e21792d78140e10e662fdfe", "score": "0.41397643", "text": "func GetProjects(s *session.Session) ([]models.Project, error) {\n\n\tvar data []models.Project\n\tresjson, err := getData(\"/projects\", s)\n\n\tlog.Debugf(\"response : %+v\", resjson)\n\n\tif err != nil {\n\t\treturn data, err\n\t}\n\n\t// using mapstructure to decode all the json response into the data variable.\n\terr = mapstructure.Decode(resjson.Data, &data)\n\tif err != nil {\n\t\treturn data, err\n\t}\n\n\t// Check if the api response code say that everything went fine or abort.\n\tif resjson.Code != api.CodeOK {\n\t\treturn data, errors.New(\"Can't get projects list :\" + resjson.Code.String())\n\t}\n\n\treturn data, nil\n}", "title": "" }, { "docid": "648e7a57e18624d13f0df6f772079079", "score": "0.41351855", "text": "func queryQuestions() []Question {\n\tvar AllQuestions []Question\n\t// Sending a request and unMarshalling the results\n\tresp, err := http.Get(\"http://localhost:8080/\")\n\tif err != nil {\n\t\tfmt.Println(\"Whoopsie daisy, an error occured. We'll be back shortly!\")\n\t\tfmt.Println(\"Error: \")\n\t\tfmt.Println(err)\n\t} else {\n\t\tfmt.Println(\"The game is afoot!\")\n\t\tbytes, errRead := ioutil.ReadAll(resp.Body)\n\t\tif errRead != nil {\n\t\t\tfmt.Println(\"An error occured:\", errRead)\n\t\t}\n\t\terrUnmarshal := json.Unmarshal(bytes, &AllQuestions)\n\t\tif errUnmarshal != nil {\n\t\t\tfmt.Println(\"An error occured:\", errUnmarshal)\n\t\t}\n\t}\n\tdefer resp.Body.Close()\n\treturn AllQuestions\n}", "title": "" }, { "docid": "79f6984408f1d997a4b40c95821db755", "score": "0.4124674", "text": "func (pb PhoneBook) Get(search PersonSearch, page, count *int) (res []*Person) {\n\tfor _, p := range pb.DB {\n\t\tres = append(res, p)\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "7474a762ab6ccf5e3cf4b72a776caa26", "score": "0.4105854", "text": "func (r *ProjectsConversationsService) List(parent string) *ProjectsConversationsListCall {\n\tc := &ProjectsConversationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.parent = parent\n\treturn c\n}", "title": "" }, { "docid": "dd68cc7142123e1fe555defccd735fe6", "score": "0.41046864", "text": "func (r *CommunicationsService) List() *CommunicationsListCall {\n\tc := &CommunicationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\treturn c\n}", "title": "" }, { "docid": "736b4aa6ef4c8351e84bbb0c9f0495a4", "score": "0.41026875", "text": "func (g *Game) GetPlayerList(pp PlayerPoolAbstraction) (result map[string]*Player) {\n\tif list, err := pp.GetAllPlayersInGame(g.GetID()); err == nil {\n\t\t// populate the map from the array\n\t\tresult = make(map[string]*Player, len(list))\n\t\tfor _, v := range(list) {\n\t\t\tresult[v.GetID()] = v\n\t\t}\n\t} else {\n\t\tpanic(\"do something with the error\")\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "b52f628ebb6313094fa3f419db4878f6", "score": "0.41011584", "text": "func (r *Client) QueryProject(formattedID string, startIndex int) (*[]Project, int, error) {\n\tif startIndex < 1 {\n\t\tstartIndex = 1\n\t}\n params := make(url.Values)\n params.Add(\"fetch\", \"true\")\n\tif formattedID != \"\" {\n \tparams.Add(\"query\", fmt.Sprintf(\"(Name = \\\"%s\\\")\", formattedID))\n\t} else {\n\t\tparams.Add(\"query\",\"\")\n\t}\n params.Add(\"start\",strconv.Itoa(startIndex))\n var out struct {\n QueryResult struct {\n Results []Project\n TotalResultCount int\n }\n }\n \n _, err := r.getRequest(\"project\", params, &out)\n if err != nil {\n return nil, 0, err\n }\n /*\n if total := out.QueryResult.TotalResultCount; total != 1 {\n return nil, fmt.Errorf(\"not found, or found too many (%v)\", total)\n }*/\n \n return &out.QueryResult.Results, out.QueryResult.TotalResultCount, nil\n}", "title": "" }, { "docid": "373abcf682821a77ec80f60a39c05085", "score": "0.40980506", "text": "func (s *service) Get(ctx context.Context, req *pb.GetRequest, res *pb.Response) error {\n\tdefer s.GetRepo().Close()\n\n\tconsignments, err := s.GetRepo().GetAll()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tres.Consignments = consignments\n\treturn nil\n}", "title": "" }, { "docid": "7f7f591a9f05ce863d2fda0dadbb2720", "score": "0.4091572", "text": "func (a *AutocompleteApiService) GetPiggiesAC(ctx _context.Context) ApiGetPiggiesACRequest {\n\treturn ApiGetPiggiesACRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t}\n}", "title": "" }, { "docid": "67f215e7875b553b619148b1b7da9e27", "score": "0.4071104", "text": "func getCities(db *sql.DB, start, count int) ([]city, error) {\n\tlog.Print(\"in db query\")\n\tstatement := fmt.Sprintf(\"SELECT id, name, pincode FROM locations_city\")\n\trows, err := db.Query(statement)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdefer rows.Close()\n\n\tcitys := []city{}\n\n\tfor rows.Next() {\n\t\tvar c city\n\t\tif err := rows.Scan(&c.ID, &c.Name, &c.Pincode); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcitys = append(citys, c)\n\t}\n\treturn citys, nil\n}", "title": "" }, { "docid": "915ddb7ccd8307b0d14187d6e008c820", "score": "0.40587914", "text": "func ListAll(ctx context.Context, chunkSize int, query *q.Query, options ...Option) <-chan Result {\n\tch := make(chan Result, chunkSize)\n\n\tgo func() {\n\t\tdefer close(ch)\n\n\t\tquery = q.MustClone(query)\n\t\tquery.PageNumber = 1\n\t\tquery.PageSize = int64(chunkSize)\n\n\t\tfor {\n\t\t\tprojects, err := Ctl.List(ctx, query, options...)\n\t\t\tif err != nil {\n\t\t\t\tformat := \"failed to list projects at page %d with page size %d, error :%v\"\n\t\t\t\tch <- Result{Error: fmt.Errorf(format, query.PageNumber, query.PageSize, err)}\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, p := range projects {\n\t\t\t\tch <- Result{Data: p}\n\t\t\t}\n\n\t\t\tif len(projects) < chunkSize {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tquery.PageNumber++\n\t\t}\n\t}()\n\n\treturn ch\n}", "title": "" }, { "docid": "4127ace28beb7afbba34ef7ddabf10d7", "score": "0.40532714", "text": "func getQuestions(client pb.QuizerClient, questionsChannel chan *pb.Question) {\n\tstream, err := client.ListQuestions(context.Background(), &pb.Empty{})\n\t_errCheck(&err, \"Failed to retrieve questions: %v\")\n\n\tfor {\n\t\tquestion, err := stream.Recv()\n\t\tif err == io.EOF {\n\t\t\tclose(questionsChannel)\n\t\t\tbreak\n\t\t}\n\t\t_errCheck(&err, \"ListQuestions(_) = _, %v\")\n\n\t\tquestionsChannel <- question\n\t}\n}", "title": "" }, { "docid": "972e513b8067eac51b19aa3972ad7756", "score": "0.40359703", "text": "func (builder *applicationEntityDTOBuilder) getApplicationCommoditiesBought(pod *api.Pod) ([]*proto.CommodityDTO, error) {\n\tvar commoditiesBought []*proto.CommodityDTO\n\t// As all the application commodities are actually retrieved from pods, so the key is also from pod.\n\tkey := util.PodKeyFunc(pod)\n\n\t// get cpu frequency\n\tcpuFrequencyUID := metrics.GenerateEntityStateMetricUID(task.NodeType, util.NodeKeyFromPodFunc(pod), metrics.CpuFrequency)\n\tcpuFrequencyMetric, err := builder.metricsSink.GetMetric(cpuFrequencyUID)\n\tif err != nil {\n\t\t// TODO acceptable return? To get cpu, frequency is required.\n\t\treturn nil, fmt.Errorf(\"Failed to get cpu frequency from sink for node %s: %s\", util.NodeKeyFromPodFunc(pod), err)\n\t}\n\tcpuFrequency := cpuFrequencyMetric.GetValue().(float64)\n\t// cpu and cpu provisioned needs to be converted from number of cores to frequency.\n\tconverter := NewConverter().Set(func(input float64) float64 { return input * cpuFrequency }, metrics.CPU)\n\n\t// Resource commodities.\n\tresourceCommoditiesBought, err := builder.getResourceCommoditiesBought(task.ApplicationType, key, applicationResourceCommodityBought, converter, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcommoditiesBought = append(commoditiesBought, resourceCommoditiesBought...)\n\n\t// Application commodity\n\tapplicationCommBought, err := sdkbuilder.NewCommodityDTOBuilder(proto.CommodityDTO_APPLICATION).\n\t\tKey(string(pod.UID)).\n\t\tCreate()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcommoditiesBought = append(commoditiesBought, applicationCommBought)\n\treturn commoditiesBought, nil\n}", "title": "" }, { "docid": "4010f98ee15fc13f4e60d73da95d0abb", "score": "0.40313724", "text": "func (r *ProjectsConversationsParticipantsService) List(parent string) *ProjectsConversationsParticipantsListCall {\n\tc := &ProjectsConversationsParticipantsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.parent = parent\n\treturn c\n}", "title": "" }, { "docid": "200a3b1c7c540a70067168341b445890", "score": "0.40313298", "text": "func (ctrl TeamController) Projects(c *gin.Context) {\n\tteam := c.MustGet(cTeam).(common.Team)\n\tuser := c.MustGet(cUser).(common.User)\n\n\tvar projects []common.Project\n\t// new mongodb iterator\n\titer := db.Projects().Find(bson.M{\"roles.type\": \"team\", \"roles.team_id\": team.ID}).Iter()\n\n\troles := new(rbac.Project)\n\t// loop through each result and modify for our needs\n\tvar tmpProject common.Project\n\t// iterate over all and only get valid objects\n\tfor iter.Next(&tmpProject) {\n\t\t// Skip if the user doesn't have read permission\n\t\tif !roles.Read(user, tmpProject) {\n\t\t\tcontinue\n\t\t}\n\t\t// skip to next\n\t\tmetadata.ProjectMetadata(&tmpProject)\n\t\t// good to go add to list\n\t\tprojects = append(projects, tmpProject)\n\t}\n\tif err := iter.Close(); err != nil {\n\t\tlogrus.WithFields(logrus.Fields{\n\t\t\t\"Error\": err.Error(),\n\t\t}).Errorln(\"Error while retriving Projects data from the database\")\n\t\tc.JSON(http.StatusInternalServerError, common.Error{\n\t\t\tCode: http.StatusInternalServerError,\n\t\t\tErrors: []string{\"Error while getting Projects\"},\n\t\t})\n\t\treturn\n\t}\n\n\tcount := len(projects)\n\tpgi := util.NewPagination(c, count)\n\t//if page is incorrect return 404\n\tif pgi.HasPage() {\n\t\tlogrus.WithFields(logrus.Fields{\n\t\t\t\"Page number\": pgi.Page(),\n\t\t}).Debugln(\"Project page does not exist\")\n\t\tc.JSON(http.StatusNotFound, gin.H{\"detail\": \"Invalid page \" + strconv.Itoa(pgi.Page()) + \": That page contains no results.\"})\n\t\treturn\n\t}\n\t// send response with JSON rendered data\n\tc.JSON(http.StatusOK, common.Response{\n\t\tCount: count,\n\t\tNext: pgi.NextPage(),\n\t\tPrevious: pgi.PreviousPage(),\n\t\tData: projects[pgi.Skip():pgi.End()],\n\t})\n}", "title": "" }, { "docid": "20265ab0127fefdd68380609ace80f9b", "score": "0.40284637", "text": "func (a *Client) GetFrequentActivities(params *GetFrequentActivitiesParams, authInfo runtime.ClientAuthInfoWriter) (*GetFrequentActivitiesOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewGetFrequentActivitiesParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"getFrequentActivities\",\n\t\tMethod: \"GET\",\n\t\tPathPattern: \"/1/user/-/activities/frequent.json\",\n\t\tProducesMediaTypes: []string{\"application/x-www-form-urlencoded\"},\n\t\tConsumesMediaTypes: []string{\"\"},\n\t\tSchemes: []string{\"https\"},\n\t\tParams: params,\n\t\tReader: &GetFrequentActivitiesReader{formats: a.formats},\n\t\tAuthInfo: authInfo,\n\t\tContext: params.Context,\n\t\tClient: params.HTTPClient,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn result.(*GetFrequentActivitiesOK), nil\n\n}", "title": "" }, { "docid": "9cd8288cfff31101c7dbfa3e4e4632e1", "score": "0.4025992", "text": "func GetProductivityTasksByProjectID(pProjectID int) []*DOMAIN.ProductivityTasks {\n\t// ProductivityTasks structure\n\tproductivityTasks := []*DOMAIN.ProductivityTasks{}\n\tif getProductivityTasksCollection() != nil {\n\t\t// Add in ProductivityTasks variable, the ProductivityTasks where ID is the same that the param\n\t\tres := getProductivityTasksCollection().Find().Where(\"project_id = ?\", pProjectID)\n\t\t// Close session when ends the method\n\t\tdefer session.Close()\n\t\terr := res.All(&productivityTasks)\n\t\tif err != nil {\n\t\t\tlog.Error(err)\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn productivityTasks\n}", "title": "" }, { "docid": "fc3e0d2afe1011131b67dcd1b04fcf02", "score": "0.4024293", "text": "func getCoaches(d *goquery.Document) []Coach {\n\tcoaches := []Coach{}\n\n\tcols := []string{\".left\", \".right\"}\n\n\tfor _, col := range cols {\n\t\ttmp := d.Selection.Find(\".block_match_lineups \" + col + \" tbody\").Find(\"tr strong\")\n\t\tif strings.Trim(tmp.Text(), \" \") == \"Coach:\" {\n\t\t\taTag := tmp.Next()\n\t\t\tif url, ok := aTag.Attr(\"href\"); ok {\n\t\t\t\tteam := 0\n\t\t\t\tif col == \".right\" {\n\t\t\t\t\tteam = 1\n\t\t\t\t}\n\n\t\t\t\tif !strings.HasPrefix(url, \"/coaches/\") {\n\t\t\t\t\tcontinue\n\t\t\t\t}\t\n\n\t\t\t\tc := Coach{Url: url, Team: team}\n\t\t\t\tcoaches = append(coaches, c)\n\t\t\t}\n\t\t}\n\n\t}\n\n\treturn coaches\n}", "title": "" }, { "docid": "ef4158e915d41a5b22055f544ab358fc", "score": "0.40236562", "text": "func (s *service) GetConsignments(ctx context.Context, req *pb.GetRequest, res *pb.Response) error {\n\tconsignments := s.repo.GetAll()\n\tres.Consignments = consignments\n\treturn nil\n}", "title": "" }, { "docid": "78d58a03df91aeb6af870ab194869fac", "score": "0.40228146", "text": "func (pod *Pods) GetPods() []*Pods {\n\tvar pods []*Pods\n\to := orm.NewOrm()\n\t_, _ = o.QueryTable(Pods{}).OrderBy(\"name\").All(&pods, \"id\", \"name\")\n\treturn pods\n}", "title": "" }, { "docid": "02c8bbb06282103bf67cd97ce7949506", "score": "0.40047172", "text": "func (s *ProjectService) List() ([]Project, *http.Response, error) {\n\tprojRes := new(ProjectResponse)\n\tresp, err := s.sling.New().\n\t\tQueryStruct(CreateFunctionParam(\"getprojects\")).\n\t\tReceiveSuccess(projRes)\n\tif projRes != nil && len(projRes.Results) > 0 {\n\t\tif projRes.Results[0].ErrorDesc != nil {\n\t\t\treturn nil, resp, Error{*projRes.Results[0].ErrorDesc}\n\t\t}\n\t\treturn *(&projRes.Results), resp, err\n\t}\n\treturn make([]Project, 0), resp, err\n}", "title": "" }, { "docid": "288acc4b460015cebd11d0f04cd24caf", "score": "0.40033013", "text": "func GetPreguntasxRespuesta() ([]Response) {\n\tdb := database.GetConnection()\n\n\tsizerows, err := db.Query(\"select count(*) from (select * from pregunta p inner join respuesta r on p.id = r.idp) as x\")\n\tvar count int\n\tvar limit int\n\tfor sizerows.Next() {\n\t\tsizerows.Scan(&count)\n\t\tfmt.Println(count)\n\t}\n\t\n\tdefer sizerows.Close()\t\n\n\trows, err := db.Query(\"SELECT * FROM pregunta p inner join respuesta r on p.id=r.idp\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer rows.Close()\n\n\tpregunta := Pregunta{}\n\tresponsejoin := ResponseJoin{}//encapsula pregunta y arreglo respuesta\n\tres := Response{} //encapsula arreglo responsejoin\n\tvar respuestasArray []Respuesta\n\t//var responsejoinArray []ResponseJoin\n\tvar resArray []Response\n\t\n\tfor rows.Next() {\n\n\t\trespuestas := Respuesta{}\n\n\t\tvar ID int\n\t\tvar nombrep string\n\t\tvar descripcionp string\n\t\tvar respuesta string\n\n\t\tvar IDS int\n\t\tvar answer string\n\t\tvar idp int\n\n\t\terr := rows.Scan(&ID,&nombrep,&descripcionp,&respuesta, &IDS, &answer, &idp)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tlimit++\n\t\tfmt.Println(\"limit\")\n\t\tfmt.Println(limit)\n\n\t\t//Llena Objecto Pregunta solo si no esta el id repetido,\n\t\t//es decir descarta filas de pregunta repetidas por el join\n\t\t//id 1 == ID 1\n\t\t//asigne valores Objeto Pregunta, Objecto respuesta\n\t\t//guarde objeto Respuesta en arreglo de respuesta\n\t\t\n\t\tif (pregunta.ID == ID || pregunta.ID == 0) && limit != count {\n\t\t\tfmt.Println(\"Pregunta repetida\")\n\t\t\tpregunta.ID = ID\n\t\t\tpregunta.NombreP = nombrep\n\t\t\tpregunta.DescripcionP = descripcionp\n\t\t\tpregunta.Respuesta = respuesta\n\n\t\t\t//Llenar arreglo de respuestas por esta pregunta\n\t\t\trespuestas.ID = IDS\n\t\t\trespuestas.Respuesta = answer\n\t\t\trespuestas.Idp = idp\n\n\t\t\trespuestasArray = append(respuestasArray, respuestas)\n\t\t}else if pregunta.ID != ID && limit == count {\n\t\t\tfmt.Println(\"Pregunta diferente y final\")\n\t\t\t//antes de borrar guardar esto dentro del empaquetador la clase responsejoin\n\t\t\tresponsejoin.Pregunta = pregunta\n\t\t\tresponsejoin.Respuestas = respuestasArray\n\t\t\t//despues guardar responsejoin en la clase empaquetadora res\n\t\t\tres.Array = responsejoin\n\t\t\t//despues guardar esto dentro de un arreglo de la clase Response\n\t\t\tresArray = append(resArray,res)\n\n\t\t\trespuestasArray = nil\n\n\t\t\tpregunta.ID = ID\n\t\t\tpregunta.NombreP = nombrep\n\t\t\tpregunta.DescripcionP = descripcionp\n\t\t\tpregunta.Respuesta = respuesta\n\n\t\t\t//Llenar arreglo de respuestas por esta pregunta\n\t\t\trespuestas.ID = IDS\n\t\t\trespuestas.Respuesta = answer\n\t\t\trespuestas.Idp = idp\n\t\t\tfmt.Println(\"hi\")\n\t\t\trespuestasArray = append(respuestasArray, respuestas)\n\n\t\t\t//si el ide de una pregunta es igual a la ultima posicion\n\t\t\t//entonces debo guardar todo en el arreglo\n\t\t\tresponsejoin.Pregunta = pregunta\n\t\t\tresponsejoin.Respuestas = respuestasArray\n\t\t\t//despues guardar responsejoin en la clase empaquetadora res\n\t\t\tres.Array = responsejoin\n\t\t\t//despues guardar esto dentro de un arreglo de la clase Response\n\t\t\tresArray = append(resArray,res)\n\t\t\t\n\t\t}else if pregunta.ID != ID && limit != count {\n\t\t\tfmt.Println(\"Pregunta diferente\")\n\t\t\t//////////////////\n\t\t\tresponsejoin.Pregunta = pregunta\n\t\t\tresponsejoin.Respuestas = respuestasArray\n\t\t\t//despues guardar responsejoin en la clase empaquetadora res\n\t\t\tres.Array = responsejoin\n\t\t\t//despues guardar esto dentro de un arreglo de la clase Response\n\t\t\tresArray = append(resArray,res)\n\n\t\t\trespuestasArray = nil\n\n\t\t\tpregunta.ID = ID\n\t\t\tpregunta.NombreP = nombrep\n\t\t\tpregunta.DescripcionP = descripcionp\n\t\t\tpregunta.Respuesta = respuesta\n\n\t\t\t//Llenar arreglo de respuestas por esta pregunta\n\t\t\trespuestas.ID = IDS\n\t\t\trespuestas.Respuesta = answer\n\t\t\trespuestas.Idp = idp\n\t\t\trespuestasArray = append(respuestasArray, respuestas)\n\t\t}else if limit == count {\n\t\t\tfmt.Println(\"pregunta final\")\n\t\t\t//si el ide de una pregunta es igual a la ultima posicion\n\t\t\t//entonces debo guardar todo en el arreglo\n\t\t\tresponsejoin.Pregunta = pregunta\n\t\t\tresponsejoin.Respuestas = respuestasArray\n\t\t\t//despues guardar responsejoin en la clase empaquetadora res\n\t\t\tres.Array = responsejoin\n\t\t\t//despues guardar esto dentro de un arreglo de la clase Response\n\t\t\tresArray = append(resArray,res)\n\t\t}\n\n\t}\n\n\treturn resArray\n}", "title": "" }, { "docid": "8763ad49fe96b534c8652da5b4769167", "score": "0.40023163", "text": "func (t *TestDB) GetList(page, perPage int) ([]*api.Job, error) {\n\treturn t.Jobs, nil\n}", "title": "" }, { "docid": "542f191fc475415f5195fc85a9d82bd5", "score": "0.40012088", "text": "func GetProjects() (projects []Project, err error) {\n\terr = Database.View(func(tx *bolt.Tx) error {\n\t\tb := tx.Bucket(projectsBucket)\n\t\tif b == nil {\n\t\t\treturn nil\n\t\t}\n\t\tb.ForEach(func(k, v []byte) error {\n\t\t\tvar project Project\n\t\t\terr = json.Unmarshal(v, &project)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tprojects = append(projects, project)\n\t\t\treturn nil\n\t\t})\n\t\treturn err\n\t})\n\treturn\n}", "title": "" }, { "docid": "ab7c0fffc44fc1db8be4b8ed7584e6cd", "score": "0.399995", "text": "func list_games(ctx *iris.Context) {\n games := []objects.Game{}\n includeInactive := ctx.URLParam(\"includeInactive\")\n val, err := strconv.ParseBool(includeInactive)\n if (err == nil) && val {\n app.Database.Find(&games)\n } else {\n app.Database.Where(\"active = ?\", true).Find(&games)\n }\n output := make([]map[string]interface{}, len(games))\n for i,element := range games {\n output[i] = utils.ToMap(element)\n }\n utils.WriteJSON(ctx, iris.StatusOK, iris.Map{\"error\": false, \"count\": len(games), \"data\": output})\n}", "title": "" } ]
e07723cea644b51003394d4b24e2ffb2
Takes two byte arrays and xors them and returns result
[ { "docid": "1a100405559c0d482a55409aa59be9e8", "score": "0.70699906", "text": "func Xor(one, two []byte) []byte {\n\tif len(one) != len(two) {\n\t\tpanic(\"length mismatch\")\n\t}\n\n\tresult := make([]byte, len(one))\n\n\tfor i := range one {\n\t\tresult[i] = one[i] ^ two[i]\n\t}\n\n\treturn result\n}", "title": "" } ]
[ { "docid": "20645694f640fae41fd69e5ba01e43be", "score": "0.81666607", "text": "func Xor(bytes1, bytes2 []byte) ([]byte, error) {\n if len(bytes1) != len(bytes2) {\n return []byte(nil), errors.New(\"Byte arrays must bt the same length\")\n }\n\n byteLen := len(bytes1)\n result := make([]byte, byteLen)\n\n for i := 0; i < byteLen; i++ {\n result[i] = bytes1[i] ^ bytes2[i]\n }\n\n return result, nil\n}", "title": "" }, { "docid": "5df115df493bc83ddd5e7b67c51eef83", "score": "0.7681061", "text": "func Xor(a, b []byte) ([]byte, error) {\n\tif len(a) != len(b) {\n\t\treturn nil, errors.New(\"byte arrays have different length\")\n\t}\n\n\tn := len(a)\n\tdst := make([]byte, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tdst[i] = a[i] ^ b[i]\n\t}\n\n\treturn dst, nil\n}", "title": "" }, { "docid": "046435eac0aaa25e4be5e148651944e4", "score": "0.7668915", "text": "func XorBytes(seqA []byte, seqB []byte) []byte {\n\tminLength := len(seqA)\n\tif len(seqB) < minLength {\n\t\tminLength = len(seqB)\n\t}\n\n\toutput := make([]byte, minLength)\n\tfor i := 0; i < minLength; i++ {\n\t\toutput[i] = seqA[i] ^ seqB[i]\n\t}\n\treturn output\n}", "title": "" }, { "docid": "d7d5931fde5eba95baf03f489170a8b5", "score": "0.7359853", "text": "func Xor(b1 []byte, b2 []byte) (xored []byte) {\n\n\txored = make([]byte, len(b1))\n\n\tfor i, v := range b1 {\n\t\txored[i] = v ^ b2[i % len(b2)]\n\t}\n\n\treturn xored\n\n}", "title": "" }, { "docid": "cf69b59fa0893439bdbca17d742ec26b", "score": "0.7262959", "text": "func XorBytesTo(a, b, result []byte) {\n\tif len(a) != len(b) || len(a) != len(result) {\n\t\tpanic(\"XorBytesTo: mismatched lengths\")\n\t}\n\tfor i, v := range a {\n\t\tresult[i] = v ^ b[i]\n\t}\n}", "title": "" }, { "docid": "a26f431a03d050119dce27e2f056305c", "score": "0.6547153", "text": "func (a *Uint256) Xor(b Uint256) Uint256 {\n\tvar output Uint256\n\toutput = Uint256{}\n\tcomp := getComp()\n\tit := getIt()\n\tfor i := getStart(); comp(i); i = it(i) {\n\t\toutput[i] = a[i] ^ b[i]\n\t}\n\treturn output\n}", "title": "" }, { "docid": "df2e03d5b61598aea909d1c999822b17", "score": "0.6470559", "text": "func XorBytes(dst, a, b []byte) int {\n\tif supportsUnaligned {\n\t\treturn fastXORBytes(dst, a, b)\n\t} else {\n\t\t// TODO(hanwen): if (dst, a, b) have common alignment\n\t\t// we could still try fastXORBytes. It is not clear\n\t\t// how often this happens, and it's only worth it if\n\t\t// the block encryption itself is hardware\n\t\t// accelerated.\n\t\treturn safeXORBytes(dst, a, b)\n\t}\n}", "title": "" }, { "docid": "664056c60577bbd08ea84334dea1ee76", "score": "0.6398992", "text": "func Xor(part1 []byte, part2 []byte) {\n\tfor i, b := range part2 {\n\t\tpart1[i] ^= b\n\t}\n}", "title": "" }, { "docid": "1c240ead54222156e6ec8c6d2d9158fd", "score": "0.6397908", "text": "func Xor(s1, s2 string) (string, error) {\n\tif len(s1) != len(s2) {\n\t\treturn \"\", errors.New(\"input strings must be same length\")\n\t}\n\tbytes1, err := hex.DecodeString(s1)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tbytes2, err := hex.DecodeString(s2)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tlength := len(bytes1)\n\tresBytes := make([]byte, length)\n\tfor i := length - 1; i >= 0; i-- {\n\t\tresBytes[i] = bytes1[i] ^ bytes2[i]\n\t}\n\toutput := hex.EncodeToString(resBytes)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn output, nil\n}", "title": "" }, { "docid": "f91fcabeebbf59b4ec9ef2b761c5334e", "score": "0.6227299", "text": "func Challenge2Main() {\n hexString1 := []byte(\"1c0111001f010100061a024b53535009181c\")\n hexString2 := []byte(\"686974207468652062756c6c277320657965\")\n\n rawBytes1 := make([]byte, hex.DecodedLen(len(hexString1)))\n _, err := hex.Decode(rawBytes1, hexString1)\n if err != nil { log.Fatal(err) }\n\n rawBytes2 := make([]byte, hex.DecodedLen(len(hexString2)))\n _, err = hex.Decode(rawBytes2, hexString2)\n if err != nil { log.Fatal(err) }\n\n result, _ := Xor(rawBytes1, rawBytes2)\n\n hexEncoded := make([]byte, hex.EncodedLen(len(result)))\n hex.Encode(hexEncoded, result)\n fmt.Printf(\"%s\\n\", hexEncoded)\n}", "title": "" }, { "docid": "24d7c5f7196abd48c30fbea25b772b6b", "score": "0.6206602", "text": "func xorend(dst, a, b []byte) {\n\taLen := len(a)\n\tbLen := len(b)\n\tdstLen := len(dst)\n\n\tif dstLen < aLen || aLen < bLen {\n\t\tlog.Panicf(\"Bad buffer lengths: %d, %d, %d\", dstLen, aLen, bLen)\n\t}\n\n\t// Copy the left part.\n\tdifference := aLen - bLen\n\tcopy(dst, a[:difference])\n\n\t// XOR in the right part.\n\tcommon.Xor(dst[difference:difference+bLen], a[difference:], b)\n}", "title": "" }, { "docid": "e54de06118109f61fc5271ac7d72a01f", "score": "0.6100998", "text": "func Xor(x1, x2 *Bitmap) *Bitmap {\n\tanswer := NewBitmap()\n\tpos1 := 0\n\tpos2 := 0\n\tlength1 := x1.highlowcontainer.size()\n\tlength2 := x2.highlowcontainer.size()\n\tfor {\n\t\tif (pos1 < length1) && (pos2 < length2) {\n\t\t\ts1 := x1.highlowcontainer.getKeyAtIndex(pos1)\n\t\t\ts2 := x2.highlowcontainer.getKeyAtIndex(pos2)\n\t\t\tif s1 < s2 {\n\t\t\t\tanswer.highlowcontainer.appendCopy(x1.highlowcontainer, pos1)\n\t\t\t\tpos1++\n\t\t\t} else if s1 > s2 {\n\t\t\t\tanswer.highlowcontainer.appendCopy(x2.highlowcontainer, pos2)\n\t\t\t\tpos2++\n\t\t\t} else {\n\t\t\t\tc := roaring.Xor(x1.highlowcontainer.getContainerAtIndex(pos1), x2.highlowcontainer.getContainerAtIndex(pos2))\n\t\t\t\tif !c.IsEmpty() {\n\t\t\t\t\tanswer.highlowcontainer.appendContainer(s1, c, false)\n\t\t\t\t}\n\t\t\t\tpos1++\n\t\t\t\tpos2++\n\t\t\t}\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\tif pos1 == length1 {\n\t\tanswer.highlowcontainer.appendCopyMany(x2.highlowcontainer, pos2, length2)\n\t} else if pos2 == length2 {\n\t\tanswer.highlowcontainer.appendCopyMany(x1.highlowcontainer, pos1, length1)\n\t}\n\treturn answer\n}", "title": "" }, { "docid": "7f8f5264fca6a7b1a8e8b4f0440b16e5", "score": "0.6056042", "text": "func xor(x, y []byte) []byte {\n\tresult := make([]byte, len(x))\n\tfor i := 0; i < len(x); i++ {\n\t\tresult[i] = x[i] ^ y[i]\n\t}\n\treturn result\n}", "title": "" }, { "docid": "dcf20e362e0fda9a8081514c7eb63758", "score": "0.60099685", "text": "func xorBytes(a, b []byte) ([]byte, error) {\n\tvar c []byte\n\tif len(a) != len(b) {\n\t\treturn nil, errors.New(\"xorBytes: arguments must be of the same length\")\n\t}\n\n\tfor i := 0; i < len(a); i++ {\n\t\tbuf := (int(a[i]) + int(b[i])) % 256\n\t\tc = append(c, byte(buf))\n\t}\n\n\treturn c, nil\n}", "title": "" }, { "docid": "4dbe013202992d37a7cf58fcb336230b", "score": "0.59944355", "text": "func BytesMerge(args ...[]byte) []byte {\n\tcount := 0\n\tfor _, arr := range args {\n\t\tcount += len(arr)\n\t}\n\tbs := make([]byte, count)\n\ti := 0\n\tfor _, arr := range args {\n\t\tfor _, el := range arr {\n\t\t\tbs[i] = el\n\t\t\ti++\n\t\t}\n\t}\n\treturn bs\n}", "title": "" }, { "docid": "29b8e1c46b00c8b131307a88d6da0c75", "score": "0.59798086", "text": "func xor(a, b []byte) ([]byte, error) {\n\tblock := make([]byte, 0)\n\tfor i := 0; i < 8; i++ {\n\t\tdata, err := structPack(&struct{ Ex uint `struc:\"uint8,little\"` }{Ex: uint(a[i] ^ b[i])})\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tblock = byteJoin(block, data)\n\t}\n\treturn block, nil\n}", "title": "" }, { "docid": "c576aa552934b6abcc6e72a44aacd4c9", "score": "0.59753555", "text": "func standardXORBytes(a, b []byte) []byte {\n\tr := make([][2]byte, len(a))\n\tfor i, e := range a {\n\t\tr[i] = [2]byte{e, b[i]}\n\t}\n\tbuf := make([]byte, len(a))\n\tfor p, q := range r {\n\t\tbuf[p] = q[0] ^ q[1]\n\t}\n\treturn buf\n}", "title": "" }, { "docid": "5ba7eebcc801a6b2c39b1480936e4a2c", "score": "0.59060574", "text": "func XORSingleByte(dst, src []byte, b byte) {\n\t// Panic if dst is smaller than src.\n\tfor i := range src {\n\t\tdst[i] = src[i] ^ b\n\t}\n}", "title": "" }, { "docid": "6d4b389a756e25c28bd64581c5f04804", "score": "0.58524203", "text": "func Union(a, b [][]byte) [][]byte {\n\tn := len(b)\n\tif len(a) > len(b) {\n\t\tn = len(a)\n\t}\n\tother := make([][]byte, 0, n)\n\n\tfor {\n\t\tif len(a) > 0 && len(b) > 0 {\n\t\t\tif cmp := bytes.Compare(a[0], b[0]); cmp == 0 {\n\t\t\t\tother, a, b = append(other, a[0]), a[1:], b[1:]\n\t\t\t} else if cmp == -1 {\n\t\t\t\tother, a = append(other, a[0]), a[1:]\n\t\t\t} else {\n\t\t\t\tother, b = append(other, b[0]), b[1:]\n\t\t\t}\n\t\t} else if len(a) > 0 {\n\t\t\tother, a = append(other, a[0]), a[1:]\n\t\t} else if len(b) > 0 {\n\t\t\tother, b = append(other, b[0]), b[1:]\n\t\t} else {\n\t\t\treturn other\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ab699b7484a9e952258cc4ae05d4d023", "score": "0.5820099", "text": "func Bytes(dst, a, b []byte) int {\n\tn := len(a)\n\tif n != len(b) || n != len(dst) {\n\t\tpanic(\"dst, a and b has to have same size\")\n\t}\n\txorBytesARM64(&dst[0], &a[0], &b[0], n)\n\treturn n\n}", "title": "" }, { "docid": "f5d70864c8cc9f66b41a7beeb0f14faa", "score": "0.57949805", "text": "func Xor(a ArtifactStream, b ArtifactStream) ArtifactStream {\n\tpeekableA := NewPeekableStream(a)\n\tpeekableB := NewPeekableStream(b)\n\n\treturn &xorStream{\n\t\ta: peekableA,\n\t\tb: peekableB,\n\t}\n}", "title": "" }, { "docid": "85c23856d7f56bf72fbf6caf5868df7e", "score": "0.5746305", "text": "func TestXor(t *testing.T) {\n text1 := encoding.HexToBytes(\"1c0111001f010100061a024b53535009181c\")\n text2 := encoding.HexToBytes(\"686974207468652062756c6c277320657965\")\n\n expected_output := \"746865206b696420646f6e277420706c6179\"\n output := encoding.BytesToHex(Xor(text1,text2))\n if output != expected_output {\n t.Errorf(\"Xor: Expected output does not match actual output.\")\n }\n}", "title": "" }, { "docid": "2e7aaddb95c0cb6684a4b2b99c8960e1", "score": "0.5744797", "text": "func XORBytes(dst, a, b []byte) int {\n\tn := len(a)\n\tif len(b) < n {\n\t\tn = len(b)\n\t}\n\tif n == 0 {\n\t\treturn 0\n\t}\n\t_ = dst[n-1]\n\txorBytesSSE2(&dst[0], &a[0], &b[0], n) // amd64 must have SSE2\n\treturn n\n}", "title": "" }, { "docid": "d0fc2895b97a2de26176e439015c130f", "score": "0.5705012", "text": "func xor(b1 string, b2 string) string{\n \n res:=\"\"\n\n for i:=0;i<len(b1);i++{\n\n if b1[i]==b2[i]{\n res+=\"0\"\n }else{\n res+=\"1\"\n }\n }\n return res\n}", "title": "" }, { "docid": "9f69aec0617c5a06957e0cc3d8d26b94", "score": "0.5683273", "text": "func (rb *Bitmap) Xor(x2 *Bitmap) {\n\tpos1 := 0\n\tpos2 := 0\n\tlength1 := rb.highlowcontainer.size()\n\tlength2 := x2.highlowcontainer.size()\n\tfor {\n\t\tif (pos1 < length1) && (pos2 < length2) {\n\t\t\ts1 := rb.highlowcontainer.getKeyAtIndex(pos1)\n\t\t\ts2 := x2.highlowcontainer.getKeyAtIndex(pos2)\n\t\t\tif s1 < s2 {\n\t\t\t\tpos1 = rb.highlowcontainer.advanceUntil(s2, pos1)\n\t\t\t\tif pos1 == length1 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t} else if s1 > s2 {\n\t\t\t\tc := x2.highlowcontainer.getWritableContainerAtIndex(pos2)\n\t\t\t\trb.highlowcontainer.insertNewKeyValueAt(pos1, x2.highlowcontainer.getKeyAtIndex(pos2), c)\n\t\t\t\tlength1++\n\t\t\t\tpos1++\n\t\t\t\tpos2++\n\t\t\t} else {\n\t\t\t\t// TODO: couple be computed in-place for reduced memory usage\n\t\t\t\tc := roaring.Xor(rb.highlowcontainer.getContainerAtIndex(pos1), x2.highlowcontainer.getContainerAtIndex(pos2))\n\t\t\t\tif !c.IsEmpty() {\n\t\t\t\t\trb.highlowcontainer.setContainerAtIndex(pos1, c)\n\t\t\t\t\tpos1++\n\t\t\t\t} else {\n\t\t\t\t\trb.highlowcontainer.removeAtIndex(pos1)\n\t\t\t\t\tlength1--\n\t\t\t\t}\n\t\t\t\tpos2++\n\t\t\t}\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\tif pos1 == length1 {\n\t\trb.highlowcontainer.appendCopyMany(x2.highlowcontainer, pos2, length2)\n\t}\n}", "title": "" }, { "docid": "0bcc8d02f735e8325898f4b2a9b8fe4e", "score": "0.5680138", "text": "func (b *Bitstring) Xor(a, dest *Bitstring) {\n\tcheckSize(a, b, dest)\n\tdest.count = 0\n\tlast := b.storage - 1\n\tfor i := uint64(0); i < b.storage; i++ {\n\t\tv := b.bits[i] ^ a.bits[i]\n\t\tif i == last {\n\t\t\tv &= b.mask\n\t\t}\n\t\tdest.bits[i] = v\n\t\tdest.count += CountBitsSet64(v)\n\t}\n}", "title": "" }, { "docid": "01e7ec3905f90a725d869605ed87342c", "score": "0.5643461", "text": "func (z *BigEndianField) Xor(x, y Field) Field {\n\txf, yf := x.(*BigEndianField), y.(*BigEndianField)\n\txb, xo, yb, yo, zb, zo, w := xf.b, xf.o, yf.b, yf.o, z.b, z.o, z.w\n\tvar xv, yv uint64\n\tfor w >= 64 {\n\t\txb, xo, xv = beGet64(xb, xo)\n\t\tyb, yo, yv = beGet64(yb, yo)\n\t\tzb, zo = bePut64(zb, zo, xv ^ yv)\n\t}\n\txb, xo, xv = beGet(xb, xo, w)\n\tyb, yo, yv = beGet(yb, yo, w)\n\tzb, zo = bePut(zb, zo, w, xv ^ yv)\n\treturn z\n}", "title": "" }, { "docid": "70a9e3ca0710dfac3f92fe8acaf0d054", "score": "0.5630919", "text": "func XORBytes(dst, b1, b2 []byte) int {\n\tn := Minimum(len(b1), len(b2))\n\tfor i := 0; i < n; i++ {\n\t\tdst[i] = b1[i] ^ b2[i]\n\t}\n\treturn n\n}", "title": "" }, { "docid": "70a9e3ca0710dfac3f92fe8acaf0d054", "score": "0.5630919", "text": "func XORBytes(dst, b1, b2 []byte) int {\n\tn := Minimum(len(b1), len(b2))\n\tfor i := 0; i < n; i++ {\n\t\tdst[i] = b1[i] ^ b2[i]\n\t}\n\treturn n\n}", "title": "" }, { "docid": "70a9e3ca0710dfac3f92fe8acaf0d054", "score": "0.5630919", "text": "func XORBytes(dst, b1, b2 []byte) int {\n\tn := Minimum(len(b1), len(b2))\n\tfor i := 0; i < n; i++ {\n\t\tdst[i] = b1[i] ^ b2[i]\n\t}\n\treturn n\n}", "title": "" }, { "docid": "c1f75b6704f07f5bc742a0731bd5877d", "score": "0.56090486", "text": "func assertByteSlicesBackedBySameData(t *testing.T, a, b []byte) {\n\torigPtr := reflect.ValueOf(a).Pointer()\n\tresultPtr := reflect.ValueOf(b).Pointer()\n\ttestutil.Eq(t, origPtr, resultPtr)\n}", "title": "" }, { "docid": "57aa7e3390af70d3de15ecdb8ff40889", "score": "0.5563217", "text": "func xorBuffers(a, b []byte) ([]byte, error) {\n\tif len(a) != len(b) {\n\t\treturn nil, fmt.Errorf(\"buffers have different lengths\")\n\t}\n\n\tresult := make([]byte, len(a))\n\tfor i := 0; i < len(a); i++ {\n\t\tresult[i] = a[i] ^ b[i]\n\t}\n\n\treturn result, nil\n}", "title": "" }, { "docid": "46529c2aedbd1e7b8a09e934dbf76f06", "score": "0.5556521", "text": "func ConcatenateBytes(data ...[]byte) []byte {\n\tfinalLength := 0\n\tfor _, slice := range data {\n\t\tfinalLength += len(slice)\n\t}\n\tresult := make([]byte, finalLength)\n\tlast := 0\n\tfor _, slice := range data {\n\t\tfor i := range slice {\n\t\t\tresult[i+last] = slice[i]\n\t\t}\n\t\tlast += len(slice)\n\t}\n\treturn result\n}", "title": "" }, { "docid": "25e89d3e9fabf2611034471028d38b85", "score": "0.5554358", "text": "func opcodeAnd(op *ParsedOp, t *thread) error {\r\n\ta, err := t.dstack.PopByteArray()\r\n\tif err != nil {\r\n\t\treturn err\r\n\t}\r\n\r\n\tb, err := t.dstack.PopByteArray()\r\n\tif err != nil {\r\n\t\treturn err\r\n\t}\r\n\r\n\tif len(a) != len(b) {\r\n\t\treturn scriptError(ErrInvalidInputLength, \"byte arrays are not the same length\")\r\n\t}\r\n\r\n\tc := make([]byte, len(a))\r\n\tfor i := range a {\r\n\t\tc[i] = a[i] & b[i]\r\n\t}\r\n\r\n\tt.dstack.PushByteArray(c)\r\n\treturn nil\r\n}", "title": "" }, { "docid": "7c782f1776fd068c662b83b914243b0a", "score": "0.55542475", "text": "func Or(s1, s2 []byte) ([]byte, error) {\n\n\tif len(s1) != len(s2) {\n\t\tlog.Printf(\"s1: %v, len s1: %d\", s1, len(s1))\n\t\tlog.Printf(\"s2: %v, len s2: %d\", s2, len(s2))\n\t\tlog.Fatal(\"Different length buffers\\n\")\n\t}\n\n\tres := make([]byte, len(s1))\n\tfor i := 0; i < len(s1); i++ {\n\t\tres[i] = s1[i] | s2[i]\n\t}\n\n\treturn res, nil\n}", "title": "" }, { "docid": "817e148eee3b25a13fbd87ec6c1635a6", "score": "0.5532135", "text": "func Concat(elements [][]byte) []byte {\n\n\tvar stream []byte\n\n\tfor _, element := range elements {\n\t\tfor _, b := range element {\n\t\t\tstream = append(stream, b)\n\t\t}\n\t}\n\n\treturn stream\n}", "title": "" }, { "docid": "e91758edcc4c1f12aea4c88b61bae148", "score": "0.5525183", "text": "func XORBytes(dst, a, b []byte) int {\n\tn := len(a)\n\tif len(b) < n {\n\t\tn = len(b)\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tdst[i] = a[i] ^ b[i]\n\t}\n\n\treturn n\n}", "title": "" }, { "docid": "cff12294a5b897db638174b5aa531ae4", "score": "0.5521476", "text": "func MuxBytes(c, a, b []byte) []byte {\n\tif len(a) != len(b) || len(a) != len(c) {\n\t\tpanic(\"MuxBytes\")\n\t}\n\tresult := make([]byte, len(a))\n\tfor i, v := range c {\n\t\tresult[i] = ((0xff ^ v) & a[i]) | (v & b[i])\n\t}\n\treturn result\n}", "title": "" }, { "docid": "94fe239dc2350b6851c9b5732974d1f1", "score": "0.5497189", "text": "func xorBytes(dst, a, b []byte) int {\n\tn := len(a)\n\tif len(b) < n {\n\t\tn = len(b)\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tdst[i] = a[i] ^ b[i]\n\t}\n\treturn n\n}", "title": "" }, { "docid": "f6a925989948c41600b7033f4d27abe5", "score": "0.5451547", "text": "func (z *Int) Xor(x, y *Int) *Int {\n\tz[0] = x[0] ^ y[0]\n\tz[1] = x[1] ^ y[1]\n\tz[2] = x[2] ^ y[2]\n\tz[3] = x[3] ^ y[3]\n\treturn z\n}", "title": "" }, { "docid": "e5ab4d5c2ffcce16f221e1bcff287509", "score": "0.54486597", "text": "func compareByteSlices(a, b []byte) bool {\n\tif len(a) != len(b) {\n\t\treturn false\n\t}\n\tfor i := range a {\n\t\tif a[i] != b[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "88dc151d872d9cd916d55c1b22fffe89", "score": "0.5400702", "text": "func BytesCombine(pBytes ...[]byte) []byte {\n\tlen := len(pBytes)\n\ts := make([][]byte, len)\n\tfor index := 0; index < len; index++ {\n\t\ts[index] = pBytes[index]\n\t}\n\tsep := []byte(\"\")\n\treturn bytes.Join(s, sep)\n}", "title": "" }, { "docid": "990a21deb4818f7f46e240f267c3d172", "score": "0.53982395", "text": "func (x Int128) Xor(y Int128) (z Int128) {\n\tz.hi = int64(uint64(x.hi) ^ uint64(y.hi))\n\tz.lo = x.lo ^ y.lo\n\treturn z\n}", "title": "" }, { "docid": "96f89f6795f5fc5845ff7213639e0f24", "score": "0.5369115", "text": "func Concat(output *[]byte, input *[]byte, outputStart int) error {\n\toutputLength := len(*output)\n\tinputLength := len(*input)\n\n\tif outputStart+inputLength > outputLength {\n\t\treturn errors.New(\"Out of Index Error!\")\n\t}\n\n\tfor i := 0; i < inputLength; i++ {\n\t\t(*output)[outputStart] = (*input)[i]\n\t\toutputStart += 1\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "e1490241a42dafb4cc31118739a5aad1", "score": "0.5358653", "text": "func XOR(a, b []byte) []byte {\n\tc := make([]byte, len(a))\n\tfor i := 0; i < len(a); i++ {\n\t\tc[i] = a[i] ^ b[i]\n\t}\n\treturn c\n}", "title": "" }, { "docid": "4600feec2124cf27110a881bb90b41db", "score": "0.5341102", "text": "func xor4(a *[4]byte, b []byte) {\n a[0] ^= b[0]\n a[1] ^= b[1]\n a[2] ^= b[2]\n a[3] ^= b[3]\n}", "title": "" }, { "docid": "75d27b18111c34dda2fc5d6fd9ceecfd", "score": "0.5333617", "text": "func rsCombinedBytes(rBytes, sBytes []byte, pubKey *ecdsa.PublicKey) ([]byte, error) {\n\tkeySize, err := ecdsakeyBytes(pubKey)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"RSCombinedBytes: ecdsa key bytes error %v\", err)\n\t}\n\trsize := len(rBytes)\n\tssize := len(sBytes)\n\tif rsize > keySize || ssize > keySize {\n\t\treturn nil, fmt.Errorf(\"RSCombinedBytes: error. keySize %v, rSize %v, sSize %v\", keySize, rsize, ssize)\n\t}\n\n\t// basically the size is 32 bytes. the r and s needs to be both left padded to two 32 bytes slice\n\t// into a single signature buffer\n\tbuffer := make([]byte, keySize*2)\n\tstartPos := keySize - rsize\n\tcopy(buffer[startPos:], rBytes)\n\tstartPos = keySize*2 - ssize\n\tcopy(buffer[startPos:], sBytes)\n\treturn buffer[:], nil\n}", "title": "" }, { "docid": "a26185f6ce469a588ffea80dc1e877dc", "score": "0.5306243", "text": "func xor_slice(a []byte, b []byte) []byte {\n\tr := make([]byte, len(a))\n\tfor i, v := range a {\n\t\tr[i] = v ^ b[i]\n\t}\n\treturn r\n}", "title": "" }, { "docid": "270e4cb959b164981a7aea6cc0da37be", "score": "0.5295073", "text": "func xorKeyStreamVX(dst, src []byte, key *[8]uint32, nonce *[3]uint32, counter *uint32)", "title": "" }, { "docid": "3316e8102f9a4663fac988244621861d", "score": "0.52880347", "text": "func TestXor64(t *testing.T) {\n u := New([]uint8{\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,\n 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1,\n 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1,\n })\n w := New([]uint8{\n 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1,\n 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1,\n 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n })\n res := New([]uint8{\n 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0,\n 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0,\n 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0,\n 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0,\n })\n v := u.Xor(w)\n if !v.Equal(res) {\n t.Errorf(\"vector testing: XOR is incorrect, %v XOR %v = %v != %v\",\n u, w, v, res)\n }\n}", "title": "" }, { "docid": "3181a9661bf72bb8343d0385e6ed697c", "score": "0.5282099", "text": "func TestXorMore64(t *testing.T) {\n u := New([]uint8{\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,\n 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1,\n 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0,\n 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0,\n 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n })\n w := New([]uint8{\n 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,\n 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1,\n 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1,\n 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n })\n res := New([]uint8{\n 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0,\n 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0,\n 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1,\n 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1,\n 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n })\n v := u.Xor(w)\n if !v.Equal(res) {\n t.Errorf(\"vector testing: XOR is incorrect, %v XOR %v = %v != %v\",\n u, w, v, res)\n }\n}", "title": "" }, { "docid": "e315e68ca89e0cc2a5dbd6651fa4c592", "score": "0.5281673", "text": "func XOR(z, x, y []byte) {\n\tfor i := range z {\n\t\tz[i] = x[i] ^ y[i]\n\t}\n}", "title": "" }, { "docid": "7864868ed4c59275cfb49154ed41ff1f", "score": "0.5248183", "text": "func opcodeXor(op *ParsedOp, t *thread) error {\r\n\ta, err := t.dstack.PopByteArray()\r\n\tif err != nil {\r\n\t\treturn err\r\n\t}\r\n\r\n\tb, err := t.dstack.PopByteArray()\r\n\tif err != nil {\r\n\t\treturn err\r\n\t}\r\n\r\n\tif len(a) != len(b) {\r\n\t\treturn scriptError(ErrInvalidInputLength, \"byte arrays are not the same length\")\r\n\t}\r\n\r\n\tc := make([]byte, len(a))\r\n\tfor i := range a {\r\n\t\tc[i] = a[i] ^ b[i]\r\n\t}\r\n\r\n\tt.dstack.PushByteArray(c)\r\n\treturn nil\r\n}", "title": "" }, { "docid": "945677cea9d5bb9365618eaebafef2f7", "score": "0.5236392", "text": "func HashByteArrays(firstArray, secondArray []byte) []byte {\n\tsha := sha256.New()\n\tsha.Write(append(firstArray[:], secondArray[:]...))\n\treturn sha.Sum(nil)\n}", "title": "" }, { "docid": "d6839b2ae86d076fdaf351519971935e", "score": "0.5213104", "text": "func Intersect(a, b [][]byte) [][]byte {\n\tn := len(b)\n\tif len(a) > len(b) {\n\t\tn = len(a)\n\t}\n\tother := make([][]byte, 0, n)\n\n\tfor len(a) > 0 && len(b) > 0 {\n\t\tif cmp := bytes.Compare(a[0], b[0]); cmp == 0 {\n\t\t\tother, a, b = append(other, a[0]), a[1:], b[1:]\n\t\t} else if cmp == -1 {\n\t\t\ta = a[1:]\n\t\t} else {\n\t\t\tb = b[1:]\n\t\t}\n\t}\n\treturn other\n}", "title": "" }, { "docid": "f92d248e33074c1abdbb89c9019c3766", "score": "0.51942295", "text": "func Xmemcmp(tls TLS, s1, s2 uintptr, n size_t) int32 {\n\treturn X__builtin_memcmp(tls, s1, s2, n)\n}", "title": "" }, { "docid": "e24c260b766202367942281f9b4ae918", "score": "0.5189066", "text": "func Xor(cleartext []byte, k []byte) []byte {\n\txored := make([]byte, len(cleartext))\n\tfor i, b := range cleartext {\n\t\txored[i] = k[i%len(k)] ^ b\n\t}\n\treturn xored\n}", "title": "" }, { "docid": "22995de0ea29c4893220a781de504979", "score": "0.518005", "text": "func Xor(text, key []byte) []byte {\n\tif len(key) == 0 {\n\t\tpanic(\"xor: key can't be empty\")\n\t}\n\tres := make([]byte, len(text))\n\tif len(key) == 1 {\n\t\t// Fast path.\n\t\tk := key[0]\n\t\tfor i := range text {\n\t\t\tres[i] = text[i] ^ k\n\t\t}\n\t\treturn res\n\t}\n\tfor i := range text {\n\t\tres[i] = text[i] ^ key[i%len(key)]\n\t}\n\treturn res\n}", "title": "" }, { "docid": "0ed3759c56906c5021686e8a07d49451", "score": "0.51758575", "text": "func xorToken(a, b []byte) []byte {\n\tn := len(a)\n\tif len(b) < n {\n\t\tn = len(b)\n\t}\n\n\tres := make([]byte, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = a[i] ^ b[i]\n\t}\n\n\treturn res\n}", "title": "" }, { "docid": "78a992e1fc14653a72d63977cb097576", "score": "0.51649994", "text": "func xorToken(a, b []byte) []byte {\n\tvar n = len(a)\n\n\tif len(b) < n {\n\t\tn = len(b)\n\t}\n\n\tres := make([]byte, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = a[i] ^ b[i]\n\t}\n\n\treturn res\n}", "title": "" }, { "docid": "313620d73a569d9717bff33dffd1460b", "score": "0.5159561", "text": "func TestXorLess64(t *testing.T) {\n u := New([]uint8{\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,\n })\n w := New([]uint8{\n 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n })\n res := New([]uint8{\n 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,\n 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,\n })\n v := u.Xor(w)\n if !v.Equal(res) {\n t.Errorf(\"vector testing: XOR is incorrect, %v XOR %v = %v != %v\",\n u, w, v, res)\n }\n}", "title": "" }, { "docid": "467c4457762c2cda42a679d291634c3a", "score": "0.51182115", "text": "func fastXORBytes(dst, a, b []byte) int {\n\tn := len(a)\n\tif len(b) < n {\n\t\tn = len(b)\n\t}\n\n\tw := n / wordSize\n\tif w > 0 {\n\t\tdw := *(*[]uintptr)(unsafe.Pointer(&dst))\n\t\taw := *(*[]uintptr)(unsafe.Pointer(&a))\n\t\tbw := *(*[]uintptr)(unsafe.Pointer(&b))\n\t\tfor i := 0; i < w; i++ {\n\t\t\tdw[i] = aw[i] ^ bw[i]\n\t\t}\n\t}\n\n\tfor i := n - n%wordSize; i < n; i++ {\n\t\tdst[i] = a[i] ^ b[i]\n\t}\n\n\treturn n\n}", "title": "" }, { "docid": "01654a7e777e1ecfd0c15d84c732c3ce", "score": "0.51143885", "text": "func vax(a uint8, x, y []byte) {\n\tif a == GF_ONE {\n\t\tcopy(y, x)\n\t\treturn\n\t}\n\tfor i := 0; i < len(x); i += 1 {\n\t\ty[i] = MT[a][x[i]]\n\t}\n}", "title": "" }, { "docid": "1dc0d954f366c873ece9c7e6fca433e7", "score": "0.5102687", "text": "func mergeNibbles(a byte, b byte) byte {\n\treturn (a | (b >> 4))\n}", "title": "" }, { "docid": "ed71a78d6b7b11d7f4c34cb595261f95", "score": "0.50881577", "text": "func Concat(slices ...[]uint8) []uint8 {\n\tvar ret []uint8\n\tfor _, x := range slices {\n\t\tret = append(ret, x...)\n\t}\n\n\treturn ret\n}", "title": "" }, { "docid": "3ea7a0f76cc0a4e7a10a1449f273953d", "score": "0.5074562", "text": "func TestXOR(t *testing.T) {\n\tfor alignP := 0; alignP < 2; alignP++ {\n\t\tfor alignQ := 0; alignQ < 2; alignQ++ {\n\t\t\tfor alignD := 0; alignD < 2; alignD++ {\n\t\t\t\tp := make([]byte, 1023)[alignP:]\n\t\t\t\tq := make([]byte, 1023)[alignQ:]\n\n\t\t\t\tfor i := 0; i < len(p); i++ {\n\t\t\t\t\tp[i] = byte(i)\n\t\t\t\t}\n\t\t\t\tfor i := 0; i < len(q); i++ {\n\t\t\t\t\tq[i] = byte(len(q) - i)\n\t\t\t\t}\n\t\t\t\td1 := make([]byte, 1023+alignD)[alignD:]\n\t\t\t\td2 := make([]byte, 1023+alignD)[alignD:]\n\n\t\t\t\tXORBytes(d1, p, q)\n\t\t\t\tsafeXORBytes(d2, p, q)\n\t\t\t\tif !bytes.Equal(d1, d2) {\n\t\t\t\t\tt.Error(\"not equal\", d1, d2)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "8653d36488e99af413c847d9b9a8eed3", "score": "0.50523806", "text": "func XorSwap(a, b int) (int, int) {\n\ta = a ^ b\n\tb = a ^ b\n\ta = a ^ b\n\n\treturn a, b\n}", "title": "" }, { "docid": "9fe7fb120c729edd9144015aa31e48ee", "score": "0.5031195", "text": "func (idx *Index) Xor(bitmaps ...*PQLBitmapQuery) *PQLBitmapQuery {\n\tif len(bitmaps) < 2 {\n\t\treturn NewPQLBitmapQuery(\"\", idx, NewError(\"Xor operation requires at least 2 bitmaps\"))\n\t}\n\treturn idx.bitmapOperation(\"Xor\", bitmaps...)\n}", "title": "" }, { "docid": "24c52f854bf41e9ce97afcb26f9dc760", "score": "0.50257075", "text": "func SingleByteXOR(dst, a []byte, b byte) {\n\tfor i := 0; i < len(a); i++ {\n\t\tdst[i] = a[i] ^ b\n\t}\n\treturn\n}", "title": "" }, { "docid": "fc41dc2faa2cb7858c2a9014a7e65b78", "score": "0.5013844", "text": "func XOR(b []byte, c []byte) []byte {\n\tn := len(b)\n\to := make([]byte, n)\n\tfor i := 0; i < n; i++ {\n\t\to[i] = b[i] ^ c[i]\n\t}\n\treturn (o)\n}", "title": "" }, { "docid": "307a3f1cf85960f1ba2e86aeb7216feb", "score": "0.50114757", "text": "func vaxpy(a uint8, x, y []byte) {\n\tif a == GF_ZERO {\n\t\treturn\n\t}\n\tfor i := 0; i < len(x); i += 1 {\n\t\ty[i] ^= MT[a][x[i]]\n\t}\n}", "title": "" }, { "docid": "47f4539f10c26a0aeef179b209dcb7d7", "score": "0.50113547", "text": "func XorMin(cleartext []byte, k []byte) []byte {\n\tmin := len(k)\n\tif min > len(cleartext) {\n\t\tmin = len(cleartext)\n\t}\n\txored := make([]byte, min)\n\tfor i := 0; i < min; i++ {\n\t\txored[i] = cleartext[i] ^ k[i]\n\t}\n\treturn xored\n}", "title": "" }, { "docid": "73f4aa41734145d2cda699d277ab651d", "score": "0.5010878", "text": "func CrackSingleXor(x string) (string, float64, float64, byte) {\n x_bytes, x_err := hex.DecodeString(x);\n\n if x_err != nil {\n panic(x_err);\n }\n\n dst := x_bytes;\n var top_score float64 = 0;\n var distance float64 = 0;\n winner := string(dst[:]);\n var winning_key byte;\n for i := 0; i < 255; i++ {\n key := byte(i);\n\n for i := 0; i < len(x_bytes); i++ {\n dst[i] = x_bytes[i] ^ key;\n }\n\n score := score(string(dst[:]));\n if score > top_score {\n distance = score - top_score;\n top_score = score;\n winning_key = key;\n winner = string(dst[:]);\n }\n }\n\n return winner, top_score, distance, winning_key;\n}", "title": "" }, { "docid": "b2de1678f4d9f80747c2412e42b22474", "score": "0.50071865", "text": "func opcodeOr(op *ParsedOp, t *thread) error {\r\n\ta, err := t.dstack.PopByteArray()\r\n\tif err != nil {\r\n\t\treturn err\r\n\t}\r\n\r\n\tb, err := t.dstack.PopByteArray()\r\n\tif err != nil {\r\n\t\treturn err\r\n\t}\r\n\r\n\tif len(a) != len(b) {\r\n\t\treturn scriptError(ErrInvalidInputLength, \"byte arrays are not the same length\")\r\n\t}\r\n\r\n\tc := make([]byte, len(a))\r\n\tfor i := range a {\r\n\t\tc[i] = a[i] | b[i]\r\n\t}\r\n\r\n\tt.dstack.PushByteArray(c)\r\n\treturn nil\r\n}", "title": "" }, { "docid": "b0c75d6c80b735a7a203d3a1b88cf8d1", "score": "0.49982664", "text": "func TestAND(t *testing.T) {\n\tfor alignP := 0; alignP < 2; alignP++ {\n\t\tfor alignQ := 0; alignQ < 2; alignQ++ {\n\t\t\tfor alignD := 0; alignD < 2; alignD++ {\n\t\t\t\tp := make([]byte, 1023)[alignP:]\n\t\t\t\tq := make([]byte, 1023)[alignQ:]\n\n\t\t\t\tfor i := 0; i < len(p); i++ {\n\t\t\t\t\tp[i] = byte(i)\n\t\t\t\t}\n\t\t\t\tfor i := 0; i < len(q); i++ {\n\t\t\t\t\tq[i] = byte(len(q) - i)\n\t\t\t\t}\n\t\t\t\td1 := make([]byte, 1023+alignD)[alignD:]\n\t\t\t\td2 := make([]byte, 1023+alignD)[alignD:]\n\n\t\t\t\tANDBytes(d1, p, q)\n\t\t\t\tsafeANDBytes(d2, p, q)\n\t\t\t\tif !bytes.Equal(d1, d2) {\n\t\t\t\t\tt.Error(\"not equal\")\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a151882da176685bddc10a91ea34ff4f", "score": "0.4978731", "text": "func compareByteValues(a, b []byte) {\n\tif reflect.DeepEqual(a, b) {\n\t\tfmt.Println(\"Nothing to do\")\n\t} else {\n\t\tuserDefinedFunction()\n\t}\n}", "title": "" }, { "docid": "e106391d4a62e10c7eb171afc0d87d27", "score": "0.49750736", "text": "func TestIntPackerGet(t *testing.T) {\n\tranges := []int{\n\t\t2, 2, 2, 2, 2, 2, 2, 2,\n\t\t2, 2, 2, 2, 2, 2, 2, 2,\n\t\t2, 2, 2, 2, 2, 2, 2, 2,\n\t\t2, 2, 2, 2, 2, 2, 2, 2,\n\t}\n\texp := []int{\n\t\t0, 0, 0, 0, 0, 0, 0, 0,\n\t\t1, 1, 1, 1, 1, 1, 1, 1,\n\t\t0, 0, 0, 0, 0, 1, 0, 0,\n\t\t0, 1, 1, 1, 1, 1, 0, 0,\n\t}\n\tbuf := []Bin{1042349824}\n\n\tpacker := NewIntPacker(ranges)\n\tfor i, v := range exp {\n\t\tif packer.get(buf, i) != v {\n\t\t\tt.Errorf(\"ERR exp: %d was: %d\\n\", v, packer.get(buf, i))\n\t\t}\n\t}\n\n\tranges2 := []int{\n\t\t2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\n\t\t2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\n\t\t2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\n\t\t2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\n\t\t2, 2, 2, 11,\n\t}\n\tbuf2 := []Bin{18446040386265677232, 543296577406}\n\tindex2 := 59\n\tpacker2 := NewIntPacker(ranges2)\n\tif res := packer2.get(buf2, index2); res != 1 {\n\t\tt.Errorf(\"ERR exp: %d was: %d\\n\", 1, res)\n\t}\n\tfor i := range ranges2 {\n\t\tif res := packer2.get(buf2, i); res < 0 {\n\t\t\tt.Errorf(\"ERR exp: %d was: %d\\n\", 1, res)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "3722dd76bde10987606d059d8dc32921", "score": "0.4973052", "text": "func ArrComp(a, b []byte) error {\n\tif len(a) != len(b) {\n\t\treturn fmt.Errorf(\"arrays differ in length. %d != %d\", len(a), len(b))\n\t}\n\tfor i, v := range a {\n\t\tif v != b[i] {\n\t\t\treturn fmt.Errorf(\"arrays differ at index: %d\", i)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a1f026dabdb70790a8108fb26f6ca6fd", "score": "0.4950798", "text": "func xor16(dst, a, b *byte)", "title": "" }, { "docid": "0f4dfab30978b99d5b88408ddf5d8e49", "score": "0.4949729", "text": "func ConvertBytes(in []byte, outrx int) (out []byte, err error) {\n\tif outrx < 2 {\n\t\treturn nil, errors.New(\"outrx must be greater than 1\")\n\t}\n\tif outrx > 256 {\n\t\treturn nil, errors.New(\"outrx must be less than 256\")\n\t}\n\n\tif len(in) == 0 {\n\t\treturn\n\t}\n\n\trx := big.NewInt(int64(outrx))\n\tzero := big.NewInt(0)\n\tnum := new(big.Int).SetBytes(in)\n\n\tfor num.Cmp(zero) != 0 {\n\t\tmod := new(big.Int)\n\t\tnum.DivMod(num, rx, mod)\n\t\tout = append(out, byte(mod.Int64()))\n\t}\n\n\tfor i, j := 0, len(out)-1; i < j; i, j = i+1, j-1 {\n\t\tout[i], out[j] = out[j], out[i]\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "7752dbe726c257997e695a2d72fab8cd", "score": "0.49493572", "text": "func And(x1, x2 *Bitmap) *Bitmap {\n\tanswer := NewBitmap()\n\tpos1 := 0\n\tpos2 := 0\n\tlength1 := x1.highlowcontainer.size()\n\tlength2 := x2.highlowcontainer.size()\nmain:\n\tfor pos1 < length1 && pos2 < length2 {\n\t\ts1 := x1.highlowcontainer.getKeyAtIndex(pos1)\n\t\ts2 := x2.highlowcontainer.getKeyAtIndex(pos2)\n\t\tfor {\n\t\t\tif s1 == s2 {\n\t\t\t\tc := roaring.And(x1.highlowcontainer.getContainerAtIndex(pos1), x2.highlowcontainer.getContainerAtIndex(pos2))\n\t\t\t\tif !c.IsEmpty() {\n\t\t\t\t\tanswer.highlowcontainer.appendContainer(s1, c, false)\n\t\t\t\t}\n\t\t\t\tpos1++\n\t\t\t\tpos2++\n\t\t\t\tif (pos1 == length1) || (pos2 == length2) {\n\t\t\t\t\tbreak main\n\t\t\t\t}\n\t\t\t\ts1 = x1.highlowcontainer.getKeyAtIndex(pos1)\n\t\t\t\ts2 = x2.highlowcontainer.getKeyAtIndex(pos2)\n\t\t\t} else if s1 < s2 {\n\t\t\t\tpos1 = x1.highlowcontainer.advanceUntil(s2, pos1)\n\t\t\t\tif pos1 == length1 {\n\t\t\t\t\tbreak main\n\t\t\t\t}\n\t\t\t\ts1 = x1.highlowcontainer.getKeyAtIndex(pos1)\n\t\t\t} else { // s1 > s2\n\t\t\t\tpos2 = x2.highlowcontainer.advanceUntil(s1, pos2)\n\t\t\t\tif pos2 == length2 {\n\t\t\t\t\tbreak main\n\t\t\t\t}\n\t\t\t\ts2 = x2.highlowcontainer.getKeyAtIndex(pos2)\n\t\t\t}\n\t\t}\n\t}\n\treturn answer\n}", "title": "" }, { "docid": "781de68e5d88b4498328a10341ab7ada", "score": "0.49473363", "text": "func TestOR(t *testing.T) {\n\tfor alignP := 0; alignP < 2; alignP++ {\n\t\tfor alignQ := 0; alignQ < 2; alignQ++ {\n\t\t\tfor alignD := 0; alignD < 2; alignD++ {\n\t\t\t\tp := make([]byte, 1023)[alignP:]\n\t\t\t\tq := make([]byte, 1023)[alignQ:]\n\n\t\t\t\tfor i := 0; i < len(p); i++ {\n\t\t\t\t\tp[i] = byte(i)\n\t\t\t\t}\n\t\t\t\tfor i := 0; i < len(q); i++ {\n\t\t\t\t\tq[i] = byte(len(q) - i)\n\t\t\t\t}\n\t\t\t\td1 := make([]byte, 1023+alignD)[alignD:]\n\t\t\t\td2 := make([]byte, 1023+alignD)[alignD:]\n\n\t\t\t\tORBytes(d1, p, q)\n\t\t\t\tsafeORBytes(d2, p, q)\n\t\t\t\tif !bytes.Equal(d1, d2) {\n\t\t\t\t\tt.Error(\"not equal\")\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ef3987f8020dc477d450997abfef4686", "score": "0.49470136", "text": "func xor(s1, s2 string) string {\n\t\n\t// Ensure strings are same length\n\tif len(s1) != len(s2) {\n\t\treturn \"\"\n\t}\n\t\n\t// Bitwise XOR strings together\n\tresult := make([]byte, len(s1))\n\tfor i := 0; i < len(s1); i++ {\n\t\tresult[i] = s1[i] ^ s2[i]\n\t}\n\treturn string(result)\n}", "title": "" }, { "docid": "e3f312254cac19441facc373abc2e31b", "score": "0.49307075", "text": "func Compare(a, b [16]byte) uint8 {\n\tvar c uint8\n\tc = 0\n\tfor i := 0; i < 16; i++ {\n\t\tv := a[i] ^ b[i]\n\t\tfor ; v != 0; c++ {\n\t\t\tv &= v - 1\n\t\t}\n\t}\n\treturn c\n}", "title": "" }, { "docid": "03959df648847f908ed45514e069a08c", "score": "0.49270174", "text": "func ConcatBytes(data ...[]byte) []byte {\n\tvar concat []byte\n\tfor _, b := range data {\n\t\tif len(b) == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tconcat = append(concat, b...)\n\t}\n\n\treturn concat\n}", "title": "" }, { "docid": "b2afb6f96764b865352c140798825565", "score": "0.49059823", "text": "func breakSingleByteXOR(msg []byte, scoringFn func(s string) float32) ([]byte, byte, float32) {\n\tvar (\n\t\tbyteCipher byte\n\t\tmaxScore float32\n\t)\n\tdst := make([]byte, len(msg))\n\tdecodedMsg := make([]byte, len(msg))\n\n\tfor i := 0; i < 255; i++ {\n\t\tb := byte(i)\n\t\tSingleByteXOR(dst, msg, b)\n\t\tmsg := string(dst[:])\n\t\tscore := scoreEnglishText(msg)\n\t\tif score > maxScore {\n\t\t\tmaxScore = score\n\t\t\tcopy(decodedMsg, dst)\n\t\t\tbyteCipher = b\n\t\t}\n\t}\n\treturn decodedMsg, byteCipher, maxScore\n\n}", "title": "" }, { "docid": "0c46a2a5681c4cf04a3b01d35c647312", "score": "0.49059334", "text": "func Compatible(a BiSplit, b BiSplit) int8 {\n tmp := compatible(a.data, b.data)\n\n if tmp != 0 {\n return tmp\n } else {\n return compatible(inverted(a), b.data);\n }\n}", "title": "" }, { "docid": "13e07210b75b99189b0b604dfb5867d6", "score": "0.49046922", "text": "func (s *RowSegment) Xor(other *RowSegment) *RowSegment {\n\tdata := s.data.Xor(other.data)\n\n\treturn &RowSegment{\n\t\tdata: data,\n\t\tshard: s.shard,\n\t\tn: data.Count(),\n\t}\n}", "title": "" }, { "docid": "378afcf7eb39d864a0331b78800d3882", "score": "0.4900863", "text": "func addBinary(a string, b string) string {\n arrA := []byte(a)\n arrB := []byte(b)\n max := findMax(len(arrA), len(arrB)) + 1\n res := make([]byte, max)\n flag := 0\n for i := 1; i <= max; i++ {\n valA, valB := 0, 0\n if len(arrA) - i >= 0 {\n valA = int(arrA[len(arrA) - i] - '0')\n }\n if len(arrB) - i >= 0 {\n valB = int(arrB[len(arrB) - i] - '0')\n }\n res[max - i] = byte((valA + valB + flag) % 2 + '0')\n flag = (valA + valB + flag) / 2\n }\n if res[0] == '0' {\n res = res[1:]\n }\n \n return string(res)\n}", "title": "" }, { "docid": "f0a30fdaa1107c41ddfe8250ddee93ff", "score": "0.48969254", "text": "func Xor[E comparable](items ...[]E) []E {\n\tlength := len(items)\n\tif length == 0 {\n\t\treturn []E{}\n\t} else if length == 1 {\n\t\tresult := append([]E{}, items[0]...)\n\t\treturn result\n\t} else {\n\t\tresult := append([]E{}, items[0]...)\n\t\tfor i := 1; i < length; i++ {\n\t\t\tresult = xor2(result, items[i])\n\t\t}\n\n\t\treturn result\n\t}\n}", "title": "" }, { "docid": "1306847d3f973eb8d98bb64b61cd40a7", "score": "0.4883797", "text": "func CompareSlices(a, b []Hex) bool {\n\tif len(a) != len(b) {\n\t\treturn false\n\t}\n\n\tfor i := range a {\n\t\tif a[i] != b[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "03bc3673f32b2127116fc879cf66b241", "score": "0.4877917", "text": "func FixedXOR(a, b []byte) ([]byte, error) {\n\tif len(a) != len(b) {\n\t\treturn nil, errors.New(\"a and b must be the same length\")\n\t}\n\n\tsz := len(a)\n\n\txor := make([]byte, sz)\n\n\tfor i := range xor {\n\t\txor[i] = a[i] ^ b[i]\n\t}\n\n\treturn xor, nil\n}", "title": "" }, { "docid": "62f1747c14fc5426c30c5dc65bf7801e", "score": "0.48737174", "text": "func makeXOR(buf []byte) []byte {\n\t/* Random byte to xor */\n\txors := make([]byte, 1)\n\tif _, err := rand.Read(xors); nil != err {\n\t\tlog.Fatalf(\"Unable to read random XOR byte: %v\", err)\n\t}\n\txorb := xors[0]\n\n\t/* Output buffer */\n\tobuf := make([]byte, len(buf)+1)\n\n\t/* Pack the output buffer */\n\tobuf[0] = xorb\n\tfor i, v := range buf {\n\t\tobuf[i+1] = v ^ xorb\n\t}\n\n\treturn obuf\n}", "title": "" }, { "docid": "a9f38f92facfd54fff63060929c986ee", "score": "0.48611587", "text": "func feBytesLE(a, b *[32]byte) int32 {\n\tequalSoFar := int32(-1)\n\tgreater := int32(0)\n\n\tfor i := uint(31); i < 32; i-- {\n\t\tx := int32(a[i])\n\t\ty := int32(b[i])\n\n\t\tgreater = (^equalSoFar & greater) | (equalSoFar & ((x - y) >> 31))\n\t\tequalSoFar = equalSoFar & (((x ^ y) - 1) >> 31)\n\t}\n\n\treturn int32(^equalSoFar & 1 & greater)\n}", "title": "" }, { "docid": "77d876b7e875abf3661a88f62bef6925", "score": "0.48547482", "text": "func (b *Builder) Xor(x, y *Value) *Value {\n\tassertTypesEqual(x.Type(), y.Type())\n\treturn b.val(x.Type(), b.llvm.CreateXor(x.llvm, y.llvm, x.Name()+\"^\"+y.Name()))\n}", "title": "" }, { "docid": "9a979f1c6173b1a30e4e3981735af6c2", "score": "0.48501825", "text": "func singleXOR(input []byte, key byte) []byte {\n\tres := make([]byte, len(input))\n\tfor i, value := range input {\n\t\tres[i] = value ^ key\n\t}\n\treturn res\n}", "title": "" }, { "docid": "80f3545907114bdef273213a262b4681", "score": "0.48448506", "text": "func TestConcatenate(t *testing.T) {\n\t// Two UCS-2 TPDUs to be concatenated. The first ends with the first surrogate\n\t// of a surrogate pair. In total there are three surrogate pairs - each one\n\t// an emoticon - 😁.\n\tu1 := tpdu.NewDeliver()\n\tdcs, _ := tpdu.DCS(0).WithAlphabet(tpdu.AlphaUCS2)\n\toa := tpdu.Address{TOA: 0x91, Addr: \"1234\"}\n\tu1.DCS = byte(dcs)\n\tu1.OA = oa\n\tu1.UD = []byte{0xd8, 0x3d, 0xde, 0x01, 0xd8, 0x3d}\n\tu2 := tpdu.NewDeliver()\n\tu2.DCS = byte(dcs)\n\tu2.OA = oa\n\tu2.UD = []byte{0xde, 0x01, 0xd8, 0x3d, 0xde, 0x01}\n\td, _ := tpdu.NewUDDecoder()\n\tc := message.NewConcatenator(d)\n\tm, err := c.Concatenate([]*tpdu.Deliver{u1, u2})\n\tassert.Equal(t, nil, err)\n\texpected := &message.Message{Msg: \"😁😁😁\", Number: \"+1234\", TPDUs: []*tpdu.Deliver{u1, u2}}\n\tassert.Equal(t, expected, m)\n}", "title": "" }, { "docid": "e7e5399b216e12dcf9b2cb7aa088382c", "score": "0.48421964", "text": "func (r *Row) Xor(other *Row) *Row {\n\tvar segments []RowSegment\n\n\titr := newMergeSegmentIterator(r.Segments, other.Segments)\n\tfor s0, s1 := itr.next(); s0 != nil || s1 != nil; s0, s1 = itr.next() {\n\t\tif s1 == nil {\n\t\t\tsegments = append(segments, *s0)\n\t\t\tcontinue\n\t\t} else if s0 == nil {\n\t\t\tsegments = append(segments, *s1)\n\t\t\tcontinue\n\t\t}\n\n\t\tsegments = append(segments, *s0.Xor(s1))\n\t}\n\n\treturn &Row{Segments: segments}\n}", "title": "" }, { "docid": "2e21fff83938cf27096c99a27e7d5b2b", "score": "0.4828433", "text": "func TestCombineResponses(t *testing.T) {\n\tt.Run(\"both combinable\", func(t *testing.T) {\n\t\tleft := &ScanResponse{\n\t\t\tRows: []KeyValue{\n\t\t\t\t{Key: Key(\"A\"), Value: MakeValueFromString(\"V\")},\n\t\t\t},\n\t\t\tIntentRows: []KeyValue{\n\t\t\t\t{Key: Key(\"Ai\"), Value: MakeValueFromString(\"X\")},\n\t\t\t},\n\t\t}\n\t\tright := &ScanResponse{\n\t\t\tRows: []KeyValue{\n\t\t\t\t{Key: Key(\"B\"), Value: MakeValueFromString(\"W\")},\n\t\t\t},\n\t\t\tIntentRows: []KeyValue{\n\t\t\t\t{Key: Key(\"Bi\"), Value: MakeValueFromString(\"Z\")},\n\t\t\t},\n\t\t}\n\t\texpCombined := &ScanResponse{\n\t\t\tRows: append(append([]KeyValue(nil), left.Rows...), right.Rows...),\n\t\t\tIntentRows: append(append([]KeyValue(nil), left.IntentRows...), right.IntentRows...),\n\t\t}\n\n\t\terr := CombineResponses(left, right)\n\t\trequire.NoError(t, err)\n\t\trequire.Equal(t, expCombined, left)\n\t})\n\n\tt.Run(\"neither combinable\", func(t *testing.T) {\n\t\tleft := &GetResponse{\n\t\t\tValue: &Value{RawBytes: []byte(\"V\")},\n\t\t}\n\t\tright := &GetResponse{\n\t\t\tValue: &Value{RawBytes: []byte(\"W\")},\n\t\t}\n\t\texpCombined := &GetResponse{\n\t\t\tValue: left.Value.ShallowClone(),\n\t\t}\n\n\t\terr := CombineResponses(left, right)\n\t\trequire.NoError(t, err)\n\t\trequire.Equal(t, expCombined, left)\n\t})\n\n\tt.Run(\"left combinable\", func(t *testing.T) {\n\t\tleft := &ScanResponse{\n\t\t\tRows: []KeyValue{\n\t\t\t\t{Key: Key(\"A\"), Value: MakeValueFromString(\"V\")},\n\t\t\t},\n\t\t\tIntentRows: []KeyValue{\n\t\t\t\t{Key: Key(\"Ai\"), Value: MakeValueFromString(\"X\")},\n\t\t\t},\n\t\t}\n\t\tright := &GetResponse{\n\t\t\tValue: &Value{RawBytes: []byte(\"W\")},\n\t\t}\n\n\t\terr := CombineResponses(left, right)\n\t\trequire.Error(t, err)\n\t\trequire.Regexp(t, \"can not combine\", err)\n\t})\n\n\tt.Run(\"right combinable\", func(t *testing.T) {\n\t\tleft := &GetResponse{\n\t\t\tValue: &Value{RawBytes: []byte(\"V\")},\n\t\t}\n\t\tright := &ScanResponse{\n\t\t\tRows: []KeyValue{\n\t\t\t\t{Key: Key(\"B\"), Value: MakeValueFromString(\"W\")},\n\t\t\t},\n\t\t\tIntentRows: []KeyValue{\n\t\t\t\t{Key: Key(\"Bi\"), Value: MakeValueFromString(\"Z\")},\n\t\t\t},\n\t\t}\n\n\t\terr := CombineResponses(left, right)\n\t\trequire.Error(t, err)\n\t\trequire.Regexp(t, \"can not combine\", err)\n\t})\n}", "title": "" }, { "docid": "0918f53611e992e54b6ff910315b1adf", "score": "0.48278162", "text": "func Swap(x, y []int8, bytes, mask int) {\n\tc := int8(mask)\n\tfor i := 0; i < bytes; i++ {\n\t\tt := c & (x[i] ^ y[i])\n\t\tx[i] ^= t\n\t\ty[i] ^= t\n\t}\n}", "title": "" } ]
617676f11958af3ffcec837ab5e57219
SendSms sends a message to the phone.
[ { "docid": "295ae2f596ead1e3c763b995ad412a13", "score": "0.7476684", "text": "func SendSms(phoneNumber, code string) {\n\tclient, err := dysmsapi.NewClientWithAccessKey(\"cn-hangzhou\", accessKeyID, accessKeySecret)\n\n\trequest := dysmsapi.CreateSendSmsRequest()\n\trequest.Scheme = \"https\"\n\n\trequest.PhoneNumbers = phoneNumber\n\trequest.SignName = SMSSignName\n\trequest.TemplateCode = SMSTemplateCode\n\trequest.TemplateParam = \"{\\\"code\\\":\\\"\" + code + \"\\\"}\"\n\n\t_, err = client.SendSms(request)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" } ]
[ { "docid": "a4d545e5c0304e7dbffc4ebc346ad82a", "score": "0.80675596", "text": "func (t *Trio) SendSms(phone string, message string) (*http.Response, error) {\n\t// gets all the predefined url parameters\n\turl_parameters := t.params\n\t// set SendSms func specific url parameters\n\turl_parameters.Set(\"to\", phone)\n\turl_parameters.Set(\"msg\", message)\n\t// parse the url parameters into an endpoint\n\tendpoint := getEndpoint(url_parameters)\n\t// sends the POST request to TrioMobile\n\tresp, err := http.Post(endpoint, \"\", nil)\n\n\treturn resp, err\n}", "title": "" }, { "docid": "2c4466e4d5b7a9a87a4b19c030f403d7", "score": "0.79923075", "text": "func (s *Server) SendSMS(p Person, t string) {\n\tfmt.Println(\"SENDING SMS TO \", p.Phone())\n\tmessage := &pkg.SMSMessage{\n\t\tFrom: s.PhoneNumber,\n\t\tTo: p.Phone(),\n\t\tType: pkg.Text,\n\t\tText: t,\n\t\t// ClientReference: \"gonexmo-test \" + strconv.FormatInt(time.Now().Unix(), 10),\n\t\t// Class: pkg.Standard,\n\t\tClass: pkg.Flash,\n\t}\n\n\ts.MsgQueue.Push(message)\n}", "title": "" }, { "docid": "9a5791557e8ce3bfb1c6cab8e27cc0f9", "score": "0.7739048", "text": "func (this *Client) SendSms(signatureId, templateId, recNum string, paramMap map[string]string) error {\n\tinitMap := this.newParamMap()\n\n\tif bytes, err := json.Marshal(paramMap); nil != err {\n\t\tprintln(\"marsh error\")\n\t} else {\n\t\tvalue := string(bytes)\n\t\tinitMap.Add(\"ParamString\", value)\n\t}\n\n\tinitMap.Add(\"Action\", \"SingleSendSms\")\n\tinitMap.Add(\"SignName\", signatureId)\n\tinitMap.Add(\"TemplateCode\", templateId)\n\tinitMap.Add(\"RecNum\", recNum)\n\n\tsignature := util.CreateSignatureForRequest(\"GET\", initMap, this.accessKeySecret+\"&\")\n\tinitMap.Add(\"Signature\", signature)\n\tfinalUrl := Url + \"?\" + initMap.Encode()\n\tprintln(finalUrl)\n\n\tif rsp, rspErr := http.Get(finalUrl); nil != rspErr {\n\t\treturn rspErr\n\t} else {\n\t\tdefer rsp.Body.Close()\n\n\t\tbody, err := ioutil.ReadAll(rsp.Body)\n\n\t\tif rsp.StatusCode > 400 {\n\t\t\treturn errors.New(string(body))\n\t\t}\n\n\t\tif err != nil {\n\t\t\t// handle error\n\t\t\treturn err\n\t\t}\n\t\t//only print the request id for debuging\n\t\tprintln(string(body))\n\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "99e0e1cd56a6a03a17c247ef1602ffb7", "score": "0.76331675", "text": "func (m *Messenger) SendSMS(to, msg string) error {\n\tif m.twilioClient == nil {\n\t\treturn errors.New(\"Twilio not set up\")\n\t}\n\n\tret, err := m.twilioClient.Messages.SendMessage(m.smsFrom, to, msg, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif ret.ErrorCode != 0 {\n\t\treturn errors.New(ret.ErrorMessage)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "83cc0d20bb3c11e8573af4268370930c", "score": "0.75981456", "text": "func (t TwilioProvider) SendSms(phone string, message string) error {\n\tbody := url.Values{\n\t\t\"To\": {\"+\" + phone}, // twilio api requires \"+\" extension to be included\n\t\t\"Channel\": {\"sms\"},\n\t\t\"From\": {t.Config.MessageServiceSid},\n\t\t\"Body\": {message},\n\t}\n\n\tclient := &http.Client{}\n\tr, err := http.NewRequest(\"POST\", t.APIPath, strings.NewReader(body.Encode()))\n\tif err != nil {\n\t\treturn err\n\t}\n\tr.Header.Add(\"Content-Type\", \"application/x-www-form-urlencoded\")\n\tr.SetBasicAuth(t.Config.AccountSid, t.Config.AuthToken)\n\tres, err := client.Do(r)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif res.StatusCode == http.StatusBadRequest || res.StatusCode == http.StatusForbidden {\n\t\tresp := &twilioErrResponse{}\n\t\tif err := json.NewDecoder(res.Body).Decode(resp); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn resp\n\t}\n\tdefer res.Body.Close()\n\n\t// validate sms status\n\tresp := &SmsStatus{}\n\tderr := json.NewDecoder(res.Body).Decode(resp)\n\tif derr != nil {\n\t\treturn derr\n\t}\n\n\tif resp.Status == \"failed\" || resp.Status == \"undelivered\" {\n\t\treturn fmt.Errorf(\"Twilio error: %v %v\", resp.ErrorMessage, resp.ErrorCode)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "d91d0f4406337d9a54f57c2802cc5ab7", "score": "0.7505617", "text": "func SendSMS(number string, message string) error {\n\t// Twilio credentials\n\tvar accountSID = revel.Config.StringDefault(\"spy.secrets.twilio.sid\", \"\")\n\tvar authToken = revel.Config.StringDefault(\"spy.secrets.twilio.token\", \"\")\n\tvar fromNumber = revel.Config.StringDefault(\"spy.secrets.twilio.number\", \"\")\n\tvar twilioURL = \"https://api.twilio.com/2010-04-01/Accounts/\" + accountSID + \"/Messages.json\"\n\n\trevel.INFO.Printf(\"SENDING %s TO %s\", message, number)\n\n\tvalues := url.Values{}\n\tvalues.Set(\"To\", number)\n\tvalues.Set(\"From\", fromNumber)\n\tvalues.Set(\"Body\", message)\n\n\trb := *strings.NewReader(values.Encode())\n\n\tclient := &http.Client{}\n\n\treq, err := http.NewRequest(\"POST\", twilioURL, &rb)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treq.SetBasicAuth(accountSID, authToken)\n\treq.Header.Add(\"Accept\", \"application/json\")\n\treq.Header.Add(\"Content-Type\", \"application/x-www-form-urlencoded\")\n\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\trevel.INFO.Println(resp.Status[0:3])\n\tif resp.Status[0:3] != \"201\" {\n\t\treturn errors.New(\"Error to try send SMS to \" + number)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "af6e122b10ff8b3467a3d2b4231d401e", "score": "0.7426557", "text": "func (svc ProductionSmsService) SendSms(sms domaintype.Sms) {\n\tsvc.smsBackend.SendSms(sms.Customer.PhoneNumber, sms.Body)\n}", "title": "" }, { "docid": "84841e6f7f2aa68eec27eeb82641db4a", "score": "0.733217", "text": "func (s *SMS) Send(ctx context.Context, msg notification.Message) (*notification.SentMessage, error) {\n\tcfg := config.FromContext(ctx)\n\tif !cfg.Twilio.Enable {\n\t\treturn nil, errors.New(\"Twilio provider is disabled\")\n\t}\n\tif msg.Destination().Type != notification.DestTypeSMS {\n\t\treturn nil, errors.Errorf(\"unsupported destination type %s; expected SMS\", msg.Destination().Type)\n\t}\n\tdestNumber := msg.Destination().Value\n\tif destNumber == cfg.Twilio.FromNumber {\n\t\treturn nil, errors.New(\"refusing to send outgoing SMS to FromNumber\")\n\t}\n\n\tctx = log.WithFields(ctx, log.Fields{\n\t\t\"Phone\": destNumber,\n\t\t\"Type\": \"TwilioSMS\",\n\t})\n\n\tmakeSMSCode := func(alertID int, serviceID string) int {\n\t\tif !hasTwoWaySMSSupport(ctx, destNumber) {\n\t\t\treturn 0\n\t\t}\n\n\t\tcode, err := s.b.insertDB(ctx, destNumber, msg.ID(), alertID, serviceID)\n\t\tif err != nil {\n\t\t\tlog.Log(ctx, errors.Wrap(err, \"insert alert id for SMS callback -- sending 1-way SMS as fallback\"))\n\t\t\treturn 0\n\t\t}\n\n\t\treturn code\n\t}\n\n\tvar message string\n\tvar err error\n\tswitch t := msg.(type) {\n\tcase notification.AlertStatus:\n\t\tmessage, err = renderAlertStatusMessage(cfg.ApplicationName(), t)\n\tcase notification.AlertBundle:\n\t\tvar link string\n\t\tif canContainURL(ctx, destNumber) {\n\t\t\tlink = cfg.CallbackURL(fmt.Sprintf(\"/services/%s/alerts\", t.ServiceID))\n\t\t}\n\n\t\tmessage, err = renderAlertBundleMessage(cfg.ApplicationName(), t, link, makeSMSCode(0, t.ServiceID))\n\tcase notification.Alert:\n\t\tvar link string\n\t\tif canContainURL(ctx, destNumber) {\n\t\t\tlink = cfg.CallbackURL(fmt.Sprintf(\"/alerts/%d\", t.AlertID))\n\t\t}\n\n\t\tmessage, err = renderAlertMessage(cfg.ApplicationName(), t, link, makeSMSCode(t.AlertID, \"\"))\n\tcase notification.Test:\n\t\tmessage = fmt.Sprintf(\"%s: Test message.\", cfg.ApplicationName())\n\tcase notification.Verification:\n\t\tmessage = fmt.Sprintf(\"%s: Verification code: %d\", cfg.ApplicationName(), t.Code)\n\tdefault:\n\t\treturn nil, errors.Errorf(\"unhandled message type %T\", t)\n\t}\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"render message\")\n\t}\n\n\topts := &SMSOptions{\n\t\tValidityPeriod: time.Second * 10,\n\t\tCallbackParams: make(url.Values),\n\t}\n\topts.CallbackParams.Set(msgParamID, msg.ID())\n\t// Actually send notification to end user & receive Message Status\n\tresp, err := s.c.SendSMS(ctx, destNumber, message, opts)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"send message\")\n\t}\n\n\t// If the message was sent successfully, reset reply limits.\n\ts.limit.Reset(destNumber)\n\n\treturn resp.sentMessage(), nil\n}", "title": "" }, { "docid": "075a7f25e68666907c74422c39c55ef2", "score": "0.71370804", "text": "func SendSmsMock(smsNumber string, message string) error {\n\treturn nil\n}", "title": "" }, { "docid": "c4fff7afb154f02a3d9ee0809dabcd42", "score": "0.7112485", "text": "func sendSMS(contentTemplate template.String, contentMap map[string]string, phone string) error {\n\tcontentMap[\"application_name\"] = viper.GetString(\"application_name\")\n\tmessage := contentTemplate.Execute(contentMap)\n\n\tif strings.HasSuffix(os.Args[0], \".test\") {\n\t\tlog.WithFields(log.Fields{\n\t\t\t\"to\": phone,\n\t\t\t\"message\": message,\n\t\t}).Infof(\"skip sending SMS in unit tests\")\n\t\treturn nil\n\t}\n\n\taccountSid := viper.GetString(\"twilio_account_sid\")\n\tauthToken := viper.GetString(\"twilio_auth_token\")\n\n\turlStr := fmt.Sprintf(\"https://api.twilio.com/2010-04-01/Accounts/%s/Messages.json\", accountSid)\n\n\tmsgData := url.Values{}\n\tmsgData.Set(\"MessagingServiceSid\", viper.GetString(\"twilio_service_sid\"))\n\tmsgData.Set(\"To\", phone)\n\tmsgData.Set(\"Body\", message)\n\tmsgDataReader := *strings.NewReader(msgData.Encode())\n\n\tclient := &http.Client{}\n\treq, _ := http.NewRequest(\"POST\", urlStr, &msgDataReader)\n\treq.SetBasicAuth(accountSid, authToken)\n\treq.Header.Add(\"Accept\", \"application/json\")\n\treq.Header.Add(\"Content-Type\", \"application/x-www-form-urlencoded\")\n\n\t_, err := client.Do(req)\n\tif err != nil {\n\t\treturn errors.Wrap(err, errors.ErrorUnknown, \"\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b5cb4d2a201bd4c8f4ee9812c2b6d6a3", "score": "0.710122", "text": "func SendPaySMS(mobile string) error {\n\tdata := url.Values{\"apikey\": {apiKey}, \"mobile\": {mobile},\n\t\t\"tpl_id\": {fmt.Sprintf(\"%d\", payTplID)}}\n\treturn sendData(data)\n}", "title": "" }, { "docid": "d6390f0ffeb333c1126bd5d394f6b191", "score": "0.70993865", "text": "func SendSMS(customer customers.Customer, notification string) {\n\tfmt.Println(\"Please wait while SMS sending...\")\n\ttime.Sleep(2 * time.Second)\n\tfmt.Println(notification + \" successfuly sent to customer with phonenumber: \" + customer.PhoneNumber)\n}", "title": "" }, { "docid": "72d49c8409101358b7d2487c81d0e9a5", "score": "0.70971733", "text": "func (twilio *Twilio) SendSMS(from, to, body, statusCallback, applicationSid string) (*SmsResponse, *Exception, error) {\n\tvar smsResponse *SmsResponse\n\tvar exception *Exception\n\ttwilioUrl := twilio.BaseUrl + \"/Accounts/\" + twilio.AccountSid + \"/Messages.json\"\n\n\tformValues := url.Values{}\n\tformValues.Set(\"From\", from)\n\tformValues.Set(\"To\", to)\n\tformValues.Set(\"Body\", body)\n\tif statusCallback != \"\" {\n\t\tformValues.Set(\"StatusCallback\", statusCallback)\n\t}\n\tif applicationSid != \"\" {\n\t\tformValues.Set(\"ApplicationSid\", applicationSid)\n\t}\n\n\tres, err := twilio.post(formValues, twilioUrl)\n\tif err != nil {\n\t\treturn smsResponse, exception, err\n\t}\n\tdefer res.Body.Close()\n\n\tresponseBody, err := ioutil.ReadAll(res.Body)\n\tif err != nil {\n\t\treturn smsResponse, exception, err\n\t}\n\n\tif res.StatusCode != http.StatusCreated {\n\t\texception = new(Exception)\n\t\terr = json.Unmarshal(responseBody, exception)\n\n\t\t// We aren't checking the error because we don't actually care.\n\t\t// It's going to be passed to the client either way.\n\t\treturn smsResponse, exception, err\n\t}\n\n\tsmsResponse = new(SmsResponse)\n\terr = json.Unmarshal(responseBody, smsResponse)\n\treturn smsResponse, exception, err\n}", "title": "" }, { "docid": "544ff5ef9f4e801647782d9a40569349", "score": "0.7039867", "text": "func sendSms() {\n\n}", "title": "" }, { "docid": "3c51b2ff0450955167efd4b0482bfdb1", "score": "0.7025922", "text": "func (c Client) SendSMS(to string, msg string) (twilioResponse Response, err error) {\n\tif err = c.checkSettings(); err != nil {\n\t\treturn twilioResponse, err\n\t}\n\n\t// Set default request timeout if one hasn't been specified\n\thttpClient := &http.Client{}\n\tif c.Timeout == 0 {\n\t\thttpClient.Timeout = defaultTimeout\n\t}\n\n\t// Set form values\n\tv := url.Values{}\n\tv.Set(\"To\", to)\n\tv.Set(\"From\", c.PhoneNumber)\n\tv.Set(\"Body\", msg)\n\trb := *strings.NewReader(v.Encode())\n\n\t// API url\n\turl := baseURL + c.SID + suffix\n\n\t// Prepare the request\n\treq, err := http.NewRequest(\"POST\", url, &rb)\n\tif err != nil {\n\t\treturn twilioResponse, err\n\t}\n\treq.SetBasicAuth(c.SID, c.AuthToken)\n\treq.Header.Add(\"Accept\", \"application/json\")\n\treq.Header.Add(\"Content-Type\", \"application/x-www-form-urlencoded\")\n\n\t// Fire off the request\n\tres, err := httpClient.Do(req)\n\n\t// Parse response\n\tif err = json.NewDecoder(res.Body).Decode(&twilioResponse); err != nil {\n\t\treturn twilioResponse, err\n\t}\n\n\treturn twilioResponse, twilioResponse.CheckError()\n}", "title": "" }, { "docid": "9eeb6839e7e7e9afbb9f11115e2fec7a", "score": "0.6965368", "text": "func (c *CoreApp) SendSMS(to []string, message string) {\n\n\t//Login if access token is empty\n\tif c.AccessToken == \"\" {\n\t\tc.Login()\n\t}\n\n\t//Check if access token is valid and if not, refresh it\n\tif !c.IsValid() {\n\t\tc.RefreshTokenMethod()\n\t}\n\n\t//data map\n\tdata := make(map[string]interface{})\n\tdata[\"to\"] = to\n\tdata[\"body\"] = message\n\tdata[\"record_source\"] = \"Monitor\"\n\n\t//jsonValue\n\tjsonValue, _ := json.Marshal(data)\n\t//request\n\treq, err := http.NewRequest(\"POST\", c.Host+\"/webservices/custom_function/sendSMS/\", bytes.NewBuffer(jsonValue))\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\t//add headers\n\treq.Header.Add(\"Content-Type\", \"application/json\")\n\treq.Header.Add(\"Accept\", \"application/json\")\n\treq.Header.Add(\"Authorization\", \"Bearer \"+c.AccessToken)\n\treq.Header.Add(\"company\", c.Company)\n\t//client\n\tclient := &http.Client{}\n\t//response\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\t//response body\n\tbody, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\t//response body string\n\tresponse := string(body)\n\tfmt.Println(response)\n}", "title": "" }, { "docid": "98b1334acedec25f11f20dbe00998932", "score": "0.69550633", "text": "func (v *Client) SendActSms(ctx context.Context, r *smsmdl.ModelSend) (msgid string, err error) {\n\tmsg := model.SmsPrefix + r.Content + model.SmsSuffixChuangLan\n\tparams := make(map[string]interface{})\n\tparams[\"account\"] = v.conf.ChuangLanActUser\n\tparams[\"password\"] = v.conf.ChuangLanActPwd\n\tparams[\"phone\"] = r.Mobile\n\tparams[\"msg\"] = url.QueryEscape(msg)\n\tparams[\"report\"] = \"true\"\n\turi := v.conf.ChuangLanActURL\n\tmsgid, err = v.post(ctx, uri, params)\n\treturn\n}", "title": "" }, { "docid": "5bc11db0c22fa1a410ad18f595353dde", "score": "0.694837", "text": "func SendSMS(sms *models.SMS) (bool, string) {\n\tu, err := url.Parse(sms.URLPath)\n\tcheckErr(err, \"Ugly URL\")\n\n\tu.Scheme = sms.Scheme\n\tu.Host = sms.Host\n\tq := u.Query()\n\tq.Set(\"CREDENCIAL\", sms.CredencialKey)\n\tq.Set(\"PRINCIPAL_USER\", sms.Project)\n\tq.Set(\"AUX_USER\", sms.AuxUser)\n\tq.Set(\"MOBILE\", sms.MobileNumber)\n\tq.Set(\"SEND_PROJECT\", sms.SendProject)\n\tq.Set(\"MESSAGE\", sms.Content)\n\tu.RawQuery = q.Encode()\n\n\tres, err := http.Get(u.String())\n\tcheckErr(err, \"SMS Not Sent\")\n\n\trobots, err := ioutil.ReadAll(res.Body)\n\tres.Body.Close()\n\tcheckErr(err, \"No response from SMS Sender\")\n\n\treturn err == nil, string(robots[:])\n}", "title": "" }, { "docid": "832d2b873cbad154867d2f7b56e3806b", "score": "0.69362956", "text": "func (c *SMS) Send(from, to, text string) (*SMSReceipt, error) {\n\tvar resp Response\n\n\tparams := internal.NewParameters()\n\tparams.Add(\"from\", from)\n\tparams.Add(\"to\", to)\n\tparams.Add(\"text\", text)\n\n\terr := c.client.post(\"/v1/sms/send\", params, &resp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresult := &SMSReceipt{}\n\terr = internal.FromMap(resp.Data, result)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn result, nil\n}", "title": "" }, { "docid": "f004b2ea5e873e655118b5403ec41f8a", "score": "0.68966275", "text": "func sendSMS(event *types.Event) error {\n\n\t//Set up our message we want to send\n\tmessage := \"Sensu alert for \" + event.Check.Name + \" on \" + event.Entity.Name + \". Check output: \" + event.Check.Output\n\n\t//Set up a plivo client with our accountSid & authToken\n\tclient, err := plivo.NewClient(accountSid, authToken, &plivo.ClientOptions{})\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t//Send our message to our recipient\n\tclient.Messages.Create(plivo.MessageCreateParams{\n\t\tSrc: fromNumber,\n\t\tDst: recipient,\n\t\tText: message,\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "4c56f0faabf24b3ad1dc72babe245389", "score": "0.6818269", "text": "func (bd BaiduSMS) SendSMSCode(\n\tmobile []string,\n\ttemplate string,\n\tsignatureID string,\n\tcontentVar map[string]string,\n) (*SuccessResponse, error) {\n\tpath := \"/api/v3/sendSms\"\n\tbody := requestBody{signatureID, strings.Join(mobile, \",\"), template, contentVar}\n\tbodyStr, err := json.Marshal(body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bd.sendRequest(\"POST\", path, string(bodyStr))\n}", "title": "" }, { "docid": "b393736fea8d19fa6001efa6dfc5864f", "score": "0.6766749", "text": "func (c *client) Send(mobile string, length int) error {\n\n\tswitch c.SMSProvider {\n\tcase \"dingxin\":\n\t\tcode := utils.GetCode(length)\n\t\turl := fmt.Sprintf(\"http://dingxin.market.alicloudapi.com/dx/sendSms?mobile=%s&param=code:%s&tpl_id=%s\", mobile, code, c.TemplateCode)\n\n\t\tclient := &http.Client{}\n\n\t\treq, err := http.NewRequest(\"POST\", url, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\treq.Header.Add(\"Authorization\", \"APPCODE\"+\" \"+c.AppCode)\n\t\tresp, _ := client.Do(req)\n\t\tb, _ := ioutil.ReadAll(resp.Body)\n\t\tfmt.Printf(\"response is %v\\n\", string(b))\n\n\t\treturn nil\n\tcase \"tianyan\":\n\t\tcode := utils.GetCode(length)\n\t\turl := fmt.Sprintf(\"https://smssend.shumaidata.com/sms/send?receive=%s&tag=%s&templateId=%s\", mobile, code, c.TemplateCode)\n\n\t\tclient := &http.Client{}\n\n\t\treq, err := http.NewRequest(\"POST\", url, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\treq.Header.Add(\"Authorization\", \"APPCODE\"+\" \"+c.AppCode)\n\t\tresp, _ := client.Do(req)\n\t\tb, _ := ioutil.ReadAll(resp.Body)\n\t\tfmt.Printf(\"response is %v\\n\", string(b))\n\n\t\treturn nil\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "61a374f82f8fa208c65f9c8db26cfb93", "score": "0.67487353", "text": "func (s *SMS77) SendSMS(text string) error {\n\turl := fmt.Sprintf(\"https://gateway.sms77.io/api/sms?%s\", createURLValues(s, text).Encode())\n\trequest, err := http.NewRequest(\"GET\", url, nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// https://www.sms77.io/en/docs/gateway/http-api/general/\n\trequest.Header.Add(\"Authorization\", fmt.Sprintf(\"basic %s\", s.Config.APIKey))\n\n\tresponse, err := s.Client.Do(request)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Checking HTTP status code\n\tlog.Info(\"http status code is \", response.StatusCode)\n\tif response.StatusCode != 200 {\n\t\treturn errors.New(\"sms77 returned non-200 status code\")\n\t}\n\n\tlog.Debug(requestHeaders(request))\n\tlog.Debug(responseHeaders(response))\n\n\tbody, err := ioutil.ReadAll(response.Body)\n\tdefer response.Body.Close()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tlog.Debug(\"Response body\", string(body))\n\n\tresult := parseResponseBody(body)\n\tlog.Debug(result)\n\n\t// Checking SMS77 status code\n\t// https://www.sms77.io/en/docs/gateway/http-api/sms-disptach\n\tif result.Success == \"100\" || result.Success == \"102\" {\n\t\treturn nil\n\t}\n\n\tlog.Error(\"sms77 returned status code \", result.Success)\n\treturn errors.New(\"sms77 returned unsuccessfully\")\n}", "title": "" }, { "docid": "db88d377f22881acd35b6d2b0ad70a6a", "score": "0.669336", "text": "func (c *FreeMobile) Send(message sachet.Message) error {\n\tparams := payload{\n\t\tUser: c.Username,\n\t\tPass: c.Password,\n\t\tMessage: message.Text,\n\t}\n\n\tdata, err := json.Marshal(params)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\trequest, err := http.NewRequest(\"POST\", c.URL, bytes.NewBuffer(data))\n\tif err != nil {\n\t\treturn err\n\t}\n\trequest.Header.Set(\"Content-Type\", \"application/json\")\n\trequest.Header.Set(\"User-Agent\", \"Sachet\")\n\n\tresponse, err := freemobileHTTPClient.Do(request)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer response.Body.Close()\n\n\tif response.StatusCode == http.StatusOK && err == nil {\n\t\treturn nil\n\t}\n\n\treturn fmt.Errorf(\"Failed sending sms. statusCode: %d\", response.StatusCode)\n}", "title": "" }, { "docid": "bdc63a4cfac8f6401e34ea0be26bd5f6", "score": "0.6500131", "text": "func SendReserveSMS(mobile, verifycode, stime string) error {\n\treturn SendYPSMS(mobile, verifycode, stime, tplID)\n}", "title": "" }, { "docid": "09d8e200dacff1028e9e656056caf32b", "score": "0.64518857", "text": "func SendSMSHandler(c *gin.Context) {\n\tvar data sms\n\tc.BindJSON(&data)\n\tisOK, message, errID := utils.SendQCSMS(data.Phone, data.Template, data.ParamList)\n\n\tif isOK {\n\t\tc.JSON(http.StatusOK, gin.H{\"code\": http.StatusOK, \"message\": \"OK\"})\n\t\treturn\n\t}\n\n\tc.JSON(http.StatusBadRequest, gin.H{\"code\": http.StatusBadRequest, \"message\": message, \"error_id\": errID})\n\n}", "title": "" }, { "docid": "28e87af8b6e21e43fef3f39e48f64d00", "score": "0.6416636", "text": "func (a smsAlert) Send(m *Message, s SenderProvider) error {\n\tvar err error\n\terrs := make([]string, 0, len(a.To))\n\tfor _, to := range a.To {\n\t\tsender := s.GetSMSSender(to + \"#\" + m.String())\n\t\tif sender == nil {\n\t\t\tcontinue\n\t\t}\n\t\tif err = sender.Send(to, m.String()); err != nil {\n\t\t\terrs = append(errs, err.Error())\n\t\t}\n\t}\n\tif len(errs) == 0 {\n\t\treturn nil\n\t}\n\treturn errors.New(strings.Join(errs, \"\\n\"))\n}", "title": "" }, { "docid": "3fe84a4aa9350f7f98432c7eb28d3dbf", "score": "0.63587797", "text": "func SendHealthSMS(mobile, verifycode string) error {\n\ttplValue := url.Values{\"#code#\": {verifycode}}.Encode()\n\tdata := url.Values{\"apikey\": {apiKey}, \"mobile\": {mobile},\n\t\t\"tpl_id\": {fmt.Sprintf(\"%d\", healthTplID)}, \"tpl_value\": {tplValue}}\n\treturn sendData(data)\n}", "title": "" }, { "docid": "c8395051a98c4598ebda907384fa1950", "score": "0.6356699", "text": "func (s *Service) Send(ctx context.Context, subject, message string) error {\n\ttext := subject + \"\\n\" + message\n\n\tvar dst string\n\tswitch len(s.destinations) {\n\tcase 0:\n\t\treturn fmt.Errorf(\"no receivers added\")\n\tcase 1:\n\t\tdst = s.destinations[0]\n\tdefault:\n\t\t// multiple destinations, use bulk message syntax\n\t\t// see: https://www.plivo.com/docs/sms/api/message#bulk-messaging\n\t\tdst = strings.Join(s.destinations, \"<\")\n\t}\n\n\tvar err error\n\tselect {\n\tcase <-ctx.Done():\n\t\treturn ctx.Err()\n\tdefault:\n\t\t_, err = s.client.Create(plivo.MessageCreateParams{\n\t\t\tDst: dst,\n\t\t\tText: text,\n\t\t\tSrc: s.mopts.Source,\n\t\t\tURL: s.mopts.CallbackURL,\n\t\t\tMethod: s.mopts.CallbackMethod,\n\t\t})\n\t}\n\n\treturn err\n}", "title": "" }, { "docid": "20f0bd1b56a629aa6f50406fb7b9d0f2", "score": "0.6166399", "text": "func (s *server) SendCustomerSMS(ctx context.Context, w http.ResponseWriter, r *http.Request, log *logging.Client) Response {\n\tvar err error\n\treq := new(pb.SendCustomerSMSReq)\n\n\t// decode request\n\terr = decodeRequest(ctx, r, req)\n\tif err != nil {\n\t\treturn failedToDecode(err)\n\t}\n\t// end decode request\n\n\ttasksC := tasks.New(ctx)\n\tvar errs []error\n\tfor _, v := range req.Emails {\n\t\tparams := &tasks.SendSMSParam{\n\t\t\tMessage: req.Message,\n\t\t}\n\t\tif strings.Contains(v, \"@\") {\n\t\t\tparams.Email = v\n\t\t} else if strings.Contains(v, \"-\") {\n\t\t\tparams.Number = v\n\t\t} else {\n\t\t\tparams.Email = v\n\t\t}\n\t\terr = tasksC.AddSendSMS(params, time.Now())\n\t\tif err != nil {\n\t\t\terrs = append(errs, errors.Annotate(err, \"failed to message.SendSMS To(\"+v+\")\"))\n\t\t\tcontinue\n\t\t}\n\t}\n\tif len(errs) >= 1 {\n\t\treturn errors.GetErrorWithCode(errs[0]).Annotatef(\"errors count: %d\", len(errs))\n\t}\n\tresp := &pb.ErrorOnlyResp{}\n\treturn resp\n}", "title": "" }, { "docid": "b2d486f38e44e2eba52f11b742542f34", "score": "0.61006576", "text": "func (o *SendSMSParams) WithTimeout(timeout time.Duration) *SendSMSParams {\n\to.SetTimeout(timeout)\n\treturn o\n}", "title": "" }, { "docid": "d11c54aa69c3015af588112bd3bf0aaf", "score": "0.60629344", "text": "func Send(numberTo string, numberFrom string, msgBody string) error {\n\tfmt.Println(\"Begginning to send twilio msg...\")\n\tfmt.Println(\"Sending to: \", numberTo)\n\tmsgData := url.Values{}\n\tmsgData.Set(\"To\", numberTo)\n\tmsgData.Set(\"From\", numberFrom)\n\tmsgData.Set(\"Body\", msgBody)\n\tmsgDataReader := *strings.NewReader(msgData.Encode())\n\n\t// Create HTTP request client\n\tclient := &http.Client{}\n\treq, err := http.NewRequest(\"POST\", twilURLString, &msgDataReader)\n\n\tif err != nil {\n\t\tfmt.Println(\"Error creating twilio request: \", err)\n\t}\n\n\treq.SetBasicAuth(accountSid, authToken)\n\treq.Header.Add(\"Accept\", \"application/json\")\n\treq.Header.Add(\"Content-Type\", \"application/x-www-form-urlencoded\")\n\n\t// Make HTTP POST request and return message SID\n\tresp, err := client.Do(req)\n\tif err == nil {\n\t\tif resp.StatusCode >= 200 && resp.StatusCode < 300 {\n\t\t\tvar data map[string]interface{}\n\t\t\tdecoder := json.NewDecoder(resp.Body)\n\t\t\terr := decoder.Decode(&data)\n\t\t\tif err == nil {\n\t\t\t\tfmt.Println(data[\"sid\"])\n\t\t\t}\n\t\t} else {\n\t\t\tfmt.Println(resp.Status)\n\t\t}\n\t} else {\n\t\tfmt.Println(\"Error getting twilio response: \", err)\n\t}\n\treturn nil;\n}", "title": "" }, { "docid": "8a3aeb8a40a779e5d7ad83b0f1ab3062", "score": "0.6045915", "text": "func (c *MediaBurst) Send(message sachet.Message) (err error) {\n\tsmsURL := \"https://api.clockworksms.com/http/send.aspx\"\n\tvar request *http.Request\n\tvar resp *http.Response\n\n\tform := url.Values{\"Key\": {c.APIKey}, \"From\": {message.From}, \"Content\": {message.Text}, \"To\": message.To}\n\n\t// preparing the request.\n\trequest, err = http.NewRequest(\"GET\", smsURL, strings.NewReader(form.Encode()))\n\tif err != nil {\n\t\treturn\n\t}\n\n\trequest.Header.Set(\"Content-Type\", \"application/x-www-form-urlencoded\")\n\trequest.Header.Set(\"User-Agent\", \"SachetV1.0\")\n\t// calling the endpoint.\n\thttpClient := &http.Client{}\n\thttpClient.Timeout = MediaBurstRequestTimeout\n\n\tresp, err = httpClient.Do(request)\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer resp.Body.Close()\n\tvar body []byte\n\t_, err = resp.Body.Read(body)\n\tif err != nil {\n\t\treturn\n\t}\n\tif resp.StatusCode == http.StatusOK && err == nil {\n\t\treturn\n\t}\n\treturn fmt.Errorf(\"Failed sending sms:Reason: %s , StatusCode : %d\", string(body), resp.StatusCode)\n}", "title": "" }, { "docid": "f989414bb59eb1fb05dfbff368670e61", "score": "0.6033831", "text": "func (c *Client) SendEcoSMS(to, body string) error {\n\tendpointURL := getURL(sendSMSAction)\n\tv := c.getBasicValuesForRequest()\n\tv.Add(\"to\", to)\n\tv.Add(\"message\", body)\n\tv.Add(\"from\", ecoSMS)\n\n\tres, err := http.PostForm(endpointURL, v)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tresInString, err := getResponseBodyAsString(res)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif strings.Contains(resInString, \"ERROR\") {\n\t\treturn fmt.Errorf(\"API returns error: %s\", resInString)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "fce0aa230797a26fc8389bc733116409", "score": "0.5974558", "text": "func send(to, body string) {\n\t// load in secret env vars from file in development\n\tif os.Getenv(\"ENV\") == \"dev\" {\n\t\terr := godotenv.Load(\".env.dev\")\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t}\n\t}\n\n\t// attempt to cast env variables into envConfig struct\n\tvar cfg envConfig\n\terr := envconfig.Process(\"\", &cfg)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// API URL endpoint\n\turlStr := \"https://api.twilio.com/2010-04-01/Accounts/\" + cfg.TwilioSID + \"/Messages.json\"\n\n\t// build message\n\tmsgData := url.Values{}\n\tmsgData.Set(\"To\", to)\n\tmsgData.Set(\"From\", cfg.FromPhone)\n\tmsgData.Set(\"Body\", body)\n\tmsgDataReader := *strings.NewReader(msgData.Encode())\n\n\t// create HTTP request client\n\tclient := &http.Client{}\n\treq, _ := http.NewRequest(\"POST\", urlStr, &msgDataReader)\n\treq.SetBasicAuth(cfg.TwilioSID, cfg.TwilioAuth)\n\treq.Header.Add(\"Accept\", \"application/json\")\n\treq.Header.Add(\"Content-Type\", \"application/x-www-form-urlencoded\")\n\n\t// make HTTP POST request\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\tif resp.StatusCode >= 200 && resp.StatusCode < 300 {\n\t\tvar data map[string]interface{}\n\t\tdecoder := json.NewDecoder(resp.Body)\n\t\terr := decoder.Decode(&data)\n\t\tif err == nil {\n\t\t\tfmt.Println(\"Successfully sent Twilio SMS\")\n\t\t} else {\n\t\t\tfmt.Printf(\"Error sending Twilio SMS %v\\n\", resp.Status)\n\t\t}\n\t} else {\n\t\tfmt.Printf(\"Error sending Twilio SMS %v\\n\", resp.Status)\n\t}\n}", "title": "" }, { "docid": "944d2415f643a370309a1c56b4dc3a7f", "score": "0.59572524", "text": "func (s *sfr) Notify(msg string) error {\n\t// Prepare the URL\n\tvar reqURL *url.URL\n\treqURL, err := url.Parse(s.url)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error while parsing the URL : %s\", err)\n\t}\n\treqURL.Path += \"/red-ws/red-b2c/resources/sms/send\"\n\tparameters := url.Values{}\n\tparameters.Add(\"responseType\", \"json\")\n\tparameters.Add(\"token\", s.token)\n\tparameters.Add(\"to\", s.to)\n\tparameters.Add(\"type\", \"PhoneNumber\")\n\tparameters.Add(\"msg\", msg)\n\treqURL.RawQuery = parameters.Encode()\n\n\t// Create the request\n\treq, err := http.NewRequest(\"GET\", reqURL.String(), nil)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error while creating the request : %s\", err)\n\t}\n\n\t// Do the request\n\tresp, err := s.client.Do(req)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error while doing the request : %s\", err)\n\t}\n\tdefer resp.Body.Close()\n\n\t// Check the status code\n\tif resp.StatusCode != 200 {\n\t\treturn fmt.Errorf(\"Error while sending the SMS. Status code is %d\", resp.StatusCode)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "ae4c1420d4c7a5b48cd7d71fd08714ec", "score": "0.5946403", "text": "func (c *Infobip) Send(message sachet.Message) (err error) {\n\tsmsURL := \"https://api.infobip.com/sms/1/text/single\"\n\t//smsURL = \"http://requestb.in/pwf2ufpw\"\n\tvar request *http.Request\n\tvar resp *http.Response\n\n\tdataMap := map[string]string{\"from\": message.From, \"to\": message.To[0], \"text\": message.Text}\n\tdata, _ := json.Marshal(dataMap)\n\t//preparing the request\n\trequest, err = http.NewRequest(\"POST\", smsURL, bytes.NewBuffer(data))\n\tif err != nil {\n\t\treturn\n\t}\n\n\trequest.SetBasicAuth(c.Token, c.Secret)\n\trequest.Header.Set(\"Content-Type\", \"application/json\")\n\trequest.Header.Set(\"User-Agent\", \"SachetV1.0\")\n\t//calling the endpoint\n\thttpClient := &http.Client{}\n\thttpClient.Timeout = InfobipRequestTimeout\n\n\tresp, err = httpClient.Do(request)\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer resp.Body.Close()\n\tvar body []byte\n\tresp.Body.Read(body)\n\tif resp.StatusCode == http.StatusOK && err == nil {\n\t\treturn\n\t}\n\treturn fmt.Errorf(\"Failed sending sms:Reason: %s , StatusCode : %d\", string(body), resp.StatusCode)\n}", "title": "" }, { "docid": "ac9f3a8904ba551dc7d35cf4820c4f4b", "score": "0.59169257", "text": "func (o *SendSMSParams) WithHTTPClient(client *http.Client) *SendSMSParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "2ea18050ba10836e81db329aef426c5b", "score": "0.5903613", "text": "func (b *Bot) Send(s string) {\n\tb.Connection.QueueMessage(s)\n}", "title": "" }, { "docid": "c3fb9871464e48753dd9e5eb9510c1ab", "score": "0.5887078", "text": "func (provider UserTwilioServiceProvider) Send(to string, message string) error {\n\tfrom := provider.From\n\tif !strings.HasPrefix(from, \"+\") { from = \"+\" + from }\n\tif !strings.HasPrefix(to, \"+\") { to = \"+\" + to }\n\n\tv := url.Values{}\n\tv.Set(\"To\", to)\n\tv.Set(\"From\", from)\n\tv.Set(\"Body\", message)\n\tvReader := *strings.NewReader(v.Encode())\n\n\treq, _ := http.NewRequest(\"POST\", URL_BASE + provider.Account + URL_MESSAGES, &vReader)\n\treq.SetBasicAuth(provider.Account, provider.Token)\n\treq.Header.Add(\"Content-Type\", HEADER_CONTENT_TYPE)\n\treq.Header.Add(\"Accept\", HEADER_ACCEPT)\n\n\tres, _ := client.Do(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer res.Body.Close()\n\tif (res.StatusCode >= 200 && res.StatusCode < 300) {\n\t\tdecoder := json.NewDecoder(res.Body)\n\t\terr := decoder.Decode(&map[string]interface{}{})\n\n\t\tif (err == nil) {\n\t\t\treturn nil\n\t\t} else {\n\t\t\treturn err // experimental\n\t\t}\n\n\t} else {\n\t\treturn errors.New(res.Status) // experimental\n\t}\n}", "title": "" }, { "docid": "85f964234f712ba3725947e4aeffbff9", "score": "0.5848603", "text": "func (v *Client) SendInternationalSms(ctx context.Context, r *smsmdl.ModelSend) (msgid string, err error) {\n\tmsg := model.SmsPrefix + r.Content\n\tparams := make(map[string]interface{})\n\tparams[\"account\"] = v.conf.ChuangLanInternationUser\n\tparams[\"password\"] = v.conf.ChuangLanInternationPwd\n\tparams[\"mobile\"] = r.Country + r.Mobile\n\tparams[\"msg\"] = msg\n\turi := v.conf.ChuangLanInternationURL\n\tbytesData, err := json.Marshal(params)\n\tif err != nil {\n\t\tlog.Error(\"ChuangLan send international Marshal error(%v)\", err)\n\t\treturn\n\t}\n\treader := bytes.NewReader(bytesData)\n\trequest, err := http.NewRequest(http.MethodPost, uri, reader)\n\tif err != nil {\n\t\tlog.Error(\"ChuangLan send international NewRequest err(%v)\", err)\n\t\treturn\n\t}\n\trequest.Header.Set(\"Content-Type\", \"application/json;charset=UTF-8\")\n\ttype internation struct {\n\t\tCode string `json:\"code\"`\n\t\tMsgid string `json:\"msgid\"`\n\t\tError string `json:\"error\"`\n\t}\n\tres := &internation{}\n\tif err = v.client.Do(ctx, request, res); err != nil {\n\t\tlog.Error(\"ChuangLan send international client.Do err(%v)\", err)\n\t\treturn\n\t}\n\tif res.Code != \"0\" {\n\t\terr = fmt.Errorf(\"ChuangLan send international sms code(%v) err(%v)\", res.Code, res.Error)\n\t\treturn\n\t}\n\tmsgid = res.Msgid\n\treturn\n}", "title": "" }, { "docid": "bd7ff5b8156c94f0f4bab6a3cc4f3695", "score": "0.58350486", "text": "func Send(logger *zap.Logger, sender Sender, formatter Formatter) http.HandlerFunc {\n\treturn func(w http.ResponseWriter, r *http.Request) {\n\n\t\tctx := r.Context()\n\t\tenc := json.NewEncoder(w)\n\t\tw.Header().Set(\"Content-Type\", \"application/json; charset=UTF-8\")\n\n\t\tvar m Message\n\t\tif err := json.NewDecoder(r.Body).Decode(&m); err != nil {\n\t\t\tlogger.Warn(\"Unable to parse JSON from request body\", zap.Error(err))\n\t\t\tw.WriteHeader(http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\n\t\tif err := validate(m); err != nil {\n\t\t\tresponseBadRequest(w, enc, err.Error())\n\t\t\treturn\n\t\t}\n\n\t\tnumber, valid, err := formatter.Format(ctx, m.PhoneNumber)\n\t\tif err != nil {\n\t\t\tlogger.Error(\"Unable to validate number\", zap.Error(err))\n\t\t\tserverError(w, enc, \"unable to validate number\")\n\t\t\treturn\n\t\t}\n\t\tif !valid {\n\t\t\tresponseBadRequest(w, enc, \"invalid phone number\")\n\t\t\treturn\n\t\t}\n\n\t\tvar status []string\n\t\tfor _, text := range m.Texts {\n\t\t\tif len(text) == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\terr := sender.Send(ctx, number, text)\n\t\t\tif err != nil {\n\t\t\t\tstatus = append(status, \"failed\")\n\t\t\t\tlogger.Error(\"Unable to send sms\", zap.String(\"text\", text), zap.Error(err))\n\t\t\t} else {\n\t\t\t\tstatus = append(status, \"success\")\n\t\t\t}\n\t\t}\n\t\tresponseOK(w, enc, status)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "640b2645952a521173c8294e6f922271", "score": "0.57641286", "text": "func (this *Smsprocess) SendP2PSMs(content string, receiverID int) (err error) {\n\tvar mes message.Message\n\tmes.Type = message.SmsMesP2PType\n\n\tvar smsMesP2P message.SmsMesP2P\n\tsmsMesP2P.Content = content\n\tsmsMesP2P.ReceiverId = receiverID\n\tsmsMesP2P.SenderId = curUser.UserId\n\n\tdata, err := json.Marshal(smsMesP2P)\n\tif err != nil {\n\t\tfmt.Println(\"smsMes from SendP2PSms failed\", err)\n\t\treturn\n\t}\n\n\tmes.Data = string(data)\n\n\tdata, err = json.Marshal(mes)\n\tif err != nil {\n\t\tfmt.Println(\"mes marshal failed from SendP2PSms\", err)\n\t\treturn\n\t}\n\n\ttf := utils.Transfer{\n\t\tConn: curUser.Conn,\n\t}\n\n\terr = tf.WritePKG(data)\n\tif err != nil {\n\t\tfmt.Println(\"write data failed from SendP2PSms\", err)\n\t\treturn\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "5ef53faa24cb700ee5569b613507b81f", "score": "0.5755907", "text": "func (s *SMS) SendCodeToUser(w http.ResponseWriter, r *http.Request, pid, number string) error {\n\tcode, err := generateRandomCode()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlogger := s.RequestLogger(r)\n\n\tif len(number) == 0 {\n\t\treturn errBadPhoneNumber\n\t}\n\n\tlastStr, ok := authboss.GetSession(r, SessionSMSLast)\n\tsuppress := false\n\tif ok {\n\t\tlast, err := strconv.ParseInt(lastStr, 10, 64)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tsuppress = time.Now().UTC().Unix()-last < smsRateLimitSeconds\n\t}\n\n\tif suppress {\n\t\tlogger.Infof(\"rate-limited sms for %s to %s\", pid, number)\n\t\treturn errSMSRateLimit\n\t}\n\n\tauthboss.PutSession(w, SessionSMSLast, strconv.FormatInt(time.Now().UTC().Unix(), 10))\n\tauthboss.PutSession(w, SessionSMSSecret, code)\n\n\tlogger.Infof(\"sending sms for %s to %s\", pid, number)\n\tif err := s.Sender.Send(r.Context(), number, code); err != nil {\n\t\tlogger.Infof(\"failed to send sms for %s to %s: %+v\", pid, number, err)\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "f82b1de7f01d9895a845dfcd15a1e654", "score": "0.5745283", "text": "func (s *Ws) Send(clientID int, msg string) {\n\ts.send <- &tx{ClientID: clientID, Msg: []byte(msg)}\n}", "title": "" }, { "docid": "d0b7638dd9d9938fa6c2c76c4c044454", "score": "0.5683274", "text": "func (a *SMSApiService) SmsSendPost(ctx context.Context, smsMessages SmsMessageCollection) (string, *http.Response, error) {\n\tvar (\n\t\tlocalVarHttpMethod = strings.ToUpper(\"Post\")\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarFileName string\n\t\tlocalVarFileBytes []byte\n\t\tlocalVarReturnValue string\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/sms/send\"\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := url.Values{}\n\tlocalVarFormParams := url.Values{}\n\n\t// to determine the Content-Type header\n\tlocalVarHttpContentTypes := []string{\"application/json\"}\n\n\t// set Content-Type header\n\tlocalVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)\n\tif localVarHttpContentType != \"\" {\n\t\tlocalVarHeaderParams[\"Content-Type\"] = localVarHttpContentType\n\t}\n\n\t// to determine the Accept header\n\tlocalVarHttpHeaderAccepts := []string{\"application/json\"}\n\n\t// set Accept header\n\tlocalVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)\n\tif localVarHttpHeaderAccept != \"\" {\n\t\tlocalVarHeaderParams[\"Accept\"] = localVarHttpHeaderAccept\n\t}\n\t// body params\n\tlocalVarPostBody = &smsMessages\n\tr, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, err\n\t}\n\n\tlocalVarHttpResponse, err := a.client.callAPI(r)\n\tif err != nil || localVarHttpResponse == nil {\n\t\treturn localVarReturnValue, localVarHttpResponse, err\n\t}\n\n\tlocalVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)\n\tlocalVarHttpResponse.Body.Close()\n\tif err != nil {\n\t\treturn localVarReturnValue, localVarHttpResponse, err\n\t}\n\n\tif localVarHttpResponse.StatusCode < 300 {\n\t\t// If we succeed, return the data, otherwise pass on to decode error.\n\t\terr = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get(\"Content-Type\"));\n\t\treturn localVarReturnValue, localVarHttpResponse, err\n\t}\n\n\tif localVarHttpResponse.StatusCode >= 300 {\n\t\tnewErr := GenericSwaggerError{\n\t\t\tbody: localVarBody,\n\t\t\terror: localVarHttpResponse.Status,\n\t\t}\n\t\t\n\t\tif localVarHttpResponse.StatusCode == 200 {\n\t\t\tvar v string\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get(\"Content-Type\"));\n\t\t\t\tif err != nil {\n\t\t\t\t\tnewErr.error = err.Error()\n\t\t\t\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t\t\t\t}\n\t\t\t\tnewErr.model = v\n\t\t\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t\t}\n\t\t\n\t\tif localVarHttpResponse.StatusCode == 400 {\n\t\t\tvar v string\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get(\"Content-Type\"));\n\t\t\t\tif err != nil {\n\t\t\t\t\tnewErr.error = err.Error()\n\t\t\t\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t\t\t\t}\n\t\t\t\tnewErr.model = v\n\t\t\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t\t}\n\t\t\n\t\tif localVarHttpResponse.StatusCode == 401 {\n\t\t\tvar v string\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get(\"Content-Type\"));\n\t\t\t\tif err != nil {\n\t\t\t\t\tnewErr.error = err.Error()\n\t\t\t\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t\t\t\t}\n\t\t\t\tnewErr.model = v\n\t\t\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t\t}\n\t\t\n\t\tif localVarHttpResponse.StatusCode == 403 {\n\t\t\tvar v string\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get(\"Content-Type\"));\n\t\t\t\tif err != nil {\n\t\t\t\t\tnewErr.error = err.Error()\n\t\t\t\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t\t\t\t}\n\t\t\t\tnewErr.model = v\n\t\t\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t\t}\n\t\t\n\t\tif localVarHttpResponse.StatusCode == 404 {\n\t\t\tvar v string\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get(\"Content-Type\"));\n\t\t\t\tif err != nil {\n\t\t\t\t\tnewErr.error = err.Error()\n\t\t\t\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t\t\t\t}\n\t\t\t\tnewErr.model = v\n\t\t\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t\t}\n\t\t\n\t\tif localVarHttpResponse.StatusCode == 405 {\n\t\t\tvar v string\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get(\"Content-Type\"));\n\t\t\t\tif err != nil {\n\t\t\t\t\tnewErr.error = err.Error()\n\t\t\t\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t\t\t\t}\n\t\t\t\tnewErr.model = v\n\t\t\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t\t}\n\t\t\n\t\tif localVarHttpResponse.StatusCode == 429 {\n\t\t\tvar v string\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get(\"Content-Type\"));\n\t\t\t\tif err != nil {\n\t\t\t\t\tnewErr.error = err.Error()\n\t\t\t\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t\t\t\t}\n\t\t\t\tnewErr.model = v\n\t\t\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t\t}\n\t\t\n\t\tif localVarHttpResponse.StatusCode == 0 {\n\t\t\tvar v string\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get(\"Content-Type\"));\n\t\t\t\tif err != nil {\n\t\t\t\t\tnewErr.error = err.Error()\n\t\t\t\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t\t\t\t}\n\t\t\t\tnewErr.model = v\n\t\t\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t\t}\n\t\t\n\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t}\n\n\treturn localVarReturnValue, localVarHttpResponse, nil\n}", "title": "" }, { "docid": "7478c10bc6952f67a80bb5fdd788bdd6", "score": "0.5671888", "text": "func (d *Dao) Send(c context.Context, mc, title, msg string, mids []int64, ts int64) (err error) {\n\tparams := url.Values{}\n\tsource := strings.Split(mc, \"_\")\n\tparams.Set(\"type\", \"json\")\n\tparams.Set(\"source\", source[0])\n\tparams.Set(\"data_type\", \"4\")\n\tparams.Set(\"mc\", mc)\n\tparams.Set(\"title\", title)\n\tparams.Set(\"context\", msg)\n\tvar midList string\n\tfor _, mid := range mids {\n\t\tmidList += strconv.FormatInt(mid, 10)\n\t\tmidList += \",\"\n\t}\n\tmidList = strings.TrimSuffix(midList, \",\")\n\tparams.Set(\"mid_list\", midList)\n\tvar res struct {\n\t\tCode int `json:\"code\"`\n\t}\n\tlog.Info(\"params:%v\", params)\n\tif err = d.client.Post(c, d.uri, \"\", params, &res); err != nil {\n\t\tlog.Error(\"growup-admin message url(%s) error(%v)\", d.uri+\"?\"+params.Encode(), err)\n\t\treturn\n\t}\n\tlog.Info(\"message res code:%d\", res.Code)\n\tif res.Code != 0 {\n\t\tlog.Error(\"growup-admin message url(%s) error(%v)\", d.uri+\"?\"+params.Encode(), err)\n\t\terr = fmt.Errorf(\"message send failed\")\n\t}\n\treturn\n}", "title": "" }, { "docid": "ef113e374f7f30a0daf75d537dfcbe13", "score": "0.56711024", "text": "func (o *SendSMSParams) WithContext(ctx context.Context) *SendSMSParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "bab8be7a0d609e49f5aab3cbabec6cbe", "score": "0.56663156", "text": "func NewSendSMSParams() *SendSMSParams {\n\tvar ()\n\treturn &SendSMSParams{\n\n\t\ttimeout: cr.DefaultTimeout,\n\t}\n}", "title": "" }, { "docid": "840d0daf287ae9cf686b366bfcb9272d", "score": "0.5647897", "text": "func (c *Infobip) Send(message sachet.Message) (err error) {\n\tsmsURL := \"https://api.infobip.com/sms/2/text/advanced\"\n\t// smsURL = \"http://requestb.in/pwf2ufpw\"\n\tvar request *http.Request\n\tvar resp *http.Response\n\n\tpayload := InfobipPayload{}\n\tpayload.Messages = append(payload.Messages, InfobipMessage{})\n\tpayload.Messages[0].From = message.From\n\tpayload.Messages[0].Text = message.Text\n\n\tfor _, destination := range message.To {\n\t\tpayload.Messages[0].Destinations = append(\n\t\t\tpayload.Messages[0].Destinations,\n\t\t\tInfobipDestination{\n\t\t\t\tTo: destination,\n\t\t\t},\n\t\t)\n\t}\n\n\tdata, err := json.Marshal(payload)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// preparing the request.\n\trequest, err = http.NewRequest(\"POST\", smsURL, bytes.NewBuffer(data))\n\tif err != nil {\n\t\treturn\n\t}\n\n\trequest.SetBasicAuth(c.Token, c.Secret)\n\trequest.Header.Set(\"Content-Type\", \"application/json\")\n\trequest.Header.Set(\"User-Agent\", \"SachetV1.0\")\n\t// calling the endpoint.\n\thttpClient := &http.Client{}\n\thttpClient.Timeout = InfobipRequestTimeout\n\n\tresp, err = httpClient.Do(request)\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer resp.Body.Close()\n\tvar body []byte\n\t_, err = resp.Body.Read(body)\n\tif err != nil {\n\t\treturn\n\t}\n\tif resp.StatusCode == http.StatusOK && err == nil {\n\t\treturn\n\t}\n\treturn fmt.Errorf(\"Failed sending sms:Reason: %s , StatusCode : %d\", string(body), resp.StatusCode)\n}", "title": "" }, { "docid": "87d174522090d7665d85e0194b5d1dc2", "score": "0.5637955", "text": "func laterSendSMS(c context.Context, TO, MSG string) {\n\tURL := fmt.Sprintf(\"http://beta.semaphore.co/api/v4/messages?apikey=%v&number=%v&message=%v&sendername=%v\", SEMAPHORE_API_KEY, TO, url.QueryEscape(MSG), SEMAPHORE_SENDER_NAME)\n\treq, err := http.NewRequest(\"POST\", URL, nil)\n //client := urlfetch.Client(c)\n client := &http.Client{}\n\t_, err = client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "ad94c3a02121c1d0b524946cab5df1fd", "score": "0.56082517", "text": "func (s *SQSService) SendMessage(req *SendMessageRequest) (result *SendMessageResponse, err error) {\n\n\tresult = new(SendMessageResponse)\n\terr = s.wrapperSignAndDo(req.QueueUrl, \"SendMessage\", req, result)\n\treturn\n}", "title": "" }, { "docid": "352c75bb37c8fd930cb054a1dbf6c54d", "score": "0.5602745", "text": "func (o *SendSMSParams) WithRequest(request static.SMSSendRequest) *SendSMSParams {\n\to.SetRequest(request)\n\treturn o\n}", "title": "" }, { "docid": "81bdd1c394d38c1f88f3f5f8552c146d", "score": "0.56026983", "text": "func sms(watches []ArmoganWatch) error {\n\tapiKey := os.Getenv(\"AT_API_KEY\")\n\tusername := os.Getenv(\"AT_USERNAME\")\n\tto := os.Getenv(\"MY_PHONENUMBER\")\n\tmessage := \"\"\n\n\tfor _, watch := range watches {\n\t\tmessage += fmt.Sprintf(\"%s-($%.2f)\\n\", watch.name, watch.price)\n\t}\n\n\tvalues := url.Values{}\n\tvalues.Set(\"username\", username)\n\tvalues.Set(\"to\", to)\n\tvalues.Set(\"message\", message)\n\n\treader := strings.NewReader(values.Encode())\n\n\treq, err := http.NewRequest(http.MethodPost, africasTalkingEndpoint, reader)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treq.Header.Set(\"apikey\", apiKey)\n\treq.Header.Set(\"Content-Length\", strconv.Itoa(reader.Len()))\n\treq.Header.Set(\"Content-Type\", \"application/x-www-form-urlencoded\")\n\treq.Header.Set(\"Accept\", \"application/json\")\n\n\tclient := &http.Client{Timeout: 10 * time.Second}\n\tresp, err := client.Do(req)\n\n\tdefer req.Body.Close()\n\tbody, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn err\n\t}\n\tlog.Println(string(body))\n\treturn nil\n}", "title": "" }, { "docid": "a5791c43124bc0c444f225d23eda7b58", "score": "0.559584", "text": "func (s *Server) SendMessage(client *Client, from, body string) error {\n\tclient.Room.Broadcast(from, body)\n\treturn nil\n}", "title": "" }, { "docid": "fde21f3a9e536f03ec1866a8331a8be8", "score": "0.55789834", "text": "func (v *Client) SendBatchActSms(ctx context.Context, r *smsmdl.ModelSend) (msgid string, err error) {\n\tmsgid, err = v.SendActSms(ctx, r)\n\treturn\n}", "title": "" }, { "docid": "0ee0888a0c6f5d5452d46e0afc70d5fc", "score": "0.5556117", "text": "func (m *messenger) Send(msg Message) error {\n\n\turi := baseURI + \"/textmessages\"\n\tif msg.IMEI != nil {\n\t\turi += \"/\"\n\t\turi += *msg.IMEI\n\t}\n\n\turi += \"?message=\"\n\turi += msg.Message\n\n\tif msg.ServiceMask != nil {\n\t\turi += \"&serviceMask=\"\n\t\turi += string(*msg.ServiceMask)\n\t}\n\n\turi += \"&sendDirect=\"\n\turi += strconv.FormatBool(msg.SendDirect)\n\n\tjson, err := json.Marshal(msg)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treq, err := http.NewRequest(\"POST\", uri, bytes.NewBuffer(json))\n\tif err != nil {\n\t\treturn err\n\t}\n\treq.Header.Add(\"X-GDB-APIKEY\", m.apiKey)\n\tresp, err := m.client.Do(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\tif resp.StatusCode < 200 || resp.StatusCode >= 300 {\n\t\treturn errors.New(\"Non-200 Response\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "eb204bb9fee0b2086023f86bbaafb52c", "score": "0.5547085", "text": "func Send(w http.ResponseWriter, r *http.Request) {\n\tdata := &SendRequest{}\n\tif err := render.Bind(r, data); err != nil {\n\t\trender.Render(w, r, ErrInvalidRequest(err))\n\t\treturn\n\t}\n\n\tmobile := data.Mobile\n\tcontent := data.Content\n\textNo := data.ExtNo\n\n\t// send\n\tcount, messageID, err := CMPPProxy.Send(mobile, content, extNo, AppConfig.SendTimeout)\n\tif err != nil {\n\t\trender.Render(w, r, ErrSendFailed(err))\n\t\treturn\n\t}\n\n\tresponseData := SendResponse{\n\t\tMobile: mobile,\n\t\tMessageID: fmt.Sprintf(\"%v\", messageID),\n\t\tCount: count,\n\t}\n\trender.Render(w, r, SuccessRender(responseData))\n\treturn\n}", "title": "" }, { "docid": "e6a7146058894bc75e754eedfd0e343f", "score": "0.55376756", "text": "func (self *ServerView) SendMsg(recv int, ctnt common.Content, reply *common.Content) error {\n\treturn self.srvs[recv].Msg(ctnt, reply)\n}", "title": "" }, { "docid": "4ea0f7f68e38f0101a2718cd5af4b3c9", "score": "0.55193937", "text": "func (s *Settings) SetSmsMessage(v string) *Settings {\n\ts.SmsMessage = &v\n\treturn s\n}", "title": "" }, { "docid": "a31a9890d0785d34593e9b15dd1131a7", "score": "0.5496353", "text": "func (u *User) SendMsg(msg string) {\n\tu.conn.Write([]byte(msg))\n}", "title": "" }, { "docid": "b4ac7b9825c02c8fca8454a63a1d4d5c", "score": "0.54845726", "text": "func (h *MqService) Send(r *http.Request, args *MqSendArgs, reply *MqReply) error {\n\tif h.stompSender == nil {\n\t\treturn errors.New(\"You must connect to the mq service first\")\n\t}\n\th.stompSender.SendMessage(args.Queue, args.Message)\n\treturn nil\n}", "title": "" }, { "docid": "f7e5ca9892929857bb0dc9af408670c5", "score": "0.5428336", "text": "func InviaSms(ctx context.Context, token, shortnumber, cell, message string) (err error) {\n\n\ttype sms struct {\n\t\tAddress string `xml:\"address\"`\n\t\tMsgid string `xml:\"msgid\"`\n\t\tNotify string `xml:\"notify\"`\n\t\tValidity string `xml:\"validity\"`\n\t\tOadc string `xml:\"oadc\"`\n\t\tMessage string `xml:\"message\"`\n\t}\n\n\t// Crea nuova struttura per sms.\n\tnuovoSMS := new(sms)\n\n\t// Formatta e verifica che il cell inserito sia secondo standard.\n\t// if !isCell.MatchString(cell) {\n\t// \terr := fmt.Errorf(\"Cellulare non nel formato standard: +39xxxxxxxxxx : %s\", cell)\n\t// \treturn err\n\t// }\n\n\taddress := \"tel:+39\" + cell\n\n\t// Verifica che il messsaggio non super 160 caratteri.\n\tif len(message) > 160 {\n\t\terr := fmt.Errorf(\"Messaggio troppo lungo, max 160 caratteri\")\n\t\treturn err\n\t}\n\n\t// Verifica che il token sia nel formato corretto.\n\tif !isToken.MatchString(token) {\n\t\terr := fmt.Errorf(\"Token non nel formato standard: %s\", token)\n\t\treturn err\n\t}\n\n\tnuovoSMS.Address = address\n\tnuovoSMS.Msgid = \"9938\"\n\tnuovoSMS.Notify = \"Y\"\n\tnuovoSMS.Validity = \"00:03\"\n\tnuovoSMS.Oadc = shortnumber\n\tnuovoSMS.Message = message\n\n\t//fmt.Println(nuovoSMS)\n\n\tbodyreq, err := xml.Marshal(nuovoSMS)\n\n\tif err != nil {\n\t\terrbodyreq := fmt.Errorf(\"Impossibile parsare dati in xml: %s\", err.Error())\n\t\treturn errbodyreq\n\t}\n\n\turlmt := \"https://easyapi.telecomitalia.it:8248/sms/v1/mt\"\n\tbearertoken := \"Bearer \" + token\n\n\t// Accetta anche certificati https non validi.\n\ttr := &http.Transport{\n\t\tTLSClientConfig: &tls.Config{InsecureSkipVerify: true},\n\t}\n\n\t// Crea il cliet http.\n\tclient := &http.Client{Transport: tr}\n\n\t// Crea la request da inviare.\n\treq, err := http.NewRequest(\"POST\", urlmt, bytes.NewBuffer(bodyreq))\n\tif err != nil {\n\t\terrreq := fmt.Errorf(\"Errore creazione request: %v: %s\", req, err.Error())\n\t\treturn errreq\n\t}\n\n\t// fmt.Println(req)\n\n\t// Aggiunge alla request il contesto.\n\treq.WithContext(ctx)\n\n\t// Aggiunge alla request l'autenticazione.\n\treq.Header.Set(\"Authorization\", bearertoken)\n\n\t// Aggiunge alla request gli header per passare le informazioni.\n\treq.Header.Set(\"Content-Type\", \"application/xml\")\n\n\t// Invia la request HTTP.\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\terrresp := fmt.Errorf(\"Errore nella richiesta http %s\", err.Error())\n\t\treturn errresp\n\t}\n\n\t// Body va chiuso come da specifica.\n\tdefer resp.Body.Close()\n\n\t// Se la http response ha un codice di errore esce.\n\tif resp.StatusCode > 299 {\n\t\terrStatusCode := fmt.Errorf(\"Errore %d impossibile inviare sms\", resp.StatusCode)\n\t\treturn errStatusCode\n\t}\n\n\t// Legge il body della risposta.\n\t_, err = ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\terrbody := fmt.Errorf(\n\t\t\t\"Error Impossibile leggere risposta client http: %s\",\n\t\t\terr.Error())\n\t\treturn errbody\n\t}\n\n\t// \tfmt.Println(string(bodyresp))\n\n\treturn err\n}", "title": "" }, { "docid": "96206c094ada67c6ecef01b457ea5290", "score": "0.5406463", "text": "func (svr *RpcServer) callSend(msg *sendMsg) (err error) {\n\t//log.Println(\"[DEBUG]Server.Send:\", msg)\n\t_, err = svr.Call(\"send\", []interface{}{msg.pid, msg.msg},\n\t\ttrue, false, 0)\n\treturn\n}", "title": "" }, { "docid": "74f95d44c1452b83b148a154b63e24b2", "score": "0.54024786", "text": "func (mgr *ServiceMgr) SendMsg(msg *ServiceMgrMsg) error {\n\tblog.Info(\"ServiceMgr: send an msg to service manager\")\n\tselect {\n\tcase mgr.msgQueue <- msg:\n\tdefault:\n\t\tblog.Error(\"ServiceMgr: send an msg to service manager fail\")\n\t\treturn fmt.Errorf(\"service mgr queue is full now\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "0d782c8bf0558bf02ab947771a06f959", "score": "0.53939444", "text": "func (m *SmtMessage) Send(user, password, host string, port int, insecureSkipVerify bool) error {\n\tauth := PlainAuth(\"\", user, password, host)\n\taddress := host + \":\" + strconv.Itoa(port)\n\n\treturn SendMail(address, auth, m.From.Address, m.AllRecipients(), m.Bytes(), insecureSkipVerify)\n}", "title": "" }, { "docid": "e010d712159690c92faf950e92373a14", "score": "0.53897595", "text": "func (messagingAPI *MessagingAPI) MessageSend(ctx context.Context, from, to address.Address, value types.AttoFIL, baseFee types.AttoFIL, gasPremium types.AttoFIL, gasLimit types.Unit, method abi.MethodNum, params interface{}) (cid.Cid, error) {\n\tmsgCid, _, err := messagingAPI.messaging.Outbox.Send(ctx, from, to, value, baseFee, gasPremium, gasLimit, true, method, params)\n\tif err != nil {\n\t\treturn cid.Undef, err\n\t}\n\treturn msgCid, nil\n}", "title": "" }, { "docid": "4956fbe14fea0a40f918d1093bc13afc", "score": "0.5381409", "text": "func NotifyByATSMS(session SessionDetails, message string) {\n\tviper.SetConfigFile(\"./.env\")\n\terr := viper.ReadInConfig()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tuserName := viper.GetString(\"AT_USERNAME\")\n\tapiKey := viper.GetString(\"AT_APIKEY\")\n\tenv := viper.GetString(\"AT_ENV\")\n\tsmsService := sms.NewService(userName, apiKey, env)\n\tsmsResponse, err := smsService.Send(\"\", session.PhoneNumber, message)\n\tif err != nil {\n\t\tlog.Error(err)\n\t}\n\tlog.Info(smsResponse)\n}", "title": "" }, { "docid": "eb5551dc43494dae58f402da80a001df", "score": "0.5378683", "text": "func (c *RawClient) SendMessage(typeString string, msgData interface{}) (err error) {\n\tvar msg *WsMessage\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tStdLogger.Printf(\"发送数据失败:%s\\n\", err.Error())\n\t\t}\n\t}()\n\tdefer func() {}()\n\tif c.IsClosed() {\n\t\terr = errors.New(\"client is closed\")\n\t\treturn\n\t}\n\tif msgData == nil {\n\t\terr = errors.New(\"数据格式错误,nil pointer\")\n\t\treturn\n\t}\n\tmsg, err = CreateWsMessage(typeString, msgData)\n\tif err != nil {\n\t\terr = errors.New(\"数据格式错误\")\n\t\treturn\n\t}\n\tselect {\n\tcase c.sent <- msg:\n\tcase <-c.closeChan:\n\t\terr = errors.New(\"the sent channel is closed\")\n\t\treturn\n\tdefault:\n\t\terr = errors.New(\"the sent channel is full\")\n\t}\n\treturn\n}", "title": "" }, { "docid": "f477abb6fd1063753a443a89990ed563", "score": "0.537572", "text": "func SendTextMessage(ctx context.Context, tenantKey, appID string,\n\tuser *protocol.UserInfo, rootID string,\n\ttext string) (*protocol.SendMsgResponse, error) {\n\n\treturn sendMsg(ctx, tenantKey, appID, protocol.NewTextMsgReq(user, rootID, text))\n}", "title": "" }, { "docid": "df16bbfba13c60972bea2476c1c19fde", "score": "0.537185", "text": "func (softphone *Softphone) Send(sipMessage SipMessage, responseHandler func(string) bool) {\n\tstringMessage := sipMessage.ToString()\n\tlog.Println(\"↑↑↑\\n\", stringMessage)\n\tif responseHandler != nil {\n\t\tvar key string\n\t\tkey = softphone.addMessageListener(func(message string) {\n\t\t\tdone := responseHandler(message)\n\t\t\tif done {\n\t\t\t\tsoftphone.removeMessageListener(key)\n\t\t\t}\n\t\t})\n\t}\n\terr := softphone.Conn.WriteMessage(1, []byte(stringMessage))\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "2dd9a9330f8992b8578805b891c26008", "score": "0.5367026", "text": "func (a mantisAlert) Send(m *Message, s SenderProvider) error {\n\tsender := s.GetMantisSender(a.Uri + \"#\" + m.String())\n\tif sender == nil {\n\t\treturn nil\n\t}\n\tid, err := sender.Send(a.Uri, m.String(), m.Long())\n\tif err == nil {\n\t\tlog.Printf(\"created Mantis issue %d\", id)\n\t}\n\treturn err\n}", "title": "" }, { "docid": "0c40554ecef676168a9f0148b947a11c", "score": "0.5360728", "text": "func (cs *chatServerMethods) SendMessage(ctx *context.T, call rpc.ServerCall, IncomingMessage string) error {\n\tremoteb, _ := security.RemoteBlessingNames(ctx, call.Security())\n\tcs.messages <- message{\n\t\tSenderName: firstShortName(remoteb),\n\t\tText: IncomingMessage,\n\t\tTimestamp: time.Now(),\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "383605c689bedabf9c78d1d5379e3924", "score": "0.53482014", "text": "func (ctx *RouteContext) Send(msg tgbotapi.Chattable) {\n\tctx.backend.mq <- msg\n}", "title": "" }, { "docid": "6847eaab7cb46ecf1849bcaff265fa0d", "score": "0.53331244", "text": "func (t Twilio) SendMessage(to string, message string) (bool, error) {\n\tu, err := url.ParseRequestURI(twilioBase)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"could not create Twilio URL: %v\", err)\n\t}\n\tu.Path = fmt.Sprintf(\"/%s/Accounts/%s/Messages.json\", twilioVersion, t.AccountSID)\n\n\tv := url.Values{}\n\tv.Set(\"To\", to)\n\tv.Set(\"From\", t.From)\n\tv.Set(\"Body\", message)\n\trb := *strings.NewReader(v.Encode())\n\n\tfmt.Println(\"request URL:\", u.String())\n\treq, err := http.NewRequest(\"POST\", u.String(), &rb)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"could not prepare request: %v\", err)\n\t}\n\treq.SetBasicAuth(t.AccountSID, t.AuthToken)\n\treq.Header.Add(\"Accept\", \"application/json\")\n\treq.Header.Add(\"Content-Type\", \"application/x-www-form-urlencoded\")\n\n\tclient := http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"could not make request: %v\", err)\n\t}\n\n\t// TODO set up a debug mode and print the response\n\t//defer resp.Body.Close()\n\t//data, _ := ioutil.ReadAll(resp.Body)\n\t//fmt.Println(data)\n\n\tstatusOK := resp.StatusCode >= 200 && resp.StatusCode < 300\n\treturn statusOK, nil\n}", "title": "" }, { "docid": "4e29190a7e2c38236826067e61c517ca", "score": "0.5331856", "text": "func (s *Simple) Send(msg []byte) error {\n\t_, err := s.buf.Write(msg)\n\treturn err\n}", "title": "" }, { "docid": "12fee2a47518612b6154921ccae68ae8", "score": "0.53185105", "text": "func (n *jarvisNode) SendMsg(addr string, msg *pb.JarvisMsg, funcOnResult FuncOnProcMsgResult) {\n\tn.mgrClient2.addSendMsgTask(msg, addr, funcOnResult)\n}", "title": "" }, { "docid": "236e1e54fcbade3a2ad7ac87e6dda437", "score": "0.5299629", "text": "func (list *List) DeleteSms(smsId string) error{\t\t\n Ddb.Update(func(tx *bolt.Tx) error {\n \tlog.Println(\"--- Delete SMS\")\n\t b := tx.Bucket([]byte(\"ListSMS-\"+list.Id))\t\t \n\t err := b.Delete([]byte(smsId))\t\t\n\t return err\n\t})\n\treturn nil\n}", "title": "" }, { "docid": "81eaaf480e4a3cd50e87882b92663781", "score": "0.5298012", "text": "func (c *Client) SMS() *SMS {\n\treturn &SMS{c}\n}", "title": "" }, { "docid": "fccc86206a9a2a56b6ef97fdff60e581", "score": "0.52948165", "text": "func (m *Mobile) GenerateSMSToken(countryCode, mobile string) error {\n\tapiURL := m.getTwilioVerifyURL()\n\tdata := url.Values{}\n\tdata.Set(\"To\", countryCode+mobile)\n\tdata.Set(\"Channel\", \"sms\")\n\tresp, err := m.send(apiURL, data)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tbodyBytes, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tbodyString := string(bodyBytes)\n\tfmt.Println(bodyString)\n\treturn err\n}", "title": "" }, { "docid": "70b0d813f701742b8521552cd0debcdd", "score": "0.52886075", "text": "func (m_2 *MockBroker_ConsumerChatServer) SendMsg(m interface{}) error {\n\n\treturn nil\n}", "title": "" }, { "docid": "cd0b1628f94677d9032ff5a11d08b0d2", "score": "0.5276578", "text": "func (service *Service) Send(message string, params *types.Params) error {\n\tif len(message) > maxlength {\n\t\treturn errors.New(\"Message exceeds the max length\")\n\t}\n\n\tconfig := *service.config\n\tif err := service.pkr.UpdateConfigFromParams(&config, params); err != nil {\n\t\treturn err\n\t}\n\n\treturn service.sendMessageForChatIDs(message, &config)\n}", "title": "" }, { "docid": "c1325e6ef7070948047b2f4969b2e1fd", "score": "0.5271638", "text": "func (bot *Bot) SendMessage(message maubot.OutgoingMessage) {\n\tbot.internal.SendMessage(\n\t\tbot.internal.NewOutgoingMessage(message.Text, message.RoomID))\n}", "title": "" }, { "docid": "cdc09690428e275307114dd4d46d1ebf", "score": "0.5262594", "text": "func (c *Client) SendMessage(ctx context.Context, chatID int64, text string) error {\n\turi := fmt.Sprintf(\"https://api.telegram.org/bot%s/sendMessage\", c.token)\n\tvar b bytes.Buffer\n\tif err := json.NewEncoder(&b).Encode(&sendMessage{\n\t\tChatID: chatID,\n\t\tDisableURLPreview: true,\n\t\tParseMode: \"MarkdownV2\",\n\t\tText: text,\n\t}); err != nil {\n\t\treturn err\n\t}\n\n\treq, err := http.NewRequestWithContext(ctx, \"POST\", uri, &b)\n\tif err != nil {\n\t\treturn err\n\t}\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tresult := &response{}\n\tif err := json.NewDecoder(resp.Body).Decode(result); err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\n\tlog.Println(string(result.Result))\n\tlog.Println(string(result.Description))\n\n\tif !result.Ok {\n\t\treturn &common.TGError{Code: result.ErrorCode, Description: string(result.Description)}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a0c3dab82d055f0ba4482445eba252b1", "score": "0.5261981", "text": "func (rtm *RTM) SendMessage(msg *OutgoingMessage) {\n\tif msg == nil {\n\t\trtm.Debugln(\"Error: Attempted to SendMessage(nil)\")\n\t\treturn\n\t}\n\n\trtm.outgoingMessages <- *msg\n}", "title": "" }, { "docid": "a0c3dab82d055f0ba4482445eba252b1", "score": "0.5261981", "text": "func (rtm *RTM) SendMessage(msg *OutgoingMessage) {\n\tif msg == nil {\n\t\trtm.Debugln(\"Error: Attempted to SendMessage(nil)\")\n\t\treturn\n\t}\n\n\trtm.outgoingMessages <- *msg\n}", "title": "" }, { "docid": "7e0fcb34afc1b67dff3df6842c2fda85", "score": "0.5257942", "text": "func (src *Chain) SendMsg(datagram sdk.Msg) (sdk.TxResponse, error) {\n\treturn src.SendMsgs([]sdk.Msg{datagram})\n}", "title": "" }, { "docid": "cbfeaf1b2fd9e16813b02be9281417cf", "score": "0.52433056", "text": "func (c *Client) SendMessage(message string) {\n\tif c.Connected() {\n\t\tc.sendCh <- message\n\t} else {\n\t\tpanic(\"Server not connected\")\n\t}\n}", "title": "" }, { "docid": "5c37947ed0eb749f8b531e4f7ad6eb10", "score": "0.5236229", "text": "func SendYPSMS(mobile, verifycode, stime string, tmpID int64) error {\n\ttplValue := url.Values{\"#code#\": {verifycode}, \"#time#\": {stime}}.Encode()\n\tdata := url.Values{\"apikey\": {apiKey}, \"mobile\": {mobile},\n\t\t\"tpl_id\": {fmt.Sprintf(\"%d\", tmpID)}, \"tpl_value\": {tplValue}}\n\treturn sendData(data)\n}", "title": "" }, { "docid": "5da55270cd094ea4c3b8bd4f56fc9e21", "score": "0.52352303", "text": "func (c *WSLink) Send(msg *msgjson.Message) error {\n\treturn c.send(msg, nil)\n}", "title": "" }, { "docid": "e7dcc425f412a051c9a9f1df10eeea67", "score": "0.5209329", "text": "func (s Sender) Send(msg proto.Message, addrs ...*mino.Address) error {\n\n\treturn nil\n}", "title": "" }, { "docid": "e2ecc7e94f4b67f9a7bfe57ab01c8259", "score": "0.51989025", "text": "func SqsSendMessage(ctx aws.Context, queue, payload string) (string, error) {\n\n\tif len(queue) == 0 {\n\t\tpanic(fmt.Sprintf(\"Empty queue to SqsSendMessage for queue: %s\", queue))\n\t}\n\n\tif len(payload) == 0 {\n\t\tpanic(fmt.Sprintf(\"Empty msg payload to SqsSendMessage for queue: %s\", queue))\n\t}\n\n\tres, err := sqsc.SendMessageWithContext(\n\t\tctx,\n\t\t&sqs.SendMessageInput{\n\t\t\tMessageBody: aws.String(payload),\n\t\t\tQueueUrl: aws.String(queue),\n\t\t},\n\t)\n\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"Failed to send message to queue: %s - reason: %v\", queue, err)\n\t}\n\n\treturn aws.StringValue(res.MessageId), nil\n}", "title": "" }, { "docid": "22691584d132c1d7251d09ad847bd94b", "score": "0.5195845", "text": "func sendToPhone(msg string) error {\n\turl := fmt.Sprintf(\"https://maker.ifttt.com/trigger/notification/with/key/%s?value1=%s\",\n\t\tconf.WebhookKey, url.QueryEscape(msg))\n\tresp, err := http.Get(url)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to make webhook trigger: %v\", err)\n\t}\n\tresp.Body.Close()\n\treturn nil\n}", "title": "" }, { "docid": "fd82b052108274bc3aa00a56759192b7", "score": "0.5191604", "text": "func (s *Server) SendMessage(msg *msg.Message) {\n\ts.sendMsgCh <- msg\n}", "title": "" }, { "docid": "51b2c5da4417db18f7dcf208ea432681", "score": "0.5189917", "text": "func (p *P2PSwitch) sendMsg(sendPeer *p2p.Peer, chanId byte, bMsg []byte) error {\n\tif sendPeer.Send(chanId, bMsg) {\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"msg send to %s error;\", sendPeer.String())\n}", "title": "" }, { "docid": "0fbf2216f7ea750bb902f9b68d1adde4", "score": "0.518033", "text": "func (r SetSMSAttributesRequest) Send(ctx context.Context) (*SetSMSAttributesResponse, error) {\n\tr.Request.SetContext(ctx)\n\terr := r.Request.Send()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp := &SetSMSAttributesResponse{\n\t\tSetSMSAttributesOutput: r.Request.Data.(*SetSMSAttributesOutput),\n\t\tresponse: &aws.Response{Request: r.Request},\n\t}\n\n\treturn resp, nil\n}", "title": "" }, { "docid": "102492fa75c108b4ef452928cc63f38b", "score": "0.51753926", "text": "func (s *Service) SendWeMessage(c context.Context, title, task, result, sender string, receiver []string) (err error) {\n\tvar (\n\t\tmsg = \"[sven需求与建议来信 📨 ]\\n\"\n\t\tusers []string\n\t)\n\tswitch task {\n\tcase need.VerifyType[need.NeedApply]:\n\t\tmsg += fmt.Sprintf(\"%s童鞋认真地提了一份建议(%s),快去看看吧~\\n%s\\n\", sender, title, \"http://sven.bilibili.co/#/suggestion/list\")\n\t\tusers = append(users, receiver...)\n\tcase need.VerifyType[need.NeedVerify]:\n\t\tmsg += fmt.Sprintf(\"%s童鞋的建议(%s)反馈我们已经收到啦,先发一朵小红花感谢支持!🌺 \\n\", sender, title)\n\t\tusers = append(users, sender)\n\tcase need.VerifyType[need.NeedReview]:\n\t\tmsg += fmt.Sprintf(\"%s童鞋的建议(%s)审核结果是%s, %s\", receiver, title, result, \"%s\")\n\t\tusers = append(users, receiver...)\n\t}\n\n\tswitch result {\n\tcase need.VerifyType[need.VerifyAccept]:\n\t\tmsg = fmt.Sprintf(msg, \"恭喜恭喜,喝杯快乐水开心一下~ 🍻 \")\n\tcase need.VerifyType[need.VerifyReject]:\n\t\tmsg = fmt.Sprintf(msg, \"不要灰心,可能是需求描述或使用姿势不够准确,还请多多支持,欢迎再来!🙇‍ 🙆‍ \")\n\tcase need.VerifyType[need.VerifyObserved]:\n\t\tmsg = fmt.Sprintf(msg, \"您的意见我们先保留啦,还请多多支持,欢迎再来补充!🙇‍ 🙆‍ \")\n\t}\n\n\tif err = s.dao.SendWechatToUsers(c, users, msg); err != nil {\n\t\tlog.Error(\"apmSvc.SendWechatMessage error(%v)\", err)\n\t\treturn\n\t}\n\treturn\n}", "title": "" }, { "docid": "727f6b44dfe6edd431b8330d659c185e", "score": "0.51733714", "text": "func (saver *SFTPSaver) SendMessage(msg interface{}) error {\n\treturn nil\n}", "title": "" }, { "docid": "4094d1e463c2a025e12a75946baa1a55", "score": "0.5171261", "text": "func (tm TweetManager) SendDirectMessage(user string, userTo string, text string) error {\n\tif user == \"\" {\n\t\treturn fmt.Errorf(\"user is required\")\n\t} else if userTo == \"\" {\n\t\treturn fmt.Errorf(\"userTo is required\")\n\t} else if text == \"\" {\n\t\treturn fmt.Errorf(\"message is required\")\n\t}\n\n\tdirect := domain.CreateMessage(user, userTo, text)\n\ttm.userMessages[userTo] = append(tm.userMessages[userTo], direct)\n\treturn nil\n}", "title": "" }, { "docid": "5d20affbf23cb1b6231e25daf1c786e3", "score": "0.5170075", "text": "func (s *SmsSettings) SetSmsMessage(v string) *SmsSettings {\n\ts.SmsMessage = &v\n\treturn s\n}", "title": "" } ]
fad2c136a4fb7492f95355af9a63fcfd
List issues a LIST FTP command.
[ { "docid": "2400ca20759d6e57a65066ba8bf5e1f0", "score": "0.7427507", "text": "func (ftp *client) List(path string) (entries []*Entry, err error) {\n\tvar cmd string\n\tvar parseFunc func(string) (*Entry, error)\n\n\tif ftp.mlst {\n\t\tcmd = \"MLSD\"\n\t\tparseFunc = parseRFC3659ListLine\n\t} else {\n\t\tcmd = \"LIST\"\n\t\tparseFunc = parseListLine\n\t}\n\tconn, err := ftp.cmdDataConnFrom(0, \"%s %s\", cmd, path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr := &response{conn, ftp}\n\tdefer r.Close()\n\n\tscanner := bufio.NewScanner(r)\n\n\tfor scanner.Scan() {\n\t\tentry, err := parseFunc(scanner.Text())\n\t\tif err == nil {\n\t\t\tentries = append(entries, entry)\n\t\t}\n\t}\n\treturn entries, scanner.Err()\n}", "title": "" } ]
[ { "docid": "9e30e2a09512623ce37a9c968989e30e", "score": "0.76437473", "text": "func (ftp *FTP) List(path string) (files []string, err error) {\n\tif err = ftp.Type(ModeASCII); err != nil {\n\t\treturn\n\t}\n\n\tvar port int\n\tif port, err = ftp.Pasv(); err != nil {\n\t\treturn\n\t}\n\n\t// check if MLSD works\n\tif err = ftp.send(\"MLSD %s\", path); err != nil {\n\t}\n\n\tvar pconn net.Conn\n\tif pconn, err = ftp.newConnection(port); err != nil {\n\t\treturn\n\t}\n\n\tvar line string\n\tif line, err = ftp.receive(); err != nil {\n\t\treturn\n\t}\n\n\tif !ftp.HasCode(line, CodeFileStatusOk) {\n\t\t// MLSD failed, lets try LIST\n\t\tif err = ftp.send(\"LIST %s\", path); err != nil {\n\t\t\treturn\n\t\t}\n\n\t\tif line, err = ftp.receive(); err != nil {\n\t\t\treturn\n\t\t}\n\n\t\tif !ftp.HasCode(line, CodeFileStatusOk) {\n\t\t\t// Really list is not working here\n\t\t\terr = errors.New(line)\n\t\t\treturn\n\t\t}\n\t}\n\n\treader := bufio.NewReader(pconn)\n\n\tfor {\n\t\tline, err = reader.ReadString('\\n')\n\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t} else if err != nil {\n\t\t\treturn\n\t\t}\n\n\t\tfiles = append(files, string(line))\n\t}\n\n\tpconn.Close()\n\n\tif line, err = ftp.receive(); err != nil {\n\t\treturn\n\t}\n\n\tif !ftp.HasCode(line, CodeClosingDataConnection) {\n\t\terr = errors.New(line)\n\t\treturn\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "987d229eca7a15b70dfc579de4f84740", "score": "0.7540712", "text": "func (c *Conn) list(args []string) {\n\tvar target string\n\tif len(args) > 0 {\n\t\ttarget = filepath.Join(c.rootDir, c.workDir, args[0])\n\t} else {\n\t\ttarget = filepath.Join(c.rootDir, c.workDir)\n\t}\n\tfiles, err := ioutil.ReadDir(target)\n\tif err != nil {\n\t\tlog.Print(err)\n\t\tc.respond(status550)\n\t\treturn\n\t}\n\tc.respond(status150)\n\t// When sending anything other than statuses, the server must establish a second, temporary connection to the client, known as the data connection, or dataConn.\n\t// Moreover, the connection must be made to a specific port that the FTP client has selected in advance.\n\t// How is this achieved? Before sending the LIST directive to the server, the client sends another command behind the scenes: PORT. PORT has a six-byte argument, corresponding to the four parts of an IP address, plus two bytes to represent a port number up to five digits long, e.g., PORT [127,0,0,1,245,1]. Be aware that your client may use subtly different formats but, if your server has proper logging, you’ll soon spot the difference.\n\tdataConn, err := c.dataConnect()\n\tif err != nil {\n\t\tlog.Print(err)\n\t\tc.respond(status425)\n\t\treturn\n\t}\n\tdefer dataConn.Close()\n\n\tfor _, file := range files {\n\t\t_, err := fmt.Fprint(dataConn, file.Name(), c.EOL())\n\t\tif err != nil {\n\t\t\tlog.Print(err)\n\t\t\tc.respond(status426)\n\t\t}\n\t}\n\t_, err = fmt.Fprintf(dataConn, c.EOL())\n\tif err != nil {\n\t\tlog.Print(err)\n\t\tc.respond(status426)\n\t}\n\tc.respond(status226)\n}", "title": "" }, { "docid": "a193c4697429e6a009c3743567d231c5", "score": "0.6885034", "text": "func (ftp *client) NameList(path string) (entries []string, err error) {\n\tconn, err := ftp.cmdDataConnFrom(0, \"NLST %s\", path)\n\tif err != nil {\n\t\treturn\n\t}\n\tr := &response{conn, ftp}\n\tdefer r.Close()\n\n\tscanner := bufio.NewScanner(r)\n\n\tfor scanner.Scan() {\n\t\tentries = append(entries, scanner.Text())\n\t}\n\treturn entries, scanner.Err()\n}", "title": "" }, { "docid": "96e6b28a460e0c96d57e5524514bd011", "score": "0.6849405", "text": "func (f *FTP) List(dir string) ([]FileInfo, error) {\n\tif err := f.ensureConnected(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tentries, err := f.connection.List(dir)\n\tif err != nil {\n\t\tf.Disconnect()\n\t\treturn nil, err\n\t}\n\n\tres := make([]FileInfo, len(entries))\n\tfor i, entry := range entries {\n\t\t// NOTE: if the FTP server is compromised, they could theoretically\n\t\t// do something malicious like give a \"filename\" with a / in it.\n\t\t// I don't trust the FTP library to prevent against these situations.\n\t\tif strings.ContainsRune(entry.Name, '/') {\n\t\t\tpanic(\"invalid filename: \" + entry.Name)\n\t\t}\n\n\t\tres[i] = FileInfo{\n\t\t\tPath: path.Join(dir, entry.Name),\n\t\t\tIsDir: entry.Type == ftp.EntryTypeFolder,\n\t\t\tFileSize: entry.Size,\n\t\t}\n\t}\n\n\treturn res, nil\n}", "title": "" }, { "docid": "c52992f493aa31d2e0825d6bc70d4cf6", "score": "0.67891264", "text": "func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err error) {\n if titre_fonction == true{\n fmt.Println(\"Using the fs list function \")\n }\n\n //fs.Debugf(src, \"Can't move - not same remote type\")\n\n xrddir := f.url+ \"/\"+ dir\n\n client,path,err :=f.xrdremote(xrddir,ctx)\n if path == \"\" {\n\t\tpath = \".\"\n\t}\n\n if err != nil{\n return nil, fmt.Errorf(\"could not stat %q: %w\", path, err)\n }\n defer client.Close()\n\n fsx := client.FS()\n fi,err := fsx.Stat(ctx,path)\n\n\n if err != nil {\n\t\treturn nil, fs.ErrorDirNotFound //errors.Wrap(err,\" could not stat\" + url.Path )\n\t}\n entries,err = f.display(ctx, fsx, path, fi, dir )\n if err != nil {\n return entries,err\n }\n\n err = client.Close();\n if err != nil {\n return entries,err\n }\n return entries,nil\n}", "title": "" }, { "docid": "cd012610c4b0450854def1a89b0492ed", "score": "0.66774946", "text": "func (p *POP3) List() []ListItem {\n\tvar resp *response.Response\n\n\tif resp = command.Send(p.socket, \"LIST\", nil); resp != nil {\n\t\tif resp.IsOK() {\n\t\t\treturn p.ListRead()\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e351e64f33f2104ecafaff7414473d6f", "score": "0.6641327", "text": "func (fs *FileSystem) List(p ...[]byte) (ls []*File, err error) {\n\treturn ls, nil\n}", "title": "" }, { "docid": "20bc49f09645f8d8d0743cb8c98d46f1", "score": "0.6581962", "text": "func (ep *SftpTransportMethod) processSftpList(req *DronaRequest) ([]string, error) {\n\tprgChan := make(types.StatsNotifChan)\n\tdefer close(prgChan)\n\tif req.ackback {\n\t\tgo statsUpdater(req, ep.ctx, prgChan)\n\t}\n\n\tstats, resp := sftp.ExecCmd(\"ls\", ep.surl, ep.uname, ep.passwd, ep.path, \"\", req.sizelimit, prgChan)\n\treturn resp.List, stats.Error\n}", "title": "" }, { "docid": "c09d7b6ee6d07045a82b7d3a873e94af", "score": "0.6571382", "text": "func (f *FakeConn) List(ctx context.Context, filePathPrefix string) ([]topo.KVInfo, error) {\n\treturn nil, topo.NewError(topo.NoImplementation, \"List not supported in fake topo\")\n}", "title": "" }, { "docid": "a8e382829608aec58c768df82d3bf82a", "score": "0.6537542", "text": "func List(rw http.ResponseWriter, r *http.Request) {\n\trw.Header().Add(\"Content-Type\", \"application/json\")\n\tlisting, err := fs.List(\"~\")\n\tif err != nil {\n\t\thandleErr(err, rw)\n\t\treturn\n\t}\n\tb, err := json.Marshal(listing)\n\tif err != nil {\n\t\thandleErr(err, rw)\n\t\treturn\n\t}\n\trw.WriteHeader(http.StatusOK)\n\t_, err = rw.Write(b)\n\tif err != nil {\n\t\thandleErr(err, rw)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "d787502bc1d6a827d64828118cee2d7b", "score": "0.6500092", "text": "func (z Adapter) List(typ ListType) ([]string, error) {\n\tvar stdout bytes.Buffer\n\n\tif err := z.runCMD([]string{\"list\", \"-H\", \"-t\", string(typ), \"-o\", \"name\"}, nil, &stdout); err != nil {\n\t\treturn nil, err\n\t}\n\n\tlines := strings.Split(stdout.String(), \"\\n\")\n\tnames := make([]string, 0, len(lines))\n\tfor _, line := range lines {\n\t\tname := strings.TrimSpace(line)\n\t\tif name == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tnames = append(names, name)\n\t}\n\tif len(names) == 0 {\n\t\treturn nil, fmt.Errorf(\"zfs list: %w\", ErrNoOutput)\n\t}\n\n\treturn names, nil\n}", "title": "" }, { "docid": "fe18ed7d5098641332afe036a8fb0dd3", "score": "0.6495403", "text": "func (c *Client) List(ref, pattern string, options *imap.ListOptions) *ListCommand {\n\tcmd := &ListCommand{\n\t\tmailboxes: make(chan *imap.ListData, 64),\n\t\treturnStatus: options != nil && options.ReturnStatus != nil,\n\t}\n\tenc := c.beginCommand(\"LIST\", cmd)\n\tif selectOpts := getSelectOpts(options); len(selectOpts) > 0 {\n\t\tenc.SP().List(len(selectOpts), func(i int) {\n\t\t\tenc.Atom(selectOpts[i])\n\t\t})\n\t}\n\tenc.SP().Mailbox(ref).SP().String(pattern)\n\tif returnOpts := getReturnOpts(options); len(returnOpts) > 0 {\n\t\tenc.SP().Atom(\"RETURN\").SP().List(len(returnOpts), func(i int) {\n\t\t\topt := returnOpts[i]\n\t\t\tenc.Atom(opt)\n\t\t\tif opt == \"STATUS\" {\n\t\t\t\treturnStatus := statusItems(options.ReturnStatus)\n\t\t\t\tenc.SP().List(len(returnStatus), func(j int) {\n\t\t\t\t\tenc.Atom(returnStatus[j])\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\tenc.end()\n\treturn cmd\n}", "title": "" }, { "docid": "97809c5c47e4bfd993015f0dd4d8becd", "score": "0.6491019", "text": "func (client *IpfsClient) List(path string) ([]*api.LsLink, error) {\n\treturn client.client.List(path)\n}", "title": "" }, { "docid": "e98090ac62cd70f0530d4f4385554ee9", "score": "0.6460325", "text": "func (gr *Grunt) List() {\n\tjobs := gr.SelectedJobs(true) // need\n\tif len(jobs) == 0 {\n\t\treturn\n\t}\n\tgr.RunGrunt(\"ls\", jobs)\n}", "title": "" }, { "docid": "f460c204b75751a41940feb55095bb93", "score": "0.6363359", "text": "func (a DbfsAPI) List(req httpmodels.ListReq) (httpmodels.ListResp, error) {\n\tvar resp httpmodels.ListResp\n\n\tjsonResp, err := a.Client.performQuery(http.MethodGet, \"/dbfs/list\", req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\terr = json.Unmarshal(jsonResp, &resp)\n\treturn resp, err\n}", "title": "" }, { "docid": "c58812b42b11c36b0dd313ee6bb99ddc", "score": "0.63514405", "text": "func listFiles() {\n\tfiles, err := sendDesfireCommand(0x6f, []byte{})\n\tcheck(err)\n\n\tfor _, file := range files.Data() {\n\t\tfileInfo, err := sendDesfireCommand(0xf5, []byte{file})\n\t\tcheck(err)\n\n\t\tdata := fileInfo.Data()\n\t\tlog.Printf(\"File 0x%02x, type %s, security level 0x%02x\\n\", file, getFileType(data[0]), data[1])\n\t}\n}", "title": "" }, { "docid": "758f96f380e7132b144e896e39520560", "score": "0.63259965", "text": "func (l *Location) List() ([]string, error) {\n\tvar filenames []string\n\tdc, err := l.fileSystem.DataConn(context.TODO(), l.Authority, types.SingleOp, nil)\n\tif err != nil {\n\t\treturn filenames, err\n\t}\n\n\tentries, err := dc.List(l.Path())\n\tif err != nil {\n\t\tif strings.HasPrefix(err.Error(), fmt.Sprintf(\"%d\", _ftp.StatusFileUnavailable)) {\n\t\t\t// in this case the directory does not exist\n\t\t\treturn filenames, nil\n\t\t}\n\t\treturn filenames, err\n\t}\n\tfor _, entry := range entries {\n\t\tif entry.Type == _ftp.EntryTypeFile {\n\t\t\tfilenames = append(filenames, entry.Name)\n\t\t}\n\t}\n\n\treturn filenames, nil\n}", "title": "" }, { "docid": "bce920934087b2e80f36ffd9d81abee9", "score": "0.6314887", "text": "func List(text string, items []string, options ...Option) (string, error) {\n\treturn list(text, items, applyOptions(options))\n}", "title": "" }, { "docid": "2b4ddf75d15a6a214c4cf74c2435bbe4", "score": "0.6312389", "text": "func (fs *FileService) List(u *User, p *Pagination) ([]File, error) {\n\treturn fs.Datasource.List(u, p)\n}", "title": "" }, { "docid": "b3cec6d895b20171aaf9b893400088b6", "score": "0.63041383", "text": "func (t *Tailer) List(topic types.Path) ([]string, error) {\n\treturn types.List(topic, t.topics), nil\n}", "title": "" }, { "docid": "f4193fc5bc64bf69b734fc95d892af5e", "score": "0.62621224", "text": "func List(input cli.Input) error {\n\treturn (&ListSubCommand{}).do(input)\n}", "title": "" }, { "docid": "0c5f41b1b7fe385a194bc0397f561ccf", "score": "0.6258526", "text": "func (s *Service) List(subject, reply, clientID string) error {\n\tquery := \"SELECT * FROM task WHERE client_id = $1 AND deleted_at IS NULL ORDER BY created_at ASC\"\n\ttasks := []model.Task{}\n\tif err := s.db.Select(&tasks, query, clientID); err != nil {\n\t\treturn s.jsonConn.Publish(reply, &model.NATSMsg{Success: false, Message: err.Error()})\n\t}\n\td, err := json.Marshal(&tasks)\n\tif err != nil {\n\t\treturn s.jsonConn.Publish(reply, &model.NATSMsg{Success: false, Message: err.Error()})\n\t}\n\treturn s.jsonConn.Publish(reply, model.NATSMsg{Success: true, Data: d})\n}", "title": "" }, { "docid": "99d1f2fe7b9fba64013a4c3f382c8aaa", "score": "0.6245571", "text": "func (rfm *RemoteFilesMonitor) listDir() ([]FileInfo, error){\n\tclient, session, err := rfm.connect()\n\tif err != nil {\n\t\tlog.Panic(err)\n\t}\n\tout, err := session.CombinedOutput(rfm.command)\n\tif err != nil {\n\t\tlog.Panic(err)\n\t}\n\tvar files []FileInfo\n\tfor _, val := range strings.Split(string(out), \"\\n\") {\n\t\tif len(val) > 0 {\n\t\t\tfi := FileInfo{}\n\t\t\terr = json.Unmarshal([]byte(val), &fi)\n\t\t\tif err != nil {\n\t\t\t\tlog.Panic(err)\n\t\t\t}\n\t\t\tfiles = append(files, fi)\n\t\t}\n\t\t\n\t}\n\t\n\tclient.Close()\n\treturn files, err\n}", "title": "" }, { "docid": "8a90c2534df3c96b1b941c38ce8c464a", "score": "0.6230633", "text": "func mainList(ctx *cli.Context) error {\n\t// Additional command specific theme customization.\n\tconsole.SetColor(\"File\", color.New(color.Bold))\n\tconsole.SetColor(\"Dir\", color.New(color.FgCyan, color.Bold))\n\tconsole.SetColor(\"Size\", color.New(color.FgYellow))\n\tconsole.SetColor(\"Time\", color.New(color.FgGreen))\n\n\t// check 'ls' cli arguments.\n\tcheckListSyntax(ctx)\n\n\t// Set command flags from context.\n\tisRecursive := ctx.Bool(\"recursive\")\n\tisIncomplete := ctx.Bool(\"incomplete\")\n\n\targs := ctx.Args()\n\t// mimic operating system tool behavior.\n\tif !ctx.Args().Present() {\n\t\targs = []string{\".\"}\n\t}\n\n\tvar cErr error\n\tfor _, targetURL := range args {\n\t\tclnt, err := newClient(targetURL)\n\t\tfatalIf(err.Trace(targetURL), \"Unable to initialize target `\"+targetURL+\"`.\")\n\n\t\tif !strings.HasSuffix(targetURL, string(clnt.GetURL().Separator)) {\n\t\t\tvar st *clientContent\n\t\t\tst, err = clnt.Stat(isIncomplete, false, false, nil)\n\t\t\tif err == nil && st.Type.IsDir() {\n\t\t\t\ttargetURL = targetURL + string(clnt.GetURL().Separator)\n\t\t\t\tclnt, err = newClient(targetURL)\n\t\t\t\tfatalIf(err.Trace(targetURL), \"Unable to initialize target `\"+targetURL+\"`.\")\n\t\t\t}\n\t\t}\n\n\t\tif e := doList(clnt, isRecursive, isIncomplete); e != nil {\n\t\t\tcErr = e\n\t\t}\n\t}\n\treturn cErr\n}", "title": "" }, { "docid": "3f70ee6aaeb5ba3adc9678d8a30ead2d", "score": "0.62173545", "text": "func (c *Client) List(ctx context.Context, p *ListPayload) (res *ListResult, err error) {\n\tvar ires any\n\tires, err = c.ListEndpoint(ctx, p)\n\tif err != nil {\n\t\treturn\n\t}\n\treturn ires.(*ListResult), nil\n}", "title": "" }, { "docid": "f2a4c18c8774269b0d4c9c5e138b2a13", "score": "0.6212603", "text": "func (fm *FileManager) List() []string {\n\tvar list []string\n\tfor _, f := range fm.listing {\n\t\tlist = append(list, fmt.Sprintf(\"size=%d;modify=%s;perm=%s;type=%s %s\", f.Size(), BaseParser.ToTimeVal(f.ModTime()), fm.listFilePerm(f.Mode()), fm.listFileType(f.IsDir()), f.Name()))\n\t}\n\n\treturn list\n}", "title": "" }, { "docid": "a1cfbaa0d0070650a3a38a8be7732172", "score": "0.6208841", "text": "func (s *SimpleFSHandler) SimpleFSList(ctx context.Context, arg keybase1.SimpleFSListArg) error {\n\tcli, err := s.client(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tctx, cancel := s.wrapContextWithTimeout(ctx)\n\tdefer cancel()\n\treturn cli.SimpleFSList(ctx, arg)\n}", "title": "" }, { "docid": "21bf2623df0b6da4608b884e52ab2dd0", "score": "0.6191622", "text": "func (s *Service) List(args struct{}, reply *string) error {\n\ttableString := &strings.Builder{}\n\ttable := tablewriter.NewWriter(tableString)\n\ttable.SetHeader([]string{\"Extension\"})\n\n\tnames := []string{}\n\tfor t := range s.serviceToken {\n\t\tif len(s.serviceToken[t]) > 0 {\n\t\t\tnames = append(names, t)\n\t\t}\n\t}\n\n\tsort.Strings(names)\n\n\tfor n := range names {\n\t\ttable.Append([]string{names[n]})\n\t}\n\n\ttable.Render()\n\t*reply = tableString.String()\n\treturn nil\n}", "title": "" }, { "docid": "2f7b1dc9401b7beae0db750a8203f911", "score": "0.61822164", "text": "func list(args ...string) error {\n\tdata, e := getList(args...)\n\tif e != nil {\n\t\treturn err.Wrap(e, \"list-GetList\")\n\t}\n\tfor _, v := range data {\n\t\tfmt.Printf(\"%v: %v [%v]\\n\", v.Name, v.State, strings.Join(v.Ipv4, \", \"))\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "024ae9ebc07a6764c895cf00e751a417", "score": "0.6180047", "text": "func list(isInfo bool, dir string, options map[string]commando.FlagValue) {\n\t// get an absolute directory path\n\tvar dirPath string\n\tif filepath.IsAbs((dir)) {\n\t\tdirPath = dir\n\t} else {\n\t\tworkingDir, _ := os.Getwd()\n\t\tdirPath = filepath.Join(workingDir, dir)\n\t}\n\n\t// print contents\n\tprintContent(isInfo, dirPath, options, 0, \"\")\n}", "title": "" }, { "docid": "e4b0dda7c6b9c4977584421b25011dd2", "score": "0.61482275", "text": "func ActionList(c *cli.Context) {\n\tif len(c.Args()) != 0 {\n\t\tlog.Fatal(\"too many arguments\")\n\t}\n\n\tresp, err := service.Service.RadiusList(c.String(\"realm\"))\n\tif err != nil {\n\t\tlog.Fatalf(\"error: %v\", err)\n\t}\n\n\tif c.Bool(\"details\") {\n\t\tfmt.Printf(\"%-45s %-30s\\n\", \"RADIUS\", \"FQDN\")\n\t}\n\n\tfor _, radius := range resp.IPAddrs {\n\t\tif !c.Bool(\"details\") {\n\t\t\tfmt.Printf(\"%s\\n\", radius)\n\t\t} else {\n\t\t\tr, e := service.Service.RadiusInfo(radius)\n\t\t\tif e != nil {\n\t\t\t\tlog.Fatalf(\"error: couldn't retrieve details for %q: %v\",\n\t\t\t\t\tradius, e)\n\t\t\t}\n\t\t\tfmt.Printf(\"%-45s %-30s\\n\", radius, r.Name)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f9ebc12c4f2e70030be004f32fae89a1", "score": "0.6140275", "text": "func (s *Server) List(messages *comm.EmptyMessage, stream comm.CommService_ListServer) error {\n\tlog.Infof(\"[Server List()]\\n\")\n\n\t// returning error will cause endless loop?\n\tdata, _ := s.storage.GetAll()\n\t// if err != nil {\n\t// \treturn err\n\t// }\n\n\tfor _, d := range data {\n\t\tif err := stream.Send(&comm.Data{Body: d}); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "bf64a668f874880e5ea0f7bd90e0c395", "score": "0.60985047", "text": "func (d *MockDriver) List(ctx context.Context, subPath string) ([]string, error) {\n\treturn nil, nil\n}", "title": "" }, { "docid": "96b18d13a0f8ffe346e2164d32b88c06", "score": "0.6067232", "text": "func List(c *session.Session, f string) (servers *ServerResponse, err error) {\n resp, err := c.Get(\"/servers\", nil)\n if err != nil {\n return nil, err\n }\n\n var s ServerResponse\n err = json.Unmarshal(resp.Body, &s)\n if err != nil {\n return nil, err\n }\n\n return &s, nil\n}", "title": "" }, { "docid": "2048c8235be6f5c053ca310bad714aa8", "score": "0.6058701", "text": "func (resolver *Resolver) List(_ context.Context) ([]remote.ResolvedObject, error) {\n\treturn nil, nil\n}", "title": "" }, { "docid": "9e67c479290ca0d0d72bf82a93165634", "score": "0.604419", "text": "func (fr *FileRepo) List(uid string, ctx context.Context) ([]string, error) {\n\tfr.RWMutex.RLock()\n\tdefer fr.RWMutex.RUnlock()\n\t// get data needed\n\t// retrieve list of keys as []string\n\tvar keys []string\n\tfor _, val := range fr.fileData {\n\t\tif val.Active == 1 && val.UID == uid {\n\t\t\tkeys = append(keys, val.Shorturl)\n\t\t}\n\t}\n\treturn keys, nil\n}", "title": "" }, { "docid": "d92464775363ec2c1b7608d819ae8546", "score": "0.6041984", "text": "func (this Server) list(response http.ResponseWriter, request *http.Request) {\n\n\titems, _ := filepath.Glob(\"./**.md\")\n\tfor i := 0; i < len(items); i++ {\n\n\t\titem := items[i]\n\t\tif strings.HasSuffix(item, \".md\") {\n\t\t\titem = item[:len(item)-3]\n\t\t\titems[i] = item\n\t\t}\n\t}\n\n\tr := ListFiles{\n\t\tItems: items,\n\t}\n\n\tserialized, err := json.Marshal(r)\n\tif err != nil {\n\t\twriteError(response, err)\n\t\treturn\n\t}\n\n\tresponse.Write(serialized)\n}", "title": "" }, { "docid": "6e92f1ee79a3017719278db5fbee68a8", "score": "0.6040565", "text": "func (c *ServerClient) List(params ServerListParams) (*ServerList, error) {\n\tvar result ServerList\n\terr := c.Backend.CallIntoInterface(\"v1/Storm/Server/list\", params, &result)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &result, nil\n}", "title": "" }, { "docid": "58c90e7d2058adc24700c6adcd5ec80c", "score": "0.60381037", "text": "func (r *SFTP) List(t Type) (IDs, error) {\n\tlist := []os.FileInfo{}\n\tvar err error\n\n\tif t == Data || t == Tree {\n\t\t// read first level\n\t\tbasedir := r.dirname(t, nil)\n\n\t\tlist1, err := r.c.ReadDir(basedir)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// read files\n\t\tfor _, dir := range list1 {\n\t\t\tentries, err := r.c.ReadDir(filepath.Join(basedir, dir.Name()))\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tfor _, entry := range entries {\n\t\t\t\tlist = append(list, entry)\n\t\t\t}\n\t\t}\n\t} else {\n\t\tlist, err = r.c.ReadDir(r.dirname(t, nil))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tids := make(IDs, 0, len(list))\n\tfor _, item := range list {\n\t\tid, err := ParseID(item.Name())\n\t\t// ignore everything that does not parse as an ID\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\t\tids = append(ids, id)\n\t}\n\n\treturn ids, nil\n}", "title": "" }, { "docid": "2285721a036ef5df8f3b909fc70b6460", "score": "0.6033666", "text": "func List(args []string, s *settings.Settings) int {\n\topts := &OptList{}\n\toptions.Bind(usageDoc, args, opts)\n\tlc := listCmd{\n\t\tconf: s.ConfigFile(),\n\t}\n\n\t// Sync DB table \"installed\" with configuration file\n\tsynchro := &sync.Sync{}\n\tcopier.Copy(synchro, isync.Inject(s))\n\tsynchro.Templates()\n\tif opts.Long {\n\t\treturn lc.LongOutput()\n\t}\n\treturn lc.ShortOutput()\n}", "title": "" }, { "docid": "95faacbe2f76f4a100c4d65a2cfe3e6a", "score": "0.60325354", "text": "func (r *RunSftp) ls(args []string) (err error) {\n\t// create app\n\tapp := cli.NewApp()\n\t// app.UseShortOptionHandling = true\n\n\t// set help message\n\tapp.CustomAppHelpTemplate = helptext\n\n\t// set parameter\n\tapp.Flags = []cli.Flag{\n\t\tcli.BoolFlag{Name: \"1\", Usage: \"list one file per line\"},\n\t\tcli.BoolFlag{Name: \"a\", Usage: \"do not ignore entries starting with\"},\n\t\tcli.BoolFlag{Name: \"f\", Usage: \"do not sort\"},\n\t\tcli.BoolFlag{Name: \"h\", Usage: \"with -l, print sizes like 1K 234M 2G etc.\"},\n\t\tcli.BoolFlag{Name: \"l\", Usage: \"use a long listing format\"},\n\t\tcli.BoolFlag{Name: \"n\", Usage: \"list numeric user and group IDs\"},\n\t\tcli.BoolFlag{Name: \"r\", Usage: \"reverse order while sorting\"},\n\t\tcli.BoolFlag{Name: \"S\", Usage: \"sort by file size, largest first\"},\n\t\tcli.BoolFlag{Name: \"t\", Usage: \"sort by modification time, newest first\"},\n\t}\n\tapp.Name = \"ls\"\n\tapp.Usage = \"lsftp build-in command: ls [remote machine ls]\"\n\tapp.ArgsUsage = \"[host,host...:][PATH]...\"\n\tapp.HideHelp = true\n\tapp.HideVersion = true\n\tapp.EnableBashCompletion = true\n\n\t// action\n\tapp.Action = func(c *cli.Context) error {\n\t\t// argpath\n\t\targData := c.Args()\n\n\t\ttargetmap := map[string]*TargetConnectMap{}\n\n\t\tif len(argData) > 0 {\n\t\t\tfor _, arg := range argData {\n\t\t\t\t// sftp target host\n\t\t\t\ttargetmap = r.createTargetMap(targetmap, arg)\n\t\t\t}\n\t\t} else {\n\t\t\tfor server, client := range r.Client {\n\t\t\t\t// sftp target host\n\t\t\t\ttargetmap[server] = &TargetConnectMap{}\n\t\t\t\ttargetmap[server].SftpConnect = *client\n\t\t\t}\n\t\t}\n\n\t\tr.executeRemoteLs(c, targetmap)\n\n\t\treturn nil\n\t}\n\n\t// parse short options\n\targs = common.ParseArgs(app.Flags, args)\n\tapp.Run(args)\n\n\treturn\n}", "title": "" }, { "docid": "c9ca586bceeece9642aea54aefbbde29", "score": "0.60258776", "text": "func (f *FileSystem) List(args *cstructs.FsListRequest, reply *cstructs.FsListResponse) error {\n\t// We only allow stale reads since the only potentially stale information is\n\t// the Node registration and the cost is fairly high for adding another hope\n\t// in the forwarding chain.\n\targs.QueryOptions.AllowStale = true\n\n\t// Potentially forward to a different region.\n\tif done, err := f.srv.forward(\"FileSystem.List\", args, args, reply); done {\n\t\treturn err\n\t}\n\tdefer metrics.MeasureSince([]string{\"nomad\", \"file_system\", \"list\"}, time.Now())\n\n\t// Check filesystem read permissions\n\tif aclObj, err := f.srv.ResolveToken(args.AuthToken); err != nil {\n\t\treturn err\n\t} else if aclObj != nil && !aclObj.AllowNsOp(args.Namespace, acl.NamespaceCapabilityReadFS) {\n\t\treturn structs.ErrPermissionDenied\n\t}\n\n\t// Verify the arguments.\n\tif args.AllocID == \"\" {\n\t\treturn errors.New(\"missing allocation ID\")\n\t}\n\n\t// Lookup the allocation\n\tsnap, err := f.srv.State().Snapshot()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\talloc, err := snap.AllocByID(nil, args.AllocID)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif alloc == nil {\n\t\treturn structs.NewErrUnknownAllocation(args.AllocID)\n\t}\n\n\t// Make sure Node is valid and new enough to support RPC\n\t_, err = getNodeForRpc(snap, alloc.NodeID)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Get the connection to the client\n\tstate, ok := f.srv.getNodeConn(alloc.NodeID)\n\tif !ok {\n\t\treturn findNodeConnAndForward(f.srv, alloc.NodeID, \"FileSystem.List\", args, reply)\n\t}\n\n\t// Make the RPC\n\treturn NodeRpc(state.Session, \"FileSystem.List\", args, reply)\n}", "title": "" }, { "docid": "105f66ffb3506df42464dbb8bbd4735a", "score": "0.60237616", "text": "func (c *Client) list(path string, isFile bool) (res *Resources.Resource, err error) {\n\t/* Check connection ready state before executing command */\n\tif _, err = c.isReady(); err != nil {\n\t\treturn\n\t}\n\n\tif !c.InPassiveMode() {\n\t\t_, err = c.PassiveMode()\n\t\tdefer c.RestoreConnections();\n\t}\n\n\tif err == nil {\n\t\tif !isFile {\n\t\t\t/* Container listing */\n\t\t\tif c.features.Supports(\"MLSD\") {\n\t\t\t\tres, err = c.Commands.MLSD(path)\n\n\t\t\t\tif !c.Commands.LastIsImplemented() {\n\t\t\t\t\t/* MLSD not supported, remove the feature from expected support and fallback on LIST */\n\t\t\t\t\tc.features.RemoveFeature(\"MLSD\")\n\t\t\t\t\treturn c.list(path, isFile)\n\t\t\t\t}\n\t\t\t} else if c.features.Supports(\"LIST\") {\n\t\t\t\tres, err = c.Commands.LIST(path)\n\t\t\t}\n\t\t} else {\n\t\t\t/* Single resource listing */\n\t\t\tif c.features.Supports(\"MLST\") {\n\t\t\t\tres, err = c.Commands.MLST(path)\n\n\t\t\t\tif !c.Commands.LastIsImplemented() {\n\t\t\t\t\t/* MLST not supported, remove the feature from expected support and fallback on LIST */\n\t\t\t\t\tc.features.RemoveFeature(\"MLST\")\n\t\t\t\t\treturn c.list(path, isFile)\n\t\t\t\t}\n\t\t\t} else if c.features.Supports(\"LIST\") {\n\t\t\t\tres, err = c.Commands.LIST(path)\n\t\t\t}\n\t\t}\n\t}\n\n\tif err == nil {\n\t\tc.Resources = res\n\t\tfmt.Println(res.GetContentByName(\"mirror\"))\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "75c2e420b79d022cb37de70a3cf63146", "score": "0.6008861", "text": "func (c *MesosCloud) List(filter string) ([]string, error) {\n\tc.RLock()\n\tdefer c.RUnlock()\n\n\tvar slaveHosts []string\n\tfor _, slave := range c.slaves {\n\t\tslaveHosts = append(slaveHosts, slave.HostName)\n\t}\n\treturn slaveHosts, nil\n}", "title": "" }, { "docid": "a1c660bd4494b7de5bcb5112f55945c2", "score": "0.6008574", "text": "func (p *Proxy) List(ctx context.Context, req ResourceRequest, pred *store.SelectionPredicate) (WrapList, error) {\n\tp.mu.RLock()\n\tdefer p.mu.RUnlock()\n\treturn p.impl.List(ctx, req, pred)\n}", "title": "" }, { "docid": "2830932791585f5e89a9ac5ba4439631", "score": "0.5999723", "text": "func (s *catalogueService) List(order string, pageNum, pageSize int) ([]Sock, error) {\n\tvar socks []Sock\n\tquery := baseQuery\n\n\tvar args []interface{}\n\n\tif order != \"\" {\n\t\tquery += \" ORDER BY ?\"\n\t\targs = append(args, order)\n\t}\n\tquery += \";\"\n\n\terr := s.db.Select(&socks, query, args...)\n\tif err != nil {\n\t\ts.logger.Log(\"database error\", err)\n\t\treturn []Sock{}, ErrDBConnection\n\t}\n\n\tsocks = cut(socks, pageNum, pageSize)\n\n\treturn socks, nil\n}", "title": "" }, { "docid": "904c7e6516510f4fec79f6c62e1649a1", "score": "0.59875304", "text": "func List(w http.ResponseWriter, r *http.Request) {\n\tdata, err := util.List()\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\thttp.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)\n\t} else {\n\t\tfmt.Fprint(w, data)\n\t}\n}", "title": "" }, { "docid": "a4379ae0ff0e41b1528335cebd52b6d7", "score": "0.59868735", "text": "func (s *User) List(cl orm.DB, query string, limit, offset int) ([]twisk.User, error) {\n\tvar users []twisk.User\n\tq := cl.Model(&users).Limit(limit).Offset(offset).Where(\"deleted_at is null\").Order(\"id desc\")\n\tif query != \"\" {\n\t\tq.Where(query)\n\t}\n\tif err := q.Select(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn users, nil\n}", "title": "" }, { "docid": "3bd991a4ddbd9c0174e691d01b66e3d5", "score": "0.59813505", "text": "func List(ctxt *context.Context, w web.ResponseWriter, r *web.Request) {\n\tdb, err := ctxt.GetDB()\n\tif err != nil {\n\t\t//return error\n\t\tresponse.InternalServerError(w, err)\n\t\treturn\n\t}\n\ttodoList, err := list(db)\n\tif err != nil {\n\t\t//return error\n\t\tresponse.InternalServerError(w, err)\n\t\treturn\n\t}\n\n\tresponse.OK(w, Todos{TodoList: todoList})\n}", "title": "" }, { "docid": "403f4c8527719487656eee08da4eea8f", "score": "0.59791136", "text": "func (b *Broker) List(ctx context.Context, req *pb.ListRequest) (*pb.ListResponse, error) {\n\treturn b.ListFunc(ctx, req)\n}", "title": "" }, { "docid": "a85160eaf2626756972b638f96bb817a", "score": "0.5971401", "text": "func (a *Server) List(ctx context.Context, req *inpb.ListUserRequest) (*inpb.ListUserResponse, error) {\n\tcred, err := a.auth.GetCredentials(ctx, auth.NewOptions())\n\tif err != nil {\n\t\treturn nil, status.Errorf(codes.Unauthenticated, \"authentication failed: %s\", err)\n\t}\n\tif !cred.IsGlobalAdmin {\n\t\treturn nil, status.Errorf(codes.PermissionDenied, \"permission denied\")\n\t}\n\n\tusers, err := a.store.GetUsers(ctx, req.Limit, req.Offset)\n\tif err != nil {\n\t\treturn nil, helpers.ErrToRPCError(err)\n\t}\n\n\ttotalUserCount, err := a.store.GetUserCount(ctx)\n\tif err != nil {\n\t\treturn nil, helpers.ErrToRPCError(err)\n\t}\n\n\tresp := inpb.ListUserResponse{\n\t\tTotalCount: int64(totalUserCount),\n\t}\n\n\tfor _, user := range users {\n\t\trow := inpb.UserListItem{\n\t\t\tUsername: user.DisplayName,\n\t\t\tId: user.ID,\n\t\t\tIsAdmin: user.IsAdmin,\n\t\t\tIsActive: user.IsActive,\n\t\t\tCreatedAt: &timestamp.Timestamp{Seconds: user.CreatedAt.Unix()},\n\t\t\tUpdatedAt: &timestamp.Timestamp{Seconds: user.UpdatedAt.Unix()},\n\t\t}\n\n\t\tresp.Result = append(resp.Result, &row)\n\t}\n\n\treturn &resp, nil\n}", "title": "" }, { "docid": "008553ce6da0b8d1d012752be18cc5e6", "score": "0.5965264", "text": "func (s listService) List(ctx context.Context) ([]*api.Install, error) {\n\tdata, err := s.spotlightSearch(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.parseSpotlightSearchResult(bytes.NewReader(data))\n}", "title": "" }, { "docid": "f96f483674b84008a9a46b763fea59f9", "score": "0.5961173", "text": "func (s *transferServerLister) List(selector labels.Selector) (ret []*v1alpha1.TransferServer, err error) {\n\terr = cache.ListAll(s.indexer, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.TransferServer))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "a8ca76f94cfd16c1c529b9a17f639ba1", "score": "0.5954802", "text": "func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err error) {\n\tfiles, err := f.client.FilesList(f.mountID, f.fullPath(dir))\n\tif err != nil {\n\t\treturn nil, translateErrorsDir(err)\n\t}\n\tentries = make([]fs.DirEntry, len(files))\n\tfor i, file := range files {\n\t\tremote := path.Join(dir, f.opt.Enc.ToStandardName(file.Name))\n\t\tif file.Type == \"dir\" {\n\t\t\tentries[i] = fs.NewDir(remote, time.Time{})\n\t\t} else {\n\t\t\tentries[i] = &Object{\n\t\t\t\tfs: f,\n\t\t\t\tinfo: file,\n\t\t\t\tremote: remote,\n\t\t\t}\n\t\t}\n\t}\n\treturn entries, nil\n}", "title": "" }, { "docid": "3a4079af3f0e5d3b47fd56c1f240ef78", "score": "0.5952078", "text": "func List() error {\n\tstore := taskStoreImpl{}\n\n\ttasks, err := store.list()\n\tif err != nil {\n\t\tlog.Println(color.RedString(\"Error listing tasks\"))\n\t\treturn err\n\t}\n\n\tfor _, t := range tasks {\n\t\tfmt.Println(color.YellowString(t.ToString()))\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "0c76f2879d96226a6a8c3574ad485646", "score": "0.5951453", "text": "func (w *walker) serveList(ready chan<- struct{}) {\n\t/* Spawn a listener */\n\tl, err := w.listen()\n\tif nil != err {\n\t\tverbose(\"Unable to listen for list queries: %v\", err)\n\t\tos.Exit(1)\n\t}\n\tverbose(\"Listening on %v for list queries\", l.Addr())\n\tdefer l.Close()\n\tclose(ready)\n\n\t/* Service queries for lists */\n\tfor {\n\t\tc, err := l.Accept()\n\t\tif nil != err {\n\t\t\tverbose(\"Unable to accept list query client: %v\", err)\n\t\t\tbreak\n\t\t}\n\t\tgo func(lc net.Conn) {\n\t\t\tdefer lc.Close()\n\t\t\tw.slistL.Lock()\n\t\t\ts := w.slist\n\t\t\tif \"\" == s {\n\t\t\t\ts = \"none yet\\n\"\n\t\t\t}\n\t\t\tw.slistL.Unlock()\n\t\t\tfmt.Fprintf(lc, \"%s\", s)\n\t\t\tverbose(\"[%v] List query\", lc.RemoteAddr())\n\t\t}(c)\n\t}\n}", "title": "" }, { "docid": "7af602218954fce5a32b3bddee07aac4", "score": "0.5938766", "text": "func (c *Client) List(prefix string, opts ...backend.ListOption) (*backend.ListResult, error) {\n\toptions := backend.DefaultListOptions()\n\tfor _, opt := range opts {\n\t\topt(options)\n\t}\n\n\tif options.Paginated {\n\t\treturn nil, errors.New(\"pagination not supported\")\n\t}\n\n\tresp, err := httputil.Get(\n\t\tfmt.Sprintf(\"http://%s/list/%s\", c.config.Addr, path.Join(c.pather.BasePath(), prefix)))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\tvar paths []string\n\tif err := json.NewDecoder(resp.Body).Decode(&paths); err != nil {\n\t\treturn nil, fmt.Errorf(\"json: %s\", err)\n\t}\n\tvar names []string\n\tfor _, p := range paths {\n\t\tname, err := c.pather.NameFromBlobPath(p)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid path %s: %s\", p, err)\n\t\t}\n\t\tnames = append(names, name)\n\t}\n\treturn &backend.ListResult{\n\t\tNames: names,\n\t}, nil\n}", "title": "" }, { "docid": "c504ed8b73d1b210f28962d7bc634b78", "score": "0.5930244", "text": "func (s *MembersServer) List(\n\tctx context.Context,\n\treq *connect.Request[members.ListRequest],\n) (*connect.Response[members.ListResponse], error) {\n\t// if !current.Admin {\n\t// \treturn nil, connect.NewError(\n\t// \t\tconnect.CodePermissionDenied,\n\t// \t\tfmt.Errorf(\"only admins can access this resource\"),\n\t// \t)\n\t// }\n\n\tif err := ctx.Err(); err != nil {\n\t\treturn nil, err\n\t}\n\n\trecords, err := s.repository.List(\n\t\tctx,\n\t\treq.Msg.Team,\n\t\treq.Msg.User,\n\t)\n\n\tif err != nil {\n\t\tif err == repository.ErrMemberNotFound {\n\t\t\treturn nil, connect.NewError(\n\t\t\t\tconnect.CodeNotFound,\n\t\t\t\terr,\n\t\t\t)\n\t\t}\n\n\t\treturn nil, connect.NewError(connect.CodeInternal, err)\n\t}\n\n\tpayload := make([]*types.Member, len(records))\n\tfor id, record := range records {\n\t\tpayload[id] = convertMemberUser(record)\n\t}\n\n\treturn connect.NewResponse(&members.ListResponse{\n\t\tMembers: payload,\n\t}), nil\n}", "title": "" }, { "docid": "57df1139dcd27c11e0c469f786580717", "score": "0.5921481", "text": "func (f *FaceList) List() ([]byte, *ErrorResponse) {\n\turl := getFacelistURL()\n\tdata := bytes.NewBuffer([]byte(\"\"))\n\treturn f.client.Connect(\"GET\", url, data, true)\n}", "title": "" }, { "docid": "2bd7845127d05e883ae6a97dd66e679b", "score": "0.59102714", "text": "func List(db func() *sql.DB, w http.ResponseWriter, r *http.Request, _ httprouter.Params) {\n\tdefer r.Body.Close()\n\tif resp, err := list(db()); err != nil {\n\t\twriteErr(w, err)\n\t\tlog.Print(err)\n\t} else {\n\t\twriteOKResp(w, resp)\n\t\tlog.Print(string(resp))\n\t}\n}", "title": "" }, { "docid": "f9b916a12c365dde05106bef5430da84", "score": "0.58834225", "text": "func (s *store) List(ctx context.Context, opts ListOpts) (uploads []shared.Upload, err error) {\n\tctx, _, endObservation := s.operations.list.With(ctx, &err, observation.Args{})\n\tdefer func() {\n\t\tendObservation(1, observation.Args{LogFields: []log.Field{\n\t\t\tlog.Int(\"numUploads\", len(uploads)),\n\t\t}})\n\t}()\n\n\t// This is only a stub and will be replaced or significantly modified\n\t// in https://github.com/sourcegraph/sourcegraph/issues/33375\n\t_, _ = scanUploads(s.db.Query(ctx, sqlf.Sprintf(listQuery, opts.Limit)))\n\treturn nil, errors.Newf(\"unimplemented: uploads.store.List\")\n}", "title": "" }, { "docid": "000136580c2237fbb4120020baffb8d7", "score": "0.5871066", "text": "func List(options *Options) error {\n\thostsfile, err := LoadHostfile(options)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\twidestHostname := 0\n\twidestIP := 0\n\n\tfor _, hostname := range hostsfile.Hosts {\n\t\tdlen := len(hostname.Domain)\n\t\tif dlen > widestHostname {\n\t\t\twidestHostname = dlen\n\t\t}\n\t\tilen := len(hostname.IP)\n\t\tif ilen > widestIP {\n\t\t\twidestIP = ilen\n\t\t}\n\t}\n\n\tfor _, hostname := range hostsfile.Hosts {\n\t\tfmt.Printf(\"%s -> %s %s\\n\",\n\t\t\tStrPadRight(hostname.Domain, widestHostname),\n\t\t\tStrPadRight(hostname.IP.String(), widestIP),\n\t\t\thostname.FormatEnabled())\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "6a37ef915ea0281144833a3901996fad", "score": "0.58656716", "text": "func (api *mirrorsessionAPI) List(ctx context.Context, opts *api.ListWatchOptions) ([]*MirrorSession, error) {\n\tvar objlist []*MirrorSession\n\tobjs, err := api.ct.List(\"MirrorSession\", ctx, opts)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, obj := range objs {\n\t\tswitch tp := obj.(type) {\n\t\tcase *MirrorSession:\n\t\t\teobj := obj.(*MirrorSession)\n\t\t\tobjlist = append(objlist, eobj)\n\t\tdefault:\n\t\t\tlog.Fatalf(\"Got invalid object type %v while looking for MirrorSession\", tp)\n\t\t}\n\t}\n\n\treturn objlist, nil\n}", "title": "" }, { "docid": "646cc22fbab3f7ba74455c43c4635fb6", "score": "0.5861922", "text": "func List(c buffalo.Context) error {\n\n\t// Render template immediately if not logged in...\n\n\tif c.Value(\"current_user\") == nil {\n\t\treturn c.Redirect(301, \"/signin\")\n\t}\n\n\tisAdmin := c.Value(\"current_user\").(*models.User).IsAdmin\n\n\t// Retrieve user's todos\n\ttx := c.Value(\"tx\").(*pop.Connection)\n\n\tq, todo, err := getTodoes(tx, c)\n\n\tif err != nil {\n\t\treturn errors.WithStack(err)\n\t}\n\n\tvar defaultMsg string\n\n\tif len(todo) == 0 {\n\n\t\tfilterStatus := c.Session().Get(\"filterStatus\").(string)\n\n\t\tswitch filterStatus {\n\n\t\tcase \"completed\":\n\t\t\tdefaultMsg = \"No completed tasks to show\"\n\t\tcase \"incompleted\":\n\t\t\tdefaultMsg = \"No incompleted tasks to show\"\n\t\tdefault:\n\t\t\tdefaultMsg = \"No tasks to show\"\n\n\t\t}\n\n\t}\n\n\tusers := []models.User{}\n\n\tif isAdmin {\n\t\tif err := tx.All(&users); err != nil {\n\t\t\treturn errors.WithStack(err)\n\t\t}\n\t}\n\n\t// Prepare to send data to template\n\n\tc.Set(\"user_id\", c.Session().Get(\"current_user_id\"))\n\tc.Set(\"users\", users)\n\tc.Set(\"isAdmin\", isAdmin)\n\tc.Set(\"todo\", todo)\n\tc.Set(\"mainViewFlag\", true)\n\tc.Set(\"pagination\", q.Paginator)\n\tc.Set(\"defaultMsg\", defaultMsg)\n\n\treturn c.Render(200, r.HTML(\"index.html\"))\n\n}", "title": "" }, { "docid": "b1d3c60d3d1c7eb2fb9b69cdac52658d", "score": "0.5858023", "text": "func (ctx *WalkContext) List() ([]string, error) {\n\tlist := []string{}\n\treturn list, ctx.Do(func(p string, info *godirwalk.Dirent) error {\n\t\tlist = append(list, p)\n\t\treturn nil\n\t})\n}", "title": "" }, { "docid": "191527bd1d910f53d1f2f16a5fa6af56", "score": "0.58561313", "text": "func List(fd *sql.DB, users *sql.DB, shares *sql.DB, pathname string, username string) internal.ListReturn {\n\t/* case where the user doesn't provide a path to 'ls' */\n\tif pathname == \".\" {\n\t pwd_return := GetPwd(users, username)\n\t if pwd_return.Err != \"\" { return internal.ListReturn { Err: pwd_return.Err } }\t \n\t pathname = pwd_return.Path\n\t}\n\n\t/* find all files that are at the base specified by clean path */\n\tsql_file_list := `\n\tSELECT Name FROM fd WHERE Basename = ? AND Owner = ? AND Directory = ?\n\t`\n\tfrows, ferr := fd.Query(sql_file_list, pathname, username, 0)\n\tif ferr != nil { return internal.ListReturn{ Err: ferr.Error() } }\n\n\t/* find all directories that are at the base specified by clean path */\n\tsql_dir_list := `\n\tSELECT Name FROM fd WHERE Basename = ? AND Owner = ? AND Directory = ?\n\t`\n\tdrows, derr := fd.Query(sql_dir_list, pathname, username, 1)\n\tif derr != nil { return internal.ListReturn{ Err: derr.Error() } }\n\n\tvar err error\n\tvar files []string\n\n\tfor frows.Next() {\n\t var entry string\n\t /* assuming the ';' here delimits unit statements like in Ocaml */\n\t if err = frows.Scan(&entry); err != nil {\n\t return internal.ListReturn{ Err: err.Error() }\n\t }\n\n\t files = append(files, entry)\n\t}\n\n\tif err != nil { return internal.ListReturn { Err: err.Error() } }\n\n\tvar dirs []string\n\tfor drows.Next() {\n\t var entry string\n\t /* assuming the ';' here delimits unit statements like in Ocaml */\n\t if err = drows.Scan(&entry); err != nil {\n\t return internal.ListReturn { Err: err.Error() }\n\t }\n\n\t dirs = append(dirs, entry)\n\t}\n\n\tif err != nil { return internal.ListReturn { Err: err.Error() } }\n\n\t/* let's now handle shared files -- let's only show them in a user's root directory */\n\tcwd := GetPwd(users, username)\n\n\tif cwd.Err != \"\" { return internal.ListReturn { Err: cwd.Err } }\n\tif cwd.Path != \"/\" { return internal.ListReturn { Files: files, Dirs: dirs } }\n\n\t/* let's query the shared table, and find all the files the user can access */\n\tsql_get_shared := `\n\tSELECT * FROM shares WHERE User = ?\n\t`\n\n\tsrows, serr := shares.Query(sql_get_shared, username)\n\tif serr != nil { panic(serr) }\n\tdefer srows.Close()\n\n\n\tfor srows.Next() {\n\t var (\n\t \tchecksum string\n\t \towner string\n\t \tbase string\n\t \tname string\n \t\tuser string\n\t\twrite bool\n\t )\n\t \n\t if serr = srows.Scan(&checksum, &owner, &base, &name, &user, &write); serr != nil {\n\t \treturn internal.ListReturn { Err: err.Error() }\n\t }\n\t\n\t /* quelch unused variable warnings */\n\t _ = owner\n\t _ = user\n\t _ = write\n\n\t /* format output for shared user */\n\t if base == \"/\" {\n\t files = append(files, (owner + \":\" + base + name))\n\t } else {\n\t files = append(files, (owner + \":\" + base + \"/\" + name))\n\t }\n\t}\n\n\treturn internal.ListReturn { Files: files, Dirs: dirs }\n}", "title": "" }, { "docid": "f42407d7484a4cb0a2c6768d93d7a411", "score": "0.5851237", "text": "func (c *ServerClient) List(ctx context.Context, opts ServerListOpts) ([]*Server, *Response, error) {\n\tpath := \"/servers?\" + opts.values().Encode()\n\treq, err := c.client.NewRequest(ctx, \"GET\", path, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar body schema.ServerListResponse\n\tresp, err := c.client.Do(req, &body)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tservers := make([]*Server, 0, len(body.Servers))\n\tfor _, s := range body.Servers {\n\t\tservers = append(servers, ServerFromSchema(s))\n\t}\n\treturn servers, resp, nil\n}", "title": "" }, { "docid": "942149371dba1535f17d1a0b79776a47", "score": "0.58487517", "text": "func (h *Handler) List(_ string, res *DirList) error {\n\tres.Dirs = viper.GetStringSlice(\"dirs\")\n\treturn nil\n}", "title": "" }, { "docid": "3ed84d18df548db2471bfc0815e43395", "score": "0.5845371", "text": "func (client Client) ListFilesystemResponder(resp *http.Response) (result FilesystemList, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tclient.ByInspecting(),\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK),\n\t\tautorest.ByUnmarshallingJSON(&result),\n\t\tautorest.ByClosing())\n\tresult.Response = autorest.Response{Response: resp}\n\treturn\n}", "title": "" }, { "docid": "cb85976130f528446796c4477a438143", "score": "0.5840898", "text": "func CmdList() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"list\",\n\t\tShort: \"List NooBaa PV stores\",\n\t\tRun: RunList,\n\t\tArgs: cobra.NoArgs,\n\t}\n\treturn cmd\n}", "title": "" }, { "docid": "9819e1a8159017cd9d3bd54df2e450f0", "score": "0.5839619", "text": "func (o *IPv6NetOp) List(ctx context.Context, zone string) (*IPv6NetListResult, error) {\n\t// build request URL\n\tpathBuildParameter := map[string]interface{}{\n\t\t\"rootURL\": SakuraCloudAPIRoot,\n\t\t\"pathSuffix\": o.PathSuffix,\n\t\t\"pathName\": o.PathName,\n\t\t\"zone\": zone,\n\t}\n\n\turl, err := buildURL(\"{{.rootURL}}/{{.zone}}/{{.pathSuffix}}/{{.pathName}}\", pathBuildParameter)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// build request body\n\tvar body interface{}\n\n\t// do request\n\tdata, err := o.Client.Do(ctx, \"GET\", url, body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// build results\n\tresults, err := o.transformListResults(data)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn results, err\n}", "title": "" }, { "docid": "ba26164559ec3af2b82f6db1e8ae9d79", "score": "0.58350635", "text": "func (b *blbCli) cmdList(c *cli.Context) {\n\tclient := b.getClient(c)\n\tnext := client.ListBlobs(context.Background())\n\tfor {\n\t\tids, err := next()\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"Error: %s\", err)\n\t\t\tbreak\n\t\t}\n\t\tif ids == nil {\n\t\t\tbreak\n\t\t}\n\t\tfor _, id := range ids {\n\t\t\tlog.Infof(\"%s\", id)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4b7ad4daf577458fe4f5ebcaedfd3c8e", "score": "0.5833747", "text": "func (client Client) ListFilesystemSender(req *http.Request) (*http.Response, error) {\n\tsd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n\treturn autorest.SendWithSender(client, req, sd...)\n}", "title": "" }, { "docid": "e63c67eecf687a784a3948930a78b49f", "score": "0.5833367", "text": "func list(rw http.ResponseWriter, r *http.Request) {\n\tuserid, err := getUserId(r)\n\tif err != nil {\n\t\trw.WriteHeader(http.StatusForbidden)\n\t\t_ = json.NewEncoder(rw).Encode(apiobj.Error{Err: \"forbidden\"})\n\t\treturn\n\t}\n\n\tstrArr := _manager.List(userid)\n\t_ = json.NewEncoder(rw).Encode(apiobj.List{List: strArr})\n}", "title": "" }, { "docid": "0ddf2f4c84b50aecc3062bd16cc217bd", "score": "0.5829968", "text": "func (d *driver) ListDir(sctx *ftp.Context, path string, callback func(iofs.FileInfo) error) (err error) {\n\tdefer log.Trace(path, \"\")(\"err = %v\", &err)\n\tVFS, err := d.getVFS(sctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tnode, err := VFS.Stat(path)\n\tif err == vfs.ENOENT {\n\t\treturn errors.New(\"directory not found\")\n\t} else if err != nil {\n\t\treturn err\n\t}\n\tif !node.IsDir() {\n\t\treturn errors.New(\"not a directory\")\n\t}\n\n\tdir := node.(*vfs.Dir)\n\tdirEntries, err := dir.ReadDirAll()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Account the transfer\n\ttr := accounting.GlobalStats().NewTransferRemoteSize(path, node.Size())\n\tdefer func() {\n\t\ttr.Done(d.ctx, err)\n\t}()\n\n\tfor _, file := range dirEntries {\n\t\terr = callback(&FileInfo{file, file.Mode(), VFS.Opt.UID, VFS.Opt.GID})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9703c9d49705f9c3dd6d1f5f6b9a434b", "score": "0.5817568", "text": "func (f FakeLister) List(api.ListOptions) (*api.NodeList, error) {\n\treturn f.NodeList, f.Err\n}", "title": "" }, { "docid": "a6383ae1a3aa70beb2169d8538c57008", "score": "0.58131737", "text": "func ListRemoteCommand() {\n\tfmt.Println(\"Listing available versions...\")\n\tversions := php.GetRemoteVersions()\n\tfor i := 0; i < len(versions); i++ {\n\t\tfmt.Println(versions[i])\n\t}\n}", "title": "" }, { "docid": "77026850fceabf26a4d3313448d3a7e2", "score": "0.57891905", "text": "func (zfs *ZFS) List(prefix string) ([]FS, error) {\n\tcommand := zfs.Command(\"get\", \"all\", \"-H\", \"-p\", \"-r\", prefix)\n\n\tstdout, _, err := command.Output()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treader := bytes.NewReader(stdout)\n\n\tvar (\n\t\tname string\n\t\tproperty string\n\t\tvalue string\n\t\tsource string\n\t)\n\n\tresult := []FS{}\n\n\tfs := &FS{}\n\n\tfor {\n\t\t_, err := fmt.Fscanf(\n\t\t\treader,\n\t\t\t\"%s %s %s %s\\n\",\n\t\t\t&name,\n\t\t\t&property,\n\t\t\t&value,\n\t\t\t&source,\n\t\t)\n\n\t\tif name != fs.Name || err == io.EOF {\n\t\t\tif fs.Name != \"\" {\n\t\t\t\tresult = append(result, *fs)\n\t\t\t}\n\n\t\t\tfs = &FS{\n\t\t\t\tName: name,\n\t\t\t\tProperties: map[string]Property{},\n\t\t\t}\n\t\t}\n\n\t\tif err != nil {\n\t\t\tif err == io.EOF {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\treturn nil, ser.Errorf(\n\t\t\t\terr,\n\t\t\t\t\"error while reading command output: '%s'\",\n\t\t\t\tcommand.String(),\n\t\t\t)\n\t\t}\n\n\t\tfs.Properties[property] = Property{\n\t\t\tName: property,\n\t\t\tValue: value,\n\t\t\tSource: Source(source),\n\t\t}\n\t}\n\n\treturn result, nil\n}", "title": "" }, { "docid": "2458f70097afc473465f7b88d100ad6c", "score": "0.57827604", "text": "func list(db *sql.DB) (resp []byte, err error) {\n\tvar todos []Todo\n\n\trows, err := db.Query(\"SELECT id, title, status FROM todo\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdefer rows.Close()\n\n\tfor rows.Next() {\n\t\tvar todo Todo\n\t\tif err := rows.Scan(&todo.ID, &todo.Title, &todo.Status); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\ttodos = append(todos, todo)\n\t}\n\n\treturn json.Marshal(Todos{todos})\n}", "title": "" }, { "docid": "eb522abcac7a75908e1c25e7d597548b", "score": "0.57807255", "text": "func (c *Client) list(resourcePath, resourceName string, unMarshalListFunc func(body []byte) (T, error)) (T, error) {\n\treq, err := http.NewRequest(\n\t\t\"GET\",\n\t\tfmt.Sprintf(\"%s/auth/admin/%s\", c.URL, resourcePath),\n\t\tnil,\n\t)\n\tif err != nil {\n\t\tlog.Error(err, \"error creating LIST request\", \"resource\", resourceName)\n\t\treturn nil, errors.Wrapf(err, \"error creating LIST %s request\", resourceName)\n\t}\n\n\treq.Header.Add(\"Authorization\", fmt.Sprintf(\"Bearer %s\", c.token))\n\tres, err := c.requester.Do(req)\n\tif err != nil {\n\t\tlog.Error(err, \"error on request\")\n\t\treturn nil, errors.Wrapf(err, \"error performing LIST %s request\", resourceName)\n\t}\n\tdefer res.Body.Close()\n\n\tif res.StatusCode < 200 || res.StatusCode > 299 {\n\t\treturn nil, fmt.Errorf(\"failed to LIST %s: (%d) %s\", resourceName, res.StatusCode, res.Status)\n\t}\n\n\tbody, err := ioutil.ReadAll(res.Body)\n\tif err != nil {\n\t\tlog.Error(err, \"error reading response\")\n\t\treturn nil, errors.Wrapf(err, \"error reading %s LIST response\", resourceName)\n\t}\n\n\tobjs, err := unMarshalListFunc(body)\n\tif err != nil {\n\t\tlog.Error(err, \"Error unmarshalling response\")\n\t\treturn nil, err\n\t}\n\treturn objs, nil\n}", "title": "" }, { "docid": "42b570fcdf64f099d102439b3a051d6b", "score": "0.5775978", "text": "func (f *Fs) List(out fs.ListOpts, dir string) {\n\tdefer out.Finished()\n\tlevel := out.Level()\n\tswitch level {\n\tcase 1:\n\t\tf.listOneLevel(out, dir)\n\tcase fs.MaxLevel:\n\t\tf.list(out, dir)\n\tdefault:\n\t\tout.SetError(fs.ErrorLevelNotSupported)\n\t}\n}", "title": "" }, { "docid": "9908d28e2237ab89f6b45903094c6866", "score": "0.57687086", "text": "func (c *UserController) List(args *msg.UserListArgs,\n\tresponse *msg.UserListResponse) error {\n\tvar err error\n\t*response, err = c.UserRepo.List()\n\n\treturn err\n}", "title": "" }, { "docid": "399d57bd928f2ec29f00f82e0682c9be", "score": "0.5764613", "text": "func (s *Server) ListFactions(w http.ResponseWriter, r *http.Request) {\n\tfactions, err := getFactions(s.DB)\n\tif err != nil {\n\t\trespondWithError(w, http.StatusInternalServerError, err.Error())\n\t\treturn\n\t}\n\n\trespondWithJSON(w, http.StatusOK, factions)\n}", "title": "" }, { "docid": "bd62edd99bdcc2a8d86ecc28da4f5e44", "score": "0.5756463", "text": "func (s *ArchetypesService) List() ([]Archetype, *http.Response, error) {\n\tu := defaultBaseURL + \"archetypes.php\"\n\treq, err := s.client.NewRequest(http.MethodGet, u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tarchetypes := new([]Archetype)\n\tresp, err := s.client.Do(req, archetypes)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn *archetypes, resp, err\n}", "title": "" }, { "docid": "c275ff2675354429d64b0f3470881b18", "score": "0.5749613", "text": "func (d *backupsService) List(ctx context.Context, listReq *ListBackupsRequest) ([]*Backup, error) {\n\treq, err := d.client.newRequest(http.MethodGet, backupsAPIPath(listReq.Organization, listReq.Database, listReq.Branch), nil)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"error creating http request\")\n\t}\n\n\tbackups := &backupsResponse{}\n\tif err := d.client.do(ctx, req, &backups); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn backups.Backups, nil\n}", "title": "" }, { "docid": "35e56e60fbfff8a15be1cc9b740c506b", "score": "0.5743146", "text": "func (s *SimpleFSHandler) SimpleFSReadList(ctx context.Context, arg keybase1.OpID) (keybase1.SimpleFSListResult, error) {\n\tcli, err := s.client(ctx)\n\tif err != nil {\n\t\treturn keybase1.SimpleFSListResult{}, err\n\t}\n\tctx, cancel := s.wrapContextWithTimeout(ctx)\n\tdefer cancel()\n\treturn cli.SimpleFSReadList(ctx, arg)\n}", "title": "" }, { "docid": "df6b073f0101ccc905cc40e59d91f76f", "score": "0.5738105", "text": "func List() Option {\n\treturn func(req *http.Request) {\n\t\treq.URL.Query().Add(\"list\", \"true\")\n\t}\n}", "title": "" }, { "docid": "edf39bac9c3b7fccd5b80f6ad9cf4e8d", "score": "0.5736551", "text": "func (s *TodoService) List() ([]*starter.Todo, error) {\n\tvar result []*starter.Todo\n\tc := s.client.db.session.DB(\"go-starter\").C(\"todo\")\n\terr := c.Find(bson.M{}).All(&result)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn result, err\n}", "title": "" }, { "docid": "5258f6091feba6f82fb6040038a9e7b9", "score": "0.57348263", "text": "func (m *UserManager) List(opts ...RequestOption) (ul *UserList, err error) {\n\terr = m.Request(\"GET\", m.URI(\"users\"), &ul, applyListDefaults(opts))\n\treturn\n}", "title": "" }, { "docid": "72bf6cee1e6ba8e8ee46cc5a2a5f7562", "score": "0.57333237", "text": "func DoList(mlc *admin.MembersListCall) (*admin.Members, error) {\n\tlg.Debug(\"starting DoList()\")\n\tdefer lg.Debug(\"finished DoList()\")\n\n\tmembers, err := mlc.Do()\n\tif err != nil {\n\t\tlg.Error(err)\n\t\treturn nil, err\n\t}\n\n\treturn members, nil\n}", "title": "" }, { "docid": "085a4025aea33af8c49e662e5de4ac21", "score": "0.57213867", "text": "func (m *Client) List(ctx context.Context, q cloudstorage.Query) (*cloudstorage.ObjectsResponse, error) {\n\n\tobjs := &cloudstorage.ObjectsResponse{\n\t\tObjects: make(cloudstorage.Objects, 0),\n\t}\n\n\terr := m.listFiles(ctx, q, objs, m.bucket)\n\tif err != nil {\n\t\tgou.Warnf(\"fetch listFiles error %v\", err)\n\t\treturn nil, err\n\t}\n\tobjs.Objects = q.ApplyFilters(objs.Objects)\n\treturn objs, nil\n}", "title": "" }, { "docid": "766a660c367b501c6cdf5f5be56cec38", "score": "0.5716092", "text": "func (client Mikrotik) List(d Resource) ([]Resource, error) {\n\tcmd := []string{d.ActionToCommand(Find)}\n\tlog.Printf(\"[INFO] Running the mikrotik command: `%s`\", cmd)\n\n\tc, err := client.getMikrotikClient()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tr, err := c.RunArgs(cmd)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlog.Printf(\"[DEBUG] find response: %v\", r)\n\n\ttargetStruct := client.newTargetStruct(d)\n\ttargetSlicePtr := reflect.New(reflect.SliceOf(reflect.Indirect(targetStruct).Type()))\n\ttargetSlice := reflect.Indirect(targetSlicePtr)\n\terr = Unmarshal(*r, targetSlicePtr.Interface())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturnSlice := make([]Resource, 0)\n\tfor i := 0; i < targetSlice.Len(); i++ {\n\t\treturnSlice = append(returnSlice, targetSlice.Index(i).Addr().Interface().(Resource))\n\t}\n\n\treturn returnSlice, nil\n}", "title": "" }, { "docid": "04c64a051c059ffa59236910f62bcfec", "score": "0.5716059", "text": "func (s *Slack) FileList(user, tsFrom, tsTo string, types []string, count, page int) (*FileListResponse, error) {\n\tparams := url.Values{}\n\tappendNotEmpty(\"user\", user, params)\n\tappendNotEmpty(\"ts_from\", tsFrom, params)\n\tappendNotEmpty(\"ts_to\", tsTo, params)\n\tappendNotEmpty(\"types\", strings.Join(types, \",\"), params)\n\tif page > 1 {\n\t\tappendNotEmpty(\"page\", strconv.Itoa(page), params)\n\t}\n\tif count > 0 {\n\t\tappendNotEmpty(\"count\", strconv.Itoa(count), params)\n\t}\n\tr := &FileListResponse{}\n\terr := s.do(\"files.list\", params, r)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn r, nil\n}", "title": "" }, { "docid": "e2d65cfec94ab49ab606ec4970965a5e", "score": "0.571559", "text": "func (cs *ChargebacksService) list(ctx context.Context, uri string, options interface{}) (\n\tres *Response,\n\tcl *ChargebacksList,\n\terr error,\n) {\n\tres, err = cs.client.get(ctx, uri, options)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tif err = json.Unmarshal(res.content, &cl); err != nil {\n\t\treturn\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "c02b391fa5013dd57dba318a870280f9", "score": "0.57127434", "text": "func (a *NFTStorageAPIService) ListExecute(r ApiListRequest) (ListResponse, *_nethttp.Response, error) {\n\tvar (\n\t\tlocalVarHTTPMethod = _nethttp.MethodGet\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarFormFileName string\n\t\tlocalVarFileName string\n\t\tlocalVarFileBytes []byte\n\t\tlocalVarReturnValue ListResponse\n\t)\n\n\tlocalBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, \"NFTStorageAPIService.List\")\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}\n\t}\n\n\tlocalVarPath := localBasePath + \"/\"\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := _neturl.Values{}\n\tlocalVarFormParams := _neturl.Values{}\n\n\tif r.before != nil {\n\t\tlocalVarQueryParams.Add(\"before\", parameterToString(*r.before, \"\"))\n\t}\n\tif r.limit != nil {\n\t\tlocalVarQueryParams.Add(\"limit\", parameterToString(*r.limit, \"\"))\n\t}\n\t// to determine the Content-Type header\n\tlocalVarHTTPContentTypes := []string{}\n\n\t// set Content-Type header\n\tlocalVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)\n\tif localVarHTTPContentType != \"\" {\n\t\tlocalVarHeaderParams[\"Content-Type\"] = localVarHTTPContentType\n\t}\n\n\t// to determine the Accept header\n\tlocalVarHTTPHeaderAccepts := []string{\"application/json\"}\n\n\t// set Accept header\n\tlocalVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)\n\tif localVarHTTPHeaderAccept != \"\" {\n\t\tlocalVarHeaderParams[\"Accept\"] = localVarHTTPHeaderAccept\n\t}\n\treq, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, err\n\t}\n\n\tlocalVarHTTPResponse, err := a.client.callAPI(req)\n\tif err != nil || localVarHTTPResponse == nil {\n\t\treturn localVarReturnValue, localVarHTTPResponse, err\n\t}\n\n\tlocalVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)\n\tlocalVarHTTPResponse.Body.Close()\n\tlocalVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody))\n\tif err != nil {\n\t\treturn localVarReturnValue, localVarHTTPResponse, err\n\t}\n\n\tif localVarHTTPResponse.StatusCode >= 300 {\n\t\tnewErr := GenericOpenAPIError{\n\t\t\tbody: localVarBody,\n\t\t\terror: localVarHTTPResponse.Status,\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 401 {\n\t\t\tvar v UnauthorizedErrorResponse\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 403 {\n\t\t\tvar v ForbiddenErrorResponse\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 500 && localVarHTTPResponse.StatusCode <= 599 {\n\t\t\tvar v ErrorResponse\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t}\n\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t}\n\n\terr = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\tif err != nil {\n\t\tnewErr := GenericOpenAPIError{\n\t\t\tbody: localVarBody,\n\t\t\terror: err.Error(),\n\t\t}\n\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t}\n\n\treturn localVarReturnValue, localVarHTTPResponse, nil\n}", "title": "" }, { "docid": "61e02ceab57125f9ec8033711a1bf84d", "score": "0.570921", "text": "func ListAction(req *http.Request) (interface{}, error) {\n\treturn listActionProcess(req)\n}", "title": "" }, { "docid": "6979b748faee9604842e6dd268ce4ec6", "score": "0.57081634", "text": "func (u users) List(params UsersListParams) (*UserList, error) {\n\tvar userList UserList\n\tif err := u.gateway.sendRequest(http.MethodGet, pathUsers, params, &userList); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &userList, nil\n}", "title": "" }, { "docid": "e01078e8fa6cb52a7aa86f716c302130", "score": "0.57061124", "text": "func (o *WebAccelOp) List(ctx context.Context) (*WebAccelListResult, error) {\n\t// build request URL\n\tpathBuildParameter := map[string]interface{}{\n\t\t\"rootURL\": SakuraCloudAPIRoot,\n\t\t\"pathSuffix\": o.PathSuffix,\n\t\t\"pathName\": o.PathName,\n\t\t\"zone\": APIDefaultZone,\n\t}\n\n\turl, err := buildURL(\"{{.rootURL}}/{{.zone}}/{{.pathSuffix}}/site\", pathBuildParameter)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// build request body\n\tvar body interface{}\n\n\t// do request\n\tdata, err := o.Client.Do(ctx, \"GET\", url, body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// build results\n\tresults, err := o.transformListResults(data)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn results, err\n}", "title": "" }, { "docid": "ea91121a1b0355e8b36f910873fa2b02", "score": "0.56902516", "text": "func (c *TodosController) List(ctx *app.ListTodosContext) error {\n\t// TodosController_List: start_implement\n\n\t// Put your logic here\n\ttdb := models.NewTodoDB(c.db)\n\tt := tdb.ListTodo(ctx.Context)\n\n\t// TodosController_List: end_implement\n\tres := app.TodoCollection{}\n\tres = t\n\treturn ctx.OK(res)\n}", "title": "" }, { "docid": "44d2cb0205e7adca716713d4a837a4a0", "score": "0.5686001", "text": "func listHandle(w http.ResponseWriter, r *http.Request) {\n\tlogs.Info(\"Handle /list/\")\n\ttangkaList, err := tangka.ListAllTangka()\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\ttemplates.ExecuteTemplate(w, \"list.html\", tangkaList)\n}", "title": "" } ]
136b03d2620d33f2bcf5828ed2ddfd49
UnmarshalYAML implements the yaml.Unmarshaler interface for QueryConfig.
[ { "docid": "f227c47f9363574fb6b642b8c2b14f88", "score": "0.84375614", "text": "func (q *QueryConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\ttype plain QueryConfig\n\tif err := unmarshal((*plain)(q)); err != nil {\n\t\treturn err\n\t}\n\n\t// Check required fields\n\tif q.Name == \"\" {\n\t\treturn fmt.Errorf(\"missing name for query %+v\", *q)\n\t}\n\tif q.Query == \"\" {\n\t\treturn fmt.Errorf(\"missing query literal for query %q\", q.Name)\n\t}\n\n\tq.metrics = make([]*MetricConfig, 0, 2)\n\n\treturn checkOverflow(q.XXX, \"metric\")\n}", "title": "" } ]
[ { "docid": "1b99e6633307b2ee1157356002d8ec19", "score": "0.7487236", "text": "func (s *QueryResponse) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\ttype plain QueryResponse\n\tif err := unmarshal((*plain)(s)); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "3743a8dc5d99ce1f851eaa6092a9bfa6", "score": "0.74658257", "text": "func (s *QueryResponse) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\ttype plain QueryResponse\n\tif err := unmarshal((*plain)(s)); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fae9c14439693ee84c518456b8105905", "score": "0.7163741", "text": "func (s *DNSProbe) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\ttype plain DNSProbe\n\tif err := unmarshal((*plain)(s)); err != nil {\n\t\treturn err\n\t}\n\tif s.QueryName == \"\" {\n\t\treturn errors.New(\"Query name must be set for DNS module\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "022d01ce53bf8c915e7d816c0579147f", "score": "0.7102914", "text": "func (s *Adapter) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\ttype rawObj Adapter\n\traw := rawObj{\n\t\tMaxConns: 200000,\n\t\tProtocol: \"tars\",\n\t\tQueueCap: 10000,\n\t\tQueueTimeout: 60000,\n\t\tThreads: 5,\n\t}\n\tif err := unmarshal(&raw); err != nil {\n\t\treturn err\n\t}\n\t*s = Adapter(raw)\n\treturn nil\n}", "title": "" }, { "docid": "3383d851d13e805f22f441ef0968f278", "score": "0.70956546", "text": "func (q *SQSQueueOrBool) UnmarshalYAML(value *yaml.Node) error {\n\tif err := value.Decode(&q.Advanced); err != nil {\n\t\tswitch err.(type) {\n\t\tcase *yaml.TypeError:\n\t\t\tbreak\n\t\tdefault:\n\t\t\treturn err\n\t\t}\n\t}\n\tif !q.Advanced.IsEmpty() {\n\t\t// Unmarshaled successfully to q.Advanced, unset q.Enabled, and return.\n\t\tq.Enabled = nil\n\t\treturn nil\n\t}\n\tif err := value.Decode(&q.Enabled); err != nil {\n\t\treturn errUnmarshalQueueOpts\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "02278f513787f77546a8f8574618878a", "score": "0.6968971", "text": "func (s *DNSProbe) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\t*s = DefaultDNSProbe\n\ttype plain DNSProbe\n\tif err := unmarshal((*plain)(s)); err != nil {\n\t\treturn err\n\t}\n\tif s.QueryName == \"\" {\n\t\treturn errors.New(\"query name must be set for DNS module\")\n\t}\n\tif s.QueryClass != \"\" {\n\t\tif _, ok := dns.StringToClass[s.QueryClass]; !ok {\n\t\t\treturn fmt.Errorf(\"query class '%s' is not valid\", s.QueryClass)\n\t\t}\n\t}\n\tif s.QueryType != \"\" {\n\t\tif _, ok := dns.StringToType[s.QueryType]; !ok {\n\t\t\treturn fmt.Errorf(\"query type '%s' is not valid\", s.QueryType)\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "07b49afc3c92d06c496d140d6dd6b53e", "score": "0.69004697", "text": "func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\tp := &storageProxyType{}\n\tif err := unmarshal(&p); err != nil {\n\t\treturn err\n\t}\n\n\tswitch p.Type {\n\tcase \"mysql\":\n\t\tif p.MySQL == nil {\n\t\t\treturn errors.New(\"storage.Config: couldn't read MySQL configuration\")\n\t\t}\n\t\tc.Type = MySQL\n\t\tc.MySQL = p.MySQL\n\n\tcase \"memory\":\n\t\tc.Type = Memory\n\n\tcase \"\":\n\t\treturn errors.New(\"storage.Config: unspecified storage type\")\n\n\tdefault:\n\t\treturn fmt.Errorf(\"storage.Config: unrecognizeed storage type: %s\", p.Type)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "f4c6f0bfae389c1abe15753930bc710a", "score": "0.6847453", "text": "func (c *Config) UnmarshalYAML(data []byte) error {\n\ttype Alias Config\n\taux := struct {\n\t\tCreationDelay string `yaml:\"creationDelay,omitempty\"`\n\t\t*Alias\n\t}{\n\t\tAlias: (*Alias)(c),\n\t}\n\tif err := yaml.Unmarshal(data, &aux); err != nil {\n\t\treturn err\n\t}\n\n\tdelay, err := time.ParseDuration(aux.CreationDelay)\n\tif err != nil {\n\t\treturn err\n\t}\n\tc.CreationDelay = delay\n\n\treturn nil\n}", "title": "" }, { "docid": "f4c6f0bfae389c1abe15753930bc710a", "score": "0.6847453", "text": "func (c *Config) UnmarshalYAML(data []byte) error {\n\ttype Alias Config\n\taux := struct {\n\t\tCreationDelay string `yaml:\"creationDelay,omitempty\"`\n\t\t*Alias\n\t}{\n\t\tAlias: (*Alias)(c),\n\t}\n\tif err := yaml.Unmarshal(data, &aux); err != nil {\n\t\treturn err\n\t}\n\n\tdelay, err := time.ParseDuration(aux.CreationDelay)\n\tif err != nil {\n\t\treturn err\n\t}\n\tc.CreationDelay = delay\n\n\treturn nil\n}", "title": "" }, { "docid": "a39f2998b26ab4895ec24d0fc328536d", "score": "0.6772587", "text": "func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\ttype configType Config // Use new type to avoid recursion\n\tif err := unmarshal((*configType)(c)); err != nil {\n\t\treturn err\n\t}\n\n\tfor name, t := range c.Tasks {\n\t\tt.Name = name\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "276cd8905e823ded66c5ef6335c42383", "score": "0.6739892", "text": "func (cfg *PeriodicTableConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\tg := struct {\n\t\tPrefix string `yaml:\"prefix\"`\n\t\tPeriod model.Duration `yaml:\"period\"`\n\t\tTags Tags `yaml:\"tags\"`\n\t}{}\n\tif err := unmarshal(&g); err != nil {\n\t\treturn err\n\t}\n\n\tcfg.Prefix = g.Prefix\n\tcfg.Period = time.Duration(g.Period)\n\tcfg.Tags = g.Tags\n\n\treturn nil\n}", "title": "" }, { "docid": "78afcd3b3862d709916eab5930aac96a", "score": "0.6717504", "text": "func (c *CollectorConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\t// Default to undefined (a negative value) so it can be overridden by the global default when not explicitly set.\n\tc.MinInterval = -1\n\n\ttype plain CollectorConfig\n\tif err := unmarshal((*plain)(c)); err != nil {\n\t\treturn err\n\t}\n\n\tif len(c.Metrics) == 0 {\n\t\treturn fmt.Errorf(\"no metrics defined for collector %q\", c.Name)\n\t}\n\n\t// Set metric.query for all metrics: resolve query references (if any) and generate QueryConfigs for literal queries.\n\tqueries := make(map[string]*QueryConfig, len(c.Queries))\n\tfor _, query := range c.Queries {\n\t\tqueries[query.Name] = query\n\t}\n\tfor _, metric := range c.Metrics {\n\t\tif metric.QueryRef != \"\" {\n\t\t\tquery, found := queries[metric.QueryRef]\n\t\t\tif !found {\n\t\t\t\treturn fmt.Errorf(\"unresolved query_ref %q in metric %q of collector %q\", metric.QueryRef, metric.Name, c.Name)\n\t\t\t}\n\t\t\tmetric.query = query\n\t\t\tquery.metrics = append(query.metrics, metric)\n\t\t} else {\n\t\t\t// For literal queries generate a QueryConfig with a name based off collector and metric name.\n\t\t\tmetric.query = &QueryConfig{\n\t\t\t\tName: metric.Name,\n\t\t\t\tQuery: metric.QueryLiteral,\n\t\t\t\tNoPreparedStatement: metric.NoPreparedStatement,\n\t\t\t}\n\t\t}\n\t}\n\n\treturn checkOverflow(c.XXX, \"collector\")\n}", "title": "" }, { "docid": "36f9b226a7f42f8a602bf78b927de8b1", "score": "0.6713887", "text": "func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\t// Apply defaults\n\tc.MaxSegmentAge = defaultMaxSegmentAge\n\ttype plain Config\n\treturn unmarshal((*plain)(c))\n}", "title": "" }, { "docid": "e5ea8d01e9ab7047a22f0868d76eb117", "score": "0.6659941", "text": "func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\ttype raw Config\n\tvar cfg raw\n\tif c.URL != nil {\n\t\t// we used flags to set that value, which already has sane default.\n\t\tcfg = raw(*c)\n\t} else {\n\t\t// force sane defaults.\n\t\tcfg = raw{\n\t\t\tBackoffConfig: backoff.Config{\n\t\t\t\tMaxBackoff: MaxBackoff,\n\t\t\t\tMaxRetries: MaxRetries,\n\t\t\t\tMinBackoff: MinBackoff,\n\t\t\t},\n\t\t\tBatchSize: BatchSize,\n\t\t\tBatchWait: BatchWait,\n\t\t\tTimeout: Timeout,\n\t\t\tStreamLagLabels: []string{\"filename\"},\n\t\t}\n\t}\n\n\tif err := unmarshal(&cfg); err != nil {\n\t\treturn err\n\t}\n\n\t*c = Config(cfg)\n\treturn nil\n}", "title": "" }, { "docid": "6e03ea674763fc1852a7630a924284e6", "score": "0.6630908", "text": "func (c *CrawlFilters) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\tvar cfg struct {\n\t\tRestrict string `yaml:\"restrict,omitempty\"`\n\t\tExclude string `yaml:\"exclude,omitempty\"`\n\t}\n\n\tif err := unmarshal(&cfg); err != nil {\n\t\treturn err\n\t}\n\n\t// All filters are optional, so we need to make sure one has been filled\n\t// before trying to parse it.\n\tif len(cfg.Restrict) > 0 {\n\t\trestrict, err := regexp.Compile(cfg.Restrict)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tc.Restrict = restrict\n\t}\n\tif len(cfg.Exclude) > 0 {\n\t\texclude, err := regexp.Compile(cfg.Exclude)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tc.Exclude = exclude\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "27756d4b90057eac3c3aca226f50f9a4", "score": "0.6596543", "text": "func (fc *FeedsConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\tvar cfg struct {\n\t\tType string `yaml:\"type\"`\n\t\tNbItems int `yaml:\"nb_items\"`\n\t\tInterface string `yaml:\"interface\"`\n\t\tPort int `yaml:\"port\"`\n\t}\n\n\tif err := unmarshal(&cfg); err != nil {\n\t\treturn err\n\t}\n\n\tswitch cfg.Type {\n\tcase \"rss\":\n\t\tfc.Type = FeedTypeRSS\n\t\tbreak\n\tcase \"atom\":\n\t\tfc.Type = FeedTypeAtom\n\t\tbreak\n\tdefault:\n\t\treturn fmt.Errorf(\"Invalid feed type: %s\", cfg.Type)\n\t}\n\n\tfc.NbItems = cfg.NbItems\n\tfc.Interface = cfg.Interface\n\tfc.Port = cfg.Port\n\n\treturn nil\n}", "title": "" }, { "docid": "a63d113aeb5a94c2fd78263a46ec037e", "score": "0.65828454", "text": "func (conf *Config) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\ttype confAlias Config\n\taliased := confAlias(NewConfig())\n\n\tdefaultFields := aliased.StaticFields\n\taliased.StaticFields = nil\n\n\tif err := unmarshal(&aliased); err != nil {\n\t\treturn err\n\t}\n\n\tif aliased.StaticFields == nil {\n\t\taliased.StaticFields = defaultFields\n\t}\n\n\t*conf = Config(aliased)\n\treturn nil\n}", "title": "" }, { "docid": "a59a33588c997af4fafda41b7222c135", "score": "0.654149", "text": "func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\t*c = DefaultConfig\n\n\ttype plain Config\n\treturn unmarshal((*plain)(c))\n}", "title": "" }, { "docid": "a59a33588c997af4fafda41b7222c135", "score": "0.654149", "text": "func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\t*c = DefaultConfig\n\n\ttype plain Config\n\treturn unmarshal((*plain)(c))\n}", "title": "" }, { "docid": "5a3ac739de072b92e2d9cfd609581bf1", "score": "0.6504813", "text": "func (s *GRPCProbe) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\t*s = DefaultGRPCProbe\n\ttype plain GRPCProbe\n\tif err := unmarshal((*plain)(s)); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ef024dfe156463ad37aa14fbe6a4542e", "score": "0.64943343", "text": "func (g *GlobalConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\t// Default to running the queries on every scrape.\n\tg.MinInterval = model.Duration(0)\n\t// Default to 10 seconds, since Prometheus has a 10 second scrape timeout default.\n\tg.ScrapeTimeout = model.Duration(10 * time.Second)\n\t// Default to .5 seconds.\n\tg.TimeoutOffset = model.Duration(500 * time.Millisecond)\n\tg.MaxConns = 3\n\tg.MaxIdleConns = 3\n\tg.MaxConnLifetime = time.Duration(0)\n\n\ttype plain GlobalConfig\n\tif err := unmarshal((*plain)(g)); err != nil {\n\t\treturn err\n\t}\n\n\tif g.TimeoutOffset <= 0 {\n\t\treturn fmt.Errorf(\"global.scrape_timeout_offset must be strictly positive, have %s\", g.TimeoutOffset)\n\t}\n\n\treturn checkOverflow(g.XXX, \"global\")\n}", "title": "" }, { "docid": "c37b257c46d523645ae626d0f44ca401", "score": "0.64843124", "text": "func (conf *Config) UnmarshalYAML(value *yaml.Node) error {\n\ttype confAlias Config\n\taliased := confAlias(NewConfig())\n\n\terr := value.Decode(&aliased)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"line %v: %v\", value.Line, err)\n\t}\n\n\tvar spec docs.ComponentSpec\n\tif aliased.Type, spec, err = docs.GetInferenceCandidateFromYAML(nil, docs.TypeCache, aliased.Type, value); err != nil {\n\t\treturn fmt.Errorf(\"line %v: %w\", value.Line, err)\n\t}\n\n\tif spec.Plugin {\n\t\tpluginNode, err := docs.GetPluginConfigYAML(aliased.Type, value)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"line %v: %v\", value.Line, err)\n\t\t}\n\t\tif spec, exists := pluginSpecs[aliased.Type]; exists && spec.confConstructor != nil {\n\t\t\tconf := spec.confConstructor()\n\t\t\tif err = pluginNode.Decode(conf); err != nil {\n\t\t\t\treturn fmt.Errorf(\"line %v: %v\", value.Line, err)\n\t\t\t}\n\t\t\taliased.Plugin = conf\n\t\t} else {\n\t\t\taliased.Plugin = &pluginNode\n\t\t}\n\t} else {\n\t\taliased.Plugin = nil\n\t}\n\n\t*conf = Config(aliased)\n\treturn nil\n}", "title": "" }, { "docid": "38ea45f194f749d01b2f1af5c2519a25", "score": "0.6462357", "text": "func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\t*c = DefaultConfig\n\ttype plain Config\n\treturn unmarshal((*plain)(c))\n}", "title": "" }, { "docid": "57a87056f96a54ebcbdf68ae20bf51fd", "score": "0.64509636", "text": "func (p *ParameterMap) UnmarshalYAML(um func(interface{}) error) error {\n\tvar ys map[string]map[string]interface{}\n\tif err := um(&ys); err != nil {\n\t\treturn err\n\t}\n\t*p = make(map[string]Parameter, len(ys))\n\n\tvar err error\n\tfor k, y := range ys {\n\t\tif (*p)[k], err = unmarshalParameter(y); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "c4e4509fafe961c77b2b001c0de7ae63", "score": "0.644083", "text": "func (cf *CacheFrom) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\tvar single string\n\terr := unmarshal(&single)\n\tif err == nil {\n\t\t*cf = CacheFrom{single}\n\t\treturn nil\n\t}\n\n\tvar multi []string\n\terr = unmarshal(&multi)\n\tif err == nil {\n\t\t*cf = multi\n\t\treturn nil\n\t}\n\n\treturn err\n}", "title": "" }, { "docid": "f8c42e7b0fffe8a694800d431eadda04", "score": "0.6432853", "text": "func (s *Storage) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\tvar storageMeta struct {\n\t\tType string `yaml:\"type\"`\n\t}\n\tif err := unmarshal(&storageMeta); err != nil {\n\t\treturn err\n\t}\n\ts.Type = storageMeta.Type\n\tvar c struct {\n\t\tConfig StorageConfig `yaml:\"config\"`\n\t}\n\tswitch storageMeta.Type {\n\tcase \"kubernetes\":\n\t\tc.Config = &kubernetes.Config{}\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown storage type %q\", storageMeta.Type)\n\t}\n\tif err := unmarshal(c); err != nil {\n\t\treturn err\n\t}\n\ts.Config = c.Config\n\treturn nil\n}", "title": "" }, { "docid": "9867579ebad0c797c2f71d7035a6c38e", "score": "0.6429698", "text": "func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\ttype config Config\n\tif err := unmarshal(&c.Config); err != nil {\n\t\treturn err\n\t}\n\treturn unmarshal((*config)(c))\n}", "title": "" }, { "docid": "1583c801829295044615bf3f75bab6e9", "score": "0.63914037", "text": "func (mapping *Mapping) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\tvar tmp map[string]string\n\tif err := unmarshal(&tmp); err != nil {\n\t\treturn err\n\t}\n\tmapping.fromMap(tmp)\n\treturn nil\n}", "title": "" }, { "docid": "fa544fe8ec4e7deaea9b474f02278351", "score": "0.6381551", "text": "func (t *TargetConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\ttype plain TargetConfig\n\tif err := unmarshal((*plain)(t)); err != nil {\n\t\treturn err\n\t}\n\n\tif t.AwsSecretName != \"\" {\n\t\tt.DSN = readDSNFromAwsSecretManager(t.AwsSecretName)\n\t}\n\n\t// Check required fields\n\tif t.DSN == \"\" {\n\t\treturn fmt.Errorf(\"missing data_source_name for target %+v\", t)\n\t}\n\tif err := checkCollectorRefs(t.CollectorRefs, \"target\"); err != nil {\n\t\treturn err\n\t}\n\n\treturn checkOverflow(t.XXX, \"target\")\n}", "title": "" }, { "docid": "eb8ea8eb9198c105bb8267876bd6fc72", "score": "0.6374141", "text": "func (p *Parameters) UnmarshalYAML(um func(interface{}) error) error {\n\tvar ys []map[string]interface{}\n\tif err := um(&ys); err != nil {\n\t\treturn err\n\t}\n\n\t*p = make(Parameters, len(ys))\n\n\tvar err error\n\tfor i, y := range ys {\n\t\tif (*p)[i], err = unmarshalParameter(y); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "987bf862a40c71ffd770dadb9720e10f", "score": "0.63714373", "text": "func (b *Bind) UnmarshalYAML(u func(interface{}) error) error {\n\ttype rawBind Bind\n\traw := rawBind{\n\t\tNoWait: false,\n\n\t\tArguments: make(map[string]interface{}),\n\t}\n\tif err := u(&raw); err != nil {\n\t\treturn err\n\t}\n\n\t*b = Bind(raw)\n\n\treturn nil\n}", "title": "" }, { "docid": "989a8b041b159cef439f4ac876db96c7", "score": "0.6363936", "text": "func (c *SDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\t*c = DefaultSDConfig\n\ttype plain SDConfig\n\terr := unmarshal((*plain)(c))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif c.Role == \"\" {\n\t\treturn errors.New(\"role missing (one of: robot, hcloud)\")\n\t}\n\treturn c.HTTPClientConfig.Validate()\n}", "title": "" }, { "docid": "2a9cb052b5fcb980c90148d6dc27b17c", "score": "0.6357703", "text": "func (a *ArraySchema) UnmarshalYAML(um func(interface{}) error) error {\n\tvar y struct {\n\t\tSchemaFields `yaml:\",inline\"`\n\t\tArrayFields `yaml:\",inline\"`\n\t\tItems yaml.MapSlice\n\t}\n\n\tif err := um(&y); err != nil {\n\t\treturn err\n\t}\n\n\ta.SchemaFields = y.SchemaFields\n\ta.ArrayFields = y.ArrayFields\n\n\tvar err error\n\ta.Items, err = unmarshalSchema(y.Items)\n\treturn err\n}", "title": "" }, { "docid": "b2077b22fab49a637ad0a182077d89cb", "score": "0.6357302", "text": "func (v *Value) UnmarshalYAML(dst interface{}) error {\n\ttext, err := v.Raw()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn yaml.Unmarshal([]byte(text), dst)\n}", "title": "" }, { "docid": "5a56ec04821db3ce675b8d5d55c4f6d0", "score": "0.63495874", "text": "func (s *Config) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\ttype plain Config\n\tif err := unmarshal((*plain)(s)); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5a56ec04821db3ce675b8d5d55c4f6d0", "score": "0.63495874", "text": "func (s *Config) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\ttype plain Config\n\tif err := unmarshal((*plain)(s)); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fa4c1a8b297aa6c99c8c5c96caa3721c", "score": "0.6344131", "text": "func (g *Grpc) UnmarshalYAML(node *yaml.Node) (err error) {\n\tif node.Kind != yaml.MappingNode {\n\t\treturn errors.New(withLoc(\"grpc must be an object\", node))\n\t}\n\n\tms := node.Content\n\ttop := len(ms)\n\tfor i := 0; i < top; i += 2 {\n\t\tkv, err := stringKey(ms[i])\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tv := ms[i+1]\n\t\tswitch kv {\n\t\tcase \"maxReceiveSize\":\n\t\t\tval, err := resource.ParseQuantity(v.Value)\n\t\t\tif err != nil {\n\t\t\t\tdlog.Warningf(parseContext, \"unable to parse quantity %q: %v\", v.Value, withLoc(err.Error(), ms[i]))\n\t\t\t} else {\n\t\t\t\tg.MaxReceiveSize = val\n\t\t\t}\n\t\tdefault:\n\t\t\tif parseContext != nil {\n\t\t\t\tdlog.Warn(parseContext, withLoc(fmt.Sprintf(\"unknown key %q\", kv), ms[i]))\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "046f3d7ad9ad7dc9b6364547e68edc55", "score": "0.6342346", "text": "func (p *Params) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\tvar m map[interface{}]interface{}\n\terr := unmarshal(&m)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t*p = Params(cleanMap(m))\n\treturn nil\n}", "title": "" }, { "docid": "ad9acf271e3b0745da1b2f2886fac6bf", "score": "0.6329065", "text": "func (d *TestDuration) UnmarshalYAML(b []byte) error {\n\tvar s string\n\tif err := yaml.Unmarshal(b, &s); err != nil {\n\t\treturn err\n\t}\n\ttd, err := time.ParseDuration(s)\n\tif err != nil {\n\t\treturn err\n\t}\n\t*d = TestDuration(td)\n\treturn nil\n}", "title": "" }, { "docid": "36ab0fa3681e1f10341e7d982c23cd6e", "score": "0.6297772", "text": "func (c *Cloud) UnmarshalYAML(node *yaml.Node) (err error) {\n\tif node.Kind != yaml.MappingNode {\n\t\treturn errors.New(withLoc(\"cloud must be an object\", node))\n\t}\n\n\tms := node.Content\n\ttop := len(ms)\n\tfor i := 0; i < top; i += 2 {\n\t\tkv, err := stringKey(ms[i])\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tv := ms[i+1]\n\t\tswitch kv {\n\t\tcase \"skipLogin\":\n\t\t\tval, err := strconv.ParseBool(v.Value)\n\t\t\tif err != nil {\n\t\t\t\tdlog.Warn(parseContext, withLoc(fmt.Sprintf(\"bool expected for key %q\", kv), ms[i]))\n\t\t\t} else {\n\t\t\t\tc.SkipLogin = val\n\t\t\t}\n\t\tcase \"refreshMessages\":\n\t\t\tduration, err := time.ParseDuration(v.Value)\n\t\t\tif err != nil {\n\t\t\t\tdlog.Warn(parseContext, withLoc(fmt.Sprintf(\"duration expected for key %q\", kv), ms[i]))\n\t\t\t} else {\n\t\t\t\tc.RefreshMessages = duration\n\t\t\t}\n\t\tcase \"systemaHost\":\n\t\t\tc.SystemaHost = v.Value\n\t\tcase \"systemaPort\":\n\t\t\tc.SystemaPort = v.Value\n\t\tdefault:\n\t\t\tif parseContext != nil {\n\t\t\t\tdlog.Warn(parseContext, withLoc(fmt.Sprintf(\"unknown key %q\", kv), ms[i]))\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6c33a34360473cf393186499d247863f", "score": "0.6283287", "text": "func (c *AzureADConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\ttype plain AzureADConfig\n\t*c = AzureADConfig{}\n\tif err := unmarshal((*plain)(c)); err != nil {\n\t\treturn err\n\t}\n\treturn c.Validate()\n}", "title": "" }, { "docid": "41780d173de3ad260fc33a3bfa791222", "score": "0.62765664", "text": "func (t *FIFOAdvanceConfigOrBool) UnmarshalYAML(value *yaml.Node) error {\n\tif err := value.Decode(&t.Advanced); err != nil {\n\t\tvar yamlTypeErr *yaml.TypeError\n\t\tif !errors.As(err, &yamlTypeErr) {\n\t\t\treturn err\n\t\t}\n\t}\n\tif !t.Advanced.IsEmpty() {\n\t\treturn nil\n\t}\n\tif err := value.Decode(&t.Enable); err != nil {\n\t\treturn errUnmarshalFifoConfig\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "30242997eca5522c9cc0e9ca240cba69", "score": "0.6275329", "text": "func (c *Configuration) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\tvar cfg struct {\n\t\tServices DynamicConfiguration `yaml:\"services\"`\n\t\tService *etcdclient.Configuration `yaml:\"service\"`\n\t\tStatic *StaticCluster `yaml:\"static\"`\n\t\tStatics StaticConfiguration `yaml:\"statics\"`\n\t\tSeedNodes *SeedNodesConfig `yaml:\"seedNodes\"`\n\t}\n\n\tif err := unmarshal(&cfg); err != nil {\n\t\treturn err\n\t}\n\n\tc.SeedNodes = cfg.SeedNodes\n\tc.Statics = cfg.Statics\n\tif cfg.Static != nil {\n\t\tc.Statics = StaticConfiguration{cfg.Static}\n\t}\n\tc.Services = cfg.Services\n\tif cfg.Service != nil {\n\t\tc.Services = DynamicConfiguration{\n\t\t\t&DynamicCluster{Service: cfg.Service},\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "2385bfb5ede0f05a8190f7c90239ad90", "score": "0.6274104", "text": "func (c *Connector) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\tvar connectorMetadata struct {\n\t\tType string `yaml:\"type\"`\n\t\tName string `yaml:\"name\"`\n\t\tID string `yaml:\"id\"`\n\t}\n\tif err := unmarshal(&connectorMetadata); err != nil {\n\t\treturn err\n\t}\n\tc.Type = connectorMetadata.Type\n\tc.Name = connectorMetadata.Name\n\tc.ID = connectorMetadata.ID\n\n\tswitch c.Type {\n\tcase \"mock\":\n\t\tvar config struct {\n\t\t\tConfig mock.Config `yaml:\"config\"`\n\t\t}\n\t\tif err := unmarshal(&config); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tc.Config = &config.Config\n\tcase \"ldap\":\n\t\tvar config struct {\n\t\t\tConfig ldap.Config `yaml:\"config\"`\n\t\t}\n\t\tif err := unmarshal(&config); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tc.Config = &config.Config\n\tcase \"github\":\n\t\tvar config struct {\n\t\t\tConfig github.Config `yaml:\"config\"`\n\t\t}\n\t\tif err := unmarshal(&config); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tc.Config = &config.Config\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown connector type %q\", c.Type)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3109f02450734c2d3b05e4ba81a58012", "score": "0.62710935", "text": "func (s *Config) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\ttype plain Config\n\tif err := unmarshal((*plain)(s)); err != nil {\n\t\treturn err\n\t}\n\tif err := checkOverflow(s.XXX, \"config\"); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9dba04c5a18deb181ea8ab68e1da3f63", "score": "0.6268958", "text": "func (s *HTTPProbe) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\ttype plain HTTPProbe\n\tif err := unmarshal((*plain)(s)); err != nil {\n\t\treturn err\n\t}\n\tif err := s.HTTPClientConfig.Validate(); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "62401d53be5c53531f9be8211d943bd2", "score": "0.6268207", "text": "func (a *AllOfSchema) UnmarshalYAML(um func(interface{}) error) error {\n\tvar ay struct {\n\t\tSchemaFields `yaml:\",inline\"`\n\t\tAllOf []yaml.MapSlice `yaml:\"allOf\"`\n\t}\n\tif err := um(&ay); err != nil {\n\t\treturn err\n\t}\n\ta.AllOf = make([]Schema, len(ay.AllOf))\n\n\tvar err error\n\tfor i, y := range ay.AllOf {\n\t\tif a.AllOf[i], err = unmarshalSchema(y); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "ddcee8e83fc1867a7c3a6cbe5fcc6ef9", "score": "0.6231159", "text": "func (o *Options) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\tvar ms yaml.MapSlice\n\tif err := unmarshal(&ms); err != nil {\n\t\treturn err\n\t}\n\n\toptions, err := getOptionsWithOrder(ms)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t*o = options\n\n\treturn nil\n}", "title": "" }, { "docid": "e7e488be9a176bdec70c549efbb92b6d", "score": "0.62138677", "text": "func (rk *RestrictionKey) UnmarshalYAML(value *yaml.Node) error {\n\ts := value.Value\n\tif s == \"\" {\n\t\treturn errors.New(\"empty value in unmarshal grant type\")\n\t}\n\t*rk = NewRestrictionKey(s)\n\tif !rk.Valid() {\n\t\treturn errors.Errorf(valueNotValidFmt, s)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5949def8ffef7b9a4053c68b3678f29b", "score": "0.62001896", "text": "func (s *ICMPProbe) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\ttype plain ICMPProbe\n\tif err := unmarshal((*plain)(s)); err != nil {\n\t\treturn err\n\t}\n\n\tif runtime.GOOS == \"windows\" && s.DontFragment {\n\t\treturn errors.New(\"\\\"dont_fragment\\\" is not supported on windows platforms\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1017c9c698d9863657a00ba24ec91b90", "score": "0.6181367", "text": "func (e *HealthCheck) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\tvar err error\n\tee := &HealthCheck{}\n\ttype plain HealthCheck\n\tif err = unmarshal((*plain)(ee)); err != nil {\n\t\treturn fmt.Errorf(\"health_check.%s\", err.Error())\n\t}\n\n\t*e = *ee\n\n\t// if err = validator.Validate(e); err != nil {\n\t// \treturn fmt.Errorf(\"health_check.%s\", err.Error())\n\t// }\n\treturn nil\n}", "title": "" }, { "docid": "1266a9ffb55f22f221659d37d664b772", "score": "0.61611724", "text": "func (s *Size) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\tvar tmap map[string]int\n\tif err := unmarshal(&tmap); err != nil {\n\t\treturn err\n\t}\n\tfor k, v := range tmap {\n\t\tswitch SizeType(k) {\n\t\tcase Square, Max, MaxHeight, MaxWidth:\n\t\t\ts.Type = SizeType(k)\n\t\t\ts.Value = v\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"Invalid size in config: %s\", k)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b0029e8103faa35133367bd5f58cb7d1", "score": "0.6159425", "text": "func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\ttype plain Config\n\tif err := unmarshal((*plain)(c)); err != nil {\n\t\treturn err\n\t}\n\n\tif c.Globals == nil {\n\t\tc.Globals = &GlobalConfig{}\n\t\t// Force a dummy unmarshall to populate global defaults\n\t\tif err := c.Globals.UnmarshalYAML(func(interface{}) error { return nil }); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif (len(c.Jobs) == 0) == (c.Target == nil) {\n\t\treturn fmt.Errorf(\"exactly one of `jobs` and `target` must be defined\")\n\t}\n\n\t// Load any externally defined collectors.\n\tif err := c.loadCollectorFiles(); err != nil {\n\t\treturn err\n\t}\n\n\t// Populate collector references for the target/jobs.\n\tcolls := make(map[string]*CollectorConfig)\n\tfor _, coll := range c.Collectors {\n\t\t// Set the min interval to the global default if not explicitly set.\n\t\tif coll.MinInterval < 0 {\n\t\t\tcoll.MinInterval = c.Globals.MinInterval\n\t\t}\n\t\tif _, found := colls[coll.Name]; found {\n\t\t\treturn fmt.Errorf(\"duplicate collector name: %s\", coll.Name)\n\t\t}\n\t\tcolls[coll.Name] = coll\n\t}\n\tif c.Target != nil {\n\t\tcs, err := resolveCollectorRefs(c.Target.CollectorRefs, colls, \"target\")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tc.Target.collectors = cs\n\t}\n\tfor _, j := range c.Jobs {\n\t\tcs, err := resolveCollectorRefs(j.CollectorRefs, colls, fmt.Sprintf(\"job %q\", j.Name))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tj.collectors = cs\n\t}\n\n\treturn checkOverflow(c.XXX, \"config\")\n}", "title": "" }, { "docid": "1c865bff94d3323183500636b7175170", "score": "0.6152141", "text": "func (iw *ProviderConfigYAMLWrapper) UnmarshalYAML(n *yaml.Node) error {\n\ttype inputWrapper ProviderConfigYAMLWrapper\n\ttype T struct {\n\t\t*inputWrapper `yaml:\",inline\"`\n\t\tWrapper yaml.Node `yaml:\"value\"`\n\t}\n\n\tobj := &T{inputWrapper: (*inputWrapper)(iw)}\n\tif err := n.Decode(obj); err != nil {\n\t\treturn err\n\t}\n\n\tswitch iw.Type {\n\tcase \"cosmos\":\n\t\tiw.Value = new(cosmos.CosmosProviderConfig)\n\tcase \"penumbra\":\n\t\tiw.Value = new(penumbra.PenumbraProviderConfig)\n\tdefault:\n\t\treturn fmt.Errorf(\"%s is an invalid chain type, check your config file\", iw.Type)\n\t}\n\n\treturn obj.Wrapper.Decode(iw.Value)\n}", "title": "" }, { "docid": "e2195157d8474d074b0acd81c0fe3f00", "score": "0.61279446", "text": "func (d *DatabaseTLSMode) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\t// try as number first.\n\ttype loopBreaker DatabaseTLSMode\n\tvar val loopBreaker\n\tif err := unmarshal(&val); err == nil {\n\t\t*d = DatabaseTLSMode(val)\n\t\treturn nil\n\t}\n\n\t// fallback to string.\n\tvar s string\n\tif err := unmarshal(&s); err != nil {\n\t\treturn trace.Wrap(err)\n\t}\n\treturn d.decodeName(s)\n}", "title": "" }, { "docid": "2b16b245be36146a7196e2a24d4f5e15", "score": "0.61211866", "text": "func UnmarshalYAML(in []byte, out interface{}) error {\n\terr := yaml.Unmarshal(in, out)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = SetDefaults(out)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = validator.Validate(out)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a3331b8466b595f92b698c5dd0ee7062", "score": "0.6109906", "text": "func (s *SchemaMap) UnmarshalYAML(um func(interface{}) error) error {\n\tvar ys yaml.MapSlice\n\tif err := um(&ys); err != nil {\n\t\treturn err\n\t}\n\t*s = make(SchemaMap, len(ys))\n\n\tfor i, y := range ys {\n\t\tv, err := unmarshalSchema(y.Value.(yaml.MapSlice))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t(*s)[i] = struct {\n\t\t\tName string\n\t\t\tSchema Schema\n\t\t}{y.Key.(string), v}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "90a704b46ddb72c678165cb943b925e8", "score": "0.61003846", "text": "func (s *DNSRRValidator) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\ttype plain DNSRRValidator\n\tif err := unmarshal((*plain)(s)); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "90a704b46ddb72c678165cb943b925e8", "score": "0.61003846", "text": "func (s *DNSRRValidator) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\ttype plain DNSRRValidator\n\tif err := unmarshal((*plain)(s)); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "92f9f15d979be1a0c93e669cd59e8485", "score": "0.6086141", "text": "func (as *ApplicationService) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\tvar t1 struct {\n\t\tCommand []string `yaml:\"command,omitempty\"`\n\t\tEnvironment map[string]string `yaml:\"environment,omitempty\"`\n\t}\n\terr := unmarshal(&t1)\n\tif err == nil {\n\t\tas.Command = t1.Command\n\t\tas.Environment = t1.Environment\n\t\treturn nil\n\t}\n\tvar t2 struct {\n\t\tCommand string `yaml:\"command,omitempty\"`\n\t\tEnvironment map[string]string `yaml:\"environment,omitempty\"`\n\t}\n\terr = unmarshal(&t2)\n\tif err == nil {\n\t\tas.Command = strings.Fields(t2.Command)\n\t\tas.Environment = t2.Environment\n\t\treturn nil\n\t}\n\treturn err\n}", "title": "" }, { "docid": "40127c2f39ae4f6ba35fd0b4777ebe9a", "score": "0.60708916", "text": "func (r *TestResult) UnmarshalYAML(b []byte) error {\n\tvar s string\n\tif err := yaml.Unmarshal(b, &s); err != nil {\n\t\treturn err\n\t}\n\tswitch s {\n\tcase testResultPassedString:\n\t\t*r = TestResultPassed\n\tcase testResultFailedString:\n\t\t*r = TestResultFailed\n\tcase testResultSkippedString:\n\t\t*r = TestResultSkipped\n\tcase testResultUndefinedString:\n\t\t*r = TestResultUndefined\n\tdefault:\n\t\treturn fmt.Errorf(\"invalid test result %s\", s)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "16d77dd42f89594c928a8d204f394956", "score": "0.60644245", "text": "func (b *BodyParameter) UnmarshalYAML(um func(interface{}) error) error {\n\tvar y struct {\n\t\tParameterFields `yaml:\",inline\"`\n\t\tSchema yaml.MapSlice\n\t}\n\n\tif err := um(&y); err != nil {\n\t\treturn err\n\t}\n\n\tb.ParameterFields = y.ParameterFields\n\n\tvar err error\n\tb.Schema, err = unmarshalSchema(y.Schema)\n\treturn err\n}", "title": "" }, { "docid": "d4dfbef7b639b7b433afcc9626c1436b", "score": "0.6063602", "text": "func unmarshalYAML(data []byte) *Config {\n\tvar config *Config\n\terr := yaml.Unmarshal(data, &config)\n\tif err != nil {\n\t\terr = displaySyntaxError(data, err)\n\t\tpanic(StatusError{err, 65})\n\t}\n\treturn config\n}", "title": "" }, { "docid": "ddfd8633d7eec5f10955d55791c41c44", "score": "0.6062374", "text": "func (ll *LogLevels) UnmarshalYAML(node *yaml.Node) (err error) {\n\tif node.Kind != yaml.MappingNode {\n\t\treturn errors.New(withLoc(\"timeouts must be an object\", node))\n\t}\n\n\tms := node.Content\n\ttop := len(ms)\n\tfor i := 0; i < top; i += 2 {\n\t\tkv, err := stringKey(ms[i])\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tv := ms[i+1]\n\t\tlevel, err := logrus.ParseLevel(v.Value)\n\t\tif err != nil {\n\t\t\treturn errors.New(withLoc(\"invalid log-level\", v))\n\t\t}\n\t\tswitch kv {\n\t\tcase \"userDaemon\":\n\t\t\tll.UserDaemon = level\n\t\tcase \"rootDaemon\":\n\t\t\tll.RootDaemon = level\n\t\tdefault:\n\t\t\tif parseContext != nil {\n\t\t\t\tdlog.Warn(parseContext, withLoc(fmt.Sprintf(\"unknown key %q\", kv), ms[i]))\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2f781b0d5b0c2da36fd6c7c1b58ffec3", "score": "0.60502416", "text": "func (c *TLSConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\ttype plain TLSConfig\n\tif err := unmarshal((*plain)(c)); err != nil {\n\t\treturn err\n\t}\n\treturn checkOverflow(c.XXX, \"TLS config\")\n}", "title": "" }, { "docid": "51450723995b4a834f9f19fe2389231a", "score": "0.6046301", "text": "func (m *MetricConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\ttype plain MetricConfig\n\tif err := unmarshal((*plain)(m)); err != nil {\n\t\treturn err\n\t}\n\n\t// Check required fields\n\tif m.Name == \"\" {\n\t\treturn fmt.Errorf(\"missing name for metric %+v\", m)\n\t}\n\tif m.TypeString == \"\" {\n\t\treturn fmt.Errorf(\"missing type for metric %q\", m.Name)\n\t}\n\tif m.Help == \"\" {\n\t\treturn fmt.Errorf(\"missing help for metric %q\", m.Name)\n\t}\n\tif (m.QueryLiteral == \"\") == (m.QueryRef == \"\") {\n\t\treturn fmt.Errorf(\"exactly one of query and query_ref must be specified for metric %q\", m.Name)\n\t}\n\n\tswitch strings.ToLower(m.TypeString) {\n\tcase \"counter\":\n\t\tm.valueType = prometheus.CounterValue\n\tcase \"gauge\":\n\t\tm.valueType = prometheus.GaugeValue\n\tdefault:\n\t\treturn fmt.Errorf(\"unsupported metric type: %s\", m.TypeString)\n\t}\n\n\t// Check for duplicate key labels\n\tfor i, li := range m.KeyLabels {\n\t\tif err := checkLabel(li, \"metric\", m.Name); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfor _, lj := range m.KeyLabels[i+1:] {\n\t\t\tif li == lj {\n\t\t\t\treturn fmt.Errorf(\"duplicate key label %q for metric %q\", li, m.Name)\n\t\t\t}\n\t\t}\n\t\tif m.ValueLabel == li {\n\t\t\treturn fmt.Errorf(\"duplicate label %q (defined in both key_labels and value_label) for metric %q\", li, m.Name)\n\t\t}\n\t}\n\n\tif len(m.Values) == 0 {\n\t\treturn fmt.Errorf(\"no values defined for metric %q\", m.Name)\n\t}\n\n\tif len(m.Values) > 1 {\n\t\t// Multiple value columns but no value label to identify them\n\t\tif m.ValueLabel == \"\" {\n\t\t\treturn fmt.Errorf(\"value_label must be defined for metric with multiple values %q\", m.Name)\n\t\t}\n\t\tif err := checkLabel(m.ValueLabel, \"value_label for metric\", m.Name); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn checkOverflow(m.XXX, \"metric\")\n}", "title": "" }, { "docid": "3ad312087d3225c96db7ea0310ccda47", "score": "0.6029562", "text": "func (va *ValAddress) UnmarshalYAML(data []byte) error {\n\tvar s string\n\n\terr := yaml.Unmarshal(data, &s)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tva2, err := ValAddressFromBech32(s)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t*va = va2\n\treturn nil\n}", "title": "" }, { "docid": "dc954542233e5ce482f8f32c3fd06fab", "score": "0.6026542", "text": "func (u *Url) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\tvar s string\n\n\t// Unmarshal the value into a string\n\terr := unmarshal(&s)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Parse the URL string into a url.URL type\n\ttarget, err := url.Parse(strings.TrimSuffix(s, \"/\"))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Set the anonymous field on u\n\tu.URL = target\n\n\t// Return nil error\n\treturn nil\n}", "title": "" }, { "docid": "b5b02386ffbd66e4d51333dc1fd0afb7", "score": "0.6023492", "text": "func (key *SecretKey) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\tvar stringValue string\n\terr := unmarshal(&stringValue)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn key.Decode(stringValue)\n}", "title": "" }, { "docid": "e920218382affb9bc92eddbdd7ab9c8c", "score": "0.6018145", "text": "func (d *Duration) UnmarshalYAML(value *yaml.Node) error {\n\tvar err error\n\n\td.Duration, err = time.ParseDuration(value.Value)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "b4cc24b5d149c9d23d4575f3c686a4ad", "score": "0.60157067", "text": "func (sl *SourceLocation) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\ts := \"\"\n\tif err := unmarshal(&s); err != nil {\n\t\treturn err\n\t}\n\tvar err error\n\t*sl, err = ParseSourceLocation(s)\n\treturn err\n}", "title": "" }, { "docid": "b018f8c4800d252a636815d9738d1bd5", "score": "0.601012", "text": "func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\tinternal := &internalCluster{}\n\tif err := unmarshal(internal); err != nil {\n\t\treturn err\n\t}\n\n\tc.ClusterConfig = *gocql.NewCluster(internal.Hosts...)\n\tif internal.CQLVersion != nil {\n\t\tc.CQLVersion = *internal.CQLVersion\n\t}\n\n\tif internal.ProtoVersion != nil {\n\t\tc.ProtoVersion = *internal.ProtoVersion\n\t}\n\n\tif internal.Timeout != nil {\n\t\tc.Timeout = *internal.Timeout\n\t}\n\n\tif internal.ConnectTimeout != nil {\n\t\tc.ConnectTimeout = *internal.ConnectTimeout\n\t}\n\n\tif internal.Port != nil {\n\t\tc.Port = *internal.Port\n\t}\n\n\tif internal.NumConns != nil {\n\t\tc.NumConns = *internal.NumConns\n\t}\n\n\tif internal.Consistency != nil {\n\t\tc.Consistency = gocql.ParseConsistency(*internal.Consistency)\n\t}\n\n\tif internal.RetryPolicy != nil {\n\t\tc.RetryPolicy = &gocql.SimpleRetryPolicy{NumRetries: *internal.RetryPolicy}\n\t}\n\n\tif internal.SocketKeepalive != nil {\n\t\tc.ClusterConfig.SocketKeepalive = *internal.SocketKeepalive\n\t}\n\n\tif internal.MaxPreparedStmts != nil {\n\t\tc.ClusterConfig.MaxPreparedStmts = *internal.MaxPreparedStmts\n\t}\n\n\tif internal.MaxRoutingKeyInfo != nil {\n\t\tc.ClusterConfig.MaxRoutingKeyInfo = *internal.MaxRoutingKeyInfo\n\t}\n\n\tif internal.PageSize != nil {\n\t\tc.ClusterConfig.PageSize = *internal.PageSize\n\t}\n\n\tif internal.SerialConsistency != nil {\n\t\tswitch *internal.SerialConsistency {\n\t\tcase gocql.Serial.String():\n\t\t\tc.ClusterConfig.SerialConsistency = gocql.Serial\n\t\tcase gocql.LocalSerial.String():\n\t\t\tc.ClusterConfig.SerialConsistency = gocql.LocalSerial\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"invalid serial consistency %q\", *internal.SerialConsistency)\n\t\t}\n\t}\n\n\tif internal.HostSelectionPolicy != nil {\n\t\tswitch *internal.HostSelectionPolicy {\n\t\tcase \"RoundRobinHostPolicy\":\n\t\t\tc.ClusterConfig.PoolConfig = gocql.PoolConfig{HostSelectionPolicy: gocql.RoundRobinHostPolicy()}\n\t\tcase \"TokenAwareHostPolicy\":\n\t\t\tc.ClusterConfig.PoolConfig = gocql.PoolConfig{HostSelectionPolicy: gocql.TokenAwareHostPolicy(gocql.RoundRobinHostPolicy())}\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unrecognized host selection policy: %s\", *internal.HostSelectionPolicy)\n\t\t}\n\t}\n\n\tif internal.DataCenter != nil {\n\t\tc.ClusterConfig.HostFilter = gocql.DataCentreHostFilter(*internal.DataCenter)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9475a4c5907513c4962bfbb11c4be392", "score": "0.600485", "text": "func (r *RunMode) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\tx := \"\"\n\tif err := unmarshal(&x); err != nil {\n\t\treturn err\n\t}\n\n\tfmt.Println(\"Debug::YAMLUnmarshal: runMode : \", x)\n\tswitch strings.ToLower(x) {\n\tcase \"server\":\n\t\t*r = SERVER\n\tcase \"client\":\n\t\t*r = CLIENT\n\tdefault:\n\t\treturn errors.New(\"invalid runMode passed: expects either 'client' or 'server'\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "1c68f2d581f8452f6ea8e87bf1e18e1e", "score": "0.5998425", "text": "func (a *ArrayItem) UnmarshalYAML(um func(interface{}) error) error {\n\tvar y struct {\n\t\tArrayFields `yaml:\",inline\"`\n\n\t\tItems map[string]interface{}\n\t}\n\n\tif err := um(&y); err != nil {\n\t\treturn err\n\t}\n\n\ta.ArrayFields = y.ArrayFields\n\n\tvar err error\n\ta.Items, err = unmarshalItems(y.Items)\n\treturn err\n}", "title": "" }, { "docid": "0ff26c1e6569d0b37b00b449aba6430c", "score": "0.5997596", "text": "func (s *Specification) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\ttype topology Specification\n\tif err := unmarshal((*topology)(s)); err != nil {\n\t\treturn err\n\t}\n\n\t// set default values from tag\n\tif err := defaults.Set(s); err != nil {\n\t\treturn errors.Trace(err)\n\t}\n\n\t// Set monitored options\n\tif s.MonitoredOptions.DeployDir == \"\" {\n\t\ts.MonitoredOptions.DeployDir = filepath.Join(s.GlobalOptions.DeployDir,\n\t\t\tfmt.Sprintf(\"%s-%d\", RoleMonitor, s.MonitoredOptions.NodeExporterPort))\n\t}\n\tif s.MonitoredOptions.DataDir == \"\" {\n\t\ts.MonitoredOptions.DataDir = filepath.Join(s.GlobalOptions.DataDir,\n\t\t\tfmt.Sprintf(\"%s-%d\", RoleMonitor, s.MonitoredOptions.NodeExporterPort))\n\t}\n\tif s.MonitoredOptions.LogDir == \"\" {\n\t\ts.MonitoredOptions.LogDir = \"log\"\n\t}\n\tif !strings.HasPrefix(s.MonitoredOptions.LogDir, \"/\") &&\n\t\t!strings.HasPrefix(s.MonitoredOptions.LogDir, s.MonitoredOptions.DeployDir) {\n\t\ts.MonitoredOptions.LogDir = filepath.Join(s.MonitoredOptions.DeployDir, s.MonitoredOptions.LogDir)\n\t}\n\n\t// populate custom default values as needed\n\tif err := fillCustomDefaults(&s.GlobalOptions, s); err != nil {\n\t\treturn err\n\t}\n\n\treturn s.Validate()\n}", "title": "" }, { "docid": "58a9bbedf511ff52c98444311bf7031e", "score": "0.599508", "text": "func (s *ICMPProbe) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\t*s = DefaultICMPProbe\n\ttype plain ICMPProbe\n\tif err := unmarshal((*plain)(s)); err != nil {\n\t\treturn err\n\t}\n\n\tif runtime.GOOS == \"windows\" && s.DontFragment {\n\t\treturn errors.New(\"\\\"dont_fragment\\\" is not supported on windows platforms\")\n\t}\n\n\tif s.TTL < 0 {\n\t\treturn errors.New(\"\\\"ttl\\\" cannot be negative\")\n\t}\n\tif s.TTL > 255 {\n\t\treturn errors.New(\"\\\"ttl\\\" cannot exceed 255\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "aeb548bc131a951f42e102d3a738d787", "score": "0.598698", "text": "func (c *TLSConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\ttype plain TLSConfig\n\tif err := unmarshal((*plain)(c)); err != nil {\n\t\treturn err\n\t}\n\treturn yaml_util.CheckOverflow(c.XXX, \"TLS config\")\n}", "title": "" }, { "docid": "c3b57d09018d9a98c6ca85c26aaa9022", "score": "0.59849614", "text": "func (r *Rule) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\ttype rule Rule\n\tif err := unmarshal((*rule)(r)); err != nil {\n\t\treturn err\n\t}\n\tr.ID = HashRule(*r)\n\treturn nil\n}", "title": "" }, { "docid": "3dc2ef401f90faf3ba1b9b65b4a8748d", "score": "0.598356", "text": "func (s *TCPProbe) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\ttype plain TCPProbe\n\tif err := unmarshal((*plain)(s)); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "dbf59ff50f87cdacdba7160ec3e07afc", "score": "0.59720343", "text": "func (c *SDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\t*c = DefaultSDConfig\n\ttype plain SDConfig\n\terr := unmarshal((*plain)(c))\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := yaml_util.CheckOverflow(c.XXX, \"consul_sd_config\"); err != nil {\n\t\treturn err\n\t}\n\tif strings.TrimSpace(c.Server) == \"\" {\n\t\treturn fmt.Errorf(\"Consul SD configuration requires a server address\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "17d07ed6a0db1db1e95d1326a7dad37c", "score": "0.59691596", "text": "func (t *Timeouts) UnmarshalYAML(node *yaml.Node) (err error) {\n\tif node.Kind != yaml.MappingNode {\n\t\treturn errors.New(withLoc(\"timeouts must be an object\", node))\n\t}\n\tms := node.Content\n\ttop := len(ms)\n\tfor i := 0; i < top; i += 2 {\n\t\tkv, err := stringKey(ms[i])\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tvar dp *time.Duration\n\t\tswitch kv {\n\t\tcase \"agentInstall\":\n\t\t\tdp = &t.PrivateAgentInstall\n\t\tcase \"apply\":\n\t\t\tdp = &t.PrivateApply\n\t\tcase \"clusterConnect\":\n\t\t\tdp = &t.PrivateClusterConnect\n\t\tcase \"endpointDial\":\n\t\t\tdp = &t.PrivateEndpointDial\n\t\tcase \"helm\":\n\t\t\tdp = &t.PrivateHelm\n\t\tcase \"intercept\":\n\t\t\tdp = &t.PrivateIntercept\n\t\tcase \"proxyDial\":\n\t\t\tdp = &t.PrivateProxyDial\n\t\tcase \"roundtripLatency\":\n\t\t\tdp = &t.PrivateRoundtripLatency\n\t\tcase \"trafficManagerAPI\":\n\t\t\tdp = &t.PrivateTrafficManagerAPI\n\t\tcase \"trafficManagerConnect\":\n\t\t\tdp = &t.PrivateTrafficManagerConnect\n\t\tdefault:\n\t\t\tif parseContext != nil {\n\t\t\t\tdlog.Warn(parseContext, withLoc(fmt.Sprintf(\"unknown key %q\", kv), ms[i]))\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tv := ms[i+1]\n\t\tvar vv interface{}\n\t\tif err = v.Decode(&vv); err != nil {\n\t\t\treturn errors.New(withLoc(\"unable to parse value\", v))\n\t\t}\n\t\tswitch vv := vv.(type) {\n\t\tcase int:\n\t\t\t*dp = time.Duration(vv) * time.Second\n\t\tcase float64:\n\t\t\t*dp = time.Duration(vv * float64(time.Second))\n\t\tcase string:\n\t\t\tif *dp, err = time.ParseDuration(vv); err != nil {\n\t\t\t\treturn errors.New(withLoc(fmt.Sprintf(\"%q is not a valid duration\", vv), v))\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "69cb57b74cea858bd57c3d739bb74818", "score": "0.59310323", "text": "func (s *Secret) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\ttype plain Secret\n\treturn unmarshal((*plain)(s))\n}", "title": "" }, { "docid": "69cb57b74cea858bd57c3d739bb74818", "score": "0.59310323", "text": "func (s *Secret) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\ttype plain Secret\n\treturn unmarshal((*plain)(s))\n}", "title": "" }, { "docid": "69cb57b74cea858bd57c3d739bb74818", "score": "0.59310323", "text": "func (s *Secret) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\ttype plain Secret\n\treturn unmarshal((*plain)(s))\n}", "title": "" }, { "docid": "69cb57b74cea858bd57c3d739bb74818", "score": "0.59310323", "text": "func (s *Secret) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\ttype plain Secret\n\treturn unmarshal((*plain)(s))\n}", "title": "" }, { "docid": "56f0e77a336327d7e1768d666aed95da", "score": "0.59276205", "text": "func (x *Labels) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\tvar m map[string]string\n\tif err := unmarshal(&m); err != nil {\n\t\treturn err\n\t}\n\tx.InitFromMap(m)\n\treturn nil\n}", "title": "" }, { "docid": "67c8685812277ed105b1538248721144", "score": "0.5926411", "text": "func (a *Authentication) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\n\tvar value string\n\n\terr := unmarshal(&value)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"error unmarshalling authentication from yaml\")\n\t}\n\n\treturn a.FromString(value)\n}", "title": "" }, { "docid": "87fb9106eb94e4f76c6ca621a3bdb08a", "score": "0.5909287", "text": "func (p *Parameter) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\td := new(parameter)\n\terr := unmarshal(d)\n\tif err == nil {\n\t\tp.Secret = d.Secret\n\t\treturn nil\n\t}\n\tvar i interface{}\n\terr = unmarshal(&i)\n\tp.Value = i\n\treturn err\n}", "title": "" }, { "docid": "7d59fb12a666186399551ad24b271408", "score": "0.59018123", "text": "func (i *Input) UnmarshalYAML(value *yaml.Node) error {\n\ttype RawInput Input\n\traw := &RawInput{\n\t\tWeight: 1,\n\t\tDistribution: algorithm.DefaultDistributionName,\n\t}\n\tif err := value.Decode(raw); err != nil {\n\t\treturn err\n\t}\n\tif raw.Field == \"\" {\n\t\treturn errors.New(\"field must be set\")\n\t}\n\tif raw.Weight <= 0 {\n\t\treturn errors.New(\"weight must be greater than 0\")\n\t}\n\n\t*i = Input(*raw)\n\n\treturn nil\n}", "title": "" }, { "docid": "7fce4f17291b6887fb59de203d3eba9d", "score": "0.58892757", "text": "func (ps *PlatformIDSet) UnmarshalYAML(unmarshaler func(interface{}) error) error {\n\tvar ids interface{}\n\n\terr := unmarshaler(&ids)\n\tif err != nil {\n\t\terrors.Wrapf(err, \"failed to unmarshal PlatformIDSet\")\n\t}\n\tps.set = make(map[string]bool)\n\tswitch v := ids.(type) {\n\tcase string:\n\t\tps.set[v] = true\n\tcase []interface{}:\n\t\tfor _, val := range v {\n\t\t\tps.set[val.(string)] = true\n\t\t}\n\tcase nil:\n\t\t/* NO-OP */\n\tdefault:\n\t\treturn errors.Errorf(\"unexpected type %v found\", v)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a74920b39616f7edbc90cb3b053f0f64", "score": "0.58804166", "text": "func (j *JobConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\ttype plain JobConfig\n\tif err := unmarshal((*plain)(j)); err != nil {\n\t\treturn err\n\t}\n\n\t// Check required fields\n\tif j.Name == \"\" {\n\t\treturn fmt.Errorf(\"missing name for job %+v\", j)\n\t}\n\tif err := checkCollectorRefs(j.CollectorRefs, fmt.Sprintf(\"job %q\", j.Name)); err != nil {\n\t\treturn err\n\t}\n\n\tif len(j.StaticConfigs) == 0 {\n\t\treturn fmt.Errorf(\"no targets defined for job %q\", j.Name)\n\t}\n\n\treturn checkOverflow(j.XXX, \"job\")\n}", "title": "" }, { "docid": "f9bbfa4a10b3440db5d34d95a2d5200d", "score": "0.5872761", "text": "func (b *Bytes) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\tvar s string\n\tif err := unmarshal(&s); err != nil {\n\t\treturn err\n\t}\n\tbs, err := ParseBytes(s)\n\tif err != nil {\n\t\treturn err\n\t}\n\t*b = bs\n\treturn nil\n}", "title": "" }, { "docid": "a0fa7084518640c5db2d744d70a9a094", "score": "0.5870189", "text": "func (apm *AccessPointMode) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\tvar val accessPointMode\n\tif err := unmarshal(&val); err != nil {\n\t\treturn err\n\t}\n\n\tapm.val = val\n\tapm.isAssigned = true\n\n\treturn nil\n}", "title": "" }, { "docid": "978667dcea3f1a7ae9ca2e88f8f1ab59", "score": "0.58632606", "text": "func (j *URL) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\tvar s string\n\terr := unmarshal(&s)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tu, err := url.Parse(s)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tj.Str = s\n\tj.URL = u\n\tj.basePath = strings.TrimSuffix(u.Path, slash)\n\treturn err\n}", "title": "" }, { "docid": "0563ef7d4f2f5802651c3d6dfe880ef9", "score": "0.5862594", "text": "func (s *TCPProbe) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\t*s = DefaultTCPProbe\n\ttype plain TCPProbe\n\tif err := unmarshal((*plain)(s)); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c726b6b3bba1082b5b628b057aa3298f", "score": "0.58614147", "text": "func (s *Credentials) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\ttype plain Credentials\n\tif err := unmarshal((*plain)(s)); err != nil {\n\t\treturn err\n\t}\n\tif err := checkOverflow(s.XXX, \"credentials\"); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "425fee7aca85e11e95d7d21a3f14311c", "score": "0.586098", "text": "func (s *SecretURL) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\tvar str string\n\tif err := unmarshal(&str); err != nil {\n\t\treturn err\n\t}\n\n\treturn unmarshal((*URL)(s))\n}", "title": "" }, { "docid": "88701bd9d5619d8aead832d8ed2fa2a7", "score": "0.5857483", "text": "func (a *BasicAuth) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\ttype plain BasicAuth\n\terr := unmarshal((*plain)(a))\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn yaml_util.CheckOverflow(a.XXX, \"basic_auth\")\n}", "title": "" }, { "docid": "cf1f1d381ec93efa420eafac35f3184c", "score": "0.5846333", "text": "func (v *ValueType) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\tvar cmd string\n\n\tif err := unmarshal(&cmd); err == nil {\n\t\tv.Value = cmd\n\t\tv.Msg = nil\n\t\treturn nil\n\t}\n\n\t// An option value can contain a string, or a computed shell property\n\tvar valuetype struct {\n\t\tMsg *MsgType\n\t}\n\n\tif err := unmarshal(&valuetype); err != nil {\n\t\treturn err\n\t}\n\n\tv.Value = \"\"\n\tv.Msg = valuetype.Msg\n\n\treturn nil\n}", "title": "" }, { "docid": "a1de433d9bf9f075e8fa0cc182d72c84", "score": "0.5845433", "text": "func (v *VariablesToSet) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\n\tres := make(map[int]map[string]string)\n\n\t// try to unmarshall as plaint text\n\tvar plain map[int]string\n\tif err := unmarshal(&plain); err == nil {\n\n\t\tfor code, varName := range plain {\n\t\t\tres[code] = map[string]string{\n\t\t\t\tvarName: \"\",\n\t\t\t}\n\t\t}\n\n\t\t*v = res\n\t\treturn nil\n\t}\n\n\t// json-paths\n\tif err := unmarshal(&res); err != nil {\n\t\treturn err\n\t}\n\n\t*v = res\n\treturn nil\n}", "title": "" } ]
470830c5f6d73c1c04733bbf3d995d3d
SetAuthorizerArn sets the AuthorizerArn field's value.
[ { "docid": "90ad74324e540c4b9de14315b77fbb8d", "score": "0.8534274", "text": "func (s *CreateAuthorizerOutput) SetAuthorizerArn(v string) *CreateAuthorizerOutput {\n\ts.AuthorizerArn = &v\n\treturn s\n}", "title": "" } ]
[ { "docid": "83b892eb151224a87a872c0ad01e69d1", "score": "0.85843104", "text": "func (s *AuthorizerSummary) SetAuthorizerArn(v string) *AuthorizerSummary {\n\ts.AuthorizerArn = &v\n\treturn s\n}", "title": "" }, { "docid": "1236cafca987c4d411f175ea4d6258bf", "score": "0.8583452", "text": "func (s *UpdateAuthorizerOutput) SetAuthorizerArn(v string) *UpdateAuthorizerOutput {\n\ts.AuthorizerArn = &v\n\treturn s\n}", "title": "" }, { "docid": "747a817f032a18d674c85686cc8833a2", "score": "0.8512536", "text": "func (s *AuthorizerDescription) SetAuthorizerArn(v string) *AuthorizerDescription {\n\ts.AuthorizerArn = &v\n\treturn s\n}", "title": "" }, { "docid": "3e2eb4842ad14ff21358100623e5a4f2", "score": "0.8448969", "text": "func (s *SetDefaultAuthorizerOutput) SetAuthorizerArn(v string) *SetDefaultAuthorizerOutput {\n\ts.AuthorizerArn = &v\n\treturn s\n}", "title": "" }, { "docid": "b428d145ee400d4c6994a7e76c62527b", "score": "0.6770652", "text": "func (s *GetServiceNetworkServiceAssociationOutput) SetArn(v string) *GetServiceNetworkServiceAssociationOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "4ebf3eedc58a14d24623639c755794c0", "score": "0.67497665", "text": "func (s *CreateServiceNetworkServiceAssociationOutput) SetArn(v string) *CreateServiceNetworkServiceAssociationOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "9065582eae6d83f5855489a0996507b4", "score": "0.67397255", "text": "func (s *GetAccessLogSubscriptionOutput) SetArn(v string) *GetAccessLogSubscriptionOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "453e5a95079bca39f40cf448ff3150bd", "score": "0.6729555", "text": "func (s *DeleteServiceNetworkServiceAssociationOutput) SetArn(v string) *DeleteServiceNetworkServiceAssociationOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "1dd6c8af7102b1763bd1b3b4c3c4c68d", "score": "0.6707547", "text": "func (s *CreateAccessLogSubscriptionOutput) SetArn(v string) *CreateAccessLogSubscriptionOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "0e77e144edef4e174a2910cb823da28e", "score": "0.67010224", "text": "func (s *ListConfigurationRevisionsInput) SetArn(v string) *ListConfigurationRevisionsInput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "e190749d3b020073bea30bb96ea0f909", "score": "0.6687967", "text": "func (s *CreateAccountCustomizationOutput) SetArn(v string) *CreateAccountCustomizationOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "013c0e201eb524f8dc99e3813aacdb11", "score": "0.66837066", "text": "func (s *StorageLensAwsOrg) SetArn(v string) *StorageLensAwsOrg {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "4888f982018b07f3aec86fca0816a6e2", "score": "0.66635114", "text": "func (s *UpdateAccountCustomizationOutput) SetArn(v string) *UpdateAccountCustomizationOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "e17633bd98b6dc31cbc35316da7a3fc0", "score": "0.66634285", "text": "func (s *ServiceNetworkServiceAssociationSummary) SetArn(v string) *ServiceNetworkServiceAssociationSummary {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "6effdd7e52d17b5b1f1337ac0c3f21e4", "score": "0.66616994", "text": "func (s *UpdateAccessLogSubscriptionOutput) SetArn(v string) *UpdateAccessLogSubscriptionOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "9cdea4d050b46f2c1f9329e112faed38", "score": "0.6617553", "text": "func (s *CreateIngestionOutput) SetArn(v string) *CreateIngestionOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "efdbd160e08f5c17c241087dfe1ec1c7", "score": "0.6612718", "text": "func (s *DescribeAccountCustomizationOutput) SetArn(v string) *DescribeAccountCustomizationOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "84bac37699f5f88a6cce69ec8f210bfd", "score": "0.6592953", "text": "func (s *CreateServiceOutput) SetArn(v string) *CreateServiceOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "84bac37699f5f88a6cce69ec8f210bfd", "score": "0.6592953", "text": "func (s *CreateServiceOutput) SetArn(v string) *CreateServiceOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "6fe200c78ff1042ed014d5e8cadf8f71", "score": "0.6578713", "text": "func (s *CreateAuthorizerInput) SetAuthorizerFunctionArn(v string) *CreateAuthorizerInput {\n\ts.AuthorizerFunctionArn = &v\n\treturn s\n}", "title": "" }, { "docid": "4f25b89c5ac40d801f52aa679a172fd1", "score": "0.65773463", "text": "func (s *UpdateAuthorizerInput) SetAuthorizerFunctionArn(v string) *UpdateAuthorizerInput {\n\ts.AuthorizerFunctionArn = &v\n\treturn s\n}", "title": "" }, { "docid": "472ec5afc84ac15015e1fce5cf566cb4", "score": "0.6564946", "text": "func (s *Ingestion) SetArn(v string) *Ingestion {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "ee2122eaa209d60c5b2035a99033c00d", "score": "0.6564377", "text": "func (s *GetServiceOutput) SetArn(v string) *GetServiceOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "ee2122eaa209d60c5b2035a99033c00d", "score": "0.6564377", "text": "func (s *GetServiceOutput) SetArn(v string) *GetServiceOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "e6f347361ff3026c870854465678ac9f", "score": "0.65630364", "text": "func (s *CreateListenerOutput) SetArn(v string) *CreateListenerOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "930e4d2f49eb45a9ee2f73dc349591d9", "score": "0.65594584", "text": "func (s *AccessLogSubscriptionSummary) SetArn(v string) *AccessLogSubscriptionSummary {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "cf9e621beee77bf30b4c20cc6ea7ee8b", "score": "0.65523314", "text": "func (s *GetEnvironmentOutput) SetArn(v string) *GetEnvironmentOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "2a9bcd7200b16cd0e9c24f4257a88d08", "score": "0.654469", "text": "func (s *DeleteServiceOutput) SetArn(v string) *DeleteServiceOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "2a9bcd7200b16cd0e9c24f4257a88d08", "score": "0.654469", "text": "func (s *DeleteServiceOutput) SetArn(v string) *DeleteServiceOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "1bb3b46cae2518600f93ce42776274d3", "score": "0.6544579", "text": "func (s *CreateServiceNetworkOutput) SetArn(v string) *CreateServiceNetworkOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "e2cc0b68c9f77bff553eae4782c583e8", "score": "0.65384376", "text": "func (s *DeleteEnvironmentOutput) SetArn(v string) *DeleteEnvironmentOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "481eb75390f3d35973493462d9cc33dc", "score": "0.653584", "text": "func (s *GetModelVersionOutput) SetArn(v string) *GetModelVersionOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "9bdcdc8662ad78b4b31acf582d1636da", "score": "0.6529525", "text": "func (s *ListComponentVersionsInput) SetArn(v string) *ListComponentVersionsInput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "1bce6baca43ff0a3c107d91b8821bff2", "score": "0.6521792", "text": "func (s *AuthorizerDescription) SetAuthorizerFunctionArn(v string) *AuthorizerDescription {\n\ts.AuthorizerFunctionArn = &v\n\treturn s\n}", "title": "" }, { "docid": "fc7a83cf9ba2e277b2eab92845c444da", "score": "0.65196633", "text": "func (s *UpdateServiceOutput) SetArn(v string) *UpdateServiceOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "36fba2687e0a9687b8392cb085bb1b91", "score": "0.6515147", "text": "func (s *DeleteComponentInput) SetArn(v string) *DeleteComponentInput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "a91d332118e81b981ea38e4ee274a9dd", "score": "0.65131015", "text": "func (s *GetDetectorVersionOutput) SetArn(v string) *GetDetectorVersionOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "6b99e895041e7d5d476dff5a71c4d038", "score": "0.6510028", "text": "func (s *UpdateStageInput) SetArn(v string) *UpdateStageInput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "3ec619ed91003200f035b82e71d43a59", "score": "0.6509044", "text": "func (s *GetServiceNetworkOutput) SetArn(v string) *GetServiceNetworkOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "ded87f99cb0b40d776c2a919434df8a7", "score": "0.65066516", "text": "func (s *CreateEnvironmentOutput) SetArn(v string) *CreateEnvironmentOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "3b816fec47b99e6f3c42d1a11e063c9f", "score": "0.6505223", "text": "func (s *DeleteStageInput) SetArn(v string) *DeleteStageInput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "bbed8f08739919491a3ff110f1559fc3", "score": "0.6502828", "text": "func (s *CreateDataSourceOutput) SetArn(v string) *CreateDataSourceOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "cecd15bce4b5a91db8992b2e31718d22", "score": "0.65010256", "text": "func (s *RetryDataReplicationOutput) SetArn(v string) *RetryDataReplicationOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "88962170329cfc8164996bc50aa04b21", "score": "0.6493212", "text": "func (s *UpdateReplicationConfigurationTemplateInput) SetArn(v string) *UpdateReplicationConfigurationTemplateInput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "6fb90a01a7e6cd6addeb4ff437ff9b15", "score": "0.6490105", "text": "func (s *CreateDataSetOutput) SetArn(v string) *CreateDataSetOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "1a43ea6c53774da0e6c486341434e63f", "score": "0.64874715", "text": "func (s *GetStageInput) SetArn(v string) *GetStageInput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "43ab551427b450ec2496e0c93ebbbcbc", "score": "0.64872295", "text": "func (s *DeleteConfigurationInput) SetArn(v string) *DeleteConfigurationInput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "596f3decb990fcb274bb4b2b3918ef3b", "score": "0.6478959", "text": "func (s *DeleteDataSourceOutput) SetArn(v string) *DeleteDataSourceOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "b90db299cdd87f193f2ade5fb5bb907e", "score": "0.64770615", "text": "func (s *ServiceSummary) SetArn(v string) *ServiceSummary {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "b90db299cdd87f193f2ade5fb5bb907e", "score": "0.64770615", "text": "func (s *ServiceSummary) SetArn(v string) *ServiceSummary {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "761d3885b59c2bc113cb01ae07958c42", "score": "0.6476475", "text": "func (s *GetListenerOutput) SetArn(v string) *GetListenerOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "c8b308c896a44a5b80675a2f65cd0d82", "score": "0.6475263", "text": "func (s *ListTagsForResourceInput) SetArn(v string) *ListTagsForResourceInput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "92809b06400e78556528bd310efd40d0", "score": "0.64743817", "text": "func (s *RotateIngestEndpointCredentialsOutput) SetArn(v string) *RotateIngestEndpointCredentialsOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "00cd0886db92243cf65468143fc7beb8", "score": "0.6473532", "text": "func (s *UpdateConfigurationInput) SetArn(v string) *UpdateConfigurationInput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "43aaabd8e084cc95f52f76af1230501e", "score": "0.6469146", "text": "func (s *UpdateServiceNetworkOutput) SetArn(v string) *UpdateServiceNetworkOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "64d700dc62252e5321f37d2f5296fbe0", "score": "0.6469104", "text": "func (s *CreateDashboardOutput) SetArn(v string) *CreateDashboardOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "0648bb52eeb811728630e8738c1f70b7", "score": "0.64686364", "text": "func (s *CreateServiceNetworkVpcAssociationOutput) SetArn(v string) *CreateServiceNetworkVpcAssociationOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "65776c689df2113f16010aabe8073fb2", "score": "0.64678717", "text": "func (s *CreateComponentVersionOutput) SetArn(v string) *CreateComponentVersionOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "f1245f23f076cdf58e67a074aea71126", "score": "0.6460993", "text": "func (s *GetServiceNetworkVpcAssociationOutput) SetArn(v string) *GetServiceNetworkVpcAssociationOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "8df3674802fd4730bda73e2b298da269", "score": "0.6460632", "text": "func (s *UpdateFolderPermissionsOutput) SetArn(v string) *UpdateFolderPermissionsOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "fadfc77cbde31b16f9061226dfafdf63", "score": "0.6459294", "text": "func (s *CreateOriginEndpointOutput) SetArn(v string) *CreateOriginEndpointOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "720d9209b47d8d1b930c7c50313f38e7", "score": "0.64574337", "text": "func (s *DisconnectSourceServerOutput) SetArn(v string) *DisconnectSourceServerOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "b539121d81aa6ca9be231aa948349f5d", "score": "0.64518535", "text": "func (s *DeleteDashboardOutput) SetArn(v string) *DeleteDashboardOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "97258399d4900aeb3d0411c69bcbcf58", "score": "0.64512587", "text": "func (s *UpdateListenerOutput) SetArn(v string) *UpdateListenerOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "b3b3befe4747153b639ca765c946396b", "score": "0.64461625", "text": "func (s *UpdateDashboardOutput) SetArn(v string) *UpdateDashboardOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "8b78df0758a9af409e93a4c3bc0f0813", "score": "0.64453965", "text": "func (s *UpdateOriginEndpointOutput) SetArn(v string) *UpdateOriginEndpointOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "3fc55196ab5cb22d3a89a5c1ff83309a", "score": "0.64450526", "text": "func (s *DescribeOriginEndpointOutput) SetArn(v string) *DescribeOriginEndpointOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "c95f3bb018a4f11a7f2c4b4314d5de25", "score": "0.6444572", "text": "func (s *UpdateDataSourceOutput) SetArn(v string) *UpdateDataSourceOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "ab92a85a488c3fc2a4143976f33f4e63", "score": "0.64414287", "text": "func (s *CreateConfigurationOutput) SetArn(v string) *CreateConfigurationOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "21321a8f35f0cbfb1416eb9a39a959e2", "score": "0.6436085", "text": "func (s *ListenerSummary) SetArn(v string) *ListenerSummary {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "57b0ca7b9b50825de4b52050ff3f095a", "score": "0.64351696", "text": "func (s *DescribeConfigurationRevisionInput) SetArn(v string) *DescribeConfigurationRevisionInput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "9b4bddd007d742158d119a660bc26e52", "score": "0.6433286", "text": "func (s *GetRouteOutput) SetArn(v string) *GetRouteOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "78c09e89af95ad8fc7499e5dc8210c11", "score": "0.6432359", "text": "func (s *CancelIngestionOutput) SetArn(v string) *CancelIngestionOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "87666607ef3b35b4341b93c104588aed", "score": "0.6427429", "text": "func (s *RotateChannelCredentialsOutput) SetArn(v string) *RotateChannelCredentialsOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "b84b9ba68c323c0b2d8697679a6ce7b9", "score": "0.64268464", "text": "func (s *DescribeComponentInput) SetArn(v string) *DescribeComponentInput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "02f6d72f3de74bd764436c799544714e", "score": "0.6425391", "text": "func (s *UpdateDataSetOutput) SetArn(v string) *UpdateDataSetOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "6c28f048cb1a7085eca2b485b4845082", "score": "0.642368", "text": "func (s *CreateAnalysisOutput) SetArn(v string) *CreateAnalysisOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "f8ec42df327bc25a1927386e515fe100", "score": "0.6423001", "text": "func (s *EntityType) SetArn(v string) *EntityType {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "c4332c547ae2f32993dd15b7ca1e26b6", "score": "0.64224774", "text": "func (s *CreateRouteOutput) SetArn(v string) *CreateRouteOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "5fc7b9bf92bc710369c3f62072797ca6", "score": "0.6420475", "text": "func (s *User) SetArn(v string) *User {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "9e99a1958cdd56de1bdaba6004b3e14e", "score": "0.6419949", "text": "func (s *CreateChannelOutput) SetArn(v string) *CreateChannelOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "dfcc310efa7c5c7d626b637d717165bb", "score": "0.6417581", "text": "func (s *DeleteServiceNetworkVpcAssociationOutput) SetArn(v string) *DeleteServiceNetworkVpcAssociationOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "fa468f65043b875181a408ec3ee65861", "score": "0.64164364", "text": "func (s *CreateReplicationConfigurationTemplateOutput) SetArn(v string) *CreateReplicationConfigurationTemplateOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "7008c343f4b0f8bb4e369d8c9d950ddf", "score": "0.641604", "text": "func (s *CreateHarvestJobOutput) SetArn(v string) *CreateHarvestJobOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "11d539181fd8b4ed46d8a86398e6bcc0", "score": "0.6413099", "text": "func (s *GetRuleOutput) SetArn(v string) *GetRuleOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "e37150680da78e6c8c8b4aefbc6ed6a5", "score": "0.64126414", "text": "func (s *GetTagsOutput) SetArn(v string) *GetTagsOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "f070096ade2e6630e754fa19890443a5", "score": "0.64120007", "text": "func (s *UpdateFolderOutput) SetArn(v string) *UpdateFolderOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "c233de328c9650bb4c810038dc4f3b03", "score": "0.6407964", "text": "func (s *CreateFolderOutput) SetArn(v string) *CreateFolderOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "ea0dbf7a602a2497c2324078dd167be3", "score": "0.640386", "text": "func (s *CreateRuleOutput) SetArn(v string) *CreateRuleOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "c57f8847402c4f344c82a91ce3d80479", "score": "0.6401872", "text": "func (s *DeleteFolderOutput) SetArn(v string) *DeleteFolderOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "b26e2a37f989afe4060f26d0a480f8de", "score": "0.64007664", "text": "func (s *GetTagsInput) SetArn(v string) *GetTagsInput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "2ed3fb225334bb59a91b40deba7dd11f", "score": "0.6400762", "text": "func (s *DeleteAnalysisOutput) SetArn(v string) *DeleteAnalysisOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "32fa8fda78e3bd90919793d8146e25e7", "score": "0.64002925", "text": "func (s *EnvironmentSummary) SetArn(v string) *EnvironmentSummary {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "d7120065bc1ca2b9f71db80f69cad56b", "score": "0.63979", "text": "func (s *CreateTargetGroupOutput) SetArn(v string) *CreateTargetGroupOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "ffc2a8a63b0f130ec866206a34b9669c", "score": "0.63972497", "text": "func (s *GetApplicationOutput) SetArn(v string) *GetApplicationOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "e5fca812093239bf75e7507864f21ccf", "score": "0.639717", "text": "func (s *UpdateConfigurationOutput) SetArn(v string) *UpdateConfigurationOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "b43870f517fecd7dd9157fdb4fef911f", "score": "0.6396086", "text": "func (s *DescribeConfigurationRevisionOutput) SetArn(v string) *DescribeConfigurationRevisionOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "95bcbedf1b06ce0d16aa9686a53e6b37", "score": "0.6394647", "text": "func (s *DeleteConfigurationOutput) SetArn(v string) *DeleteConfigurationOutput {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "2a42478e2b9d271df5c33b4954bb0df8", "score": "0.63938105", "text": "func (s *AllowDenyList) SetArn(v string) *AllowDenyList {\n\ts.Arn = &v\n\treturn s\n}", "title": "" }, { "docid": "de360b90a1a8d0172591125fc1d6015d", "score": "0.639312", "text": "func (s *ServiceNetworkSummary) SetArn(v string) *ServiceNetworkSummary {\n\ts.Arn = &v\n\treturn s\n}", "title": "" } ]
68f0bda3409c8477dc2d7573f5a87bb4
Printable returns a printable string for given rune
[ { "docid": "f931289ddd6e600f5c0dd81eb59a8c43", "score": "0.764539", "text": "func Printable(r rune) string {\n\tif unicode.IsGraphic(r) {\n\t\treturn fmt.Sprintf(\"%c\", r)\n\t} else if r < 128 {\n\t\treturn fmt.Sprintf(\"0x%02X\", r)\n\t}\n\treturn fmt.Sprintf(\"%U\", r)\n}", "title": "" } ]
[ { "docid": "7713b95ab9cb35c1c82461326601e61f", "score": "0.6788482", "text": "func PrintChar(char byte)", "title": "" }, { "docid": "83811abca11a662b7b9ab9ecd5552365", "score": "0.63112324", "text": "func PrintRune(r rune, x int, y int, fgColor Color, bgColor Color) {\n\ttermbox.SetCell(x, y, r, getTermboxColor(fgColor), getTermboxColor(bgColor))\n}", "title": "" }, { "docid": "0226796f8e9ad8329e33a2dc69439f98", "score": "0.6274272", "text": "func printer(c string) {\n\tfmt.Printf(\"%v\", c)\n}", "title": "" }, { "docid": "b2ba4650b788c6a05863459e367370e3", "score": "0.60932857", "text": "func Printchar(s string) {\n\tchars := string([]byte(s))\n\tfor i := 0; i < len(chars); i++ {\n\t\tfmt.Println(string(chars[i]))\n\t}\n}", "title": "" }, { "docid": "74fda4b7007568a01d3048645acc9ebe", "score": "0.5982076", "text": "func printableString(s string) string {\n\tresult := \"\"\n\tfor _, c := range s {\n\t\tswitch {\n\t\tcase c == '\\n':\n\t\t\tresult += \"\\\\n\"\n\t\tcase c == '\\t':\n\t\t\tresult += \"\\\\t\"\n\t\tcase c == '\\f':\n\t\t\tresult += \"\\\\f\"\n\t\tcase c == '\\b':\n\t\t\tresult += \"\\\\b\"\n\t\tcase c == '\\\\', c == '\"':\n\t\t\tresult += \"\\\\\" + string(c)\n\t\tcase c < ' ':\n\t\t\tresult += fmt.Sprintf(\"\\\\0%02o\", c)\n\t\tdefault:\n\t\t\tresult += string(c)\n\t\t}\n\t}\n\treturn result\n}", "title": "" }, { "docid": "a68e8d61ee3578388761ec10a75f4015", "score": "0.5973998", "text": "func rawPrintString(in string, posX, posY int) {\n\trawPrintRunes([]rune(in), posX, posY)\n}", "title": "" }, { "docid": "10df82f19f587e87886a7a1d244ca4e4", "score": "0.597293", "text": "func RandPrintable(length int) string {\n\treturn randString(length, CHARS_PRINTABLE)\n}", "title": "" }, { "docid": "d310863d12d9e3d428fd214079e35574", "score": "0.589531", "text": "func printStringInRune(stringIn string) {\n\tfor _, r := range stringIn {\n\t\tz01.PrintRune(r)\n\t}\n}", "title": "" }, { "docid": "86c86718fd2ec3a521e4402a7f0744ba", "score": "0.5858906", "text": "func rawTransparentPrintString(in string, posX, posY int) {\n\trawTransparentPrintRunes([]rune(in), posX, posY)\n}", "title": "" }, { "docid": "a30b74487edc2b8c1fcbc5b1f1cbd992", "score": "0.58421904", "text": "func (op *UnaryOperatorChr) String() string {\n\treturn generateUnaryOperator(op.GetExpression(), \"chr \")\n}", "title": "" }, { "docid": "4e5091859b6a2e3b6e500227fba13caf", "score": "0.58087647", "text": "func (c *Character) Print() {\n fmt.Printf(characterFormat, c.NumLines, c.Name)\n}", "title": "" }, { "docid": "9d8ad7e671b3f40fe09b0f0d6bb475e0", "score": "0.5790765", "text": "func (pac Pac) Rune() rune {\n\tr := []rune{'𝑃', '𝐹', '𝐶'}[pac.Shifumi]\n\tif !pac.ally {\n\t\tr -= 26\n\t}\n\treturn r\n}", "title": "" }, { "docid": "2465f94969a07e0391b15dc7999f0266", "score": "0.57887185", "text": "func repr(name, value string, c Card) {\n\tstr := \"%s %v: %032b %08x (%d)\\n\"\n\tfmt.Printf(str, name, value, c, uint32(c), c)\n}", "title": "" }, { "docid": "803c5f13d9242fbeb2d21296ddb796c1", "score": "0.5756605", "text": "func Print(grid [][]rune) {\n\tfmt.Println(Sprint(grid))\n}", "title": "" }, { "docid": "7483de5aa4661761de4657bb1a6b248d", "score": "0.57422715", "text": "func String(drawing map[geom.Vec2]rune, unknown rune) string {\n\tresult := \"\"\n\tmin, max := MinMax(drawing)\n\tfor y := min.Y; y <= max.Y; y++ {\n\t\tif y != min.Y {\n\t\t\tresult += \"\\n\"\n\t\t}\n\t\tfor x := min.X; x <= max.X; x++ {\n\t\t\tc, ok := drawing[geom.Vec2{X: x, Y: y}]\n\t\t\tif !ok {\n\t\t\t\tc = unknown\n\t\t\t}\n\t\t\tresult += string(c)\n\t\t}\n\t}\n\treturn result\n}", "title": "" }, { "docid": "7cf6703a3045bd143462b7749e456f4c", "score": "0.570996", "text": "func (digit Digit) String() string {\n\treturn fmt.Sprintf(\"%X\", byte(digit))\n}", "title": "" }, { "docid": "cc53f0cfd2a7626cfe6a8b96664244e1", "score": "0.56864715", "text": "func (p Piece) Rune() rune {\n\tswitch p {\n\tcase King:\n\t\treturn '♚'\n\tcase Queen:\n\t\treturn '♛'\n\tcase Rook:\n\t\treturn '♜'\n\tcase Bishop:\n\t\treturn '♝'\n\tcase Knight:\n\t\treturn '♞'\n\t}\n\treturn '?'\n}", "title": "" }, { "docid": "26ef069061449c09d9509afc3b6147c1", "score": "0.5679416", "text": "func Char(length int) string {\n\treturn genString(length)\n}", "title": "" }, { "docid": "09a42ded4182e57f4d1e24cb5935912b", "score": "0.5671834", "text": "func (liter *CharLiteral) String() string {\n\treturn fmt.Sprintf(\"'%v'\", liter.char)\n}", "title": "" }, { "docid": "9acd9cd82217c622ef08d5e022426578", "score": "0.565475", "text": "func FmtNonASCIIPrintableCharToHex(str string) string {\n\tvar b bytes.Buffer\n\tb.Grow(len(str) * 2)\n\tfor i := 0; i < len(str); i++ {\n\t\tif PrintableASCII(str[i]) {\n\t\t\tb.WriteByte(str[i])\n\t\t\tcontinue\n\t\t}\n\n\t\tb.WriteString(`\\x`)\n\t\t// turns non-printable-ASCII character into hex-string\n\t\tb.WriteString(fmt.Sprintf(\"%02X\", str[i]))\n\t}\n\treturn b.String()\n}", "title": "" }, { "docid": "c6af180f68669a1f410576b38ec45e20", "score": "0.5522152", "text": "func isPrintable(name string) bool {\n\tnotASCII := func(r rune) bool {\n\t\treturn !unicode.IsPrint(r)\n\t}\n\treturn strings.IndexFunc(name, notASCII) == -1\n}", "title": "" }, { "docid": "56387af32dda79d71f18406f904207a9", "score": "0.550098", "text": "func (node Node) Rune() rune {\n\treturn node.char\n}", "title": "" }, { "docid": "da4c7a23cab1efccf5051ed00f2e5704", "score": "0.55001974", "text": "func (c Characters) Print() {\n for _, character := range c {\n character.Print()\n }\n}", "title": "" }, { "docid": "45bda863fdf0af827d907f72e2fc7d93", "score": "0.54900885", "text": "func (op Common) String() string {\n\treturn fmt.Sprintf(\"%c\", rune(op))\n}", "title": "" }, { "docid": "3b27d5b650ff79b7770340f0a31f0a23", "score": "0.548519", "text": "func isPrintable(b byte) bool {\n\treturn 'a' <= b && b <= 'z' ||\n\t\t'A' <= b && b <= 'Z' ||\n\t\t'0' <= b && b <= '9' ||\n\t\t'\\'' <= b && b <= ')' ||\n\t\t'+' <= b && b <= '/' ||\n\t\tb == ' ' ||\n\t\tb == ':' ||\n\t\tb == '=' ||\n\t\tb == '?'\n}", "title": "" }, { "docid": "13b1c3a6c8bf9ba423154fd1b78c6809", "score": "0.54838926", "text": "func cprotect(r rune) string {\n\tif strconv.IsPrint(r) {\n\t\treturn string(r)\n\t} else {\n\t\ts := strconv.QuoteRune(r)\n\t\treturn s[1 : len(s)-1]\n\t}\n}", "title": "" }, { "docid": "05932e25be4db5d503ec288833681fe6", "score": "0.5453931", "text": "func (UTF8Encoder) Encode(r rune, buf *bytes.Buffer) { buf.WriteRune(r) }", "title": "" }, { "docid": "2986b35b063c848a40c3faa0afe0de89", "score": "0.54242045", "text": "func (p *Pit) Rune() rune {\n\tif p.Visibility {\n\t\treturn pitRune\n\t} else {\n\t\treturn invisibleRune\n\t}\n}", "title": "" }, { "docid": "094c9b72831529af2e9ccddbcb06af2b", "score": "0.5365572", "text": "func (ins *CastChar) String() string {\n\treturn fmt.Sprintf(\"%s = char %s\", ins.Result, ins.X)\n}", "title": "" }, { "docid": "7fbf361f225024f4838a63f8fa04444e", "score": "0.53002805", "text": "func (x Letter) String() string {\n\tif str, ok := _LetterMap[x]; ok {\n\t\treturn str\n\t}\n\treturn fmt.Sprintf(\"Letter(%d)\", x)\n}", "title": "" }, { "docid": "cc658a95d13fa5b6e21c4a23956a2ff8", "score": "0.5300055", "text": "func replUnASCII(r rune) rune {\n\tif r > 255 {\n\t\treturn '?'\n\t}\n\treturn r\n}", "title": "" }, { "docid": "0889c390d05ad89c003fe002c3a9b619", "score": "0.529967", "text": "func rawPrintRunes(in []rune, posX, posY int) {\n\tif len(in) == 0 {\n\t\treturn\n\t}\n\tfor i, char := range in {\n\t\tScreen.SetContent(posX+i, posY, char, nil, tcell.StyleDefault)\n\t}\n}", "title": "" }, { "docid": "2fb41e5d85874045650fde49d266215f", "score": "0.5297743", "text": "func foldRune(r rune) string {\n\tvar buffer bytes.Buffer\n\n\tasciiRune := runeToASCII(r)\n\n\tswitch asciiRune {\n\tcase \"C0\", // [LATIN CAPITAL LETTER A WITH GRAVE]\n\t\t\"C1\", // [LATIN CAPITAL LETTER A WITH ACUTE]\n\t\t\"C2\", // [LATIN CAPITAL LETTER A WITH CIRCUMFLEX]\n\t\t\"C3\", // [LATIN CAPITAL LETTER A WITH TILDE]\n\t\t\"C4\", // [LATIN CAPITAL LETTER A WITH DIAERESIS]\n\t\t\"C5\", // [LATIN CAPITAL LETTER A WITH RING ABOVE]\n\t\t\"100\", // [LATIN CAPITAL LETTER A WITH MACRON]\n\t\t\"102\", // [LATIN CAPITAL LETTER A WITH BREVE]\n\t\t\"104\", // [LATIN CAPITAL LETTER A WITH OGONEK]\n\t\t\"18F\", // [LATIN CAPITAL LETTER SCHWA]\n\t\t\"1CD\", // [LATIN CAPITAL LETTER A WITH CARON]\n\t\t\"1DE\", // [LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON]\n\t\t\"1E0\", // [LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON]\n\t\t\"1FA\", // [LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE]\n\t\t\"200\", // [LATIN CAPITAL LETTER A WITH DOUBLE GRAVE]\n\t\t\"202\", // [LATIN CAPITAL LETTER A WITH INVERTED BREVE]\n\t\t\"226\", // [LATIN CAPITAL LETTER A WITH DOT ABOVE]\n\t\t\"23A\", // [LATIN CAPITAL LETTER A WITH STROKE]\n\t\t\"1D00\", // [LATIN LETTER SMALL CAPITAL A]\n\t\t\"1E00\", // [LATIN CAPITAL LETTER A WITH RING BELOW]\n\t\t\"1EA0\", // [LATIN CAPITAL LETTER A WITH DOT BELOW]\n\t\t\"1EA2\", // [LATIN CAPITAL LETTER A WITH HOOK ABOVE]\n\t\t\"1EA4\", // [LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE]\n\t\t\"1EA6\", // [LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE]\n\t\t\"1EA8\", // [LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE]\n\t\t\"1EAA\", // [LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE]\n\t\t\"1EAC\", // [LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW]\n\t\t\"1EAE\", // [LATIN CAPITAL LETTER A WITH BREVE AND ACUTE]\n\t\t\"1EB0\", // [LATIN CAPITAL LETTER A WITH BREVE AND GRAVE]\n\t\t\"1EB2\", // [LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE]\n\t\t\"1EB4\", // [LATIN CAPITAL LETTER A WITH BREVE AND TILDE]\n\t\t\"1EB6\", // [LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW]\n\t\t\"24B6\", // [CIRCLED LATIN CAPITAL LETTER A]\n\t\t\"FF21\": // [FULLWIDTH LATIN CAPITAL LETTER A]\n\t\tbuffer.WriteString(\"A\")\n\tcase \"E0\", // [LATIN SMALL LETTER A WITH GRAVE]\n\t\t\"E1\", // [LATIN SMALL LETTER A WITH ACUTE]\n\t\t\"E2\", // [LATIN SMALL LETTER A WITH CIRCUMFLEX]\n\t\t\"E3\", // [LATIN SMALL LETTER A WITH TILDE]\n\t\t\"E4\", // [LATIN SMALL LETTER A WITH DIAERESIS]\n\t\t\"E5\", // [LATIN SMALL LETTER A WITH RING ABOVE]\n\t\t\"101\", // [LATIN SMALL LETTER A WITH MACRON]\n\t\t\"103\", // [LATIN SMALL LETTER A WITH BREVE]\n\t\t\"105\", // [LATIN SMALL LETTER A WITH OGONEK]\n\t\t\"1CE\", // [LATIN SMALL LETTER A WITH CARON]\n\t\t\"1DF\", // [LATIN SMALL LETTER A WITH DIAERESIS AND MACRON]\n\t\t\"1E1\", // [LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON]\n\t\t\"1FB\", // [LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE]\n\t\t\"201\", // [LATIN SMALL LETTER A WITH DOUBLE GRAVE]\n\t\t\"203\", // [LATIN SMALL LETTER A WITH INVERTED BREVE]\n\t\t\"227\", // [LATIN SMALL LETTER A WITH DOT ABOVE]\n\t\t\"250\", // [LATIN SMALL LETTER TURNED A]\n\t\t\"259\", // [LATIN SMALL LETTER SCHWA]\n\t\t\"25A\", // [LATIN SMALL LETTER SCHWA WITH HOOK]\n\t\t\"1D8F\", // [LATIN SMALL LETTER A WITH RETROFLEX HOOK]\n\t\t\"1D95\", // [LATIN SMALL LETTER SCHWA WITH RETROFLEX HOOK]\n\t\t\"1E01\", // [LATIN SMALL LETTER A WITH RING BELOW]\n\t\t\"1E9A\", // [LATIN SMALL LETTER A WITH RIGHT HALF RING]\n\t\t\"1EA1\", // [LATIN SMALL LETTER A WITH DOT BELOW]\n\t\t\"1EA3\", // [LATIN SMALL LETTER A WITH HOOK ABOVE]\n\t\t\"1EA5\", // [LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE]\n\t\t\"1EA7\", // [LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE]\n\t\t\"1EA9\", // [LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE]\n\t\t\"1EAB\", // [LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE]\n\t\t\"1EAD\", // [LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW]\n\t\t\"1EAF\", // [LATIN SMALL LETTER A WITH BREVE AND ACUTE]\n\t\t\"1EB1\", // [LATIN SMALL LETTER A WITH BREVE AND GRAVE]\n\t\t\"1EB3\", // [LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE]\n\t\t\"1EB5\", // [LATIN SMALL LETTER A WITH BREVE AND TILDE]\n\t\t\"1EB7\", // [LATIN SMALL LETTER A WITH BREVE AND DOT BELOW]\n\t\t\"2090\", // [LATIN SUBSCRIPT SMALL LETTER A]\n\t\t\"2094\", // [LATIN SUBSCRIPT SMALL LETTER SCHWA]\n\t\t\"24D0\", // [CIRCLED LATIN SMALL LETTER A]\n\t\t\"2C65\", // [LATIN SMALL LETTER A WITH STROKE]\n\t\t\"2C6F\", // [LATIN CAPITAL LETTER TURNED A]\n\t\t\"FF41\": // [FULLWIDTH LATIN SMALL LETTER A]\n\t\tbuffer.WriteString(\"a\")\n\tcase \"A732\": // [LATIN CAPITAL LETTER AA]\n\t\tbuffer.WriteString(\"A\")\n\t\tbuffer.WriteString(\"A\")\n\tcase \"C6\", // [LATIN CAPITAL LETTER AE]\n\t\t\"1E2\", // [LATIN CAPITAL LETTER AE WITH MACRON]\n\t\t\"1FC\", // [LATIN CAPITAL LETTER AE WITH ACUTE]\n\t\t\"1D01\": // [LATIN LETTER SMALL CAPITAL AE]\n\t\tbuffer.WriteString(\"A\")\n\t\tbuffer.WriteString(\"E\")\n\tcase \"A734\": // [LATIN CAPITAL LETTER AO]\n\t\tbuffer.WriteString(\"A\")\n\t\tbuffer.WriteString(\"O\")\n\tcase \"A736\": // [LATIN CAPITAL LETTER AU]\n\t\tbuffer.WriteString(\"A\")\n\t\tbuffer.WriteString(\"U\")\n\tcase \"A738\", // [LATIN CAPITAL LETTER AV]\n\t\t\"A73A\": // [LATIN CAPITAL LETTER AV WITH HORIZONTAL BAR]\n\t\tbuffer.WriteString(\"A\")\n\t\tbuffer.WriteString(\"V\")\n\tcase \"A73C\": // [LATIN CAPITAL LETTER AY]\n\t\tbuffer.WriteString(\"A\")\n\t\tbuffer.WriteString(\"Y\")\n\tcase \"249C\": // [PARENTHESIZED LATIN SMALL LETTER A]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"a\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"A733\": // [LATIN SMALL LETTER AA]\n\t\tbuffer.WriteString(\"a\")\n\t\tbuffer.WriteString(\"a\")\n\tcase \"E6\", // [LATIN SMALL LETTER AE]\n\t\t\"1E3\", // [LATIN SMALL LETTER AE WITH MACRON]\n\t\t\"1FD\", // [LATIN SMALL LETTER AE WITH ACUTE]\n\t\t\"1D02\": // [LATIN SMALL LETTER TURNED AE]\n\t\tbuffer.WriteString(\"a\")\n\t\tbuffer.WriteString(\"e\")\n\tcase \"A735\": // [LATIN SMALL LETTER AO]\n\t\tbuffer.WriteString(\"a\")\n\t\tbuffer.WriteString(\"o\")\n\tcase \"A737\": // [LATIN SMALL LETTER AU]\n\t\tbuffer.WriteString(\"a\")\n\t\tbuffer.WriteString(\"u\")\n\tcase \"A739\", // [LATIN SMALL LETTER AV]\n\t\t\"A73B\": // [LATIN SMALL LETTER AV WITH HORIZONTAL BAR]\n\t\tbuffer.WriteString(\"a\")\n\t\tbuffer.WriteString(\"v\")\n\tcase \"A73D\": // [LATIN SMALL LETTER AY]\n\t\tbuffer.WriteString(\"a\")\n\t\tbuffer.WriteString(\"y\")\n\tcase \"181\", // [LATIN CAPITAL LETTER B WITH HOOK]\n\t\t\"182\", // [LATIN CAPITAL LETTER B WITH TOPBAR]\n\t\t\"243\", // [LATIN CAPITAL LETTER B WITH STROKE]\n\t\t\"299\", // [LATIN LETTER SMALL CAPITAL B]\n\t\t\"1D03\", // [LATIN LETTER SMALL CAPITAL BARRED B]\n\t\t\"1E02\", // [LATIN CAPITAL LETTER B WITH DOT ABOVE]\n\t\t\"1E04\", // [LATIN CAPITAL LETTER B WITH DOT BELOW]\n\t\t\"1E06\", // [LATIN CAPITAL LETTER B WITH LINE BELOW]\n\t\t\"24B7\", // [CIRCLED LATIN CAPITAL LETTER B]\n\t\t\"FF22\": // [FULLWIDTH LATIN CAPITAL LETTER B]\n\t\tbuffer.WriteString(\"B\")\n\tcase \"180\", // [LATIN SMALL LETTER B WITH STROKE]\n\t\t\"183\", // [LATIN SMALL LETTER B WITH TOPBAR]\n\t\t\"253\", // [LATIN SMALL LETTER B WITH HOOK]\n\t\t\"1D6C\", // [LATIN SMALL LETTER B WITH MIDDLE TILDE]\n\t\t\"1D80\", // [LATIN SMALL LETTER B WITH PALATAL HOOK]\n\t\t\"1E03\", // [LATIN SMALL LETTER B WITH DOT ABOVE]\n\t\t\"1E05\", // [LATIN SMALL LETTER B WITH DOT BELOW]\n\t\t\"1E07\", // [LATIN SMALL LETTER B WITH LINE BELOW]\n\t\t\"24D1\", // [CIRCLED LATIN SMALL LETTER B]\n\t\t\"FF42\": // [FULLWIDTH LATIN SMALL LETTER B]\n\t\tbuffer.WriteString(\"b\")\n\tcase \"249D\": // [PARENTHESIZED LATIN SMALL LETTER B]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"b\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"C7\", // [LATIN CAPITAL LETTER C WITH CEDILLA]\n\t\t\"106\", // [LATIN CAPITAL LETTER C WITH ACUTE]\n\t\t\"108\", // [LATIN CAPITAL LETTER C WITH CIRCUMFLEX]\n\t\t\"10A\", // [LATIN CAPITAL LETTER C WITH DOT ABOVE]\n\t\t\"10C\", // [LATIN CAPITAL LETTER C WITH CARON]\n\t\t\"187\", // [LATIN CAPITAL LETTER C WITH HOOK]\n\t\t\"23B\", // [LATIN CAPITAL LETTER C WITH STROKE]\n\t\t\"297\", // [LATIN LETTER STRETCHED C]\n\t\t\"1D04\", // [LATIN LETTER SMALL CAPITAL C]\n\t\t\"1E08\", // [LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE]\n\t\t\"24B8\", // [CIRCLED LATIN CAPITAL LETTER C]\n\t\t\"FF23\": // [FULLWIDTH LATIN CAPITAL LETTER C]\n\t\tbuffer.WriteString(\"C\")\n\tcase \"E7\", // [LATIN SMALL LETTER C WITH CEDILLA]\n\t\t\"107\", // [LATIN SMALL LETTER C WITH ACUTE]\n\t\t\"109\", // [LATIN SMALL LETTER C WITH CIRCUMFLEX]\n\t\t\"10B\", // [LATIN SMALL LETTER C WITH DOT ABOVE]\n\t\t\"10D\", // [LATIN SMALL LETTER C WITH CARON]\n\t\t\"188\", // [LATIN SMALL LETTER C WITH HOOK]\n\t\t\"23C\", // [LATIN SMALL LETTER C WITH STROKE]\n\t\t\"255\", // [LATIN SMALL LETTER C WITH CURL]\n\t\t\"1E09\", // [LATIN SMALL LETTER C WITH CEDILLA AND ACUTE]\n\t\t\"2184\", // [LATIN SMALL LETTER REVERSED C]\n\t\t\"24D2\", // [CIRCLED LATIN SMALL LETTER C]\n\t\t\"A73E\", // [LATIN CAPITAL LETTER REVERSED C WITH DOT]\n\t\t\"A73F\", // [LATIN SMALL LETTER REVERSED C WITH DOT]\n\t\t\"FF43\": // [FULLWIDTH LATIN SMALL LETTER C]\n\t\tbuffer.WriteString(\"c\")\n\tcase \"249E\": // [PARENTHESIZED LATIN SMALL LETTER C]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"c\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"D0\", // [LATIN CAPITAL LETTER ETH]\n\t\t\"10E\", // [LATIN CAPITAL LETTER D WITH CARON]\n\t\t\"110\", // [LATIN CAPITAL LETTER D WITH STROKE]\n\t\t\"189\", // [LATIN CAPITAL LETTER AFRICAN D]\n\t\t\"18A\", // [LATIN CAPITAL LETTER D WITH HOOK]\n\t\t\"18B\", // [LATIN CAPITAL LETTER D WITH TOPBAR]\n\t\t\"1D05\", // [LATIN LETTER SMALL CAPITAL D]\n\t\t\"1D06\", // [LATIN LETTER SMALL CAPITAL ETH]\n\t\t\"1E0A\", // [LATIN CAPITAL LETTER D WITH DOT ABOVE]\n\t\t\"1E0C\", // [LATIN CAPITAL LETTER D WITH DOT BELOW]\n\t\t\"1E0E\", // [LATIN CAPITAL LETTER D WITH LINE BELOW]\n\t\t\"1E10\", // [LATIN CAPITAL LETTER D WITH CEDILLA]\n\t\t\"1E12\", // [LATIN CAPITAL LETTER D WITH CIRCUMFLEX BELOW]\n\t\t\"24B9\", // [CIRCLED LATIN CAPITAL LETTER D]\n\t\t\"A779\", // [LATIN CAPITAL LETTER INSULAR D]\n\t\t\"FF24\": // [FULLWIDTH LATIN CAPITAL LETTER D]\n\t\tbuffer.WriteString(\"D\")\n\tcase \"F0\", // [LATIN SMALL LETTER ETH]\n\t\t\"10F\", // [LATIN SMALL LETTER D WITH CARON]\n\t\t\"111\", // [LATIN SMALL LETTER D WITH STROKE]\n\t\t\"18C\", // [LATIN SMALL LETTER D WITH TOPBAR]\n\t\t\"221\", // [LATIN SMALL LETTER D WITH CURL]\n\t\t\"256\", // [LATIN SMALL LETTER D WITH TAIL]\n\t\t\"257\", // [LATIN SMALL LETTER D WITH HOOK]\n\t\t\"1D6D\", // [LATIN SMALL LETTER D WITH MIDDLE TILDE]\n\t\t\"1D81\", // [LATIN SMALL LETTER D WITH PALATAL HOOK]\n\t\t\"1D91\", // [LATIN SMALL LETTER D WITH HOOK AND TAIL]\n\t\t\"1E0B\", // [LATIN SMALL LETTER D WITH DOT ABOVE]\n\t\t\"1E0D\", // [LATIN SMALL LETTER D WITH DOT BELOW]\n\t\t\"1E0F\", // [LATIN SMALL LETTER D WITH LINE BELOW]\n\t\t\"1E11\", // [LATIN SMALL LETTER D WITH CEDILLA]\n\t\t\"1E13\", // [LATIN SMALL LETTER D WITH CIRCUMFLEX BELOW]\n\t\t\"24D3\", // [CIRCLED LATIN SMALL LETTER D]\n\t\t\"A77A\", // [LATIN SMALL LETTER INSULAR D]\n\t\t\"FF44\": // [FULLWIDTH LATIN SMALL LETTER D]\n\t\tbuffer.WriteString(\"d\")\n\tcase \"1C4\", // [LATIN CAPITAL LETTER DZ WITH CARON]\n\t\t\"1F1\": // [LATIN CAPITAL LETTER DZ]\n\t\tbuffer.WriteString(\"D\")\n\t\tbuffer.WriteString(\"Z\")\n\tcase \"1C5\", // [LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON]\n\t\t\"1F2\": // [LATIN CAPITAL LETTER D WITH SMALL LETTER Z]\n\t\tbuffer.WriteString(\"D\")\n\t\tbuffer.WriteString(\"z\")\n\tcase \"249F\": // [PARENTHESIZED LATIN SMALL LETTER D]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"d\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"238\": // [LATIN SMALL LETTER DB DIGRAPH]\n\t\tbuffer.WriteString(\"d\")\n\t\tbuffer.WriteString(\"b\")\n\tcase \"1C6\", // [LATIN SMALL LETTER DZ WITH CARON]\n\t\t\"1F3\", // [LATIN SMALL LETTER DZ]\n\t\t\"2A3\", // [LATIN SMALL LETTER DZ DIGRAPH]\n\t\t\"2A5\": // [LATIN SMALL LETTER DZ DIGRAPH WITH CURL]\n\t\tbuffer.WriteString(\"d\")\n\t\tbuffer.WriteString(\"z\")\n\tcase \"C8\", // [LATIN CAPITAL LETTER E WITH GRAVE]\n\t\t\"C9\", // [LATIN CAPITAL LETTER E WITH ACUTE]\n\t\t\"CA\", // [LATIN CAPITAL LETTER E WITH CIRCUMFLEX]\n\t\t\"CB\", // [LATIN CAPITAL LETTER E WITH DIAERESIS]\n\t\t\"112\", // [LATIN CAPITAL LETTER E WITH MACRON]\n\t\t\"114\", // [LATIN CAPITAL LETTER E WITH BREVE]\n\t\t\"116\", // [LATIN CAPITAL LETTER E WITH DOT ABOVE]\n\t\t\"118\", // [LATIN CAPITAL LETTER E WITH OGONEK]\n\t\t\"11A\", // [LATIN CAPITAL LETTER E WITH CARON]\n\t\t\"18E\", // [LATIN CAPITAL LETTER REVERSED E]\n\t\t\"190\", // [LATIN CAPITAL LETTER OPEN E]\n\t\t\"204\", // [LATIN CAPITAL LETTER E WITH DOUBLE GRAVE]\n\t\t\"206\", // [LATIN CAPITAL LETTER E WITH INVERTED BREVE]\n\t\t\"228\", // [LATIN CAPITAL LETTER E WITH CEDILLA]\n\t\t\"246\", // [LATIN CAPITAL LETTER E WITH STROKE]\n\t\t\"1D07\", // [LATIN LETTER SMALL CAPITAL E]\n\t\t\"1E14\", // [LATIN CAPITAL LETTER E WITH MACRON AND GRAVE]\n\t\t\"1E16\", // [LATIN CAPITAL LETTER E WITH MACRON AND ACUTE]\n\t\t\"1E18\", // [LATIN CAPITAL LETTER E WITH CIRCUMFLEX BELOW]\n\t\t\"1E1A\", // [LATIN CAPITAL LETTER E WITH TILDE BELOW]\n\t\t\"1E1C\", // [LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE]\n\t\t\"1EB8\", // [LATIN CAPITAL LETTER E WITH DOT BELOW]\n\t\t\"1EBA\", // [LATIN CAPITAL LETTER E WITH HOOK ABOVE]\n\t\t\"1EBC\", // [LATIN CAPITAL LETTER E WITH TILDE]\n\t\t\"1EBE\", // [LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE]\n\t\t\"1EC0\", // [LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE]\n\t\t\"1EC2\", // [LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE]\n\t\t\"1EC4\", // [LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE]\n\t\t\"1EC6\", // [LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW]\n\t\t\"24BA\", // [CIRCLED LATIN CAPITAL LETTER E]\n\t\t\"2C7B\", // [LATIN LETTER SMALL CAPITAL TURNED E]\n\t\t\"FF25\": // [FULLWIDTH LATIN CAPITAL LETTER E]\n\t\tbuffer.WriteString(\"E\")\n\tcase \"E8\", // [LATIN SMALL LETTER E WITH GRAVE]\n\t\t\"E9\", // [LATIN SMALL LETTER E WITH ACUTE]\n\t\t\"EA\", // [LATIN SMALL LETTER E WITH CIRCUMFLEX]\n\t\t\"EB\", // [LATIN SMALL LETTER E WITH DIAERESIS]\n\t\t\"113\", // [LATIN SMALL LETTER E WITH MACRON]\n\t\t\"115\", // [LATIN SMALL LETTER E WITH BREVE]\n\t\t\"117\", // [LATIN SMALL LETTER E WITH DOT ABOVE]\n\t\t\"119\", // [LATIN SMALL LETTER E WITH OGONEK]\n\t\t\"11B\", // [LATIN SMALL LETTER E WITH CARON]\n\t\t\"1DD\", // [LATIN SMALL LETTER TURNED E]\n\t\t\"205\", // [LATIN SMALL LETTER E WITH DOUBLE GRAVE]\n\t\t\"207\", // [LATIN SMALL LETTER E WITH INVERTED BREVE]\n\t\t\"229\", // [LATIN SMALL LETTER E WITH CEDILLA]\n\t\t\"247\", // [LATIN SMALL LETTER E WITH STROKE]\n\t\t\"258\", // [LATIN SMALL LETTER REVERSED E]\n\t\t\"25B\", // [LATIN SMALL LETTER OPEN E]\n\t\t\"25C\", // [LATIN SMALL LETTER REVERSED OPEN E]\n\t\t\"25D\", // [LATIN SMALL LETTER REVERSED OPEN E WITH HOOK]\n\t\t\"25E\", // [LATIN SMALL LETTER CLOSED REVERSED OPEN E]\n\t\t\"29A\", // [LATIN SMALL LETTER CLOSED OPEN E]\n\t\t\"1D08\", // [LATIN SMALL LETTER TURNED OPEN E]\n\t\t\"1D92\", // [LATIN SMALL LETTER E WITH RETROFLEX HOOK]\n\t\t\"1D93\", // [LATIN SMALL LETTER OPEN E WITH RETROFLEX HOOK]\n\t\t\"1D94\", // [LATIN SMALL LETTER REVERSED OPEN E WITH RETROFLEX HOOK]\n\t\t\"1E15\", // [LATIN SMALL LETTER E WITH MACRON AND GRAVE]\n\t\t\"1E17\", // [LATIN SMALL LETTER E WITH MACRON AND ACUTE]\n\t\t\"1E19\", // [LATIN SMALL LETTER E WITH CIRCUMFLEX BELOW]\n\t\t\"1E1B\", // [LATIN SMALL LETTER E WITH TILDE BELOW]\n\t\t\"1E1D\", // [LATIN SMALL LETTER E WITH CEDILLA AND BREVE]\n\t\t\"1EB9\", // [LATIN SMALL LETTER E WITH DOT BELOW]\n\t\t\"1EBB\", // [LATIN SMALL LETTER E WITH HOOK ABOVE]\n\t\t\"1EBD\", // [LATIN SMALL LETTER E WITH TILDE]\n\t\t\"1EBF\", // [LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE]\n\t\t\"1EC1\", // [LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE]\n\t\t\"1EC3\", // [LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE]\n\t\t\"1EC5\", // [LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE]\n\t\t\"1EC7\", // [LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW]\n\t\t\"2091\", // [LATIN SUBSCRIPT SMALL LETTER E]\n\t\t\"24D4\", // [CIRCLED LATIN SMALL LETTER E]\n\t\t\"2C78\", // [LATIN SMALL LETTER E WITH NOTCH]\n\t\t\"FF45\": // [FULLWIDTH LATIN SMALL LETTER E]\n\t\tbuffer.WriteString(\"e\")\n\tcase \"24A0\": // [PARENTHESIZED LATIN SMALL LETTER E]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"e\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"191\", // [LATIN CAPITAL LETTER F WITH HOOK]\n\t\t\"1E1E\", // [LATIN CAPITAL LETTER F WITH DOT ABOVE]\n\t\t\"24BB\", // [CIRCLED LATIN CAPITAL LETTER F]\n\t\t\"A730\", // [LATIN LETTER SMALL CAPITAL F]\n\t\t\"A77B\", // [LATIN CAPITAL LETTER INSULAR F]\n\t\t\"A7FB\", // [LATIN EPIGRAPHIC LETTER REVERSED F]\n\t\t\"FF26\": // [FULLWIDTH LATIN CAPITAL LETTER F]\n\t\tbuffer.WriteString(\"F\")\n\tcase \"192\", // [LATIN SMALL LETTER F WITH HOOK]\n\t\t\"1D6E\", // [LATIN SMALL LETTER F WITH MIDDLE TILDE]\n\t\t\"1D82\", // [LATIN SMALL LETTER F WITH PALATAL HOOK]\n\t\t\"1E1F\", // [LATIN SMALL LETTER F WITH DOT ABOVE]\n\t\t\"1E9B\", // [LATIN SMALL LETTER LONG S WITH DOT ABOVE]\n\t\t\"24D5\", // [CIRCLED LATIN SMALL LETTER F]\n\t\t\"A77C\", // [LATIN SMALL LETTER INSULAR F]\n\t\t\"FF46\": // [FULLWIDTH LATIN SMALL LETTER F]\n\t\tbuffer.WriteString(\"f\")\n\tcase \"24A1\": // [PARENTHESIZED LATIN SMALL LETTER F]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"f\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"FB00\": // [LATIN SMALL LIGATURE FF]\n\t\tbuffer.WriteString(\"f\")\n\t\tbuffer.WriteString(\"f\")\n\tcase \"FB03\": // [LATIN SMALL LIGATURE FFI]\n\t\tbuffer.WriteString(\"f\")\n\t\tbuffer.WriteString(\"f\")\n\t\tbuffer.WriteString(\"i\")\n\tcase \"FB04\": // [LATIN SMALL LIGATURE FFL]\n\t\tbuffer.WriteString(\"f\")\n\t\tbuffer.WriteString(\"f\")\n\t\tbuffer.WriteString(\"l\")\n\tcase \"FB01\": // [LATIN SMALL LIGATURE FI]\n\t\tbuffer.WriteString(\"f\")\n\t\tbuffer.WriteString(\"i\")\n\tcase \"FB02\": // [LATIN SMALL LIGATURE FL]\n\t\tbuffer.WriteString(\"f\")\n\t\tbuffer.WriteString(\"l\")\n\tcase \"11C\", // [LATIN CAPITAL LETTER G WITH CIRCUMFLEX]\n\t\t\"11E\", // [LATIN CAPITAL LETTER G WITH BREVE]\n\t\t\"120\", // [LATIN CAPITAL LETTER G WITH DOT ABOVE]\n\t\t\"122\", // [LATIN CAPITAL LETTER G WITH CEDILLA]\n\t\t\"193\", // [LATIN CAPITAL LETTER G WITH HOOK]\n\t\t\"1E4\", // [LATIN CAPITAL LETTER G WITH STROKE]\n\t\t\"1E5\", // [LATIN SMALL LETTER G WITH STROKE]\n\t\t\"1E6\", // [LATIN CAPITAL LETTER G WITH CARON]\n\t\t\"1E7\", // [LATIN SMALL LETTER G WITH CARON]\n\t\t\"1F4\", // [LATIN CAPITAL LETTER G WITH ACUTE]\n\t\t\"262\", // [LATIN LETTER SMALL CAPITAL G]\n\t\t\"29B\", // [LATIN LETTER SMALL CAPITAL G WITH HOOK]\n\t\t\"1E20\", // [LATIN CAPITAL LETTER G WITH MACRON]\n\t\t\"24BC\", // [CIRCLED LATIN CAPITAL LETTER G]\n\t\t\"A77D\", // [LATIN CAPITAL LETTER INSULAR G]\n\t\t\"A77E\", // [LATIN CAPITAL LETTER TURNED INSULAR G]\n\t\t\"FF27\": // [FULLWIDTH LATIN CAPITAL LETTER G]\n\t\tbuffer.WriteString(\"G\")\n\tcase \"11D\", // [LATIN SMALL LETTER G WITH CIRCUMFLEX]\n\t\t\"11F\", // [LATIN SMALL LETTER G WITH BREVE]\n\t\t\"121\", // [LATIN SMALL LETTER G WITH DOT ABOVE]\n\t\t\"123\", // [LATIN SMALL LETTER G WITH CEDILLA]\n\t\t\"1F5\", // [LATIN SMALL LETTER G WITH ACUTE]\n\t\t\"260\", // [LATIN SMALL LETTER G WITH HOOK]\n\t\t\"261\", // [LATIN SMALL LETTER SCRIPT G]\n\t\t\"1D77\", // [LATIN SMALL LETTER TURNED G]\n\t\t\"1D79\", // [LATIN SMALL LETTER INSULAR G]\n\t\t\"1D83\", // [LATIN SMALL LETTER G WITH PALATAL HOOK]\n\t\t\"1E21\", // [LATIN SMALL LETTER G WITH MACRON]\n\t\t\"24D6\", // [CIRCLED LATIN SMALL LETTER G]\n\t\t\"A77F\", // [LATIN SMALL LETTER TURNED INSULAR G]\n\t\t\"FF47\": // [FULLWIDTH LATIN SMALL LETTER G]\n\t\tbuffer.WriteString(\"g\")\n\tcase \"24A2\": // [PARENTHESIZED LATIN SMALL LETTER G]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"g\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"124\", // [LATIN CAPITAL LETTER H WITH CIRCUMFLEX]\n\t\t\"126\", // [LATIN CAPITAL LETTER H WITH STROKE]\n\t\t\"21E\", // [LATIN CAPITAL LETTER H WITH CARON]\n\t\t\"29C\", // [LATIN LETTER SMALL CAPITAL H]\n\t\t\"1E22\", // [LATIN CAPITAL LETTER H WITH DOT ABOVE]\n\t\t\"1E24\", // [LATIN CAPITAL LETTER H WITH DOT BELOW]\n\t\t\"1E26\", // [LATIN CAPITAL LETTER H WITH DIAERESIS]\n\t\t\"1E28\", // [LATIN CAPITAL LETTER H WITH CEDILLA]\n\t\t\"1E2A\", // [LATIN CAPITAL LETTER H WITH BREVE BELOW]\n\t\t\"24BD\", // [CIRCLED LATIN CAPITAL LETTER H]\n\t\t\"2C67\", // [LATIN CAPITAL LETTER H WITH DESCENDER]\n\t\t\"2C75\", // [LATIN CAPITAL LETTER HALF H]\n\t\t\"FF28\": // [FULLWIDTH LATIN CAPITAL LETTER H]\n\t\tbuffer.WriteString(\"H\")\n\tcase \"125\", // [LATIN SMALL LETTER H WITH CIRCUMFLEX]\n\t\t\"127\", // [LATIN SMALL LETTER H WITH STROKE]\n\t\t\"21F\", // [LATIN SMALL LETTER H WITH CARON]\n\t\t\"265\", // [LATIN SMALL LETTER TURNED H]\n\t\t\"266\", // [LATIN SMALL LETTER H WITH HOOK]\n\t\t\"2AE\", // [LATIN SMALL LETTER TURNED H WITH FISHHOOK]\n\t\t\"2AF\", // [LATIN SMALL LETTER TURNED H WITH FISHHOOK AND TAIL]\n\t\t\"1E23\", // [LATIN SMALL LETTER H WITH DOT ABOVE]\n\t\t\"1E25\", // [LATIN SMALL LETTER H WITH DOT BELOW]\n\t\t\"1E27\", // [LATIN SMALL LETTER H WITH DIAERESIS]\n\t\t\"1E29\", // [LATIN SMALL LETTER H WITH CEDILLA]\n\t\t\"1E2B\", // [LATIN SMALL LETTER H WITH BREVE BELOW]\n\t\t\"1E96\", // [LATIN SMALL LETTER H WITH LINE BELOW]\n\t\t\"24D7\", // [CIRCLED LATIN SMALL LETTER H]\n\t\t\"2C68\", // [LATIN SMALL LETTER H WITH DESCENDER]\n\t\t\"2C76\", // [LATIN SMALL LETTER HALF H]\n\t\t\"FF48\": // [FULLWIDTH LATIN SMALL LETTER H]\n\t\tbuffer.WriteString(\"h\")\n\tcase \"1F6\": // [LATIN CAPITAL LETTER HWAIR]\n\t\tbuffer.WriteString(\"H\")\n\t\tbuffer.WriteString(\"V\")\n\tcase \"24A3\": // [PARENTHESIZED LATIN SMALL LETTER H]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"h\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"195\": // [LATIN SMALL LETTER HV]\n\t\tbuffer.WriteString(\"h\")\n\t\tbuffer.WriteString(\"v\")\n\tcase \"CC\", // [LATIN CAPITAL LETTER I WITH GRAVE]\n\t\t\"CD\", // [LATIN CAPITAL LETTER I WITH ACUTE]\n\t\t\"CE\", // [LATIN CAPITAL LETTER I WITH CIRCUMFLEX]\n\t\t\"CF\", // [LATIN CAPITAL LETTER I WITH DIAERESIS]\n\t\t\"128\", // [LATIN CAPITAL LETTER I WITH TILDE]\n\t\t\"12A\", // [LATIN CAPITAL LETTER I WITH MACRON]\n\t\t\"12C\", // [LATIN CAPITAL LETTER I WITH BREVE]\n\t\t\"12E\", // [LATIN CAPITAL LETTER I WITH OGONEK]\n\t\t\"130\", // [LATIN CAPITAL LETTER I WITH DOT ABOVE]\n\t\t\"196\", // [LATIN CAPITAL LETTER IOTA]\n\t\t\"197\", // [LATIN CAPITAL LETTER I WITH STROKE]\n\t\t\"1CF\", // [LATIN CAPITAL LETTER I WITH CARON]\n\t\t\"208\", // [LATIN CAPITAL LETTER I WITH DOUBLE GRAVE]\n\t\t\"20A\", // [LATIN CAPITAL LETTER I WITH INVERTED BREVE]\n\t\t\"26A\", // [LATIN LETTER SMALL CAPITAL I]\n\t\t\"1D7B\", // [LATIN SMALL CAPITAL LETTER I WITH STROKE]\n\t\t\"1E2C\", // [LATIN CAPITAL LETTER I WITH TILDE BELOW]\n\t\t\"1E2E\", // [LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE]\n\t\t\"1EC8\", // [LATIN CAPITAL LETTER I WITH HOOK ABOVE]\n\t\t\"1ECA\", // [LATIN CAPITAL LETTER I WITH DOT BELOW]\n\t\t\"24BE\", // [CIRCLED LATIN CAPITAL LETTER I]\n\t\t\"A7FE\", // [LATIN EPIGRAPHIC LETTER I LONGA]\n\t\t\"FF29\": // [FULLWIDTH LATIN CAPITAL LETTER I]\n\t\tbuffer.WriteString(\"I\")\n\tcase \"EC\", // [LATIN SMALL LETTER I WITH GRAVE]\n\t\t\"ED\", // [LATIN SMALL LETTER I WITH ACUTE]\n\t\t\"EE\", // [LATIN SMALL LETTER I WITH CIRCUMFLEX]\n\t\t\"EF\", // [LATIN SMALL LETTER I WITH DIAERESIS]\n\t\t\"129\", // [LATIN SMALL LETTER I WITH TILDE]\n\t\t\"12B\", // [LATIN SMALL LETTER I WITH MACRON]\n\t\t\"12D\", // [LATIN SMALL LETTER I WITH BREVE]\n\t\t\"12F\", // [LATIN SMALL LETTER I WITH OGONEK]\n\t\t\"131\", // [LATIN SMALL LETTER DOTLESS I]\n\t\t\"1D0\", // [LATIN SMALL LETTER I WITH CARON]\n\t\t\"209\", // [LATIN SMALL LETTER I WITH DOUBLE GRAVE]\n\t\t\"20B\", // [LATIN SMALL LETTER I WITH INVERTED BREVE]\n\t\t\"268\", // [LATIN SMALL LETTER I WITH STROKE]\n\t\t\"1D09\", // [LATIN SMALL LETTER TURNED I]\n\t\t\"1D62\", // [LATIN SUBSCRIPT SMALL LETTER I]\n\t\t\"1D7C\", // [LATIN SMALL LETTER IOTA WITH STROKE]\n\t\t\"1D96\", // [LATIN SMALL LETTER I WITH RETROFLEX HOOK]\n\t\t\"1E2D\", // [LATIN SMALL LETTER I WITH TILDE BELOW]\n\t\t\"1E2F\", // [LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE]\n\t\t\"1EC9\", // [LATIN SMALL LETTER I WITH HOOK ABOVE]\n\t\t\"1ECB\", // [LATIN SMALL LETTER I WITH DOT BELOW]\n\t\t\"2071\", // [SUPERSCRIPT LATIN SMALL LETTER I]\n\t\t\"24D8\", // [CIRCLED LATIN SMALL LETTER I]\n\t\t\"FF49\": // [FULLWIDTH LATIN SMALL LETTER I]\n\t\tbuffer.WriteString(\"i\")\n\tcase \"132\": // [LATIN CAPITAL LIGATURE IJ]\n\t\tbuffer.WriteString(\"I\")\n\t\tbuffer.WriteString(\"J\")\n\tcase \"24A4\": // [PARENTHESIZED LATIN SMALL LETTER I]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"i\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"133\": // [LATIN SMALL LIGATURE IJ]\n\t\tbuffer.WriteString(\"i\")\n\t\tbuffer.WriteString(\"j\")\n\tcase \"134\", // [LATIN CAPITAL LETTER J WITH CIRCUMFLEX]\n\t\t\"248\", // [LATIN CAPITAL LETTER J WITH STROKE]\n\t\t\"1D0A\", // [LATIN LETTER SMALL CAPITAL J]\n\t\t\"24BF\", // [CIRCLED LATIN CAPITAL LETTER J]\n\t\t\"FF2A\": // [FULLWIDTH LATIN CAPITAL LETTER J]\n\t\tbuffer.WriteString(\"J\")\n\tcase \"135\", // [LATIN SMALL LETTER J WITH CIRCUMFLEX]\n\t\t\"1F0\", // [LATIN SMALL LETTER J WITH CARON]\n\t\t\"237\", // [LATIN SMALL LETTER DOTLESS J]\n\t\t\"249\", // [LATIN SMALL LETTER J WITH STROKE]\n\t\t\"25F\", // [LATIN SMALL LETTER DOTLESS J WITH STROKE]\n\t\t\"284\", // [LATIN SMALL LETTER DOTLESS J WITH STROKE AND HOOK]\n\t\t\"29D\", // [LATIN SMALL LETTER J WITH CROSSED-TAIL]\n\t\t\"24D9\", // [CIRCLED LATIN SMALL LETTER J]\n\t\t\"2C7C\", // [LATIN SUBSCRIPT SMALL LETTER J]\n\t\t\"FF4A\": // [FULLWIDTH LATIN SMALL LETTER J]\n\t\tbuffer.WriteString(\"j\")\n\tcase \"24A5\": // [PARENTHESIZED LATIN SMALL LETTER J]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"j\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"136\", // [LATIN CAPITAL LETTER K WITH CEDILLA]\n\t\t\"198\", // [LATIN CAPITAL LETTER K WITH HOOK]\n\t\t\"1E8\", // [LATIN CAPITAL LETTER K WITH CARON]\n\t\t\"1D0B\", // [LATIN LETTER SMALL CAPITAL K]\n\t\t\"1E30\", // [LATIN CAPITAL LETTER K WITH ACUTE]\n\t\t\"1E32\", // [LATIN CAPITAL LETTER K WITH DOT BELOW]\n\t\t\"1E34\", // [LATIN CAPITAL LETTER K WITH LINE BELOW]\n\t\t\"24C0\", // [CIRCLED LATIN CAPITAL LETTER K]\n\t\t\"2C69\", // [LATIN CAPITAL LETTER K WITH DESCENDER]\n\t\t\"A740\", // [LATIN CAPITAL LETTER K WITH STROKE]\n\t\t\"A742\", // [LATIN CAPITAL LETTER K WITH DIAGONAL STROKE]\n\t\t\"A744\", // [LATIN CAPITAL LETTER K WITH STROKE AND DIAGONAL STROKE]\n\t\t\"FF2B\": // [FULLWIDTH LATIN CAPITAL LETTER K]\n\t\tbuffer.WriteString(\"K\")\n\tcase \"137\", // [LATIN SMALL LETTER K WITH CEDILLA]\n\t\t\"199\", // [LATIN SMALL LETTER K WITH HOOK]\n\t\t\"1E9\", // [LATIN SMALL LETTER K WITH CARON]\n\t\t\"29E\", // [LATIN SMALL LETTER TURNED K]\n\t\t\"1D84\", // [LATIN SMALL LETTER K WITH PALATAL HOOK]\n\t\t\"1E31\", // [LATIN SMALL LETTER K WITH ACUTE]\n\t\t\"1E33\", // [LATIN SMALL LETTER K WITH DOT BELOW]\n\t\t\"1E35\", // [LATIN SMALL LETTER K WITH LINE BELOW]\n\t\t\"24DA\", // [CIRCLED LATIN SMALL LETTER K]\n\t\t\"2C6A\", // [LATIN SMALL LETTER K WITH DESCENDER]\n\t\t\"A741\", // [LATIN SMALL LETTER K WITH STROKE]\n\t\t\"A743\", // [LATIN SMALL LETTER K WITH DIAGONAL STROKE]\n\t\t\"A745\", // [LATIN SMALL LETTER K WITH STROKE AND DIAGONAL STROKE]\n\t\t\"FF4B\": // [FULLWIDTH LATIN SMALL LETTER K]\n\t\tbuffer.WriteString(\"k\")\n\tcase \"24A6\": // [PARENTHESIZED LATIN SMALL LETTER K]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"k\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"139\", // [LATIN CAPITAL LETTER L WITH ACUTE]\n\t\t\"13B\", // [LATIN CAPITAL LETTER L WITH CEDILLA]\n\t\t\"13D\", // [LATIN CAPITAL LETTER L WITH CARON]\n\t\t\"13F\", // [LATIN CAPITAL LETTER L WITH MIDDLE DOT]\n\t\t\"141\", // [LATIN CAPITAL LETTER L WITH STROKE]\n\t\t\"23D\", // [LATIN CAPITAL LETTER L WITH BAR]\n\t\t\"29F\", // [LATIN LETTER SMALL CAPITAL L]\n\t\t\"1D0C\", // [LATIN LETTER SMALL CAPITAL L WITH STROKE]\n\t\t\"1E36\", // [LATIN CAPITAL LETTER L WITH DOT BELOW]\n\t\t\"1E38\", // [LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON]\n\t\t\"1E3A\", // [LATIN CAPITAL LETTER L WITH LINE BELOW]\n\t\t\"1E3C\", // [LATIN CAPITAL LETTER L WITH CIRCUMFLEX BELOW]\n\t\t\"24C1\", // [CIRCLED LATIN CAPITAL LETTER L]\n\t\t\"2C60\", // [LATIN CAPITAL LETTER L WITH DOUBLE BAR]\n\t\t\"2C62\", // [LATIN CAPITAL LETTER L WITH MIDDLE TILDE]\n\t\t\"A746\", // [LATIN CAPITAL LETTER BROKEN L]\n\t\t\"A748\", // [LATIN CAPITAL LETTER L WITH HIGH STROKE]\n\t\t\"A780\", // [LATIN CAPITAL LETTER TURNED L]\n\t\t\"FF2C\": // [FULLWIDTH LATIN CAPITAL LETTER L]\n\t\tbuffer.WriteString(\"L\")\n\tcase \"13A\", // [LATIN SMALL LETTER L WITH ACUTE]\n\t\t\"13C\", // [LATIN SMALL LETTER L WITH CEDILLA]\n\t\t\"13E\", // [LATIN SMALL LETTER L WITH CARON]\n\t\t\"140\", // [LATIN SMALL LETTER L WITH MIDDLE DOT]\n\t\t\"142\", // [LATIN SMALL LETTER L WITH STROKE]\n\t\t\"19A\", // [LATIN SMALL LETTER L WITH BAR]\n\t\t\"234\", // [LATIN SMALL LETTER L WITH CURL]\n\t\t\"26B\", // [LATIN SMALL LETTER L WITH MIDDLE TILDE]\n\t\t\"26C\", // [LATIN SMALL LETTER L WITH BELT]\n\t\t\"26D\", // [LATIN SMALL LETTER L WITH RETROFLEX HOOK]\n\t\t\"1D85\", // [LATIN SMALL LETTER L WITH PALATAL HOOK]\n\t\t\"1E37\", // [LATIN SMALL LETTER L WITH DOT BELOW]\n\t\t\"1E39\", // [LATIN SMALL LETTER L WITH DOT BELOW AND MACRON]\n\t\t\"1E3B\", // [LATIN SMALL LETTER L WITH LINE BELOW]\n\t\t\"1E3D\", // [LATIN SMALL LETTER L WITH CIRCUMFLEX BELOW]\n\t\t\"24DB\", // [CIRCLED LATIN SMALL LETTER L]\n\t\t\"2C61\", // [LATIN SMALL LETTER L WITH DOUBLE BAR]\n\t\t\"A747\", // [LATIN SMALL LETTER BROKEN L]\n\t\t\"A749\", // [LATIN SMALL LETTER L WITH HIGH STROKE]\n\t\t\"A781\", // [LATIN SMALL LETTER TURNED L]\n\t\t\"FF4C\": // [FULLWIDTH LATIN SMALL LETTER L]\n\t\tbuffer.WriteString(\"l\")\n\tcase \"1C7\": // [LATIN CAPITAL LETTER LJ]\n\t\tbuffer.WriteString(\"L\")\n\t\tbuffer.WriteString(\"J\")\n\tcase \"1EFA\": // [LATIN CAPITAL LETTER MIDDLE-WELSH LL]\n\t\tbuffer.WriteString(\"L\")\n\t\tbuffer.WriteString(\"L\")\n\tcase \"1C8\": // [LATIN CAPITAL LETTER L WITH SMALL LETTER J]\n\t\tbuffer.WriteString(\"L\")\n\t\tbuffer.WriteString(\"j\")\n\tcase \"24A7\": // [PARENTHESIZED LATIN SMALL LETTER L]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"l\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"1C9\": // [LATIN SMALL LETTER LJ]\n\t\tbuffer.WriteString(\"l\")\n\t\tbuffer.WriteString(\"j\")\n\tcase \"1EFB\": // [LATIN SMALL LETTER MIDDLE-WELSH LL]\n\t\tbuffer.WriteString(\"l\")\n\t\tbuffer.WriteString(\"l\")\n\tcase \"2AA\": // [LATIN SMALL LETTER LS DIGRAPH]\n\t\tbuffer.WriteString(\"l\")\n\t\tbuffer.WriteString(\"s\")\n\tcase \"2AB\": // [LATIN SMALL LETTER LZ DIGRAPH]\n\t\tbuffer.WriteString(\"l\")\n\t\tbuffer.WriteString(\"z\")\n\tcase \"19C\", // [LATIN CAPITAL LETTER TURNED M]\n\t\t\"1D0D\", // [LATIN LETTER SMALL CAPITAL M]\n\t\t\"1E3E\", // [LATIN CAPITAL LETTER M WITH ACUTE]\n\t\t\"1E40\", // [LATIN CAPITAL LETTER M WITH DOT ABOVE]\n\t\t\"1E42\", // [LATIN CAPITAL LETTER M WITH DOT BELOW]\n\t\t\"24C2\", // [CIRCLED LATIN CAPITAL LETTER M]\n\t\t\"2C6E\", // [LATIN CAPITAL LETTER M WITH HOOK]\n\t\t\"A7FD\", // [LATIN EPIGRAPHIC LETTER INVERTED M]\n\t\t\"A7FF\", // [LATIN EPIGRAPHIC LETTER ARCHAIC M]\n\t\t\"FF2D\": // [FULLWIDTH LATIN CAPITAL LETTER M]\n\t\tbuffer.WriteString(\"M\")\n\tcase \"26F\", // [LATIN SMALL LETTER TURNED M]\n\t\t\"270\", // [LATIN SMALL LETTER TURNED M WITH LONG LEG]\n\t\t\"271\", // [LATIN SMALL LETTER M WITH HOOK]\n\t\t\"1D6F\", // [LATIN SMALL LETTER M WITH MIDDLE TILDE]\n\t\t\"1D86\", // [LATIN SMALL LETTER M WITH PALATAL HOOK]\n\t\t\"1E3F\", // [LATIN SMALL LETTER M WITH ACUTE]\n\t\t\"1E41\", // [LATIN SMALL LETTER M WITH DOT ABOVE]\n\t\t\"1E43\", // [LATIN SMALL LETTER M WITH DOT BELOW]\n\t\t\"24DC\", // [CIRCLED LATIN SMALL LETTER M]\n\t\t\"FF4D\": // [FULLWIDTH LATIN SMALL LETTER M]\n\t\tbuffer.WriteString(\"m\")\n\tcase \"24A8\": // [PARENTHESIZED LATIN SMALL LETTER M]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"m\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"D1\", // [LATIN CAPITAL LETTER N WITH TILDE]\n\t\t\"143\", // [LATIN CAPITAL LETTER N WITH ACUTE]\n\t\t\"145\", // [LATIN CAPITAL LETTER N WITH CEDILLA]\n\t\t\"147\", // [LATIN CAPITAL LETTER N WITH CARON]\n\t\t\"14A\", // [LATIN CAPITAL LETTER ENG]\n\t\t\"19D\", // [LATIN CAPITAL LETTER N WITH LEFT HOOK]\n\t\t\"1F8\", // [LATIN CAPITAL LETTER N WITH GRAVE]\n\t\t\"220\", // [LATIN CAPITAL LETTER N WITH LONG RIGHT LEG]\n\t\t\"274\", // [LATIN LETTER SMALL CAPITAL N]\n\t\t\"1D0E\", // [LATIN LETTER SMALL CAPITAL REVERSED N]\n\t\t\"1E44\", // [LATIN CAPITAL LETTER N WITH DOT ABOVE]\n\t\t\"1E46\", // [LATIN CAPITAL LETTER N WITH DOT BELOW]\n\t\t\"1E48\", // [LATIN CAPITAL LETTER N WITH LINE BELOW]\n\t\t\"1E4A\", // [LATIN CAPITAL LETTER N WITH CIRCUMFLEX BELOW]\n\t\t\"24C3\", // [CIRCLED LATIN CAPITAL LETTER N]\n\t\t\"FF2E\": // [FULLWIDTH LATIN CAPITAL LETTER N]\n\t\tbuffer.WriteString(\"N\")\n\tcase \"F1\", // [LATIN SMALL LETTER N WITH TILDE]\n\t\t\"144\", // [LATIN SMALL LETTER N WITH ACUTE]\n\t\t\"146\", // [LATIN SMALL LETTER N WITH CEDILLA]\n\t\t\"148\", // [LATIN SMALL LETTER N WITH CARON]\n\t\t\"149\", // [LATIN SMALL LETTER N PRECEDED BY APOSTROPHE]\n\t\t\"14B\", // [LATIN SMALL LETTER ENG]\n\t\t\"19E\", // [LATIN SMALL LETTER N WITH LONG RIGHT LEG]\n\t\t\"1F9\", // [LATIN SMALL LETTER N WITH GRAVE]\n\t\t\"235\", // [LATIN SMALL LETTER N WITH CURL]\n\t\t\"272\", // [LATIN SMALL LETTER N WITH LEFT HOOK]\n\t\t\"273\", // [LATIN SMALL LETTER N WITH RETROFLEX HOOK]\n\t\t\"1D70\", // [LATIN SMALL LETTER N WITH MIDDLE TILDE]\n\t\t\"1D87\", // [LATIN SMALL LETTER N WITH PALATAL HOOK]\n\t\t\"1E45\", // [LATIN SMALL LETTER N WITH DOT ABOVE]\n\t\t\"1E47\", // [LATIN SMALL LETTER N WITH DOT BELOW]\n\t\t\"1E49\", // [LATIN SMALL LETTER N WITH LINE BELOW]\n\t\t\"1E4B\", // [LATIN SMALL LETTER N WITH CIRCUMFLEX BELOW]\n\t\t\"207F\", // [SUPERSCRIPT LATIN SMALL LETTER N]\n\t\t\"24DD\", // [CIRCLED LATIN SMALL LETTER N]\n\t\t\"FF4E\": // [FULLWIDTH LATIN SMALL LETTER N]\n\t\tbuffer.WriteString(\"n\")\n\tcase \"1CA\": // [LATIN CAPITAL LETTER NJ]\n\t\tbuffer.WriteString(\"N\")\n\t\tbuffer.WriteString(\"J\")\n\tcase \"1CB\": // [LATIN CAPITAL LETTER N WITH SMALL LETTER J]\n\t\tbuffer.WriteString(\"N\")\n\t\tbuffer.WriteString(\"j\")\n\tcase \"24A9\": // [PARENTHESIZED LATIN SMALL LETTER N]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"n\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"1CC\": // [LATIN SMALL LETTER NJ]\n\t\tbuffer.WriteString(\"n\")\n\t\tbuffer.WriteString(\"j\")\n\tcase \"D2\", // [LATIN CAPITAL LETTER O WITH GRAVE]\n\t\t\"D3\", // [LATIN CAPITAL LETTER O WITH ACUTE]\n\t\t\"D4\", // [LATIN CAPITAL LETTER O WITH CIRCUMFLEX]\n\t\t\"D5\", // [LATIN CAPITAL LETTER O WITH TILDE]\n\t\t\"D6\", // [LATIN CAPITAL LETTER O WITH DIAERESIS]\n\t\t\"D8\", // [LATIN CAPITAL LETTER O WITH STROKE]\n\t\t\"14C\", // [LATIN CAPITAL LETTER O WITH MACRON]\n\t\t\"14E\", // [LATIN CAPITAL LETTER O WITH BREVE]\n\t\t\"150\", // [LATIN CAPITAL LETTER O WITH DOUBLE ACUTE]\n\t\t\"186\", // [LATIN CAPITAL LETTER OPEN O]\n\t\t\"19F\", // [LATIN CAPITAL LETTER O WITH MIDDLE TILDE]\n\t\t\"1A0\", // [LATIN CAPITAL LETTER O WITH HORN]\n\t\t\"1D1\", // [LATIN CAPITAL LETTER O WITH CARON]\n\t\t\"1EA\", // [LATIN CAPITAL LETTER O WITH OGONEK]\n\t\t\"1EC\", // [LATIN CAPITAL LETTER O WITH OGONEK AND MACRON]\n\t\t\"1FE\", // [LATIN CAPITAL LETTER O WITH STROKE AND ACUTE]\n\t\t\"20C\", // [LATIN CAPITAL LETTER O WITH DOUBLE GRAVE]\n\t\t\"20E\", // [LATIN CAPITAL LETTER O WITH INVERTED BREVE]\n\t\t\"22A\", // [LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON]\n\t\t\"22C\", // [LATIN CAPITAL LETTER O WITH TILDE AND MACRON]\n\t\t\"22E\", // [LATIN CAPITAL LETTER O WITH DOT ABOVE]\n\t\t\"230\", // [LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON]\n\t\t\"1D0F\", // [LATIN LETTER SMALL CAPITAL O]\n\t\t\"1D10\", // [LATIN LETTER SMALL CAPITAL OPEN O]\n\t\t\"1E4C\", // [LATIN CAPITAL LETTER O WITH TILDE AND ACUTE]\n\t\t\"1E4E\", // [LATIN CAPITAL LETTER O WITH TILDE AND DIAERESIS]\n\t\t\"1E50\", // [LATIN CAPITAL LETTER O WITH MACRON AND GRAVE]\n\t\t\"1E52\", // [LATIN CAPITAL LETTER O WITH MACRON AND ACUTE]\n\t\t\"1ECC\", // [LATIN CAPITAL LETTER O WITH DOT BELOW]\n\t\t\"1ECE\", // [LATIN CAPITAL LETTER O WITH HOOK ABOVE]\n\t\t\"1ED0\", // [LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE]\n\t\t\"1ED2\", // [LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE]\n\t\t\"1ED4\", // [LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE]\n\t\t\"1ED6\", // [LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE]\n\t\t\"1ED8\", // [LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW]\n\t\t\"1EDA\", // [LATIN CAPITAL LETTER O WITH HORN AND ACUTE]\n\t\t\"1EDC\", // [LATIN CAPITAL LETTER O WITH HORN AND GRAVE]\n\t\t\"1EDE\", // [LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE]\n\t\t\"1EE0\", // [LATIN CAPITAL LETTER O WITH HORN AND TILDE]\n\t\t\"1EE2\", // [LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW]\n\t\t\"24C4\", // [CIRCLED LATIN CAPITAL LETTER O]\n\t\t\"A74A\", // [LATIN CAPITAL LETTER O WITH LONG STROKE OVERLAY]\n\t\t\"A74C\", // [LATIN CAPITAL LETTER O WITH LOOP]\n\t\t\"FF2F\": // [FULLWIDTH LATIN CAPITAL LETTER O]\n\t\tbuffer.WriteString(\"O\")\n\tcase \"F2\", // [LATIN SMALL LETTER O WITH GRAVE]\n\t\t\"F3\", // [LATIN SMALL LETTER O WITH ACUTE]\n\t\t\"F4\", // [LATIN SMALL LETTER O WITH CIRCUMFLEX]\n\t\t\"F5\", // [LATIN SMALL LETTER O WITH TILDE]\n\t\t\"F6\", // [LATIN SMALL LETTER O WITH DIAERESIS]\n\t\t\"F8\", // [LATIN SMALL LETTER O WITH STROKE]\n\t\t\"14D\", // [LATIN SMALL LETTER O WITH MACRON]\n\t\t\"14F\", // [LATIN SMALL LETTER O WITH BREVE]\n\t\t\"151\", // [LATIN SMALL LETTER O WITH DOUBLE ACUTE]\n\t\t\"1A1\", // [LATIN SMALL LETTER O WITH HORN]\n\t\t\"1D2\", // [LATIN SMALL LETTER O WITH CARON]\n\t\t\"1EB\", // [LATIN SMALL LETTER O WITH OGONEK]\n\t\t\"1ED\", // [LATIN SMALL LETTER O WITH OGONEK AND MACRON]\n\t\t\"1FF\", // [LATIN SMALL LETTER O WITH STROKE AND ACUTE]\n\t\t\"20D\", // [LATIN SMALL LETTER O WITH DOUBLE GRAVE]\n\t\t\"20F\", // [LATIN SMALL LETTER O WITH INVERTED BREVE]\n\t\t\"22B\", // [LATIN SMALL LETTER O WITH DIAERESIS AND MACRON]\n\t\t\"22D\", // [LATIN SMALL LETTER O WITH TILDE AND MACRON]\n\t\t\"22F\", // [LATIN SMALL LETTER O WITH DOT ABOVE]\n\t\t\"231\", // [LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON]\n\t\t\"254\", // [LATIN SMALL LETTER OPEN O]\n\t\t\"275\", // [LATIN SMALL LETTER BARRED O]\n\t\t\"1D16\", // [LATIN SMALL LETTER TOP HALF O]\n\t\t\"1D17\", // [LATIN SMALL LETTER BOTTOM HALF O]\n\t\t\"1D97\", // [LATIN SMALL LETTER OPEN O WITH RETROFLEX HOOK]\n\t\t\"1E4D\", // [LATIN SMALL LETTER O WITH TILDE AND ACUTE]\n\t\t\"1E4F\", // [LATIN SMALL LETTER O WITH TILDE AND DIAERESIS]\n\t\t\"1E51\", // [LATIN SMALL LETTER O WITH MACRON AND GRAVE]\n\t\t\"1E53\", // [LATIN SMALL LETTER O WITH MACRON AND ACUTE]\n\t\t\"1ECD\", // [LATIN SMALL LETTER O WITH DOT BELOW]\n\t\t\"1ECF\", // [LATIN SMALL LETTER O WITH HOOK ABOVE]\n\t\t\"1ED1\", // [LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE]\n\t\t\"1ED3\", // [LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE]\n\t\t\"1ED5\", // [LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE]\n\t\t\"1ED7\", // [LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE]\n\t\t\"1ED9\", // [LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW]\n\t\t\"1EDB\", // [LATIN SMALL LETTER O WITH HORN AND ACUTE]\n\t\t\"1EDD\", // [LATIN SMALL LETTER O WITH HORN AND GRAVE]\n\t\t\"1EDF\", // [LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE]\n\t\t\"1EE1\", // [LATIN SMALL LETTER O WITH HORN AND TILDE]\n\t\t\"1EE3\", // [LATIN SMALL LETTER O WITH HORN AND DOT BELOW]\n\t\t\"2092\", // [LATIN SUBSCRIPT SMALL LETTER O]\n\t\t\"24DE\", // [CIRCLED LATIN SMALL LETTER O]\n\t\t\"2C7A\", // [LATIN SMALL LETTER O WITH LOW RING INSIDE]\n\t\t\"A74B\", // [LATIN SMALL LETTER O WITH LONG STROKE OVERLAY]\n\t\t\"A74D\", // [LATIN SMALL LETTER O WITH LOOP]\n\t\t\"FF4F\": // [FULLWIDTH LATIN SMALL LETTER O]\n\t\tbuffer.WriteString(\"o\")\n\tcase \"152\", // [LATIN CAPITAL LIGATURE OE]\n\t\t\"276\": // [LATIN LETTER SMALL CAPITAL OE]\n\t\tbuffer.WriteString(\"O\")\n\t\tbuffer.WriteString(\"E\")\n\tcase \"A74E\": // [LATIN CAPITAL LETTER OO]\n\t\tbuffer.WriteString(\"O\")\n\t\tbuffer.WriteString(\"O\")\n\tcase \"222\", // [LATIN CAPITAL LETTER OU]\n\t\t\"1D15\": // [LATIN LETTER SMALL CAPITAL OU]\n\t\tbuffer.WriteString(\"O\")\n\t\tbuffer.WriteString(\"U\")\n\tcase \"24AA\": // [PARENTHESIZED LATIN SMALL LETTER O]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"o\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"153\", // [LATIN SMALL LIGATURE OE]\n\t\t\"1D14\": // [LATIN SMALL LETTER TURNED OE]\n\t\tbuffer.WriteString(\"o\")\n\t\tbuffer.WriteString(\"e\")\n\tcase \"A74F\": // [LATIN SMALL LETTER OO]\n\t\tbuffer.WriteString(\"o\")\n\t\tbuffer.WriteString(\"o\")\n\tcase \"223\": // [LATIN SMALL LETTER OU]\n\t\tbuffer.WriteString(\"o\")\n\t\tbuffer.WriteString(\"u\")\n\tcase \"1A4\", // [LATIN CAPITAL LETTER P WITH HOOK]\n\t\t\"1D18\", // [LATIN LETTER SMALL CAPITAL P]\n\t\t\"1E54\", // [LATIN CAPITAL LETTER P WITH ACUTE]\n\t\t\"1E56\", // [LATIN CAPITAL LETTER P WITH DOT ABOVE]\n\t\t\"24C5\", // [CIRCLED LATIN CAPITAL LETTER P]\n\t\t\"2C63\", // [LATIN CAPITAL LETTER P WITH STROKE]\n\t\t\"A750\", // [LATIN CAPITAL LETTER P WITH STROKE THROUGH DESCENDER]\n\t\t\"A752\", // [LATIN CAPITAL LETTER P WITH FLOURISH]\n\t\t\"A754\", // [LATIN CAPITAL LETTER P WITH SQUIRREL TAIL]\n\t\t\"FF30\": // [FULLWIDTH LATIN CAPITAL LETTER P]\n\t\tbuffer.WriteString(\"P\")\n\tcase \"1A5\", // [LATIN SMALL LETTER P WITH HOOK]\n\t\t\"1D71\", // [LATIN SMALL LETTER P WITH MIDDLE TILDE]\n\t\t\"1D7D\", // [LATIN SMALL LETTER P WITH STROKE]\n\t\t\"1D88\", // [LATIN SMALL LETTER P WITH PALATAL HOOK]\n\t\t\"1E55\", // [LATIN SMALL LETTER P WITH ACUTE]\n\t\t\"1E57\", // [LATIN SMALL LETTER P WITH DOT ABOVE]\n\t\t\"24DF\", // [CIRCLED LATIN SMALL LETTER P]\n\t\t\"A751\", // [LATIN SMALL LETTER P WITH STROKE THROUGH DESCENDER]\n\t\t\"A753\", // [LATIN SMALL LETTER P WITH FLOURISH]\n\t\t\"A755\", // [LATIN SMALL LETTER P WITH SQUIRREL TAIL]\n\t\t\"A7FC\", // [LATIN EPIGRAPHIC LETTER REVERSED P]\n\t\t\"FF50\": // [FULLWIDTH LATIN SMALL LETTER P]\n\t\tbuffer.WriteString(\"p\")\n\tcase \"24AB\": // [PARENTHESIZED LATIN SMALL LETTER P]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"p\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"24A\", // [LATIN CAPITAL LETTER SMALL Q WITH HOOK TAIL]\n\t\t\"24C6\", // [CIRCLED LATIN CAPITAL LETTER Q]\n\t\t\"A756\", // [LATIN CAPITAL LETTER Q WITH STROKE THROUGH DESCENDER]\n\t\t\"A758\", // [LATIN CAPITAL LETTER Q WITH DIAGONAL STROKE]\n\t\t\"FF31\": // [FULLWIDTH LATIN CAPITAL LETTER Q]\n\t\tbuffer.WriteString(\"Q\")\n\tcase \"138\", // [LATIN SMALL LETTER KRA]\n\t\t\"24B\", // [LATIN SMALL LETTER Q WITH HOOK TAIL]\n\t\t\"2A0\", // [LATIN SMALL LETTER Q WITH HOOK]\n\t\t\"24E0\", // [CIRCLED LATIN SMALL LETTER Q]\n\t\t\"A757\", // [LATIN SMALL LETTER Q WITH STROKE THROUGH DESCENDER]\n\t\t\"A759\", // [LATIN SMALL LETTER Q WITH DIAGONAL STROKE]\n\t\t\"FF51\": // [FULLWIDTH LATIN SMALL LETTER Q]\n\t\tbuffer.WriteString(\"q\")\n\tcase \"24AC\": // [PARENTHESIZED LATIN SMALL LETTER Q]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"q\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"239\": // [LATIN SMALL LETTER QP DIGRAPH]\n\t\tbuffer.WriteString(\"q\")\n\t\tbuffer.WriteString(\"p\")\n\tcase \"154\", // [LATIN CAPITAL LETTER R WITH ACUTE]\n\t\t\"156\", // [LATIN CAPITAL LETTER R WITH CEDILLA]\n\t\t\"158\", // [LATIN CAPITAL LETTER R WITH CARON]\n\t\t\"210\", // [LATIN CAPITAL LETTER R WITH DOUBLE GRAVE]\n\t\t\"212\", // [LATIN CAPITAL LETTER R WITH INVERTED BREVE]\n\t\t\"24C\", // [LATIN CAPITAL LETTER R WITH STROKE]\n\t\t\"280\", // [LATIN LETTER SMALL CAPITAL R]\n\t\t\"281\", // [LATIN LETTER SMALL CAPITAL INVERTED R]\n\t\t\"1D19\", // [LATIN LETTER SMALL CAPITAL REVERSED R]\n\t\t\"1D1A\", // [LATIN LETTER SMALL CAPITAL TURNED R]\n\t\t\"1E58\", // [LATIN CAPITAL LETTER R WITH DOT ABOVE]\n\t\t\"1E5A\", // [LATIN CAPITAL LETTER R WITH DOT BELOW]\n\t\t\"1E5C\", // [LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON]\n\t\t\"1E5E\", // [LATIN CAPITAL LETTER R WITH LINE BELOW]\n\t\t\"24C7\", // [CIRCLED LATIN CAPITAL LETTER R]\n\t\t\"2C64\", // [LATIN CAPITAL LETTER R WITH TAIL]\n\t\t\"A75A\", // [LATIN CAPITAL LETTER R ROTUNDA]\n\t\t\"A782\", // [LATIN CAPITAL LETTER INSULAR R]\n\t\t\"FF32\": // [FULLWIDTH LATIN CAPITAL LETTER R]\n\t\tbuffer.WriteString(\"R\")\n\tcase \"155\", // [LATIN SMALL LETTER R WITH ACUTE]\n\t\t\"157\", // [LATIN SMALL LETTER R WITH CEDILLA]\n\t\t\"159\", // [LATIN SMALL LETTER R WITH CARON]\n\t\t\"211\", // [LATIN SMALL LETTER R WITH DOUBLE GRAVE]\n\t\t\"213\", // [LATIN SMALL LETTER R WITH INVERTED BREVE]\n\t\t\"24D\", // [LATIN SMALL LETTER R WITH STROKE]\n\t\t\"27C\", // [LATIN SMALL LETTER R WITH LONG LEG]\n\t\t\"27D\", // [LATIN SMALL LETTER R WITH TAIL]\n\t\t\"27E\", // [LATIN SMALL LETTER R WITH FISHHOOK]\n\t\t\"27F\", // [LATIN SMALL LETTER REVERSED R WITH FISHHOOK]\n\t\t\"1D63\", // [LATIN SUBSCRIPT SMALL LETTER R]\n\t\t\"1D72\", // [LATIN SMALL LETTER R WITH MIDDLE TILDE]\n\t\t\"1D73\", // [LATIN SMALL LETTER R WITH FISHHOOK AND MIDDLE TILDE]\n\t\t\"1D89\", // [LATIN SMALL LETTER R WITH PALATAL HOOK]\n\t\t\"1E59\", // [LATIN SMALL LETTER R WITH DOT ABOVE]\n\t\t\"1E5B\", // [LATIN SMALL LETTER R WITH DOT BELOW]\n\t\t\"1E5D\", // [LATIN SMALL LETTER R WITH DOT BELOW AND MACRON]\n\t\t\"1E5F\", // [LATIN SMALL LETTER R WITH LINE BELOW]\n\t\t\"24E1\", // [CIRCLED LATIN SMALL LETTER R]\n\t\t\"A75B\", // [LATIN SMALL LETTER R ROTUNDA]\n\t\t\"A783\", // [LATIN SMALL LETTER INSULAR R]\n\t\t\"FF52\": // [FULLWIDTH LATIN SMALL LETTER R]\n\t\tbuffer.WriteString(\"r\")\n\tcase \"24AD\": // [PARENTHESIZED LATIN SMALL LETTER R]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"r\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"15A\", // [LATIN CAPITAL LETTER S WITH ACUTE]\n\t\t\"15C\", // [LATIN CAPITAL LETTER S WITH CIRCUMFLEX]\n\t\t\"15E\", // [LATIN CAPITAL LETTER S WITH CEDILLA]\n\t\t\"160\", // [LATIN CAPITAL LETTER S WITH CARON]\n\t\t\"218\", // [LATIN CAPITAL LETTER S WITH COMMA BELOW]\n\t\t\"1E60\", // [LATIN CAPITAL LETTER S WITH DOT ABOVE]\n\t\t\"1E62\", // [LATIN CAPITAL LETTER S WITH DOT BELOW]\n\t\t\"1E64\", // [LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE]\n\t\t\"1E66\", // [LATIN CAPITAL LETTER S WITH CARON AND DOT ABOVE]\n\t\t\"1E68\", // [LATIN CAPITAL LETTER S WITH DOT BELOW AND DOT ABOVE]\n\t\t\"24C8\", // [CIRCLED LATIN CAPITAL LETTER S]\n\t\t\"A731\", // [LATIN LETTER SMALL CAPITAL S]\n\t\t\"A785\", // [LATIN SMALL LETTER INSULAR S]\n\t\t\"FF33\": // [FULLWIDTH LATIN CAPITAL LETTER S]\n\t\tbuffer.WriteString(\"S\")\n\tcase \"15B\", // [LATIN SMALL LETTER S WITH ACUTE]\n\t\t\"15D\", // [LATIN SMALL LETTER S WITH CIRCUMFLEX]\n\t\t\"15F\", // [LATIN SMALL LETTER S WITH CEDILLA]\n\t\t\"161\", // [LATIN SMALL LETTER S WITH CARON]\n\t\t\"17F\", // [LATIN SMALL LETTER LONG S]\n\t\t\"219\", // [LATIN SMALL LETTER S WITH COMMA BELOW]\n\t\t\"23F\", // [LATIN SMALL LETTER S WITH SWASH TAIL]\n\t\t\"282\", // [LATIN SMALL LETTER S WITH HOOK]\n\t\t\"1D74\", // [LATIN SMALL LETTER S WITH MIDDLE TILDE]\n\t\t\"1D8A\", // [LATIN SMALL LETTER S WITH PALATAL HOOK]\n\t\t\"1E61\", // [LATIN SMALL LETTER S WITH DOT ABOVE]\n\t\t\"1E63\", // [LATIN SMALL LETTER S WITH DOT BELOW]\n\t\t\"1E65\", // [LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE]\n\t\t\"1E67\", // [LATIN SMALL LETTER S WITH CARON AND DOT ABOVE]\n\t\t\"1E69\", // [LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE]\n\t\t\"1E9C\", // [LATIN SMALL LETTER LONG S WITH DIAGONAL STROKE]\n\t\t\"1E9D\", // [LATIN SMALL LETTER LONG S WITH HIGH STROKE]\n\t\t\"24E2\", // [CIRCLED LATIN SMALL LETTER S]\n\t\t\"A784\", // [LATIN CAPITAL LETTER INSULAR S]\n\t\t\"FF53\": // [FULLWIDTH LATIN SMALL LETTER S]\n\t\tbuffer.WriteString(\"s\")\n\tcase \"1E9E\": // [LATIN CAPITAL LETTER SHARP S]\n\t\tbuffer.WriteString(\"S\")\n\t\tbuffer.WriteString(\"S\")\n\tcase \"24AE\": // [PARENTHESIZED LATIN SMALL LETTER S]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"s\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"DF\": // [LATIN SMALL LETTER SHARP S]\n\t\tbuffer.WriteString(\"s\")\n\t\tbuffer.WriteString(\"s\")\n\tcase \"FB06\": // [LATIN SMALL LIGATURE ST]\n\t\tbuffer.WriteString(\"s\")\n\t\tbuffer.WriteString(\"t\")\n\tcase \"162\", // [LATIN CAPITAL LETTER T WITH CEDILLA]\n\t\t\"164\", // [LATIN CAPITAL LETTER T WITH CARON]\n\t\t\"166\", // [LATIN CAPITAL LETTER T WITH STROKE]\n\t\t\"1AC\", // [LATIN CAPITAL LETTER T WITH HOOK]\n\t\t\"1AE\", // [LATIN CAPITAL LETTER T WITH RETROFLEX HOOK]\n\t\t\"21A\", // [LATIN CAPITAL LETTER T WITH COMMA BELOW]\n\t\t\"23E\", // [LATIN CAPITAL LETTER T WITH DIAGONAL STROKE]\n\t\t\"1D1B\", // [LATIN LETTER SMALL CAPITAL T]\n\t\t\"1E6A\", // [LATIN CAPITAL LETTER T WITH DOT ABOVE]\n\t\t\"1E6C\", // [LATIN CAPITAL LETTER T WITH DOT BELOW]\n\t\t\"1E6E\", // [LATIN CAPITAL LETTER T WITH LINE BELOW]\n\t\t\"1E70\", // [LATIN CAPITAL LETTER T WITH CIRCUMFLEX BELOW]\n\t\t\"24C9\", // [CIRCLED LATIN CAPITAL LETTER T]\n\t\t\"A786\", // [LATIN CAPITAL LETTER INSULAR T]\n\t\t\"FF34\": // [FULLWIDTH LATIN CAPITAL LETTER T]\n\t\tbuffer.WriteString(\"T\")\n\tcase \"163\", // [LATIN SMALL LETTER T WITH CEDILLA]\n\t\t\"165\", // [LATIN SMALL LETTER T WITH CARON]\n\t\t\"167\", // [LATIN SMALL LETTER T WITH STROKE]\n\t\t\"1AB\", // [LATIN SMALL LETTER T WITH PALATAL HOOK]\n\t\t\"1AD\", // [LATIN SMALL LETTER T WITH HOOK]\n\t\t\"21B\", // [LATIN SMALL LETTER T WITH COMMA BELOW]\n\t\t\"236\", // [LATIN SMALL LETTER T WITH CURL]\n\t\t\"287\", // [LATIN SMALL LETTER TURNED T]\n\t\t\"288\", // [LATIN SMALL LETTER T WITH RETROFLEX HOOK]\n\t\t\"1D75\", // [LATIN SMALL LETTER T WITH MIDDLE TILDE]\n\t\t\"1E6B\", // [LATIN SMALL LETTER T WITH DOT ABOVE]\n\t\t\"1E6D\", // [LATIN SMALL LETTER T WITH DOT BELOW]\n\t\t\"1E6F\", // [LATIN SMALL LETTER T WITH LINE BELOW]\n\t\t\"1E71\", // [LATIN SMALL LETTER T WITH CIRCUMFLEX BELOW]\n\t\t\"1E97\", // [LATIN SMALL LETTER T WITH DIAERESIS]\n\t\t\"24E3\", // [CIRCLED LATIN SMALL LETTER T]\n\t\t\"2C66\", // [LATIN SMALL LETTER T WITH DIAGONAL STROKE]\n\t\t\"FF54\": // [FULLWIDTH LATIN SMALL LETTER T]\n\t\tbuffer.WriteString(\"t\")\n\tcase \"DE\", // [LATIN CAPITAL LETTER THORN]\n\t\t\"A766\": // [LATIN CAPITAL LETTER THORN WITH STROKE THROUGH DESCENDER]\n\t\tbuffer.WriteString(\"T\")\n\t\tbuffer.WriteString(\"H\")\n\tcase \"A728\": // [LATIN CAPITAL LETTER TZ]\n\t\tbuffer.WriteString(\"T\")\n\t\tbuffer.WriteString(\"Z\")\n\tcase \"24AF\": // [PARENTHESIZED LATIN SMALL LETTER T]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"t\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"2A8\": // [LATIN SMALL LETTER TC DIGRAPH WITH CURL]\n\t\tbuffer.WriteString(\"t\")\n\t\tbuffer.WriteString(\"c\")\n\tcase \"FE\", // [LATIN SMALL LETTER THORN]\n\t\t\"1D7A\", // [LATIN SMALL LETTER TH WITH STRIKETHROUGH]\n\t\t\"A767\": // [LATIN SMALL LETTER THORN WITH STROKE THROUGH DESCENDER]\n\t\tbuffer.WriteString(\"t\")\n\t\tbuffer.WriteString(\"h\")\n\tcase \"2A6\": // [LATIN SMALL LETTER TS DIGRAPH]\n\t\tbuffer.WriteString(\"t\")\n\t\tbuffer.WriteString(\"s\")\n\tcase \"A729\": // [LATIN SMALL LETTER TZ]\n\t\tbuffer.WriteString(\"t\")\n\t\tbuffer.WriteString(\"z\")\n\tcase \"D9\", // [LATIN CAPITAL LETTER U WITH GRAVE]\n\t\t\"DA\", // [LATIN CAPITAL LETTER U WITH ACUTE]\n\t\t\"DB\", // [LATIN CAPITAL LETTER U WITH CIRCUMFLEX]\n\t\t\"DC\", // [LATIN CAPITAL LETTER U WITH DIAERESIS]\n\t\t\"168\", // [LATIN CAPITAL LETTER U WITH TILDE]\n\t\t\"16A\", // [LATIN CAPITAL LETTER U WITH MACRON]\n\t\t\"16C\", // [LATIN CAPITAL LETTER U WITH BREVE]\n\t\t\"16E\", // [LATIN CAPITAL LETTER U WITH RING ABOVE]\n\t\t\"170\", // [LATIN CAPITAL LETTER U WITH DOUBLE ACUTE]\n\t\t\"172\", // [LATIN CAPITAL LETTER U WITH OGONEK]\n\t\t\"1AF\", // [LATIN CAPITAL LETTER U WITH HORN]\n\t\t\"1D3\", // [LATIN CAPITAL LETTER U WITH CARON]\n\t\t\"1D5\", // [LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON]\n\t\t\"1D7\", // [LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE]\n\t\t\"1D9\", // [LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON]\n\t\t\"1DB\", // [LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE]\n\t\t\"214\", // [LATIN CAPITAL LETTER U WITH DOUBLE GRAVE]\n\t\t\"216\", // [LATIN CAPITAL LETTER U WITH INVERTED BREVE]\n\t\t\"244\", // [LATIN CAPITAL LETTER U BAR]\n\t\t\"1D1C\", // [LATIN LETTER SMALL CAPITAL U]\n\t\t\"1D7E\", // [LATIN SMALL CAPITAL LETTER U WITH STROKE]\n\t\t\"1E72\", // [LATIN CAPITAL LETTER U WITH DIAERESIS BELOW]\n\t\t\"1E74\", // [LATIN CAPITAL LETTER U WITH TILDE BELOW]\n\t\t\"1E76\", // [LATIN CAPITAL LETTER U WITH CIRCUMFLEX BELOW]\n\t\t\"1E78\", // [LATIN CAPITAL LETTER U WITH TILDE AND ACUTE]\n\t\t\"1E7A\", // [LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS]\n\t\t\"1EE4\", // [LATIN CAPITAL LETTER U WITH DOT BELOW]\n\t\t\"1EE6\", // [LATIN CAPITAL LETTER U WITH HOOK ABOVE]\n\t\t\"1EE8\", // [LATIN CAPITAL LETTER U WITH HORN AND ACUTE]\n\t\t\"1EEA\", // [LATIN CAPITAL LETTER U WITH HORN AND GRAVE]\n\t\t\"1EEC\", // [LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE]\n\t\t\"1EEE\", // [LATIN CAPITAL LETTER U WITH HORN AND TILDE]\n\t\t\"1EF0\", // [LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW]\n\t\t\"24CA\", // [CIRCLED LATIN CAPITAL LETTER U]\n\t\t\"FF35\": // [FULLWIDTH LATIN CAPITAL LETTER U]\n\t\tbuffer.WriteString(\"U\")\n\tcase \"F9\", // [LATIN SMALL LETTER U WITH GRAVE]\n\t\t\"FA\", // [LATIN SMALL LETTER U WITH ACUTE]\n\t\t\"FB\", // [LATIN SMALL LETTER U WITH CIRCUMFLEX]\n\t\t\"FC\", // [LATIN SMALL LETTER U WITH DIAERESIS]\n\t\t\"169\", // [LATIN SMALL LETTER U WITH TILDE]\n\t\t\"16B\", // [LATIN SMALL LETTER U WITH MACRON]\n\t\t\"16D\", // [LATIN SMALL LETTER U WITH BREVE]\n\t\t\"16F\", // [LATIN SMALL LETTER U WITH RING ABOVE]\n\t\t\"171\", // [LATIN SMALL LETTER U WITH DOUBLE ACUTE]\n\t\t\"173\", // [LATIN SMALL LETTER U WITH OGONEK]\n\t\t\"1B0\", // [LATIN SMALL LETTER U WITH HORN]\n\t\t\"1D4\", // [LATIN SMALL LETTER U WITH CARON]\n\t\t\"1D6\", // [LATIN SMALL LETTER U WITH DIAERESIS AND MACRON]\n\t\t\"1D8\", // [LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE]\n\t\t\"1DA\", // [LATIN SMALL LETTER U WITH DIAERESIS AND CARON]\n\t\t\"1DC\", // [LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE]\n\t\t\"215\", // [LATIN SMALL LETTER U WITH DOUBLE GRAVE]\n\t\t\"217\", // [LATIN SMALL LETTER U WITH INVERTED BREVE]\n\t\t\"289\", // [LATIN SMALL LETTER U BAR]\n\t\t\"1D64\", // [LATIN SUBSCRIPT SMALL LETTER U]\n\t\t\"1D99\", // [LATIN SMALL LETTER U WITH RETROFLEX HOOK]\n\t\t\"1E73\", // [LATIN SMALL LETTER U WITH DIAERESIS BELOW]\n\t\t\"1E75\", // [LATIN SMALL LETTER U WITH TILDE BELOW]\n\t\t\"1E77\", // [LATIN SMALL LETTER U WITH CIRCUMFLEX BELOW]\n\t\t\"1E79\", // [LATIN SMALL LETTER U WITH TILDE AND ACUTE]\n\t\t\"1E7B\", // [LATIN SMALL LETTER U WITH MACRON AND DIAERESIS]\n\t\t\"1EE5\", // [LATIN SMALL LETTER U WITH DOT BELOW]\n\t\t\"1EE7\", // [LATIN SMALL LETTER U WITH HOOK ABOVE]\n\t\t\"1EE9\", // [LATIN SMALL LETTER U WITH HORN AND ACUTE]\n\t\t\"1EEB\", // [LATIN SMALL LETTER U WITH HORN AND GRAVE]\n\t\t\"1EED\", // [LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE]\n\t\t\"1EEF\", // [LATIN SMALL LETTER U WITH HORN AND TILDE]\n\t\t\"1EF1\", // [LATIN SMALL LETTER U WITH HORN AND DOT BELOW]\n\t\t\"24E4\", // [CIRCLED LATIN SMALL LETTER U]\n\t\t\"FF55\": // [FULLWIDTH LATIN SMALL LETTER U]\n\t\tbuffer.WriteString(\"u\")\n\tcase \"24B0\": // [PARENTHESIZED LATIN SMALL LETTER U]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"u\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"1D6B\": // [LATIN SMALL LETTER UE]\n\t\tbuffer.WriteString(\"u\")\n\t\tbuffer.WriteString(\"e\")\n\tcase \"1B2\", // [LATIN CAPITAL LETTER V WITH HOOK]\n\t\t\"245\", // [LATIN CAPITAL LETTER TURNED V]\n\t\t\"1D20\", // [LATIN LETTER SMALL CAPITAL V]\n\t\t\"1E7C\", // [LATIN CAPITAL LETTER V WITH TILDE]\n\t\t\"1E7E\", // [LATIN CAPITAL LETTER V WITH DOT BELOW]\n\t\t\"1EFC\", // [LATIN CAPITAL LETTER MIDDLE-WELSH V]\n\t\t\"24CB\", // [CIRCLED LATIN CAPITAL LETTER V]\n\t\t\"A75E\", // [LATIN CAPITAL LETTER V WITH DIAGONAL STROKE]\n\t\t\"A768\", // [LATIN CAPITAL LETTER VEND]\n\t\t\"FF36\": // [FULLWIDTH LATIN CAPITAL LETTER V]\n\t\tbuffer.WriteString(\"V\")\n\tcase \"28B\", // [LATIN SMALL LETTER V WITH HOOK]\n\t\t\"28C\", // [LATIN SMALL LETTER TURNED V]\n\t\t\"1D65\", // [LATIN SUBSCRIPT SMALL LETTER V]\n\t\t\"1D8C\", // [LATIN SMALL LETTER V WITH PALATAL HOOK]\n\t\t\"1E7D\", // [LATIN SMALL LETTER V WITH TILDE]\n\t\t\"1E7F\", // [LATIN SMALL LETTER V WITH DOT BELOW]\n\t\t\"24E5\", // [CIRCLED LATIN SMALL LETTER V]\n\t\t\"2C71\", // [LATIN SMALL LETTER V WITH RIGHT HOOK]\n\t\t\"2C74\", // [LATIN SMALL LETTER V WITH CURL]\n\t\t\"A75F\", // [LATIN SMALL LETTER V WITH DIAGONAL STROKE]\n\t\t\"FF56\": // [FULLWIDTH LATIN SMALL LETTER V]\n\t\tbuffer.WriteString(\"v\")\n\tcase \"A760\": // [LATIN CAPITAL LETTER VY]\n\t\tbuffer.WriteString(\"V\")\n\t\tbuffer.WriteString(\"Y\")\n\tcase \"24B1\": // [PARENTHESIZED LATIN SMALL LETTER V]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"v\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"A761\": // [LATIN SMALL LETTER VY]\n\t\tbuffer.WriteString(\"v\")\n\t\tbuffer.WriteString(\"y\")\n\tcase \"174\", // [LATIN CAPITAL LETTER W WITH CIRCUMFLEX]\n\t\t\"1F7\", // [LATIN CAPITAL LETTER WYNN]\n\t\t\"1D21\", // [LATIN LETTER SMALL CAPITAL W]\n\t\t\"1E80\", // [LATIN CAPITAL LETTER W WITH GRAVE]\n\t\t\"1E82\", // [LATIN CAPITAL LETTER W WITH ACUTE]\n\t\t\"1E84\", // [LATIN CAPITAL LETTER W WITH DIAERESIS]\n\t\t\"1E86\", // [LATIN CAPITAL LETTER W WITH DOT ABOVE]\n\t\t\"1E88\", // [LATIN CAPITAL LETTER W WITH DOT BELOW]\n\t\t\"24CC\", // [CIRCLED LATIN CAPITAL LETTER W]\n\t\t\"2C72\", // [LATIN CAPITAL LETTER W WITH HOOK]\n\t\t\"FF37\": // [FULLWIDTH LATIN CAPITAL LETTER W]\n\t\tbuffer.WriteString(\"W\")\n\tcase \"175\", // [LATIN SMALL LETTER W WITH CIRCUMFLEX]\n\t\t\"1BF\", // [LATIN LETTER WYNN]\n\t\t\"28D\", // [LATIN SMALL LETTER TURNED W]\n\t\t\"1E81\", // [LATIN SMALL LETTER W WITH GRAVE]\n\t\t\"1E83\", // [LATIN SMALL LETTER W WITH ACUTE]\n\t\t\"1E85\", // [LATIN SMALL LETTER W WITH DIAERESIS]\n\t\t\"1E87\", // [LATIN SMALL LETTER W WITH DOT ABOVE]\n\t\t\"1E89\", // [LATIN SMALL LETTER W WITH DOT BELOW]\n\t\t\"1E98\", // [LATIN SMALL LETTER W WITH RING ABOVE]\n\t\t\"24E6\", // [CIRCLED LATIN SMALL LETTER W]\n\t\t\"2C73\", // [LATIN SMALL LETTER W WITH HOOK]\n\t\t\"FF57\": // [FULLWIDTH LATIN SMALL LETTER W]\n\t\tbuffer.WriteString(\"w\")\n\tcase \"24B2\": // [PARENTHESIZED LATIN SMALL LETTER W]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"w\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"1E8A\", // [LATIN CAPITAL LETTER X WITH DOT ABOVE]\n\t\t\"1E8C\", // [LATIN CAPITAL LETTER X WITH DIAERESIS]\n\t\t\"24CD\", // [CIRCLED LATIN CAPITAL LETTER X]\n\t\t\"FF38\": // [FULLWIDTH LATIN CAPITAL LETTER X]\n\t\tbuffer.WriteString(\"X\")\n\tcase \"1D8D\", // [LATIN SMALL LETTER X WITH PALATAL HOOK]\n\t\t\"1E8B\", // [LATIN SMALL LETTER X WITH DOT ABOVE]\n\t\t\"1E8D\", // [LATIN SMALL LETTER X WITH DIAERESIS]\n\t\t\"2093\", // [LATIN SUBSCRIPT SMALL LETTER X]\n\t\t\"24E7\", // [CIRCLED LATIN SMALL LETTER X]\n\t\t\"FF58\": // [FULLWIDTH LATIN SMALL LETTER X]\n\t\tbuffer.WriteString(\"x\")\n\tcase \"24B3\": // [PARENTHESIZED LATIN SMALL LETTER X]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"x\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"DD\", // [LATIN CAPITAL LETTER Y WITH ACUTE]\n\t\t\"176\", // [LATIN CAPITAL LETTER Y WITH CIRCUMFLEX]\n\t\t\"178\", // [LATIN CAPITAL LETTER Y WITH DIAERESIS]\n\t\t\"1B3\", // [LATIN CAPITAL LETTER Y WITH HOOK]\n\t\t\"232\", // [LATIN CAPITAL LETTER Y WITH MACRON]\n\t\t\"24E\", // [LATIN CAPITAL LETTER Y WITH STROKE]\n\t\t\"28F\", // [LATIN LETTER SMALL CAPITAL Y]\n\t\t\"1E8E\", // [LATIN CAPITAL LETTER Y WITH DOT ABOVE]\n\t\t\"1EF2\", // [LATIN CAPITAL LETTER Y WITH GRAVE]\n\t\t\"1EF4\", // [LATIN CAPITAL LETTER Y WITH DOT BELOW]\n\t\t\"1EF6\", // [LATIN CAPITAL LETTER Y WITH HOOK ABOVE]\n\t\t\"1EF8\", // [LATIN CAPITAL LETTER Y WITH TILDE]\n\t\t\"1EFE\", // [LATIN CAPITAL LETTER Y WITH LOOP]\n\t\t\"24CE\", // [CIRCLED LATIN CAPITAL LETTER Y]\n\t\t\"FF39\": // [FULLWIDTH LATIN CAPITAL LETTER Y]\n\t\tbuffer.WriteString(\"Y\")\n\tcase \"FD\", // [LATIN SMALL LETTER Y WITH ACUTE]\n\t\t\"FF\", // [LATIN SMALL LETTER Y WITH DIAERESIS]\n\t\t\"177\", // [LATIN SMALL LETTER Y WITH CIRCUMFLEX]\n\t\t\"1B4\", // [LATIN SMALL LETTER Y WITH HOOK]\n\t\t\"233\", // [LATIN SMALL LETTER Y WITH MACRON]\n\t\t\"24F\", // [LATIN SMALL LETTER Y WITH STROKE]\n\t\t\"28E\", // [LATIN SMALL LETTER TURNED Y]\n\t\t\"1E8F\", // [LATIN SMALL LETTER Y WITH DOT ABOVE]\n\t\t\"1E99\", // [LATIN SMALL LETTER Y WITH RING ABOVE]\n\t\t\"1EF3\", // [LATIN SMALL LETTER Y WITH GRAVE]\n\t\t\"1EF5\", // [LATIN SMALL LETTER Y WITH DOT BELOW]\n\t\t\"1EF7\", // [LATIN SMALL LETTER Y WITH HOOK ABOVE]\n\t\t\"1EF9\", // [LATIN SMALL LETTER Y WITH TILDE]\n\t\t\"1EFF\", // [LATIN SMALL LETTER Y WITH LOOP]\n\t\t\"24E8\", // [CIRCLED LATIN SMALL LETTER Y]\n\t\t\"FF59\": // [FULLWIDTH LATIN SMALL LETTER Y]\n\t\tbuffer.WriteString(\"y\")\n\tcase \"24B4\": // [PARENTHESIZED LATIN SMALL LETTER Y]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"y\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"179\", // [LATIN CAPITAL LETTER Z WITH ACUTE]\n\t\t\"17B\", // [LATIN CAPITAL LETTER Z WITH DOT ABOVE]\n\t\t\"17D\", // [LATIN CAPITAL LETTER Z WITH CARON]\n\t\t\"1B5\", // [LATIN CAPITAL LETTER Z WITH STROKE]\n\t\t\"21C\", // [LATIN CAPITAL LETTER YOGH]\n\t\t\"224\", // [LATIN CAPITAL LETTER Z WITH HOOK]\n\t\t\"1D22\", // [LATIN LETTER SMALL CAPITAL Z]\n\t\t\"1E90\", // [LATIN CAPITAL LETTER Z WITH CIRCUMFLEX]\n\t\t\"1E92\", // [LATIN CAPITAL LETTER Z WITH DOT BELOW]\n\t\t\"1E94\", // [LATIN CAPITAL LETTER Z WITH LINE BELOW]\n\t\t\"24CF\", // [CIRCLED LATIN CAPITAL LETTER Z]\n\t\t\"2C6B\", // [LATIN CAPITAL LETTER Z WITH DESCENDER]\n\t\t\"A762\", // [LATIN CAPITAL LETTER VISIGOTHIC Z]\n\t\t\"FF3A\": // [FULLWIDTH LATIN CAPITAL LETTER Z]\n\t\tbuffer.WriteString(\"Z\")\n\tcase \"17A\", // [LATIN SMALL LETTER Z WITH ACUTE]\n\t\t\"17C\", // [LATIN SMALL LETTER Z WITH DOT ABOVE]\n\t\t\"17E\", // [LATIN SMALL LETTER Z WITH CARON]\n\t\t\"1B6\", // [LATIN SMALL LETTER Z WITH STROKE]\n\t\t\"21D\", // [LATIN SMALL LETTER YOGH]\n\t\t\"225\", // [LATIN SMALL LETTER Z WITH HOOK]\n\t\t\"240\", // [LATIN SMALL LETTER Z WITH SWASH TAIL]\n\t\t\"290\", // [LATIN SMALL LETTER Z WITH RETROFLEX HOOK]\n\t\t\"291\", // [LATIN SMALL LETTER Z WITH CURL]\n\t\t\"1D76\", // [LATIN SMALL LETTER Z WITH MIDDLE TILDE]\n\t\t\"1D8E\", // [LATIN SMALL LETTER Z WITH PALATAL HOOK]\n\t\t\"1E91\", // [LATIN SMALL LETTER Z WITH CIRCUMFLEX]\n\t\t\"1E93\", // [LATIN SMALL LETTER Z WITH DOT BELOW]\n\t\t\"1E95\", // [LATIN SMALL LETTER Z WITH LINE BELOW]\n\t\t\"24E9\", // [CIRCLED LATIN SMALL LETTER Z]\n\t\t\"2C6C\", // [LATIN SMALL LETTER Z WITH DESCENDER]\n\t\t\"A763\", // [LATIN SMALL LETTER VISIGOTHIC Z]\n\t\t\"FF5A\": // [FULLWIDTH LATIN SMALL LETTER Z]\n\t\tbuffer.WriteString(\"z\")\n\tcase \"24B5\": // [PARENTHESIZED LATIN SMALL LETTER Z]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"z\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"2070\", // [SUPERSCRIPT ZERO]\n\t\t\"2080\", // [SUBSCRIPT ZERO]\n\t\t\"24EA\", // [CIRCLED DIGIT ZERO]\n\t\t\"24FF\", // [NEGATIVE CIRCLED DIGIT ZERO]\n\t\t\"FF10\": // [FULLWIDTH DIGIT ZERO]\n\t\tbuffer.WriteString(\"0\")\n\tcase \"B9\", // [SUPERSCRIPT ONE]\n\t\t\"2081\", // [SUBSCRIPT ONE]\n\t\t\"2460\", // [CIRCLED DIGIT ONE]\n\t\t\"24F5\", // [DOUBLE CIRCLED DIGIT ONE]\n\t\t\"2776\", // [DINGBAT NEGATIVE CIRCLED DIGIT ONE]\n\t\t\"2780\", // [DINGBAT CIRCLED SANS-SERIF DIGIT ONE]\n\t\t\"278A\", // [DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT ONE]\n\t\t\"FF11\": // [FULLWIDTH DIGIT ONE]\n\t\tbuffer.WriteString(\"1\")\n\tcase \"2488\": // [DIGIT ONE FULL STOP]\n\t\tbuffer.WriteString(\"1\")\n\t\tbuffer.WriteString(\".\")\n\tcase \"2474\": // [PARENTHESIZED DIGIT ONE]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"1\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"B2\", // [SUPERSCRIPT TWO]\n\t\t\"2082\", // [SUBSCRIPT TWO]\n\t\t\"2461\", // [CIRCLED DIGIT TWO]\n\t\t\"24F6\", // [DOUBLE CIRCLED DIGIT TWO]\n\t\t\"2777\", // [DINGBAT NEGATIVE CIRCLED DIGIT TWO]\n\t\t\"2781\", // [DINGBAT CIRCLED SANS-SERIF DIGIT TWO]\n\t\t\"278B\", // [DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT TWO]\n\t\t\"FF12\": // [FULLWIDTH DIGIT TWO]\n\t\tbuffer.WriteString(\"2\")\n\tcase \"2489\": // [DIGIT TWO FULL STOP]\n\t\tbuffer.WriteString(\"2\")\n\t\tbuffer.WriteString(\".\")\n\tcase \"2475\": // [PARENTHESIZED DIGIT TWO]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"2\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"B3\", // [SUPERSCRIPT THREE]\n\t\t\"2083\", // [SUBSCRIPT THREE]\n\t\t\"2462\", // [CIRCLED DIGIT THREE]\n\t\t\"24F7\", // [DOUBLE CIRCLED DIGIT THREE]\n\t\t\"2778\", // [DINGBAT NEGATIVE CIRCLED DIGIT THREE]\n\t\t\"2782\", // [DINGBAT CIRCLED SANS-SERIF DIGIT THREE]\n\t\t\"278C\", // [DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT THREE]\n\t\t\"FF13\": // [FULLWIDTH DIGIT THREE]\n\t\tbuffer.WriteString(\"3\")\n\tcase \"248A\": // [DIGIT THREE FULL STOP]\n\t\tbuffer.WriteString(\"3\")\n\t\tbuffer.WriteString(\".\")\n\tcase \"2476\": // [PARENTHESIZED DIGIT THREE]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"3\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"2074\", // [SUPERSCRIPT FOUR]\n\t\t\"2084\", // [SUBSCRIPT FOUR]\n\t\t\"2463\", // [CIRCLED DIGIT FOUR]\n\t\t\"24F8\", // [DOUBLE CIRCLED DIGIT FOUR]\n\t\t\"2779\", // [DINGBAT NEGATIVE CIRCLED DIGIT FOUR]\n\t\t\"2783\", // [DINGBAT CIRCLED SANS-SERIF DIGIT FOUR]\n\t\t\"278D\", // [DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT FOUR]\n\t\t\"FF14\": // [FULLWIDTH DIGIT FOUR]\n\t\tbuffer.WriteString(\"4\")\n\tcase \"248B\": // [DIGIT FOUR FULL STOP]\n\t\tbuffer.WriteString(\"4\")\n\t\tbuffer.WriteString(\".\")\n\tcase \"2477\": // [PARENTHESIZED DIGIT FOUR]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"4\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"2075\", // [SUPERSCRIPT FIVE]\n\t\t\"2085\", // [SUBSCRIPT FIVE]\n\t\t\"2464\", // [CIRCLED DIGIT FIVE]\n\t\t\"24F9\", // [DOUBLE CIRCLED DIGIT FIVE]\n\t\t\"277A\", // [DINGBAT NEGATIVE CIRCLED DIGIT FIVE]\n\t\t\"2784\", // [DINGBAT CIRCLED SANS-SERIF DIGIT FIVE]\n\t\t\"278E\", // [DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT FIVE]\n\t\t\"FF15\": // [FULLWIDTH DIGIT FIVE]\n\t\tbuffer.WriteString(\"5\")\n\tcase \"248C\": // [DIGIT FIVE FULL STOP]\n\t\tbuffer.WriteString(\"5\")\n\t\tbuffer.WriteString(\".\")\n\tcase \"2478\": // [PARENTHESIZED DIGIT FIVE]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"5\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"2076\", // [SUPERSCRIPT SIX]\n\t\t\"2086\", // [SUBSCRIPT SIX]\n\t\t\"2465\", // [CIRCLED DIGIT SIX]\n\t\t\"24FA\", // [DOUBLE CIRCLED DIGIT SIX]\n\t\t\"277B\", // [DINGBAT NEGATIVE CIRCLED DIGIT SIX]\n\t\t\"2785\", // [DINGBAT CIRCLED SANS-SERIF DIGIT SIX]\n\t\t\"278F\", // [DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT SIX]\n\t\t\"FF16\": // [FULLWIDTH DIGIT SIX]\n\t\tbuffer.WriteString(\"6\")\n\tcase \"248D\": // [DIGIT SIX FULL STOP]\n\t\tbuffer.WriteString(\"6\")\n\t\tbuffer.WriteString(\".\")\n\tcase \"2479\": // [PARENTHESIZED DIGIT SIX]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"6\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"2077\", // [SUPERSCRIPT SEVEN]\n\t\t\"2087\", // [SUBSCRIPT SEVEN]\n\t\t\"2466\", // [CIRCLED DIGIT SEVEN]\n\t\t\"24FB\", // [DOUBLE CIRCLED DIGIT SEVEN]\n\t\t\"277C\", // [DINGBAT NEGATIVE CIRCLED DIGIT SEVEN]\n\t\t\"2786\", // [DINGBAT CIRCLED SANS-SERIF DIGIT SEVEN]\n\t\t\"2790\", // [DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT SEVEN]\n\t\t\"FF17\": // [FULLWIDTH DIGIT SEVEN]\n\t\tbuffer.WriteString(\"7\")\n\tcase \"248E\": // [DIGIT SEVEN FULL STOP]\n\t\tbuffer.WriteString(\"7\")\n\t\tbuffer.WriteString(\".\")\n\tcase \"247A\": // [PARENTHESIZED DIGIT SEVEN]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"7\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"2078\", // [SUPERSCRIPT EIGHT]\n\t\t\"2088\", // [SUBSCRIPT EIGHT]\n\t\t\"2467\", // [CIRCLED DIGIT EIGHT]\n\t\t\"24FC\", // [DOUBLE CIRCLED DIGIT EIGHT]\n\t\t\"277D\", // [DINGBAT NEGATIVE CIRCLED DIGIT EIGHT]\n\t\t\"2787\", // [DINGBAT CIRCLED SANS-SERIF DIGIT EIGHT]\n\t\t\"2791\", // [DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT EIGHT]\n\t\t\"FF18\": // [FULLWIDTH DIGIT EIGHT]\n\t\tbuffer.WriteString(\"8\")\n\tcase \"248F\": // [DIGIT EIGHT FULL STOP]\n\t\tbuffer.WriteString(\"8\")\n\t\tbuffer.WriteString(\".\")\n\tcase \"247B\": // [PARENTHESIZED DIGIT EIGHT]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"8\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"2079\", // [SUPERSCRIPT NINE]\n\t\t\"2089\", // [SUBSCRIPT NINE]\n\t\t\"2468\", // [CIRCLED DIGIT NINE]\n\t\t\"24FD\", // [DOUBLE CIRCLED DIGIT NINE]\n\t\t\"277E\", // [DINGBAT NEGATIVE CIRCLED DIGIT NINE]\n\t\t\"2788\", // [DINGBAT CIRCLED SANS-SERIF DIGIT NINE]\n\t\t\"2792\", // [DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT NINE]\n\t\t\"FF19\": // [FULLWIDTH DIGIT NINE]\n\t\tbuffer.WriteString(\"9\")\n\tcase \"2490\": // [DIGIT NINE FULL STOP]\n\t\tbuffer.WriteString(\"9\")\n\t\tbuffer.WriteString(\".\")\n\tcase \"247C\": // [PARENTHESIZED DIGIT NINE]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"9\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"2469\", // [CIRCLED NUMBER TEN]\n\t\t\"24FE\", // [DOUBLE CIRCLED NUMBER TEN]\n\t\t\"277F\", // [DINGBAT NEGATIVE CIRCLED NUMBER TEN]\n\t\t\"2789\", // [DINGBAT CIRCLED SANS-SERIF NUMBER TEN]\n\t\t\"2793\": // [DINGBAT NEGATIVE CIRCLED SANS-SERIF NUMBER TEN]\n\t\tbuffer.WriteString(\"1\")\n\t\tbuffer.WriteString(\"0\")\n\tcase \"2491\": // [NUMBER TEN FULL STOP]\n\t\tbuffer.WriteString(\"1\")\n\t\tbuffer.WriteString(\"0\")\n\t\tbuffer.WriteString(\".\")\n\tcase \"247D\": // [PARENTHESIZED NUMBER TEN]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"1\")\n\t\tbuffer.WriteString(\"0\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"246A\", // [CIRCLED NUMBER ELEVEN]\n\t\t\"24EB\": // [NEGATIVE CIRCLED NUMBER ELEVEN]\n\t\tbuffer.WriteString(\"1\")\n\t\tbuffer.WriteString(\"1\")\n\tcase \"2492\": // [NUMBER ELEVEN FULL STOP]\n\t\tbuffer.WriteString(\"1\")\n\t\tbuffer.WriteString(\"1\")\n\t\tbuffer.WriteString(\".\")\n\tcase \"247E\": // [PARENTHESIZED NUMBER ELEVEN]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"1\")\n\t\tbuffer.WriteString(\"1\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"246B\", // [CIRCLED NUMBER TWELVE]\n\t\t\"24EC\": // [NEGATIVE CIRCLED NUMBER TWELVE]\n\t\tbuffer.WriteString(\"1\")\n\t\tbuffer.WriteString(\"2\")\n\tcase \"2493\": // [NUMBER TWELVE FULL STOP]\n\t\tbuffer.WriteString(\"1\")\n\t\tbuffer.WriteString(\"2\")\n\t\tbuffer.WriteString(\".\")\n\tcase \"247F\": // [PARENTHESIZED NUMBER TWELVE]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"1\")\n\t\tbuffer.WriteString(\"2\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"246C\", // [CIRCLED NUMBER THIRTEEN]\n\t\t\"24ED\": // [NEGATIVE CIRCLED NUMBER THIRTEEN]\n\t\tbuffer.WriteString(\"1\")\n\t\tbuffer.WriteString(\"3\")\n\tcase \"2494\": // [NUMBER THIRTEEN FULL STOP]\n\t\tbuffer.WriteString(\"1\")\n\t\tbuffer.WriteString(\"3\")\n\t\tbuffer.WriteString(\".\")\n\tcase \"2480\": // [PARENTHESIZED NUMBER THIRTEEN]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"1\")\n\t\tbuffer.WriteString(\"3\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"246D\", // [CIRCLED NUMBER FOURTEEN]\n\t\t\"24EE\": // [NEGATIVE CIRCLED NUMBER FOURTEEN]\n\t\tbuffer.WriteString(\"1\")\n\t\tbuffer.WriteString(\"4\")\n\tcase \"2495\": // [NUMBER FOURTEEN FULL STOP]\n\t\tbuffer.WriteString(\"1\")\n\t\tbuffer.WriteString(\"4\")\n\t\tbuffer.WriteString(\".\")\n\tcase \"2481\": // [PARENTHESIZED NUMBER FOURTEEN]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"1\")\n\t\tbuffer.WriteString(\"4\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"246E\", // [CIRCLED NUMBER FIFTEEN]\n\t\t\"24EF\": // [NEGATIVE CIRCLED NUMBER FIFTEEN]\n\t\tbuffer.WriteString(\"1\")\n\t\tbuffer.WriteString(\"5\")\n\tcase \"2496\": // [NUMBER FIFTEEN FULL STOP]\n\t\tbuffer.WriteString(\"1\")\n\t\tbuffer.WriteString(\"5\")\n\t\tbuffer.WriteString(\".\")\n\tcase \"2482\": // [PARENTHESIZED NUMBER FIFTEEN]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"1\")\n\t\tbuffer.WriteString(\"5\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"246F\", // [CIRCLED NUMBER SIXTEEN]\n\t\t\"24F0\": // [NEGATIVE CIRCLED NUMBER SIXTEEN]\n\t\tbuffer.WriteString(\"1\")\n\t\tbuffer.WriteString(\"6\")\n\tcase \"2497\": // [NUMBER SIXTEEN FULL STOP]\n\t\tbuffer.WriteString(\"1\")\n\t\tbuffer.WriteString(\"6\")\n\t\tbuffer.WriteString(\".\")\n\tcase \"2483\": // [PARENTHESIZED NUMBER SIXTEEN]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"1\")\n\t\tbuffer.WriteString(\"6\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"2470\", // [CIRCLED NUMBER SEVENTEEN]\n\t\t\"24F1\": // [NEGATIVE CIRCLED NUMBER SEVENTEEN]\n\t\tbuffer.WriteString(\"1\")\n\t\tbuffer.WriteString(\"7\")\n\tcase \"2498\": // [NUMBER SEVENTEEN FULL STOP]\n\t\tbuffer.WriteString(\"1\")\n\t\tbuffer.WriteString(\"7\")\n\t\tbuffer.WriteString(\".\")\n\tcase \"2484\": // [PARENTHESIZED NUMBER SEVENTEEN]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"1\")\n\t\tbuffer.WriteString(\"7\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"2471\", // [CIRCLED NUMBER EIGHTEEN]\n\t\t\"24F2\": // [NEGATIVE CIRCLED NUMBER EIGHTEEN]\n\t\tbuffer.WriteString(\"1\")\n\t\tbuffer.WriteString(\"8\")\n\tcase \"2499\": // [NUMBER EIGHTEEN FULL STOP]\n\t\tbuffer.WriteString(\"1\")\n\t\tbuffer.WriteString(\"8\")\n\t\tbuffer.WriteString(\".\")\n\tcase \"2485\": // [PARENTHESIZED NUMBER EIGHTEEN]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"1\")\n\t\tbuffer.WriteString(\"8\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"2472\", // [CIRCLED NUMBER NINETEEN]\n\t\t\"24F3\": // [NEGATIVE CIRCLED NUMBER NINETEEN]\n\t\tbuffer.WriteString(\"1\")\n\t\tbuffer.WriteString(\"9\")\n\tcase \"249A\": // [NUMBER NINETEEN FULL STOP]\n\t\tbuffer.WriteString(\"1\")\n\t\tbuffer.WriteString(\"9\")\n\t\tbuffer.WriteString(\".\")\n\tcase \"2486\": // [PARENTHESIZED NUMBER NINETEEN]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"1\")\n\t\tbuffer.WriteString(\"9\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"2473\", // [CIRCLED NUMBER TWENTY]\n\t\t\"24F4\": // [NEGATIVE CIRCLED NUMBER TWENTY]\n\t\tbuffer.WriteString(\"2\")\n\t\tbuffer.WriteString(\"0\")\n\tcase \"249B\": // [NUMBER TWENTY FULL STOP]\n\t\tbuffer.WriteString(\"2\")\n\t\tbuffer.WriteString(\"0\")\n\t\tbuffer.WriteString(\".\")\n\tcase \"2487\": // [PARENTHESIZED NUMBER TWENTY]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"2\")\n\t\tbuffer.WriteString(\"0\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"AB\", // [LEFT-POINTING DOUBLE ANGLE QUOTATION MARK]\n\t\t\"BB\", // [RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK]\n\t\t\"201C\", // [LEFT DOUBLE QUOTATION MARK]\n\t\t\"201D\", // [RIGHT DOUBLE QUOTATION MARK]\n\t\t\"201E\", // [DOUBLE LOW-9 QUOTATION MARK]\n\t\t\"2033\", // [DOUBLE PRIME]\n\t\t\"2036\", // [REVERSED DOUBLE PRIME]\n\t\t\"275D\", // [HEAVY DOUBLE TURNED COMMA QUOTATION MARK ORNAMENT]\n\t\t\"275E\", // [HEAVY DOUBLE COMMA QUOTATION MARK ORNAMENT]\n\t\t\"276E\", // [HEAVY LEFT-POINTING ANGLE QUOTATION MARK ORNAMENT]\n\t\t\"276F\", // [HEAVY RIGHT-POINTING ANGLE QUOTATION MARK ORNAMENT]\n\t\t\"FF02\": // [FULLWIDTH QUOTATION MARK]\n\t\tbuffer.WriteString(\"\\\"\")\n\tcase \"2018\", // [LEFT SINGLE QUOTATION MARK]\n\t\t\"2019\", // [RIGHT SINGLE QUOTATION MARK]\n\t\t\"201A\", // [SINGLE LOW-9 QUOTATION MARK]\n\t\t\"201B\", // [SINGLE HIGH-REVERSED-9 QUOTATION MARK]\n\t\t\"2032\", // [PRIME]\n\t\t\"2035\", // [REVERSED PRIME]\n\t\t\"2039\", // [SINGLE LEFT-POINTING ANGLE QUOTATION MARK]\n\t\t\"203A\", // [SINGLE RIGHT-POINTING ANGLE QUOTATION MARK]\n\t\t\"275B\", // [HEAVY SINGLE TURNED COMMA QUOTATION MARK ORNAMENT]\n\t\t\"275C\", // [HEAVY SINGLE COMMA QUOTATION MARK ORNAMENT]\n\t\t\"FF07\": // [FULLWIDTH APOSTROPHE]\n\t\tbuffer.WriteString(\"'\")\n\tcase \"2010\", // [HYPHEN]\n\t\t\"2011\", // [NON-BREAKING HYPHEN]\n\t\t\"2012\", // [FIGURE DASH]\n\t\t\"2013\", // [EN DASH]\n\t\t\"2014\", // [EM DASH]\n\t\t\"207B\", // [SUPERSCRIPT MINUS]\n\t\t\"208B\", // [SUBSCRIPT MINUS]\n\t\t\"FF0D\": // [FULLWIDTH HYPHEN-MINUS]\n\t\tbuffer.WriteString(\"-\")\n\tcase \"2045\", // [LEFT SQUARE BRACKET WITH QUILL]\n\t\t\"2772\", // [LIGHT LEFT TORTOISE SHELL BRACKET ORNAMENT]\n\t\t\"FF3B\": // [FULLWIDTH LEFT SQUARE BRACKET]\n\t\tbuffer.WriteString(\"[\")\n\tcase \"2046\", // [RIGHT SQUARE BRACKET WITH QUILL]\n\t\t\"2773\", // [LIGHT RIGHT TORTOISE SHELL BRACKET ORNAMENT]\n\t\t\"FF3D\": // [FULLWIDTH RIGHT SQUARE BRACKET]\n\t\tbuffer.WriteString(\"]\")\n\tcase \"207D\", // [SUPERSCRIPT LEFT PARENTHESIS]\n\t\t\"208D\", // [SUBSCRIPT LEFT PARENTHESIS]\n\t\t\"2768\", // [MEDIUM LEFT PARENTHESIS ORNAMENT]\n\t\t\"276A\", // [MEDIUM FLATTENED LEFT PARENTHESIS ORNAMENT]\n\t\t\"FF08\": // [FULLWIDTH LEFT PARENTHESIS]\n\t\tbuffer.WriteString(\"(\")\n\tcase \"2E28\": // [LEFT DOUBLE PARENTHESIS]\n\t\tbuffer.WriteString(\"(\")\n\t\tbuffer.WriteString(\"(\")\n\tcase \"207E\", // [SUPERSCRIPT RIGHT PARENTHESIS]\n\t\t\"208E\", // [SUBSCRIPT RIGHT PARENTHESIS]\n\t\t\"2769\", // [MEDIUM RIGHT PARENTHESIS ORNAMENT]\n\t\t\"276B\", // [MEDIUM FLATTENED RIGHT PARENTHESIS ORNAMENT]\n\t\t\"FF09\": // [FULLWIDTH RIGHT PARENTHESIS]\n\t\tbuffer.WriteString(\")\")\n\tcase \"2E29\": // [RIGHT DOUBLE PARENTHESIS]\n\t\tbuffer.WriteString(\")\")\n\t\tbuffer.WriteString(\")\")\n\tcase \"276C\", // [MEDIUM LEFT-POINTING ANGLE BRACKET ORNAMENT]\n\t\t\"2770\", // [HEAVY LEFT-POINTING ANGLE BRACKET ORNAMENT]\n\t\t\"FF1C\": // [FULLWIDTH LESS-THAN SIGN]\n\t\tbuffer.WriteString(\"<\")\n\tcase \"276D\", // [MEDIUM RIGHT-POINTING ANGLE BRACKET ORNAMENT]\n\t\t\"2771\", // [HEAVY RIGHT-POINTING ANGLE BRACKET ORNAMENT]\n\t\t\"FF1E\": // [FULLWIDTH GREATER-THAN SIGN]\n\t\tbuffer.WriteString(\">\")\n\tcase \"2774\", // [MEDIUM LEFT CURLY BRACKET ORNAMENT]\n\t\t\"FF5B\": // [FULLWIDTH LEFT CURLY BRACKET]\n\t\tbuffer.WriteString(\"{\")\n\tcase \"2775\", // [MEDIUM RIGHT CURLY BRACKET ORNAMENT]\n\t\t\"FF5D\": // [FULLWIDTH RIGHT CURLY BRACKET]\n\t\tbuffer.WriteString(\"}\")\n\tcase \"207A\", // [SUPERSCRIPT PLUS SIGN]\n\t\t\"208A\", // [SUBSCRIPT PLUS SIGN]\n\t\t\"FF0B\": // [FULLWIDTH PLUS SIGN]\n\t\tbuffer.WriteString(\"+\")\n\tcase \"207C\", // [SUPERSCRIPT EQUALS SIGN]\n\t\t\"208C\", // [SUBSCRIPT EQUALS SIGN]\n\t\t\"FF1D\": // [FULLWIDTH EQUALS SIGN]\n\t\tbuffer.WriteString(\"=\")\n\tcase \"FF01\": // [FULLWIDTH EXCLAMATION MARK]\n\t\tbuffer.WriteString(\"!\")\n\tcase \"203C\": // [DOUBLE EXCLAMATION MARK]\n\t\tbuffer.WriteString(\"!\")\n\t\tbuffer.WriteString(\"!\")\n\tcase \"2049\": // [EXCLAMATION QUESTION MARK]\n\t\tbuffer.WriteString(\"!\")\n\t\tbuffer.WriteString(\"?\")\n\tcase \"FF03\": // [FULLWIDTH NUMBER SIGN]\n\t\tbuffer.WriteString(\"#\")\n\tcase \"FF04\": // [FULLWIDTH DOLLAR SIGN]\n\t\tbuffer.WriteString(\"$\")\n\tcase \"2052\", // [COMMERCIAL MINUS SIGN]\n\t\t\"FF05\": // [FULLWIDTH PERCENT SIGN]\n\t\tbuffer.WriteString(\"%\")\n\tcase \"FF06\": // [FULLWIDTH AMPERSAND]\n\t\tbuffer.WriteString(\"&\")\n\tcase \"204E\", // [LOW ASTERISK]\n\t\t\"FF0A\": // [FULLWIDTH ASTERISK]\n\t\tbuffer.WriteString(\"*\")\n\tcase \"FF0C\": // [FULLWIDTH COMMA]\n\t\tbuffer.WriteString(\",\")\n\tcase \"FF0E\": // [FULLWIDTH FULL STOP]\n\t\tbuffer.WriteString(\".\")\n\tcase \"2044\", // [FRACTION SLASH]\n\t\t\"FF0F\": // [FULLWIDTH SOLIDUS]\n\t\tbuffer.WriteString(\"/\")\n\tcase \"FF1A\": // [FULLWIDTH COLON]\n\t\tbuffer.WriteString(\":\")\n\tcase \"204F\", // [REVERSED SEMICOLON]\n\t\t\"FF1B\": // [FULLWIDTH SEMICOLON]\n\t\tbuffer.WriteString(\";\")\n\tcase \"FF1F\": // [FULLWIDTH QUESTION MARK]\n\t\tbuffer.WriteString(\"?\")\n\tcase \"2047\": // [DOUBLE QUESTION MARK]\n\t\tbuffer.WriteString(\"?\")\n\t\tbuffer.WriteString(\"?\")\n\tcase \"2048\": // [QUESTION EXCLAMATION MARK]\n\t\tbuffer.WriteString(\"?\")\n\t\tbuffer.WriteString(\"!\")\n\tcase \"FF20\": // [FULLWIDTH COMMERCIAL AT]\n\t\tbuffer.WriteString(\"@\")\n\tcase \"FF3C\": // [FULLWIDTH REVERSE SOLIDUS]\n\t\tbuffer.WriteString(\"\\\\\")\n\tcase \"2038\", // [CARET]\n\t\t\"FF3E\": // [FULLWIDTH CIRCUMFLEX ACCENT]\n\t\tbuffer.WriteString(\"^\")\n\tcase \"FF3F\": // [FULLWIDTH LOW LINE]\n\t\tbuffer.WriteString(\"_\")\n\tcase \"2053\", // [SWUNG DASH]\n\t\t\"FF5E\": // [FULLWIDTH TILDE]\n\t\tbuffer.WriteString(\"~\")\n\tdefault:\n\t\tbuffer.WriteRune(r)\n\t}\n\n\treturn buffer.String()\n}", "title": "" }, { "docid": "91ff356bea8b765dab83bee03e4b626e", "score": "0.5295704", "text": "func (p *PopUpMenu) TypedRune(rune) {}", "title": "" }, { "docid": "1a1e424daea75d77af9d791add76b7e2", "score": "0.52897745", "text": "func print(str string) { fmt.Println(str) }", "title": "" }, { "docid": "76dc48c3dcb61639e86b23a61512bb9f", "score": "0.5281451", "text": "func (ef EnumFormatter) Print(e int) string {\n\tif e >= len(ef.names) || e < 0 {\n\t\treturn \"Invalid\"\n\t}\n\treturn ef.names[e]\n}", "title": "" }, { "docid": "ec7ba7981a063d1fe0e68b89dd71171a", "score": "0.5280097", "text": "func PrintableASCII(b byte) bool {\n\tif b < 32 || b > 127 {\n\t\treturn false\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "6ee8f1e43d6c71994c8ea1cdd9fbbb2a", "score": "0.52558315", "text": "func (s Shifumi) Rune() rune {\n\treturn []rune{'✊', '✋', '✌'}[s]\n}", "title": "" }, { "docid": "1b8f1d40ca7a49a63471352d2af46d13", "score": "0.5231818", "text": "func (p *Char) String() string {\n\tif p == nil || *p == Char(0) {\n\t\treturn \"\"\n\t}\n\treturn string(*p)\n}", "title": "" }, { "docid": "a564f85cc1b79eae523ff607a0a072da", "score": "0.52254295", "text": "func (k Karma) String() string {\n\tlength := k.length()\n\tcode := make([]byte, length+2)\n\tcode[0] = '{'\n\tcode[length+1] = '}'\n\ti := 1\n\tfor _, e := range Index {\n\t\tfor _, ok := range k[e] {\n\t\t\tif ok {\n\t\t\t\tcode[i] = e.ToChar()\n\t\t\t} else {\n\t\t\t\tcode[i] = e.ToChar() + 32\n\t\t\t}\n\t\t\ti++\n\t\t}\n\t}\n\treturn cast.StringBytes(code)\n}", "title": "" }, { "docid": "8868fcd6e119d08139a5318fa0029327", "score": "0.5224755", "text": "func IsPrintableASCII(s string) bool {\n\treturn printableASCIIRegex.MatchString(s)\n}", "title": "" }, { "docid": "695b0ca9ba4bdd190dbf284b4c044af8", "score": "0.5221927", "text": "func (z *E8) String() string {\n\treturn (z.C0.String() + \"+(\" + z.C1.String() + \")*w\")\n}", "title": "" }, { "docid": "a010c5a31d8d533f0b3fa6d34b2f6508", "score": "0.52158785", "text": "func Printable(rng Rand) byte {\n\treturn ' ' + byte(rng.Intn(95))\n}", "title": "" }, { "docid": "bfe3b786caebcf67eaf82588dcfef209", "score": "0.5197955", "text": "func (m *Info) roffPrint(c int) string {\n\ts := fmt.Sprintf(`.TH HTTPMAN 7\n.SH STATUS CODE\n.B %d\n- %s\n.SH CATEGORY\n%s\n.SH DESCRIPTION\n%s\n`,\n\t\tc,\n\t\tm.codes[c].Message,\n\t\tm.codes[c].Category,\n\t\tm.codes[c].Description)\n\t// Escape all dashes\n\ts = strings.Replace(s, \"-\", \"\\\\-\", -1)\n\treturn s\n}", "title": "" }, { "docid": "a2053833316b6a2144f3a598f6db0424", "score": "0.5190241", "text": "func main() {\n\ts := \"James Bond\"\n\tdrk := `This is done with\n\tBACK-QUOTES ;) `\n\t// Them ni99as `...` back-quotes Above the Tab button\n\tfmt.Println(s)\n\tfmt.Println(drk)\n\n\twrd := \"Look at my ASCII\"\n\tfmt.Println(wrd)\n\n\tbs := []byte(wrd)\n\tfmt.Println(bs)\n\tfmt.Printf(\"%T \\n\\n\", bs) //uint8 = Byte\n\n\t//UTF-8 Character points\n\t// each code point is called a rune = uint32\n\tfor i := 0; i < len(s); i++ {\n\t\tfmt.Printf(\"%#U \", s[i])\n\t}\n\tfmt.Println()\n\n}", "title": "" }, { "docid": "637e0f70333039bae43af711e055b9f4", "score": "0.51814544", "text": "func (stmt *PrintStatement) istring(level int) string {\n\treturn fmt.Sprintf(\"%vprint %v\", getIndentation(level), stmt.expr)\n}", "title": "" }, { "docid": "74152ef88f7c5b7a142bd8783fa02a20", "score": "0.5162138", "text": "func (p *Object) R() rune {\n\treturn p.ToRune()\n}", "title": "" }, { "docid": "090ba7e15bf81a6c459cb50a048a176a", "score": "0.51414734", "text": "func encode(char rune) rune {\n\tswitch {\n\tcase 'a' <= char && char <= 'z':\n\t\treturn 'z' - char + 'a'\n\tcase 'A' <= char && char <= 'Z':\n\t\treturn 'Z' - char + 'a'\n\tcase '0' <= char && char <= '9':\n\t\treturn char\n\tdefault:\n\t\treturn ' '\n\t}\n}", "title": "" }, { "docid": "8594311b949c4b72dc9ea5d8bc7354ff", "score": "0.5137392", "text": "func (t tile) String() string {\n\tswitch t {\n\tcase unknown:\n\t\treturn \".\"\n\tcase wall:\n\t\treturn \"#\"\n\tcase free:\n\t\treturn \" \"\n\tcase target:\n\t\treturn \"x\"\n\tdefault:\n\t\treturn fmt.Sprintf(\"<unknown %d>\", t)\n\t}\n}", "title": "" }, { "docid": "4aaefdf824069d1f1121788a8e5ec12a", "score": "0.51278895", "text": "func (c *Cookie) Rune() rune {\n\tif c.Visibility {\n\t\treturn cookieRune\n\t}\n\treturn invisibleRune\n}", "title": "" }, { "docid": "3be845f19cb9bd404dad296e9513789c", "score": "0.51263475", "text": "func intToChar(char int) string {\n var out string\n switch char {\n case 48:\n out = \"0\"\n case 49:\n out = \"1\"\n case 50:\n out = \"2\"\n case 51:\n out = \"3\"\n case 52:\n out = \"4\"\n case 53:\n out = \"5\"\n case 54:\n out = \"6\"\n case 55:\n out = \"7\"\n case 56:\n out = \"8\"\n case 57:\n out = \"9\"\n case 10:\n out = \"\\n\"\n default:\n out = \" \"\n }\n return out\n}", "title": "" }, { "docid": "a003836dbdfa317e3a1a1d4bc5222dd7", "score": "0.5116608", "text": "func (dc DrawChar) Dump(w io.Writer) error {\n\t_, err := fmt.Fprintf(w, `\"%s\"`, string(dc))\n\treturn err\n}", "title": "" }, { "docid": "c69d928b0a3dd109e45cc3875e91e68d", "score": "0.510876", "text": "func (o Oct) String() string {\n\treturn fmt.Sprintf(\"0o%o\", o.Value())\n}", "title": "" }, { "docid": "ddf8a3ed60c1c60c173041a0673c830e", "score": "0.5106505", "text": "func (f *Fout) WriteRune(s rune) (int, error) {\n\treturn f.fwriter.WriteRune(s)\n}", "title": "" }, { "docid": "fb1d4889c986b8c08d0840175010ec29", "score": "0.5094593", "text": "func Print(s tcell.Screen, x, y int, text string, st tcell.Style) {\n\tfor _, c := range text {\n\t\tvar comb []rune\n\t\tw := runewidth.RuneWidth(c)\n\t\tif w == 0 {\n\t\t\tcomb = []rune{c}\n\t\t\tc = ' '\n\t\t\tw = 1\n\t\t}\n\t\ts.SetContent(x, y, c, comb, st)\n\t\tx += w\n\t}\n}", "title": "" }, { "docid": "1b96fbc37e7dddb0318edaa62ae1fec2", "score": "0.5090899", "text": "func newPrintableString(msg string) (*C.PrintableString_t, error) {\n\t// PrintableString is defined via OctetString --> see PrintableString.h\n\tprntStrC, err := newOctetString(msg)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"newOctetString() %s\", err.Error())\n\t}\n\n\treturn prntStrC, nil\n}", "title": "" }, { "docid": "ac3d5230e77cdd62c00ba5142304928b", "score": "0.50870633", "text": "func (p *PrinterString) Print(value string) string {\n\treturn fmt.Sprintf(\"%v\", value)\n}", "title": "" }, { "docid": "a0150f62b029b3459a2aed77cf8ca496", "score": "0.50833684", "text": "func TypeRune(t Type) rune {\n\tswitch t {\n\tcase TypeMan:\n\t\treturn 'm'\n\tcase TypePin:\n\t\treturn 'p'\n\tcase TypeSou:\n\t\treturn 's'\n\tcase TypeDragon, TypeWind:\n\t\treturn 'z'\n\t}\n\treturn '-'\n}", "title": "" }, { "docid": "f48cf9dbac578c7fb37276b322fe7967", "score": "0.50740176", "text": "func Draw(drawing map[geom.Vec2]rune, unknown rune) {\n\tfmt.Print(String(drawing, unknown))\n}", "title": "" }, { "docid": "675765ea712ede07bbb7226705dec4d7", "score": "0.5073237", "text": "func rcer(r byte) (byte) {\n\tswitch {\n\t\tcase r == 'A': return 'T'\n\t\tcase r == 'a': return 'T'\n\n\t\tcase r == 'C': return 'G'\n\t\tcase r == 'c': return 'G'\n\n\t\tcase r == 'G': return 'C'\n\t\tcase r == 'g': return 'C'\n\n\t\tcase r == 'T': return 'A'\n\t\tcase r == 't': return 'A'\n\n\t\tcase r == 'N': return 'N'\n\t\tcase r == 'n': return 'N'\n\t}\n\tlog.Panic(\"unknown byte\", string(r), \" \", r)\n\treturn r\n}", "title": "" }, { "docid": "07b8526da7e22dd73bdefc017f7dea52", "score": "0.50677675", "text": "func walkRuneToString(n *ir.ConvExpr, init *ir.Nodes) ir.Node {\n\ta := typecheck.NodNil()\n\tif n.Esc() == ir.EscNone {\n\t\ta = stackBufAddr(4, types.Types[types.TUINT8])\n\t}\n\t// intstring(*[4]byte, rune)\n\treturn mkcall(\"intstring\", n.Type(), init, a, typecheck.Conv(n.X, types.Types[types.TINT64]))\n}", "title": "" }, { "docid": "c912a363cbcb9df48f609af85de75d72", "score": "0.50643224", "text": "func (p PEGICode) String() string {\n\tswitch p {\n\tcase 1:\n\t\treturn \"3\"\n\tcase 2:\n\t\treturn \"7\"\n\tcase 3:\n\t\treturn \"12\"\n\tcase 4:\n\t\treturn \"16\"\n\tcase 5:\n\t\treturn \"18\"\n\tdefault:\n\t\treturn \"Undefined\"\n\t}\n}", "title": "" }, { "docid": "b446e9680f1b0f45016b58042bfdb6c8", "score": "0.50579876", "text": "func myPrint(s string) {\n\tfmt.Print(s)\n}", "title": "" }, { "docid": "00bcae30a6e8e00314fb2de45b3cc4ee", "score": "0.50523055", "text": "func (puz *Puzzle) String() string {\n\tvar buf bytes.Buffer\n\tfor i := 0; i < GridSize; i++ {\n\t\tglyph := puz[i]\n\t\tif !Known(glyph) {\n\t\t\tbuf.WriteByte('_')\n\t\t} else {\n\t\t\tbuf.WriteByte(puz[i])\n\t\t}\n\t\tif i % Size == Size-1 {\n\t\t\tbuf.WriteByte('\\n')\n\t\t} else {\n\t\t\tbuf.WriteByte(' ')\n\t\t}\n\t}\n\treturn buf.String()\n}", "title": "" }, { "docid": "ac58765c5fe004c6b681cf2c60ad6ed1", "score": "0.5052274", "text": "func (c *GF127) String() string {\n\treturn hex.EncodeToString(c.ByteArray())\n}", "title": "" }, { "docid": "83cdd470c37abc9e9c24175b55f77857", "score": "0.5047932", "text": "func RTypeRune() uintptr { return ekaclike.RTypeRune }", "title": "" }, { "docid": "10cc1458bf6df55444781da1b18176e4", "score": "0.5042356", "text": "func Print(out io.Writer, param VMWord) (err error) {\n\t_, err = fmt.Fprintf(out, \"%c\", param)\n\treturn\n}", "title": "" }, { "docid": "3247efdebfade86613bb3dbf2e81d0f2", "score": "0.50405914", "text": "func isPrintable(str string) bool {\n\tconst firstPrintable = 32 // ASCII space\n\n\tfor _, r := range str {\n\t\tif r < firstPrintable || r > unicode.MaxASCII {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "2f7b54755f50cedecf1cae72adc6d5e9", "score": "0.5037377", "text": "func (img *ImageToASCII) Print() {\n\n\tfor y := 0; y < len(img.ASCII); y++ {\n\n\t\t// @TODO(mark): Remove this work around once the conversion algorithm\n\t\t// has been fixed. This just halves x so it is twice as\n\t\t// wide\n\t\tfor x := 0.0; int(x) < len(img.ASCII[y]); x += 0.5 {\n\n\t\t\tfmt.Printf(\"%c\", img.ASCII[y][int(x)])\n\t\t}\n\t\tfmt.Printf(\"\\n\")\n\t}\n}", "title": "" }, { "docid": "b494f2cc466984ee40b9f4af9c859e11", "score": "0.50302124", "text": "func (ctrl SubtitleControl) String() string {\n\treturn string([]rune{rune((ctrl >> 0) & 0xFF), rune((ctrl >> 8) & 0xFF), rune((ctrl >> 16) & 0xFF), rune((ctrl >> 24) & 0xFF)})\n}", "title": "" }, { "docid": "3a48643e56d805bafefc60afd5bbe829", "score": "0.5027195", "text": "func (self Aux) String() string {\n\treturn fmt.Sprintf(\"%s:%c:%v\", []byte(self[:2]), auxTypes[self.Type()], self.Value())\n}", "title": "" }, { "docid": "fa7a1623d4b83b4576d290b2b4d8df52", "score": "0.50165176", "text": "func (t *Tile) String() string {\r\n\treturn fmt.Sprintf(\"%s|%s|%d\", t.ID, t.Letter, t.Value)\r\n}", "title": "" }, { "docid": "a6dfc10457974f6e5fd9d1ec95b7568c", "score": "0.49932185", "text": "func StrIsPrintRune(s string) bool {\n\tfor _, r := range s {\n\t\tif !unicode.IsPrint(r) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "f1d9ff6271f212e1b78bc7ad83e5afd5", "score": "0.49901626", "text": "func Rune(v rune) *rune {\n\treturn &v\n}", "title": "" }, { "docid": "178a29c1b70eec2587a4b7ac188e5331", "score": "0.49878916", "text": "func (p *Painter) DrawRune(x, y int, r rune, st *Style) {\n\tp.SetCell(Cell{r, *st}, image.Pt(x, y))\n}", "title": "" }, { "docid": "0b3ece01fbfb6f8c9ec1870d1f4d7016", "score": "0.4987851", "text": "func (s *Scanner) Rune() rune {\n\treturn s.c.C\n}", "title": "" }, { "docid": "c5a875c572182c4655ab29282f6fb336", "score": "0.49806932", "text": "func (c *Card) ToString() string {\n return c.GetSymbol()\n}", "title": "" }, { "docid": "9b0831d129e9a6f607047909e7554705", "score": "0.4979289", "text": "func (h *Hand) PrintString() string {\n\tswitch h.Rank {\n\tcase hand.HighCard:\n\t\treturn fmt.Sprintf(\"high card %s\",\n\t\t\th.High[0].KindTitle(),\n\t\t)\n\n\tcase hand.OnePair:\n\t\treturn fmt.Sprintf(\"pair of %ss\",\n\t\t\th.High[0].KindTitle(),\n\t\t)\n\n\tcase hand.TwoPair:\n\t\treturn fmt.Sprintf(\"two pairs, %ss and %ss\",\n\t\t\th.High[0].KindTitle(),\n\t\t\th.High[1].KindTitle(),\n\t\t)\n\n\tcase hand.ThreeKind:\n\t\treturn fmt.Sprintf(\"three of a kind, %ss\",\n\t\t\th.High[0].KindTitle(),\n\t\t)\n\n\tcase hand.Straight:\n\t\treturn fmt.Sprintf(\"straight, %s to %s\",\n\t\t\th.Value.Min(AceHigh).KindTitle(),\n\t\t\th.Value.Max(AceHigh).KindTitle(),\n\t\t)\n\n\tcase hand.Flush:\n\t\treturn fmt.Sprintf(\"flush, %s high\",\n\t\t\th.High[0].KindTitle(),\n\t\t)\n\n\tcase hand.FullHouse:\n\t\treturn fmt.Sprintf(\"full house, %ss full of %ss\",\n\t\t\th.High[0].KindTitle(),\n\t\t\th.High[1].KindTitle(),\n\t\t)\n\n\tcase hand.FourKind:\n\t\treturn fmt.Sprintf(\"four of a kind, %ss\",\n\t\t\th.High[0].KindTitle(),\n\t\t)\n\n\tcase hand.StraightFlush:\n\t\treturn fmt.Sprintf(\"straight flush, %s to %s\",\n\t\t\th.Value.Min(AceHigh).KindTitle(),\n\t\t\th.Value.Max(AceHigh).KindTitle(),\n\t\t)\n\n\tcase hand.BadugiOne:\n\t\treturn fmt.Sprintf(\"1-card badugi: %s\",\n\t\t\th.Value[0].KindTitle(),\n\t\t)\n\n\tcase hand.BadugiTwo:\n\t\treturn fmt.Sprintf(\"2-card badugi: %s + %s\",\n\t\t\th.Value[0].KindTitle(),\n\t\t\th.Value[1].KindTitle(),\n\t\t)\n\n\tcase hand.BadugiThree:\n\t\treturn fmt.Sprintf(\"3-card badugi: %s + %s + %s\",\n\t\t\th.Value[0].KindTitle(),\n\t\t\th.Value[1].KindTitle(),\n\t\t\th.Value[2].KindTitle(),\n\t\t)\n\n\tcase hand.BadugiFour:\n\t\treturn fmt.Sprintf(\"4-card badugi: %s + %s + %s + %s\",\n\t\t\th.Value[0].KindTitle(),\n\t\t\th.Value[1].KindTitle(),\n\t\t\th.Value[2].KindTitle(),\n\t\t\th.Value[3].KindTitle(),\n\t\t)\n\t}\n\n\treturn \"\"\n}", "title": "" }, { "docid": "8edaed137f781894773e4ea6cde9b31b", "score": "0.49745873", "text": "func print(str string) {\n\tfmt.Println(str)\n}", "title": "" }, { "docid": "848567052ffefd3318ed2341fe48b0a1", "score": "0.49737188", "text": "func (e *Entry) String() string {\n\treturn fmt.Sprintf(\"{term=%v command=%v} \", e.Term, e.Command)\n}", "title": "" }, { "docid": "28fd0a7a9685c39e5382e41e626d0d94", "score": "0.49700448", "text": "func (h Hash) TerminalString() string {\n\treturn fmt.Sprintf(\"%x…%x\", h[:3], h[29:])\n}", "title": "" }, { "docid": "28fd0a7a9685c39e5382e41e626d0d94", "score": "0.49700448", "text": "func (h Hash) TerminalString() string {\n\treturn fmt.Sprintf(\"%x…%x\", h[:3], h[29:])\n}", "title": "" }, { "docid": "798c596ec9c216748a89cf0ea5d0af85", "score": "0.49682647", "text": "func (p *Char) A() string {\n\treturn p.String()\n}", "title": "" }, { "docid": "6da35a1fbc00dd58de58c31899773c22", "score": "0.49382737", "text": "func (*ASCIIEncoder) Encode(w io.Writer, r rune) error {\n\tif r > 127 {\n\t\treturn errors.New(\"character out of range\")\n\t}\n\n\tbuf := make([]byte, 1)\n\tbuf[0] = byte(r)\n\t_, err := w.Write(buf)\n\treturn err\n}", "title": "" }, { "docid": "f74ca5c4ef4fe44335f62cfa5cf53546", "score": "0.49272534", "text": "func (enc UTF16Encoder) RuneToCharcode(r rune) (CharCode, bool) {\n\treturn CharCode(r), true\n}", "title": "" }, { "docid": "f7224cf8fd9409d3c662e1069cf0a328", "score": "0.49239638", "text": "func (k PublicKey) String() string {\n\treturn hex.EncodeToString(k[:])\n}", "title": "" }, { "docid": "0864c7d7ec82b461a1938cd7b78e57b2", "score": "0.49204382", "text": "func (f FRRepr) String() string {\n\treturn fmt.Sprintf(\"%016x%016x%016x%016x\", f[3], f[2], f[1], f[0])\n}", "title": "" }, { "docid": "75ce3712b11f542bae8a05a5e296742c", "score": "0.49086267", "text": "func (c Card) String() string {\n\treturn fmt.Sprintf(\"[%s of %s]\", c.Value, c.Suit)\n}", "title": "" }, { "docid": "9c3ec9ee520a5201fdb0a38d07eb61f8", "score": "0.4900731", "text": "func Chr(ascii int) string {\n\treturn string([]byte{byte(ascii % 256)})\n}", "title": "" }, { "docid": "05fbf9ea1d83c1534515de1697c0509b", "score": "0.49000487", "text": "func (b *BingoBoard) boardToASCII() string {\n\tt := table.NewWriter()\n\tt.SetOutputMirror(os.Stdout)\n\tt.AppendHeader(table.Row{\"1\", \"2\", \"3\", \"4\", \"5\"})\n\tt.AppendRows([]table.Row{\n\t\t{b.boardState[0][0], b.boardState[0][1], b.boardState[0][2], b.boardState[0][3], b.boardState[0][4]},\n\t})\n\t//t.AppendSeparator()\n\treturn t.RenderMarkdown()\n}", "title": "" }, { "docid": "035334b8fae607dfb1c8137016d92d26", "score": "0.48907042", "text": "func runePoints(r rune) int {\n\t// a => A\n\tif r >= 97 {\n\t\tr -= 32\n\t}\n\tswitch r {\n\tcase 'A', 'E', 'I', 'O', 'U', 'L', 'N', 'R', 'S', 'T':\n\t\treturn 1\n\tcase 'D', 'G':\n\t\treturn 2\n\tcase 'B', 'C', 'M', 'P':\n\t\treturn 3\n\tcase 'F', 'H', 'V', 'W', 'Y':\n\t\treturn 4\n\tcase 'K':\n\t\treturn 5\n\tcase 'J', 'X':\n\t\treturn 8\n\tcase 'Q', 'Z':\n\t\treturn 10\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "af91a9ddea5060f0a5becaad8e82a039", "score": "0.4888203", "text": "func (d NormalDie) String() string {\n\treturn fmt.Sprintf(\"d%d\", d)\n}", "title": "" }, { "docid": "2a744f3fb594051c2d379a314ae26d37", "score": "0.48872206", "text": "func (screen *Screen) RenderRune(x, y int, r rune) {\n\tscreen.screen.SetCell(x, y, screen.themeStyle, r)\n\n}", "title": "" }, { "docid": "e8494c8d0e9c2f5235a015e07a058b88", "score": "0.48838127", "text": "func (c Card) String() string {\n\treturn fmt.Sprintf(\"%s of %s\", valueString(c.Value), c.Suit)\n}", "title": "" }, { "docid": "bcedb0f69f3f887e948a61f9c8991a34", "score": "0.4882665", "text": "func (t *TicTacToe) String() string {\n\tvar sb strings.Builder\n\n\tfor i, v := range t.board {\n\t\tfor _, c := range v {\n\t\t\tsb.WriteByte('|')\n\t\t\tsb.WriteByte(c)\n\t\t}\n\n\t\tsb.WriteByte('|')\n\n\t\tif i < 2 {\n\t\t\tsb.WriteByte('\\n')\n\t\t}\n\t}\n\n\treturn sb.String()\n}", "title": "" }, { "docid": "680cd68efce5702892152b713f9851b9", "score": "0.48795363", "text": "func (c *Character) Print() {\n\t// Print the name\n\tfmt.Printf(\"%s\\t%s\\n\", theme.Title(\"Name\"), c.Name)\n\n\t// Print the backgrounds\n\tbackgrounds := []Background{}\n\n\tfor _, background := range c.Backgrounds {\n\t\tbackgrounds = append(backgrounds, background)\n\t}\n\n\tslice.Sort(backgrounds, func(i, j int) bool {\n\t\tif backgrounds[i].Type != backgrounds[j].Type {\n\t\t\treturn backgrounds[i].Type < backgrounds[j].Type\n\t\t}\n\n\t\treturn backgrounds[i].Name < backgrounds[j].Name\n\t})\n\n\tfor _, background := range backgrounds {\n\t\tfmt.Printf(\"%s\\t%s\\n\", theme.Title(strings.Title(background.Type)), strings.Title(background.Name))\n\t}\n\n\t// Print the aptitudes\n\taptitudes := []Aptitude{}\n\n\tfor _, aptitude := range c.Aptitudes {\n\t\taptitudes = append(aptitudes, aptitude)\n\t}\n\n\tslice.Sort(aptitudes, func(i, j int) bool {\n\t\treturn aptitudes[i] < aptitudes[j]\n\t})\n\n\tfmt.Printf(\"\\n%s (%s)\\n\", theme.Title(\"Aptitudes\"), theme.Value(fmt.Sprintf(\"%d\", len(aptitudes))))\n\tfor _, aptitude := range aptitudes {\n\t\tfmt.Printf(\"%s\\n\", strings.Title(string(aptitude)))\n\t}\n\n\t// Print the experience\n\tfmt.Printf(\"\\n%s\\t%d/%d\\n\", theme.Title(\"Experience\"), c.Spent, c.Experience)\n\n\t// Print the characteristics\n\n\tvar characteristicSum int\n\tcharacteristics := []Characteristic{}\n\tfor _, characteristic := range c.Characteristics {\n characteristicSum += characteristic.Value\n\t\tcharacteristics = append(characteristics, characteristic)\n\t}\n\n\tslice.Sort(characteristics, func(i, j int) bool {\n\t\treturn characteristics[i].Name < characteristics[j].Name\n\t})\n \n\tfmt.Printf(\"\\n%s (%s)\\n\", theme.Title(\"Characteristics\"), theme.Value(fmt.Sprintf(\"%d\", characteristicSum)))\n\n\tfor _, characteristic := range characteristics {\n\t\tfmt.Printf(\"%s\\t%s %s\\n\", characteristic.Name, theme.Value(characteristic.Value), theme.Value(characteristic.Level()))\n\t}\n\n\t// Print the gauges\n\n\tif len(c.Gauges) != 0 {\n\n\t\tfmt.Printf(\"\\n%s\\n\", theme.Title(\"Gauges\"))\n\n\t\tgauges := []Gauge{}\n\t\tfor _, gauge := range c.Gauges {\n\t\t\tgauges = append(gauges, gauge)\n\t\t}\n\n\t\tslice.Sort(gauges, func(i, j int) bool {\n\t\t\treturn gauges[i].Name < gauges[j].Name\n\t\t})\n\n\t\tfor _, gauge := range gauges {\n\t\t\tfmt.Printf(\"%s\\t%s\\n\", gauge.Name, theme.Value(gauge.Value))\n\t\t}\n\t}\n\n\t// Print the skills\n\n\tif len(c.Skills) != 0 {\n\n\t\t// Print the skills using a tabwriter\n\t\tfmt.Printf(\"\\n%s\\n\", theme.Title(\"Skills\"))\n\n\t\tskills := []Skill{}\n\t\tfor _, skill := range c.Skills {\n\t\t\tskills = append(skills, skill)\n\t\t}\n\n\t\tslice.Sort(skills, func(i, j int) bool {\n\t\t\treturn skills[i].FullName() < skills[j].FullName()\n\t\t})\n\n\t\tw := tabwriter.NewWriter(os.Stdout, 10, 1, 2, ' ', 0)\n\t\tfor _, skill := range skills {\n\t\t\tfmt.Fprintf(w, \"%s\\t+%s\\n\", strings.Title(skill.FullName()), theme.Value((skill.Tier-1)*10))\n\t\t}\n\t\tw.Flush()\n\t}\n\n\t// Print the talents\n\n\tif len(c.Talents) != 0 {\n\n\t\tfmt.Printf(\"\\n%s\\n\", theme.Title(\"Talents\"))\n\n\t\ttalents := []Talent{}\n\t\tfor _, talent := range c.Talents {\n\t\t\ttalents = append(talents, talent)\n\t\t}\n\n\t\tslice.Sort(talents, func(i, j int) bool {\n\t\t\treturn talents[i].FullName() < talents[j].FullName()\n\t\t})\n\n\t\tw := tabwriter.NewWriter(os.Stdout, 10, 1, 2, ' ', 0)\n\t\tfor _, talent := range talents {\n\t\t\tif talent.Value != 1 {\n\t\t\t\tfmt.Fprintf(w, \"%s (%d)\\t%s\\n\", strings.Title(talent.FullName()), talent.Value, talent.Description)\n\t\t\t} else {\n\t\t\t\tfmt.Fprintf(w, \"%s\\t%s\\n\", strings.Title(talent.FullName()), talent.Description)\n\t\t\t}\n\t\t}\n\t\tw.Flush()\n\t}\n\n\t// Print the spells\n\n\tif len(c.Spells) != 0 {\n\n\t\tfmt.Printf(\"\\n%s\\n\", theme.Title(\"Spells\"))\n\n\t\tspells := []Spell{}\n\n\t\tfor _, spell := range c.Spells {\n\t\t\tspells = append(spells, spell)\n\t\t}\n\n\t\tslice.Sort(spells, func(i, j int) bool {\n\t\t\treturn spells[i].Name < spells[j].Name\n\t\t})\n\n\t\tw := tabwriter.NewWriter(os.Stdout, 10, 1, 2, ' ', 0)\n\t\tfor _, spell := range spells {\n\t\t\tfmt.Fprintf(w, \"%s\\t%s\\n\", strings.Title(spell.Name), spell.Description)\n\t\t}\n\t\tw.Flush()\n\t}\n\n\t// Print the special rules\n\n\tif len(c.Rules) != 0 {\n\t\tfmt.Printf(\"\\n%s\\n\", theme.Title(\"Rules\"))\n\n\t\trules := []Rule{}\n\n\t\tfor _, rule := range c.Rules {\n\t\t\trules = append(rules, rule)\n\t\t}\n\n\t\tslice.Sort(rules, func(i, j int) bool {\n\t\t\treturn rules[i].Name < rules[j].Name\n\t\t})\n\n\t\tw := tabwriter.NewWriter(os.Stdout, 10, 1, 2, ' ', 0)\n\t\tfor _, rule := range rules {\n\t\t\tfmt.Printf(\"%s\\t%s\\n\", strings.Title(rule.Name), rule.Description)\n\t\t}\n\t\tw.Flush()\n\t}\n}", "title": "" }, { "docid": "f3502356715cecb539f070940612d94e", "score": "0.4876452", "text": "func (g *Gui) Rune(x, y int) (rune, error) {\n\tif x < 0 || y < 0 || x >= g.maxX || y >= g.maxY {\n\t\treturn ' ', errors.New(\"invalid point\")\n\t}\n\tc := termbox.CellBuffer()[y*g.maxX+x]\n\treturn c.Ch, nil\n}", "title": "" }, { "docid": "347a43788be86f179299801419bb85a9", "score": "0.48737025", "text": "func (s *TestSurface) String() string {\n\tvar buf bytes.Buffer\n\tbuf.WriteRune('\\n')\n\tfor j := 0; j < s.size.Y; j++ {\n\t\tfor i := 0; i < s.size.X; i++ {\n\t\t\tif cell, ok := s.cells[image.Point{i, j}]; ok {\n\t\t\t\tbuf.WriteRune(cell.Rune)\n\t\t\t\tif w := runeWidth(cell.Rune); w > 1 {\n\t\t\t\t\ti += w - 1\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tbuf.WriteRune(s.emptyCh)\n\t\t\t}\n\t\t}\n\t\tbuf.WriteRune('\\n')\n\t}\n\treturn buf.String()\n}", "title": "" }, { "docid": "b742a3aab0dd1f87a8690c8ed3e3c137", "score": "0.48652843", "text": "func print(a string){\n fmt.Println(a)\n}", "title": "" }, { "docid": "310c9a2d635077ebe7b5de88734bab91", "score": "0.48617214", "text": "func ToCharStr(i int) string {\n\treturn string('A' - 1 + i)\n}", "title": "" } ]
fb47da3c98525d48aebb2de5a80d7831
GetBackupFrameworkWithName retrieves all backup.Framework items from an AWS CloudFormation template whose logical ID matches the provided name. Returns an error if not found.
[ { "docid": "d393e700c13eff74843d55a4716e8f96", "score": "0.8286608", "text": "func (t *Template) GetBackupFrameworkWithName(name string) (*backup.Framework, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *backup.Framework:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type backup.Framework not found\", name)\n}", "title": "" } ]
[ { "docid": "030c8614f79d296d1de2fb8dd92ac948", "score": "0.5583265", "text": "func Get(id string) model.Framework {\n\treturn frameworks[id]\n}", "title": "" }, { "docid": "e83ab982ea4f1a7bc58e2c3815374f96", "score": "0.53410196", "text": "func (t *Template) GetAllBackupFrameworkResources() map[string]*backup.Framework {\n\tresults := map[string]*backup.Framework{}\n\tfor name, untyped := range t.Resources {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *backup.Framework:\n\t\t\tresults[name] = resource\n\t\t}\n\t}\n\treturn results\n}", "title": "" }, { "docid": "a12d80567314c656d8eb998114685f28", "score": "0.507272", "text": "func (t *Template) GetCodePipelineWebhookWithName(name string) (*codepipeline.Webhook, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *codepipeline.Webhook:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type codepipeline.Webhook not found\", name)\n}", "title": "" }, { "docid": "13efd3598de531c15b0bf3c10d38789e", "score": "0.50349337", "text": "func (t *Template) GetWAFByteMatchSetWithName(name string) (*waf.ByteMatchSet, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *waf.ByteMatchSet:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type waf.ByteMatchSet not found\", name)\n}", "title": "" }, { "docid": "604ab7b7e70f56ee464f7a4591606452", "score": "0.4949281", "text": "func getFrameworkInfoByFrameworkID(frameworkID string, frameworks []frameworkInfo) (frameworkInfo, bool) {\n\tfor _, framework := range frameworks {\n\t\tif framework.ID == frameworkID {\n\t\t\treturn framework, true\n\t\t}\n\t}\n\treturn frameworkInfo{}, false\n}", "title": "" }, { "docid": "0810ce5063cb9d72918868c099a53dc9", "score": "0.49216568", "text": "func (t *Template) GetWAFIPSetWithName(name string) (*waf.IPSet, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *waf.IPSet:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type waf.IPSet not found\", name)\n}", "title": "" }, { "docid": "d4363f8b590fe598f0f9a3dcbc128ff8", "score": "0.48558074", "text": "func GetBackend(name string) (Backend, error) {\n\tbackend, exists := backends[name]\n\tif !exists {\n\t\treturn nil, fmt.Errorf(\"no backend with name %q found\", name)\n\t}\n\treturn backend, nil\n}", "title": "" }, { "docid": "b1f491cb2b3e0378dbefd26e441d1ee5", "score": "0.47403723", "text": "func (t *Template) GetWAFRuleWithName(name string) (*waf.Rule, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *waf.Rule:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type waf.Rule not found\", name)\n}", "title": "" }, { "docid": "47d7bd0d67890c51f846584b85c1db80", "score": "0.47313038", "text": "func (t *Template) GetGlueWorkflowWithName(name string) (*glue.Workflow, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *glue.Workflow:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type glue.Workflow not found\", name)\n}", "title": "" }, { "docid": "2d8892fd67abf4b398e4a6270a84d647", "score": "0.4730656", "text": "func FindBackend(name string) Backend {\n\tfor _, backend := range Backends {\n\t\tif backend.Name == name {\n\t\t\treturn backend\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3f87ace32c338d00616d39a71dae0202", "score": "0.46878165", "text": "func (t *Template) GetIoTFleetWiseSignalCatalogWithName(name string) (*iotfleetwise.SignalCatalog, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *iotfleetwise.SignalCatalog:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type iotfleetwise.SignalCatalog not found\", name)\n}", "title": "" }, { "docid": "29a48d4d556a345800d1c9c945839e2e", "score": "0.4677199", "text": "func (t *Template) GetApiGatewayStageWithName(name string) (*apigateway.Stage, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *apigateway.Stage:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type apigateway.Stage not found\", name)\n}", "title": "" }, { "docid": "67b9dc093fcefa133f9636e908712257", "score": "0.4643323", "text": "func (t *Template) GetSageMakerWorkteamWithName(name string) (*sagemaker.Workteam, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *sagemaker.Workteam:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type sagemaker.Workteam not found\", name)\n}", "title": "" }, { "docid": "ff02036cc37d454553f342611b891cef", "score": "0.46319026", "text": "func (t *Template) GetSageMakerAppWithName(name string) (*sagemaker.App, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *sagemaker.App:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type sagemaker.App not found\", name)\n}", "title": "" }, { "docid": "5a08ea0aa9427c06c93c6a71eeae90d2", "score": "0.45493257", "text": "func (t *Template) GetLakeFormationResourceWithName(name string) (*lakeformation.Resource, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *lakeformation.Resource:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type lakeformation.Resource not found\", name)\n}", "title": "" }, { "docid": "cf8dbba9fb50010b79e95a8506c802e7", "score": "0.4527949", "text": "func (t *Template) GetBatchJobQueueWithName(name string) (*batch.JobQueue, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *batch.JobQueue:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type batch.JobQueue not found\", name)\n}", "title": "" }, { "docid": "99cdb58db5a262ab5fa9bfa018a7c6ad", "score": "0.45254323", "text": "func (t *Template) GetMWAAEnvironmentWithName(name string) (*mwaa.Environment, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *mwaa.Environment:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type mwaa.Environment not found\", name)\n}", "title": "" }, { "docid": "1c391eb9bdfb67a22e4ef370f662d9a5", "score": "0.44844145", "text": "func (t *Template) GetWAFSizeConstraintSetWithName(name string) (*waf.SizeConstraintSet, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *waf.SizeConstraintSet:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type waf.SizeConstraintSet not found\", name)\n}", "title": "" }, { "docid": "1bf28d7ce76f1592f385791f7e0f1c11", "score": "0.4484275", "text": "func (t *Template) GetMSKConfigurationWithName(name string) (*msk.Configuration, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *msk.Configuration:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type msk.Configuration not found\", name)\n}", "title": "" }, { "docid": "b0350e29daa23480ddf8030646068c13", "score": "0.44740543", "text": "func (t *Template) GetCloudFormationHookVersionWithName(name string) (*cloudformation.HookVersion, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *cloudformation.HookVersion:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type cloudformation.HookVersion not found\", name)\n}", "title": "" }, { "docid": "cf3cad9670575e5021ba178f9bf4254d", "score": "0.44634566", "text": "func (t *Template) GetBackupBackupPlanWithName(name string) (*backup.BackupPlan, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *backup.BackupPlan:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type backup.BackupPlan not found\", name)\n}", "title": "" }, { "docid": "c4dabb224fec2326056c591e722537f9", "score": "0.44481158", "text": "func (t *Template) GetMSKBatchScramSecretWithName(name string) (*msk.BatchScramSecret, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *msk.BatchScramSecret:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type msk.BatchScramSecret not found\", name)\n}", "title": "" }, { "docid": "110c8545e1242f43c5d77a9e5d149a06", "score": "0.44460416", "text": "func (t *Template) GetIoTFleetHubApplicationWithName(name string) (*iotfleethub.Application, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *iotfleethub.Application:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type iotfleethub.Application not found\", name)\n}", "title": "" }, { "docid": "7f070c491d24f789a8a9f0decb2fc304", "score": "0.4440737", "text": "func (pc *PrometheusController) GetFramework() *framework.Framework {\n\treturn pc.framework\n}", "title": "" }, { "docid": "2422b6a58dfacff3ae9ea9b36cb3966f", "score": "0.44381246", "text": "func (t *Template) GetCustomerProfilesIntegrationWithName(name string) (*customerprofiles.Integration, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *customerprofiles.Integration:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type customerprofiles.Integration not found\", name)\n}", "title": "" }, { "docid": "5c894931367a60307931202c081fd77f", "score": "0.4438001", "text": "func (t *Template) GetElasticBeanstalkApplicationWithName(name string) (*elasticbeanstalk.Application, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *elasticbeanstalk.Application:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type elasticbeanstalk.Application not found\", name)\n}", "title": "" }, { "docid": "b600ff919aa694fe6a8da1b7cf5d3c75", "score": "0.44344452", "text": "func GetCurrentDeploymentByName(name string) (*v1beta1_ext.Deployment, *v1beta1_apps.StatefulSet, error) {\n\tgitClient := git.Client()\n\tgitClient.Refresh()\n\n\tenvironment, err := bitesize.LoadEnvironmentFromConfig(config.Env)\n\tif err != nil {\n\t\tlog.Errorf(\"Could not load env: %s\", err.Error())\n\t\treturn nil, nil, err\n\t}\n\n\tlog.Debugf(\"ENV: %+v\", *environment)\n\n\tservice := environment.Services.FindByName(name)\n\tif service == nil {\n\t\tlog.Infof(\"Services: %q\", environment.Services)\n\t\treturn nil, nil, fmt.Errorf(\"%s not found\", name)\n\t}\n\n\tmapper := translator.KubeMapper{\n\t\tBiteService: service,\n\t}\n\n\tif service.DatabaseType == \"mongo\" {\n\t\tstatefulset, _ := mapper.MongoStatefulSet()\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"Could not process statefulset: %s\", err.Error())\n\t\t\treturn nil, nil, err\n\t\t}\n\t\treturn nil, statefulset, nil\n\n\t} else {\n\t\tdeployment, err := mapper.Deployment()\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"Could not process deployment : %s\", err.Error())\n\t\t\treturn nil, nil, err\n\t\t}\n\t\treturn deployment, nil, nil\n\t}\n}", "title": "" }, { "docid": "9c55b331265dc6bdcce9439a579578f6", "score": "0.4432639", "text": "func (t *Template) GetIoTFleetWiseDecoderManifestWithName(name string) (*iotfleetwise.DecoderManifest, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *iotfleetwise.DecoderManifest:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type iotfleetwise.DecoderManifest not found\", name)\n}", "title": "" }, { "docid": "46be52fec7d95e946042dd6dd6ea90e2", "score": "0.4412997", "text": "func (t *Template) GetAppConfigExtensionWithName(name string) (*appconfig.Extension, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *appconfig.Extension:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type appconfig.Extension not found\", name)\n}", "title": "" }, { "docid": "72fc8ce76e82cc4d33451d8d5cb6104e", "score": "0.44007638", "text": "func (t *Template) GetGlueSchemaWithName(name string) (*glue.Schema, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *glue.Schema:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type glue.Schema not found\", name)\n}", "title": "" }, { "docid": "eef558d9e239d16fa4d44f3b23cf15ad", "score": "0.43860456", "text": "func (t *Template) GetStepFunctionsStateMachineWithName(name string) (*stepfunctions.StateMachine, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *stepfunctions.StateMachine:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type stepfunctions.StateMachine not found\", name)\n}", "title": "" }, { "docid": "0e53d0abbbf4a76a57799addac5f82e1", "score": "0.43836978", "text": "func (t *Template) GetOpsWorksAppWithName(name string) (*opsworks.App, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *opsworks.App:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type opsworks.App not found\", name)\n}", "title": "" }, { "docid": "115bf12f5e7ab92618c8544e0a687ffe", "score": "0.43802115", "text": "func GetTemplateByName(name string) (*DevcontainerTemplate, error) {\n\t// TODO - could possibly make this quicker by searching using the name rather than listing all and filtering\n\ttemplates, err := GetTemplates()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, template := range templates {\n\t\tif template.Name == name {\n\t\t\treturn &template, nil\n\t\t}\n\t}\n\treturn nil, nil\n}", "title": "" }, { "docid": "b5d9bdadbe79ea7ba6103bf88683caf9", "score": "0.43642014", "text": "func (t *Template) GetBackupBackupSelectionWithName(name string) (*backup.BackupSelection, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *backup.BackupSelection:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type backup.BackupSelection not found\", name)\n}", "title": "" }, { "docid": "77790338a84c4723961f78a5cd0245e8", "score": "0.43488282", "text": "func NewDefaultFramework(baseName string) *Framework {\n\tf := NewFramework(baseName, nil)\n\treturn f\n}", "title": "" }, { "docid": "bc678b5841e65bc0eabdf357377e8e94", "score": "0.4334749", "text": "func (t *Template) GetAthenaWorkGroupWithName(name string) (*athena.WorkGroup, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *athena.WorkGroup:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type athena.WorkGroup not found\", name)\n}", "title": "" }, { "docid": "62d7a80ec84a080b18dcdb6308cd9427", "score": "0.43256915", "text": "func (t *Template) GetBackupBackupVaultWithName(name string) (*backup.BackupVault, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *backup.BackupVault:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type backup.BackupVault not found\", name)\n}", "title": "" }, { "docid": "253fd7a4621397a8ef091836535271b5", "score": "0.43256414", "text": "func (t *Template) GetBatchJobDefinitionWithName(name string) (*batch.JobDefinition, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *batch.JobDefinition:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type batch.JobDefinition not found\", name)\n}", "title": "" }, { "docid": "18e38ec54ad7a3d32efdc863ada9b985", "score": "0.4313802", "text": "func (t *Template) GetMediaConvertJobTemplateWithName(name string) (*mediaconvert.JobTemplate, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *mediaconvert.JobTemplate:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type mediaconvert.JobTemplate not found\", name)\n}", "title": "" }, { "docid": "bb8b7f084e3edf83f4be5534af38b3b9", "score": "0.43067786", "text": "func (t *Template) GetASKSkillWithName(name string) (*ask.Skill, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *ask.Skill:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type ask.Skill not found\", name)\n}", "title": "" }, { "docid": "d8289fa92d50c05977e4e3461d73ecaf", "score": "0.4300225", "text": "func (b *Runtime) Get(namespace, name string) *backup_controller.BackupController {\n\tb.lock.Lock()\n\tdefer b.lock.Unlock()\n\n\tif b.backups == nil {\n\t\tb.backups = map[string]*backup_controller.BackupController{}\n\t}\n\n\tkey := fmt.Sprintf(\"%s/%s\", namespace, name)\n\n\tif b.backups[key] == nil {\n\t\tb.backups[key] = &backup_controller.BackupController{\n\t\t\tName: name,\n\t\t\tNamespace: namespace,\n\t\t}\n\t\tb.backups[key].SetClient(b.client)\n\t}\n\n\treturn b.backups[key]\n}", "title": "" }, { "docid": "33b51ede9884ceaa57cf36e76f91080d", "score": "0.4300069", "text": "func (t *Template) GetApplicationInsightsApplicationWithName(name string) (*applicationinsights.Application, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *applicationinsights.Application:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type applicationinsights.Application not found\", name)\n}", "title": "" }, { "docid": "5ef4eb343f96952df5a5dc942da144d1", "score": "0.42960596", "text": "func (t *Template) GetGlueDatabaseWithName(name string) (*glue.Database, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *glue.Database:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type glue.Database not found\", name)\n}", "title": "" }, { "docid": "80fa0cc380feb7848b15cdfca669ab94", "score": "0.42954695", "text": "func (t *Template) GetDataBrewProjectWithName(name string) (*databrew.Project, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *databrew.Project:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type databrew.Project not found\", name)\n}", "title": "" }, { "docid": "2a2691b80e22e741c87f7a77756b6e3a", "score": "0.42926377", "text": "func (t *Template) GetSageMakerPipelineWithName(name string) (*sagemaker.Pipeline, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *sagemaker.Pipeline:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type sagemaker.Pipeline not found\", name)\n}", "title": "" }, { "docid": "d2cc9674cbd1de5f8ad8d5141500a64a", "score": "0.42865553", "text": "func (t *Template) GetBatchSchedulingPolicyWithName(name string) (*batch.SchedulingPolicy, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *batch.SchedulingPolicy:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type batch.SchedulingPolicy not found\", name)\n}", "title": "" }, { "docid": "ecde53dc7a820ab6081de871b0bf49e0", "score": "0.42862284", "text": "func (t *Template) GetDataBrewJobWithName(name string) (*databrew.Job, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *databrew.Job:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type databrew.Job not found\", name)\n}", "title": "" }, { "docid": "4458233508e3a19026bb33a2f47c4506", "score": "0.4283047", "text": "func (t *Template) GetStepFunctionsStateMachineVersionWithName(name string) (*stepfunctions.StateMachineVersion, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *stepfunctions.StateMachineVersion:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type stepfunctions.StateMachineVersion not found\", name)\n}", "title": "" }, { "docid": "d5e6d86842e25fa83ba9e05af8c17bd7", "score": "0.42821535", "text": "func (t *Template) GetLambdaVersionWithName(name string) (*lambda.Version, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *lambda.Version:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type lambda.Version not found\", name)\n}", "title": "" }, { "docid": "827737e33400c28efa22b6ac572f742b", "score": "0.42743018", "text": "func (t *Template) GetCloudFormationHookTypeConfigWithName(name string) (*cloudformation.HookTypeConfig, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *cloudformation.HookTypeConfig:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type cloudformation.HookTypeConfig not found\", name)\n}", "title": "" }, { "docid": "4041e2d04aee49b130fc9967209b7c24", "score": "0.427143", "text": "func (t *Template) GetAmplifyUIBuilderFormWithName(name string) (*amplifyuibuilder.Form, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *amplifyuibuilder.Form:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type amplifyuibuilder.Form not found\", name)\n}", "title": "" }, { "docid": "0de02cbf977f34767a444195f721c207", "score": "0.4271154", "text": "func (t *Template) GetSageMakerCodeRepositoryWithName(name string) (*sagemaker.CodeRepository, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *sagemaker.CodeRepository:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type sagemaker.CodeRepository not found\", name)\n}", "title": "" }, { "docid": "56d36d304f1d2166e564e6caa4d2d510", "score": "0.4267936", "text": "func (c *CLI) KubeFramework() *framework.Framework {\n\treturn c.kubeFramework\n}", "title": "" }, { "docid": "48cdaef5ee889f51049e271b723a48da", "score": "0.42618605", "text": "func (t *Template) GetMediaConvertQueueWithName(name string) (*mediaconvert.Queue, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *mediaconvert.Queue:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type mediaconvert.Queue not found\", name)\n}", "title": "" }, { "docid": "e829c5370a049174422e95b0e1898a5c", "score": "0.4259483", "text": "func (t *Template) GetDataBrewScheduleWithName(name string) (*databrew.Schedule, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *databrew.Schedule:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type databrew.Schedule not found\", name)\n}", "title": "" }, { "docid": "f24efa9b2fd60034e908d0345682ae9f", "score": "0.42556262", "text": "func (t *Template) GetLightsailBucketWithName(name string) (*lightsail.Bucket, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *lightsail.Bucket:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type lightsail.Bucket not found\", name)\n}", "title": "" }, { "docid": "01ce5e43490fa8a6f4ea9f043772e1cd", "score": "0.42518726", "text": "func (t *Template) GetApiGatewayResourceWithName(name string) (*apigateway.Resource, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *apigateway.Resource:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type apigateway.Resource not found\", name)\n}", "title": "" }, { "docid": "dd7cc066c845373b37f865d8d66f97b4", "score": "0.42502788", "text": "func (t *Template) GetSageMakerFeatureGroupWithName(name string) (*sagemaker.FeatureGroup, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *sagemaker.FeatureGroup:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type sagemaker.FeatureGroup not found\", name)\n}", "title": "" }, { "docid": "b29099e2e86d76fd1e9ef046d8b61c2b", "score": "0.4247779", "text": "func (t *Template) GetQuickSightTemplateWithName(name string) (*quicksight.Template, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *quicksight.Template:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type quicksight.Template not found\", name)\n}", "title": "" }, { "docid": "22c5dd7fc51161cf158d1407725e9f14", "score": "0.42404112", "text": "func (t *Template) GetAmplifyUIBuilderThemeWithName(name string) (*amplifyuibuilder.Theme, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *amplifyuibuilder.Theme:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type amplifyuibuilder.Theme not found\", name)\n}", "title": "" }, { "docid": "2fedec74f822de133b551ac588c83625", "score": "0.4235557", "text": "func (t *Template) GetGlueJobWithName(name string) (*glue.Job, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *glue.Job:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type glue.Job not found\", name)\n}", "title": "" }, { "docid": "6b657433d56fe9a3dc362f28ba147e03", "score": "0.42347932", "text": "func (t *Template) GetWAFRegionalByteMatchSetWithName(name string) (*wafregional.ByteMatchSet, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *wafregional.ByteMatchSet:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type wafregional.ByteMatchSet not found\", name)\n}", "title": "" }, { "docid": "a9f642c9ad7cd049a5ec1bdc5f96a158", "score": "0.4226931", "text": "func (t *Template) GetFMSResourceSetWithName(name string) (*fms.ResourceSet, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *fms.ResourceSet:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type fms.ResourceSet not found\", name)\n}", "title": "" }, { "docid": "be5f4876b31ba09531c778d24ea7804e", "score": "0.42172608", "text": "func (t *Template) GetConnectQueueWithName(name string) (*connect.Queue, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *connect.Queue:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type connect.Queue not found\", name)\n}", "title": "" }, { "docid": "492afe8fa93bd447f59f879f8a126f18", "score": "0.42158175", "text": "func (t *Template) GetApiGatewayDeploymentWithName(name string) (*apigateway.Deployment, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *apigateway.Deployment:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type apigateway.Deployment not found\", name)\n}", "title": "" }, { "docid": "3a8197014fd16bced0415fb2156db0c6", "score": "0.42155966", "text": "func (t *Template) GetApiGatewayRestApiWithName(name string) (*apigateway.RestApi, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *apigateway.RestApi:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type apigateway.RestApi not found\", name)\n}", "title": "" }, { "docid": "fe207933f1baa97cbdbbf25b8ebd02be", "score": "0.42131883", "text": "func (t *Template) GetLambdaLayerVersionWithName(name string) (*lambda.LayerVersion, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *lambda.LayerVersion:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type lambda.LayerVersion not found\", name)\n}", "title": "" }, { "docid": "ea043415b2f13104a13b41fa157ad962", "score": "0.42131072", "text": "func (t *Template) GetTransferWorkflowWithName(name string) (*transfer.Workflow, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *transfer.Workflow:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type transfer.Workflow not found\", name)\n}", "title": "" }, { "docid": "0db9160741bbf734df8f68ef94d3f470", "score": "0.4212722", "text": "func (t *Template) GetGlueTableWithName(name string) (*glue.Table, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *glue.Table:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type glue.Table not found\", name)\n}", "title": "" }, { "docid": "0187d38c263950625d07544ab562413f", "score": "0.4205091", "text": "func (t *Template) GetApiGatewayV2StageWithName(name string) (*apigatewayv2.Stage, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *apigatewayv2.Stage:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type apigatewayv2.Stage not found\", name)\n}", "title": "" }, { "docid": "7e8254a92d68138dee15222375fa83b1", "score": "0.41997436", "text": "func (t *Template) GetSQSQueueWithName(name string) (*sqs.Queue, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *sqs.Queue:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type sqs.Queue not found\", name)\n}", "title": "" }, { "docid": "7ddc16a12b2f7712add308868c59a71f", "score": "0.41967234", "text": "func (c *FakeWorkloads) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Workload, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewGetAction(workloadsResource, c.ns, name), &v1alpha1.Workload{})\n\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\treturn obj.(*v1alpha1.Workload), err\n}", "title": "" }, { "docid": "c7a0d0784a455cfd698f1ca7665a549a", "score": "0.41808796", "text": "func (t *Template) GetSSMPatchBaselineWithName(name string) (*ssm.PatchBaseline, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *ssm.PatchBaseline:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type ssm.PatchBaseline not found\", name)\n}", "title": "" }, { "docid": "6bad2df921c7cb73b5805a0b31bd8e40", "score": "0.41708553", "text": "func (c *Client) GetTemplateByName(name string) (*Template, error) {\n\ttemps, err := c.GetTemplates()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar ret Template\n\tn := 0\n\tfor _, t := range temps {\n\t\tif strings.HasPrefix(t.Name, name) {\n\t\t\tn = n + 1\n\t\t\tret = t\n\t\t}\n\t}\n\n\tif n > 1 {\n\t\treturn nil, fmt.Errorf(\"Found more than one Template. Redefine!\")\n\t}\n\n\tif n == 0 {\n\t\treturn nil, fmt.Errorf(\"Could not find Template with name '%s'\", name)\n\t}\n\n\treturn &ret, nil\n}", "title": "" }, { "docid": "21c68314f672df63ab3fd08aa16a8496", "score": "0.41666988", "text": "func (ds *dataSvcImpl) GetBackend(name string) (*Backend, *Error) {\n\treturn ds.db.GetBackend(name)\n}", "title": "" }, { "docid": "0699979ff7252b3c1d8f4362e4187983", "score": "0.41622305", "text": "func (t *Template) GetWAFSqlInjectionMatchSetWithName(name string) (*waf.SqlInjectionMatchSet, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *waf.SqlInjectionMatchSet:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type waf.SqlInjectionMatchSet not found\", name)\n}", "title": "" }, { "docid": "fc7b52fda407f8f3bee925c430299b07", "score": "0.41517237", "text": "func (t *Template) GetLakeFormationTagWithName(name string) (*lakeformation.Tag, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *lakeformation.Tag:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type lakeformation.Tag not found\", name)\n}", "title": "" }, { "docid": "81847bb1222523bfe8efdca9f38937ea", "score": "0.41491184", "text": "func (t *Template) GetGlueClassifierWithName(name string) (*glue.Classifier, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *glue.Classifier:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type glue.Classifier not found\", name)\n}", "title": "" }, { "docid": "929d48b486a9a7c3b7a2f01101ef0d59", "score": "0.41456348", "text": "func (t *Template) GetAppRunnerServiceWithName(name string) (*apprunner.Service, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *apprunner.Service:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type apprunner.Service not found\", name)\n}", "title": "" }, { "docid": "fb3837f1ef9e4a8dbed0cc19e18e902c", "score": "0.41408724", "text": "func (t *Template) GetSageMakerProjectWithName(name string) (*sagemaker.Project, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *sagemaker.Project:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type sagemaker.Project not found\", name)\n}", "title": "" }, { "docid": "4859043056d4aab666184144f2b0751b", "score": "0.41400227", "text": "func (t *Template) GetServerlessApplicationWithName(name string) (*serverless.Application, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *serverless.Application:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type serverless.Application not found\", name)\n}", "title": "" }, { "docid": "78419f0e3e7cf0780cc4bf7ff9475d49", "score": "0.41332948", "text": "func (t *Template) GetImageBuilderImagePipelineWithName(name string) (*imagebuilder.ImagePipeline, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *imagebuilder.ImagePipeline:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type imagebuilder.ImagePipeline not found\", name)\n}", "title": "" }, { "docid": "74612c1d6f1f8302d1fa0d66276dbe1d", "score": "0.4132054", "text": "func (db *BackupDatabase) GetByName(name string) *Backup {\n\tdb.mutex.Lock()\n\tdefer db.mutex.Unlock()\n\n\tbackup, exists := db.db[name]\n\tif !exists {\n\t\treturn nil\n\t}\n\treturn backup\n}", "title": "" }, { "docid": "7a2f54c0999d3732bd052b862a4280b7", "score": "0.41313064", "text": "func (t *Template) GetIoTTwinMakerSceneWithName(name string) (*iottwinmaker.Scene, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *iottwinmaker.Scene:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type iottwinmaker.Scene not found\", name)\n}", "title": "" }, { "docid": "4c214af1a313674725bdcc565312c476", "score": "0.41304982", "text": "func (t *Template) GetLightsailLoadBalancerWithName(name string) (*lightsail.LoadBalancer, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *lightsail.LoadBalancer:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type lightsail.LoadBalancer not found\", name)\n}", "title": "" }, { "docid": "c5f754c9c979ffa8cea061a714d568e4", "score": "0.41254124", "text": "func (t *Template) GetGlueSchemaVersionWithName(name string) (*glue.SchemaVersion, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *glue.SchemaVersion:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type glue.SchemaVersion not found\", name)\n}", "title": "" }, { "docid": "73f308ea4a8f05b8c059a3f95c738dab", "score": "0.4124642", "text": "func (t *Template) GetM2ApplicationWithName(name string) (*m2.Application, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *m2.Application:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type m2.Application not found\", name)\n}", "title": "" }, { "docid": "af73c0b7876555e71d7d414cb4c7da81", "score": "0.41217396", "text": "func (t *Template) GetElasticBeanstalkApplicationVersionWithName(name string) (*elasticbeanstalk.ApplicationVersion, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *elasticbeanstalk.ApplicationVersion:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type elasticbeanstalk.ApplicationVersion not found\", name)\n}", "title": "" }, { "docid": "7f213579d1389da310a4ade4131916ba", "score": "0.41184992", "text": "func (s backupBatchNamespaceLister) Get(name string) (*v1beta1.BackupBatch, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1beta1.Resource(\"backupbatch\"), name)\n\t}\n\treturn obj.(*v1beta1.BackupBatch), nil\n}", "title": "" }, { "docid": "e7f9358ba0b6d756867e61d2ee73ef84", "score": "0.41019827", "text": "func Get(c context.Context) B {\n\tif f, ok := c.Value(&configBackendKey).(Factory); ok {\n\t\treturn f(c)\n\t}\n\tpanic(\"no Backend factory is installed in the Context\")\n}", "title": "" }, { "docid": "4e13408a37e1e6d69c4ced30842aac0d", "score": "0.41009283", "text": "func (f *ZookeeperFrameworkIDState) Get() *mesos.FrameworkID {\n\tif f.current != nil {\n\t\treturn f.current\n\t}\n\n\t// log.Debug(\"Finding value\")\n\tb := f.cache.Get()\n\tif len(b) > 0 {\n\t\t// log.Debug(\"We have some data\")\n\t\tnw := frameworkIDFromBytes(b)\n\t\tf.Set(nw)\n\t\treturn nw\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7598fff45395e67e17afa4bae56b87c7", "score": "0.40985563", "text": "func (h *Handler) GetByName(name string) (*appsv1.Deployment, error) {\n\treturn h.clientset.AppsV1().Deployments(h.namespace).Get(h.ctx, name, h.Options.GetOptions)\n}", "title": "" }, { "docid": "fec10fd3012a7a3ca157ff822964980b", "score": "0.40891254", "text": "func (t *Template) GetSageMakerModelPackageWithName(name string) (*sagemaker.ModelPackage, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *sagemaker.ModelPackage:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type sagemaker.ModelPackage not found\", name)\n}", "title": "" }, { "docid": "f65dc17d12bd1bde438b0cd47d8251a3", "score": "0.40882763", "text": "func (t *Template) GetAppStreamAppBlockBuilderWithName(name string) (*appstream.AppBlockBuilder, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *appstream.AppBlockBuilder:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type appstream.AppBlockBuilder not found\", name)\n}", "title": "" }, { "docid": "e28e25abbec6518f547bf4fc3350201a", "score": "0.40838757", "text": "func (t *Template) GetGlueRegistryWithName(name string) (*glue.Registry, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *glue.Registry:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type glue.Registry not found\", name)\n}", "title": "" }, { "docid": "f7158cc643d0bf881c6a9d8c14c71440", "score": "0.4079192", "text": "func (t *Template) GetCodePipelinePipelineWithName(name string) (*codepipeline.Pipeline, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *codepipeline.Pipeline:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type codepipeline.Pipeline not found\", name)\n}", "title": "" }, { "docid": "54c16a47e8dc628199cb3f9a07a1ddb1", "score": "0.40692014", "text": "func (t *Template) GetRDSDBProxyWithName(name string) (*rds.DBProxy, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *rds.DBProxy:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type rds.DBProxy not found\", name)\n}", "title": "" }, { "docid": "347a27fe0a0727a796be70376466c532", "score": "0.40682864", "text": "func (t *Template) GetPersonalizeSchemaWithName(name string) (*personalize.Schema, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *personalize.Schema:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type personalize.Schema not found\", name)\n}", "title": "" }, { "docid": "1210e0b40247a528541b98c0a0bade02", "score": "0.40635195", "text": "func (t *Template) GetServerlessStateMachineWithName(name string) (*serverless.StateMachine, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *serverless.StateMachine:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type serverless.StateMachine not found\", name)\n}", "title": "" }, { "docid": "8ce32cbce468112448367fad0a2c8a79", "score": "0.4050716", "text": "func (t *Template) GetIoTJobTemplateWithName(name string) (*iot.JobTemplate, error) {\n\tif untyped, ok := t.Resources[name]; ok {\n\t\tswitch resource := untyped.(type) {\n\t\tcase *iot.JobTemplate:\n\t\t\treturn resource, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %q of type iot.JobTemplate not found\", name)\n}", "title": "" } ]
8d4abc5ce58cf7f434442e183bce67b0
MkdirAll creates a directory named path, along with any necessary parents, and returns nil, or else returns an error. The permission bits perm are used for all directories that MkdirAll creates. If path is already a directory, MkdirAll does nothing and returns nil.
[ { "docid": "adf02234a91af46dc3614e3b6e83712f", "score": "0.77614635", "text": "func MkdirAll(path string, perm os.FileMode) error {\n\treturn os.MkdirAll(fixpath(path), perm)\n}", "title": "" } ]
[ { "docid": "460c4bd255c28a7843e833952403c9fe", "score": "0.79631555", "text": "func (t *Extractor) MkdirAll(path string, perm os.FileMode) error {\n\t// fast path: if we can tell whether path is a directory or file, stop with success or error.\n\tdir, err := os.Stat(path)\n\tif err == nil {\n\t\tif dir.IsDir() {\n\t\t\treturn nil\n\t\t}\n\t\treturn &os.PathError{Op: \"mkdir\", Path: path, Err: syscall.ENOTDIR}\n\t}\n\n\t// avoid string comparison: dir == t.outputDir, since dir is already checked to has prefix, length check is enough\n\tminLength := len(t.outputDir)\n\n\t// slow path: make sure parent exists and then call Mkdir for path.\n\ti := len(path)\n\tfor i > minLength && !os.IsPathSeparator(path[i-1]) {\n\t\ti--\n\t}\n\n\tif i > minLength {\n\t\t// create parent\n\t\tparentPath := path[:i-1]\n\t\t_, isDirCreated := t.createdDirs[parentPath]\n\t\tif !isDirCreated {\n\t\t\terr = t.MkdirAll(parentPath, perm)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\t// parent now exists\n\terr = os.Mkdir(path, perm)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "1c0ac829e5c927a332cd93e700a7aab3", "score": "0.79475516", "text": "func (b *Builder) MkdirAll(fileSystem vfs.FS, path string, perm fs.FileMode) error {\n\t// Check path.\n\tinfo, err := fileSystem.Lstat(path)\n\tswitch {\n\tcase err != nil && errors.Is(err, fs.ErrNotExist):\n\t\t// path does not exist, fallthrough to create.\n\tcase err == nil && info.IsDir():\n\t\t// path already exists and is a directory.\n\t\treturn nil\n\tcase err == nil && !info.IsDir():\n\t\t// path already exists, but is not a directory.\n\t\treturn err\n\tdefault:\n\t\t// Some other error.\n\t\treturn err\n\t}\n\n\t// Create path.\n\tif b.verbose {\n\t\tlog.Printf(\"mkdir -p -m 0%o %s\", perm&^b.umask, path)\n\t}\n\treturn vfs.MkdirAll(fileSystem, path, perm&^b.umask)\n}", "title": "" }, { "docid": "9731ddc47b787302cd9c963af5500923", "score": "0.7858048", "text": "func (c *Client) MkdirAll(path string) error {\n\t// Most of this code mimics https://golang.org/src/os/path.go?s=514:561#L13\n\t// Fast path: if we can tell whether path is a directory or file, stop with success or error.\n\tdir, err := c.Stat(path)\n\tif err == nil {\n\t\tif dir.IsDir() {\n\t\t\treturn nil\n\t\t}\n\t\treturn &os.PathError{Op: \"mkdir\", Path: path, Err: syscall.ENOTDIR}\n\t}\n\n\t// Slow path: make sure parent exists and then call Mkdir for path.\n\ti := len(path)\n\tfor i > 0 && os.IsPathSeparator(path[i-1]) { // Skip trailing path separator.\n\t\ti--\n\t}\n\n\tj := i\n\tfor j > 0 && !os.IsPathSeparator(path[j-1]) { // Scan backward over element.\n\t\tj--\n\t}\n\n\tif j > 1 {\n\t\t// Create parent\n\t\terr = c.MkdirAll(path[0 : j-1])\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// Parent now exists; invoke Mkdir and use its result.\n\terr = c.Mkdir(path)\n\tif err != nil {\n\t\t// Handle arguments like \"foo/.\" by\n\t\t// double-checking that directory doesn't exist.\n\t\tdir, err1 := c.Lstat(path)\n\t\tif err1 == nil && dir.IsDir() {\n\t\t\treturn nil\n\t\t}\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4f97e2c6fef70928181e7059b047a82d", "score": "0.77865887", "text": "func MkdirAll(ctx context.Context, fs webdav.FileSystem, path string, perm os.FileMode) error {\n\t// Fast path: if we can tell whether path is a directory or file, stop with success or error.\n\tdir, err := fs.Stat(ctx, path)\n\tif err == nil {\n\t\tif dir.IsDir() {\n\t\t\treturn nil\n\t\t}\n\t\treturn &os.PathError{Op: \"mkdir\", Path: path, Err: fmt.Errorf(\"not a directory\")}\n\t}\n\n\t// Slow path: make sure parent exists and then call Mkdir for path.\n\ti := len(path)\n\tfor i > 0 && path[i-1] == '/' { // Skip trailing path separator.\n\t\ti--\n\t}\n\n\tj := i\n\tfor j > 0 && path[j-1] != '/' { // Scan backward over element.\n\t\tj--\n\t}\n\n\tif j > 1 {\n\t\t// Create parent.\n\t\terr = MkdirAll(ctx, fs, path[0:j-1], perm)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// Parent now exists; invoke Mkdir and use its result.\n\terr = fs.Mkdir(ctx, path, perm)\n\tif err != nil {\n\t\t// Handle arguments like \"foo/.\" by double-checking that directory doesn't exist.\n\t\tdir, err1 := fs.Stat(ctx, path)\n\t\tif err1 == nil && dir.IsDir() {\n\t\t\treturn nil\n\t\t}\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e12e36998fe69f0f24a99f5a8d745e22", "score": "0.7543024", "text": "func mkdirAll(dirPath string, mode os.FileMode) (err error) {\n\tif dirPath == \"\" {\n\t\treturn errInvalidArgument\n\t}\n\n\tif err = checkPathLength(dirPath); err != nil {\n\t\treturn err\n\t}\n\n\tif err = reliableMkdirAll(dirPath, mode); err != nil {\n\t\t// File path cannot be verified since one of the parents is a file.\n\t\tif isSysErrNotDir(err) {\n\t\t\treturn errFileAccessDenied\n\t\t} else if isSysErrPathNotFound(err) {\n\t\t\t// This is a special case should be handled only for\n\t\t\t// windows, because windows API does not return \"not a\n\t\t\t// directory\" error message. Handle this specifically here.\n\t\t\treturn errFileAccessDenied\n\t\t}\n\t\treturn osErrToFileErr(err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "18ccb9ee20ec19d03ea0fe2944245d52", "score": "0.7481795", "text": "func MakeAll(path string) error {\n\t// check\n\tif IsPathExist(path) {\n\t\treturn nil\n\t}\n\terr := os.MkdirAll(path, os.ModePerm) // 0755\n\tif err != nil {\n\t\treturn err\n\t}\n\t// check again\n\tif !IsPathExist(path) {\n\t\treturn fmt.Errorf(\"Makeall: fail to create %q\", path)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3cfa307f9ef4e8bd1863baa4806ae549", "score": "0.7446504", "text": "func (m *FileSystem) MkdirAll(path string, perm os.FileMode) error {\n\treturn os.MkdirAll(path, perm)\n}", "title": "" }, { "docid": "503f5397be903b61a6c699c1a32e25ea", "score": "0.74266636", "text": "func (m *FS) MkdirAll(path string, perm fs.FileMode) error {\n\treturn m.root.MkdirAll(cleanPath(path), perm)\n}", "title": "" }, { "docid": "95f1b644d313465b400ea79e3516c651", "score": "0.74155647", "text": "func MkdirAll(path string, dirMode os.FileMode) error {\n\treturn os.MkdirAll(path, dirMode)\n}", "title": "" }, { "docid": "9feacc4064de83dea0b797e5dc4921d2", "score": "0.73104984", "text": "func MkdirAll(dir string) error {\n\t// If path is already a directory, MkdirAll does nothing\n\t// and returns nil.\n\terr := os.MkdirAll(dir, PrivateDirMode)\n\tif err != nil {\n\t\t// if mkdirAll(\"a/text\") and \"text\" is not\n\t\t// a directory, this will return syscall.ENOTDIR\n\t\treturn err\n\t}\n\treturn DirWritable(dir)\n}", "title": "" }, { "docid": "4673ced68490e5c2fb5b0f7b98146168", "score": "0.728451", "text": "func (fos *FilesOpStruct) MkdirAll(path string, perm os.FileMode) error {\n\n\tdir, err := os.Stat(path)\n\tif err == nil {\n\t\tif dir.IsDir() {\n\t\t\treturn nil\n\t\t}\n\t\treturn &os.PathError{\"mkdir\", path, syscall.ENOTDIR}\n\t}\n\n\ti := len(path) // Skip trailing path separator.\n\tfor i > 0 && os.IsPathSeparator(path[i-1]) {\n\t\ti--\n\t}\n\n\tj := i // Scan backward over element.\n\tfor j > 0 && !os.IsPathSeparator(path[j-1]) {\n\t\tj--\n\t}\n\n\tif j > 1 {\n\t\terr = fos.MkdirAll(path[:j-1], perm)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif err = os.Mkdir(path, perm); err != nil {\n\n\t\tdir, err1 := os.Lstat(path)\n\t\tif err1 == nil && dir.IsDir() {\n\t\t\treturn nil\n\t\t}\n\t\treturn err\n\t}\n\n\t// Change dir owner if required\n\tif err = fos.SetOwner(path); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "0291df61662173a5b932a204354dff3d", "score": "0.7273896", "text": "func mkdirAll(path string) error {\n\tvar err error\n\t// check path exist or create\n\tif isExist(path) == false {\n\t\terr = os.MkdirAll(path, 0755)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\t// check path writable\n\tif isWritable(path) == false {\n\t\treturn errors.New(\"path [\" + path + \"] is not writable!\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a8523d8bfc38cea942ac4cafeaa368d6", "score": "0.7237919", "text": "func (dfs *DiskFS) MkdirAll(path string, perm os.FileMode) error {\n\treturn os.MkdirAll(path, perm)\n}", "title": "" }, { "docid": "cfd5a86204ce27b5a31e72e02daf720e", "score": "0.7218668", "text": "func (l Local) MkdirAll(ctx context.Context, path string) error {\n\treturn os.MkdirAll(AbsPath(l, path), 0777)\n}", "title": "" }, { "docid": "1ba7c09efdb757c39bfba2312be4a1de", "score": "0.71299875", "text": "func (m *RealFS) MkdirAll(path string, perm os.FileMode) error {\n\treturn os.MkdirAll(path, perm)\n}", "title": "" }, { "docid": "14394095bd5a1c0063e741dfbde69121", "score": "0.71062857", "text": "func MkdirAll(dir string, perm os.FileMode, uid, gid int) error {\n\tif _, err := os.Stat(strings.TrimRight(dir, \"/\")); os.IsNotExist(err) {\n\t\tparent, _ := path.Split(dir)\n\t\terr = MkdirAll(strings.TrimRight(parent, \"/\"), perm, uid, gid)\n\t\tif err != nil && !os.IsExist(err) {\n\t\t\tlogger.Errorf(\"mkdirall error: %s\", err)\n\t\t\treturn err\n\t\t}\n\t\terr = os.Mkdir(dir, perm)\n\t\tif err != nil && !os.IsExist(err) {\n\t\t\tlogger.Errorf(\"mkdirall error: %s\", err)\n\t\t\treturn err\n\t\t}\n\t\treturn os.Chown(dir, uid, gid)\n\t} else if err != nil {\n\t\tlogger.Errorf(\"mkdirall error: %s\", err)\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "60a08eccaecc599f13a7051b3564c2cc", "score": "0.7049117", "text": "func (s *FileSystemBuilder) mkdirAll(path string, mode os.FileMode, atime, mtime time.Time) (err error) {\n\tpath = filepath.Clean(string(filepath.Separator) + path)\n\tabsPath := filepath.Join(s.root, path)\n\tst, err := os.Stat(absPath)\n\tif err == nil {\n\t\tif st.IsDir() {\n\t\t\treturn\n\t\t} else {\n\t\t\tif err = s.fsEval.Remove(absPath); err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t} else if !os.IsNotExist(err) {\n\t\treturn\n\t}\n\tif err = s.mkdirAll(filepath.Dir(path), mode, atime, mtime); err != nil {\n\t\treturn\n\t}\n\tif err = s.fsEval.Mkdir(absPath, mode); err != nil {\n\t\treturn\n\t}\n\tif err = s.restoreTimeMetadata(absPath, atime, mtime); err == nil {\n\t\ts.files = append(s.files, path)\n\t}\n\treturn\n}", "title": "" }, { "docid": "0f55ed9b86b8cd5633dd678125d6582a", "score": "0.70295364", "text": "func MkdirAllIfNotExist(path string) error {\n\tif IsPathExist(path) {\n\t\treturn nil\n\t}\n\treturn mkdirSync(path)\n}", "title": "" }, { "docid": "17c21f659d97782b08f8e553c0edefcf", "score": "0.6991971", "text": "func MkdirAllNewAs(path string, mode os.FileMode, ownerUID, ownerGID int) error {\n\t// make an array containing the original path asked for, plus (for mkAll == true)\n\t// all path components leading up to the complete path that don't exist before we MkdirAll\n\t// so that we can chown all of them properly at the end. If chownExisting is false, we won't\n\t// chown the full directory path if it exists\n\tvar paths []string\n\tif _, err := os.Stat(path); err != nil && os.IsNotExist(err) {\n\t\tpaths = []string{path}\n\t} else if err == nil {\n\t\t// nothing to do; directory path fully exists already\n\t\treturn nil\n\t}\n\n\t// walk back to \"/\" looking for directories which do not exist\n\t// and add them to the paths array for chown after creation\n\tdirPath := path\n\tfor {\n\t\tdirPath = filepath.Dir(dirPath)\n\t\tif dirPath == \"/\" {\n\t\t\tbreak\n\t\t}\n\t\tif _, err := os.Stat(dirPath); err != nil && os.IsNotExist(err) {\n\t\t\tpaths = append(paths, dirPath)\n\t\t}\n\t}\n\n\tif err := os.MkdirAll(path, mode); err != nil && !os.IsExist(err) {\n\t\treturn err\n\t}\n\n\t// even if it existed, we will chown the requested path + any subpaths that\n\t// didn't exist when we called MkdirAll\n\tfor _, pathComponent := range paths {\n\t\tif err := os.Chown(pathComponent, ownerUID, ownerGID); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5d2f6744d08bd6164a4c03b04415d5c0", "score": "0.6960564", "text": "func (t *Methods) MkdirAll(arguments *args.MkdirArgs, reply *int) (err error) {\n\tmainthread.Execute(func() {\n\t\toldmask := syscall.Umask(0)\n\t\terr = os.MkdirAll(arguments.Path, arguments.Perm)\n\t\tsyscall.Umask(oldmask)\n\t})\n\treturn err\n}", "title": "" }, { "docid": "3ba47ab10eb7a3e65a1a87e8e668b2bd", "score": "0.689891", "text": "func MkdirAllPanic(path string, perm os.FileMode) {\n\terr := os.MkdirAll(path, perm)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "ead38489a02a15227321923a757ed1e1", "score": "0.6776864", "text": "func (realFS) MkdirAll(name string) error {\n\treturn os.MkdirAll(name, 0777|os.ModeDir)\n}", "title": "" }, { "docid": "adfe6a15cbd28ef8180932c9a61ec4a8", "score": "0.6734236", "text": "func MakeAll(name string) error {\n\treturn os.MkdirAll(name, DefaultPermissionDirectory)\n}", "title": "" }, { "docid": "489d06f7c9c45ecddcbccf9fa73e9c0e", "score": "0.66572946", "text": "func (nt *Tree) MkdirAll(path string) (*Node, error) {\n\tvar (\n\t\terr error\n\t\tfolderNode = nt.Node\n\t\tlogLevel = log.GetLevel()\n\t\tnextNode *Node\n\t\tnode *Node\n\t)\n\n\t// Short-circuit if the node already exists!\n\t{\n\t\tlog.SetLevel(log.DisableLogLevel)\n\t\tnode, err = nt.FindNode(path)\n\t\tlog.SetLevel(logLevel)\n\t}\n\tif err == nil {\n\t\tif node.IsDir() {\n\t\t\treturn node, err\n\t\t}\n\t\tlog.Errorf(\"%s: %s\", constants.ErrFileExistsAndIsNotFolder, path)\n\t\treturn nil, constants.ErrFileExistsAndIsNotFolder\n\t}\n\n\t// chop off the first /.\n\tif strings.HasPrefix(path, \"/\") {\n\t\tpath = path[1:]\n\t}\n\tparts := strings.Split(path, \"/\")\n\tif len(parts) == 0 {\n\t\tlog.Errorf(\"%s: %s\", constants.ErrCannotCreateRootNode, path)\n\t\treturn nil, constants.ErrCannotCreateRootNode\n\t}\n\n\tfor i, part := range parts {\n\t\t{\n\t\t\tlog.SetLevel(log.DisableLogLevel)\n\t\t\tnextNode, err = nt.FindNode(strings.Join(parts[:i+1], \"/\"))\n\t\t\tlog.SetLevel(logLevel)\n\t\t}\n\t\tif err != nil && err != constants.ErrNodeNotFound {\n\t\t\treturn nil, err\n\t\t}\n\t\tif err == constants.ErrNodeNotFound {\n\t\t\tnextNode, err = folderNode.CreateFolder(part)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\n\t\tif !nextNode.IsDir() {\n\t\t\tlog.Errorf(\"%s: %s\", constants.ErrCannotCreateANodeUnderAFile, strings.Join(parts[:i+1], \"/\"))\n\t\t\treturn nil, constants.ErrCannotCreateANodeUnderAFile\n\t\t}\n\n\t\tfolderNode = nextNode\n\t}\n\n\treturn folderNode, nil\n}", "title": "" }, { "docid": "3ea26ec76248b294ff20284d41c92b18", "score": "0.6630282", "text": "func MkdirAll(dir string) error {\n\treturn os.MkdirAll(DataPath(dir), 0777)\n}", "title": "" }, { "docid": "8768faef57b176a20b2d9d0b335627c1", "score": "0.65680987", "text": "func (file File) MakeAllDirs(perm ...Permissions) error {\n\tif file == \"\" {\n\t\treturn ErrEmptyPath\n\t}\n\tif info, e := file.Stat(); e == nil {\n\t\t// File exists\n\t\tif !info.IsDir() {\n\t\t\treturn NewErrIsNotDirectory(file)\n\t\t}\n\t\treturn nil // File is already a directory\n\t}\n\n\tdir, name := file.DirAndName()\n\tif name != \"\" {\n\t\t// if name != \"\" then dir is not the root\n\t\t// so we can attempt to make the dir\n\t\t// by recursively calling MakeAllDirs\n\t\terr := dir.MakeAllDirs(perm...)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn file.MakeDir(perm...)\n}", "title": "" }, { "docid": "a6dc59ff5373018006780abeecf48fd5", "score": "0.6539192", "text": "func MkdirAllWithInheritedOwner(path string, perm os.FileMode) error {\n\tif len(path) == 0 {\n\t\treturn fmt.Errorf(\"the path is empty\")\n\t}\n\n\t// By default, use the uid and gid of the calling process.\n\tvar uid = os.Getuid()\n\tvar gid = os.Getgid()\n\n\tpaths := getAllParentPaths(path)\n\tfor _, curPath := range paths {\n\t\tinfo, err := os.Stat(curPath)\n\n\t\tif err != nil {\n\t\t\tif err = os.MkdirAll(curPath, perm); err != nil {\n\t\t\t\treturn fmt.Errorf(\"mkdir call failed: %v\", err.Error())\n\t\t\t}\n\t\t\tif err = syscall.Chown(curPath, uid, gid); err != nil {\n\t\t\t\treturn fmt.Errorf(\"chown syscall failed: %v\", err.Error())\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tif !info.IsDir() {\n\t\t\treturn &os.PathError{Op: \"mkdir\", Path: curPath, Err: syscall.ENOTDIR}\n\t\t}\n\t\tif stat, ok := info.Sys().(*syscall.Stat_t); ok {\n\t\t\tuid = int(stat.Uid)\n\t\t\tgid = int(stat.Gid)\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"fail to retrieve the uid and gid of path %s\", curPath)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d6f1ddc94c4f4a6bf323502e3a1c94b9", "score": "0.65265274", "text": "func MkDir(path string, mode os.FileMode) (err error) {\n\terr = os.MkdirAll(path, mode)\n\treturn err\n}", "title": "" }, { "docid": "d137ccf15631b586ee2db617efee697e", "score": "0.6502594", "text": "func (ep ExecPrefix) MkdirAll(ctx context.Context, path string) error {\n\treturn forwardMkdirAll(ctx, ep.Biome, path)\n}", "title": "" }, { "docid": "e4fc276a788a5586838ba32a9ccfe5e9", "score": "0.64317954", "text": "func (f relFsOnDisk) MkdirAll(name string) error {\n\tpath := filepath.Join(f.basePath, name)\n\treturn f.fs.MkdirAll(path)\n}", "title": "" }, { "docid": "7e9304923b32f97d03d8841122a0658f", "score": "0.6417606", "text": "func mkdirAll(dir string) error {\n\tif _, err := os.Stat(dir); os.IsNotExist(err) {\n\t\tif err := os.MkdirAll(dir, 0755); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5114ff54e6566bada9e34021c2479dcb", "score": "0.63916975", "text": "func (rfs *RootFS) MkdirAll(_ string, _ os.FileMode) (err error) {\n\treturn errors.New(\"RootFS cannot mkdir\")\n}", "title": "" }, { "docid": "e8025328156f8993c26b4c20d37dc50e", "score": "0.63474685", "text": "func reliableMkdirAll(dirPath string, mode os.FileMode) (err error) {\n\ti := 0\n\tfor {\n\t\t// Creates all the parent directories, with mode 0777 mkdir honors system umask.\n\t\tif err = MkdirAll(dirPath, mode); err != nil {\n\t\t\t// Retry only for the first retryable error.\n\t\t\tif osIsNotExist(err) && i == 0 {\n\t\t\t\ti++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tbreak\n\t}\n\treturn err\n}", "title": "" }, { "docid": "7114ea3f1e3cc1ffb54e3d50d61ea5df", "score": "0.6321338", "text": "func (context Context) MkdirAll(url string, mode os.FileMode) GError {\n\tvar err *C.GError\n\n\tcURL := (*C.char)(C.CString(url))\n\tdefer C.free(unsafe.Pointer(cURL))\n\n\tret := C.gfal2_mkdir_rec(context.cContext, cURL, C.mode_t(mode), &err)\n\tif ret < 0 {\n\t\treturn errorCtoGo(err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "5d3fb70827a32d2af94789d31a209520", "score": "0.629385", "text": "func MkdirAllFailIfExist(path string) error {\n\tif IsPathExist(path) {\n\t\treturn fmt.Errorf(\"the %q already exists\", path)\n\t}\n\treturn mkdirSync(path)\n}", "title": "" }, { "docid": "0215878535a5ff392e3a349669b15360", "score": "0.6270443", "text": "func MkdirAll(names ...string) {\n\tfor _, name := range names {\n\t\tOK(os.MkdirAll(name, 0700))\n\t}\n}", "title": "" }, { "docid": "3d513b99d910a22938e897199ea022e5", "score": "0.6203698", "text": "func Mkdir(path string) error {\n\tstat, err := os.Lstat(path)\n\tif os.IsNotExist(err) {\n\t\tlog.WithField(\"path\", path).Info(\"Directory doesn't exist, creating it \")\n\t\tif err := os.MkdirAll(path, 0755); err != nil {\n\t\t\tlog.WithFields(log.Fields{\"path\": path,\n\t\t\t\t\"err\": err}).Error(\"Failed to create directory \")\n\t\t\treturn err\n\t\t}\n\t} else if err != nil {\n\t\tlog.WithFields(log.Fields{\"path\": path,\n\t\t\t\"err\": err}).Error(\"Failed to test directory existence \")\n\t\treturn err\n\t}\n\n\tif stat != nil && !stat.IsDir() {\n\t\tmsg := fmt.Sprintf(\"%v already exists and it's not a directory\", path)\n\t\tlog.Error(msg)\n\t\treturn fmt.Errorf(msg)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "109a84d3bd9fe5a3e0cc3ccf05cc0766", "score": "0.61808175", "text": "func (p *p) mkdirAllChown(path string, perm os.FileMode, uid, gid string) error {\n\tif err := os.MkdirAll(path, perm); err != nil {\n\t\treturn err\n\t}\n\n\treturn p.chown(path, uid, gid)\n}", "title": "" }, { "docid": "70e7d5c46f241116e0b0855adecaa3a1", "score": "0.6168989", "text": "func CreateAll(path string) (*os.File, error) {\n\treturn OpenFileAll(path, DefaultFlagCreate, DefaultPermissionDirectory, DefaultPermissionFile)\n}", "title": "" }, { "docid": "b488510a85e21a883da8b01a3e7527a1", "score": "0.6048696", "text": "func MkPathDir(path string) {\n\n\tdirName := ParentDir(path)\n\tif _, e := os.Stat(dirName); e != nil {\n\n\t\tos.MkdirAll(dirName, 0755)\n\t}\n}", "title": "" }, { "docid": "3b0a939b278dd469af5f2458fef05eb0", "score": "0.6033459", "text": "func mustMkdirAll(names ...string) {\n\tfor _, name := range names {\n\t\terr := os.MkdirAll(name, 0700)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6cb706ae50b5e578ef70ceddb6854794", "score": "0.6003165", "text": "func (m *Fs) MkdirAll(name string, mode os.FileMode) error {\n\treturn nil\n}", "title": "" }, { "docid": "bd3853940680588aab1465e93cb55a93", "score": "0.598225", "text": "func Mkdirp(path string) {\n\terr := os.MkdirAll(path, 0777)\n\tif err != nil {\n\t\tlog.Fatalf(\"Error creating path %s, exiting.\", path)\n\t}\n}", "title": "" }, { "docid": "99548545389e1409a98dc241f65ec379", "score": "0.5978378", "text": "func createDirectory(dir string, perms os.FileMode) error {\n\t// This prevents someone passing /path/to/dir and 'dir' not being created\n\t// If two '//' exist, MkdirAll deals it with correctly\n\tdir = dir + \"/\"\n\treturn os.MkdirAll(dir, perms)\n}", "title": "" }, { "docid": "fc8e1e9f8eee9718865859d7c0c2ffa6", "score": "0.59667826", "text": "func ensureDir(path string) error {\n\t_, err := os.Stat(path)\n\tif os.IsNotExist(err) {\n\t\terr = os.MkdirAll(path, 0750)\n\t}\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "cc891749589d8d1334ea727a13055b2f", "score": "0.5928979", "text": "func Mkdir(name string, perm int) Error {\n\te := syscall.Mkdir(name, perm);\n\tif e != 0 {\n\t\treturn &PathError{\"mkdir\", name, Errno(e)}\n\t}\n\treturn nil;\n}", "title": "" }, { "docid": "2353823eb847554d8541ae5de90e63de", "score": "0.5921016", "text": "func CreateDir(path string, createParents bool) error {\n\tif createParents {\n\t\treturn os.MkdirAll(path, 0700)\n\t}\n\treturn os.Mkdir(path, 0700)\n}", "title": "" }, { "docid": "b1397ee0c93d9b8fa94e51c93d70b02e", "score": "0.5904096", "text": "func Mkdir(path string, mode uint32) (err error) {\n\tvar _p0 *byte\n\t_p0, err = BytePtrFromString(path)\n\tif err != nil {\n\t\treturn\n\t}\n\t_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "title": "" }, { "docid": "631f97c35b1a50d7fd313efcda663c8b", "score": "0.58862", "text": "func Mkdirp(dirPath string) error {\n\treturn os.MkdirAll(dirPath, os.ModeDir)\n}", "title": "" }, { "docid": "08d761e72b32c068c1b8ac9e5db6da73", "score": "0.58836854", "text": "func MkDir(path string) error {\n\n\tif s3path(path) {\n\t\ts3log(\"store.MkDir: silently refusing to create unneeded dir path on S3: [%s]\", path)\n\t\treturn nil\n\t}\n\n\treturn os.MkdirAll(path, 0750)\n}", "title": "" }, { "docid": "b33a79b4cfc961afa8abe64665b67de1", "score": "0.58792627", "text": "func CreateDir(path string) {\n\n\t_, err := os.Stat(path)\n \n\tif os.IsNotExist(err) {\n\t\n\t\terrDir := os.MkdirAll(path, 0755)\n\t\tif errDir != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "354f3d5127267d05d7fc1e42d3b094cb", "score": "0.58521247", "text": "func makeDir(path string) {\n\tif _, err := os.Stat(path); os.IsNotExist(err) {\n\t\tos.Mkdir(path, os.ModePerm)\n\t}\n}", "title": "" }, { "docid": "38c75545148dd147fa00298ce2250599", "score": "0.58433706", "text": "func (m *MockOS) MkdirAll(path string, perm os0.FileMode) error {\n\tret := m.ctrl.Call(m, \"MkdirAll\", path, perm)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "efc2f91c7581ad805ccddf94b73fa03f", "score": "0.5840287", "text": "func (mr *MockFSMockRecorder) MkdirAll(path, perm interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"MkdirAll\", reflect.TypeOf((*MockFS)(nil).MkdirAll), path, perm)\n}", "title": "" }, { "docid": "35f6efd00fb50d8bbdadbcf97fb44ff5", "score": "0.58309853", "text": "func mkdirAs(path string, mode os.FileMode, ownerUID, ownerGID int, mkAll bool) error {\n\tif err := system.MkdirAll(path, mode); err != nil && !os.IsExist(err) {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c260901fb74c217c10ba59219099cecf", "score": "0.5824662", "text": "func (b *Builder) Mkdir(fileSystem vfs.FS, path string, perm fs.FileMode) error {\n\tif info, err := fileSystem.Lstat(path); errors.Is(err, fs.ErrNotExist) {\n\t\tif b.verbose {\n\t\t\tlog.Printf(\"mkdir -m 0%o %s\", perm&^b.umask, path)\n\t\t}\n\t\treturn fileSystem.Mkdir(path, perm&^b.umask)\n\t} else if err != nil {\n\t\treturn err\n\t} else if !info.IsDir() {\n\t\treturn fmt.Errorf(\"%s: not a directory\", path)\n\t} else if gotPerm, wantPerm := info.Mode()&fs.ModePerm, perm&^b.umask; !PermEqual(gotPerm, wantPerm) {\n\t\treturn fmt.Errorf(\"%s has permissions 0%o, want 0%o\", path, gotPerm, wantPerm)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "73a0f3a7bbcac32d682642d49f807abf", "score": "0.58204013", "text": "func checkDir(path string) {\n\n\tif len(path) == 0 {\n\t\treturn\n\t}\n\te := os.MkdirAll(path, 0755)\n\tif e != nil {\n\t\tglog.Fatal(e)\n\t}\n}", "title": "" }, { "docid": "a159a8510a4cb37bc8c6425d7fb1dfcf", "score": "0.57547426", "text": "func (m *MockFileSystem) MkdirAll(path string, perm os.FileMode) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"MkdirAll\", path, perm)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "f575749c8d113b10155ef77f5eb72f81", "score": "0.5749439", "text": "func MakeDirs(path string) error {\n\tif err := os.MkdirAll(path, 0755); err != nil {\n\t\treturn errors.Annotate(err, \"\").Err()\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2312b1a58ecaa7afd4fe526a4bf0af80", "score": "0.57431453", "text": "func createPath(path string) error {\n\t_, err := os.Stat(path)\n\n\tif os.IsNotExist(err) {\n\t\terr = os.MkdirAll(path, 0770)\n\t}\n\treturn err\n}", "title": "" }, { "docid": "6df9fbda2934e237a6b71f0306e75542", "score": "0.5714964", "text": "func Mkdir(dirfd int, path string, mode uint32) (err error) {\n\tfor {\n\t\terr = unix.Mkdir(dirfd, path, mode)\n\t\tif err != syscall.EINTR {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "edebc93119d39c2dce2a14638cf6cfb5", "score": "0.57085216", "text": "func createDir(dirname string, permission os.FileMode) {\n\texists, err := fileExists(dirname)\n\tcheckError(err)\n\tif !exists {\n\t\tos.MkdirAll(dirname, permission)\n\t}\n}", "title": "" }, { "docid": "0406610d3a91a0e5e4a6979a207e589e", "score": "0.56880105", "text": "func (f *FileHelperUtil) CreateDir(dirpath string) {\n\n\terr := os.MkdirAll(dirpath, os.FileMode(0511))\n\n\tif err != nil {\n\t\tlog.Println(err)\n\t}\n}", "title": "" }, { "docid": "8a959772dcc4bef9e17b1b754237165c", "score": "0.56840605", "text": "func Mkdir(dirpath string) error {\n\terr := os.Mkdir(dirpath, 0755)\n\tif err != nil && !os.IsExist(err) {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "740be4dc1227959157959a906dd87a17", "score": "0.5681585", "text": "func MakePath(path string) error {\n\tif _, err := os.Stat(path); os.IsNotExist(err) {\n\t\terr := os.MkdirAll(path, 0755)\n\t\tif err != nil {\n\t\t\tfmt.Println(\"ERROR Make Path\", err)\n\t\t}\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "96e99dd6bf5d807e81e68cee87f4f1c9", "score": "0.56780446", "text": "func createDir(dir string, umask uint32) error {\n\tif err := os.MkdirAll(dir, os.FileMode(0777&^umask)); err != nil && !os.IsExist(err) {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "99ea9330bbe665e061b6799dcb90de5a", "score": "0.56776065", "text": "func (mr *MockFileSystemMockRecorder) MkdirAll(path, perm interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"MkdirAll\", reflect.TypeOf((*MockFileSystem)(nil).MkdirAll), path, perm)\n}", "title": "" }, { "docid": "8b3d0cc31846d17f4a7719823cda8f8f", "score": "0.56525636", "text": "func (m *MockFS) MkdirAll(path string, perm os.FileMode) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"MkdirAll\", path, perm)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "104a1cece9d023760dbe7b198338e3f4", "score": "0.56410325", "text": "func CheckAndCreateDir(path string) {\n\n\tif _, err := os.Stat(path); os.IsNotExist(err) {\n\t\tos.Mkdir(path, os.ModePerm)\n\t}\n}", "title": "" }, { "docid": "d2f21436f880553032182d04ab9eb302", "score": "0.5639851", "text": "func Mkdirp(path string) {\n\terr := os.MkdirAll(path, os.ModePerm)\n\n\tif err != nil {\n\t\tfmt.Println(\"Error creating output folder at \", path, \" \", err)\n\t\tos.Exit(-1)\n\t}\n}", "title": "" }, { "docid": "fac2086f11e6ea05fd6bb46459c1bfe5", "score": "0.5603885", "text": "func (mr *MockOSMockRecorder) MkdirAll(path, perm interface{}) *gomock.Call {\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"MkdirAll\", reflect.TypeOf((*MockOS)(nil).MkdirAll), path, perm)\n}", "title": "" }, { "docid": "3ac0c13356174c1e05269c95dc7b039d", "score": "0.5592782", "text": "func MakePath(dirname string) error {\n\tif _, err := os.Stat(dirname); err != nil {\n\t\treturn os.MkdirAll(dirname, 0755)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cad56c6b8fff1f45850f0efaf1176152", "score": "0.5584655", "text": "func mkdir(path string) error {\n\tdir := filepath.Dir(path)\n\n\t// 0775 is the file mode that $ mkdir uses when creating a directoru\n\terr := os.MkdirAll(dir, 0775)\n\n\treturn err\n}", "title": "" }, { "docid": "44586a13b15fbca0b967f6fac7a57b95", "score": "0.5575194", "text": "func (m *MockClient) MkdirAll(path string, mode os.FileMode) error {\n\tret := m.ctrl.Call(m, \"MkdirAll\", path, mode)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "3386a73b16321af62cb90b1e5f911a16", "score": "0.5536723", "text": "func ensureDir(dirName string) error {\n\terr := os.MkdirAll(dirName, os.ModeDir)\n\tif err == nil || os.IsExist(err) {\n\t\treturn nil\n\t}\n\treturn err\n}", "title": "" }, { "docid": "a553f0028ad2939fec44fdaa9aa20803", "score": "0.5525683", "text": "func MkDir(dir string) {\n\t_, err := os.Stat(dir)\n\tif os.IsNotExist(err) {\n\t\terrDir := os.MkdirAll(dir, 0755)\n\t\tif errDir != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a209ce05c2466456a4025ebf8b3d4ada", "score": "0.5523164", "text": "func (fs *FileSystem) Mkdir(p string) error {\n\tif fs.workspace == \"\" {\n\t\treturn fmt.Errorf(\"cannot write to read-only filesystem\")\n\t}\n\terr := os.MkdirAll(path.Join(fs.workspace, p), 0o755)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not create directory %s: %v\", p, err)\n\t}\n\t// we are not interesting in returning the entries\n\treturn err\n}", "title": "" }, { "docid": "1969299b77bf0a653a29bc21b5446cee", "score": "0.55212367", "text": "func (*osFilesys) EnsureDirectory(path string) error {\r\n\tpath = strings.TrimSpace(path)\r\n\tif path == \"\" {\r\n\t\treturn ErrPathEmpty\r\n\t}\r\n\r\n\treturn os.MkdirAll(path, os.ModePerm)\r\n}", "title": "" }, { "docid": "206627aba8ea102894fdc7e635c1fc25", "score": "0.54930323", "text": "func MkDirIfNotExists(path string, fmode os.FileMode) (err error) {\n\tpath = filepath.FromSlash(path)\n\n\tok, err := FileExists(path)\n\tif err != nil {\n\t\treturn mdp.ErrorNew(\"MkDirIfNotExists Check directory \"+path, err)\n\t}\n\tif !ok {\n\t\terr = os.MkdirAll(path, fmode)\n\t\tif err != nil {\n\t\t\treturn mdp.ErrorNew(\"MkDirIfNotExists Mkdir file \"+path, err)\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "fa29394ef82418598c0e32fbba069b5d", "score": "0.54761654", "text": "func MkDir(src string) error {\n\terr := os.MkdirAll(src, os.ModePerm)\n\tif err != nil {\n\t\treturn err\n\t}\n\tos.Chmod(src, 0o777)\n\n\treturn nil\n}", "title": "" }, { "docid": "9abefaba496a5a821bd7092ef2b5fcc8", "score": "0.5467862", "text": "func maybeMakeDir(path string, mode int16) error {\n\tif fi, err := os.Stat(path); err != nil {\n\t\tif err := os.Mkdir(path, os.FileMode(mode)); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t} else {\n\t\tif !fi.IsDir() {\n\t\t\treturn fmt.Errorf(\"Path %s exists, but is not a directory.\", path)\n\t\t}\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "eb6308fa25c4b798a626a9b5a53c3dbe", "score": "0.5461584", "text": "func createDirIfNotExists(path string) error {\n\tif _, err := os.Stat(path); os.IsNotExist(err) {\n\t\treturn os.MkdirAll(path, os.ModePerm)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "eb6308fa25c4b798a626a9b5a53c3dbe", "score": "0.5461584", "text": "func createDirIfNotExists(path string) error {\n\tif _, err := os.Stat(path); os.IsNotExist(err) {\n\t\treturn os.MkdirAll(path, os.ModePerm)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1a9a557074f29cdd1995372e02882302", "score": "0.5456017", "text": "func (_m *MockDependencies) MkdirAll(path string, perm fs.FileMode) error {\n\tret := _m.Called(path, perm)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(string, fs.FileMode) error); ok {\n\t\tr0 = rf(path, perm)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "909cd7492610dd00f955ace3812b1eb5", "score": "0.5454651", "text": "func CreateDirWithNecessaryParentsIfnotExists(path string) error {\n\terr := os.MkdirAll(path, os.ModePerm)\n\tif err != nil {\n\t\tlog.Printf(\"Utils: CreateDirWithNecessaryParentsIfnotExists: Error creating dir: %v \\n error: %v \", path, err)\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "197dd21a48df911b28966e4aab0287d0", "score": "0.5449848", "text": "func ensureDir(name string) error {\n\tif _, err := os.Stat(name); os.IsNotExist(err) {\n\t\tif err := os.MkdirAll(name, 0755); err != nil {\n\t\t\treturn err\n\t\t\tlog.Fatal(err)\n\t\t} else {\n\t\t\tlog.Printf(\"created directory at: %s\", name)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6ab33a2bf08a3d3ac06c84a501d6d179", "score": "0.54357356", "text": "func CreateDir(fullDirPath string, parents bool) (err error) {\n\tif _, err = os.Stat(fullDirPath); !os.IsNotExist(err) {\n\t\terrMsg := fmt.Sprintf(\"%s already exists\", fullDirPath)\n\t\treturn errors.New(errMsg)\n\t}\n\n\tif parents {\n\t\terr = os.MkdirAll(fullDirPath, 0755)\n\t} else {\n\t\terr = os.Mkdir(fullDirPath, 0755)\n\t}\n\treturn err\n}", "title": "" }, { "docid": "4d35105938bd2c6dee05cc32ba9673f1", "score": "0.5428394", "text": "func CreateAllIfNotExist(path string) (*os.File, error) {\n\treturn OpenFileAll(path, DefaultFlagCreateIfNotExist, DefaultPermissionDirectory, DefaultPermissionFile)\n}", "title": "" }, { "docid": "c80461ccf6b4afe3bc7b2f15d3e0dcf1", "score": "0.54213166", "text": "func MakeDir(dir string) error {\n\tif !FolderExist(dir) {\n\t\terr := os.MkdirAll(dir, os.ModePerm)\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2ebd1b3323e787d3a5e8a9b1692c24a6", "score": "0.5404898", "text": "func (fs *FS) Mkdir(path string, mode uint32) int {\n\tlog.Printf(\"(unimplemented) fs.Mkdir(%v)\\n\", path)\n\treturn errno.ENOSYS\n}", "title": "" }, { "docid": "fdb2fe20ade7359f0a5140a5e0934853", "score": "0.540405", "text": "func (h *TempDir) Mkdir(dir string) *TempDir {\n\treturn h.failIfErr(os.MkdirAll(h.Path(dir), os.ModePerm))\n}", "title": "" }, { "docid": "9abac2834659bb06711ab19bfd8fd904", "score": "0.5389504", "text": "func (mr *MockClientMockRecorder) MkdirAll(path, mode interface{}) *gomock.Call {\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"MkdirAll\", reflect.TypeOf((*MockClient)(nil).MkdirAll), path, mode)\n}", "title": "" }, { "docid": "83051dc320f9fbeb39ca8e175aff5ee7", "score": "0.53887045", "text": "func (mount *MountInfo) MakeDir(path string, mode uint32) error {\n\tcPath := C.CString(path)\n\tdefer C.free(unsafe.Pointer(cPath))\n\n\tret := C.ceph_mkdir(mount.mount, cPath, C.mode_t(mode))\n\treturn getError(ret)\n}", "title": "" }, { "docid": "04192f037212580182612ed8793d4ca4", "score": "0.5384887", "text": "func CreateDir(dirPath string) error {\n\treturn CreateDirWithFileMode(dirPath, allUsersFullPermission)\n}", "title": "" }, { "docid": "0d7030fd8165db34049bf720eea30394", "score": "0.536743", "text": "func createDir(dir string) error {\n\tif exists, err := Exists(dir); err != nil {\n\t\treturn err\n\t} else if !exists {\n\t\terr = os.MkdirAll(dir, 0755) // This is the default permission for a folder\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "52c58ddd917ab1f141415c98033f569f", "score": "0.5366072", "text": "func PathExistsAndMkdir(path string) error {\n\t_, err := os.Stat(path)\n\tif err == nil {\n\t\treturn nil\n\t}\n\terr = os.Mkdir(path, os.ModePerm)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "255147fdfaf4cc210b5d5edc56d96dd2", "score": "0.53526473", "text": "func ensureDir(path string) {\n\tfolder := filepath.Dir(absPath(path))\n\tfmt.Println(folder)\n\tif _, err := os.Stat(folder); os.IsNotExist(err) {\n\t\tos.Mkdir(folder, os.ModePerm)\n\t}\n}", "title": "" }, { "docid": "f14f6e76b78069a226dcd67838d166ac", "score": "0.5352469", "text": "func mkdirAll(files ...string) error {\n\tfor _, f := range files {\n\t\tif err := os.MkdirAll(f, 0755); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "15dffaa93e6d9cad393b5a75406bd8f0", "score": "0.5326205", "text": "func ensureDirectory(name string) {\n\tos.MkdirAll(name, 0755)\n}", "title": "" }, { "docid": "34b0057ec785da40fb41e43503683f8a", "score": "0.53238916", "text": "func CreateDir(\n\treqLogger logr.Logger,\n\tobj runtime.Object,\n\tnamespace string,\n\tpodName string,\n\texpectedContainerID string,\n\tcontainerName string,\n\tdirName string,\n\tsetPerms bool,\n) error {\n\n\tcommand := []string{\"mkdir\", \"-p\", dirName}\n\t// We only need the exit status, but we have to supply at least one\n\t// stream to avoid an error.\n\tvar stdErr bytes.Buffer\n\tioStreams := &Streams{ErrOut: &stdErr}\n\terr := ExecCommand(\n\t\treqLogger,\n\t\tobj,\n\t\tnamespace,\n\t\tpodName,\n\t\texpectedContainerID,\n\t\tcontainerName,\n\t\tcommand,\n\t\tioStreams,\n\t)\n\tif err != nil {\n\t\terr = fmt.Errorf(\"mkdir failed: %s\\n%s\",\n\t\t\tstdErr.String(),\n\t\t\terr.Error(),\n\t\t)\n\t\treturn err\n\t}\n\tif !setPerms {\n\t\treturn nil\n\t}\n\tcommand = []string{\"chmod\", \"700\", dirName}\n\terr = ExecCommand(\n\t\treqLogger,\n\t\tobj,\n\t\tnamespace,\n\t\tpodName,\n\t\texpectedContainerID,\n\t\tcontainerName,\n\t\tcommand,\n\t\tioStreams,\n\t)\n\tif err != nil {\n\t\terr = fmt.Errorf(\"directory chmod failed: %s\\n%s\",\n\t\t\tstdErr.String(),\n\t\t\terr.Error(),\n\t\t)\n\t}\n\treturn err\n}", "title": "" } ]
e4b5b77143e086872c7995372687e16c
Part1 "How many different passwords within the range given in your puzzle input meet these criteria?"
[ { "docid": "9dbe7cd2662d7528c89c575324af4741", "score": "0.0", "text": "func Part1(fileName string) int {\n\treturn countValid(fileName, false)\n}", "title": "" } ]
[ { "docid": "969a21c966041d37da8beadb7a8af592", "score": "0.70071316", "text": "func findValidPasswords(inputFile string) {\n\tfile, err := os.Open(inputFile)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer file.Close()\n\n\tscanner := bufio.NewScanner(file)\n\tnAllowed1 := 0\n\tnAllowed2 := 0\n\tfor scanner.Scan() {\n\t\tfirst, second, target, password, err := parsePasswordLine(scanner.Text())\n\t\tif err != nil { fmt.Println(err) }\n\t\tif checkCountAllowed(password, target, first, second) {\n\t\t\tnAllowed1 += 1\n\t\t}\n\t\tif checkPositionAllowed(password, target, first, second) {\n\t\t\tnAllowed2 += 1\n\t\t}\n\t}\n\tif err := scanner.Err(); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Println(\"Part 1:\", nAllowed1)\n\tfmt.Println(\"Part 2:\", nAllowed2)\n\n}", "title": "" }, { "docid": "de2c91d371727b96e54c927620d98163", "score": "0.6910061", "text": "func checkCountAllowed(password string, target string, min int, max int) (allowed bool) {\n\toccurrences := strings.Count(password, target)\n\tallowed = min <= occurrences && max >= occurrences\n\treturn\n}", "title": "" }, { "docid": "f36ef1bfaaaf4cb1a980efd42be0a02b", "score": "0.69041973", "text": "func calculateNumberOfCorrectLetters(attempt string, correctPassword string) int {\n\tcorrectLetterCount := 0\n\n\tfor i := 0; i < len(attempt); i++ {\n\t\tif attempt[i] == correctPassword[i] {\n\t\t\tcorrectLetterCount++\n\t\t}\n\t}\n\n\treturn correctLetterCount\n}", "title": "" }, { "docid": "9cd0a3ed5bba21b9b5c14a9319892968", "score": "0.687194", "text": "func (policy *passPolicy) checkPasswordCount(password string) bool {\n\tcountChr := 0\n\tfor _, char := range password {\n\t\tif char == policy.c {\n\t\t\tcountChr++\n\t\t}\n\t}\n\n\treturn policy.a <= countChr && countChr <= policy.b\n}", "title": "" }, { "docid": "a49b71ab82a09bebe8360d31fa18d9ec", "score": "0.67674154", "text": "func SolveDay2Part1(input []string) (int, error) {\r\n\tvar validCount int\r\n\tfor _, s := range input {\r\n\t\tmainParts := strings.Split(s, \":\") // The first substring specifies the password rules, the second specifies the password itself\r\n\t\tif len(mainParts) != 2 {\r\n\t\t\treturn 0, fmt.Errorf(\"the input \\\"%s\\\" is invalid\", s) // Invalid input\r\n\t\t}\r\n\t\tpassword := strings.TrimSpace(mainParts[1])\r\n\r\n\t\t// Parse the rule specification\r\n\t\truleParts := strings.Split(mainParts[0], \" \")\r\n\t\tif len(ruleParts) != 2 {\r\n\t\t\treturn 0, fmt.Errorf(\"the password rule specification \\\"%s\\\" is invalid\", mainParts[0]) // Invalid password rule part\r\n\t\t}\r\n\r\n\t\t// Parse the character count rule\r\n\t\tcountRuleParts := strings.Split(ruleParts[0], \"-\")\r\n\t\tif len(countRuleParts) != 2 {\r\n\t\t\treturn 0, fmt.Errorf(\"the password character count rule specification \\\"%s\\\" is invalid\", ruleParts[0]) // Invalid password character count rule part\r\n\t\t}\r\n\t\tlowerLimit, err := strconv.Atoi(countRuleParts[0])\r\n\t\tif err != nil {\r\n\t\t\treturn 0, err\r\n\t\t}\r\n\t\tupperLimit, err := strconv.Atoi(countRuleParts[1])\r\n\t\tif err != nil {\r\n\t\t\treturn 0, err\r\n\t\t}\r\n\r\n\t\t// Parse the character\r\n\t\tcharacter := ruleParts[1]\r\n\r\n\t\tcount := strings.Count(password, character)\r\n\t\tif count <= upperLimit && count >= lowerLimit {\r\n\t\t\tvalidCount++ // Password meets specified rules\r\n\t\t}\r\n\t}\r\n\r\n\treturn validCount, nil\r\n}", "title": "" }, { "docid": "2d4446964a063e7060dff14bba0c3ae3", "score": "0.6538752", "text": "func validPasswordsPart1(pws []PasswordPolicy) (int, error) {\n\tvalid := 0\n\tfor _, pw := range pws {\n\t\tcount := strings.Count(pw.pw, pw.policy.letter)\n\t\tif count >= pw.policy.lower && count <= pw.policy.upper {\n\t\t\tvalid++\n\t\t}\n\t}\n\n\treturn valid, nil\n}", "title": "" }, { "docid": "dd8b5565f4e117e49291f10079a75d20", "score": "0.6471866", "text": "func validPasswordsPart2(pws []PasswordPolicy) (int, error) {\n\tvalid := 0\n\tfor _, pw := range pws {\n\t\tletter := []rune(pw.policy.letter)[0]\n\t\t// passwords are not 0-based index\n \t\tinPos1 := ([]rune(pw.pw))[pw.policy.lower - 1] == letter\n\t\tinPos2 := ([]rune(pw.pw))[pw.policy.upper - 1] == letter\n\n\t\tif (inPos1 && !inPos2) || (!inPos1 && inPos2) { // inPos1 != inPos2\n\t\t\tvalid++\n\t\t}\n\t}\n\n\treturn valid, nil\n}", "title": "" }, { "docid": "c7dea65261c2c76ad26090eb282f6558", "score": "0.6377249", "text": "func partOne(records []Record) int {\r\n\tcount := 0\r\n\r\n\tfor _, v := range records {\r\n\t\tif c := strings.Count(v.Password, string(v.Letter)); c >= v.Min && c <= v.Max {\r\n\t\t\tcount++\r\n\t\t}\r\n\t}\r\n\r\n\treturn count\r\n}", "title": "" }, { "docid": "32e0973e52f511d8e8b8cc3d55082387", "score": "0.6273384", "text": "func partTwo(records []Record) int {\r\n\tcount := 0\r\n\r\n\tfor _, v := range records {\r\n\t\ts := byte(v.Letter)\r\n\t\thasFirstPos := v.Password[v.Min-1] == s\r\n\t\thasSecondPos := v.Password[v.Max-1] == s\r\n\r\n\t\tif hasFirstPos != hasSecondPos {\r\n\t\t\tcount++\r\n\t\t}\r\n\t}\r\n\r\n\treturn count\r\n}", "title": "" }, { "docid": "f3f159fcd141b8574d478ad43c75e133", "score": "0.62225735", "text": "func Password(pass string) bool {\n\tvar (\n\t\tupp, low, num bool\n\t\ttot uint8\n\t)\n \n\tfor _, char := range pass {\n\t\tswitch {\n\t\tcase unicode.IsUpper(char):\n\t\t\tupp = true\n\t\t\ttot++\n\t\tcase unicode.IsLower(char):\n\t\t\tlow = true\n\t\t\ttot++\n\t\tcase unicode.IsNumber(char):\n\t\t\tnum = true\n\t\t\ttot++\n\t\tdefault:\n\t\t\treturn false\n\t\t}\n\t}\n \n\tif !upp || !low || !num || tot < 8 {\n\t\treturn false \n\t}\n \n\treturn true\n}", "title": "" }, { "docid": "5c4cdce94497e53625c29211ba247872", "score": "0.61885464", "text": "func main() {\n\tfmt.Println(\"Advent of Code 2020, Day 4\")\n\tconst filename = \"input.txt\"\n\tfmt.Printf(\"Reading file %s\\n\", filename)\n\tinput, err := os.Open(filename)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer input.Close()\n\tpassports := readPassports(input)\n\tvar valid, valid2 int\n\tfor _, p := range passports {\n\t\tif p.isValid() {\n\t\t\tvalid++\n\t\t}\n\t\tif p.isValid2() {\n\t\t\tvalid2++\n\t\t}\n\t}\n\tfmt.Printf(\"Part 1: valid = %d\\n\", valid)\n\tfmt.Printf(\"Part 2: valid = %d\\n\", valid2)\n}", "title": "" }, { "docid": "cc7677528f7ef8b492222be21fd0e398", "score": "0.61654204", "text": "func PasswordStrength(password string) []string {\n\tmessages := []string{}\n\n\thasLetter := false\n\thasNumber := false\n\thasPunctuation := false\n\thasRepeatedCharacter := false\n\n\tvar lastRune rune\n\tvar lastRuneCount int = 0\n\tfor _, c := range password {\n\t\tif c != lastRune {\n\t\t\tlastRune = c\n\t\t\tlastRuneCount = 0\n\t\t} else {\n\t\t\tlastRuneCount = lastRuneCount + 1\n\t\t\tif lastRuneCount >= 2 {\n\t\t\t\thasRepeatedCharacter = true\n\t\t\t}\n\t\t}\n\t\tif c > '0' && c < '9' {\n\t\t\thasNumber = true\n\t\t}\n\t\tif c > 'A' && c < 'Z' {\n\t\t\thasLetter = true\n\t\t}\n\t\tif c > 'a' && c < 'z' {\n\t\t\thasLetter = true\n\t\t}\n\t\tif c == ' ' || c == '.' || c == ',' ||\n\t\t\tc == '=' || c == '!' || c == '@' ||\n\t\t\tc == '#' || c == '$' || c == '%' ||\n\t\t\tc == '^' || c == ':' || c == '&' ||\n\t\t\tc == '*' || c == '(' || c == ')' ||\n\t\t\tc == '-' || c == '_' || c == '+' ||\n\t\t\tc == '[' || c == ']' || c == '{' ||\n\t\t\tc == '}' || c == '|' || c == '\\\\' ||\n\t\t\tc == '/' || c == '\\'' || c == '\"' ||\n\t\t\tc == '`' || c == '~' || c == '<' ||\n\t\t\tc == '>' || c == ';' || c == '?' {\n\t\t\thasPunctuation = true\n\t\t}\n\t}\n\n\tif len(password) < 8 {\n\t\tmessages = append(messages, \"Passwords must be at least 8 characters\")\n\t}\n\n\tif len(password) < 10 {\n\t\tif !hasLetter || !hasNumber || !hasPunctuation {\n\t\t\tmessages = append(messages, \"Passwords less than 10 characters must contain letters, numbers, and punctuation\")\n\t\t}\n\t}\n\n\tif hasRepeatedCharacter {\n\t\tmessages = append(messages, \"Passwords may not have repeated characters, i.e. 111\")\n\t}\n\n\tif strings.Index(password, \"abc\") >= 0 {\n\t\tmessages = append(messages, \"Password may not contain 'abc'\")\n\t}\n\n\tif strings.Index(password, \"123\") >= 0 {\n\t\tmessages = append(messages, \"Password may not contain '123'\")\n\t}\n\n\treturn messages\n}", "title": "" }, { "docid": "456214df3985e3ef23114b3c16f3dd71", "score": "0.6148091", "text": "func ValidatePasswords(path string) (int, int) {\r\n\tfile, err := os.Open(path)\r\n\tif err != nil {\r\n\t\tlog.Fatal(err)\r\n\t}\r\n\tdefer file.Close()\r\n\r\n\tpattern, err := regexp.Compile(PasswordPattern)\r\n\tif err != nil {\r\n\t\tlog.Fatal(err)\r\n\t}\r\n\r\n\tscanner := bufio.NewScanner(file)\r\n\tvalid, validDownTheRoad := 0, 0\r\n\r\n\tfor scanner.Scan() {\r\n\t\tmatch := pattern.FindStringSubmatch(scanner.Text())\r\n\t\tif match == nil {\r\n\t\t\tcontinue\r\n\t\t}\r\n\t\tmin, err := strconv.Atoi(match[1])\r\n\t\tif err != nil {\r\n\t\t\tlog.Fatal(err)\r\n\t\t}\r\n\t\tmax, err := strconv.Atoi(match[2])\r\n\t\tif err != nil {\r\n\t\t\tlog.Fatal(err)\r\n\t\t}\r\n\t\tpassword := Password{\r\n\t\t\tmin: min,\r\n\t\t\tmax: max,\r\n\t\t\tcharacter: []rune(match[3])[0],\r\n\t\t\tpassword: match[4],\r\n\t\t}\r\n\t\tif password.IsValid() {\r\n\t\t\tvalid++\r\n\t\t}\r\n\t\tif password.IsValidDownTheRoad() {\r\n\t\t\tvalidDownTheRoad++\r\n\t\t}\r\n\t}\r\n\treturn valid, validDownTheRoad\r\n}", "title": "" }, { "docid": "05ff3e51eae52f8d1a0c4ba49d077c6c", "score": "0.607064", "text": "func SolveDay2Part2(input []string) (int, error) {\r\n\tvar validCount int\r\n\tfor _, s := range input {\r\n\t\tmainParts := strings.Split(s, \":\") // The first substring specifies the password rules, the second specifies the password itself\r\n\t\tif len(mainParts) != 2 {\r\n\t\t\treturn 0, fmt.Errorf(\"the input \\\"%s\\\" is invalid\", s) // Invalid input\r\n\t\t}\r\n\t\tpassword := []rune(strings.TrimSpace(mainParts[1])) // Use as rune slice for index access\r\n\r\n\t\t// Parse the rule specification\r\n\t\truleParts := strings.Split(mainParts[0], \" \")\r\n\t\tif len(ruleParts) != 2 {\r\n\t\t\treturn 0, fmt.Errorf(\"the password rule specification \\\"%s\\\" is invalid\", mainParts[0]) // Invalid password rule part\r\n\t\t}\r\n\r\n\t\t// Parse the character position rule\r\n\t\tposRuleParts := strings.Split(ruleParts[0], \"-\")\r\n\t\tif len(posRuleParts) != 2 {\r\n\t\t\treturn 0, fmt.Errorf(\"the password character position rule specification \\\"%s\\\" is invalid\", ruleParts[0]) // Invalid password character position rule part\r\n\t\t}\r\n\t\tlowerPos, err := strconv.Atoi(posRuleParts[0])\r\n\t\tif err != nil {\r\n\t\t\treturn 0, err\r\n\t\t}\r\n\t\tupperPos, err := strconv.Atoi(posRuleParts[1])\r\n\t\tif err != nil {\r\n\t\t\treturn 0, err\r\n\t\t}\r\n\r\n\t\t// Parse the character\r\n\t\tcharacter := []rune(ruleParts[1])\r\n\r\n\t\tif (password[lowerPos-1] == character[0] && password[upperPos-1] != character[0]) || (password[lowerPos-1] != character[0] && password[upperPos-1] == character[0]) {\r\n\t\t\tvalidCount++ // Password meets specified rules\r\n\t\t}\r\n\t}\r\n\r\n\treturn validCount, nil\r\n}", "title": "" }, { "docid": "1bbfd02fb927e030d6211ee43a7062cf", "score": "0.59736925", "text": "func NumberOfValidPassphrases(scanner *bufio.Scanner) (int, int) {\n\tvar n int\n\tvar h int\n\n\tfor scanner.Scan() {\n\t\tt := scanner.Text()\n\t\tif ValidPassphrase(t) {\n\t\t\tn++\n\t\t}\n\n\t\tif ValidHardenedPassphrase(t) {\n\t\t\th++\n\t\t}\n\n\t}\n\n\treturn n, h\n}", "title": "" }, { "docid": "38e7005560e71b99c04a28d93b54dfc2", "score": "0.59548837", "text": "func getPwLengthFromParams(config *Config) int {\n\tif config.minPassLen > config.maxPassLen {\n\t\tconfig.maxPassLen = config.minPassLen\n\t}\n\tlenDiff := config.maxPassLen - config.minPassLen + 1\n\trandAdd, err := getRandNum(lenDiff)\n\tif err != nil {\n\t\tlog.Fatalf(\"Failed to generated password length: %v\", err)\n\t}\n\tretVal := config.minPassLen + randAdd\n\tif retVal <= 0 {\n\t\treturn 1\n\t}\n\n\treturn retVal\n}", "title": "" }, { "docid": "d0ed55c53e5607fede7a276143752d05", "score": "0.592767", "text": "func ValidatePasswords(s []string) (int, int) {\n\tisValid, isValidTwo := 0, 0\n\tfor _, p := range s {\n\t\tpwd := ParsePassword(p)\n\t\tif pwd.isValid() {\n\t\t\tisValid++\n\t\t}\n\t\tif pwd.isValidTwo() {\n\t\t\tisValidTwo++\n\t\t}\n\t}\n\treturn isValid, isValidTwo\n}", "title": "" }, { "docid": "d13fc4addff7e242147aae9b59d6163d", "score": "0.5913877", "text": "func cakeProblem() {\n // cake contains E or P\n // slice should contain at least one E\n var cake, cake_in string\n var s, dist int\n var count int64 = 0\n _, err := fmt.Fscan(os.Stdin, &cake_in, &s)\n ok(err)\n cake = cake_in + cake_in;\n n := len(cake_in)\n a := make([]int, n*2)\n\n a[0] = -1;\n for i := 1; i < n * 2; i++ {\n if cake[i - 1] == 'E' {\n a[i] = i - 1\n } else {\n a[i] = a[i - 1]\n }\n\n if i >= n {\n if a[i] == -1 {\n break;\n }\n if cake[i] == 'E' {\n dist = i - a[i]\n for j := 1; j <= Min(dist, s); j++ {\n count += int64(j)\n }\n for j := dist + 1; j <= s; j++ {\n count += int64(dist)\n }\n }\n }\n }\n\n fmt.Println(count)\n}", "title": "" }, { "docid": "a265eec13ac6069f614a8f3d3bf5b0f7", "score": "0.58410347", "text": "func validatePassword(password string) error {\n\tvar uppercasePresent bool\n\tvar lowercasePresent bool\n\tvar numberPresent bool\n\tvar specialCharPresent bool\n\tconst minPassLength = 8\n\tconst maxPassLength = 64\n\tvar passLen int\n\tvar errorString string\n\n\tfor _, ch := range password {\n\t\tswitch {\n\t\tcase unicode.IsNumber(ch):\n\t\t\tnumberPresent = true\n\t\t\tpassLen++\n\t\tcase unicode.IsUpper(ch):\n\t\t\tuppercasePresent = true\n\t\t\tpassLen++\n\t\tcase unicode.IsLower(ch):\n\t\t\tlowercasePresent = true\n\t\t\tpassLen++\n\t\tcase unicode.IsPunct(ch) || unicode.IsSymbol(ch):\n\t\t\tspecialCharPresent = true\n\t\t\tpassLen++\n\t\tcase ch == ' ':\n\t\t\tpassLen++\n\t\t}\n\t}\n\tappendError := func(err string) {\n\t\tif len(strings.TrimSpace(errorString)) != 0 {\n\t\t\terrorString += \", \" + err\n\t\t} else {\n\t\t\terrorString = err\n\t\t}\n\t}\n\tif !lowercasePresent {\n\t\tappendError(\"lowercase letter missing\")\n\t}\n\tif !uppercasePresent {\n\t\tappendError(\"uppercase letter missing\")\n\t}\n\tif !numberPresent {\n\t\tappendError(\"atleast one numeric character required\")\n\t}\n\tif !specialCharPresent {\n\t\tappendError(\"special character missing\")\n\t}\n\tif !(minPassLength <= passLen && passLen <= maxPassLength) {\n\t\tappendError(fmt.Sprintf(\"password length must be between %d to %d characters long\", minPassLength, maxPassLength))\n\t}\n\n\tif len(errorString) != 0 {\n\t\treturn fmt.Errorf(errorString)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "024bf5a78ccfd975cee9ce25897ccb2b", "score": "0.5817589", "text": "func SolvePart1(input string) int64 {\n\tlines := strings.Split(input, \"\\n\")\n\tvalid := int64(0)\n\tre := regexp.MustCompile(`([0-9]*)-([0-9]*)\\s([a-z]):\\s(.*)`)\n\n\tfor i := 0; i < len(lines); i++ {\n\t\tmatches := re.FindStringSubmatch(lines[i])\n\n\t\tif matches != nil {\n\t\t\tmin, _ := strconv.Atoi(matches[1])\n\t\t\tmax, _ := strconv.Atoi(matches[2])\n\t\t\tchar := matches[3]\n\t\t\tpass := matches[4]\n\n\t\t\tc := strings.Count(pass, char)\n\t\t\tif c >= min && c <= max {\n\t\t\t\tvalid++\n\t\t\t}\n\t\t}\n\t}\n\n\treturn valid\n}", "title": "" }, { "docid": "1985e2aafb27e17d5a063bab8ac028c8", "score": "0.5789944", "text": "func passportProcessing() {\n\tdefer x.Took(time.Now())\n\tinput := x.ReadString()\n\tfmt.Println(countValid(input, false))\n}", "title": "" }, { "docid": "b60d32a1c8d67ab28157807904e055b8", "score": "0.57820123", "text": "func TestPasswordSanity(t *testing.T) {\n\tpw := make([]byte, 10)\n\tpw2 := make([]byte, 10)\n\tvar salt, hash, hash2 []byte\n\n\tfor i := 0; i < 32; i++ {\n\t\trand.Read(pw)\n\t\trand.Read(pw2)\n\t\tsalt = Salt128()\n\t\thash = EncryptPassword(pw, salt)\n\t\thash2 = EncryptPassword(pw2, salt)\n\n\t\tif err := ComparePassword(hash, pw, salt); err != nil {\n\t\t\tt.Error(err)\n\t\t\tt.FailNow()\n\t\t}\n\t\tif err := ComparePassword(hash2, pw, salt); err == nil {\n\t\t\tt.Error(\"ComparePassword is giving false positive\")\n\t\t\tt.FailNow()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "cfd0ea978890800fc529c240e3a2ac6a", "score": "0.5742238", "text": "func main() {\n\tinput := \"Indivisibilities\"\n\tdata := collections.StringValues(\n\t\tstrings.Split(\n\t\t\tstrings.ToLower(input), \"\")).Data()\n\tcounterMap := counter.Counter(data)\n\tfmt.Println(count(counterMap))\n\tfmt.Println(countAlt(data))\n\tfmt.Println(countAlt2(data))\n\n}", "title": "" }, { "docid": "f33d4375a388d3b8679c224f59d0e190", "score": "0.5724603", "text": "func D2a(input string) string {\n\tentries, err := parseInput(input)\n\tif err != nil {\n\t\treturn fmt.Sprintf(\"Can not parse input: %v\", err)\n\t}\n\n\tvar valid int\n\tfor _, e := range entries {\n\t\tcount := strings.Count(e.password, e.letter)\n\t\tif count > e.max || count < e.min {\n\t\t\tcontinue\n\t\t}\n\t\tvalid++\n\t}\n\treturn strconv.Itoa(valid)\n}", "title": "" }, { "docid": "4785ec22f218b87af95622dda6cea873", "score": "0.5680339", "text": "func (p Password) IsValid() bool {\r\n\tif len(p.password) < p.max {\r\n\t\treturn false\r\n\t}\r\n\tcount := 0\r\n\tfor _, c := range p.password {\r\n\t\tif c == p.character {\r\n\t\t\tcount++\r\n\t\t\tif count > p.max {\r\n\t\t\t\treturn false\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn count >= p.min\r\n}", "title": "" }, { "docid": "842722d681dbdcf9ed9e6fc353550028", "score": "0.5662192", "text": "func Password(n int) (string, string, string, error) {\n\tb, err := tao.Parent().GetRandomBytes(n * 2)\n\tif err != nil {\n\t\treturn \"\", \"\", \"\", err\n\t}\n\tvar words []string\n\tvar alt1 []byte\n\tvar alt2 []byte\n\tfor i := 0; i < n; i++ {\n\t\tr0 := int(b[2*i])\n\t\tr1 := int(b[2*i+1])\n\t\tvar r = int(r1*256+r0) % len(Wordlist)\n\t\twords = append(words, Wordlist[r%len(Wordlist)])\n\t\talt1 = append(alt1, SmallAlphabet[r0%len(SmallAlphabet)])\n\t\talt1 = append(alt1, SmallAlphabet[r1%len(SmallAlphabet)])\n\t\talt2 = append(alt2, TinyAlphabet[r0%len(TinyAlphabet)])\n\t\talt2 = append(alt2, TinyAlphabet[r1%len(TinyAlphabet)])\n\t}\n\treturn strings.Join(words, \" \"), string(alt1), string(alt2), nil\n}", "title": "" }, { "docid": "67c014c328ac300d340b250e5b4c812f", "score": "0.56327385", "text": "func (s *Service) Password(pw string, inputs ...string) bool {\n\tinputs = append(inputs, s.appWords...)\n\tpwStrength := zxcvbn.PasswordStrength(pw, inputs)\n\treturn (pwStrength.Score >= s.minStr)\n}", "title": "" }, { "docid": "4102baa6a5a7aef36f07c42f2f0a22b7", "score": "0.56278086", "text": "func main() {\n\tfile, err := os.Open(\"input.txt\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer file.Close()\n\n\tvalidLines := 0\n\tre := regexp.MustCompile(`(\\d+)-(\\d+) (.): (.*)`)\n\tscanner := bufio.NewScanner(file)\n\tfor scanner.Scan() {\n\t\tline := scanner.Text()\n\t\tparsed := re.FindStringSubmatch(line)[1:]\n\t\tposA, _ := strconv.Atoi(parsed[0])\n\t\tposB, _ := strconv.Atoi(parsed[1])\n\t\tchar := []rune(parsed[2])[0]\n\t\tpwd := []rune(parsed[3])\n\t\toccurrences := 0\n\t\tif pwd[posA-1] == char {\n\t\t\toccurrences++\n\t\t}\n\t\tif pwd[posB-1] == char {\n\t\t\toccurrences++\n\t\t}\n\t\tif occurrences == 1 {\n\t\t\tvalidLines++\n\t\t}\n\t}\n\n\tif err := scanner.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(validLines)\n\n}", "title": "" }, { "docid": "0fa642e28b76138936b5a05f9eba9de0", "score": "0.56202203", "text": "func determinePasswordStrength(password string, userInput []string) scoring.MinEntropyMatch {\n\treturn zxcbvn.PasswordStrength(password, userInput)\n}", "title": "" }, { "docid": "300ec1855599bf9d282ab912cf4e0dce", "score": "0.5605815", "text": "func validatePassword(password string) error {\n\tif len(password) < 8 {\n\t\treturn fmt.Errorf(\"validate password: too short (min 8)\")\n\t}\n\t// lower, upper, digit, punct := false, false, false, false\n\t// for _, r := range password {\n\t// \tswitch {\n\t// \tcase unicode.IsLower(r):\n\t// \t\tlower = true\n\t// \tcase unicode.IsUpper(r):\n\t// \t\tupper = true\n\t// \tcase unicode.IsDigit(r):\n\t// \t\tdigit = true\n\t// \tcase unicode.IsPunct(r):\n\t// \t\tpunct = true\n\t// \t}\n\t// }\n\t// switch {\n\t// case !lower:\n\t// \treturn fmt.Errorf(\"validate password: must contain lowercase\")\n\t// case !upper:\n\t// \treturn fmt.Errorf(\"validate password: must contain uppercase\")\n\t// case !digit:\n\t// \treturn fmt.Errorf(\"validate password: must contain digits\")\n\t// case !punct:\n\t// \treturn fmt.Errorf(\"validate password: must contain punctuation\")\n\t// }\n\treturn nil\n}", "title": "" }, { "docid": "2466c32da3f1390e099f30864e2756cf", "score": "0.5585981", "text": "func (p *Password) isValid() bool {\n\tresult := strings.Count(p.value, p.policy.letter)\n\treturn result >= p.policy.min && result <= p.policy.max\n}", "title": "" }, { "docid": "ab9b27f0ed8e0d8e94555fcfd9398ced", "score": "0.55799115", "text": "func (p PasswordEntry) IsValid() bool {\n\tvar count int\n\tfor _, letter := range p.Password {\n\t\tif letter == p.Letter {\n\t\t\tcount++\n\t\t}\n\t}\n\treturn count >= p.MinCount && count <= p.MaxCount\n}", "title": "" }, { "docid": "105b0ba9a1cd2070915dbfb1c5d0ac72", "score": "0.55691445", "text": "func PassGen(desiredLen, complexity int) string {\n\n\tpassword := make([]rune, desiredLen)\n\tpasswordIdx := 0\n\n\tfor i := 0; passwordIdx < desiredLen; i++ {\n\n\t\t// Skip this group is the password is too complex\n\t\tletterGroupIndex := letterGroupIndexes[i%len(letterGroupIndexes)]\n\t\tif (letterGroupIndex & complexity) == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tletters := letterGroups[letterGroupIndex]\n\t\tpassword[passwordIdx] = letters[rand.Intn(len(letters))]\n\t\tpasswordIdx++\n\t}\n\n\trand.Shuffle(desiredLen, func(i, j int) { password[i], password[j] = password[j], password[i] })\n\treturn string(password)\n}", "title": "" }, { "docid": "bde37773c2f5775d10e8a432cf22d7e6", "score": "0.553445", "text": "func appealSum(s string) int64 {\n\tvar n int64 = 0\n\t// for each len find a str\n\tfor i := 1; i <= len(s); i++ {\n\t\tfor j := 0; j <= len(s)-i; j++ {\n\t\t\tn += countLetters(s[j : j+i])\n\t\t}\n\t}\n\n\treturn n\n}", "title": "" }, { "docid": "4fb975a5feaa6395831f7cac80e54764", "score": "0.5495491", "text": "func main() {\n\tvar possibleSolutions int\n\n\tfor i := 134792; i < 675810; i++ {\n\t\tif !increasingNumbers(i) {\n\t\t\tcontinue\n\t\t}\n\n\t\tif !sameAdjacentDigits(i) {\n\t\t\tcontinue\n\t\t}\n\n\t\tpossibleSolutions++\n\t}\n\n\tfmt.Println(possibleSolutions)\n}", "title": "" }, { "docid": "feeed7d0253594f088ca4eedfea84563", "score": "0.54898316", "text": "func check_letters(b string) (x, y bool){\n m := make(map[rune]int)\n x = false \n y = false\n for _, c := range b{\n if _, found := m[c]; found {\n m[c] += 1\n } else {\n m[c] = 1\n }\n }\n\n for _, v := range m {\n if v == 2 {\n x = true\n }\n if v == 3 {\n y = true\n }\n }\n\n return x, y\n}", "title": "" }, { "docid": "86d12f711e13d8d407fed4842d5b7f2e", "score": "0.5478054", "text": "func (policy *passPolicy) checkPasswordPos(password string) bool {\n\tpassSplit := []rune(password)\n\tif len(passSplit) < policy.a || len(passSplit) < policy.b {\n\t\treturn false\n\t}\n\n\t// make sure both have different truth values!!\n\treturn (passSplit[policy.a-1] == policy.c) != (passSplit[policy.b-1] == policy.c)\n}", "title": "" }, { "docid": "adadaab36fed3f425ccb90be8147fbd0", "score": "0.54771703", "text": "func randpass(size int) string {\n\t// Somewhat password-friendly.\n\tpw := make([]byte, size)\n\tfor i := 0; i < size; i++ {\n\t\tn, err := rand.Int(rand.Reader, big.NewInt(int64(len(validchars))))\n\t\tif err != nil {\n\t\t\treturn \"\"\n\t\t}\n\t\tc := validchars[n.Int64()]\n\t\tpw[i] = c\n\t}\n\treturn string(pw)\n}", "title": "" }, { "docid": "5de319c71b39581a3051fea30c3103cf", "score": "0.5461218", "text": "func Password(n int, complex bool) string {\n\trand.Seed(time.Now().UnixNano())\n\tupper := strings.ToUpper(lower)\n\n\tpool := fmt.Sprintf(\"%s%s%s\", lower, upper, num)\n\tif complex {\n\t\tpool += alpha\n\t}\n\n\tpassword := make([]byte, n)\n\tfor i := 0; i < n; i++ {\n\t\tr := rand.Intn(len(pool))\n\t\tpassword[i] = pool[r]\n\t}\n\n\treturn string(password)\n}", "title": "" }, { "docid": "4a9ecd298f1b8ebc9cfdc04817f172e3", "score": "0.54275274", "text": "func passwordMatches(hashedPassword string, rawPassword string) bool {\n if hashedPassword == rawPassword {\n return true\n } else {\n return false\n }\n}", "title": "" }, { "docid": "1c994f265caeef7affaedc1a73dce4f1", "score": "0.54265827", "text": "func genPasswords(n, l int) (p []string, err error) {\n\tp = make([]string, n)\n\tfor i := 0; i < len(p); i++ {\n\t\tp[i], err = genPassword(l)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "4839ba625cd6fa6d5ea004785cd88623", "score": "0.54100895", "text": "func generateHashForPassword(password string, cost int) ([]string, error) {\n\tvar hashLines []string\n\n\thash, err := hashPassword(password, cost)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\thashLine := strings.Join([]string{password, hash}, \" \")\n\thashLines = append(hashLines, hashLine)\n\n\treturn hashLines, err\n}", "title": "" }, { "docid": "2e206634cb8724f20e4e0cb947c5ed06", "score": "0.5389246", "text": "func main() {\n start := time.Now()\n max_threshold := 1000000\n threshold := 1000000\n \n\n x := make ([]int, max_threshold)\n \n for i := 0; i < max_threshold; i++ {\n x[i] = 1;\n }\n \n x[0] = 0\n x[1] = 0\n\n i := 2;\n \n for i < max_threshold {\n for j := 2; (j * i) < (max_threshold); j++ {\n tmp := j * i;\n x[tmp] = 0\n }\n \n i++;\n for i < max_threshold && x[i] == 0 {\n i++;\n }\n }\n \n output := []int{}\n \n for i := 0; i < threshold; i++ {\n valid := true\n \n if (x[i] == 0) {\n continue;\n }\n \n temp := strconv.Itoa(i)\n \n if strings.Contains(temp, \"0\") {\n continue\n }\n \n for i := 0; i < len(temp); i++ {\n \n temp = temp[1:] + temp[:1]\n var perm, _ = strconv.Atoi(temp)\n \n if x[perm] == 0 {\n valid = false\n break\n }\n }\n \n if valid {\n output = append(output, i)\n }\n\n }\n \n for i := 0; i < len(output); i++ {\n fmt.Println(output[i]);\n }\n \n fmt.Println(\"Answer:\", len(output));\n\n fmt.Print(\"Total time: \")\n fmt.Println(time.Since(start).Seconds()) \n}", "title": "" }, { "docid": "d3d44ca5df8f330ec1ee9cd51973503a", "score": "0.5385178", "text": "func main() {\n\tfmt.Println(findLength([]int{0, 1, 1, 1, 1}, []int{1, 0, 1, 0, 1}))\n}", "title": "" }, { "docid": "8e4cd0a0efd99db1275bcfaf268f17cb", "score": "0.537037", "text": "func newPassword(pwdProfile PasswordProfileStruct) (string, error) {\r\n\tdebug(\"newPassword function call\")\r\n\tvar passwordChars []string\r\n\tvar password string\r\n\tvar allChars string\r\n\tif pwdProfile.Length == 0 {\r\n\t\tpwdProfile.Length = defaultStringLength\r\n\t}\r\n\r\n\tif (pwdProfile.ForceLower + pwdProfile.ForceUpper + pwdProfile.ForceNumeric + pwdProfile.ForceSpecial) > pwdProfile.Length {\r\n\t\treturn \"\", errors.New(\"sum of forced profile values is greater than total password length requested\")\r\n\t}\r\n\r\n\t//process lower chars\r\n\tif pwdProfile.UseLower {\r\n\t\tdebug(\"UseLower TRUE\")\r\n\t\tallChars += lcs\r\n\t}\r\n\tfor i := 0; i < pwdProfile.ForceLower; i++ {\r\n\t\tcharacter := getRune(lcs)\r\n\t\tpasswordChars = append(passwordChars, character)\r\n\t}\r\n\r\n\t//process upper chars\r\n\tif pwdProfile.UseUpper {\r\n\t\tdebug(\"UseUpper TRUE\")\r\n\t\tallChars += ucs\r\n\t}\r\n\tfor i := 0; i < pwdProfile.ForceUpper; i++ {\r\n\t\tcharacter := getRune(ucs)\r\n\t\tpasswordChars = append(passwordChars, character)\r\n\t}\r\n\r\n\t//process number chars\r\n\tif pwdProfile.UseNumeric {\r\n\t\tdebug(\"UseNumeric TRUE\")\r\n\t\tallChars += num\r\n\t}\r\n\tfor i := 0; i < pwdProfile.ForceNumeric; i++ {\r\n\t\tcharacter := getRune(num)\r\n\t\tpasswordChars = append(passwordChars, character)\r\n\t}\r\n\r\n\t//process special chars\r\n\tif pwdProfile.UseSpecial {\r\n\t\tdebug(\"UseSpecial TRUE\")\r\n\t\tallChars += spc\r\n\t}\r\n\tfor i := 0; i < pwdProfile.ForceSpecial; i++ {\r\n\t\tcharacter := getRune(spc)\r\n\t\tpasswordChars = append(passwordChars, character)\r\n\t}\r\n\r\n\t//Generate rest of password\r\n\tif len(passwordChars) < pwdProfile.Length {\r\n\t\tif allChars == \"\" {\r\n\t\t\tallChars = lcs + ucs + num + spc\r\n\t\t}\r\n\t\tmoreCharsLen := pwdProfile.Length - len(passwordChars)\r\n\t\tfor i := 0; i < moreCharsLen; i++ {\r\n\t\t\tcharacter := getRune(allChars)\r\n\t\t\tpasswordChars = append(passwordChars, character)\r\n\t\t}\r\n\t}\r\n\r\n\t//Shuffle slice, build password string\r\n\tvar src cryptoSource\r\n\trnd := rand.New(src)\r\n\tfor _, i := range rnd.Perm(len(passwordChars)) {\r\n\t\tpassword += passwordChars[i]\r\n\t}\r\n\r\n\tdebug(\"allChars: \" + allChars)\r\n\tdebug(\"passwordChars: \" + strings.Join(passwordChars, \"\"))\r\n\tdebug(\"password: \" + password)\r\n\r\n\t//Check generated password isn't in blacklist\r\n\tif len(pwdProfile.Blacklist) > 0 {\r\n\t\tdebug(\"Blacklist Length: \" + strconv.Itoa(len(pwdProfile.Blacklist)))\r\n\t\tif isBlk := checkBlacklist(pwdProfile.Blacklist, password); isBlk {\r\n\t\t\tdebug(\"[BLACKLIST] Generated password in blacklist: \" + password)\r\n\t\t\tpassword, err := newPassword(pwdProfile)\r\n\t\t\tdebug(\"[BLACKLIST] New Password: \" + password)\r\n\t\t\tdebug(\"[BLACKLIST] Error: \" + err.Error())\r\n\t\t\treturn password, err\r\n\t\t}\r\n\t\tdebug(\"Password not found in Blacklist\")\r\n\t}\r\n\r\n\t//Check generated password doesn't contain any of the strings provided in the MustNotContain array\r\n\tif len(pwdProfile.MustNotContain) > 0 {\r\n\t\tdebug(\"MustNotContain Length: \" + strconv.Itoa(len(pwdProfile.MustNotContain)))\r\n\t\tif containsStr := checkContain(pwdProfile.MustNotContain, password); containsStr {\r\n\t\t\tdebug(\"[MUSTNOTCONTAIN] Generated password contains restricted string: \" + password)\r\n\t\t\tpassword, err := newPassword(pwdProfile)\r\n\t\t\tdebug(\"[MUSTNOTCONTAIN] New Password: \" + password)\r\n\t\t\tdebug(\"[MUSTNOTCONTAIN] Error: \" + err.Error())\r\n\t\t\treturn password, err\r\n\t\t}\r\n\t\tdebug(\"Password does not contain restricted strings\")\r\n\t}\r\n\tdebug(\"Returning Password: \" + password)\r\n\treturn password, nil\r\n}", "title": "" }, { "docid": "13560dc3fd11654508141f4c555ae1eb", "score": "0.5361607", "text": "func checkPassword(pwd string) string {\n\t// valid: a UTF-8 encoded string consisting of a minimum of 6 and a maximum of 25 characters. The accepted range of characters is [U+0021, U+007A]\n\t// strong: at least 1 lowercase letter, 1 uppercase, 1 special, at least len of 10\n\t// medium: same as strong except it will not contain special characters and its length must be greater or equal to 8 characters\n\t// weak: All other valid passwords\n\n\t// a minimum of 6 and a maximum of 25 characters\n\tif len(pwd) < 6 || len(pwd) > 25 {\n\t\treturn \"invalid\"\n\t}\n\n\tpwdBytes := []byte(pwd)\n\n\t// check if password contains an invalid character, The accepted range of characters is [U+0021, U+007A]\n\tinvalid, err := regexp.Match(`[\\x{0000}-\\x{0020}\\x{007B}-\\x{FFFF}]`, pwdBytes)\n\tif invalid || err != nil {\n\t\treturn \"invalid\"\n\t}\n\n\tuppercaseExists, _ := regexp.Match(\"[A-Z]+\", pwdBytes)\n\tlowercaseExists, _ := regexp.Match(\"[a-z]+\", pwdBytes)\n\tspecialExists, _ := regexp.Match(\"[!\\\"#$%&'\\\\(\\\\)\\\\*\\\\+,-./\\\\:;<=>?@\\\\[\\\\\\\\\\\\]\\\\^\\\\_]\", pwdBytes)\n\n\tif uppercaseExists && lowercaseExists {\n\t\tif specialExists && len(pwd) >= 10 {\n\t\t\treturn \"strong\"\n\t\t} else if len(pwd) >= 8 {\n\t\t\treturn \"medium\" // it will not contain special characters !!! this is conflict\n\t\t}\n\t}\n\n\treturn \"weak\"\n}", "title": "" }, { "docid": "79645be274a3c604e6423a6f94550c61", "score": "0.53442496", "text": "func ValidPart2(pwd string) bool {\n\tpwdLength := len(pwd)\n\n\tif pwdLength != validPasswordLength {\n\t\treturn false\n\t}\n\n\tcurrentAdjacent := 1\n\tadjacent := false\n\tprevDigit := pwd[0]\n\tfor index := 1; index < pwdLength; index++ {\n\t\tdigit := pwd[index]\n\n\t\tif digit < prevDigit {\n\t\t\treturn false\n\t\t} else if digit == prevDigit {\n\t\t\tcurrentAdjacent++\n\t\t} else {\n\t\t\tadjacent = adjacent || currentAdjacent == 2\n\t\t\tcurrentAdjacent = 1\n\t\t}\n\n\t\tprevDigit = digit\n\t}\n\tadjacent = adjacent || currentAdjacent == 2\n\n\treturn adjacent\n}", "title": "" }, { "docid": "0af22c40b585866885984830af57988a", "score": "0.534377", "text": "func countPrimeSetBits(L int, R int) int {\n \n}", "title": "" }, { "docid": "513d3e1a99deb34cea912a76f69553db", "score": "0.5321573", "text": "func GeneratePasswords(t *string, n *int, l *int) ([]string, error) {\n\tvar r []string\n\tvar p string\n\tvar err error\n\tmrand.Seed(time.Now().UTC().UnixNano()) // this needs to move anywhere it will only be called once; moved after refactor 6/18/17\n\n// GenerateNumericPasswords generates multiple random numeric passwords\n// n (*int) = a pointer to a value specifying the number of passwords to generate (int)\n// l (*int) = a pointer to a value specifying the length of each password (int)\n// Returns an array of generated passwords ([]string)\nfunc GenerateNumericPasswords(n *int, l *int) []string {\n\tmrand.Seed(time.Now().UTC().UnixNano()) // consider moving this to main goroutine for highly concurrent usage\n\tvar r []string\n\tfor i := 0; i < *n; i++ {\n\t\tswitch {\n\t\tcase *t == \"a\", *t == \"alphanumeric\":\n\t\t\tp = generateAlphanumericPassword(l)\n\t\tcase *t == \"n\", *t == \"numeric\":\n\t\t\tp = generateNumericPassword(l)\n\t\tdefault:\n\t\t\terr = fmt.Errorf(`\"%s\" is not a supported flag value for \"type\". Supported values are \"alphanumeric\"/\"a\" and \"numeric\"/\"n\".\\n`, *t)\n\t\t\tbreak\n\t\t}\n\t\tr = append(r, p)\n\t}\n\treturn r, err\n}\n", "title": "" }, { "docid": "6db2c9a5b680532844d67ba8ec0cca32", "score": "0.5309407", "text": "func ValidPart1(pwd string) bool {\n\tpwdLength := len(pwd)\n\n\tif pwdLength != validPasswordLength {\n\t\treturn false\n\t}\n\n\tadjacent := false\n\tprevDigit := pwd[0]\n\tfor index := 1; index < pwdLength; index++ {\n\t\tdigit := pwd[index]\n\n\t\tif digit < prevDigit {\n\t\t\treturn false\n\t\t} else if digit == prevDigit {\n\t\t\tadjacent = true\n\t\t}\n\n\t\tprevDigit = digit\n\t}\n\n\treturn adjacent\n}", "title": "" }, { "docid": "5ba74d9cf07b18bf776619b019ee7c03", "score": "0.5295549", "text": "func CompareLengths(p Passphrase, m int) string {\n\tn := len(p.Phrase)\n\tvar password string\n\tswitch {\n\tcase n == m:\n\t\tfmt.Println(\"Same lengths.\")\n\t\tpassword = SameLengths(p, n)\n\n\tcase n > m:\n\t\t//fmt.Println(\"Phrase longer than desired.\")\n\t\tpassword = Longer(p, m)\n\tcase n < m:\n\t\tfmt.Println(\"Phrase shorter than desired.\")\n\t\tpassword = Shorter(p, m, n)\n\t}\n\treturn password\n}", "title": "" }, { "docid": "97acd3d7e134fd7a61a0a8e7ec158ae9", "score": "0.52840745", "text": "func PasswordResstrictions(oldPassword string, newPassword string, retypeNewPassword string) {\n\tlog := util.Logger()\n\n\t//Checking that we did not get the same password as the old one\n\tif newPassword == oldPassword {\n\t\tlog.Fatalf(`❌ The password cannot match the old password, aborting.`)\n\t}\n\n\t//Checking that we got the same password twice\n\tif newPassword != retypeNewPassword {\n\t\tlog.Fatalf(`❌ The password and is not matching the retype, aborting.`)\n\t}\n\n\t//TODO... This is the place for adding more restrictions\n\t// length of password\n\t// charecters\n\n}", "title": "" }, { "docid": "f2fe2410a93faae8988128c9c02f3fb5", "score": "0.52778894", "text": "func CryptarithmeticAdditionPuzzle(first, second, result string) map[rune]int {\n\tletters := make(map[rune]struct{}, 10)\n\tfor _, part := range []string{first, second, result} {\n\t\tfor _, r := range part {\n\t\t\tletters[r] = struct{}{}\n\t\t}\n\t}\n\tif len(letters) > 10 {\n\t\treturn nil\n\t}\n\trunes := make([]rune, 0, len(letters))\n\tfor r := range letters {\n\t\trunes = append(runes, r)\n\t}\n\tsort.Slice(runes, func(i, j int) bool {\n\t\treturn runes[i] < runes[j]\n\t})\n\tavailDigits := make([]bool, 10)\n\tfor i := 0; i < 10; i++ {\n\t\tavailDigits[i] = true\n\t}\n\treturn backtrackingSearch(runes, make(map[rune]int), availDigits, first, second, result)\n}", "title": "" }, { "docid": "00a2e4ecfa1cb97030dcc0952339088d", "score": "0.527747", "text": "func kaprekarNumbers(p, q int64) {\n\tvar count int64\n\tfor i := p; i <= q; i++ {\n\t\tif i == sumSeparateDigits(i*i) {\n\t\t\tcount++\n\t\t\tfmt.Printf(\"%d \", i)\n\t\t}\n\t}\n\tif count == 0 {\n\t\tfmt.Print(\"INVALID RANGE\")\n\t}\n\tfmt.Println()\n}", "title": "" }, { "docid": "878df0c4313c41cf3189cb39302fff79", "score": "0.5261625", "text": "func countUsefulFactors(v, min int) int {\n\tsmallPrimes := []int{2,3,5,7}\n\tvar cnt int\n\tfor _, n := range smallPrimes {\n\t\tfor v % n == 0 {\n\t\t\tv /= n\n\t\t\tif v < min {\n\t\t\t\treturn cnt\n\t\t\t}\n\t\t\tcnt++\n\t\t}\n\t}\n\treturn cnt\n}", "title": "" }, { "docid": "ebcc0b3a4e0caeceabc20a8a2f28ac3b", "score": "0.5246747", "text": "func checkPositionAllowed(password string, target string, first int, second int) (allowed bool) {\n\tfirstAllowed := string(password[first - 1]) == target\n\tsecondAllowed := string(password[second - 1]) == target\n\tallowed = (firstAllowed || secondAllowed) && !(firstAllowed && secondAllowed)\n\treturn\n}", "title": "" }, { "docid": "07a5aa1db4b45c8817aa8ac20bcb6dc8", "score": "0.5227847", "text": "func isCryptSolution(crypt []string, solution [][]string) bool {\n\tvar letterToNumber = map[string]string{} // map letter > number\n\tvar equation = []string{\"\", \"\", \"\"} // number1, number2, result\n\n\tfor _, pair := range solution {\n\t\tletter := pair[0]\n\t\tnumber := pair[1]\n\t\tletterToNumber[letter] = number\n\t}\n\n\tfor wordIndex := 0; wordIndex < len(crypt); wordIndex++ {\n\t\tword := crypt[wordIndex] // a word in crypt\n\t\tzeroExist := false\n\n\t\tfor index := 0; index < len(word); index++ {\n\t\t\t// number that correspond with the letter\n\t\t\tnumber := letterToNumber[string(word[index])]\n\n\t\t\tif zeroExist { // if zero exist at start then exit\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif number == \"0\" && index == 0 {\n\t\t\t\tzeroExist = true\n\t\t\t}\n\t\t\tequation[wordIndex] += number\n\t\t}\n\t}\n\t// As usual GoLang makes stuff fun :D\n\t// I didnt want to repeat this 3 times so why not make\n\t// A mini function :)\n\tparseInt := func(str string) int64 {\n\t\tnumber, err := strconv.ParseInt(str, 10, 64)\n\t\tif err == nil {\n\t\t\treturn number\n\t\t}\n\t\tpanic(err)\n\t}\n\n\t// Evaluate the equation and see if its valid\n\treturn parseInt(equation[0])+parseInt(equation[1]) == parseInt(equation[2])\n}", "title": "" }, { "docid": "af271c82fd7b9171e99aa1418d21cc14", "score": "0.5212368", "text": "func isValid(password string, mustHaveSeq2 bool) bool {\n\tif len(password) != passwordLen {\n\t\treturn false\n\t}\n\tseq := new(sequence.Sequence)\n\tfor i := 0; i < passwordLen; i++ {\n\t\tcurrent := password[i]\n\t\tif j := i + 1; j < passwordLen && current > password[j] {\n\t\t\treturn false // Decreasing digits are invalid\n\t\t}\n\t\tif current == seq.Last() {\n\t\t\tseq.Add(current)\n\t\t\tcontinue\n\t\t}\n\t\tseq.Ended()\n\t\tseq.Reset(current)\n\t}\n\tseq.Ended() // Last digit ends a sequence\n\tif mustHaveSeq2 {\n\t\treturn seq.Found2\n\t}\n\treturn seq.Found\n}", "title": "" }, { "docid": "535ba852f5c0e5e2f975dcabe10c6f4f", "score": "0.5189751", "text": "func is_concomitant(layout []string, letter1, letter2 string) bool {\n var i1 int = index(layout, letter1)\n var i2 int = index(layout, letter2)\n\n var c1 int\n var c2 int\n\n if i1 >= 0 && i2 >= 0 {\n c1 = i1 % 6\n c2 = i2 / 6\n return c1 == c2\n } else {\n return false\n }\n}", "title": "" }, { "docid": "fc0e6d2ec04c51470cbacf075f01a781", "score": "0.5186326", "text": "func Solve2() int {\n\tvar i int\n\tpasslist := ParseLines(input)\n\tfor _, p := range passlist {\n\t\ti += validatepass2(p)\n\t}\n\treturn i\n}", "title": "" }, { "docid": "68235f41ae5cb5266d94691d0b338728", "score": "0.51819676", "text": "func countingValleys(n int32, s string) int32 {\n\tcountStep := 0\n\tvar countValley int32 = 0\n\tfirstStep := \"\"\n\n\tfor _, step := range s {\n\t\tstepS := string(step)\n\n\t\t// Count steps\n\t\tif stepS == \"D\" {\n\t\t\tcountStep += 1\n\t\t} else {\n\t\t\tcountStep -= 1\n\t\t}\n\n\t\tif countStep == 0 {\n\n\t\t\tif firstStep == \"D\" {\n\t\t\t\tcountValley += 1\n\t\t\t}\n\n\t\t\tfirstStep = \"\"\n\t\t\tfmt.Println(\"countValley: \", countValley)\n\n\t\t} else if countStep == 1 && firstStep == \"\" {\n\t\t\tfirstStep = stepS\n\t\t\tfmt.Println(\"firstStep: \", firstStep)\n\t\t}\n\n\t}\n\n\treturn countValley\n\n}", "title": "" }, { "docid": "4862b699e892c540dd4db0c92efeac4a", "score": "0.5180792", "text": "func CheckModulosAreSatisfied(breakpoints []int, number int, totalElementsToChooseFrom int) (bool, []int) {\n\n\n\t//use an input number and convert it to binary string\n\tbinaryString := fmt.Sprintf(\"%b\", number)\n\n\t//make sure the binary string is long as the elements to choose from\n\tfor len(binaryString) < totalElementsToChooseFrom{\n\t\tbinaryString = \"0\" + binaryString\n\t}\n\n\t//convert the binary string to have its bits be held in an []int slice\n\t//the left most bit is the most significant\n\tbinaryCursor := []int{}\n\n\tfor i := 0; i < len(binaryString); i++ {\n\n\t\tcurrentBit := rune(binaryString[i])\n\n\t\tif(currentBit == '0'){\n\t\t\tbinaryCursor = append(binaryCursor, 0)\n\t\t}else if(currentBit == '1'){\n\t\t\tbinaryCursor = append(binaryCursor, 1)\n\t\t}else{\n\t\t\tpanic(\"unkown bit CheckModulosAreSatisfied()\")\n\t\t}\n\t}\n\n\t//used to help check the binaryCursor \n\t//won't yield an invalid combination\n\thorizontalCursor := len(binaryCursor) - 1\n\n\tdoneCheckingMods := false\n\n\tlastIndex := len(binaryCursor) - 1\n\n\n\t//this for loop uses the modulus operator along with the generated breakpoints\n\t//to ensure that there is never two high bits inbetween break points\n\t//this would mean that two elements of the same inner slice of the original\n\t//2D slice would be in a combination together violating the expected output\n\tfor !doneCheckingMods {\n\n\t\tcurrentModDoneBeingChecked := false\n\n\t\tsummation := float64(0)\n\n\t\tfor !currentModDoneBeingChecked {\n\n\t\t\tcurrentAdditionToSummation := math.Pow(2, float64(lastIndex - horizontalCursor))\n\n\n\t\t\tif(binaryCursor[horizontalCursor] == 1){\n\t\t\n\t\t\t\tsummation = summation + currentAdditionToSummation\n\n\t\t\t}\n\n\t\t\tif(IsABreakPoint(horizontalCursor, breakpoints)){\n\n\t\t\t\tintSummation := int(summation)\n\n\t\t\t\tintCurrentAdditionToSummation := int(currentAdditionToSummation)\n\n\t\t\t\tif(intSummation == 0){\n\t\t\t\t\thorizontalCursor = horizontalCursor - 1\n\t\t\t\t\tcurrentModDoneBeingChecked = true\n\t\t\t\t}else if( (intCurrentAdditionToSummation % intSummation == 0)){\n\t\t\t\t\thorizontalCursor = horizontalCursor - 1\n\n\t\t\t\t\tcurrentModDoneBeingChecked = true\n\n\t\t\t\t}else{\n\t\t\t\t\treturn false, binaryCursor\n\t\t\t\t}\n\n\t\t\t}else{\n\t\t\t\thorizontalCursor = horizontalCursor - 1\n\t\t\t}\n\n\n\t\t}\n\t\t\n\t\tif(horizontalCursor == -1){\n\t\t\treturn true, binaryCursor\n\t\t}\n\n\t}\n\n\treturn true, binaryCursor\n}", "title": "" }, { "docid": "71319055ec4399c4871baf41ad25a36c", "score": "0.5170046", "text": "func countLuckyNumber6and8(low int64, high int64) int64 {\n\th := getdigits(high)\n\t// l := getdigits(low)\n\tcount := int64(0)\n\tif h <= 4 {\n\t\tcount = calcNormal(low, high)\n\t\treturn count\n\t}\n\n\treturn count\n}", "title": "" }, { "docid": "1f52cbb01e80b0dae427ae939df8cdf9", "score": "0.51698077", "text": "func getTotalX_bruteforce(a []int32, b []int32) int32 {\n\tsort.Slice(a, func(i, j int) bool { return a[i] < a[j] })\n\tsort.Slice(b, func(i, j int) bool { return b[i] < b[j] })\n\n\tvar count int32 = 0\n\n\tfor i := a[len(a)-1]; i <= b[0]; i++ {\n\t\tif is_all_factors(i, a) && is_factor_of(i, b) {\n\t\t\tcount += 1\n\t\t}\n\n\t}\n\tfmt.Println(count)\n\treturn count\n}", "title": "" }, { "docid": "bd878648a7966dedd8768d59f6b3c380", "score": "0.5163326", "text": "func findAnagrams(s string, p string) []int {\n\trequired := [26]int{} // Strings consists of lowercase English letters only\n\tfor _, c := range p {\n\t\trequired[c-'a']++\n\t}\n\tlength := len(p)\n\tleft := 0\n\tresults := []int{}\n\tfor _, c := range s {\n\t\tb := c - 'a'\n\t\trequired[b]--\n\t\tlength--\n\t\tif required[b] < 0 {\n\t\t\tfor {\n\t\t\t\tl := left\n\t\t\t\tleft++\n\t\t\t\trequired[s[l]-'a']++\n\t\t\t\tlength++\n\t\t\t\tif s[l] == byte(c) {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif length == 0 {\n\t\t\tresults = append(results, left)\n\t\t\trequired[s[left]-'a']++\n\t\t\tlength++\n\t\t\tleft++\n\t\t}\n\t}\n\treturn results\n}", "title": "" }, { "docid": "e50f68b3a374946637912132bc55105c", "score": "0.5161198", "text": "func rotatedDigits(N int) int {\n\tcount := 0\n\tfor i := 1; i <= N; i++ {\n\t\tif isValid(i) {\n\t\t\tcount++\n\t\t}\n\t}\n\treturn count\n}", "title": "" }, { "docid": "d38bb7023d2d1cd7dfb280c60dc2d2fc", "score": "0.51476324", "text": "func CalculateValidPassports(lines []string) (part1Valid int, part2Valid int) {\n\tpart1Valid, part2Valid = 0, 0\n\tvar sanitizedLines []string\n\tsanitizedIndex := 0\n\tfor i, line := range lines {\n\t\tif line == \"\" {\n\t\t\t// If empty line increment sanitized index (next line will be a new passport)\n\t\t\tsanitizedIndex++\n\t\t} else if (len(sanitizedLines)) == sanitizedIndex {\n\t\t\t// the current index needs to be created\n\t\t\tsanitizedLines = append(sanitizedLines, line)\n\t\t} else {\n\t\t\t// the current index already exists, append to it\n\t\t\tsanitizedLines[sanitizedIndex] += \" \" + line\n\t\t}\n\n\t\tif i+1 == len(lines) || lines[i+1] == \"\" {\n\t\t\t// If the next line is blank or it is the end of the slice,\n\t\t\t// convert the current sanitizedLine to a passport and append it to the passports slice\n\t\t\tpassport := ConvertLineToPassport(sanitizedLines[sanitizedIndex])\n\n\t\t\tif IsPassportValidPart1(passport) {\n\t\t\t\tpart1Valid++\n\t\t\t}\n\n\t\t\tif IsPassportValidPart2(passport) {\n\t\t\t\tpart2Valid++\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "905519a211ab583e73791b39652a68bb", "score": "0.51373184", "text": "func countGoodTriplets(arr []int, a int, b int, c int) (count int) {\n\tsize := len(arr)\n\tfor i := 0; i < size; i++ {\n\t\tfor j := i + 1; j < size; j++ {\n\t\t\tif myAbs(arr[i]-arr[j]) > a {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor k := j + 1; k < size; k++ {\n\t\t\t\tif myAbs(arr[j]-arr[k]) > b || myAbs(arr[i]-arr[k]) > c {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "bb98bf78d3a83b3c40abffa08395511a", "score": "0.5133582", "text": "func PartA(input string) int {\n\tcount := 0\n\tfor i := 0; i < 128; i++ {\n\t\tkeystring := input + \"-\" + strconv.Itoa(i)\n\t\tdenseHash := knothash.PartB(keystring)\n\t\tfor _, char := range denseHash {\n\t\t\tbitMask := convertToBitmask(char)\n\t\t\tfor _, c := range bitMask {\n\t\t\t\tif c == '1' {\n\t\t\t\t\tcount++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn count\n}", "title": "" }, { "docid": "d87f690659463be55d0b29c157ec484d", "score": "0.5130419", "text": "func GetPasswordScore(password string, userInput []string) (int, error) {\n\tif minLength != -1 && len(password) < minLength {\n\t\treturn 0, errors.New(\"Password must have at least \" + strconv.Itoa(minLength) + \" characters!\")\n\t}\n\tif maxLength != -1 && len(password) > maxLength {\n\t\treturn 0, errors.New(\"Password must be not longer than \" + strconv.Itoa(maxLength) + \" characters!\")\n\t}\n\tmatch := determinePasswordStrength(password, userInput)\n\treturn match.Score, nil\n}", "title": "" }, { "docid": "979e89d5634262a877e1388cddaef523", "score": "0.51219845", "text": "func countSubstringsSlow(s string) int {\n count := 0\n for i := 0; i < len(s); i++ {\n for j := i + 1; j <= len(s); j++ {\n if isPalindrom(s[i:j]) {\n count++\n }\n }\n }\n return count\n}", "title": "" }, { "docid": "b3916e5eac01413bd0b2f0b8e771874c", "score": "0.5113682", "text": "func GeneratePassword(keywords []string, l int) string {\n\tkw := strings.Join(keywords, \"\")\n\tif len(kw) == 0 {\n\t\tkw = \"abcdefghijklmno\"\n\t}\n\tif l == 0 {\n\t\tl = 10\n\t\tif l > len(kw) {\n\t\t\tl = len(kw)\n\t\t}\n\t}\n\n\tpwd := \"\"\n\tfor l > 0 {\n\t\tpwd += string(kw[rand.Int()%len(kw)])\n\t\tl--\n\t}\n\treturn pwd\n}", "title": "" }, { "docid": "ff69b1a928eb1f9c8678bd030a895cdf", "score": "0.51089114", "text": "func validateRoom(charCounts map[string]int, ordered []int, checksum string) bool {\n\tfor i := 0; i < len(checksum); i++ {\n\t\tcurrent := string(checksum[i])\n\t\tif charCounts[current] != ordered[i] {\n\t\t\treturn false\n\t\t}\n\t\tif i < len(checksum)-1 {\n\t\t\tnext := string(checksum[i+1])\n\t\t\tif charCounts[current] == charCounts[next] {\n\t\t\t\tif current > next {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "f497732c31da57443a35f20a3118e79a", "score": "0.5105013", "text": "func CountUsedSquares(in []string) int64 {\n\tvar totalUsed int64\n\tfor _, s := range in {\n\t\thash := knothash.Hash(256, s)\n\t\tfor _, r := range hash {\n\t\t\tfor n, _ := strconv.ParseInt(string(r), 16, 8); n != 0; n = n >> 1 {\n\t\t\t\ttotalUsed += n & 1\n\t\t\t}\n\t\t}\n\t}\n\treturn totalUsed\n}", "title": "" }, { "docid": "f098c170457bb7c3064a19b15fbbeb8d", "score": "0.51021016", "text": "func FullTest1(t *testing.T) {\n // Whole puzzle\n initialString := \".237....68...6.59.9.....7......4.97.3.7.96..2.........5..47.........2....8.......\"\n solutionString := \"123759486874261593965384721216543978357896142498127365532478619641932857789615234\"\n runTest(t, initialString, solutionString)\n}", "title": "" }, { "docid": "b153b989ea546d601fcff326a8946e1a", "score": "0.51004636", "text": "func solutionLvl2(puzzle string, parameters map[string]int) (answer int) {\n\tpps := getInput(puzzle)\n\n\tstart := time.Now()\nPassportLoop:\n\tfor _, passport := range pps {\n\t\tif len(passport) < 7 || (len(passport) == 7 && passport[\"cid\"] != \"\") {\n\t\t\tcontinue\n\t\t} else {\n\t\t\tfor key, policy := range Policies {\n\t\t\t\tif passport[key] == \"\" ||\n\t\t\t\t\t!(policy.Rule.MatchString(passport[key]) && policy.Validate(passport[key])) {\n\t\t\t\t\tcontinue PassportLoop\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tanswer++\n\t}\n\n\telapsed := time.Since(start)\n\tfmt.Printf(\" Without input time 2 took %s\\n\", elapsed)\n\treturn\n}", "title": "" }, { "docid": "1c39bb452c4d9614ca094c96b134bde6", "score": "0.50923467", "text": "func (us UserService) comparePassword(password []byte, hash string) bool {\n\tvar (\n\t\ttime uint32\n\t\tmemory uint32\n\t\tthreads uint8\n\t\tkeyLen uint32\n\t)\n\n\tparts := strings.Split(hash, \"$\")\n\n\tif len(parts) != 6 {\n\t\tus.logger.Printf(\"AuthService.comparePassword(): invalid hash len(parts) = %v\", len(parts))\n\t\treturn false\n\t}\n\n\t_, err := fmt.Sscanf(parts[3], \"m=%d,t=%d,p=%d\", &memory, &time, &threads)\n\tif err != nil {\n\t\tus.logger.Printf(\"AuthService.comparePassword(): Sscanf(parts[3]): %s\", err)\n\t\treturn false\n\t}\n\n\tsalt, err := base64.RawStdEncoding.DecodeString(parts[4])\n\tif err != nil {\n\t\tus.logger.Printf(\"AuthService.comparePassword(): base64.RawStdEncoding.DecodeString(parts[4]): %s\", err)\n\t\treturn false\n\t}\n\n\tdecodedHash, err := base64.RawStdEncoding.DecodeString(parts[5])\n\tif err != nil {\n\t\tus.logger.Printf(\"AuthService.comparePassword(): base64.RawStdEncoding.DecodeString(parts[5]): %s\", err)\n\t\treturn false\n\t}\n\tkeyLen = uint32(len(decodedHash))\n\n\tcomparisonHash := argon2.IDKey(password, salt, time, memory, threads, keyLen)\n\treturn subtle.ConstantTimeCompare(decodedHash, comparisonHash) == 1\n}", "title": "" }, { "docid": "5c45a70529b954d648138cf7fac71427", "score": "0.5074048", "text": "func main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n \tarr := make([]int, 101)\n\n \tcount := 0\n\n \tfor i := 0; i < n; i++ {\n \t\tvar colorCode int\n \t\tfmt.Scan(&colorCode)\n\n \t\tarr[colorCode]++\n\n \t\tif (arr[colorCode]%2 == 0){\n \t\tcount++\n \t\t}\n \t}\n\n \tfmt.Println(count)\n}", "title": "" }, { "docid": "73000f0d8b31897438898cb8879de0b5", "score": "0.50726116", "text": "func checkPasswordCost(hashedPwd string) bool {\n\tbyteHash := []byte(hashedPwd)\n\n\thashCost, costErr := bcrypt.Cost(byteHash)\n\tif costErr == nil && hashCost != bcrypt.DefaultCost {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "9f2a3eeee84d3e4ead319fda3e87cf91", "score": "0.50708216", "text": "func checkContain(blacklist []string, password string) bool {\r\n\tpwContainsRestricted := false\r\n\tfor _, v := range blacklist {\r\n\t\tif len(v) > 2 && strings.Contains(strings.ToLower(password), strings.ToLower(v)) {\r\n\t\t\tpwContainsRestricted = true\r\n\t\t\tbreak\r\n\t\t}\r\n\t}\r\n\treturn pwContainsRestricted\r\n}", "title": "" }, { "docid": "8799d32e920b9fb509edb6ae4d2732a3", "score": "0.50694716", "text": "func countBadPairs(nums []int) int64 {\n\tn := len(nums)\n\tgood := 0\n\tcnt := make(map[int]int)\n\tfor i, v := range nums {\n\t\tgood += cnt[v-i]\n\t\tcnt[v-i]++\n\t}\n\treturn int64(n*(n-1)/2 - good)\n}", "title": "" }, { "docid": "a7f6a2e3ff4a39c2e1e1d5b716743f2f", "score": "0.5069093", "text": "func PasswordContainsFold(v string) predicate.Nurse {\n\treturn predicate.Nurse(func(s *sql.Selector) {\n\t\ts.Where(sql.ContainsFold(s.C(FieldPassword), v))\n\t})\n}", "title": "" }, { "docid": "1070aa1d292b0c6c0deca6c759b1f11e", "score": "0.50615287", "text": "func GeneratePasswordBySetE(n int, sets ...string) (string, error) {\n\ts := \"\"\n\n\tif len(sets) == 0 {\n\t\tsets = []string{LowerLetters, UpperLetters, DigitsLetters}\n\t}\n\n\tl := len(sets)\n\n\tfor i := 0; i < n && i < l; i++ {\n\t\tr, err := randomElement(sets[i])\n\t\tif err != nil {\n\t\t\treturn s, err\n\t\t}\n\n\t\ts += r\n\t}\n\n\tfor i := l; i < n; i++ {\n\t\tri, err := rand.Int(rand.Reader, big.NewInt(int64(l)))\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\n\t\tr, err := randomElement(sets[ri.Int64()])\n\t\tif err != nil {\n\t\t\treturn s, err\n\t\t}\n\n\t\ts += r\n\t}\n\n\treturn s, nil\n}", "title": "" }, { "docid": "0407913b7a3143d956ba72d683b8fe24", "score": "0.5049119", "text": "func TestValidator_Validate_PasswordTooShort_Invalid(t *testing.T) {\n\tval := NewValidator()\n\n\t// Length = 7\n\tpass := \"ZI(9§sl\"\n\tassert.False(t, val.Validate(pass), \"The password should be invalid\")\n}", "title": "" }, { "docid": "14ce2dd65cfb8b35cecc056a063f9b16", "score": "0.50488234", "text": "func solve1(input string) string {\n\t// basically each house i get 10 * (sum of numbers < i where n % i == 0)\n\t// the numbers are the factors and combinations of the factors\n\ttarget, _ := strconv.Atoi(strings.TrimSpace(input))\n\n\tfor house := 100000; house < 2000000; house++ {\n\t\tp := numPresents(house)\n\t\tif p > target {\n\t\t\treturn fmt.Sprintf(\"%d\", house)\n\t\t}\n\t\t// if house < 20 {\n\t\t// \tfmt.Println(\"house:\", house, \"presents:\", p)\n\t\t// } else {\n\t\t// \tpanic(\"\")\n\t\t// }\n\t}\n\treturn \"nope\"\n}", "title": "" }, { "docid": "418685e2ed46598797f97e3a25091938", "score": "0.50468224", "text": "func CollectNewPassword() string {\n\tpassword := \"\"\n\tconfirmed_password := false\n\tfor !confirmed_password {\n\t\tpassword = ReadString(\"Set a new password\", \"\", true)\n\t\tcheck := ReadString(\"Confirm\", \"\", true)\n\t\tif password == check {\n\t\t\tconfirmed_password = true\n\t\t} else {\n\t\t\tcolor.HiRed(\"Password mismatch, please try again\")\n\t\t}\n\t}\n\treturn password\n}", "title": "" }, { "docid": "33a4a3eb3283d07c9c61a16694d0529c", "score": "0.5038742", "text": "func countPrimeSetBits(L int, R int) int {\n\tprimes := []int{2, 3, 5, 7, 11, 13, 17, 19} // R <= 10^6\n\tcount := 0\n\n\tfor i := L; i <= R; i++ {\n\t\tif isInSlice(bits.OnesCount(uint(i)), primes) {\n\t\t\tcount++\n\t\t}\n\t}\n\n\treturn count\n}", "title": "" }, { "docid": "aac54c5094bef95622bfc6082db3e99e", "score": "0.5037758", "text": "func main() {\n\tpassword := checkArgs()\n\tfmt.Println(\"Password = \" + password)\n\n\tsalt := generateSalt()\n\tfmt.Println(\"Salt = \" + salt)\n\n\tresult := hashPassword(password, salt)\n\tfmt.Println(\"Hashed Value returned from hashPassword() = \" + result)\n}", "title": "" }, { "docid": "6b555be47fd510cdce9c6b4186e7aaaa", "score": "0.503738", "text": "func kaprekarNumbers(p int32, q int32) {\n var found bool = false\n\n for n := int64(p); n <= int64(q); n++ {\n s := n * n\n d := len(strconv.Itoa(int(n)))\n ss := strconv.Itoa(int(s))\n if len(ss) % 2 == 1 {\n ss = \"0\" + ss\n }\n\n r, _ := strconv.Atoi(ss[:d])\n l, _ := strconv.Atoi(ss[d:])\n k := int(n) == (r + l)\n \n if k {\n fmt.Print(n, \" \")\n found = true\n }\n }\n\n if !found {\n fmt.Println(\"INVALID RANGE\")\n }\n}", "title": "" }, { "docid": "71ea90fb749c344895403089b6226cc8", "score": "0.50366336", "text": "func Solve1() int {\n\tvar i int\n\tpasslist := ParseLines(input)\n\tfor _, p := range passlist {\n\t\ti += validatepass1(p)\n\t}\n\treturn i\n}", "title": "" }, { "docid": "40fb9035a65b8abb46dbfd1e93966950", "score": "0.5034096", "text": "func numWays(s string) int {\n\tc := 0\n for i:=0; i<len(s); i++ {\n \tif s[i]=='1' {\n \t\tc++\n\t\t}\n\t}\n\tif c%3 != 0 {\n\t\treturn 0\n\t}\n\tmod := int(1e9+7)\n\tif c == 0 {\n\t\treturn ((len(s)-1)*(len(s)-2)/2) % mod\n\t}\n\tc = c/3\n\tvar p1, p2, p3, p4 = -1, -1, -1, -1\n\tp := 0\n\tfor i:=0; i<len(s); i++ {\n\t\tif s[i]=='1' {\n\t\t\tp++\n\t\t}\n\t\tif p1==-1 && p==c {\n\t\t\tp1 = i\n\t\t}\n\t\tif p2==-1 && p==c+1 {\n\t\t\tp2 = i\n\t\t}\n\t\tif p3==-1 && p==2*c {\n\t\t\tp3 = i\n\t\t}\n\t\tif p4==-1 && p==2*c+1 {\n\t\t\tp4 = i\n\t\t}\n\t}\n\treturn ((p2-p1)*(p4-p3)) % mod\n}", "title": "" }, { "docid": "a1ba2300228009585c79184d8413c05c", "score": "0.50240743", "text": "func findAnagrams(s, p string) []int {\n\twin := make(map[byte]int)\n\tneed := make(map[byte]int)\n\tfor i := 0; i < len(p); i++ {\n\t\tneed[p[i]]++\n\t}\n\tleft, right, match := 0, 0, 0\n\tans := make([]int, 0)\n\tfor right < len(s) {\n\t\tc := s[right]\n\t\tright++\n\t\tif need[c] != 0 {\n\t\t\twin[c]++\n\t\t\tif win[c] == need[c] {\n\t\t\t\tmatch++\n\t\t\t}\n\t\t}\n\t\tfor right-left >= len(p) {\n\t\t\tif right-left == len(p) && match == len(need) {\n\t\t\t\tans = append(ans, left)\n\t\t\t}\n\t\t\td := s[left]\n\t\t\tleft++\n\t\t\tif need[d] != 0 {\n\t\t\t\tif win[d] == need[d] {\n\t\t\t\t\tmatch--\n\t\t\t\t}\n\t\t\t\twin[d]--\n\t\t\t}\n\t\t}\n\t}\n\treturn ans\n}", "title": "" }, { "docid": "e340df647b9fead8c7d331fb2ddcef97", "score": "0.50206286", "text": "func (f *Form) PasswordComplexity() {\n\tpass := f.Get(\"password\")\n\tgpuPass := gpu.New(pass) \n gpuPass.ProcessPassword()\n if gpuPass.ComplexityRating() == \"Horrible\" || gpuPass.ComplexityRating() == \"Weak\" {\n\t\tf.Errors.Add(\"password\", \"Your password is too weak. Please use alpha-numeric, mixed case, and special characters.\")\n\t}\n}", "title": "" }, { "docid": "2c59e07ce04f5c58c0656a98fd9cec0e", "score": "0.5020123", "text": "func TestHashPassword(t *testing.T) {\n hash, err := HashPassword(testPassword)\n if err != nil {\n t.Errorf(\"HashPassword returned err: %s\", err.Error())\n }\n\n if len(hash) == 0 {\n t.Error(\"len(HashPassword) is 0\")\n }\n}", "title": "" }, { "docid": "45cc408b38d0ff23b5ef5ed4647d4ba9", "score": "0.5019423", "text": "func MatchPassword(password, tweak []byte, g, g0 int64, H hash.Hash, ph *PasswordHash) bool {\n\tout, err := HashPasswordWithSalt(password, tweak, ph.Salt, g, g0, H)\n\tif err != nil {\n\t\treturn false\n\t}\n\treturn subtle.ConstantTimeCompare(out, ph.Hash) == 1\n}", "title": "" }, { "docid": "d73e9a238914e7d8e31b1ce5c9ccf780", "score": "0.50168425", "text": "func SolvePart2(input string) int64 {\n\tlines := strings.Split(input, \"\\n\")\n\tvalid := int64(0)\n\tre := regexp.MustCompile(`([0-9]*)-([0-9]*)\\s([a-z]):\\s(.*)`)\n\n\tfor i := 0; i < len(lines); i++ {\n\t\tmatches := re.FindStringSubmatch(lines[i])\n\n\t\tif matches != nil {\n\t\t\tpos1, _ := strconv.Atoi(matches[1])\n\t\t\tpos2, _ := strconv.Atoi(matches[2])\n\t\t\tchar := matches[3][0]\n\t\t\tpass := matches[4]\n\n\t\t\tmatches := 0\n\t\t\tif pass[pos1-1] == char {\n\t\t\t\tmatches++\n\t\t\t}\n\t\t\tif pass[pos2-1] == char {\n\t\t\t\tmatches++\n\t\t\t}\n\n\t\t\tif matches == 1 {\n\t\t\t\tvalid++\n\t\t\t}\n\t\t}\n\t}\n\n\treturn valid\n}", "title": "" }, { "docid": "5a9850d6ca1cd3c17dafb6fac32e8bf9", "score": "0.50163573", "text": "func (p Password) IsValidDownTheRoad() bool {\r\n\tfirst := rune(p.password[p.min-1]) == p.character\r\n\tsecond := rune(p.password[p.max-1]) == p.character\r\n\treturn (first || second) && !(first && second)\r\n}", "title": "" }, { "docid": "e45a188152915efa26e99a797c955450", "score": "0.5016078", "text": "func main() {\n\n\tvar T int\n\tfmt.Scan(&T)\n\n\tfor t := 0; t < T; t++ {\n\t\tvar N, D int\n\t\tfmt.Scan(&N)\n\t\tfmt.Scan(&D)\n\n\t\tA := make([]int, N)\n\t\tfor i := range A {\n\t\t\tfmt.Scan(&A[i])\n\t\t}\n\n\t\tsort.Ints(A)\n\n\t\tminCut := D - 1\n\t\tfor i := range A {\n\t\t\tfor j := 1; j <= D; j++ {\n\t\t\t\tif A[i] % j != 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\ttargetSize := fraction{numerator: A[i], denominator: j}\n\n\t\t\t\tif okay, countFullyUsed := isPossible(A, targetSize, D); !okay {\n\t\t\t\t\tcontinue\n\t\t\t\t} else {\n\t\t\t\t\t// fmt.Println(targetSize, countFullyUsed)\n\t\t\t\t\tcut := D - countFullyUsed\n\t\t\t\t\tif cut < minCut {\n\t\t\t\t\t\tminCut = cut\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfmt.Printf(\"Case #%d: %d\\n\", t+1, minCut)\n\t\t\n\t}\n}", "title": "" }, { "docid": "a8216cfe76d2097f7d6e902ca86f6fce", "score": "0.50104535", "text": "func parseLineIntoPasswordSpec(line string) Password {\n\telems := strings.Split(line, \" \")\n\t// fmt.Println(elems)\n\n\tallowed_range := strings.Split(elems[0], \"-\")\n\tmin, _ := strconv.Atoi(allowed_range[0])\n\tmax, _ := strconv.Atoi(allowed_range[1])\n\tletter_spec := elems[1]\n\tpass := elems[2]\n\n\treturn Password{pass, letter_spec[0], min, max}\n}", "title": "" }, { "docid": "9e0208f1ff8b216515ab648ab97a74b8", "score": "0.50069356", "text": "func validasiusernamecs(usernameCS, passwordCS string) {\r\n\tfor usernameCS != \"admin\" || passwordCS != \"admin\" {\r\n\t\tfmt.Println(\"**** Ada yang salah nih ****\")\r\n\t\tfmt.Print(\"Input Username : \")\r\n\t\tfmt.Scan(&usernameCS)\r\n\t\tfmt.Print(\"Input Password : \")\r\n\t\tfmt.Scan(&passwordCS)\r\n\t}\r\n}", "title": "" }, { "docid": "76c372f3564d4185b424bedec1159610", "score": "0.5003753", "text": "func uniqueLetterString(s string) int {\n\t// native method, for n² substrings, calculate each countUniqueChars(t), we got n³ time.\n\t// for each substrings start at s[i], we calculate for s[i: i], s[i: i+1]... gradually, we got n² time.\n\t// smarter method: for each character, like 'A', how many substrings that contain EXACTLY ONE 'A'?\n\t// we just need to answer this question for 26 times.\n\tchs := make([][]int, 26)\n\tfor i := range s {\n\t\tchs[int(s[i]-'A')] = append(chs[int(s[i]-'A')], i)\n\t}\n\tcount := 0\n\tfor i := range chs {\n\t\tif len(chs[i]) > 0 {\n\t\t\tfmt.Println(string('A' + i))\n\t\t}\n\t\tfor j := range chs[i] {\n\t\t\tprev := -1\n\t\t\tif j-1 >= 0 {\n\t\t\t\tprev = chs[i][j-1]\n\t\t\t}\n\t\t\tnext := len(s)\n\t\t\tif j+1 < len(chs[i]) {\n\t\t\t\tnext = chs[i][j+1]\n\t\t\t}\n\t\t\tcount += (chs[i][j] - prev - 1) + (next - chs[i][j] - 1) + 1 + (chs[i][j]-prev-1)*(next-chs[i][j]-1)\n\t\t\tcount %= 1000000007\n\t\t\tfmt.Println(prev, chs[i][j], next, chs[i][j]-prev-1, next-chs[i][j]-1, count)\n\t\t}\n\t}\n\treturn count\n}", "title": "" } ]
9c441e9b32dcc71fd745fbd59ba7576a
Messages_setInlineBotResultsOneWayWithContext is the proxy function for the method defined in the tars file, with the context
[ { "docid": "6dee7234c0abe823f914f05d92cdf4ff", "score": "0.8563273", "text": "func (_obj *Apimessages) Messages_setInlineBotResultsOneWayWithContext(tarsCtx context.Context, params *TLmessages_setInlineBotResults, _opt ...map[string]string) (ret Bool, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_setInlineBotResults\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" } ]
[ { "docid": "059ae52d9d121639191a8ca62eaf157b", "score": "0.80065113", "text": "func (_obj *Apimessages) Messages_getInlineBotResultsOneWayWithContext(tarsCtx context.Context, params *TLmessages_getInlineBotResults, _opt ...map[string]string) (ret Messages_BotResults, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_getInlineBotResults\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "29e5684d00c75ee3e1ce3f80334b69a0", "score": "0.7825102", "text": "func (_obj *Apimessages) Messages_sendInlineBotResultOneWayWithContext(tarsCtx context.Context, params *TLmessages_sendInlineBotResult, _opt ...map[string]string) (ret Updates, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_sendInlineBotResult\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "069de1bc7d17052bff97623a7e1464d2", "score": "0.7723076", "text": "func (_obj *Apimessages) Messages_setInlineBotResultsWithContext(tarsCtx context.Context, params *TLmessages_setInlineBotResults, _opt ...map[string]string) (ret Bool, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 0, \"messages_setInlineBotResults\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\t_is := codec.NewReader(tools.Int8ToByte(_resp.SBuffer))\n\terr = ret.ReadBlock(_is, 0, true)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "b4f85d322e7746f8a9dd086c9bf4ebe9", "score": "0.7094968", "text": "func (_obj *Apimessages) Messages_sendInlineBotResultWithContext(tarsCtx context.Context, params *TLmessages_sendInlineBotResult, _opt ...map[string]string) (ret Updates, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 0, \"messages_sendInlineBotResult\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\t_is := codec.NewReader(tools.Int8ToByte(_resp.SBuffer))\n\terr = ret.ReadBlock(_is, 0, true)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "9061e62d02780dae0c92e6578339a70c", "score": "0.7078528", "text": "func (_obj *Apimessages) Messages_editInlineBotMessageOneWayWithContext(tarsCtx context.Context, params *TLmessages_editInlineBotMessage, _opt ...map[string]string) (ret Bool, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_editInlineBotMessage\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "527eabac2891f67b6907e3337e0b6d70", "score": "0.7029729", "text": "func (_obj *Apimessages) Messages_getInlineBotResultsWithContext(tarsCtx context.Context, params *TLmessages_getInlineBotResults, _opt ...map[string]string) (ret Messages_BotResults, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 0, \"messages_getInlineBotResults\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\t_is := codec.NewReader(tools.Int8ToByte(_resp.SBuffer))\n\terr = ret.ReadBlock(_is, 0, true)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "927e8dfb9726f32e183a1a5f163ac336", "score": "0.6980368", "text": "func (_obj *Apimessages) Messages_setInlineGameScoreOneWayWithContext(tarsCtx context.Context, params *TLmessages_setInlineGameScore, _opt ...map[string]string) (ret Bool, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_setInlineGameScore\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "4d3332e19c26c1aa215a0f1fa14a1b9e", "score": "0.6968484", "text": "func (_obj *Apimessages) Messages_setBotPrecheckoutResultsOneWayWithContext(tarsCtx context.Context, params *TLmessages_setBotPrecheckoutResults, _opt ...map[string]string) (ret Bool, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_setBotPrecheckoutResults\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "75f7d862ffe383962649d943c5ab9c1c", "score": "0.68460864", "text": "func (_obj *Apimessages) Messages_setInlineBotResults(params *TLmessages_setInlineBotResults, _opt ...map[string]string) (ret Bool, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\ttarsCtx := context.Background()\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 0, \"messages_setInlineBotResults\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\t_is := codec.NewReader(tools.Int8ToByte(_resp.SBuffer))\n\terr = ret.ReadBlock(_is, 0, true)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "37497b1d0af2d911cfebc60b0df18693", "score": "0.66351104", "text": "func (_obj *Apimessages) Messages_setBotShippingResultsOneWayWithContext(tarsCtx context.Context, params *TLmessages_setBotShippingResults, _opt ...map[string]string) (ret Bool, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_setBotShippingResults\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "5602a36703ab2bdae3854e395dee267c", "score": "0.64274555", "text": "func (_obj *Apimessages) Messages_setBotCallbackAnswerOneWayWithContext(tarsCtx context.Context, params *TLmessages_setBotCallbackAnswer, _opt ...map[string]string) (ret Bool, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_setBotCallbackAnswer\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "75e5a1402adfb5e44ff788cf5df73832", "score": "0.6397075", "text": "func (_obj *Apimessages) Messages_startBotOneWayWithContext(tarsCtx context.Context, params *TLmessages_startBot, _opt ...map[string]string) (ret Updates, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_startBot\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "931b84d82fe8d3fc5a9e6b9832c53822", "score": "0.6250393", "text": "func (_obj *Apimessages) Messages_sendInlineBotResult(params *TLmessages_sendInlineBotResult, _opt ...map[string]string) (ret Updates, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\ttarsCtx := context.Background()\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 0, \"messages_sendInlineBotResult\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\t_is := codec.NewReader(tools.Int8ToByte(_resp.SBuffer))\n\terr = ret.ReadBlock(_is, 0, true)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "2944356d6d1a51a9c17424fbb2711244", "score": "0.6244258", "text": "func (_obj *Apimessages) Messages_editInlineBotMessageWithContext(tarsCtx context.Context, params *TLmessages_editInlineBotMessage, _opt ...map[string]string) (ret Bool, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 0, \"messages_editInlineBotMessage\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\t_is := codec.NewReader(tools.Int8ToByte(_resp.SBuffer))\n\terr = ret.ReadBlock(_is, 0, true)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "3fc0afb15c3713c35d220b1400591b9a", "score": "0.62328726", "text": "func (_obj *Apimessages) Messages_getInlineGameHighScoresOneWayWithContext(tarsCtx context.Context, params *TLmessages_getInlineGameHighScores, _opt ...map[string]string) (ret Messages_HighScores, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_getInlineGameHighScores\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "81dc619ecae1697e08e144b50b537814", "score": "0.61474013", "text": "func (_obj *Apimessages) Messages_sendVoteOneWayWithContext(tarsCtx context.Context, params *TLmessages_sendVote, _opt ...map[string]string) (ret Updates, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_sendVote\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "e2cd0102b29ab5d2020f34a0741ffe1c", "score": "0.6107532", "text": "func (_obj *Apimessages) Messages_setGameScoreOneWayWithContext(tarsCtx context.Context, params *TLmessages_setGameScore, _opt ...map[string]string) (ret Updates, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_setGameScore\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "cbe5725f1de89e6ce3b85af78e2e730b", "score": "0.60811096", "text": "func (_obj *Apimessages) Messages_setBotPrecheckoutResultsWithContext(tarsCtx context.Context, params *TLmessages_setBotPrecheckoutResults, _opt ...map[string]string) (ret Bool, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 0, \"messages_setBotPrecheckoutResults\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\t_is := codec.NewReader(tools.Int8ToByte(_resp.SBuffer))\n\terr = ret.ReadBlock(_is, 0, true)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "c87d7344a620a43b4ea857eda72aa4b3", "score": "0.6049929", "text": "func (_obj *Apimessages) Messages_getBotCallbackAnswerOneWayWithContext(tarsCtx context.Context, params *TLmessages_getBotCallbackAnswer, _opt ...map[string]string) (ret Messages_BotCallbackAnswer, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_getBotCallbackAnswer\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "6ad89fee2a2ce785ba422581cfe1319d", "score": "0.6029775", "text": "func (_obj *Apimessages) Messages_getPollResultsOneWayWithContext(tarsCtx context.Context, params *TLmessages_getPollResults, _opt ...map[string]string) (ret Updates, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_getPollResults\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "56088847a0641464351e9dccf45652c6", "score": "0.6027357", "text": "func (_obj *Apimessages) Messages_getInlineBotResults(params *TLmessages_getInlineBotResults, _opt ...map[string]string) (ret Messages_BotResults, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\ttarsCtx := context.Background()\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 0, \"messages_getInlineBotResults\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\t_is := codec.NewReader(tools.Int8ToByte(_resp.SBuffer))\n\terr = ret.ReadBlock(_is, 0, true)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "0c6644a1199e33f64125d00258db70ab", "score": "0.60149604", "text": "func (_obj *Apimessages) Messages_setInlineGameScoreWithContext(tarsCtx context.Context, params *TLmessages_setInlineGameScore, _opt ...map[string]string) (ret Bool, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 0, \"messages_setInlineGameScore\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\t_is := codec.NewReader(tools.Int8ToByte(_resp.SBuffer))\n\terr = ret.ReadBlock(_is, 0, true)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "f27366bfa02eacf6c17bf8f7184889d0", "score": "0.6007724", "text": "func (_obj *Apimessages) Messages_getOnlinesOneWayWithContext(tarsCtx context.Context, params *TLmessages_getOnlines, _opt ...map[string]string) (ret ChatOnlines, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_getOnlines\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "771376815089bbf30afee0e68a1671c1", "score": "0.5931267", "text": "func (_obj *Apimessages) Messages_sendMultiMediaOneWayWithContext(tarsCtx context.Context, params *TLmessages_sendMultiMedia, _opt ...map[string]string) (ret Updates, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_sendMultiMedia\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "cab8330868d3a73acd5c5917f6c04ba0", "score": "0.589144", "text": "func (_obj *Apimessages) Messages_reportEncryptedSpamOneWayWithContext(tarsCtx context.Context, params *TLmessages_reportEncryptedSpam, _opt ...map[string]string) (ret Bool, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_reportEncryptedSpam\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "8b86a4de998e6e56cc80bd8a225a73be", "score": "0.588225", "text": "func (_obj *Apimessages) Messages_forwardMessagesOneWayWithContext(tarsCtx context.Context, params *TLmessages_forwardMessages, _opt ...map[string]string) (ret Updates, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_forwardMessages\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "afa055229b69b2d4f463ae200417b878", "score": "0.5869377", "text": "func (_obj *Apimessages) Messages_setEncryptedTypingOneWayWithContext(tarsCtx context.Context, params *TLmessages_setEncryptedTyping, _opt ...map[string]string) (ret Bool, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_setEncryptedTyping\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "5521e397cea1b1f76aea8e2773e6322a", "score": "0.5816159", "text": "func (_obj *Apimessages) Messages_searchStickerSetsOneWayWithContext(tarsCtx context.Context, params *TLmessages_searchStickerSets, _opt ...map[string]string) (ret Messages_FoundStickerSets, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_searchStickerSets\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "dbf68cac129fa26b8d5de409d62592b9", "score": "0.5815106", "text": "func (_obj *Apimessages) Messages_editChatAdminOneWayWithContext(tarsCtx context.Context, params *TLmessages_editChatAdmin, _opt ...map[string]string) (ret Bool, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_editChatAdmin\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "e755f27f2cdb95110a69cd71b5147999", "score": "0.58043647", "text": "func (_obj *Apimessages) Messages_readMentionsOneWayWithContext(tarsCtx context.Context, params *TLmessages_readMentions, _opt ...map[string]string) (ret Messages_AffectedHistory, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_readMentions\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "42b69efdef32d603de4d8520b50dcc8f", "score": "0.57869923", "text": "func (_obj *Apimessages) Messages_acceptEncryptionOneWayWithContext(tarsCtx context.Context, params *TLmessages_acceptEncryption, _opt ...map[string]string) (ret EncryptedChat, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_acceptEncryption\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "d76c560c8cca3bf8ed29e47436256320", "score": "0.57699746", "text": "func (_obj *Apimessages) Messages_getRepliesOneWayWithContext(tarsCtx context.Context, params *TLmessages_getReplies, _opt ...map[string]string) (ret Messages_Messages, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_getReplies\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "652e8e784b477550da53a1e1c68d2e86", "score": "0.5766029", "text": "func (_obj *Apimessages) Messages_reportOneWayWithContext(tarsCtx context.Context, params *TLmessages_report, _opt ...map[string]string) (ret Bool, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_report\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "d4982913d72db42f169362d94f3e79ed", "score": "0.5755067", "text": "func (_obj *Apimessages) Messages_migrateChatOneWayWithContext(tarsCtx context.Context, params *TLmessages_migrateChat, _opt ...map[string]string) (ret Updates, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_migrateChat\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "e20389979675a8098e011385418c542f", "score": "0.5754614", "text": "func (_obj *Apimessages) Messages_setBotShippingResultsWithContext(tarsCtx context.Context, params *TLmessages_setBotShippingResults, _opt ...map[string]string) (ret Bool, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 0, \"messages_setBotShippingResults\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\t_is := codec.NewReader(tools.Int8ToByte(_resp.SBuffer))\n\terr = ret.ReadBlock(_is, 0, true)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "911bcd69326c75c96c8a7b876a7120ae", "score": "0.5718374", "text": "func (_obj *Apimessages) Messages_setTypingOneWayWithContext(tarsCtx context.Context, params *TLmessages_setTyping, _opt ...map[string]string) (ret Bool, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_setTyping\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "9eccb62df4e708c59462c5c7eccc6173", "score": "0.5701121", "text": "func (_obj *Apimessages) Messages_editMessageOneWayWithContext(tarsCtx context.Context, params *TLmessages_editMessage, _opt ...map[string]string) (ret Updates, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_editMessage\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "4a691f14e05022ee3c00f8709d402a55", "score": "0.5701019", "text": "func (_obj *Apimessages) Messages_sendMessageOneWayWithContext(tarsCtx context.Context, params *TLmessages_sendMessage, _opt ...map[string]string) (ret Updates, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_sendMessage\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "4a504994b8a4f3008621e316782fe992", "score": "0.5678706", "text": "func (_obj *Apimessages) Messages_reportSpamOneWayWithContext(tarsCtx context.Context, params *TLmessages_reportSpam, _opt ...map[string]string) (ret Bool, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_reportSpam\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "949fcd59babf3e2e507cb718245d5cfb", "score": "0.5664457", "text": "func (_obj *Apimessages) Messages_editChatDefaultBannedRightsOneWayWithContext(tarsCtx context.Context, params *TLmessages_editChatDefaultBannedRights, _opt ...map[string]string) (ret Updates, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_editChatDefaultBannedRights\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "efaeee7894eb22fc8cc80321e1a93433", "score": "0.56541294", "text": "func (_obj *Apimessages) Messages_updateDialogFilterOneWayWithContext(tarsCtx context.Context, params *TLmessages_updateDialogFilter, _opt ...map[string]string) (ret Bool, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_updateDialogFilter\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "d3aaaac6e05f1a95945541f04fa4cbeb", "score": "0.5648876", "text": "func (_obj *Apimessages) Messages_requestEncryptionOneWayWithContext(tarsCtx context.Context, params *TLmessages_requestEncryption, _opt ...map[string]string) (ret EncryptedChat, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_requestEncryption\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "023d20f702b3a17146f5c13772316689", "score": "0.5647676", "text": "func (_obj *Apimessages) Messages_editChatPhotoOneWayWithContext(tarsCtx context.Context, params *TLmessages_editChatPhoto, _opt ...map[string]string) (ret Updates, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_editChatPhoto\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "cbb13990741871837a95e254b8adea33", "score": "0.5644524", "text": "func (_obj *Apimessages) Messages_setBotCallbackAnswerWithContext(tarsCtx context.Context, params *TLmessages_setBotCallbackAnswer, _opt ...map[string]string) (ret Bool, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 0, \"messages_setBotCallbackAnswer\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\t_is := codec.NewReader(tools.Int8ToByte(_resp.SBuffer))\n\terr = ret.ReadBlock(_is, 0, true)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "cfcb0cc7e6674db850a7a227b20c3c21", "score": "0.5631765", "text": "func (_obj *Apimessages) Messages_editChatTitleOneWayWithContext(tarsCtx context.Context, params *TLmessages_editChatTitle, _opt ...map[string]string) (ret Updates, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_editChatTitle\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "9ef2c467360030eb0bbacfece19db931", "score": "0.5627352", "text": "func (_obj *Apimessages) Messages_sendMediaOneWayWithContext(tarsCtx context.Context, params *TLmessages_sendMedia, _opt ...map[string]string) (ret Updates, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_sendMedia\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "ebc89cff2dc24d96382fa0f389f30902", "score": "0.56074214", "text": "func (_obj *Apimessages) Messages_sendEncryptedOneWayWithContext(tarsCtx context.Context, params *TLmessages_sendEncrypted, _opt ...map[string]string) (ret Messages_SentEncryptedMessage, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_sendEncrypted\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "2b53472e47109e3d01b0735b4e8cb846", "score": "0.56041515", "text": "func (_obj *Apimessages) Messages_updateDialogFiltersOrderOneWayWithContext(tarsCtx context.Context, params *TLmessages_updateDialogFiltersOrder, _opt ...map[string]string) (ret Bool, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_updateDialogFiltersOrder\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "5e56cb200469db075f69704ddac0378b", "score": "0.5582659", "text": "func (_obj *Apimessages) Messages_importChatInviteOneWayWithContext(tarsCtx context.Context, params *TLmessages_importChatInvite, _opt ...map[string]string) (ret Updates, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_importChatInvite\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "93eb701d654d869ee06085620064463e", "score": "0.5572181", "text": "func (_obj *Apimessages) Messages_toggleStickerSetsOneWayWithContext(tarsCtx context.Context, params *TLmessages_toggleStickerSets, _opt ...map[string]string) (ret Bool, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_toggleStickerSets\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "6bea6fba61578c7d93f5fc877b9c0785", "score": "0.55582464", "text": "func (_obj *Apimessages) Messages_markDialogUnreadOneWayWithContext(tarsCtx context.Context, params *TLmessages_markDialogUnread, _opt ...map[string]string) (ret Bool, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_markDialogUnread\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "ad03ff7f18e6d966003729360e03796c", "score": "0.5537135", "text": "func (_obj *Apimessages) Messages_updatePinnedMessageOneWayWithContext(tarsCtx context.Context, params *TLmessages_updatePinnedMessage, _opt ...map[string]string) (ret Updates, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_updatePinnedMessage\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "709e95205f9a42e752863d3d0827b0bd", "score": "0.5535961", "text": "func (_obj *Apimessages) Messages_getEmojiKeywordsOneWayWithContext(tarsCtx context.Context, params *TLmessages_getEmojiKeywords, _opt ...map[string]string) (ret EmojiKeywordsDifference, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_getEmojiKeywords\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "30fb02e67787a18235fa5325fe49e0c9", "score": "0.5525293", "text": "func (_obj *Apimessages) Messages_toggleDialogPinOneWayWithContext(tarsCtx context.Context, params *TLmessages_toggleDialogPin, _opt ...map[string]string) (ret Bool, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_toggleDialogPin\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "942042bd634faf4e518b8814acb7d2f9", "score": "0.5512098", "text": "func (_obj *Apimessages) Messages_startBotWithContext(tarsCtx context.Context, params *TLmessages_startBot, _opt ...map[string]string) (ret Updates, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 0, \"messages_startBot\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\t_is := codec.NewReader(tools.Int8ToByte(_resp.SBuffer))\n\terr = ret.ReadBlock(_is, 0, true)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "3f7c127157ace4f3606ea7065ef28e4c", "score": "0.549964", "text": "func (_obj *Apimessages) Messages_searchOneWayWithContext(tarsCtx context.Context, params *TLmessages_search, _opt ...map[string]string) (ret Messages_Messages, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_search\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "5fd90066a06237e4a8b525a9b1bd492c", "score": "0.5496761", "text": "func (_obj *Apimessages) Messages_getPollVotesOneWayWithContext(tarsCtx context.Context, params *TLmessages_getPollVotes, _opt ...map[string]string) (ret Messages_VotesList, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_getPollVotes\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "ea1cf52060839bf780b4920514ee54b0", "score": "0.54909617", "text": "func (_obj *Apimessages) Messages_sendEncryptedServiceOneWayWithContext(tarsCtx context.Context, params *TLmessages_sendEncryptedService, _opt ...map[string]string) (ret Messages_SentEncryptedMessage, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_sendEncryptedService\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "812496c18051cb4b41f85897e4716e19", "score": "0.54883546", "text": "func (_obj *Apimessages) Messages_getEmojiKeywordsLanguagesOneWayWithContext(tarsCtx context.Context, params *TLmessages_getEmojiKeywordsLanguages, _opt ...map[string]string) (ret []EmojiLanguage, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_getEmojiKeywordsLanguages\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "b370cf1679dec9415e44e47021f2895f", "score": "0.5483796", "text": "func (_obj *Apimessages) Messages_sendScheduledMessagesOneWayWithContext(tarsCtx context.Context, params *TLmessages_sendScheduledMessages, _opt ...map[string]string) (ret Updates, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_sendScheduledMessages\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "1f88f181787248e901c72ea7602a4531", "score": "0.5476659", "text": "func (_obj *Apimessages) Messages_readEncryptedHistoryOneWayWithContext(tarsCtx context.Context, params *TLmessages_readEncryptedHistory, _opt ...map[string]string) (ret Bool, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_readEncryptedHistory\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "14e8ebfff294aa45bdd35f2aaf4e9480", "score": "0.54754984", "text": "func (_obj *Apimessages) Messages_editChatAboutOneWayWithContext(tarsCtx context.Context, params *TLmessages_editChatAbout, _opt ...map[string]string) (ret Bool, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_editChatAbout\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "8df25f3ddb21ff60b54d4bda56e4ee2c", "score": "0.54732645", "text": "func (_obj *Apimessages) Messages_checkChatInviteOneWayWithContext(tarsCtx context.Context, params *TLmessages_checkChatInvite, _opt ...map[string]string) (ret ChatInvite, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_checkChatInvite\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "fe44fc692242bb19f3303c169a9051fd", "score": "0.54612345", "text": "func (_obj *Apimessages) Messages_sendScreenshotNotificationOneWayWithContext(tarsCtx context.Context, params *TLmessages_sendScreenshotNotification, _opt ...map[string]string) (ret Updates, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_sendScreenshotNotification\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "a3a0d1f388a6b39210be072218524d76", "score": "0.5443073", "text": "func (_obj *Apimessages) Messages_getPeerSettingsOneWayWithContext(tarsCtx context.Context, params *TLmessages_getPeerSettings, _opt ...map[string]string) (ret PeerSettings, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_getPeerSettings\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "bd75f561118803b336fc210bf2d5a78b", "score": "0.544018", "text": "func (_obj *Apimessages) Messages_getUnreadMentionsOneWayWithContext(tarsCtx context.Context, params *TLmessages_getUnreadMentions, _opt ...map[string]string) (ret Messages_Messages, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_getUnreadMentions\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "157d16e950fa4bc9de7c7afabe1fefd1", "score": "0.5407056", "text": "func (_obj *Apimessages) Messages_faveStickerOneWayWithContext(tarsCtx context.Context, params *TLmessages_faveSticker, _opt ...map[string]string) (ret Bool, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_faveSticker\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "144417ea69bd7394fc349f76b2e46498", "score": "0.54046446", "text": "func (_obj *Apimessages) Messages_getWebPagePreviewOneWayWithContext(tarsCtx context.Context, params *TLmessages_getWebPagePreview, _opt ...map[string]string) (ret MessageMedia, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_getWebPagePreview\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "61a84ccbd55b34534b46d2842890bcd4", "score": "0.5401517", "text": "func (_obj *Apimessages) Messages_getEmojiKeywordsDifferenceOneWayWithContext(tarsCtx context.Context, params *TLmessages_getEmojiKeywordsDifference, _opt ...map[string]string) (ret EmojiKeywordsDifference, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_getEmojiKeywordsDifference\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "68f06feb66c08ffcf14fbbe91375a8c9", "score": "0.53818446", "text": "func (_obj *Apimessages) Messages_getPeerDialogsOneWayWithContext(tarsCtx context.Context, params *TLmessages_getPeerDialogs, _opt ...map[string]string) (ret Messages_PeerDialogs, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_getPeerDialogs\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "513154558a17b9723dae530177cfde04", "score": "0.5350296", "text": "func (_obj *Apimessages) Messages_getSuggestedDialogFiltersOneWayWithContext(tarsCtx context.Context, params *TLmessages_getSuggestedDialogFilters, _opt ...map[string]string) (ret []DialogFilterSuggested, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_getSuggestedDialogFilters\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "d455d61a3fca1365af6a85e978937de6", "score": "0.5348015", "text": "func (_obj *Apimessages) Messages_editInlineBotMessage(params *TLmessages_editInlineBotMessage, _opt ...map[string]string) (ret Bool, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\ttarsCtx := context.Background()\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 0, \"messages_editInlineBotMessage\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\t_is := codec.NewReader(tools.Int8ToByte(_resp.SBuffer))\n\terr = ret.ReadBlock(_is, 0, true)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "9078ad0c8eee4e464da8f4a5f88bf9d0", "score": "0.5345082", "text": "func (_obj *Apimessages) Messages_getScheduledHistoryOneWayWithContext(tarsCtx context.Context, params *TLmessages_getScheduledHistory, _opt ...map[string]string) (ret Messages_Messages, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_getScheduledHistory\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "dcc8985db0ddd87de09413e37912bed8", "score": "0.5335192", "text": "func (_obj *Apimessages) Messages_sendVoteWithContext(tarsCtx context.Context, params *TLmessages_sendVote, _opt ...map[string]string) (ret Updates, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 0, \"messages_sendVote\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\t_is := codec.NewReader(tools.Int8ToByte(_resp.SBuffer))\n\terr = ret.ReadBlock(_is, 0, true)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "9ce5566b2512bcd84a2bcdd5c5b7f4e8", "score": "0.5330629", "text": "func (_obj *Apimessages) Messages_getGameHighScoresOneWayWithContext(tarsCtx context.Context, params *TLmessages_getGameHighScores, _opt ...map[string]string) (ret Messages_HighScores, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_getGameHighScores\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "a205dc98b6456ee6854434217de7e30a", "score": "0.53172", "text": "func (_obj *Apimessages) Messages_installStickerSetOneWayWithContext(tarsCtx context.Context, params *TLmessages_installStickerSet, _opt ...map[string]string) (ret Messages_StickerSetInstallResult, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_installStickerSet\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "c65886d0b23ad6c3eb5143bd680bf93a", "score": "0.52904534", "text": "func (_obj *Apimessages) Messages_getDialogUnreadMarksOneWayWithContext(tarsCtx context.Context, params *TLmessages_getDialogUnreadMarks, _opt ...map[string]string) (ret []DialogPeer, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_getDialogUnreadMarks\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "c2f185f147b54148387c67256a364dce", "score": "0.52806985", "text": "func (_obj *Apimessages) Messages_getStickerSetOneWayWithContext(tarsCtx context.Context, params *TLmessages_getStickerSet, _opt ...map[string]string) (ret Messages_StickerSet, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_getStickerSet\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "e7f6608f2bf851cd7a076ed72478dc71", "score": "0.52677363", "text": "func (_obj *Apimessages) Messages_getScheduledMessagesOneWayWithContext(tarsCtx context.Context, params *TLmessages_getScheduledMessages, _opt ...map[string]string) (ret Messages_Messages, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_getScheduledMessages\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "85ced22126406169631bee3b22eb6218", "score": "0.52651584", "text": "func (_obj *Apimessages) Messages_getAllDraftsOneWayWithContext(tarsCtx context.Context, params *TLmessages_getAllDrafts, _opt ...map[string]string) (ret Updates, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_getAllDrafts\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "c9780208e4e1e0897e81cbace9bb851f", "score": "0.52614695", "text": "func (_obj *Apimessages) Messages_getMessageEditDataOneWayWithContext(tarsCtx context.Context, params *TLmessages_getMessageEditData, _opt ...map[string]string) (ret Messages_MessageEditData, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_getMessageEditData\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "d8df1f6d39f1bc95cc55f6eabb9bd89a", "score": "0.5249499", "text": "func (_obj *Apimessages) Messages_getMessagesOneWayWithContext(tarsCtx context.Context, params *TLmessages_getMessages, _opt ...map[string]string) (ret Messages_Messages, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_getMessages\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "fa6a46126fe0f1841094fccb5a52facc", "score": "0.52479553", "text": "func (_obj *Apimessages) Messages_addChatUserOneWayWithContext(tarsCtx context.Context, params *TLmessages_addChatUser, _opt ...map[string]string) (ret Updates, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_addChatUser\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "79384b673862329b0ed486d23bd1d375", "score": "0.5225377", "text": "func (_obj *Apimessages) Messages_acceptUrlAuthOneWayWithContext(tarsCtx context.Context, params *TLmessages_acceptUrlAuth, _opt ...map[string]string) (ret UrlAuthResult, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_acceptUrlAuth\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "8e8b77b4bdee23f783212e1726605e52", "score": "0.5196323", "text": "func (_obj *Apimessages) Messages_reorderStickerSetsOneWayWithContext(tarsCtx context.Context, params *TLmessages_reorderStickerSets, _opt ...map[string]string) (ret Bool, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_reorderStickerSets\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "145c30c83779d706c99400889af4a68e", "score": "0.51836497", "text": "func (_obj *Apimessages) Messages_getMessagesViewsOneWayWithContext(tarsCtx context.Context, params *TLmessages_getMessagesViews, _opt ...map[string]string) (ret Messages_MessageViews, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_getMessagesViews\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "8ebe012c567f6f1c78db5e94866ff28d", "score": "0.5171094", "text": "func (_obj *Apimessages) Messages_readHistoryOneWayWithContext(tarsCtx context.Context, params *TLmessages_readHistory, _opt ...map[string]string) (ret Messages_AffectedMessages, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_readHistory\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "04b4f6824bd2aa31553ca0919b630b1a", "score": "0.51697075", "text": "func (_obj *Apimessages) Messages_receivedQueueOneWayWithContext(tarsCtx context.Context, params *TLmessages_receivedQueue, _opt ...map[string]string) (ret []int64, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_receivedQueue\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "f56e357a9d188d730faf08870596309b", "score": "0.5166338", "text": "func (_obj *Apimessages) Messages_readMessageContentsOneWayWithContext(tarsCtx context.Context, params *TLmessages_readMessageContents, _opt ...map[string]string) (ret Messages_AffectedMessages, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_readMessageContents\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "39315a0ac1df9d2cef22d8063747d872", "score": "0.5161283", "text": "func (_obj *Apimessages) Messages_saveRecentStickerOneWayWithContext(tarsCtx context.Context, params *TLmessages_saveRecentSticker, _opt ...map[string]string) (ret Bool, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_saveRecentSticker\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "0e849c07ae07b2a473042595ed6cd8a5", "score": "0.5159867", "text": "func (_obj *Apimessages) Messages_sendEncryptedFileOneWayWithContext(tarsCtx context.Context, params *TLmessages_sendEncryptedFile, _opt ...map[string]string) (ret Messages_SentEncryptedMessage, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_sendEncryptedFile\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "27adfa0d41bd402fa7b318b3d9b710e9", "score": "0.51468235", "text": "func (_obj *Apimessages) Messages_getDialogsOneWayWithContext(tarsCtx context.Context, params *TLmessages_getDialogs, _opt ...map[string]string) (ret Messages_Dialogs, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_getDialogs\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "794b6bc63521d9adb0e8637ffecdfa7f", "score": "0.51398695", "text": "func (_obj *Apimessages) Messages_receivedMessagesOneWayWithContext(tarsCtx context.Context, params *TLmessages_receivedMessages, _opt ...map[string]string) (ret []ReceivedNotifyMessage, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_receivedMessages\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "1f3afc64d51e44524f7147786e7cbb63", "score": "0.51339996", "text": "func (_obj *Apimessages) Messages_getCommonChatsOneWayWithContext(tarsCtx context.Context, params *TLmessages_getCommonChats, _opt ...map[string]string) (ret Messages_Chats, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_getCommonChats\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "e763ac09eae5df575142b47d36fc8cc4", "score": "0.51254934", "text": "func (_obj *Apimessages) Messages_getHistoryOneWayWithContext(tarsCtx context.Context, params *TLmessages_getHistory, _opt ...map[string]string) (ret Messages_Messages, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_getHistory\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "714c9fb830932d519b19b345fbfbc060", "score": "0.5105212", "text": "func (_obj *Apimessages) Messages_getSearchCountersOneWayWithContext(tarsCtx context.Context, params *TLmessages_getSearchCounters, _opt ...map[string]string) (ret []Messages_SearchCounter, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_getSearchCounters\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "790fb15b166f8b91346a46558be7160c", "score": "0.5104907", "text": "func (_obj *Apimessages) Messages_getRecentLocationsOneWayWithContext(tarsCtx context.Context, params *TLmessages_getRecentLocations, _opt ...map[string]string) (ret Messages_Messages, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_getRecentLocations\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "0f52f2e2771fa9a664c5e8807c1eb934", "score": "0.5104831", "text": "func (_obj *Apimessages) Messages_getArchivedStickersOneWayWithContext(tarsCtx context.Context, params *TLmessages_getArchivedStickers, _opt ...map[string]string) (ret Messages_ArchivedStickers, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_getArchivedStickers\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "9034c42d990c778b333b4ebd1da84789", "score": "0.50905895", "text": "func (_obj *Apimessages) Messages_getFavedStickersOneWayWithContext(tarsCtx context.Context, params *TLmessages_getFavedStickers, _opt ...map[string]string) (ret Messages_FavedStickers, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_getFavedStickers\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" }, { "docid": "e95baadef6808c9dcfcb63234d657c0c", "score": "0.50840753", "text": "func (_obj *Apimessages) Messages_hidePeerSettingsBarOneWayWithContext(tarsCtx context.Context, params *TLmessages_hidePeerSettingsBar, _opt ...map[string]string) (ret Bool, err error) {\n\n\tvar length int32\n\tvar have bool\n\tvar ty byte\n\t_os := codec.NewBuffer()\n\terr = params.WriteBlock(_os, 1)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tvar _status map[string]string\n\tvar _context map[string]string\n\tif len(_opt) == 1 {\n\t\t_context = _opt[0]\n\t} else if len(_opt) == 2 {\n\t\t_context = _opt[0]\n\t\t_status = _opt[1]\n\t}\n\t_resp := new(requestf.ResponsePacket)\n\n\terr = _obj.s.Tars_invoke(tarsCtx, 1, \"messages_hidePeerSettingsBar\", _os.ToBytes(), _status, _context, _resp)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\n\tif len(_opt) == 1 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t} else if len(_opt) == 2 {\n\t\tfor k := range _context {\n\t\t\tdelete(_context, k)\n\t\t}\n\t\tfor k, v := range _resp.Context {\n\t\t\t_context[k] = v\n\t\t}\n\t\tfor k := range _status {\n\t\t\tdelete(_status, k)\n\t\t}\n\t\tfor k, v := range _resp.Status {\n\t\t\t_status[k] = v\n\t\t}\n\n\t}\n\t_ = length\n\t_ = have\n\t_ = ty\n\treturn ret, nil\n}", "title": "" } ]
000fbdf9970d83909d2215078e7b6693
PutResourcePolicyWithContext is the same as PutResourcePolicy with the addition of the ability to pass a context and additional request options. See PutResourcePolicy for details on how to use this API operation. The context must be nonnil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create subcontexts for http.Requests. See for more information on using Contexts.
[ { "docid": "1acfb8f60b08e0cf94bcd8b9463260ee", "score": "0.8445773", "text": "func (c *NetworkManager) PutResourcePolicyWithContext(ctx aws.Context, input *PutResourcePolicyInput, opts ...request.Option) (*PutResourcePolicyOutput, error) {\n\treq, out := c.PutResourcePolicyRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" } ]
[ { "docid": "8060bc856fefaeed75c9527eae5f92a0", "score": "0.8571809", "text": "func (c *CloudTrail) PutResourcePolicyWithContext(ctx aws.Context, input *PutResourcePolicyInput, opts ...request.Option) (*PutResourcePolicyOutput, error) {\n\treq, out := c.PutResourcePolicyRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "1404104b89764853e03e0b56f4417cc6", "score": "0.77636117", "text": "func (m *MockCloudWatchLogsAPI) PutResourcePolicyWithContext(arg0 aws.Context, arg1 *cloudwatchlogs.PutResourcePolicyInput, arg2 ...request.Option) (*cloudwatchlogs.PutResourcePolicyOutput, error) {\n\tvarargs := []interface{}{arg0, arg1}\n\tfor _, a := range arg2 {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"PutResourcePolicyWithContext\", varargs...)\n\tret0, _ := ret[0].(*cloudwatchlogs.PutResourcePolicyOutput)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "29faaad8a7a1e9b243bfc7ef11ca401c", "score": "0.73079115", "text": "func (mr *MockCloudWatchLogsAPIMockRecorder) PutResourcePolicyWithContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {\n\tvarargs := append([]interface{}{arg0, arg1}, arg2...)\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"PutResourcePolicyWithContext\", reflect.TypeOf((*MockCloudWatchLogsAPI)(nil).PutResourcePolicyWithContext), varargs...)\n}", "title": "" }, { "docid": "e3d32f0e77c5390efae03543684132a9", "score": "0.69658214", "text": "func (c *ConfigService) PutResourceConfigWithContext(ctx aws.Context, input *PutResourceConfigInput, opts ...request.Option) (*PutResourceConfigOutput, error) {\n\treq, out := c.PutResourceConfigRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "a222441e59cd91ed74b384b848f8fd5f", "score": "0.6879288", "text": "func (c *MediaConvert) PutPolicyWithContext(ctx aws.Context, input *PutPolicyInput, opts ...request.Option) (*PutPolicyOutput, error) {\n\treq, out := c.PutPolicyRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "e810a01750c0e919ae738ccbb8696716", "score": "0.68689066", "text": "func (m *MockCloudWatchLogsAPI) DeleteResourcePolicyWithContext(arg0 aws.Context, arg1 *cloudwatchlogs.DeleteResourcePolicyInput, arg2 ...request.Option) (*cloudwatchlogs.DeleteResourcePolicyOutput, error) {\n\tvarargs := []interface{}{arg0, arg1}\n\tfor _, a := range arg2 {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"DeleteResourcePolicyWithContext\", varargs...)\n\tret0, _ := ret[0].(*cloudwatchlogs.DeleteResourcePolicyOutput)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "ece9da2f0ed0e956e3cfa7e8d5cf47dc", "score": "0.68137664", "text": "func (c *Client) PutResourcePolicy(ctx context.Context, params *PutResourcePolicyInput, optFns ...func(*Options)) (*PutResourcePolicyOutput, error) {\n\tif params == nil {\n\t\tparams = &PutResourcePolicyInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"PutResourcePolicy\", params, optFns, c.addOperationPutResourcePolicyMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*PutResourcePolicyOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}", "title": "" }, { "docid": "ece9da2f0ed0e956e3cfa7e8d5cf47dc", "score": "0.68137664", "text": "func (c *Client) PutResourcePolicy(ctx context.Context, params *PutResourcePolicyInput, optFns ...func(*Options)) (*PutResourcePolicyOutput, error) {\n\tif params == nil {\n\t\tparams = &PutResourcePolicyInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"PutResourcePolicy\", params, optFns, c.addOperationPutResourcePolicyMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*PutResourcePolicyOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}", "title": "" }, { "docid": "b8c67ce28967e87853659dffa282ea12", "score": "0.6592637", "text": "func (c *CloudTrail) DeleteResourcePolicyWithContext(ctx aws.Context, input *DeleteResourcePolicyInput, opts ...request.Option) (*DeleteResourcePolicyOutput, error) {\n\treq, out := c.DeleteResourcePolicyRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "0d5c68cc4c820a18028e7084c29862d6", "score": "0.65313953", "text": "func (c *NetworkManager) DeleteResourcePolicyWithContext(ctx aws.Context, input *DeleteResourcePolicyInput, opts ...request.Option) (*DeleteResourcePolicyOutput, error) {\n\treq, out := c.DeleteResourcePolicyRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "f6caf6b65e3bd5a42439c6f27f95d779", "score": "0.6437174", "text": "func (c *IoTWireless) PutResourceLogLevelWithContext(ctx aws.Context, input *PutResourceLogLevelInput, opts ...request.Option) (*PutResourceLogLevelOutput, error) {\n\treq, out := c.PutResourceLogLevelRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "3aac5099a03b9d83e2bc775ad97cfc10", "score": "0.6402764", "text": "func (c *CloudTrail) GetResourcePolicyWithContext(ctx aws.Context, input *GetResourcePolicyInput, opts ...request.Option) (*GetResourcePolicyOutput, error) {\n\treq, out := c.GetResourcePolicyRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "9ffb252a42bfea244abb7fc6c52524b6", "score": "0.638045", "text": "func (mr *MockCloudWatchLogsAPIMockRecorder) DeleteResourcePolicyWithContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {\n\tvarargs := append([]interface{}{arg0, arg1}, arg2...)\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"DeleteResourcePolicyWithContext\", reflect.TypeOf((*MockCloudWatchLogsAPI)(nil).DeleteResourcePolicyWithContext), varargs...)\n}", "title": "" }, { "docid": "0fed3e8b8329331eed089ea72696ddaf", "score": "0.62935424", "text": "func (c *NetworkManager) GetResourcePolicyWithContext(ctx aws.Context, input *GetResourcePolicyInput, opts ...request.Option) (*GetResourcePolicyOutput, error) {\n\treq, out := c.GetResourcePolicyRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "e3756d87f3fdc3f49b5e4be2b33456cb", "score": "0.60094213", "text": "func (s *PutResourcePolicyInput) SetResourcePolicy(v string) *PutResourcePolicyInput {\n\ts.ResourcePolicy = &v\n\treturn s\n}", "title": "" }, { "docid": "46c4bbf73952be82c031c3340cf34c70", "score": "0.5991646", "text": "func (c *Route53Resolver) PutResolverRulePolicyWithContext(ctx aws.Context, input *PutResolverRulePolicyInput, opts ...request.Option) (*PutResolverRulePolicyOutput, error) {\n\treq, out := c.PutResolverRulePolicyRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "3a414f98aa248cb56adc73eb0a9f3b81", "score": "0.59887403", "text": "func (s *PutResourcePolicyOutput) SetResourcePolicy(v string) *PutResourcePolicyOutput {\n\ts.ResourcePolicy = &v\n\treturn s\n}", "title": "" }, { "docid": "9db73f87501a3317f414280ba15992f5", "score": "0.57900935", "text": "func (c *OAM) PutSinkPolicyWithContext(ctx aws.Context, input *PutSinkPolicyInput, opts ...request.Option) (*PutSinkPolicyOutput, error) {\n\treq, out := c.PutSinkPolicyRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "62fc4c9bfe48f66262e13e9443164cd3", "score": "0.5768123", "text": "func (c *Mgn) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) {\n\treq, out := c.TagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "25c5ed2148eab4708181a7df2e3c8061", "score": "0.5713797", "text": "func (c *MWAA) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) {\n\treq, out := c.TagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "5bba517eed481265d2fe8b8c8004f3bf", "score": "0.5707593", "text": "func (c *ConfigService) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) {\n\treq, out := c.TagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "8436679703b41a649452c4cb13a9affb", "score": "0.570156", "text": "func (c *SecurityHub) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) {\n\treq, out := c.TagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "f1107b775b1e869cf49bc124b161f491", "score": "0.5697625", "text": "func (c *Chime) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) {\n\treq, out := c.TagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "c8eec4cda46d9b98b6f9b9c8f641c182", "score": "0.56921536", "text": "func (s *GetResourcePolicyOutput) SetResourcePolicy(v string) *GetResourcePolicyOutput {\n\ts.ResourcePolicy = &v\n\treturn s\n}", "title": "" }, { "docid": "d297d1a5c33861e16534ac304f2b198d", "score": "0.56698203", "text": "func (c *CodeStarNotifications) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) {\n\treq, out := c.TagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "246d98ecc743b36f4058c1659185ed38", "score": "0.5654045", "text": "func (c *IoTWireless) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) {\n\treq, out := c.TagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "634e9214efe9b4aeb4dea83620275a0d", "score": "0.56294614", "text": "func (c *OAM) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) {\n\treq, out := c.TagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "37d5fe4693c461ed1b1b4bbd68b02009", "score": "0.5618549", "text": "func (c *Mgn) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) {\n\treq, out := c.UntagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "2dbb830caf2ece4ff461ee38e693d533", "score": "0.56184226", "text": "func (c *Route53Resolver) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) {\n\treq, out := c.TagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "83257782a6d7b2666392dc99db5b1b6f", "score": "0.5615763", "text": "func (c *CodeStarNotifications) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) {\n\treq, out := c.UntagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "993b51423508b7f5ce63bed3525f946e", "score": "0.56110984", "text": "func (c *Transfer) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) {\n\treq, out := c.TagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "a86f036f66cd6f5e1c6fe2262b30d969", "score": "0.5597438", "text": "func (c *IoTWireless) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) {\n\treq, out := c.UntagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "3d703dc60e5b74ba9dea36a2a8a17351", "score": "0.55801415", "text": "func (c *CustomerProfiles) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) {\n\treq, out := c.TagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "7d7a2cd38adb353f8bcbb517b8ea5776", "score": "0.5576818", "text": "func (m *MockCloudWatchLogsAPI) PutDestinationPolicyWithContext(arg0 aws.Context, arg1 *cloudwatchlogs.PutDestinationPolicyInput, arg2 ...request.Option) (*cloudwatchlogs.PutDestinationPolicyOutput, error) {\n\tvarargs := []interface{}{arg0, arg1}\n\tfor _, a := range arg2 {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"PutDestinationPolicyWithContext\", varargs...)\n\tret0, _ := ret[0].(*cloudwatchlogs.PutDestinationPolicyOutput)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "675010ad258e49abab42a574511d8098", "score": "0.5556395", "text": "func (c *LicenseManager) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) {\n\treq, out := c.TagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "a8036a7601b67d566358d6c7eb629294", "score": "0.5555255", "text": "func (c *OpenSearchServerless) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) {\n\treq, out := c.TagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "c8d46c4a5a209b591c776c3a3db5b8fb", "score": "0.5554332", "text": "func (m *MockCloudWatchLogsAPI) DescribeResourcePoliciesWithContext(arg0 aws.Context, arg1 *cloudwatchlogs.DescribeResourcePoliciesInput, arg2 ...request.Option) (*cloudwatchlogs.DescribeResourcePoliciesOutput, error) {\n\tvarargs := []interface{}{arg0, arg1}\n\tfor _, a := range arg2 {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"DescribeResourcePoliciesWithContext\", varargs...)\n\tret0, _ := ret[0].(*cloudwatchlogs.DescribeResourcePoliciesOutput)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "448b6bf0b6e6b38e79e90e4c8d1a0ce5", "score": "0.55526835", "text": "func (c *DeviceFarm) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) {\n\treq, out := c.TagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "b2921fe5cbef75099e20772d5e219d15", "score": "0.5550813", "text": "func (c *RAM) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) {\n\treq, out := c.TagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "cbc381b634d047d2469ed5fa9a247519", "score": "0.5546944", "text": "func (c *MediaConvert) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) {\n\treq, out := c.TagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "22482c6042653c142cceedf74b26f23a", "score": "0.55438924", "text": "func (c *Chime) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) {\n\treq, out := c.UntagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "63a3e4aba64a6c55077d3dda47003451", "score": "0.55349314", "text": "func (c *IoT1ClickProjects) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) {\n\treq, out := c.TagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "ef1650d0abcb062c934a92688f479ca5", "score": "0.5525016", "text": "func (c *CloudWatchRUM) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) {\n\treq, out := c.TagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "a4270041dbffb4225d800285e9f0d307", "score": "0.5519618", "text": "func (c *ChimeSDKMediaPipelines) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) {\n\treq, out := c.TagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "b82041b912ed4ec54a7d1d862614b01c", "score": "0.55163443", "text": "func (c *LexModelBuildingService) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) {\n\treq, out := c.TagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "9ee32e77b977f11ac66e0e059100a214", "score": "0.5470248", "text": "func (c *Route53Resolver) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) {\n\treq, out := c.UntagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "6e365f4495ce2d140b0247a3cab34599", "score": "0.54586846", "text": "func (c *MWAA) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) {\n\treq, out := c.UntagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "c0d3824657e7cef0ca4c6b011c95a8ea", "score": "0.5453733", "text": "func (c *ConfigService) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) {\n\treq, out := c.UntagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "ce168513e7f2971835da7090909f38a7", "score": "0.5446987", "text": "func (c *Route53RecoveryReadiness) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) {\n\treq, out := c.UntagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "3513eacf36e2aee126bce82dffb2936e", "score": "0.54436755", "text": "func (c *DeviceFarm) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) {\n\treq, out := c.UntagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "d1741111bb8c52616d04c177c80c45bc", "score": "0.543756", "text": "func (c *MediaConvert) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) {\n\treq, out := c.UntagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "7fc0108712fbd1a605b0c48bf2bd0795", "score": "0.5433975", "text": "func (c *SecurityHub) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) {\n\treq, out := c.UntagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "ddeff983f2bc3c88657c9760061c552e", "score": "0.5415633", "text": "func (c *OpenSearchServerless) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) {\n\treq, out := c.UntagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "d48fd6e8a6f7e9d05e1c73c75c3cecd2", "score": "0.5415612", "text": "func (c *NetworkManager) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) {\n\treq, out := c.TagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "d8ad163b533a8bbf923b0f3e04c712d3", "score": "0.54093987", "text": "func (c *ChimeSDKMediaPipelines) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) {\n\treq, out := c.UntagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "8a34fa0c077d7cb8118ccc0318189868", "score": "0.5402538", "text": "func (c *Transfer) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) {\n\treq, out := c.UntagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "c4858b9c743aea3d2d51bdc2de38d882", "score": "0.5374767", "text": "func (c *RAM) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) {\n\treq, out := c.UntagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "e1f0e3f7d15ac90b848448ffdd12f86a", "score": "0.5372385", "text": "func (c *Route53RecoveryReadiness) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) {\n\treq, out := c.TagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "04b66f4db33a9f5b3d3f5546db7ce8d9", "score": "0.5366191", "text": "func (c *LicenseManager) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) {\n\treq, out := c.UntagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "d36f6631ffaecfc8164a7f203e9abb72", "score": "0.5361382", "text": "func (c *CustomerProfiles) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) {\n\treq, out := c.UntagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "e914646e630ef6cb4876a2e8e1e53a97", "score": "0.53608423", "text": "func (c *OAM) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) {\n\treq, out := c.UntagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "b93498be9f0d7770a6623cd8d89138a3", "score": "0.5296362", "text": "func (c *CloudWatchRUM) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) {\n\treq, out := c.UntagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "929b012194b16407e8223eee1bf81e2e", "score": "0.5275914", "text": "func (db *DynamoDb) TagResourceWithContext(aws.Context, *dynamodb.TagResourceInput, ...request.Option) (*dynamodb.TagResourceOutput, error) {\n\tpanic(\"TagResourceWithContext is not implemented\")\n}", "title": "" }, { "docid": "79fe8621f7f05dc8f6b7e61edc5145e9", "score": "0.52491915", "text": "func (c *ConfigService) DeleteResourceConfigWithContext(ctx aws.Context, input *DeleteResourceConfigInput, opts ...request.Option) (*DeleteResourceConfigOutput, error) {\n\treq, out := c.DeleteResourceConfigRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "ac60b677d45662ce830620be5f876494", "score": "0.5226788", "text": "func (c *RAM) GetResourcePoliciesWithContext(ctx aws.Context, input *GetResourcePoliciesInput, opts ...request.Option) (*GetResourcePoliciesOutput, error) {\n\treq, out := c.GetResourcePoliciesRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "3bfd09d67c76ac532c50a2c6cada91a1", "score": "0.522456", "text": "func (c *LexModelBuildingService) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) {\n\treq, out := c.UntagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "bdc423cd4275a5c8c45e69eaa219cb72", "score": "0.5219059", "text": "func (c *IoT1ClickProjects) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) {\n\treq, out := c.UntagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "9fa375afdfc583b7388e3470b87b7614", "score": "0.52004635", "text": "func (c *RAM) PromoteResourceShareCreatedFromPolicyWithContext(ctx aws.Context, input *PromoteResourceShareCreatedFromPolicyInput, opts ...request.Option) (*PromoteResourceShareCreatedFromPolicyOutput, error) {\n\treq, out := c.PromoteResourceShareCreatedFromPolicyRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "c9274832d4f928cc540bc9d1b873f06d", "score": "0.51432973", "text": "func (c *NetworkManager) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) {\n\treq, out := c.UntagResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "83b7a77624958fe5597c3e804c9f9aa5", "score": "0.51408005", "text": "func (c *IoTWireless) ResetResourceLogLevelWithContext(ctx aws.Context, input *ResetResourceLogLevelInput, opts ...request.Option) (*ResetResourceLogLevelOutput, error) {\n\treq, out := c.ResetResourceLogLevelRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "fa1a0df59fc32b613bece637e01c2c1b", "score": "0.5104039", "text": "func (mr *MockCloudWatchLogsAPIMockRecorder) DescribeResourcePoliciesWithContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {\n\tvarargs := append([]interface{}{arg0, arg1}, arg2...)\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"DescribeResourcePoliciesWithContext\", reflect.TypeOf((*MockCloudWatchLogsAPI)(nil).DescribeResourcePoliciesWithContext), varargs...)\n}", "title": "" }, { "docid": "a8643a74a4aea88a76469cf47afead06", "score": "0.50817", "text": "func (c *ConfigService) SelectResourceConfigWithContext(ctx aws.Context, input *SelectResourceConfigInput, opts ...request.Option) (*SelectResourceConfigOutput, error) {\n\treq, out := c.SelectResourceConfigRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "0be91ef27882d081050dce5d6bf27114", "score": "0.5068779", "text": "func (c *ConfigService) PutConfigRuleWithContext(ctx aws.Context, input *PutConfigRuleInput, opts ...request.Option) (*PutConfigRuleOutput, error) {\n\treq, out := c.PutConfigRuleRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "39d543d9d178b7708cca1c693f13f246", "score": "0.50586396", "text": "func (c *Iam) GetPolicyWithContext(ctx aws.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) {\n\treq, out := c.GetPolicyRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "b0c84624c83bb817052b0cecefac08e3", "score": "0.5036704", "text": "func (m *MockCloudWatchLogsAPI) PutResourcePolicy(arg0 *cloudwatchlogs.PutResourcePolicyInput) (*cloudwatchlogs.PutResourcePolicyOutput, error) {\n\tret := m.ctrl.Call(m, \"PutResourcePolicy\", arg0)\n\tret0, _ := ret[0].(*cloudwatchlogs.PutResourcePolicyOutput)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "028848b211edd0377c7819d581435564", "score": "0.50129026", "text": "func (c *Iam) UpdatePolicyWithContext(ctx aws.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) {\n\treq, out := c.UpdatePolicyRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "fadd984f59000bff68af0ac92b0affa0", "score": "0.49575663", "text": "func (c *NetworkManager) PutCoreNetworkPolicyWithContext(ctx aws.Context, input *PutCoreNetworkPolicyInput, opts ...request.Option) (*PutCoreNetworkPolicyOutput, error) {\n\treq, out := c.PutCoreNetworkPolicyRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "ccd5c4350b2dc73892a64fff96c0f54b", "score": "0.49299705", "text": "func (mr *MockCloudWatchLogsAPIMockRecorder) PutDestinationPolicyWithContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {\n\tvarargs := append([]interface{}{arg0, arg1}, arg2...)\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"PutDestinationPolicyWithContext\", reflect.TypeOf((*MockCloudWatchLogsAPI)(nil).PutDestinationPolicyWithContext), varargs...)\n}", "title": "" }, { "docid": "7a247c21fdaa7d90798d173955c91ab4", "score": "0.48983914", "text": "func (c *Client) PutPolicy(ctx context.Context, params *PutPolicyInput, optFns ...func(*Options)) (*PutPolicyOutput, error) {\n\tif params == nil {\n\t\tparams = &PutPolicyInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"PutPolicy\", params, optFns, c.addOperationPutPolicyMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*PutPolicyOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}", "title": "" }, { "docid": "7308a1d6bdd4d0ac2112f985bbc7eb98", "score": "0.48730588", "text": "func (db *DynamoDb) UntagResourceWithContext(aws.Context, *dynamodb.UntagResourceInput, ...request.Option) (*dynamodb.UntagResourceOutput, error) {\n\tpanic(\"UntagResourceWithContext is not implemented\")\n}", "title": "" }, { "docid": "c6c89e6adce6eb6171ff1b0fa954a8f2", "score": "0.48528907", "text": "func (c *Neptune) AddTagsToResourceWithContext(ctx aws.Context, input *AddTagsToResourceInput, opts ...request.Option) (*AddTagsToResourceOutput, error) {\n\treq, out := c.AddTagsToResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "7f4b2bc662c02bc8f73cb50789bcbe11", "score": "0.4830606", "text": "func (o *PutPolicyOK) WithPayload(payload *models.Policy) *PutPolicyOK {\n\to.Payload = payload\n\treturn o\n}", "title": "" }, { "docid": "972885c249ce00b7075c495e78353365", "score": "0.4769234", "text": "func (m *MockCloudWatchLogsAPI) PutRetentionPolicyWithContext(arg0 aws.Context, arg1 *cloudwatchlogs.PutRetentionPolicyInput, arg2 ...request.Option) (*cloudwatchlogs.PutRetentionPolicyOutput, error) {\n\tvarargs := []interface{}{arg0, arg1}\n\tfor _, a := range arg2 {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"PutRetentionPolicyWithContext\", varargs...)\n\tret0, _ := ret[0].(*cloudwatchlogs.PutRetentionPolicyOutput)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "9f84539a3c00fd907ff2aef7d58d0166", "score": "0.47533378", "text": "func (m *MockCloudWatchLogsAPI) PutSubscriptionFilterWithContext(arg0 aws.Context, arg1 *cloudwatchlogs.PutSubscriptionFilterInput, arg2 ...request.Option) (*cloudwatchlogs.PutSubscriptionFilterOutput, error) {\n\tvarargs := []interface{}{arg0, arg1}\n\tfor _, a := range arg2 {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"PutSubscriptionFilterWithContext\", varargs...)\n\tret0, _ := ret[0].(*cloudwatchlogs.PutSubscriptionFilterOutput)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "bf055151caa05b4264133c9934b20a07", "score": "0.47276875", "text": "func (mr *MockCloudWatchLogsAPIMockRecorder) PutResourcePolicy(arg0 interface{}) *gomock.Call {\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"PutResourcePolicy\", reflect.TypeOf((*MockCloudWatchLogsAPI)(nil).PutResourcePolicy), arg0)\n}", "title": "" }, { "docid": "1adf911dd042a38181519beaef9b2546", "score": "0.47122097", "text": "func (c *Iam) DeletePolicyWithContext(ctx aws.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) {\n\treq, out := c.DeletePolicyRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "d65968d16ed793b70b8b573da6a404ae", "score": "0.4697634", "text": "func (c *ConfigService) DescribeComplianceByResourceWithContext(ctx aws.Context, input *DescribeComplianceByResourceInput, opts ...request.Option) (*DescribeComplianceByResourceOutput, error) {\n\treq, out := c.DescribeComplianceByResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "8fbed62b03f80764003617ec3b155ddf", "score": "0.4660321", "text": "func (c *Route53Resolver) PutResolverQueryLogConfigPolicyWithContext(ctx aws.Context, input *PutResolverQueryLogConfigPolicyInput, opts ...request.Option) (*PutResolverQueryLogConfigPolicyOutput, error) {\n\treq, out := c.PutResolverQueryLogConfigPolicyRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "62fcedc1a7f547db6498aa5f3c960c5e", "score": "0.46394435", "text": "func (c *MediaConvert) DeletePolicyWithContext(ctx aws.Context, input *DeletePolicyInput, opts ...request.Option) (*DeletePolicyOutput, error) {\n\treq, out := c.DeletePolicyRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "0cad45eaafd6350fe03ddd5c6a61b92c", "score": "0.46338174", "text": "func (c *Route53RecoveryReadiness) UpdateResourceSetWithContext(ctx aws.Context, input *UpdateResourceSetInput, opts ...request.Option) (*UpdateResourceSetOutput, error) {\n\treq, out := c.UpdateResourceSetRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "72574cf4ebcf75cbf4b0a90b9c36284c", "score": "0.46280938", "text": "func (s *Product) SetProductSubscriptionResourcePolicy(v string) *Product {\n\ts.ProductSubscriptionResourcePolicy = &v\n\treturn s\n}", "title": "" }, { "docid": "30edff592d65fee41a392bd83883d134", "score": "0.46262777", "text": "func (c *MediaConvert) GetPolicyWithContext(ctx aws.Context, input *GetPolicyInput, opts ...request.Option) (*GetPolicyOutput, error) {\n\treq, out := c.GetPolicyRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "638e5dff22ccb32bc117bfa1acc1588c", "score": "0.46116164", "text": "func (m *MockCloudWatchLogsAPI) PutMetricFilterWithContext(arg0 aws.Context, arg1 *cloudwatchlogs.PutMetricFilterInput, arg2 ...request.Option) (*cloudwatchlogs.PutMetricFilterOutput, error) {\n\tvarargs := []interface{}{arg0, arg1}\n\tfor _, a := range arg2 {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"PutMetricFilterWithContext\", varargs...)\n\tret0, _ := ret[0].(*cloudwatchlogs.PutMetricFilterOutput)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "23d1c790e2bcd71d8dc41fc80fca5959", "score": "0.45833254", "text": "func Convert_v2beta1_PodResourcePolicy_To_autoscaling_PodResourcePolicy(in *v2beta1.PodResourcePolicy, out *autoscaling.PodResourcePolicy, s conversion.Scope) error {\n\treturn autoConvert_v2beta1_PodResourcePolicy_To_autoscaling_PodResourcePolicy(in, out, s)\n}", "title": "" }, { "docid": "338fef94ae91b42648fba971aab3b4a3", "score": "0.45790344", "text": "func NewCancelDeploymentResourcePendingPlanParamsWithContext(ctx context.Context) *CancelDeploymentResourcePendingPlanParams {\n\treturn &CancelDeploymentResourcePendingPlanParams{\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "dbf76f016aacbbc7c8cea2f8fea17616", "score": "0.45699155", "text": "func (svc *CloudwatchLogs) RawPutResourcePolicy(ctx context.Context, in *SDK.PutResourcePolicyInput) (*SDK.PutResourcePolicyResponse, error) {\n\treturn svc.client.PutResourcePolicyRequest(in).Send(ctx)\n}", "title": "" }, { "docid": "2a8781571045c0f4066beb054c9e1e66", "score": "0.45672974", "text": "func (c *Inspector) SetTagsForResourceWithContext(ctx aws.Context, input *SetTagsForResourceInput, opts ...request.Option) (*SetTagsForResourceOutput, error) {\n\treq, out := c.SetTagsForResourceRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "df3455be238bcab30efcc03340fb93f5", "score": "0.4560825", "text": "func (c *IoTWireless) GetResourceLogLevelWithContext(ctx aws.Context, input *GetResourceLogLevelInput, opts ...request.Option) (*GetResourceLogLevelOutput, error) {\n\treq, out := c.GetResourceLogLevelRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "dda5ddc608ba0acaf59a0540b9630b84", "score": "0.45494208", "text": "func NewPutPrefilterParamsWithContext(ctx context.Context) *PutPrefilterParams {\n\tvar ()\n\treturn &PutPrefilterParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "66cc226dc97974f82222371c9c241b17", "score": "0.4542687", "text": "func (c *Route53Resolver) GetResolverRulePolicyWithContext(ctx aws.Context, input *GetResolverRulePolicyInput, opts ...request.Option) (*GetResolverRulePolicyOutput, error) {\n\treq, out := c.GetResolverRulePolicyRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" } ]
274be17288c6dec415c9f4d4dd19d17b
ResolveEndpoints passes the actual concrete type to the resolver for handing property endpoints. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling, if desired.
[ { "docid": "4a2577ae028d27acba5450e4923da884", "score": "0.7371351", "text": "func (t *Place) ResolveEndpoints(r *Resolver) (s Resolution, err error) {\n\ts = Unresolved\n\thandled := false\n\tif t.raw.IsEndpoints() {\n\t\thandled, err = r.dispatch(t.raw.GetEndpoints())\n\t\tif handled {\n\t\t\ts = Resolved\n\t\t}\n\t} else if t.raw.IsEndpointsIRI() {\n\t\ts = RawResolutionNeeded\n\t}\n\treturn\n\n}", "title": "" } ]
[ { "docid": "472035b8f2e9e8eeea21ace1a98e53b3", "score": "0.67307734", "text": "func (m *authorityEndpoint) ResolveEndpoints(ctx context.Context, authorityInfo authority.Info, userPrincipalName string) (authority.Endpoints, error) {\n\n\tif endpoints, found := m.cachedEndpoints(authorityInfo, userPrincipalName); found {\n\t\treturn endpoints, nil\n\t}\n\n\tendpoint, err := m.openIDConfigurationEndpoint(ctx, authorityInfo, userPrincipalName)\n\tif err != nil {\n\t\treturn authority.Endpoints{}, err\n\t}\n\n\tresp, err := m.rest.Authority().GetTenantDiscoveryResponse(ctx, endpoint)\n\tif err != nil {\n\t\treturn authority.Endpoints{}, err\n\t}\n\tif err := resp.Validate(); err != nil {\n\t\treturn authority.Endpoints{}, fmt.Errorf(\"ResolveEndpoints(): %w\", err)\n\t}\n\n\ttenant := authorityInfo.Tenant\n\n\tendpoints := authority.NewEndpoints(\n\t\tstrings.Replace(resp.AuthorizationEndpoint, \"{tenant}\", tenant, -1),\n\t\tstrings.Replace(resp.TokenEndpoint, \"{tenant}\", tenant, -1),\n\t\tstrings.Replace(resp.Issuer, \"{tenant}\", tenant, -1),\n\t\tauthorityInfo.Host)\n\n\tm.addCachedEndpoints(authorityInfo, userPrincipalName, endpoints)\n\n\treturn endpoints, nil\n}", "title": "" }, { "docid": "b06a9f5fb6fa77f587018b17eeb2233f", "score": "0.61559635", "text": "func (ep Endpoints) Resolve(endpoint string) *url.URL {\n\tfor k, v := range ep {\n\t\tif strings.HasPrefix(endpoint, k) {\n\t\t\tu := *v\n\t\t\tu.Path = u.Path + strings.TrimPrefix(endpoint, k)\n\t\t\treturn &u\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fe901d1a90b058045b872f2309d14850", "score": "0.55579746", "text": "func (e EndpointResolverFunc) ResolveEndpoint(service, region string) (Endpoint, error) {\n\treturn e(service, region)\n}", "title": "" }, { "docid": "82693a7715e5cbe2f5b4bc609c8da88d", "score": "0.54416645", "text": "func ResolveEndpoint(services listersv1.ServiceLister, endpoints listersv1.EndpointsLister, namespace, id string, port int32) (*url.URL, error) {\n\tsvc, err := services.Services(namespace).Get(id)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tswitch {\n\tcase svc.Spec.Type == v1.ServiceTypeClusterIP, svc.Spec.Type == v1.ServiceTypeLoadBalancer, svc.Spec.Type == v1.ServiceTypeNodePort:\n\t\t// these are fine\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unsupported service type %q\", svc.Spec.Type)\n\t}\n\n\tsvcPort, err := findServicePort(svc, port)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\teps, err := endpoints.Endpoints(namespace).Get(svc.Name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(eps.Subsets) == 0 {\n\t\treturn nil, errors.NewServiceUnavailable(fmt.Sprintf(\"no endpoints available for service %q\", svc.Name))\n\t}\n\n\t// Pick a random Subset to start searching from.\n\tssSeed := rand.Intn(len(eps.Subsets))\n\n\t// Find a Subset that has the port.\n\tfor ssi := 0; ssi < len(eps.Subsets); ssi++ {\n\t\tss := &eps.Subsets[(ssSeed+ssi)%len(eps.Subsets)]\n\t\tif len(ss.Addresses) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tfor i := range ss.Ports {\n\t\t\tif ss.Ports[i].Name == svcPort.Name {\n\t\t\t\t// Pick a random address.\n\t\t\t\tip := ss.Addresses[rand.Intn(len(ss.Addresses))].IP\n\t\t\t\tport := int(ss.Ports[i].Port)\n\t\t\t\treturn &url.URL{\n\t\t\t\t\tScheme: \"https\",\n\t\t\t\t\tHost: net.JoinHostPort(ip, strconv.Itoa(port)),\n\t\t\t\t}, nil\n\t\t\t}\n\t\t}\n\t}\n\treturn nil, errors.NewServiceUnavailable(fmt.Sprintf(\"no endpoints available for service %q\", id))\n}", "title": "" }, { "docid": "52c658d839dfc70cc0029d865185cd6e", "score": "0.5351561", "text": "func NewResolveEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint {\n\treturn func(ctx context.Context, req interface{}) (interface{}, error) {\n\t\tp := req.(*ResolvePayload)\n\t\tvar err error\n\t\tsc := security.JWTScheme{\n\t\t\tName: \"jwt\",\n\t\t\tScopes: []string{\"api:access\", \"api:admin\", \"api:ingestion\"},\n\t\t\tRequiredScopes: []string{},\n\t\t}\n\t\tvar token string\n\t\tif p.Auth != nil {\n\t\t\ttoken = *p.Auth\n\t\t}\n\t\tctx, err = authJWTFn(ctx, token, &sc)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tres, err := s.Resolve(ctx, p)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tvres := NewViewedSavedBookmark(res, \"default\")\n\t\treturn vres, nil\n\t}\n}", "title": "" }, { "docid": "c727a67ad8d9f7306303e7bdb73e3b86", "score": "0.52777654", "text": "func (e *Engine) resolveEndpoint(req *http.Request) (*endpoints.ResolvedEndpoint, error) {\n\tendpointID, err := extractEndpointID(req)\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err)\n\t}\n\topts := func(opts *endpoints.Options) {\n\t\topts.ResolveUnknownService = true\n\t}\n\tre, err := endpoints.DefaultResolver().EndpointFor(endpointID, e.sessionCtx.Database.GetAWS().Region, opts)\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err)\n\t}\n\turi := e.sessionCtx.Database.GetURI()\n\tif uri != \"\" && uri != apiaws.DynamoDBURIForRegion(e.sessionCtx.Database.GetAWS().Region) {\n\t\t// override the resolved endpoint URL with the user-configured URI.\n\t\tre.URL = uri\n\t}\n\tif !strings.Contains(re.URL, \"://\") {\n\t\tre.URL = \"https://\" + re.URL\n\t}\n\treturn &re, nil\n}", "title": "" }, { "docid": "eaaade219810111eaded09d91946fb32", "score": "0.5240624", "text": "func (s *server) resolveToEndpoint(ctx *context.T, address string) ([]naming.Endpoint, error) {\n\tns := v23.GetNamespace(ctx)\n\tns.FlushCacheEntry(ctx, address)\n\tresolved, err := ns.Resolve(ctx, address)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// An empty set of protocols means all protocols...\n\tif resolved.Servers, err = filterAndOrderServers(resolved.Servers, s.preferredProtocols); err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar eps []naming.Endpoint\n\tfor _, n := range resolved.Names() {\n\t\taddress, suffix := naming.SplitAddressName(n)\n\t\tif suffix != \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tif ep, err := naming.ParseEndpoint(address); err == nil {\n\t\t\teps = append(eps, ep)\n\t\t}\n\t}\n\tif len(eps) > 0 {\n\t\treturn eps, nil\n\t}\n\treturn nil, errNoCompatibleServers.Errorf(nil, \"failed to resolve %v to an endpoint\", address)\n}", "title": "" }, { "docid": "dc2f01130cbb08eba6f1d954c489a973", "score": "0.5177704", "text": "func (r *EndpointResolver) ResolveEndpoint(service, region string) (aws.Endpoint, error) {\n\tdefaultEndpoint, err := endpoints.NewDefaultResolver().ResolveEndpoint(service, region)\n\tif err != nil {\n\t\treturn defaultEndpoint, err\n\t}\n\tif ep := os.Getenv(AWSSecretsmanagerEndpoint); ep != \"\" {\n\t\tif service == \"secretsmanager\" {\n\t\t\treturn aws.Endpoint{\n\t\t\t\tURL: ep,\n\t\t\t}, nil\n\t\t}\n\t}\n\tif ep := os.Getenv(AWSSTSEndpoint); ep != \"\" {\n\t\tif service == \"sts\" {\n\t\t\treturn aws.Endpoint{\n\t\t\t\tURL: ep,\n\t\t\t}, nil\n\t\t}\n\t}\n\treturn r.res.ResolveEndpoint(service, region)\n}", "title": "" }, { "docid": "64b48911922b45ee6c587699bc88db73", "score": "0.49270052", "text": "func Resolve(c echo.Context) error {\n\tif !models.CheckAPIKey(c.Request().Header[\"Xrplns-Key\"]) {\n\t\tvar empty interface{}\n\t\treturn c.JSON(http.StatusUnauthorized, empty)\n\t}\n\tnetwork := c.Param(\"network\")\n\tusername := c.Param(\"username\")\n\n\tsocial, exists := models.GetXrplAccount(network, username)\n\n\tr := new(resolveResponse)\n\n\tif exists {\n\t\tr.XrplAccount = social.PreferredXrplAccount.XrplAccount\n\t\tr.DestinationTag = social.PreferredXrplAccount.Tag\n\t\tr.Label = social.PreferredXrplAccount.Label\n\t\tr.IsPreferredXRPLAccountAddress = social.PreferredXrplAccount.IsPreferredAddressOfUser\n\t\tr.Slug = social.User.Slug\n\t\tr.PublicPage = fmt.Sprintf(\"%s%s\", os.Getenv(\"PUBLIC_USERS_URL\"), social.User.Slug)\n\t\tw := new(resolveResponseWrap)\n\t\tw.Data = *r\n\t\treturn c.JSON(http.StatusOK, w)\n\t}\n\n\tvar empty interface{}\n\treturn c.JSON(http.StatusNotFound, empty)\n}", "title": "" }, { "docid": "a3c9349a18e2665b29dfaa8e0fa9fe69", "score": "0.4919395", "text": "func (t *Place) ResolveFollowers(r *Resolver) (s Resolution, err error) {\n\ts = Unresolved\n\thandled := false\n\tif t.raw.IsFollowersCollection() {\n\t\thandled, err = r.dispatch(t.raw.GetFollowersCollection())\n\t\tif handled {\n\t\t\ts = Resolved\n\t\t}\n\t} else if t.raw.IsFollowersOrderedCollection() {\n\t\ts = RawResolutionNeeded\n\t} else if t.raw.IsFollowersAnyURI() {\n\t\ts = RawResolutionNeeded\n\t}\n\treturn\n\n}", "title": "" }, { "docid": "6bf37423cd6dc6275a4cedaf671bde5d", "score": "0.48644647", "text": "func (s *Schema) Resolve(r *Schema) *Schema {\n\tif r == nil {\n\t\tr = s\n\t}\n\n\tfor n, d := range s.Definitions {\n\t\tif d.Title == \"\" {\n\t\t\td.Title = n\n\t\t}\n\t\ts.Definitions[n] = d.Resolve(r)\n\t}\n\tfor n, p := range s.Properties {\n\t\tif p.Title == \"\" {\n\t\t\tp.Title = n\n\t\t}\n\t\ts.Properties[n] = p.Resolve(r)\n\t}\n\tfor n, f := range s.Functions {\n\t\tif f.Title == \"\" {\n\t\t\tf.Title = n\n\t\t}\n\t\ts.Functions[n] = f.Resolve(r)\n\t}\n\tfor n, p := range s.PatternProperties {\n\t\ts.PatternProperties[n] = p.Resolve(r)\n\t}\n\tfor n, p := range s.Items {\n\t\ts.Items[n] = p.Resolve(r)\n\t}\n\tif s.Ref != nil {\n\t\ts = s.Ref.Resolve(r)\n\t}\n\tif len(s.OneOf) > 0 {\n\t\ts = s.OneOf[0].Ref.Resolve(r)\n\t}\n\tif len(s.AnyOf) > 0 {\n\t\ts = s.AnyOf[0].Ref.Resolve(r)\n\t}\n\tfor _, l := range s.Links {\n\t\tl.Resolve(r)\n\t}\n\n\tfor route, handlers := range s.Paths {\n\t\tfor verb, handler := range handlers {\n\t\t\tfor parameterIndex, parameter := range handler.Parameters {\n\t\t\t\tif parameter.Schema == nil {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\thandler.Parameters[parameterIndex].Schema = parameter.Schema.Resolve(r)\n\t\t\t}\n\n\t\t\tfor responseCode, response := range handler.Responses {\n\t\t\t\tif response == nil {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\thandler.Responses[responseCode] = response.Resolve(r)\n\t\t\t}\n\n\t\t\ts.Paths[route][verb] = handler\n\t\t}\n\t}\n\n\treturn s\n}", "title": "" }, { "docid": "1d2bc645fc5a0ab12c5c33feb2e05f4a", "score": "0.48631287", "text": "func credentialsEndpointResolver(ctx context.Context, c *Config) aws.EndpointResolverWithOptions {\n\tlogger := logging.RetrieveLogger(ctx)\n\n\tresolver := func(service, region string, options ...interface{}) (aws.Endpoint, error) {\n\t\tswitch service {\n\t\tcase iam.ServiceID:\n\t\t\tif endpoint := c.IamEndpoint; endpoint != \"\" {\n\t\t\t\tlogger.Info(ctx, \"Credentials resolution: setting custom IAM endpoint\", map[string]any{\n\t\t\t\t\t\"tf_aws.iam_client.endpoint\": endpoint,\n\t\t\t\t})\n\t\t\t\treturn aws.Endpoint{\n\t\t\t\t\tURL: endpoint,\n\t\t\t\t\tSource: aws.EndpointSourceCustom,\n\t\t\t\t\tSigningRegion: region,\n\t\t\t\t}, nil\n\t\t\t}\n\t\tcase sts.ServiceID:\n\t\t\tif endpoint := c.StsEndpoint; endpoint != \"\" {\n\t\t\t\tfields := map[string]any{\n\t\t\t\t\t\"tf_aws.sts_client.endpoint\": endpoint,\n\t\t\t\t}\n\t\t\t\tif c.StsRegion != \"\" {\n\t\t\t\t\tfields[\"tf_aws.sts_client.signing_region\"] = c.StsRegion\n\t\t\t\t\tregion = c.StsRegion\n\t\t\t\t}\n\t\t\t\tlogger.Info(ctx, \"Credentials resolution: setting custom STS endpoint\", fields)\n\t\t\t\treturn aws.Endpoint{\n\t\t\t\t\tURL: endpoint,\n\t\t\t\t\tSource: aws.EndpointSourceCustom,\n\t\t\t\t\tSigningRegion: region,\n\t\t\t\t}, nil\n\t\t\t}\n\t\t}\n\n\t\treturn aws.Endpoint{}, &aws.EndpointNotFoundError{}\n\t}\n\n\treturn aws.EndpointResolverWithOptionsFunc(resolver)\n}", "title": "" }, { "docid": "aa4773e052f0a7bc39cbc9da96ef96e3", "score": "0.47241813", "text": "func (t *Place) HasEndpoints() (p Presence) {\n\tp = NoPresence\n\tif t.raw.IsEndpoints() {\n\t\tp = ConvenientPresence\n\t} else if t.raw.IsEndpointsIRI() {\n\t\tp = RawPresence\n\t}\n\treturn\n\n}", "title": "" }, { "docid": "eb3c5af60edf4d6365ff6e2290ee6fc7", "score": "0.46763742", "text": "func (_m *MockETypeParameter) EGetResolve(_a0 EStructuralFeature, _a1 bool) interface{} {\n\tret := _m.Called(_a0, _a1)\n\n\tvar r0 interface{}\n\tif rf, ok := ret.Get(0).(func(EStructuralFeature, bool) interface{}); ok {\n\t\tr0 = rf(_a0, _a1)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(interface{})\n\t\t}\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "1ca93d9c5a6a6944407d9e8098901ac7", "score": "0.46671975", "text": "func (t *Place) ResolveGenerator(r *Resolver, idx int) (s Resolution, err error) {\n\ts = Unresolved\n\thandled := false\n\tif t.raw.IsGeneratorObject(idx) {\n\t\thandled, err = r.dispatch(t.raw.GetGeneratorObject(idx))\n\t\tif handled {\n\t\t\ts = Resolved\n\t\t}\n\t} else if t.raw.IsGeneratorLink(idx) {\n\t\thandled, err = r.dispatch(t.raw.GetGeneratorLink(idx))\n\t\tif handled {\n\t\t\ts = Resolved\n\t\t}\n\t} else if t.raw.IsGeneratorIRI(idx) {\n\t\ts = RawResolutionNeeded\n\t}\n\treturn\n\n}", "title": "" }, { "docid": "853fc8f8c552652b3bca7a7d1aa4c1cc", "score": "0.466389", "text": "func mockEndpointResolver(endpoint string) aws.EndpointResolverFunc {\n\treturn aws.EndpointResolverFunc(func(service, region string) (aws.Endpoint, error) {\n\t\tif endpoint == \"\" {\n\t\t\treturn aws.Endpoint{}, &aws.EndpointNotFoundError{}\n\t\t}\n\n\t\tif service == ec2.ServiceID && region == \"shoes-aws-testing-region\" {\n\t\t\treturn aws.Endpoint{\n\t\t\t\tPartitionID: \"aws\",\n\t\t\t\tURL: endpoint,\n\t\t\t\tSigningRegion: \"shoes-aws-testing-region\",\n\t\t\t}, nil\n\t\t}\n\n\t\treturn aws.Endpoint{}, &aws.EndpointNotFoundError{}\n\t})\n}", "title": "" }, { "docid": "c840400f12c80c0faf77e54f5db4956e", "score": "0.46595418", "text": "func Providers(r io.Reader) (LookupFunc, error) {\n\tps := []struct {\n\t\tEndpoints []struct {\n\t\t\tURL string `json:\"url\"`\n\t\t\tSchemes []string `json:\"schemes,omitempty\"`\n\t\t} `json:\"endpoints\"`\n\t}{}\n\tif err := json.NewDecoder(r).Decode(&ps); err != nil {\n\t\treturn nil, err\n\t}\n\tvar providers endpoints\n\tfor _, p := range ps {\n\t\tfor _, ep := range p.Endpoints {\n\t\t\tif ep.URL == \"\" || len(ep.Schemes) == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tu, err := url.Parse(strings.Replace(ep.URL, \"{format}\", \"json\", -1))\n\t\t\tif err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor _, pat := range ep.Schemes {\n\t\t\t\tu2, err := url.Parse(pat)\n\t\t\t\tif err != nil {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tswitch u2.Scheme {\n\t\t\t\tcase \"http\", \"https\":\n\t\t\t\tdefault:\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif idx := strings.IndexByte(u2.Host, '*'); idx != strings.LastIndexByte(u2.Host, '*') ||\n\t\t\t\t\tidx != strings.Index(u2.Host, \"*.\") ||\n\t\t\t\t\t(idx >= 0 && strings.Count(u2.Host[idx:], \".\") < 2) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tendpoint := endpoint{u: u, https: u2.Scheme == \"https\"}\n\t\t\t\tif endpoint.domain, err = glob.Compile(u2.Host); err != nil {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif endpoint.path, err = glob.Compile(u2.Path); err != nil {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tproviders = append(providers, endpoint)\n\t\t\t}\n\t\t}\n\t}\n\treturn providers.lookup, nil\n}", "title": "" }, { "docid": "eb072aff264047711c4c820258365cc3", "score": "0.464398", "text": "func (h *HTTPUniversalResolver) RawResolve(d *did.DID) (*UniversalResolverResponse, error) {\n\tif d == nil {\n\t\treturn nil, errors.New(\"Invalid DID\")\n\t}\n\n\tclient := chttp.NewRestHelper(\"\", \"\")\n\tres, err := client.SendRequestToURLWithRetry(\n\t\th.fullResolverURL(d),\n\t\thttp.MethodGet,\n\t\tnil,\n\t\tnil,\n\t\treqMaxAtts,\n\t\treqBaseWaitMs,\n\t)\n\tif err != nil {\n\t\tcause := errors.Cause(err)\n\t\tif strings.Contains(strings.ToLower(cause.Error()),\n\t\t\t\"resolve problem for\") {\n\t\t\tlog.Infof(\"Resolver err: %v\", cause.Error())\n\t\t\treturn nil, ErrResolverDIDNotFound\n\t\t}\n\n\t\treturn nil, errors.Wrap(err, \"resolve.sendrequest\")\n\t}\n\n\tresp := &UniversalResolverResponse{}\n\terr = json.Unmarshal(res, resp)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"resolve.unmarshal\")\n\t}\n\n\treturn resp, nil\n}", "title": "" }, { "docid": "0054783cafbdedb8c429579dd6c898be", "score": "0.46432602", "text": "func (rs ResolverSet) Resolve(resp ResponseWriter, req Request) error {\n\tfor _, r := range rs {\n\t\tif err := r.Resolve(resp, req); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e7963a2452bb54c82b21eb425b5257c0", "score": "0.4635149", "text": "func ResolveEdge(log *zerolog.Logger, region string, overrideIPVersion ConfigIPVersion) (*Regions, error) {\n\tedgeAddrs, err := edgeDiscovery(log, getRegionalServiceName(region))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(edgeAddrs) < 2 {\n\t\treturn nil, fmt.Errorf(\"expected at least 2 Cloudflare Regions regions, but SRV only returned %v\", len(edgeAddrs))\n\t}\n\treturn &Regions{\n\t\tregion1: NewRegion(edgeAddrs[0], overrideIPVersion),\n\t\tregion2: NewRegion(edgeAddrs[1], overrideIPVersion),\n\t}, nil\n}", "title": "" }, { "docid": "a53f887a22ba2a975df4beea4cbaf7b5", "score": "0.46220395", "text": "func (c *Client) ResolveRaw(host string, requestType uint16) (results []string, raw string, err error) {\n\tmsg := new(dns.Msg)\n\n\tmsg.Id = dns.Id()\n\tmsg.RecursionDesired = true\n\tmsg.Question = make([]dns.Question, 1)\n\tmsg.Question[0] = dns.Question{\n\t\tName: dns.Fqdn(host),\n\t\tQtype: requestType,\n\t\tQclass: dns.ClassINET,\n\t}\n\n\tvar answer *dns.Msg\n\n\tfor i := 0; i < c.maxRetries; i++ {\n\t\tc.mutex.Lock()\n\t\tresolver := c.resolvers[c.rand.Intn(len(c.resolvers))]\n\t\tc.mutex.Unlock()\n\n\t\tanswer, err = dns.Exchange(msg, resolver)\n\t\tif answer != nil {\n\t\t\traw = answer.String()\n\t\t}\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\n\t\t// In case we got some error from the server, return.\n\t\tif answer != nil && answer.Rcode != dns.RcodeSuccess {\n\t\t\treturn results, raw, errors.New(dns.RcodeToString[answer.Rcode])\n\t\t}\n\n\t\tresults = append(results, parse(answer, requestType)...)\n\n\t\treturn results, raw, nil\n\t}\n\n\treturn results, raw, err\n}", "title": "" }, { "docid": "59a2e5df3c8ab513aa60382de6890d7c", "score": "0.46183884", "text": "func (jad *JsonApiData) Resolve(t *testing.T, v interface{}) {\n\tu := jsonapi.JsonApiUrl{\n\t\tT: t,\n\t\t// TODO FIXME the BaseUrl won't work as expected. Really the caller wants the BaseUrl that was used to retrieve\n\t\t// the JsonApiData, which means we really need access to the JSON API 'links' object and use the 'self' href.\n\t\t// But we can't do that easily right now.\n\t\tBaseUrl: env.BaseUrlOr(\"https://islandora-idc.traefik.me\"),\n\t\tDrupalEntity: jad.Type.Entity(),\n\t\tDrupalBundle: jad.Type.Bundle(),\n\t\tFilter: \"id\",\n\t\tValue: jad.Id,\n\t}\n\n\tu.GetSingle(v)\n}", "title": "" }, { "docid": "4feccfb175e0b55c0d95620275d0a45d", "score": "0.46046254", "text": "func (r *MultiResolver) Resolve(ctx context.Context, region, version, instanceType, imageFamily string) (string, error) {\n\tfor _, resolver := range r.delegates {\n\t\tami, err := resolver.Resolve(ctx, region, version, instanceType, imageFamily)\n\t\tif err != nil {\n\t\t\tif _, ok := err.(*UnsupportedQueryError); ok {\n\t\t\t\tlogger.Debug(err.Error())\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn \"\", err\n\t\t}\n\t\tif ami != \"\" {\n\t\t\treturn ami, nil\n\t\t}\n\t}\n\n\treturn \"\", NewErrFailedResolution(region, version, instanceType, imageFamily)\n}", "title": "" }, { "docid": "98b4a5cad6aa1d74b111fad2bd0f8039", "score": "0.46025038", "text": "func NewResolverEndpoint(ctx *pulumi.Context,\n\tname string, args *ResolverEndpointArgs, opts ...pulumi.ResourceOption) (*ResolverEndpoint, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.Direction == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'Direction'\")\n\t}\n\tif args.IpAddresses == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'IpAddresses'\")\n\t}\n\tif args.SecurityGroupIds == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'SecurityGroupIds'\")\n\t}\n\tvar resource ResolverEndpoint\n\terr := ctx.RegisterResource(\"aws:route53/resolverEndpoint:ResolverEndpoint\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "e362ef8c92312d52ccf110bd647aa197", "score": "0.45934397", "text": "func (r *CompositeResolver) Resolve() (string, error) {\n\tfor _, r := range r.dels {\n\t\tif s, err := r.Resolve(); s != \"\" || err != nil {\n\t\t\treturn s, err\n\t\t}\n\t}\n\treturn \"\", fmt.Errorf(\"could not resolve: no delegate resolved: %v\", r.dels)\n}", "title": "" }, { "docid": "73c2f4deb5f291bc77469d32fb3707b2", "score": "0.4571323", "text": "func (t *Place) ResolveReplies(r *Resolver) (s Resolution, err error) {\n\ts = Unresolved\n\thandled := false\n\tif t.raw.IsReplies() {\n\t\thandled, err = r.dispatch(t.raw.GetReplies())\n\t\tif handled {\n\t\t\ts = Resolved\n\t\t}\n\t} else if t.raw.IsRepliesIRI() {\n\t\ts = RawResolutionNeeded\n\t}\n\treturn\n\n}", "title": "" }, { "docid": "83763424d00abc6d6751dfee30523510", "score": "0.45663595", "text": "func (p *StaticComputationPolicy) Resolve(path string, preferredLocation ProcessingLocation) (ComputationLevel, http.Handler) {\n\tcapability, ok := p.capabilities[path]\n\tif ok {\n\t\trawDataHandler, hasRawDataHandler := capability[RawData]\n\t\tcanComputeHandler, hasCanComputeHandler := capability[CanCompute]\n\n\t\tif hasCanComputeHandler {\n\t\t\tif hasRawDataHandler {\n\t\t\t\tif preferredLocation == Remote {\n\t\t\t\t\treturn CanCompute, canComputeHandler\n\t\t\t\t} else {\n\t\t\t\t\treturn RawData, rawDataHandler\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn CanCompute, canComputeHandler\n\t\t\t}\n\t\t} else {\n\t\t\tif hasRawDataHandler {\n\t\t\t\treturn RawData, rawDataHandler\n\t\t\t}\n\t\t}\n\n\t}\n\t// Default to no capabilities (and so nil function reference)\n\treturn NoComputation, nil\n}", "title": "" }, { "docid": "0ba97b9b8dd402ae82d182006ab7464b", "score": "0.45472503", "text": "func (c *Config) Resolve() error {\n\tif c.Port == 0 {\n\t\tif c.Security.TLS.Enabled() {\n\t\t\tc.Port = 8443\n\t\t} else {\n\t\t\tc.Port = 8080\n\t\t}\n\t}\n\n\troot, err := filepath.Abs(c.Root)\n\tif err != nil {\n\t\treturn err\n\t}\n\tc.Root = root\n\n\tc.DB.Migrations = fmt.Sprintf(\"file://%s\", filepath.Join(c.Root, \"static/migrations\"))\n\n\tif c.ResourceManager.AgentRM != nil && c.ResourceManager.AgentRM.Scheduler == nil {\n\t\tc.ResourceManager.AgentRM.Scheduler = DefaultSchedulerConfig()\n\t}\n\n\tif c.Webhooks.SigningKey == \"\" {\n\t\tb := make([]byte, 6)\n\t\tif _, err := rand.Read(b); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tc.Webhooks.SigningKey = hex.EncodeToString(b)\n\t}\n\n\tif err := c.ResolveResource(); err != nil {\n\t\treturn err\n\t}\n\n\tif err := c.Logging.Resolve(); err != nil {\n\t\treturn err\n\t}\n\n\tif c.Security.AuthZ.StrictNTSCEnabled {\n\t\tlog.Warn(\"_strict_ntsc_enabled option is removed and will not have any effect.\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "5d02064c30efeae9096f9c69a6f03336", "score": "0.45247477", "text": "func (a *APIv1) GetEndpoints() *map[entities.EntityType]models.Endpoint {\n\tif a.endPoints == nil {\n\t\ta.endPoints = rest.CreateEndPoints(a.config.GetExternalServerURI())\n\t}\n\n\treturn &a.endPoints\n}", "title": "" }, { "docid": "8c06abd4cd1c49c1d5b768a437ccfe4a", "score": "0.4504475", "text": "func (e *DppAcpiExDevPath) Resolver() (EfiPathSegmentResolver, error) {\n\treturn nil, ErrUnimpl\n}", "title": "" }, { "docid": "19533417807c44187d92de091a61cc65", "score": "0.45027497", "text": "func (p *manager) Resolve(ac *auth.Context, api, path string) []*APIProduct {\n\tvalidProducts, failHints := resolve(ac, p.Products(), api, path)\n\tvar selected []string\n\tfor _, p := range validProducts {\n\t\tselected = append(selected, p.Name)\n\t}\n\tlog.Debugf(`\nResolve api: %s, path: %s, scopes: %v\nSelected: %v\nEliminated: %v`, api, path, ac.Scopes, selected, failHints)\n\treturn validProducts\n}", "title": "" }, { "docid": "11971f74b7945b947af78b1942d1ef94", "score": "0.4495189", "text": "func (c *ResolveController) Resolve(ctx *app.ResolveResolveContext) error {\n\n\thostname := ctx.Hostname\n\n\tips, err := net.LookupIP(hostname)\n\tif err != nil {\n\t\treturn ctx.NotDiscoverable([]byte(err.Error()))\n\t}\n\n\tvar response []string\n\n\tfor _, ip := range ips {\n\t\t// Only consider IPV4\n\t\tif ip.To4() != nil {\n\t\t\tipString := ip.String()\n\t\t\tresponse = append(response, ipString)\n\t\t}\n\t}\n\n\tif len(response) == 0 {\n\t\treturn ctx.NotDiscoverable([]byte(\"Hostname can't be resolved\"))\n\t}\n\n\treturn ctx.OK(response)\n}", "title": "" }, { "docid": "72ca98bcecd3faba744f34e4c805a91e", "score": "0.44920796", "text": "func DiscoverEndpoints(app App, insecure discovery.InsecureOption) (out *Endpoints, attempts []FailedAttempt, err error) {\n\tout = &Endpoints{}\n\ttestFn := func(pre string, eps *Endpoints, err error) error {\n\t\tif len(out.ACIEndpoints) != 0 || len(out.Keys) != 0 || len(out.ACIPushEndpoints) != 0 {\n\t\t\treturn errEnough\n\t\t}\n\t\treturn nil\n\t}\n\n\terr = DiscoverWalk(app, insecure, walker(out, &attempts, testFn))\n\tif err != nil && err != errEnough {\n\t\treturn nil, attempts, err\n\t}\n\n\treturn out, attempts, nil\n}", "title": "" }, { "docid": "2d14e643990a889e7b84126907a4255f", "score": "0.449168", "text": "func (e *DppAcpiDevPath) Resolver() (EfiPathSegmentResolver, error) { return nil, ErrUnimpl }", "title": "" }, { "docid": "c9009d1427662f867bf192fbef277e62", "score": "0.44855493", "text": "func (e Engine) Resolve(publicID string) error {\n\t_, err := e.launchResolution(publicID, true)\n\treturn err\n}", "title": "" }, { "docid": "602749fede186e531c378332923ea7df", "score": "0.44817486", "text": "func Discover(issuer string, httpClient *http.Client) (Endpoints, error) {\n\twellKnown := strings.TrimSuffix(issuer, \"/\") + oidc.DiscoveryEndpoint\n\treq, err := http.NewRequest(\"GET\", wellKnown, nil)\n\tif err != nil {\n\t\treturn Endpoints{}, err\n\t}\n\tdiscoveryConfig := new(oidc.DiscoveryConfiguration)\n\terr = httphelper.HttpRequest(httpClient, req, &discoveryConfig)\n\tif err != nil {\n\t\treturn Endpoints{}, err\n\t}\n\tif discoveryConfig.Issuer != issuer {\n\t\treturn Endpoints{}, oidc.ErrIssuerInvalid\n\t}\n\treturn GetEndpoints(discoveryConfig), nil\n}", "title": "" }, { "docid": "c8607e91aa9943ccbb24993f6cfdcd55", "score": "0.44794682", "text": "func AnyResolver(mf *dynamic.MessageFactory, files ...*desc.FileDescriptor) jsonpb.AnyResolver {\n\treturn &anyResolver{mf: mf, files: files}\n}", "title": "" }, { "docid": "ad13c6a330d4adcda68032e2dfa67068", "score": "0.44794405", "text": "func (r *Discovery) Resolve(ctx context.Context, name string) ([]string, error) {\n\tvar records []string\n\tklog.Infof(\"trying to resolve %q using GCEResolver\", name)\n\n\tvar requiredTags []string\n\n\t// We assume we are trying to resolve a component that runs on the control plane\n\trequiredTags = append(requiredTags, gce.TagForRole(r.clusterName, kops.InstanceGroupRoleControlPlane))\n\n\tif err := r.findInstances(ctx, func(i *compute.Instance) (bool, error) {\n\t\t// Make sure the instance has any required tags\n\t\tfor _, requiredTag := range requiredTags {\n\t\t\thasTag := false\n\t\t\tif i.Tags != nil {\n\t\t\t\tfor _, tag := range i.Tags.Items {\n\t\t\t\t\tif requiredTag == tag {\n\t\t\t\t\t\thasTag = true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !hasTag {\n\t\t\t\treturn true, nil\n\t\t\t}\n\t\t}\n\n\t\t// TODO: Expose multiple IPs topologies?\n\t\tfor _, ni := range i.NetworkInterfaces {\n\t\t\t// TODO: Check e.g. Network\n\n\t\t\tif ni.NetworkIP != \"\" {\n\t\t\t\trecords = append(records, ni.NetworkIP)\n\t\t\t}\n\t\t}\n\n\t\treturn true, nil\n\t}); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn records, nil\n}", "title": "" }, { "docid": "31bb0c5c1e11995025a4b40e3dbbe968", "score": "0.4466361", "text": "func resourceEndpoint() *schema.Resource {\n\treturn &schema.Resource{\n\t\tCreate: resourceEndpointCreate,\n\t\tRead: resourceEndpointRead,\n\t\tUpdate: resourceEndpointUpdate,\n\t\tDelete: resourceEndpointDelete,\n\t\tImporter: &schema.ResourceImporter{\n\t\t\tState: schema.ImportStatePassthrough,\n\t\t},\n\n\t\tSchema: map[string]*schema.Schema{\n\t\t\tendpointType: {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tValidateFunc: validateEndpointType,\n\t\t\t\tDiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {\n\t\t\t\t\tnew = strings.Replace(new, \"_\", \"\", 1)\n\t\t\t\t\tif strings.EqualFold(old, new) {\n\t\t\t\t\t\treturn true\n\t\t\t\t\t}\n\t\t\t\t\treturn false\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpointTitle: {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t},\n\t\t\tendpointDescription: {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t},\n\t\t\tendpointSlack: {\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\t\t\t\t\t\tendpointUrl: {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\tValidateFunc: validateUrl,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpointCustom: {\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\t\t\t\t\t\tendpointUrl: {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\tValidateFunc: validateUrl,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tendpointMethod: {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\tValidateFunc: validateHttpMethod,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tendpointHeaders: {\n\t\t\t\t\t\t\tType: schema.TypeMap,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tendpointBodyTemplate: {\n\t\t\t\t\t\t\tType: schema.TypeMap,\n\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpointPagerDuty: {\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\t\t\t\t\t\tendpointServiceKey: {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpointBigPanda: {\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\t\t\t\t\t\tendpointApiToken: {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tendpointAppKey: {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpointDataDog: {\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\t\t\t\t\t\tendpointApiKey: {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tendpointVictorOps: {\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\t\t\t\t\t\tendpointRoutingKey: {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tendpointMessageType: {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tendpointServiceApiKey: {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "81e3e587dac4821c5d85451d829d6b1e", "score": "0.44651967", "text": "func resolve(ctx context.Context, r resolver, name string, options *opts.ResolveOpts, prefixes ...string) (path.Path, error) {\n\tdepth := options.Depth\n\tfor {\n\t\tp, err := r.resolveOnce(ctx, name, options)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tlog.Debugf(\"resolved %s to %s\", name, p.String())\n\n\t\tif strings.HasPrefix(p.String(), \"/ipfs/\") {\n\t\t\t// we've bottomed out with an IPFS path\n\t\t\treturn p, nil\n\t\t}\n\n\t\tif depth == 1 {\n\t\t\treturn p, ErrResolveRecursion\n\t\t}\n\n\t\tmatched := false\n\t\tfor _, prefix := range prefixes {\n\t\t\tif strings.HasPrefix(p.String(), prefix) {\n\t\t\t\tmatched = true\n\t\t\t\tif len(prefixes) == 1 {\n\t\t\t\t\tname = strings.TrimPrefix(p.String(), prefix)\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif !matched {\n\t\t\treturn p, nil\n\t\t}\n\n\t\tif depth > 1 {\n\t\t\tdepth--\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e68fd0895d1b4d1f0280b8728bdf4dc7", "score": "0.4460228", "text": "func (remote *Remote) Resolve(ctx context.Context) (*ocispec.Descriptor, error) {\n\tref := reference.TagNameOnly(remote.parsed).String()\n\n\t_, desc, err := remote.resolver.Resolve(ctx, ref)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &desc, nil\n}", "title": "" }, { "docid": "fb4a5ea4302eefe4b132a9d4b7c56c9b", "score": "0.44595048", "text": "func (r *jsiiProxy_Reference) Resolve(_context IResolveContext) interface{} {\n\tvar returns interface{}\n\n\t_jsii_.Invoke(\n\t\tr,\n\t\t\"resolve\",\n\t\t[]interface{}{_context},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "34041291ca8fa7534546bf87dba10517", "score": "0.4454957", "text": "func (store *registryStorage) Resolve(names ...string) ([]string, map[string]shared.Feature, error) {\n\tif len(names) == 0 {\n\t\tnames = append(names, \"\")\n\t}\n\n\tparams := features.NewGetAPIResolvedFeaturesParams()\n\tparams.Names = names\n\n\tfeatures, err := store.Features.GetAPIResolvedFeatures(params)\n\tif err != nil {\n\t\treturn []string{}, map[string]shared.Feature{},err\n\t}\n\n\tvar slice []string\n\tresult := map[string]shared.Feature{}\n\n\tfor _,feature := range features.Payload {\n\n\t\tfeature2 := shared.NewFeature(feature)\n\t\tname := feature2.Meta.Name\n\t\tresult[name] = feature2\n\t\tslice = append(slice, name)\n\t}\n\treturn slice, result, nil\n}", "title": "" }, { "docid": "cf72895b47b3a901e59eec46ed1b5286", "score": "0.44511288", "text": "func (m *MockDiscoveryService) GetEndpoints(domain string) ([]*models.Endpoint, error) {\n\tif m.GetEndpointsFunc != nil {\n\t\treturn m.GetEndpointsFunc(domain)\n\t}\n\n\treturn nil, nil\n}", "title": "" }, { "docid": "3c5dafa2635e0cdd6f91f018a48f9863", "score": "0.44462055", "text": "func (c *Client) ResolveResolve(ctx context.Context, path string) (*http.Response, error) {\n\treq, err := c.NewResolveResolveRequest(ctx, path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn c.Client.Do(ctx, req)\n}", "title": "" }, { "docid": "7e1f2e445cfeb13e69e09bbae2bd98d5", "score": "0.44389313", "text": "func ResolveReadParams(params []interface{}) (string, []interface{}, error) {\n\tif len(params) == 0 {\n\t\treturn \"\", []interface{}{}, nil\n\t}\n\n\tvar (\n\t\tquery string\n\t\tok bool\n\t)\n\n\tif query, ok = params[0].(string); !ok {\n\t\treturn \"\", nil, errors.New(fmt.Sprintf(\"Invalid query: %v\", params[0]))\n\t}\n\n\tif len(params) == 1 {\n\t\treturn query, []interface{}{}, nil\n\t}\n\n\treturn query, params[1:], nil\n}", "title": "" }, { "docid": "f9c88d8d2c661662ed62f31d0b839217", "score": "0.44355974", "text": "func NewResolver(endpoints []string, service string) resolver.Builder {\n\treturn &Resolver{endpoints: endpoints, service: service}\n}", "title": "" }, { "docid": "ee41fc5db4ffc140b3856bfa7238c2f8", "score": "0.4431728", "text": "func MakeLookupEndpoint(s shortservice.Service) endpoint.Endpoint {\n\treturn func(ctx context.Context, request interface{}) (response interface{}, err error) {\n\t\treq := request.(LookupRequest)\n\t\tv, err := s.Lookup(ctx, req.K)\n\t\treturn LookupResponse{V: v, Err: err}, nil\n\t}\n}", "title": "" }, { "docid": "811e779ffb0101374ddf49d184fda699", "score": "0.44269347", "text": "func (y *Type) Resolve() *Type {\n\tif y.delegate == nil {\n\t\tpanic(\"no delegate\")\n\t}\n\treturn y.delegate\n}", "title": "" }, { "docid": "8de47749f590b4c9a1e6ff456656278d", "score": "0.44043583", "text": "func (o *OAuth2) GetResolver(key string) (telegraf.ResolveFunc, error) {\n\tresolver := func() ([]byte, bool, error) {\n\t\ts, err := o.Get(key)\n\t\treturn s, true, err\n\t}\n\treturn resolver, nil\n}", "title": "" }, { "docid": "e4122dce60fe76d67519f03feba575ca", "score": "0.43992013", "text": "func (c *Container) Resolve(entity interface{}) {\r\n\r\n\tti := reflect.TypeOf(entity).Elem()\r\n\tconcreteVal, concretType := c.createInstace(ti)\r\n\r\n\tc.populateFields(concretType, concreteVal)\r\n\tvalueOfInterface := reflect.ValueOf(entity)\r\n\tvalueOfInterface.Elem().Set(concreteVal)\r\n}", "title": "" }, { "docid": "08255eb42a30a48399bf9fe6d73a2d67", "score": "0.4397686", "text": "func (i *Instance) convertEndpoints(endpoints *resource.Instance, outMeta *resource.Metadata, out *networking.ServiceEntry) {\n\tif endpoints == nil {\n\t\treturn\n\t}\n\n\tspec := endpoints.Message.(*coreV1.Endpoints)\n\t// Store the subject alternate names in a set to avoid duplicates.\n\tsubjectAltNameSet := make(map[string]struct{})\n\teps := make([]*networking.ServiceEntry_Endpoint, 0)\n\n\t// TODO: Add pooling support for strings.Builder and put it in pkg/pool\n\n\t// A builder for the annotation for not-ready addresses. The ServiceEntry does not support not ready addresses,\n\t// so we send them as an annotation instead.\n\tvar notReadyBuilder strings.Builder\n\n\tfor _, subset := range spec.Subsets {\n\t\t// Convert the ports for this subset. They will be re-used for each endpoint in the same subset.\n\t\tports := make(map[string]uint32)\n\t\tfor _, port := range subset.Ports {\n\t\t\tports[port.Name] = uint32(port.Port)\n\n\t\t\t// Process the not ready addresses.\n\t\t\tportString := strconv.Itoa(int(port.Port))\n\t\t\tfor _, address := range subset.NotReadyAddresses {\n\t\t\t\tif notReadyBuilder.Len() > 0 {\n\t\t\t\t\t// Add a separator between the addresses.\n\t\t\t\t\tnotReadyBuilder.WriteByte(',')\n\t\t\t\t}\n\t\t\t\tnotReadyBuilder.WriteString(address.IP)\n\t\t\t\tnotReadyBuilder.WriteByte(':')\n\t\t\t\tnotReadyBuilder.WriteString(portString)\n\t\t\t}\n\t\t}\n\n\t\t// Convert the endpoints in this subset.\n\t\tfor _, address := range subset.Addresses {\n\t\t\tlocality := \"\"\n\t\t\tvar labels map[string]string\n\n\t\t\tip := address.IP\n\t\t\tp, hasPod := i.pods.GetPodByIP(ip)\n\t\t\tif hasPod {\n\t\t\t\tlabels = p.Labels\n\t\t\t\tlocality = p.Locality\n\t\t\t\tif p.ServiceAccountName != \"\" {\n\t\t\t\t\tsubjectAltNameSet[p.ServiceAccountName] = struct{}{}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tep := &networking.ServiceEntry_Endpoint{\n\t\t\t\tLabels: labels,\n\t\t\t\tAddress: ip,\n\t\t\t\tPorts: ports,\n\t\t\t\tLocality: locality,\n\t\t\t\t// TODO(nmittler): Network: \"\",\n\t\t\t}\n\t\t\teps = append(eps, ep)\n\t\t}\n\t}\n\n\t// Convert the subject alternate names to an array.\n\tsubjectAltNames := make([]string, 0, len(subjectAltNameSet))\n\tfor k := range subjectAltNameSet {\n\t\tsubjectAltNames = append(subjectAltNames, k)\n\t}\n\tsort.Strings(subjectAltNames)\n\n\tout.Endpoints = eps\n\tout.SubjectAltNames = subjectAltNames\n\n\t// Add an annotation for the version of the Endpoints resource.\n\toutMeta.Annotations = outMeta.Annotations.CloneOrCreate()\n\toutMeta.Annotations[annotation.AlphaNetworkingEndpointsVersion.Name] = string(endpoints.Metadata.Version)\n\n\t// Add an annotation for any \"not ready\" endpoints.\n\tif notReadyBuilder.Len() > 0 {\n\t\toutMeta.Annotations[annotation.AlphaNetworkingNotReadyEndpoints.Name] = notReadyBuilder.String()\n\t}\n}", "title": "" }, { "docid": "4add8a3688f47aaf7fd927ccee2ed2d9", "score": "0.43948632", "text": "func resourceEndpointRead(d *schema.ResourceData, m interface{}) error {\n\tclient := endpointClient(m)\n\tendpointId, _ := idFromResourceData(d)\n\n\tvar endpoint *endpoints.Endpoint\n\tendpoint, err := client.GetEndpoint(endpointId)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\td.Set(endpointType, endpoint.EndpointType)\n\td.Set(endpointTitle, endpoint.Title)\n\td.Set(endpointDescription, endpoint.Description)\n\n\tset := make([]map[string]interface{}, 1)\n\n\tswitch endpoint.EndpointType {\n\tcase endpoints.EndpointTypeSlack:\n\t\tset[0] = map[string]interface{}{\n\t\t\tendpointUrl: endpoint.Url,\n\t\t}\n\t\td.Set(endpointSlack, set)\n\tcase endpoints.EndpointTypeCustom:\n\t\tset[0] = map[string]interface{}{\n\t\t\tendpointUrl: endpoint.Url,\n\t\t\tendpointMethod: endpoint.Method,\n\t\t\tendpointHeaders: endpoint.Headers,\n\t\t\tendpointBodyTemplate: endpoint.BodyTemplate,\n\t\t}\n\t\td.Set(endpointCustom, set)\n\tcase endpoints.EndpointTypePagerDuty:\n\t\tset[0] = map[string]interface{}{\n\t\t\tendpointServiceKey: endpoint.ServiceKey,\n\t\t}\n\t\td.Set(endpointPagerDuty, set)\n\tcase endpoints.EndpointTypeBigPanda:\n\t\tset[0] = map[string]interface{}{\n\t\t\tendpointApiToken: endpoint.ApiToken,\n\t\t\tendpointAppKey: endpoint.AppKey,\n\t\t}\n\t\td.Set(endpointBigPanda, set)\n\tcase endpoints.EndpointTypeDataDog:\n\t\tset[0] = map[string]interface{}{\n\t\t\tendpointApiKey: endpoint.ApiKey,\n\t\t}\n\t\td.Set(endpointDataDog, set)\n\tcase endpoints.EndpointTypeVictorOps:\n\t\tset[0] = map[string]interface{}{\n\t\t\tendpointRoutingKey: endpoint.RoutingKey,\n\t\t\tendpointMessageType: endpoint.MessageType,\n\t\t\tendpointServiceApiKey: endpoint.ApiKey,\n\t\t}\n\t\td.Set(endpointVictorOps, set)\n\tdefault:\n\t\treturn fmt.Errorf(\"unhandled endpoint type: %s\", endpoint.EndpointType)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "a3af0c962aa4b7cf0e2a6dcad68962e4", "score": "0.43853667", "text": "func (t *Place) ResolveFollowing(r *Resolver) (s Resolution, err error) {\n\ts = Unresolved\n\thandled := false\n\tif t.raw.IsFollowingCollection() {\n\t\thandled, err = r.dispatch(t.raw.GetFollowingCollection())\n\t\tif handled {\n\t\t\ts = Resolved\n\t\t}\n\t} else if t.raw.IsFollowingOrderedCollection() {\n\t\ts = RawResolutionNeeded\n\t} else if t.raw.IsFollowingAnyURI() {\n\t\ts = RawResolutionNeeded\n\t}\n\treturn\n\n}", "title": "" }, { "docid": "38a64f8fe8b09a2a0601d89cb1720755", "score": "0.43844843", "text": "func Endpoints(endpoints ...*swagger.Endpoint) Option {\n\treturn func(c *Client) {\n\t\tc.factory = func(filters web.Filters) http.Handler {\n\t\t\trouter := web.NewRouter()\n\t\t\tfor _, endpoint := range endpoints {\n\t\t\t\tswitch h := endpoint.Handler.(type) {\n\t\t\t\tcase web.HandlerFunc:\n\t\t\t\t\th = filters.Apply(h)\n\t\t\t\t\trouter.Handle(endpoint.Method, endpoint.Path, h)\n\n\t\t\t\tcase func(c web.Context) error:\n\t\t\t\t\th = filters.Apply(h)\n\t\t\t\t\trouter.Handle(endpoint.Method, endpoint.Path, h)\n\n\t\t\t\tdefault:\n\t\t\t\t\tlog.Fatalf(\"*swagger.Endpoint contained unhandled handler, %#v\", endpoint.Handler)\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn router\n\t\t}\n\t}\n}", "title": "" }, { "docid": "368daa00e21849d444297d96562c66df", "score": "0.43815088", "text": "func (r *PubsubResolver) Resolve(ctx context.Context, name string, options ...opts.ResolveOpt) (path.Path, error) {\n\treturn resolve(ctx, r, name, opts.ProcessOpts(options), \"/ipns/\")\n}", "title": "" }, { "docid": "5d85bd888801f13b6e117cc6aab40105", "score": "0.43796894", "text": "func (f *FieldDef) Resolve(field *Field, args map[string]interface{}) (result interface{}, err error) {\n\tswitch field.Name {\n\tcase nameStr:\n\t\tresult = f.N\n\tcase descriptionStr:\n\t\tresult = f.Desc\n\tcase argsStr:\n\t\tresult = &f.args\n\tcase typeStr:\n\t\tresult = f.Type\n\tcase isDeprecatedStr:\n\t\tresult = false\n\t\tfor _, du := range f.Dirs {\n\t\t\tif du.Directive.Name() == deprecatedStr {\n\t\t\t\tresult = true\n\t\t\t}\n\t\t}\n\tcase deprecationReasonStr:\n\t\tfor _, du := range f.Dirs {\n\t\t\tif du.Directive.Name() == deprecatedStr {\n\t\t\t\tif av := du.Args[reasonStr]; av != nil {\n\t\t\t\t\tresult = av.Value\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "2b00db09aa704820d49cfb8d9527c2c8", "score": "0.43787214", "text": "func (promise *Promise) resolve(resolution interface{}) {\n\tif promise.state != PENDING {\n\t\treturn\n\t}\n\n\tswitch result := resolution.(type) {\n\tcase *Promise:\n\t\tflattenedResult, err := result.Await()\n\t\tif err != nil {\n\t\t\tpromise.reject(err)\n\t\t\treturn\n\t\t}\n\t\tpromise.resolveChannel <- flattenedResult\n\tdefault:\n\t\tpromise.resolveChannel <- result\n\t}\n\n\tpromise.state = FULFILLED\n}", "title": "" }, { "docid": "2987676425c6fab8ad0bd7d55c92f7f7", "score": "0.4372257", "text": "func (sc *virtualServiceSource) Endpoints(ctx context.Context) ([]*endpoint.Endpoint, error) {\n\tvirtualServices, err := sc.virtualserviceInformer.Lister().VirtualServices(sc.namespace).List(labels.Everything())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvirtualServices, err = sc.filterByAnnotations(virtualServices)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar endpoints []*endpoint.Endpoint\n\n\tfor _, virtualService := range virtualServices {\n\t\t// Check controller annotation to see if we are responsible.\n\t\tcontroller, ok := virtualService.Annotations[controllerAnnotationKey]\n\t\tif ok && controller != controllerAnnotationValue {\n\t\t\tlog.Debugf(\"Skipping VirtualService %s/%s because controller value does not match, found: %s, required: %s\",\n\t\t\t\tvirtualService.Namespace, virtualService.Name, controller, controllerAnnotationValue)\n\t\t\tcontinue\n\t\t}\n\n\t\tgwEndpoints, err := sc.endpointsFromVirtualService(ctx, virtualService)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// apply template if host is missing on VirtualService\n\t\tif (sc.combineFQDNAnnotation || len(gwEndpoints) == 0) && sc.fqdnTemplate != nil {\n\t\t\tiEndpoints, err := sc.endpointsFromTemplate(ctx, virtualService)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tif sc.combineFQDNAnnotation {\n\t\t\t\tgwEndpoints = append(gwEndpoints, iEndpoints...)\n\t\t\t} else {\n\t\t\t\tgwEndpoints = iEndpoints\n\t\t\t}\n\t\t}\n\n\t\tif len(gwEndpoints) == 0 {\n\t\t\tlog.Debugf(\"No endpoints could be generated from VirtualService %s/%s\", virtualService.Namespace, virtualService.Name)\n\t\t\tcontinue\n\t\t}\n\n\t\tlog.Debugf(\"Endpoints generated from VirtualService: %s/%s: %v\", virtualService.Namespace, virtualService.Name, gwEndpoints)\n\t\tsc.setResourceLabel(virtualService, gwEndpoints)\n\t\tendpoints = append(endpoints, gwEndpoints...)\n\t}\n\n\tfor _, ep := range endpoints {\n\t\tsort.Sort(ep.Targets)\n\t}\n\n\treturn endpoints, nil\n}", "title": "" }, { "docid": "13e0fedce56e20afc9eed3f4b1df594d", "score": "0.4365949", "text": "func (c *PropertyConversionContext) ResolveType(t astmodel.Type) (astmodel.TypeName, astmodel.Type, bool) {\n\tname, ok := astmodel.AsTypeName(t)\n\tif !ok {\n\t\treturn nil, nil, false\n\t}\n\n\tactualType, err := c.definitions.FullyResolve(name)\n\tif err != nil {\n\t\treturn nil, nil, false\n\t}\n\n\treturn name, actualType, true\n}", "title": "" }, { "docid": "7cff963bf9097d16353b48f5da914c25", "score": "0.43614194", "text": "func (r *BaseResolver) Resolve(ctx context.Context, name, qtype string, priority int, retry Retry) ([]requests.DNSAnswer, error) {\n\tif priority != PriorityCritical && priority != PriorityHigh && priority != PriorityLow {\n\t\treturn []requests.DNSAnswer{}, &ResolveError{\n\t\t\tErr: fmt.Sprintf(\"Resolver: Invalid priority parameter: %d\", priority),\n\t\t\tRcode: ResolverErrRcode,\n\t\t}\n\t}\n\n\tif avail, err := r.Available(); !avail {\n\t\treturn []requests.DNSAnswer{}, &ResolveError{\n\t\t\tErr: err.Error(),\n\t\t\tRcode: ResolverErrRcode,\n\t\t}\n\t}\n\n\tqt, err := textToTypeNum(qtype)\n\tif err != nil {\n\t\treturn nil, &ResolveError{\n\t\t\tErr: err.Error(),\n\t\t\tRcode: ResolverErrRcode,\n\t\t}\n\t}\n\n\tvar bus *eventbus.EventBus\n\tif b := ctx.Value(requests.ContextEventBus); b != nil {\n\t\tbus = b.(*eventbus.EventBus)\n\t}\n\n\tagain := true\n\tvar times int\n\tvar ans []requests.DNSAnswer\n\tfor again {\n\t\terr = checkContext(ctx)\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\n\t\ttimes++\n\t\tmsg := queryMessage(r.getID(), name, qt)\n\t\tresult := r.queueQuery(msg, name, qt, priority)\n\t\terr = result.Err\n\t\tans = result.Records\n\t\t// Report the completion of the DNS query\n\t\tif bus != nil {\n\t\t\trcode := dns.RcodeSuccess\n\t\t\tif err != nil {\n\t\t\t\trcode = (err.(*ResolveError)).Rcode\n\t\t\t}\n\n\t\t\tbus.Publish(requests.ResolveCompleted, eventbus.PriorityCritical, time.Now(), rcode)\n\t\t}\n\n\t\tif err == nil || retry == nil {\n\t\t\tbreak\n\t\t}\n\n\t\tresp := result.Msg\n\t\trcode := (result.Err.(*ResolveError)).Rcode\n\t\tif resp == nil {\n\t\t\tresp = msg\n\t\t\tresp.Rcode = rcode\n\t\t}\n\t\tagain = retry(times, priority, resp)\n\t}\n\n\treturn ans, err\n}", "title": "" }, { "docid": "47481d77941ca41d7460f19f85423c3e", "score": "0.4356178", "text": "func (m *MultiResolver) Resolve(addr string) (h common.Hash, err error) {\n\trs, err := m.getResolveValidator(addr)\n\tif err != nil {\n\t\treturn h, err\n\t}\n\tfor _, r := range rs {\n\t\th, err = r.Resolve(addr)\n\t\tif err == nil {\n\t\t\treturn\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "ee2567a691c260195781effebba5010e", "score": "0.4352424", "text": "func (t *Place) ResolvePreview(r *Resolver, idx int) (s Resolution, err error) {\n\ts = Unresolved\n\thandled := false\n\tif t.raw.IsPreviewObject(idx) {\n\t\thandled, err = r.dispatch(t.raw.GetPreviewObject(idx))\n\t\tif handled {\n\t\t\ts = Resolved\n\t\t}\n\t} else if t.raw.IsPreviewLink(idx) {\n\t\thandled, err = r.dispatch(t.raw.GetPreviewLink(idx))\n\t\tif handled {\n\t\t\ts = Resolved\n\t\t}\n\t} else if t.raw.IsPreviewIRI(idx) {\n\t\ts = RawResolutionNeeded\n\t}\n\treturn\n\n}", "title": "" }, { "docid": "d9f23bb0efeedc0ac059c89c2343d0b5", "score": "0.43514928", "text": "func (f *Fragment) Resolve() ResolverFunc {\n\treturn func(c *fiber.Ctx, cfg Config) error {\n\t\terr := f.do(c, cfg, f.src)\n\t\tif err == nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif err != fasthttp.ErrTimeout {\n\t\t\treturn err\n\t\t}\n\n\t\terr = f.do(c, cfg, f.fallback)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "8455317154425a7f0ddda4fda1ce9544", "score": "0.43401012", "text": "func (cs *connectorSource) Endpoints(ctx context.Context) ([]*endpoint.Endpoint, error) {\n\tendpoints := []*endpoint.Endpoint{}\n\n\tconn, err := net.DialTimeout(\"tcp\", cs.remoteServer, dialTimeout)\n\tif err != nil {\n\t\tlog.Errorf(\"Connection error: %v\", err)\n\t\treturn nil, err\n\t}\n\tdefer conn.Close()\n\n\tdecoder := gob.NewDecoder(conn)\n\tif err := decoder.Decode(&endpoints); err != nil {\n\t\tlog.Errorf(\"Decode error: %v\", err)\n\t\treturn nil, err\n\t}\n\n\tlog.Debugf(\"Received endpoints: %#v\", endpoints)\n\n\treturn endpoints, nil\n}", "title": "" }, { "docid": "8190e468cd07cd3ccb98b3d8a1de7879", "score": "0.4326178", "text": "func (rsc *RedSkyConfig) Endpoints() (Endpoints, error) {\n\tsrv, err := CurrentServer(rsc.Reader())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tadd := func(ep Endpoints, prefix, endpoint string) error {\n\t\tu, err := url.Parse(endpoint)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tu.Path = strings.TrimSuffix(u.Path, \"/\") + \"/\"\n\t\tep[prefix] = u\n\t\treturn nil\n\t}\n\n\tep := Endpoints(make(map[string]*url.URL, 2))\n\tif err := add(ep, \"/experiments/\", srv.API.ExperimentsEndpoint); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := add(ep, \"/accounts/\", srv.API.AccountsEndpoint); err != nil {\n\t\treturn nil, err\n\t}\n\treturn ep, nil\n}", "title": "" }, { "docid": "19f3e1c773f7d87a0d5251b1b21b7c83", "score": "0.43198216", "text": "func GetResolverEndpoint(ctx *pulumi.Context,\n\tname string, id pulumi.IDInput, state *ResolverEndpointState, opts ...pulumi.ResourceOption) (*ResolverEndpoint, error) {\n\tvar resource ResolverEndpoint\n\terr := ctx.ReadResource(\"aws:route53/resolverEndpoint:ResolverEndpoint\", name, id, state, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "9af394ed134c35bff50e8aa2d8460aec", "score": "0.43064788", "text": "func (a *APIApp) Resolve() error {\n\tif a.isResolved {\n\t\treturn nil\n\t}\n\n\tif a.router == nil {\n\t\ta.router = mux.NewRouter().StrictSlash(a.StrictSlash).UseEncodedPath()\n\t}\n\n\tif err := a.attachRoutes(a.router, true); err != nil {\n\t\treturn err\n\t}\n\n\ta.isResolved = true\n\n\treturn nil\n}", "title": "" }, { "docid": "5399fdf0d808f3dbc52b8b8e15ef8833", "score": "0.42887557", "text": "func GetResourceResolver(client clientset.Interface, resource *v1alpha1.Resource) (string, error) {\n\tif len(resource.Spec.Resolver) > 0 {\n\t\treturn resource.Spec.Resolver, nil\n\t}\n\n\t// If resolver is set in config file, use it.\n\tresolverConfigKey := fmt.Sprintf(\"%s-resolver\", strings.ToLower(resource.Spec.Type))\n\tif resolver, ok := controller.Config.Images[resolverConfigKey]; ok {\n\t\treturn resolver, nil\n\t}\n\n\tnamespaces := []string{resource.Namespace}\n\tsystemNamespace := common.GetSystemNamespace()\n\tif resource.Namespace != systemNamespace {\n\t\tnamespaces = append(namespaces, systemNamespace)\n\t}\n\n\tresources, err := GetResourceTypes(client, namespaces, \"\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tfor _, r := range resources {\n\t\tif strings.EqualFold(r.Spec.Type, resource.Spec.Type) {\n\t\t\treturn r.Spec.Resolver, nil\n\t\t}\n\t}\n\n\treturn \"\", fmt.Errorf(\"resolver not found for '%s'\", resource.Spec.Type)\n}", "title": "" }, { "docid": "61d2af084168721ec460cec05516b06f", "score": "0.4278501", "text": "func buildEndpoints(\n\tctx context.Context,\n\tnamespace string,\n\tresolver DnsResolver,\n\tservice *consulapi.CatalogService,\n\tupstreams []*v1.Upstream,\n) ([]*v1.Endpoint, error) {\n\n\t// Address is the IP address of the Consul node on which the service is registered.\n\t// ServiceAddress is the IP address of the service host — if empty, node address should be used\n\taddress := service.ServiceAddress\n\tif address == \"\" {\n\t\taddress = service.Address\n\t}\n\n\tipAddresses, err := getIpAddresses(ctx, address, resolver)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar endpoints []*v1.Endpoint\n\tfor _, ipAddr := range ipAddresses {\n\t\tendpoints = append(endpoints, buildEndpoint(namespace, address, ipAddr, service, upstreams))\n\t}\n\treturn endpoints, nil\n}", "title": "" }, { "docid": "5ca17b5eab8d344ecea0f1af31e04f2b", "score": "0.42663255", "text": "func (o ContainerCodePackagePropertiesResponseOutput) Endpoints() EndpointPropertiesResponseArrayOutput {\n\treturn o.ApplyT(func(v ContainerCodePackagePropertiesResponse) []EndpointPropertiesResponse { return v.Endpoints }).(EndpointPropertiesResponseArrayOutput)\n}", "title": "" }, { "docid": "f07fbf779b40fe4b10dd6402555b21f6", "score": "0.4266308", "text": "func (c *jsiiProxy_CfnDynamicReference) Resolve(_context IResolveContext) interface{} {\n\tvar returns interface{}\n\n\t_jsii_.Invoke(\n\t\tc,\n\t\t\"resolve\",\n\t\t[]interface{}{_context},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "5c9f59178d8e16e79dedafea574186da", "score": "0.42562687", "text": "func (o Operation) Resolve(operationProvider OperationProvider, typeProvider TypeProvider, generics Generics) (Operation, error) {\n\tvar err error\n\tresolved := o\n\n\tif o.Reference != \"\" {\n\t\tvar ref Operation\n\t\tref, err = operationProvider.dereferenceOperation(o.Reference)\n\t\tif err != nil {\n\t\t\treturn Operation{}, err\n\t\t}\n\t\trefGens := make(Generics)\n\t\tfor gen, genType := range o.Generics {\n\t\t\tresolvedGen, err := genType.Resolve(typeProvider, generics)\n\t\t\tif err != nil {\n\t\t\t\treturn Operation{}, err\n\t\t\t}\n\t\t\trefGens[gen] = &resolvedGen\n\t\t}\n\t\tresolved, err = ref.Resolve(operationProvider, typeProvider, refGens)\n\t\tif err != nil {\n\t\t\treturn Operation{}, err\n\t\t}\n\t\treturn resolved, nil\n\t}\n\n\tresolved.In, err = resolved.In.Resolve(typeProvider, generics)\n\tif err != nil {\n\t\treturn Operation{}, err\n\t}\n\n\tresolved.Out, err = resolved.Out.Resolve(typeProvider, generics)\n\tif err != nil {\n\t\treturn Operation{}, err\n\t}\n\n\treturn resolved, nil\n}", "title": "" }, { "docid": "92734114463d1937e11ed2906016301a", "score": "0.42561603", "text": "func (ctx *Context) Resolve(dependencies ...interface{}) bool {\n\terr := ctx.c.Resolve(dependencies...)\n\tif err != nil {\n\t\tctx.InternalServerError(err)\n\t\treturn false\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "9211c3f5f23a0be6a81f768fa76eb2ea", "score": "0.4254541", "text": "func (c *Client) Resolve(u string) ([]byte, error) {\n\tparsedURL, err := c.validateURL(u)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn c.makeRequest(parsedURL)\n}", "title": "" }, { "docid": "3780d2978614e95d81d96f84f134076c", "score": "0.4251687", "text": "func (s SingleHostBaseURLResolver) Resolve(r *http.Request) string {\n\n\tbaseURL := s.BaseURL\n\n\tif strings.HasSuffix(baseURL, \"/\") {\n\t\tbaseURL = baseURL[0 : len(baseURL)-1]\n\t}\n\treturn baseURL\n}", "title": "" }, { "docid": "bf486f6ae122fc296e3d9cd0c6c78859", "score": "0.42515492", "text": "func (c *jsiiProxy_CfnJson) Resolve(_arg IResolveContext) interface{} {\n\tvar returns interface{}\n\n\t_jsii_.Invoke(\n\t\tc,\n\t\t\"resolve\",\n\t\t[]interface{}{_arg},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "60c6fe621ed2b84c1ea850f4f06f4278", "score": "0.42512107", "text": "func (fn ParameterResolveFn) Resolve(cp []v1alpha2.ComponentParameter, cpv []v1alpha2.ComponentParameterValue) ([]Parameter, error) {\n\treturn fn(cp, cpv)\n}", "title": "" }, { "docid": "60c6fe621ed2b84c1ea850f4f06f4278", "score": "0.42512107", "text": "func (fn ParameterResolveFn) Resolve(cp []v1alpha2.ComponentParameter, cpv []v1alpha2.ComponentParameterValue) ([]Parameter, error) {\n\treturn fn(cp, cpv)\n}", "title": "" }, { "docid": "fb5ca40c70dea2f0d4c4e75beec2b4bc", "score": "0.42498314", "text": "func (_m *mockResolver) Resolve(certs []*x509.Certificate) ([]*x509.Certificate, error) {\n\tret := _m.Called(certs)\n\n\tvar r0 []*x509.Certificate\n\tvar r1 error\n\tif rf, ok := ret.Get(0).(func([]*x509.Certificate) ([]*x509.Certificate, error)); ok {\n\t\treturn rf(certs)\n\t}\n\tif rf, ok := ret.Get(0).(func([]*x509.Certificate) []*x509.Certificate); ok {\n\t\tr0 = rf(certs)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).([]*x509.Certificate)\n\t\t}\n\t}\n\n\tif rf, ok := ret.Get(1).(func([]*x509.Certificate) error); ok {\n\t\tr1 = rf(certs)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "5d204098e8567c1d6cb3088a380922a4", "score": "0.42289072", "text": "func MakeEndpoints(s interfaces.Service) Endpoints {\n\treturn Endpoints{\n\t\tCreateAssessment: makeCreateAssessmentEndpoint(s),\n\t\tGetAllAssessments: makeGetAllAssessmentsEndpoint(s),\n\t\tGetAssessmentByID: makeGetAssessmentByIDEndpoint(s),\n\t\tUpdateAssessment: makeUpdateAssessmentEndpoint(s),\n\t\tDeleteAssessment: makeDeleteAssessmentEndpoint(s),\n\n\t\tCreateAssessmentAttempt: makeCreateAssessmentAttemptEndpoint(s),\n\t\tGetAssessmentAttemptByID: makeGetAssessmentAttemptByIDEndpoint(s),\n\t\tLocalGetAssessmentAttemptByID: makeLocalGetAssessmentAttemptByIDEndpoint(s),\n\t\tUpdateAssessmentAttempt: makeUpdateAssessmentAttemptEndpoint(s),\n\t\tLocalUpdateAssessmentAttempt: makeLocalUpdateAssessmentAttemptEndpoint(s),\n\t\tDeleteAssessmentAttempt: makeDeleteAssessmentAttemptEndpoint(s),\n\n\t\tCreateQuestion: makeCreateQuestionEndpoint(s),\n\t\tBulkCreateQuestion: makeBulkCreateQuestionEndpoint(s),\n\t\tGetAllQuestions: makeGetAllQuestionsEndpoint(s),\n\t\tGetQuestionByID: makeGetQuestionByIDEndpoint(s),\n\t\tUpdateQuestion: makeUpdateQuestionEndpoint(s),\n\t\tDeleteQuestion: makeDeleteQuestionEndpoint(s),\n\n\t\tCreateTag: makeCreateTagEndpoint(s),\n\t\tDeleteTag: makeDeleteTagEndpoint(s),\n\n\t\tUpdateAttemptQuestion: makeUpdateAttemptQuestionEndpoint(s),\n\t}\n}", "title": "" }, { "docid": "29ccd96b60b2d362467bbb774a57b1d4", "score": "0.42092466", "text": "func (r *resolverWrapper) Resolve(ctx context.Context, ref string) (name string, desc ocispec.Descriptor, err error) {\n\tnewRef, desc, err := r.resolver.Resolve(ctx, ref)\n\tif err != nil {\n\t\treturn \"\", ocispec.Descriptor{}, err\n\t}\n\n\tif name, ok := r.refToName[newRef]; ok {\n\t\treturn name, desc, nil\n\t}\n\n\treturn newRef, desc, nil\n}", "title": "" }, { "docid": "4f8e6e95d311aaf48e63b92563d09569", "score": "0.4208037", "text": "func (r *Resolver) Resolve(target string) (naming.Watcher, error) {\n\tvar (\n\t\tnext = make(chan nextResults)\n\t\tfirstLookup, err = r.ResolverLookup(target)\n\t)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Initial read\n\tgo func() {\n\t\tnext <- nextResults{results: firstLookup}\n\t}()\n\n\tr.watcher = &watcher{\n\t\tresolverLookup: r.ResolverLookup,\n\t\tcurrentAddrs: make(map[string]interface{}),\n\t\tclose: make(chan struct{}),\n\t\tnext: next,\n\t\tinterval: r.WatcherInterval,\n\t\ttarget: target,\n\t}\n\n\tgo r.watcher.run()\n\n\treturn r.watcher, nil\n}", "title": "" }, { "docid": "3bcbd071dfabdd677c0184147b50156d", "score": "0.42022565", "text": "func (e *Endpoint) RunMetadataResolver(resolveMetadata MetadataResolverCB) {\n\tdone := make(chan struct{})\n\tcontrollerName := resolveLabels + \"-\" + e.GetK8sNamespaceAndPodName()\n\tgo func() {\n\t\tselect {\n\t\tcase <-done:\n\t\tcase <-e.aliveCtx.Done():\n\t\t\treturn\n\t\t}\n\t\te.controllers.RemoveController(controllerName)\n\t}()\n\n\te.controllers.UpdateController(controllerName,\n\t\tcontroller.ControllerParams{\n\t\t\tGroup: resolveLabelsControllerGroup,\n\t\t\tDoFunc: func(ctx context.Context) error {\n\t\t\t\tns, podName := e.GetK8sNamespace(), e.GetK8sPodName()\n\t\t\t\tpod, cp, identityLabels, info, _, err := resolveMetadata(ns, podName)\n\t\t\t\tif err != nil {\n\t\t\t\t\te.Logger(resolveLabels).WithError(err).Warning(\"Unable to fetch kubernetes labels\")\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\te.SetPod(pod)\n\t\t\t\te.SetK8sMetadata(cp)\n\t\t\t\te.UpdateNoTrackRules(func(_, _ string) (noTrackPort string, err error) {\n\t\t\t\t\tpo, _, _, _, _, err := resolveMetadata(ns, podName)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn \"\", err\n\t\t\t\t\t}\n\t\t\t\t\tvalue, _ := annotation.Get(po, annotation.NoTrack, annotation.NoTrackAlias)\n\t\t\t\t\treturn value, nil\n\t\t\t\t})\n\t\t\t\te.UpdateVisibilityPolicy(func(_, _ string) (proxyVisibility string, err error) {\n\t\t\t\t\tpo, _, _, _, _, err := resolveMetadata(ns, podName)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn \"\", err\n\t\t\t\t\t}\n\t\t\t\t\tvalue, _ := annotation.Get(po, annotation.ProxyVisibility, annotation.ProxyVisibilityAlias)\n\t\t\t\t\treturn value, nil\n\t\t\t\t})\n\t\t\t\te.UpdateBandwidthPolicy(func(ns, podName string) (bandwidthEgress string, err error) {\n\t\t\t\t\t_, _, _, _, annotations, err := resolveMetadata(ns, podName)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn \"\", err\n\t\t\t\t\t}\n\t\t\t\t\treturn annotations[bandwidth.EgressBandwidth], nil\n\t\t\t\t})\n\t\t\t\te.UpdateLabels(ctx, identityLabels, info, true)\n\t\t\t\tclose(done)\n\t\t\t\treturn nil\n\t\t\t},\n\t\t\tContext: e.aliveCtx,\n\t\t},\n\t)\n}", "title": "" }, { "docid": "7898195403e2ed95ff3d3543a99abe1a", "score": "0.4187961", "text": "func (r Reflect) Resolve(field string, args Args) (result interface{}, err error) {\n\tval := reflect.ValueOf(r.Target)\n\ttyp := val.Type()\n\n\tif _, ok := typ.MethodByName(\"Get\" + field); ok {\n\t\tm := val.MethodByName(\"Get\" + field)\n\t\treturn call(m, args)\n\t}\n\tif _, ok := typ.MethodByName(field); ok {\n\t\tm := val.MethodByName(field)\n\t\treturn call(m, args)\n\t}\n\tif _, ok := typ.FieldByName(field); ok {\n\t\treturn val.FieldByName(field).Interface(), nil\n\t}\n\n\treturn nil, errors.New(\"missing field\")\n}", "title": "" }, { "docid": "47efb9ee6450ce166a2b3e30d02dd897", "score": "0.4187075", "text": "func (s *Service) QueryEndpoints() *ServiceEndpointQuery {\n\treturn (&ServiceClient{s.config}).QueryEndpoints(s)\n}", "title": "" }, { "docid": "760e17d0d07035cb803ebead7804b1a5", "score": "0.41862777", "text": "func (s *Store) Resolve(ctx context.Context, reference string) (ocispec.Descriptor, error) {\n\tif reference == \"\" {\n\t\treturn ocispec.Descriptor{}, errdef.ErrMissingReference\n\t}\n\n\t// attempt resolving manifest\n\tdesc, err := s.tagResolver.Resolve(ctx, reference)\n\tif err != nil {\n\t\tif errors.Is(err, errdef.ErrNotFound) {\n\t\t\t// attempt resolving blob\n\t\t\treturn resolveBlob(os.DirFS(s.root), reference)\n\t\t}\n\t\treturn ocispec.Descriptor{}, err\n\t}\n\n\tif reference == desc.Digest.String() {\n\t\treturn descriptor.Plain(desc), nil\n\t}\n\n\treturn desc, nil\n}", "title": "" }, { "docid": "025441247c52457f30a18f035f56a3da", "score": "0.4185308", "text": "func (s *jsiiProxy_Stack) Resolve(obj interface{}) interface{} {\n\tvar returns interface{}\n\n\t_jsii_.Invoke(\n\t\ts,\n\t\t\"resolve\",\n\t\t[]interface{}{obj},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "1ce40ca44265c29273df7da97ed4d70a", "score": "0.4182293", "text": "func (r *Resolver) Resolve(did string, parsed *did.DID, res resolver.Resolver) (*resolver.Document, error) {\n\tif parsed.Method != r.Method() {\n\t\treturn nil, fmt.Errorf(\"unknown did method: '%s'\", parsed.Method)\n\t}\n\tpath := parsed.ID + DocPath\n\tid := strings.Split(parsed.ID, \":\")\n\tif len(id) > 1 {\n\t\tpath = strings.Join(id, \"/\") + \"/did.json\"\n\t}\n\turl := \"https://\" + path\n\tresp, err := Client.Get(url)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn nil, fmt.Errorf(\"unable to resolve: '%s'\", resp.Status)\n\t}\n\tif resp.Body == nil {\n\t\treturn nil, fmt.Errorf(\"empty did document\")\n\t}\n\tdefer resp.Body.Close()\n\n\tvar state resolver.Document\n\terr = json.NewDecoder(resp.Body).Decode(&state)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif state.ID != did {\n\t\treturn nil, fmt.Errorf(\"id does not match requested did\")\n\t}\n\tif len(state.VerificationMethod) < 1 {\n\t\treturn nil, fmt.Errorf(\"no verification methods\")\n\t}\n\treturn &state, nil\n}", "title": "" }, { "docid": "ba602d64fb31fbd7799d6cdb67fe50b1", "score": "0.41816223", "text": "func (c *Client) getResolver(ctx context.Context, authConfig *types.AuthConfig, name string, refs []string, resolverOpt docker.ResolverOptions) (remotes.Resolver, string, error) {\n\tusername, secret := \"\", \"\"\n\tif authConfig != nil {\n\t\tusername = authConfig.Username\n\t\tsecret = authConfig.Password\n\t}\n\n\tvar (\n\t\tavailableRef string\n\t\topt docker.ResolverOptions\n\t)\n\n\tfor _, ref := range refs {\n\t\tnamedRef, err := reference.Parse(ref)\n\t\tif err != nil {\n\t\t\tlogrus.Warnf(\"failed to parse image reference when trying to resolve image %s, raw reference is %s: %v\", ref, name, err)\n\t\t\tcontinue\n\t\t}\n\t\tnamedRef = reference.TrimTagForDigest(reference.WithDefaultTagIfMissing(namedRef))\n\n\t\tinsecure := c.isInsecureDomain(ref)\n\t\ttr := &http.Transport{\n\t\t\tProxy: proxyFromEnvironment,\n\t\t\tDialContext: (&net.Dialer{\n\t\t\t\tTimeout: 30 * time.Second,\n\t\t\t\tKeepAlive: 30 * time.Second,\n\t\t\t\tDualStack: true,\n\t\t\t}).DialContext,\n\t\t\tMaxIdleConns: 10,\n\t\t\tIdleConnTimeout: 30 * time.Second,\n\t\t\tTLSHandshakeTimeout: 10 * time.Second,\n\t\t\tTLSClientConfig: &tls.Config{\n\t\t\t\tInsecureSkipVerify: insecure,\n\t\t\t},\n\t\t\tExpectContinueTimeout: 5 * time.Second,\n\t\t}\n\n\t\topt = docker.ResolverOptions{\n\t\t\tTracker: resolverOpt.Tracker,\n\t\t\tPlainHTTP: insecure,\n\t\t\tCredentials: func(host string) (string, string, error) {\n\t\t\t\t// Only one host\n\t\t\t\treturn username, secret, nil\n\t\t\t},\n\t\t\tClient: &http.Client{\n\t\t\t\tTransport: tr,\n\t\t\t},\n\t\t}\n\n\t\tresolver := docker.NewResolver(opt)\n\n\t\tif _, _, err := resolver.Resolve(ctx, namedRef.String()); err == nil {\n\t\t\tavailableRef = namedRef.String()\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif availableRef == \"\" {\n\t\tlogrus.Warnf(\"there is no available image reference after trying %+q\", refs)\n\t\treturn nil, \"\", errtypes.ErrNotfound\n\t}\n\n\trefToName := map[string]string{\n\t\tavailableRef: name,\n\t}\n\n\treturn newImageResolver(refToName, opt), availableRef, nil\n}", "title": "" }, { "docid": "bf3e38720de6ee80b4f3413812240122", "score": "0.417896", "text": "func buildEndpoints() {\n\tfor key, endpoint := range endpoints {\n\t\tendpoints[key] = baseURL.ResolveReference(endpoint)\n\t}\n}", "title": "" }, { "docid": "4f07b0a71fad597dfcf99ce45b559286", "score": "0.41756788", "text": "func buildEndpointsFromSpecs(\n\tctx context.Context,\n\twriteNamespace string,\n\tresolver DnsResolver,\n\tspecs []*consulapi.CatalogService,\n\ttrackedServiceToUpstreams map[string][]*v1.Upstream,\n) v1.EndpointList {\n\tvar endpoints v1.EndpointList\n\tfor _, spec := range specs {\n\t\tif upstreams, ok := trackedServiceToUpstreams[spec.ServiceName]; ok {\n\t\t\tif eps, err := buildEndpoints(ctx, writeNamespace, resolver, spec, upstreams); err != nil {\n\t\t\t\tcontextutils.LoggerFrom(ctx).Warnf(\"consul eds plugin encountered error resolving DNS for consul service %v\", spec, err)\n\t\t\t} else {\n\t\t\t\tendpoints = append(endpoints, eps...)\n\t\t\t}\n\t\t}\n\t}\n\n\t// Sort by name in ascending order for idempotency\n\tsort.SliceStable(endpoints, func(i, j int) bool {\n\t\treturn endpoints[i].GetMetadata().GetName() < endpoints[j].GetMetadata().GetName()\n\t})\n\treturn endpoints\n}", "title": "" }, { "docid": "84e87f4e1b1fb7aa635cbc916d764979", "score": "0.41739535", "text": "func (state *resourceState) resolve(ctx *Context, err error, inputs *resourceInputs, urn, id string,\n\tresult *structpb.Struct, deps map[string][]Resource,\n) {\n\tdryrun := ctx.DryRun()\n\n\tvar inprops resource.PropertyMap\n\tif inputs != nil {\n\t\tinprops = inputs.resolvedProps\n\t}\n\n\tvar outprops resource.PropertyMap\n\tif err == nil {\n\t\toutprops, err = plugin.UnmarshalProperties(\n\t\t\tresult,\n\t\t\tctx.withKeepOrRejectUnknowns(plugin.MarshalOptions{\n\t\t\t\tKeepSecrets: true,\n\t\t\t\tKeepResources: true,\n\t\t\t}),\n\t\t)\n\t}\n\tif err != nil {\n\t\t// If there was an error, we must reject everything.\n\t\tfor _, output := range state.outputs {\n\t\t\tinternal.RejectOutput(output, err)\n\t\t}\n\t\tinternal.RejectOutput(state.rawOutputs, err)\n\t\treturn\n\t}\n\n\toutprops[\"urn\"] = resource.NewStringProperty(urn)\n\tif id != \"\" || !dryrun {\n\t\toutprops[\"id\"] = resource.NewStringProperty(id)\n\t} else {\n\t\toutprops[\"id\"] = resource.MakeComputed(resource.PropertyValue{})\n\t}\n\n\tif _, hasRemainingOutput := state.outputs[\"\"]; hasRemainingOutput {\n\t\tremaining, known := resource.PropertyMap{}, true\n\t\tfor k, v := range outprops {\n\t\t\tif v.IsNull() || v.IsComputed() || v.IsOutput() {\n\t\t\t\tknown = !dryrun\n\t\t\t}\n\t\t\tif _, ok := state.outputs[string(k)]; !ok {\n\t\t\t\tremaining[k] = v\n\t\t\t}\n\t\t}\n\t\tif !known {\n\t\t\toutprops[\"\"] = resource.MakeComputed(resource.NewStringProperty(\"\"))\n\t\t} else {\n\t\t\toutprops[\"\"] = resource.NewObjectProperty(remaining)\n\t\t}\n\t}\n\n\t// We need to wait until after we finish mutating outprops to resolve. Resolving\n\t// unlocks multithreaded access to the resolved value, making mutation a data race.\n\tinternal.ResolveOutput(state.rawOutputs, outprops, true, false, resourcesToInternal(nil))\n\n\tfor k, output := range state.outputs {\n\t\t// If this is an unknown or missing value during a dry run, do nothing.\n\t\tv, ok := outprops[resource.PropertyKey(k)]\n\t\tif !ok && !dryrun {\n\t\t\tv = inprops[resource.PropertyKey(k)]\n\t\t}\n\n\t\tknown := true\n\t\tif v.IsNull() || v.IsComputed() || v.IsOutput() {\n\t\t\tknown = !dryrun\n\t\t}\n\n\t\t// Allocate storage for the unmarshalled output.\n\t\tdest := reflect.New(output.ElementType()).Elem()\n\t\tsecret, err := unmarshalOutput(ctx, v, dest)\n\t\tif err != nil {\n\t\t\tinternal.RejectOutput(output, err)\n\t\t} else {\n\t\t\tinternal.ResolveOutput(output, dest.Interface(), known, secret, resourcesToInternal(deps[k]))\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b66e943b6d01ad2af78616fa8e8fb2ac", "score": "0.4170842", "text": "func (a adapter) Resolver(meta interface{}) oas.Resolver {\n\tdoc, ok := meta.(*oas.Document)\n\tif !ok {\n\t\tpanic(\"oas_chi: Resolver meta is not *oas.Document\")\n\t}\n\n\treturn NewResolver(doc)\n}", "title": "" }, { "docid": "5d9fa0cccfdb064ec795c7506652c610", "score": "0.4169568", "text": "func (c *MqttConnectionResolver) Resolve(correlationId string) (*cconf.ConfigParams, error) {\n\tconnections, err := c.ConnectionResolver.ResolveAll(correlationId)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcredential, err := c.CredentialResolver.Lookup(correlationId)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Validate connections\n\tfor _, connection := range connections {\n\t\terr = c.validateConnection(correlationId, connection)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\toptions := c.composeOptions(connections, credential)\n\treturn options, nil\n}", "title": "" }, { "docid": "11d00f52cad84057a4c7cacb5617ec2f", "score": "0.41684687", "text": "func (r PipelineResolver) Resolve(value string) (*ComponentMatch, error) {\n\treturn &ComponentMatch{\n\t\tValue: value,\n\t\tLocalOnly: true,\n\t}, nil\n}", "title": "" }, { "docid": "5bb6c7f96a9e47b34d0b9a0ee82c02e8", "score": "0.41674298", "text": "func Resolve(ctx context.Context, target ReadOnlyTarget, reference string, opts ResolveOptions) (ocispec.Descriptor, error) {\n\tif opts.TargetPlatform == nil {\n\t\treturn target.Resolve(ctx, reference)\n\t}\n\treturn resolve(ctx, target, nil, reference, opts)\n}", "title": "" }, { "docid": "f8a3dba9a51934718865ad6f1f608b4b", "score": "0.41661015", "text": "func endpointFromResourceData(d *schema.ResourceData) endpoints.Endpoint {\n\teType := d.Get(endpointType).(string)\n\n\tendpoint := endpoints.Endpoint{\n\t\tTitle: d.Get(endpointTitle).(string),\n\t\tDescription: d.Get(endpointDescription).(string),\n\t}\n\n\tswitch strings.ToLower(eType) {\n\tcase string(endpoints.EndpointTypeSlack):\n\t\tendpoint.EndpointType = endpoints.EndpointTypeSlack\n\t\topts, _ := mappingsFromResourceData(d, endpointSlack)\n\t\tendpoint.Url = opts[endpointUrl].(string)\n\tcase string(endpoints.EndpointTypeCustom):\n\t\tendpoint.EndpointType = endpoints.EndpointTypeCustom\n\t\topts, _ := mappingsFromResourceData(d, endpointCustom)\n\t\tendpoint.Url = opts[endpointUrl].(string)\n\t\tendpoint.Method = opts[endpointMethod].(string)\n\t\tendpoint.BodyTemplate = opts[endpointBodyTemplate]\n\t\theaderMap := make(map[string]string)\n\t\tfor k, v := range opts[endpointHeaders].(map[string]interface{}) {\n\t\t\theaderMap[k] = v.(string)\n\t\t}\n\t\tendpoint.Headers = headerMap\n\tcase string(endpoints.EndpointTypePagerDuty):\n\t\tendpoint.EndpointType = endpoints.EndpointTypePagerDuty\n\t\topts, _ := mappingsFromResourceData(d, endpointPagerDuty)\n\t\tendpoint.ServiceKey = opts[endpointServiceKey].(string)\n\tcase string(endpoints.EndpointTypeBigPanda):\n\t\tendpoint.EndpointType = endpoints.EndpointTypeBigPanda\n\t\topts, _ := mappingsFromResourceData(d, endpointBigPanda)\n\t\tendpoint.ApiToken = opts[endpointApiToken].(string)\n\t\tendpoint.AppKey = opts[endpointAppKey].(string)\n\tcase string(endpoints.EndpointTypeDataDog):\n\t\tendpoint.EndpointType = endpoints.EndpointTypeDataDog\n\t\topts, _ := mappingsFromResourceData(d, endpointDataDog)\n\t\tendpoint.ApiKey = opts[endpointApiKey].(string)\n\tcase string(endpoints.EndpointTypeVictorOps):\n\t\tendpoint.EndpointType = endpoints.EndpointTypeVictorOps\n\t\topts, _ := mappingsFromResourceData(d, endpointVictorOps)\n\t\tendpoint.RoutingKey = opts[endpointRoutingKey].(string)\n\t\tendpoint.MessageType = opts[endpointMessageType].(string)\n\t\tendpoint.ServiceApiKey = opts[endpointServiceApiKey].(string)\n\tdefault:\n\t\tpanic(fmt.Sprintf(\"unhandled endpoint type %s\", eType))\n\t}\n\treturn endpoint\n}", "title": "" }, { "docid": "c90dd9a02d9b2c878fa8d6785f474ba2", "score": "0.41659868", "text": "func (g *Gitlab) Resolve(r *http.Request) (*serving.Request, error) {\n\thost := request.GetHostWithoutPort(r)\n\n\tresponse := g.client.Resolve(r.Context(), host)\n\tif response.Error != nil {\n\t\treturn nil, response.Error\n\t}\n\n\turlPath := path.Clean(r.URL.Path)\n\tsize := len(response.Domain.LookupPaths)\n\n\tfor _, lookup := range response.Domain.LookupPaths {\n\t\tisSubPath := strings.HasPrefix(urlPath, lookup.Prefix)\n\t\tisRootPath := urlPath == path.Clean(lookup.Prefix)\n\n\t\tif isSubPath || isRootPath {\n\t\t\tsubPath := \"\"\n\t\t\tif isSubPath {\n\t\t\t\tsubPath = strings.TrimPrefix(urlPath, lookup.Prefix)\n\t\t\t}\n\n\t\t\treturn &serving.Request{\n\t\t\t\tServing: fabricateServing(lookup),\n\t\t\t\tLookupPath: fabricateLookupPath(size, lookup),\n\t\t\t\tSubPath: subPath}, nil\n\t\t}\n\t}\n\n\treturn nil, domain.ErrDomainDoesNotExist\n}", "title": "" }, { "docid": "ed1cda2c16912c3e8ed5d2868943a3f5", "score": "0.4165061", "text": "func (r *searchResolver) resolveRepositories(ctx context.Context, options search.RepoOptions) (resolved searchrepos.Resolved, err error) {\n\tif mockResolveRepositories != nil {\n\t\treturn mockResolveRepositories()\n\t}\n\n\ttr, ctx := trace.New(ctx, \"graphql.resolveRepositories\", fmt.Sprintf(\"options: %+v\", options))\n\tdefer func() {\n\t\ttr.SetError(err)\n\t\ttr.LazyPrintf(\"%s\", resolved.String())\n\t\ttr.Finish()\n\t}()\n\n\tif options.CacheLookup {\n\t\t// Cache if opts are empty, so that multiple calls to resolveRepositories only\n\t\t// hit the database once.\n\t\tr.reposMu.Lock()\n\t\tdefer r.reposMu.Unlock()\n\t\tif r.resolved.RepoRevs != nil || r.resolved.MissingRepoRevs != nil || r.repoErr != nil {\n\t\t\ttr.LazyPrintf(\"cached\")\n\t\t\treturn *r.resolved, r.repoErr\n\t\t}\n\t\tdefer func() {\n\t\t\tr.resolved = &resolved\n\t\t\tr.repoErr = err\n\t\t}()\n\t}\n\n\ttr.LazyPrintf(\"resolveRepositories - start\")\n\tdefer tr.LazyPrintf(\"resolveRepositories - done\")\n\n\trepositoryResolver := &searchrepos.Resolver{\n\t\tDB: r.db,\n\t\tZoekt: r.zoekt,\n\t\tSearchableReposFunc: backend.Repos.ListSearchable,\n\t}\n\n\treturn repositoryResolver.Resolve(ctx, options)\n}", "title": "" } ]
8b85712ac095bbac54f7eda2b5cdfe9e
CreateUserOfRole insert a row
[ { "docid": "d16fc151ccd511962c7441e40f9089a3", "score": "0.0", "text": "func (m *Machine) Create() (err error) {\n\tm.Id = 0\n\treturn db.Create(m).Error\n}", "title": "" } ]
[ { "docid": "d6f356f34f8133fbe5b781ff024c032f", "score": "0.6622578", "text": "func (u *User) Create(db *gorm.DB, ce *casbin.Enforcer, req *schemago.ReqCreateUser) (*schemago.SUser, error) {\n\tvar user = new(schemago.SUser)\n\tif !db.Where(\"code = ?\", req.Code).Find(&user).RecordNotFound() {\n\t\treturn nil, ErrAlreadyExists\n\t}\n\tuser = req.ToSchemaSUser()\n\tuserRoles := req.ToSchemaSUserRoles()\n\n\ttx := db.Begin()\n\tif err := tx.Create(&user).Error; err != nil {\n\t\ttx.Rollback()\n\t\treturn nil, err\n\t}\n\tfor _, item := range userRoles {\n\t\tif err := tx.Create(&item).Error; err != nil {\n\t\t\ttx.Rollback()\n\t\t\treturn nil, err\n\t\t}\n\t}\n\ttx.Commit()\n\tcasbinplug.RemoveUserRoleGroup(req.Recid, ce.GetModel())\n\tcasbinplug.LoadUserRoleGroup(db, req.Recid, ce.GetModel())\n\t// printPolicy(ce)\n\treturn user, nil\n}", "title": "" }, { "docid": "4a00ff8354aeff2dc34cdbc9ec1babcb", "score": "0.64835554", "text": "func (s Store) Create(ctx context.Context, usr User) error {\n\tconst q = `\n\tINSERT INTO users\n\t\t(user_id, name, email, password_hash, roles, date_created, date_updated)\n\tVALUES\n\t\t(:user_id, :name, :email, :password_hash, :roles, :date_created, :date_updated)`\n\n\tif err := database.NamedExecContext(ctx, s.log, s.db, q, usr); err != nil {\n\t\treturn fmt.Errorf(\"inserting user: %w\", err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "f0ba9fc1b2d83d8dd9d3bac632697130", "score": "0.64748096", "text": "func (i *UserInteractor) Create(scope string, data map[string]interface{}) error {\n\trole, ok := data[\"role\"]\n\tif !ok {\n\t\treturn ErrMissedRole\n\t}\n\tif scope == domain.RoleUser && role != domain.RoleUser {\n\t\treturn ErrNotAvailableRole\n\t}\n\n\temail, ok := data[\"email\"]\n\tif ok {\n\t\tif user, err := i.repo.GetByEmail(email.(string)); err == nil && user.ID > 0 {\n\t\t\treturn ErrEmailIsTaken\n\t\t}\n\t}\n\n\tuser, err := domain.NewUser(data)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif _, err := i.repo.Store(user); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "f1baf5975f67e882c28c8974ad12efed", "score": "0.64196074", "text": "func CreateUserLogin(w http.ResponseWriter, r *http.Request) {\n\t//create username/email with hashed default password: DOB - YYYYMMDD\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\n\tvar usr []structs.User\n\tvar errstr structs.ErrorMessage\n\n\t_ = json.NewDecoder(r.Body).Decode(&usr)\n\tdb := mysql.InitializeMySQL()\n\tsqlQuery := \"INSERT INTO users (username, password) values (?,?)\"\n\tsqlQueryRole := \"INSERT INTO user_roles (user_id, role_id, institution_id) values (?,?,?)\"\n\ttx, err := db.Begin()\n\tj := 0\n\tfor range usr {\n\t\tif err != nil {\n\t\t\ttx.Rollback()\n\t\t\tcommon.JSONError(w, usr[j].Username, err.Error(), http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\n\t\tv := validator.New()\n\t\terr := v.Struct(usr[j])\n\t\tif err != nil {\n\t\t\ttx.Rollback()\n\t\t\tcommon.JSONError(w, structs.Validate, err.Error(), http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\n\t\tres, err := tx.Exec(sqlQuery, &usr[j].Username, hashAndSalt([]byte(usr[j].Password)))\n\t\tif err != nil {\n\t\t\ttx.Rollback()\n\t\t\tcommon.JSONError(w, structs.QueryErr, err.Error(), http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\n\t\tlastInsertedID, err := res.LastInsertId()\n\t\tif err != nil {\n\t\t\ttx.Rollback()\n\t\t\tcommon.JSONError(w, structs.LastIDErr, err.Error(), http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\n\t\tif &usr[j].RoleID != nil {\n\t\t\t_, err := tx.Exec(sqlQueryRole, &lastInsertedID, &usr[j].RoleID, &usr[j].InstitutionID)\n\t\t\tif err != nil {\n\t\t\t\ttx.Rollback()\n\t\t\t\tcommon.JSONError(w, structs.QueryErr, err.Error(), http.StatusInternalServerError)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\terrstr.Message = structs.Success\n\t\terrstr.Code = http.StatusOK\n\t\tj++\n\t}\n\ttx.Commit()\n\tjson.NewEncoder(w).Encode(errstr)\n}", "title": "" }, { "docid": "50540b03875d3b66149188ed5d48bb2a", "score": "0.641666", "text": "func (r *PostgresRoleRepository) Create(role types.Role) (*types.Role, error) {\n\n\tdefaultLog.Trace(\"role Create\")\n\tdefer defaultLog.Trace(\"role Create done\")\n\n\tuuid, err := repository.UUID()\n\tif err == nil {\n\t\trole.ID = uuid\n\t} else {\n\t\t// return &role, err\n\t\treturn &role, errors.Wrap(err, \"role create: failed to get UUID\")\n\t}\n\tif err := r.db.Create(&role).Error; err != nil {\n\t\treturn &role, errors.Wrap(err, \"role create: failed\")\n\t}\n\treturn &role, nil\n}", "title": "" }, { "docid": "025d47b0f8b0a2bb75d28b0a23ecb1c7", "score": "0.6386731", "text": "func (sp *serviceProvider) AddRole(conn orm.Connection, sid int32, rid int16) error {\n\tnow := time.Now()\n\ts := &Staff{}\n\tr := &Role{}\n\trelation := &Relation{}\n\tvalue := &Relation{\n\t\tStaffId: sid,\n\t\tRoleId: rid,\n\t\tCreated: &now,\n\t}\n\n\tdb := conn.(*gorm.DB)\n\ttxn := db.Begin().Exec(\"USE staff\")\n\n\terr := txn.Model(s).Where(\"id = ?\", sid).First(s).Error\n\tif err != nil {\n\t\tgoto finish\n\t}\n\n\tif !s.Active || s.Resigned {\n\t\terr = errStaffInactive\n\t\tgoto finish\n\t}\n\n\terr = txn.Model(r).Where(\"id = ?\", rid).First(r).Error\n\tif err != nil {\n\t\tgoto finish\n\t}\n\n\tif !r.Active {\n\t\terr = errRoleInactive\n\t\tgoto finish\n\t}\n\n\terr = txn.Model(relation).Create(value).Error\n\nfinish:\n\tif err == nil {\n\t\terr = txn.Commit().Error\n\t}\n\n\tif err != nil {\n\t\ttxn.Rollback()\n\t}\n\n\treturn err\n}", "title": "" }, { "docid": "498219206e3420effa8b24eb8af7289c", "score": "0.6304893", "text": "func (p *RoleService) createAndInsertRole(roleName string, desc string) (roleId string, err error) {\n\trole := &entity.Role{}\n\trole, err = p.getRoleByName(roleName)\n\tif err == nil {\n\t\tlogrus.Infoln(\"role already exist! roleName: \", roleName)\n\t\troleId = role.ObjectId.Hex()\n\t\treturn\n\t}\n\n\tcurrentTime := common.GetCurrentTime()\n\tobjectId := bson.NewObjectId()\n\trole = &entity.Role{\n\t\tObjectId: objectId,\n\t\tRolename: roleName,\n\t\tDescription: desc,\n\t\tTimeCreate: currentTime,\n\t\tTimeUpdate: currentTime,\n\t}\n\n\terr = dao.HandleInsert(p.collectionName, role)\n\tif err != nil {\n\t\tlogrus.Warnln(\"create role error %v\", err)\n\t\treturn\n\t}\n\troleId = role.ObjectId.Hex()\n\treturn\n\n}", "title": "" }, { "docid": "6687e00c2bd344139331b475c8a4a445", "score": "0.62594897", "text": "func AddUserRole(m *model.UserRole) (id int64, err error) {\n\to := orm.NewOrm()\n\to.Using(model.DbName)\n\tid, err = o.Insert(m)\n\tif err == nil {\n\t\tfmt.Println(\"id of records insert in database:\", id)\n\t\tcache.UserRoleCache.Add(m.UserId, m.RoleId)\n\t}\n\treturn\n}", "title": "" }, { "docid": "91bf94337e2869e1344751bc35aa5fc5", "score": "0.61610633", "text": "func (es *Elasticsearch) CreateUser(ctx context.Context, statements dbplugin.Statements, usernameConfig dbplugin.UsernameConfig, _ time.Time) (string, string, error) {\n\tusername, err := es.credentialProducer.GenerateUsername(usernameConfig)\n\tif err != nil {\n\t\treturn \"\", \"\", errwrap.Wrapf(fmt.Sprintf(\"unable to generate username for %q: {{err}}\", usernameConfig), err)\n\t}\n\n\tpassword, err := es.credentialProducer.GeneratePassword()\n\tif err != nil {\n\t\treturn \"\", \"\", errwrap.Wrapf(\"unable to generate password: {{err}}\", err)\n\t}\n\n\tstmt, err := newCreationStatement(statements)\n\tif err != nil {\n\t\treturn \"\", \"\", errwrap.Wrapf(\"unable to read creation_statements: {{err}}\", err)\n\t}\n\n\tuser := &User{\n\t\tPassword: password,\n\t\tRoles: stmt.PreexistingRoles,\n\t}\n\n\t// Don't let anyone write the config while we're using it for our current client.\n\tes.mux.RLock()\n\tdefer es.mux.RUnlock()\n\n\tclient, err := buildClient(es.config)\n\tif err != nil {\n\t\treturn \"\", \"\", errwrap.Wrapf(\"unable to get client: {{err}}\", err)\n\t}\n\n\t// If the RoleToCreate map has been populated with any data, we have one role to create.\n\t// There can either be one RoleToCreate and no PreexistingRoles, or >= 1 PreexistingRoles\n\t// and no RoleToCreate. They're mutually exclusive.\n\tif len(stmt.RoleToCreate) > 0 {\n\t\t// We'll simply name the role the same thing as the username, making it easy to tie back to this user.\n\t\tif err := client.CreateRole(ctx, username, stmt.RoleToCreate); err != nil {\n\t\t\treturn \"\", \"\", errwrap.Wrapf(fmt.Sprintf(\"unable to create role name %s, role definition %q: {{err}}\", username, stmt.RoleToCreate), err)\n\t\t}\n\t\tuser.Roles = []string{username}\n\t}\n\tif err := client.CreateUser(ctx, username, user); err != nil {\n\t\treturn \"\", \"\", errwrap.Wrapf(fmt.Sprintf(\"unable to create user name %s, user %q: {{err}}\", username, user), err)\n\t}\n\treturn username, password, nil\n}", "title": "" }, { "docid": "a80c9e694bb1654bd147e3caf6bd9341", "score": "0.61555207", "text": "func (o *AuthUserRole) Insert(exec boil.Executor, whitelist ...string) error {\n\tif o == nil {\n\t\treturn errors.New(\"chado: no auth_user_role provided for insertion\")\n\t}\n\n\tvar err error\n\n\tif err := o.doBeforeInsertHooks(exec); err != nil {\n\t\treturn err\n\t}\n\n\tnzDefaults := queries.NonZeroDefaultSet(authUserRoleColumnsWithDefault, o)\n\n\tkey := makeCacheKey(whitelist, nzDefaults)\n\tauthUserRoleInsertCacheMut.RLock()\n\tcache, cached := authUserRoleInsertCache[key]\n\tauthUserRoleInsertCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl, returnColumns := strmangle.InsertColumnSet(\n\t\t\tauthUserRoleColumns,\n\t\t\tauthUserRoleColumnsWithDefault,\n\t\t\tauthUserRoleColumnsWithoutDefault,\n\t\t\tnzDefaults,\n\t\t\twhitelist,\n\t\t)\n\n\t\tcache.valueMapping, err = queries.BindMapping(authUserRoleType, authUserRoleMapping, wl)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcache.retMapping, err = queries.BindMapping(authUserRoleType, authUserRoleMapping, returnColumns)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcache.query = fmt.Sprintf(\"INSERT INTO \\\"auth_user_role\\\" (\\\"%s\\\") VALUES (%s)\", strings.Join(wl, \"\\\",\\\"\"), strmangle.Placeholders(dialect.IndexPlaceholders, len(wl), 1, 1))\n\n\t\tif len(cache.retMapping) != 0 {\n\t\t\tcache.query += fmt.Sprintf(\" RETURNING \\\"%s\\\"\", strings.Join(returnColumns, \"\\\",\\\"\"))\n\t\t}\n\t}\n\n\tvalue := reflect.Indirect(reflect.ValueOf(o))\n\tvals := queries.ValuesFromMapping(value, cache.valueMapping)\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, cache.query)\n\t\tfmt.Fprintln(boil.DebugWriter, vals)\n\t}\n\n\tif len(cache.retMapping) != 0 {\n\t\terr = exec.QueryRow(cache.query, vals...).Scan(queries.PtrsFromMapping(value, cache.retMapping)...)\n\t} else {\n\t\t_, err = exec.Exec(cache.query, vals...)\n\t}\n\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"chado: unable to insert into auth_user_role\")\n\t}\n\n\tif !cached {\n\t\tauthUserRoleInsertCacheMut.Lock()\n\t\tauthUserRoleInsertCache[key] = cache\n\t\tauthUserRoleInsertCacheMut.Unlock()\n\t}\n\n\treturn o.doAfterInsertHooks(exec)\n}", "title": "" }, { "docid": "de6a7a3cf3988bc4d8d85f6622278654", "score": "0.6146594", "text": "func (s *Store) Create(ctx context.Context, usr user.User) error {\n\tconst q = `\n\tINSERT INTO users\n\t\t(user_id, name, email, password_hash, roles, enabled, date_created, date_updated)\n\tVALUES\n\t\t(:user_id, :name, :email, :password_hash, :roles, :enabled, :date_created, :date_updated)`\n\n\tif err := database.NamedExecContext(ctx, s.log, s.db, q, toDBUser(usr)); err != nil {\n\t\tif errors.Is(err, database.ErrDBDuplicatedEntry) {\n\t\t\treturn fmt.Errorf(\"create: %w\", user.ErrUniqueEmail)\n\t\t}\n\t\treturn fmt.Errorf(\"inserting user: %w\", err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "87297f5be158180be4c58e98de41cadd", "score": "0.6114326", "text": "func CreateAdminUser(c *gin.Context) {\n\tvar request AdminSignUpRequest\n\n\tif c.BindJSON(&request) != nil {\n\t\tc.JSON(http.StatusBadRequest, gin.H{})\n\t\treturn\n\t}\n\n\tdb := NewDB()\n\tdefer db.Close()\n\tvar admin User\n\n\trequest.Password = EncryptPassword(request.Password)\n\tif err := db.Get(&admin, \"select * from user a join role r on u.role_id = r.id WHERE email = ? AND password = ? AND authority = ?\", request.Name, request.Password, \"ROLE_ADMIN\"); err != nil {\n\t\tif err != sql.ErrNoRows {\n\t\t\tfmt.Printf(\"%+v\", errors.Wrap(err, \"Error on retrieve getting admin user\"))\n\t\t\tc.JSON(http.StatusInternalServerError, err)\n\t\t\treturn\n\t\t}\n\n\t}\n\n\tif admin.ID != 0 {\n\t\tc.JSON(http.StatusConflict, gin.H{\n\t\t\t\"message\": \"The admin name exists\",\n\t\t})\n\t\treturn\n\t}\n\n\tvar role Role\n\tif err := db.Get(&role, \"select * from role where authority = ?\", \"ROLE_ADMIN\"); err != nil {\n\t\tfmt.Printf(\"%+v\", errors.Wrap(err, \"Error on getting admin role\"))\n\t\tc.JSON(http.StatusInternalServerError, gin.H{\n\t\t\t\"message\": \"Error on getting admin role\",\n\t\t\t\"error\": err,\n\t\t})\n\t\treturn\n\t}\n\n\tadminUser := User{\n\t\tEmail: request.Name,\n\t\tPassword: request.Password,\n\t\tFirstName: request.FirstName,\n\t\tLastName: request.LastName,\n\t\tRole: role,\n\t}\n\n\tif _, err := db.NamedExec(\"INSERT INTO user (email, password, first_name, last_name, role_id) VALUES (:email, :password, :first_name, :last_name, :role_id)\", &adminUser); err != nil {\n\t\tfmt.Printf(\"%+v\", errors.Wrap(err, \"Error on creating admin user\"))\n\t\tc.JSON(http.StatusInternalServerError, gin.H{\n\t\t\t\"message\": \"Error on creating admin user\",\n\t\t\t\"error\": err,\n\t\t})\n\t\treturn\n\t}\n\n\tc.JSON(http.StatusOK, gin.H{})\n}", "title": "" }, { "docid": "cb098f1875e9452a9eca54ecc04d6940", "score": "0.6104508", "text": "func (r *UserRepo) Create(u *User) error {\n\tsqlstr := `INSERT INTO ` + UserTable + ` (name, pswd, role, email, active, created_at, updated_at)\n\tVALUES (:name, :pswd, :role, :email, :active, :created_at, :updated_at)`\n\n\tresult, err := storage.GetRDBx().NamedExec(sqlstr, u)\n\tif err == nil {\n\t\tid, _ := result.LastInsertId()\n\t\tif id > 0 {\n\t\t\tu.ID = uint64(id)\n\t\t}\n\t}\n\n\treturn err\n}", "title": "" }, { "docid": "303c1af69d50c595e9fbe7809b9459d7", "score": "0.60902816", "text": "func (dao *UserDAO) Create(rs app.RequestScope, user *models.User) error {\n\tuser.Id = 0\n\treturn rs.Tx().Model(user).Insert()\n}", "title": "" }, { "docid": "c45fd6e99a5cf459b5717735704f1d22", "score": "0.6080517", "text": "func (t UserModel) AddRole(roleId string) (int64, error) {\n\tif roleId != \"\" {\n\t\tif !t.CheckRoleId(roleId) {\n\t\t\treturn t.WithTx(t.Tx).Table(\"goadmin_role_users\").\n\t\t\t\tInsert(dialect.H{\n\t\t\t\t\t\"role_id\": roleId,\n\t\t\t\t\t\"user_id\": t.Id,\n\t\t\t\t})\n\t\t}\n\t}\n\treturn 0, nil\n}", "title": "" }, { "docid": "8fb7ce162accae1dbea5f12ee3771358", "score": "0.6050866", "text": "func (p *Dao) Role(name string, rty string, rid uint) (*Role, error) {\n\tvar e error\n\tr := Role{}\n\tdb := p.Db\n\tif db.\n\t\tWhere(\"name = ? AND resource_type = ? AND resource_id = ?\", name, rty, rid).\n\t\tFirst(&r).\n\t\tRecordNotFound() {\n\t\tr = Role{\n\t\t\tName: name,\n\t\t\tResourceType: rty,\n\t\t\tResourceID: rid,\n\t\t}\n\t\te = db.Create(&r).Error\n\n\t}\n\treturn &r, e\n}", "title": "" }, { "docid": "1d00f51486a6c33698edd8d47a5ac418", "score": "0.6029664", "text": "func InitRole(ctx context.Context, ses *Session, tenant *TenantInfo, cr *tree.CreateRole) (err error) {\n\tvar exists int\n\tvar erArray []ExecResult\n\tvar sql string\n\terr = normalizeNamesOfRoles(ctx, cr.Roles)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tbh := ses.GetBackgroundExec(ctx)\n\tdefer bh.Close()\n\n\terr = bh.Exec(ctx, \"begin;\")\n\tdefer func() {\n\t\terr = finishTxn(ctx, bh, err)\n\t}()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor _, r := range cr.Roles {\n\t\texists = 0\n\t\tif isPredefinedRole(r.UserName) {\n\t\t\texists = 3\n\t\t} else {\n\t\t\t//dedup with role\n\t\t\tsql, err = getSqlForRoleIdOfRole(ctx, r.UserName)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tbh.ClearExecResultSet()\n\t\t\terr = bh.Exec(ctx, sql)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\terArray, err = getResultSet(ctx, bh)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif execResultArrayHasData(erArray) {\n\t\t\t\texists = 1\n\t\t\t}\n\n\t\t\t//dedup with user\n\t\t\tif exists == 0 {\n\t\t\t\tsql, err = getSqlForPasswordOfUser(ctx, r.UserName)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tbh.ClearExecResultSet()\n\t\t\t\terr = bh.Exec(ctx, sql)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\terArray, err = getResultSet(ctx, bh)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tif execResultArrayHasData(erArray) {\n\t\t\t\t\texists = 2\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif exists != 0 {\n\t\t\tif cr.IfNotExists {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif exists == 1 {\n\t\t\t\terr = moerr.NewInternalError(ctx, \"the role %s exists\", r.UserName)\n\t\t\t} else if exists == 2 {\n\t\t\t\terr = moerr.NewInternalError(ctx, \"there is a user with the same name as the role %s\", r.UserName)\n\t\t\t} else if exists == 3 {\n\t\t\t\terr = moerr.NewInternalError(ctx, \"can not use the name %s. it is the name of the predefined role\", r.UserName)\n\t\t\t}\n\n\t\t\treturn err\n\t\t}\n\n\t\tinitMoRole := fmt.Sprintf(initMoRoleWithoutIDFormat, r.UserName, tenant.GetUserID(), tenant.GetDefaultRoleID(),\n\t\t\ttypes.CurrentTimestamp().String2(time.UTC, 0), \"\")\n\t\terr = bh.Exec(ctx, initMoRole)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn err\n}", "title": "" }, { "docid": "8f32dd37eb621fd4bafe1b93ec0d4ef8", "score": "0.6026033", "text": "func (c *RolesStore) Add(ctx context.Context, u *chronograf.Role) (*chronograf.Role, error) {\n\tif err := c.Ctrl.CreateRole(ctx, u.Name); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := c.Ctrl.SetRolePerms(ctx, u.Name, ToEnterprise(u.Permissions)); err != nil {\n\t\treturn nil, err\n\t}\n\n\tusers := make([]string, len(u.Users))\n\tfor i, u := range u.Users {\n\t\tusers[i] = u.Name\n\t}\n\tif err := c.Ctrl.SetRoleUsers(ctx, u.Name, users); err != nil {\n\t\treturn nil, err\n\t}\n\treturn u, nil\n}", "title": "" }, { "docid": "ab49ab76f3192c3b34bd5564422a7b4e", "score": "0.6004166", "text": "func (v *DbUsers) create() (userId int, err error) {\n return\n}", "title": "" }, { "docid": "b0060d9cc6d3d1cf317bc68c7722e363", "score": "0.59808725", "text": "func (c *RolesController) Create(ctx *app.CreateRolesContext) error {\n\t// RolesController_Create: start_implement\n\tm, err := c.fm()\n\tif err != nil {\n\t\tgoa.ContextLogger(ctx).Error(`unable to get model`, `error`, err.Error())\n\t\treturn ctx.ServiceUnavailable()\n\t}\n\tdefer func() { m.Close() }()\n\n\tb, err := m.InsertRole(ctx.Payload.RoleName)\n\tif err != nil {\n\t\tgoa.ContextLogger(ctx).Error(`failed to insert role`, `error`, err.Error())\n\t\tif err == model.ErrDuplicateKey {\n\t\t\treturn ctx.UnprocessableEntity()\n\t\t}\n\t\treturn ctx.InternalServerError()\n\t}\n\n\tctx.ResponseData.Header().Set(\"Location\", app.RolesHref(b.ID))\n\treturn ctx.Created()\n\t// RolesController_Create: end_implement\n}", "title": "" }, { "docid": "dd433b5952db28e7fef97126d08388e8", "score": "0.5973011", "text": "func CreateUser(v interface{}) error {\n\treturn WithinTransaction(func(tx *gorm.DB) (err error) {\n\t\t// check new object\n\t\tif !gormdb.DBManager().NewRecord(v) {\n\t\t\treturn err\n\t\t}\n\t\tif err = tx.Create(v).Error; err != nil {\n\t\t\ttx.Rollback() // rollback\n\t\t\treturn err\n\t\t}\n\t\treturn err\n\t})\n}", "title": "" }, { "docid": "9cce9b55037e3aa829b86be23827d788", "score": "0.59723234", "text": "func (this *userDAO) Create(user *User) (e error) {\n\tvar wg sync.WaitGroup\n\twg.Add(1)\n\tgo func() {\n\t\tu, _ := this.GetByEmail(user.Email)\n\t\tif len(u.Role) > 0 {\n\t\t\te = errors.New(\"The user already exists in the database\")\n\t\t} else {\n\t\t\t// it creates a hashed byte slice from the user password\n\t\t\tpass, _ := bcrypt.GenerateFromPassword([]byte(user.Password), bcrypt.DefaultCost)\n\t\t\tuser.Password = pass // apply the encrypted pass to the user obj\n\t\t\tDbConn.GetConn().Create(&user)\n\t\t\te = DbConn.Check() // check for errors\n\t\t}\n\t\tdefer wg.Done()\n\t}()\n\twg.Wait()\n\treturn\n}", "title": "" }, { "docid": "ec64a889ce388b6235f1164ede36d4d4", "score": "0.5955081", "text": "func (client *ChatSQLClient) CreateUser(username string, hash []byte) (id int64, err error) {\n res, err := client.db.Exec(INSERT_USER, username, hash)\n if err != nil {\n return -1, err\n }\n return res.LastInsertId()\n}", "title": "" }, { "docid": "9a8e5f9f63efd7ab8df875faed0b772b", "score": "0.5932584", "text": "func (ser *UserService) Create(u *models.User, tx db.Tx) (int, error) {\n\tuw := userWrap{false, u}\n\treturn tx.Database().Create(&uw, ser, tx)\n}", "title": "" }, { "docid": "8dba94a077a6ee382018e21ad88ad2fc", "score": "0.59285355", "text": "func CreateUser(ctx context.Context, store store.Driver, email string, roleID int) (models.User, error) {\n\tuser := models.User{\n\t\tEmail: email,\n\t\tRoleID: roleID,\n\t}\n\tuser.ID = utils.GenerateUUID()\n\tuser.TS = time.Now()\n\n\tif err := store.CreateUser(ctx, &user); err != nil {\n\t\treturn models.User{}, err\n\t}\n\n\treturn user, nil\n}", "title": "" }, { "docid": "6d9ff41cfe063069f6ae9362bb28fa32", "score": "0.5924895", "text": "func (repo PostgresRepository) Save(role entity.Role) error {\n\t_, err := repo.db.Table(\"roles\").Insert(&role)\n\treturn err\n}", "title": "" }, { "docid": "48819f26fa615028390c2080224bbd9a", "score": "0.591688", "text": "func (s service) Create(ctx context.Context, req *auth.CreateRoleRequest) (*auth.Role, error) {\n\tif err := ValidateCreateRequest(req); err != nil {\n\t\treturn nil, err\n\t}\n\tid, err := s.repo.Create(ctx, entity.Role{\n\t\tTitle: req.Title,\n\t\tEnable: req.Enable,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn s.Get(ctx, id)\n}", "title": "" }, { "docid": "0a792210dea076a9a5d2a8abb2796f7a", "score": "0.5910113", "text": "func (client *Client) CreateRole(\n\tctx context.Context, role *graylog.Role,\n) (*ErrorInfo, error) {\n\tif role == nil {\n\t\treturn nil, errors.New(\"role is nil\")\n\t}\n\treturn client.callPost(ctx, client.Endpoints().Roles(), role, role)\n}", "title": "" }, { "docid": "52f44dc2646c469cf854da5c3576d94d", "score": "0.5908032", "text": "func RolesCreate(w http.ResponseWriter, r *http.Request) {\n\tc := htp.GetController(r)\n\tuser := controls.GetMemberUser(c, r, w)\n\tn := c.GetFormString(\"name\")\n\n\tusp := ws.UserPerms{}.From(user)\n\tc.Assert(usp.ManageRoles, \"403: users require the manage_roles permission to update roles\")\n\n\tnr := db.CreateRole(n)\n\tdb.CreateAudit(db.ActionRoleCreate, user, nr.UUID, \"\", \"\")\n\tw.WriteHeader(http.StatusCreated)\n\tws.BroadcastMessage(map[string]interface{}{\n\t\t\"type\": \"role-new\",\n\t\t\"role\": nr,\n\t})\n}", "title": "" }, { "docid": "03ff840eff8618e79d90287ccf6aff98", "score": "0.5892861", "text": "func Register(id string, name string, role string) {\n\tuser := new(id, name, role)\n}", "title": "" }, { "docid": "14ab7d3080da405d73b841ffe14ff0ae", "score": "0.5891015", "text": "func (u *User) createUser(db *sql.DB) error {\n\t_, err := db.Exec(\"UPDATE users SET name=$1, email=$2 WHERE id=$3\", u.Name, u.Email, u.ID)\n\treturn err\n}", "title": "" }, { "docid": "50ce55a73d72fc57d772fdbdc9d7ac9b", "score": "0.5870468", "text": "func (roleCreate AerospikeRoleCreateUpdate) createRole(client *as.Client, adminPolicy *as.AdminPolicy, logger Logger) error {\n\tlogger.Info(\"Creating role\", log.Ctx{\"rolename\": roleCreate.name})\n\n\taerospikePrivileges, err := privilegeStringtoAerospikePrivilege(roleCreate.privileges)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Could not create role %s: %v\", roleCreate.name, err)\n\t}\n\n\terr = client.CreateRole(adminPolicy, roleCreate.name, aerospikePrivileges, roleCreate.whitelist)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Could not create role %s: %v\", roleCreate.name, err)\n\t}\n\tlogger.Info(\"Created role\", log.Ctx{\"rolename\": roleCreate.name})\n\n\treturn nil\n}", "title": "" }, { "docid": "aa4d4b6ccde56073acac8c6cea928a12", "score": "0.5867526", "text": "func (uh *RoleHandler) AddRole(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {\n\tl := r.ContentLength\n\tbody := make([]byte, l)\n\n\t_, _ = r.Body.Read(body)\n\n\trol := &entities.Role{}\n\n\terr := json.Unmarshal(body, rol)\n\n\t// fmt.Println(user.Interests)\n\n\tif err != nil {\n\t\tfmt.Printf(\"Error %s\", err.Error())\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\thttp.Error(w, http.StatusText(http.StatusNotExtended), http.StatusNotExtended)\n\t\treturn\n\t}\n\n\trol, errs := uh.userService.StoreRole(rol)\n\tfmt.Println(rol)\n\tif len(errs) > 0 {\n\t\tfmt.Println(errs)\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\thttp.Error(w, http.StatusText(http.StatusNotFound), http.StatusNotFound)\n\t\treturn\n\t}\n\n\toutput, err := json.MarshalIndent(rol, \"\", \"\\t\")\n\n\tif err != nil {\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\thttp.Error(w, http.StatusText(http.StatusNotImplemented), http.StatusNotImplemented)\n\t\treturn\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.Write(output)\n\treturn\n\n}", "title": "" }, { "docid": "a1d34d0cc49185674114d46abda3d714", "score": "0.5864917", "text": "func createUser(rw http.ResponseWriter, request *http.Request) {\n\tdecoder := json.NewDecoder(request.Body)\n\n\tvar t User\n\terr := decoder.Decode(&t)\n\n\tif err != nil {\n\t\tfmt.Fprintf(rw, \"Unable to create User - reason: %s\\n\", err)\n\t\treturn\n\t}\n\texistingUser, err := findUsersByUserID(t.Id)\n\tif err != nil {\n\t\tfmt.Fprintf(rw, \"Unable to create User - reason: %s\\n\", err)\n\t\treturn\n\t}\n\tif len(existingUser) > 0 {\n\t\tfmt.Fprintf(rw, \"User \\\"%s\\\" already exists\\n\", t.Id)\n\t\treturn\n\t}\n\tSha2512hasher := sha512.New()\n\tSha2512hasher.Write([]byte(t.Password))\n\tpassHash := hex.EncodeToString(Sha2512hasher.Sum(nil))\n\tt.Password = passHash\n\tinsertedUser, err := InsertUser(t)\n\tif err != nil {\n\t\tfmt.Fprintf(rw, \"Unable to create User - reason: %s\\n\", err)\n\t\treturn\n\t}\n\tfmt.Fprintf(rw, \"UserId %s created successfully for %s \\n\", t.Id, t.Name)\n\tvar _ = insertedUser\n}", "title": "" }, { "docid": "b79d0308d2c2268dbd0834ac46d2ec09", "score": "0.58546895", "text": "func Create(ctx context.Context, m metrics.Metrics, dbx SqlDB, table string, elem methods.User) error {\n\tdefer m.CollectMetrics(\"DB.Create\")\n\tdefer m.Emit(metrics.Info(\"Create User in db\"), metrics.With(\"table\", table))\n\n\tif isContextExpired(ctx) {\n\t\tm.Emit(metrics.Error(ErrExpiredContext))\n\t\treturn ErrExpiredContext\n\t}\n\n\tif validator, ok := interface{}(elem).(Validation); ok {\n\t\tif err := validator.Validate(); err != nil {\n\t\t\tm.Emit(metrics.Errorf(\"Failed validate record\"),\n\t\t\t\tmetrics.With(\"table\", table),\n\t\t\t\tmetrics.With(\"error\", err.Error()))\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif _, ok := interface{}(elem).(UserFields); !ok {\n\t\tm.Emit(metrics.Error(ErrExpectedFieldType))\n\t\treturn ErrExpectedFieldType\n\t}\n\n\tm.Emit(metrics.Info(\"Create User record\"),\n\t\tmetrics.With(\"table\", table),\n\t\tmetrics.With(\"elem\", elem))\n\n\tfields, err := elem.Fields()\n\tif err != nil {\n\t\tm.Emit(metrics.Error(err), metrics.With(\"table\", table), metrics.With(\"elem\", elem))\n\t\treturn err\n\t}\n\n\tfieldNames := fieldNames(fields)\n\tvalues := fieldValues(fieldNames, fields)\n\n\tquery := fmt.Sprintf(insertTemplate, table, fieldNameMarkers(fieldNames), fieldMarkers(len(fieldNames)))\n\tm.Emit(metrics.Info(\"DB:\"), metrics.With(\"query\", query))\n\n\tdb, err := dbx.New()\n\tif err != nil {\n\t\tm.Emit(metrics.Error(err), metrics.With(\"table\", table), metrics.With(\"elem\", elem))\n\t\treturn err\n\t}\n\n\tdefer db.Close()\n\n\ttx, err := db.Begin()\n\tif err != nil {\n\t\tm.Emit(metrics.Error(err), metrics.With(\"table\", table), metrics.With(\"elem\", elem))\n\t\treturn err\n\t}\n\n\tif _, err := db.Exec(query, values...); err != nil {\n\t\tm.Emit(metrics.Error(err), metrics.WithFields(metrics.Field{\n\t\t\t\"err\": err,\n\t\t\t\"query\": query,\n\t\t\t\"table\": table,\n\t\t\t\"elem\": elem,\n\t\t}))\n\t\treturn err\n\t}\n\n\tif err := tx.Commit(); err != nil {\n\t\tm.Emit(metrics.Error(err), metrics.WithFields(metrics.Field{\n\t\t\t\"err\": err,\n\t\t\t\"query\": query,\n\t\t\t\"table\": table,\n\t\t\t\"elem\": elem,\n\t\t}))\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "b6963970e4257ec9f797c62f537e047f", "score": "0.58529603", "text": "func (c *SysUserRoleClient) Create() *SysUserRoleCreate {\n\tmutation := newSysUserRoleMutation(c.config, OpCreate)\n\treturn &SysUserRoleCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "41f015c0de267c09f5b99d9256be7c9c", "score": "0.584101", "text": "func (r repository) Create(ctx context.Context, user entity.User) error {\n\t_, err := r.db.With(ctx).Model(&user).Insert()\n\treturn err\n}", "title": "" }, { "docid": "6f809c28acbd3e055a6dda88a66f2898", "score": "0.58390665", "text": "func (c *testContext) createUserAndRole(ctx context.Context, t testing.TB, userName, roleName string, dbUsers, dbNames []string, roleOpts ...roleOptFn) (types.User, types.Role) {\n\tuser, role, err := auth.CreateUserAndRole(c.tlsServer.Auth(), userName, []string{roleName}, nil)\n\trequire.NoError(t, err)\n\trole.SetDatabaseUsers(types.Allow, dbUsers)\n\trole.SetDatabaseNames(types.Allow, dbNames)\n\tfor _, roleOpt := range roleOpts {\n\t\troleOpt(role)\n\t}\n\terr = c.tlsServer.Auth().UpsertRole(ctx, role)\n\trequire.NoError(t, err)\n\treturn user, role\n}", "title": "" }, { "docid": "6789dced4b6bfa1ccea22952c7287e3e", "score": "0.58381", "text": "func (r *repository) CreateUser(ctx context.Context, m *models.User) (*models.User, error) {\n\tif m == nil {\n\t\treturn nil, errors.New(\"Input parameter user is nil\")\n\t}\n\n\ttx, err := r.DB.BeginContext(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, role := range m.Roles {\n\t\tswitch role {\n\t\tcase \"Candidate\":\n\t\t\tif m.Candidate != nil {\n\t\t\t\tif m.Candidate.ID == 0 {\n\t\t\t\t\t_, err = r.CreateCandidate(ctx, tx, m.Candidate)\n\t\t\t\t} else {\n\t\t\t\t\t_, err = r.UpdateCandidate(ctx, tx, m.Candidate)\n\t\t\t\t}\n\t\t\t\tif err != nil {\n\t\t\t\t\ttx.Rollback()\n\t\t\t\t\terr = errors.Wrapf(err, \"Failed to insert candidate %v\", m.Candidate)\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t}\n\t\tcase \"Company\":\n\t\t\tif m.JobCompany != nil {\n\t\t\t\tcompany := &joblistingPb.JobCompany{\n\t\t\t\t\tId: m.JobCompany.ID,\n\t\t\t\t\tName: m.JobCompany.Name,\n\t\t\t\t\tLogoUrl: m.JobCompany.LogoURL,\n\t\t\t\t\tSize: m.JobCompany.Size,\n\t\t\t\t}\n\t\t\t\tvar c *joblistingPb.JobCompany\n\t\t\t\tvar err error\n\t\t\t\tif m.JobCompany.ID == 0 {\n\t\t\t\t\treq := &joblistingPb.CreateJobCompanyRequest{\n\t\t\t\t\t\tCompany: company,\n\t\t\t\t\t}\n\t\t\t\t\tc, err = r.jlClient.LocalCreateCompany(ctx, req)\n\t\t\t\t} else {\n\t\t\t\t\treq := &joblistingPb.UpdateJobCompanyRequest{\n\t\t\t\t\t\tId: m.JobCompany.ID,\n\t\t\t\t\t\tCompany: company,\n\t\t\t\t\t}\n\t\t\t\t\tc, err = r.jlClient.LocalUpdateCompany(ctx, req)\n\t\t\t\t}\n\t\t\t\tif err != nil {\n\t\t\t\t\ttx.Rollback()\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tm.JobCompany = &models.JobCompany{\n\t\t\t\t\tID: c.Id,\n\t\t\t\t\tName: c.Name,\n\t\t\t\t\tLogoURL: c.LogoUrl,\n\t\t\t\t\tSize: c.Size,\n\t\t\t\t}\n\t\t\t\tm.JobCompanyID = c.Id\n\t\t\t}\n\t\tcase \"Admin\":\n\t\t\t// Do nothing\n\t\t}\n\t}\n\n\t_, err = tx.Model(m).\n\t\tRelation(relCandidate).Relation(relCandidateSkills).\n\t\tRelation(relCandidateAcademics).Relation(relCandidateAcademicsInstitution).Relation(relCandidateAcademicsCourse).\n\t\tRelation(relCandidateJobs).Relation(relCandidateJobsCompany).Relation(relCandidateJobsDepartment).\n\t\tReturning(\"*\").\n\t\tOnConflict(\"(auth_id) DO UPDATE\").\n\t\tSet(\"roles = EXCLUDED.roles, candidate_id = EXCLUDED.candidate_id, job_company_id = EXCLUDED.job_company_id\").\n\t\tInsert()\n\tif err != nil {\n\t\ttx.Rollback()\n\t\terr = errors.Wrapf(err, \"Failed to insert user %v\", m)\n\t\treturn nil, err\n\t}\n\n\tif err := tx.Commit(); err != nil {\n\t\treturn nil, err\n\t}\n\n\terr = r.updateAuth0User(m)\n\tif err != nil {\n\t\terr = errors.Wrapf(err, \"Failed to update auth0 user %v\", m.AuthID)\n\t\treturn nil, err\n\t}\n\n\terr = r.triggerCRMRegistrationWorkflow(m)\n\tif err != nil {\n\t\terr = errors.Wrapf(err, \"Failed to trigger CRM workflow %v\", m.Email)\n\t\treturn nil, err\n\t}\n\n\treturn m, nil\n}", "title": "" }, { "docid": "18bb0c9267f5534f101f775b5e28627f", "score": "0.5823218", "text": "func InitUser(ctx context.Context, ses *Session, tenant *TenantInfo, cu *tree.CreateUser) (err error) {\n\tvar exists int\n\tvar erArray []ExecResult\n\tvar newUserId int64\n\tvar host string\n\tvar newRoleId int64\n\tvar status string\n\tvar sql string\n\tvar mp *mpool.MPool\n\n\terr = normalizeNamesOfUsers(ctx, cu.Users)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif cu.Role != nil {\n\t\terr = normalizeNameOfRole(ctx, cu.Role)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tmp, err = mpool.NewMPool(\"init_user\", 0, mpool.NoFixed)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer mpool.DeleteMPool(mp)\n\n\tbh := ses.GetBackgroundExec(ctx)\n\tdefer bh.Close()\n\n\terr = bh.Exec(ctx, \"begin;\")\n\tdefer func() {\n\t\terr = finishTxn(ctx, bh, err)\n\t}()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t//TODO: get role and the id of role\n\tnewRoleId = publicRoleID\n\tif cu.Role != nil {\n\t\tsql, err = getSqlForRoleIdOfRole(ctx, cu.Role.UserName)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tbh.ClearExecResultSet()\n\t\terr = bh.Exec(ctx, sql)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\terArray, err = getResultSet(ctx, bh)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif !execResultArrayHasData(erArray) {\n\t\t\treturn moerr.NewInternalError(ctx, \"there is no role %s\", cu.Role.UserName)\n\t\t}\n\t\tnewRoleId, err = erArray[0].GetInt64(ctx, 0, 0)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfrom := &verifiedRole{\n\t\t\ttyp: roleType,\n\t\t\tname: cu.Role.UserName,\n\t\t}\n\n\t\tfor _, user := range cu.Users {\n\t\t\tto := &verifiedRole{\n\t\t\t\ttyp: userType,\n\t\t\t\tname: user.Username,\n\t\t\t}\n\t\t\terr = verifySpecialRolesInGrant(ctx, tenant, from, to)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\t//TODO: get password_option or lock_option. there is no field in mo_user to store it.\n\tstatus = userStatusUnlock\n\tif cu.MiscOpt != nil {\n\t\tif _, ok := cu.MiscOpt.(*tree.UserMiscOptionAccountLock); ok {\n\t\t\tstatus = userStatusLock\n\t\t}\n\t}\n\n\tfor _, user := range cu.Users {\n\t\t//dedup with user\n\t\tsql, err = getSqlForPasswordOfUser(ctx, user.Username)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tbh.ClearExecResultSet()\n\t\terr = bh.Exec(ctx, sql)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\terArray, err = getResultSet(ctx, bh)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\texists = 0\n\t\tif execResultArrayHasData(erArray) {\n\t\t\texists = 1\n\t\t}\n\n\t\t//dedup with the role\n\t\tif exists == 0 {\n\t\t\tsql, err = getSqlForRoleIdOfRole(ctx, user.Username)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tbh.ClearExecResultSet()\n\t\t\terr = bh.Exec(ctx, sql)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\terArray, err = getResultSet(ctx, bh)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif execResultArrayHasData(erArray) {\n\t\t\t\texists = 2\n\t\t\t}\n\t\t}\n\n\t\tif exists != 0 {\n\t\t\tif cu.IfNotExists { //do nothing\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif exists == 1 {\n\t\t\t\terr = moerr.NewInternalError(ctx, \"the user %s exists\", user.Username)\n\t\t\t} else if exists == 2 {\n\t\t\t\terr = moerr.NewInternalError(ctx, \"there is a role with the same name as the user\")\n\t\t\t}\n\n\t\t\treturn err\n\t\t}\n\n\t\tif user.AuthOption == nil {\n\t\t\treturn moerr.NewInternalError(ctx, \"the user %s misses the auth_option\", user.Username)\n\t\t}\n\n\t\tif user.AuthOption.Typ != tree.AccountIdentifiedByPassword {\n\t\t\treturn moerr.NewInternalError(ctx, \"only support password verification now\")\n\t\t}\n\n\t\tpassword := user.AuthOption.Str\n\t\tif len(password) == 0 {\n\t\t\treturn moerr.NewInternalError(ctx, \"password is empty string\")\n\t\t}\n\n\t\t//encryption the password\n\t\tencryption := HashPassWord(password)\n\n\t\t//TODO: get comment or attribute. there is no field in mo_user to store it.\n\t\thost = user.Hostname\n\t\tif len(user.Hostname) == 0 || user.Hostname == \"%\" {\n\t\t\thost = rootHost\n\t\t}\n\t\tinitMoUser1 := fmt.Sprintf(initMoUserWithoutIDFormat, host, user.Username, encryption, status,\n\t\t\ttypes.CurrentTimestamp().String2(time.UTC, 0), rootExpiredTime, rootLoginType,\n\t\t\ttenant.GetUserID(), tenant.GetDefaultRoleID(), newRoleId)\n\n\t\tbh.ClearExecResultSet()\n\t\terr = bh.Exec(ctx, initMoUser1)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t//query the id\n\t\tbh.ClearExecResultSet()\n\t\tsql, err = getSqlForPasswordOfUser(ctx, user.Username)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\terr = bh.Exec(ctx, sql)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\terArray, err = getResultSet(ctx, bh)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif !execResultArrayHasData(erArray) {\n\t\t\treturn moerr.NewInternalError(ctx, \"get the id of user %s failed\", user.Username)\n\t\t}\n\t\tnewUserId, err = erArray[0].GetInt64(ctx, 0, 0)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tinitMoUserGrant1 := fmt.Sprintf(initMoUserGrantFormat, newRoleId, newUserId, types.CurrentTimestamp().String2(time.UTC, 0), true)\n\t\terr = bh.Exec(ctx, initMoUserGrant1)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t//if it is not public role, just insert the record for public\n\t\tif newRoleId != publicRoleID {\n\t\t\tinitMoUserGrant2 := fmt.Sprintf(initMoUserGrantFormat, publicRoleID, newUserId, types.CurrentTimestamp().String2(time.UTC, 0), true)\n\t\t\terr = bh.Exec(ctx, initMoUserGrant2)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\treturn err\n}", "title": "" }, { "docid": "3cb4d312b390656b0b9e90f522c72a6c", "score": "0.58222103", "text": "func (m *PgModel) CreateUser(ctx context.Context, uid, role, email, firstname, lastname string) (*UsrJoinRow, error) {\n\t// 1. Look up the default price list\n\tvar priceListID int\n\tvar priceListUUID string\n\tq1 := \"SELECT id, uuid FROM price_list WHERE code = 'default'\"\n\terr := m.db.QueryRowContext(ctx, q1).Scan(&priceListID, &priceListUUID)\n\tif err == sql.ErrNoRows {\n\t\treturn nil, ErrDefaultPriceListNotFound\n\t}\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"postgres: query row context failed for q1=%q\", q1)\n\t}\n\n\tq2 := `\n\t\tINSERT INTO usr (\n\t\t uid, price_list_id, role, email, firstname, lastname\n\t\t) VALUES (\n\t\t $1, $2, $3, $4, $5, $6\n\t\t)\n\t\tRETURNING\n\t\t id, uuid, uid, price_list_id, role, email, firstname, lastname, created, modified\n\t`\n\tu := UsrJoinRow{}\n\terr = m.db.QueryRowContext(ctx, q2, uid, priceListID, role, email, firstname, lastname).Scan(\n\t\t&u.id, &u.UUID, &u.UID, &u.priceListID, &u.Role, &u.Email, &u.Firstname, &u.Lastname, &u.Created, &u.Modified)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"scan failed q2=%q\", q2)\n\t}\n\tu.PriceListUUID = priceListUUID\n\treturn &u, nil\n}", "title": "" }, { "docid": "998ab9ab61e88017e46b1d181a38af6e", "score": "0.58029544", "text": "func CreateRoleEndpoint(w http.ResponseWriter, r *http.Request) {\n\tvar role models.Role\n\tdecoder := json.NewDecoder(r.Body)\n\terr := decoder.Decode(&role)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), 400)\n\t\treturn\n\t}\n\n\troleExist := db.GetRoleByName(role.Name)\n\tif roleExist.Name != \"\" {\n\t\tmsg := \"Role already exist in the database\"\n\t\thttp.Error(w, msg, 400)\n\t\treturn\n\t}\n\n\trole.ID = primitive.NewObjectID()\n\n\tdb.CreateRole(role)\n\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tjson.NewEncoder(w).Encode(role)\n\n}", "title": "" }, { "docid": "f711a36cd040bcdf258dee39cc674ca3", "score": "0.5793172", "text": "func (store *Store) createAccount(username, password string, role portainer.UserRole) error {\n\tvar err error\n\tuser := &portainer.User{Username: username, Role: role}\n\n\t// encrypt the password\n\tcs := &crypto.Service{}\n\tuser.Password, err = cs.Hash(password)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = store.User().Create(user)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "1d1553da74253f39b6ba3ddcdf8fdbf2", "score": "0.57902884", "text": "func crearUsuario(w http.ResponseWriter, r *http.Request) {\n\n\tvar userx Usuario\n\t// Decode the incoming User json\n\terr := json.NewDecoder(r.Body).Decode(&userx)\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\treturn\n\t}\n\t// Validate the User entity\n\terr = validate(userx)\n\tuserx.Clave = \"********\"\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\treturn\n\t}\n\t// Insert User entity into User Store\n\tuserStore = append(userStore, userx)\n\tw.WriteHeader(http.StatusCreated)\n}", "title": "" }, { "docid": "df01cc07881344e472c081e799ab3567", "score": "0.57774204", "text": "func (r *UserAccountTable) Create(db Queryer) error {\n\terr := db.QueryRow(\n\t\t`INSERT INTO user_account (email, last_name, first_name) VALUES ($1, $2, $3) RETURNING id`,\n\t\t&r.Email, &r.LastName, &r.FirstName).Scan(&r.ID)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2bbf5f88471d170d5e896fd26054a0d7", "score": "0.5767204", "text": "func (q *UserClient) Create(username, password string) (user *UserForCreate, err error) {\n\tvar (\n\t\tpayload io.Reader\n\t\tcode int\n\t)\n\n\tif password == \"\" {\n\t\tpassword = util.GeneratePassword(8)\n\t}\n\n\tpayload, user = genSimpleUserAsPayload(username, password)\n\tcode, err = q.RequestWithoutData(http.MethodPost, \"/securityRealm/createAccountByAdmin\",\n\t\tmap[string]string{httpdownloader.ContentType: httpdownloader.ApplicationForm}, payload, 200)\n\tif code == 302 {\n\t\terr = nil\n\t}\n\treturn\n}", "title": "" }, { "docid": "c46346a54819198563a4d593ec8d04c7", "score": "0.5751859", "text": "func createUserId(c *gin.Context) {\n\tregisterBody := &typings.Registerbody{\n\t\tUsername: \"\",\n\t\tName: \"\",\n\t\tStudentId: \"\",\n\t\tMotto: \"\",\n\t\tPassword: \"\",\n\t\tBirthday: \"\",\n\t}\n\tif err := c.ShouldBindJSON(registerBody); err != nil {\n\t\t//400\n\t\tc.JSON(http.StatusBadRequest, gin.H{\n\t\t\t\"errMsg\": err.Error(),\n\t\t})\n\t\treturn\n\t}\n\tif userID, err := database.CreateUserIdByRegister(registerBody); err != nil {\n\t\t//409请求资源和当前状态存在冲突\n\t\tc.JSON(http.StatusConflict, gin.H{\n\t\t\t\"errMsg\": err.Error(),\n\t\t})\n\t} else {\n\t\t//201\n\t\tc.JSON(http.StatusCreated, gin.H{\n\t\t\t\"userid\": userID,\n\t\t})\n\t}\n}", "title": "" }, { "docid": "3f145dad9e8021ddea6bf573c9aea3f4", "score": "0.57457054", "text": "func CreateNewUser(w http.ResponseWriter, r *http.Request) {\n\n\tquery := `\n\t\tINSERT INTO authenticate_customuser(email, phone, password, is_active, date_joined, date_update, is_staff, email_confirm, agents_is_active, last_login, is_superuser)\n\t\tVALUES ($1,$2,$3, $4, $5, $6, $7, $8, $9, $10, $11)\n\t\tRETURNING id, email, phone, is_active, date_joined, date_update, is_staff, email_confirm, agents_is_active, last_login\n\t`\n\n\tdecoder := json.NewDecoder(r.Body)\n\tvar user StructCreateNewUser\n\terr := decoder.Decode(&user)\n\tobj := new(DetailUserDataJSONStruct) //user object\n\t// if err != nil {\n\t// \tlog.Println(err)\n\t// \tutl.JSONError(w, \"Structure of income JSON invalid!\", 400, false)\n\t// \treturn\n\t// }\n\tv := validate.Struct(user)\n\tif v.Validate() {\n\t\tlog.Println(&user)\n\n\t\tdata := utl.DB.QueryRow(\n\t\t\tquery, &user.Email, &user.Phone, &user.Password, &user.IsActive, time.Now().Format(time.RFC3339),\n\t\t\ttime.Now().Format(time.RFC3339), &user.IsStaff, &user.EmailConfirm, &user.AgentsIsActive,\n\t\t\ttime.Now().Format(time.RFC3339), &user.IsSuperuser).Scan(&obj.ID, &obj.Email, &obj.Phone, &obj.IsActive,\n\t\t\t&obj.DateJoined, &obj.DateUpdate, &user.IsStaff, &user.EmailConfirm, &obj.AgentsIsActive, &obj.LastLogin) //create user obj and return fields related to this instance\n\n\t\tif data != nil {\n\t\t\tlog.Println(\"Error\", err)\n\t\t} else {\n\t\t\tlog.Println(\"Log data\", &obj)\n\t\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\n\t\t\tjson.NewEncoder(w).Encode(&obj)\n\t\t\treturn\n\t\t}\n\t\t// w.Header().Set(\"Content-Type\", \"application/json\")\n\t\t// json.NewEncoder(w).Encode()\n\t} else {\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\tjson.NewEncoder(w).Encode(v.Errors)\n\t}\n\n}", "title": "" }, { "docid": "90eed2d0fe156d9f32e5ca1914275aa9", "score": "0.5742321", "text": "func (usr *User) CreateAccount(db *sql.DB) error {\r\n\r\n // to run on test table\r\n err := db.QueryRow(`INSERT INTO users(test) VALUES('{\"id\": ?,\"utype\": ?, \"gpsLong\": ?, \"gpsLat\": ?, \"points\": ?, \"time\": ?}')`, usr.id, usr.utype, usr.gpsLong, usr.gpsLat, usr.points, usr.time).Scan(&usr.id, &usr.utype, &usr.gpsLong, &usr.gpsLat, &usr.points, &usr.time)\r\n\r\n // to run on users table\r\n //err := db.QueryRow(`INSERT INTO users(data) VALUES('{\"id\": ?,\"utype\": ?, \"gpsLong\": ?, \"gpsLat\": ?, \"points\": ?, \"time\": ?}')`, usr.id, usr.utype, usr.gpsLong, usr.gpsLat, usr.points, usr.time).Scan(&usr.id, &usr.utype, &usr.gpsLong, &usr.gpsLat, &usr.points, &usr.time)\r\n\r\n if err != nil {\r\n return err\r\n }\r\n\r\n return nil\r\n}", "title": "" }, { "docid": "1728584e464ece960628e4004661859d", "score": "0.57406753", "text": "func (u UserCreate) Execute(user User, password string, authToken string) (ID string, error error) {\n\n\tbadRequest := user.Username == \"\" ||\n\t\tuser.Email == \"\" ||\n\t\tpassword == \"\" ||\n\t\tlen(user.Roles) == 0\n\n\tif badRequest {\n\t\treturn \"\", newBadRequestError(\"username, email, password, and role are required\")\n\t}\n\n\tif !validateEmail(user.Email) {\n\t\treturn \"\", newBadRequestError(\"email invalid\")\n\t}\n\n\terr := u.UsernameValidator.Validate(user.Username)\n\tif err != nil {\n\t\treturn \"\", newBadRequestError(err.Error())\n\t}\n\n\terr = u.PasswordValidator.Validate(password)\n\tif err != nil {\n\t\treturn \"\", newBadRequestError(err.Error())\n\t}\n\n\tif authToken != \"\" {\n\t\tauthUserID, err := u.TokenAuthenticate.Execute(authToken)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\n\t\tauthUser, err := u.UserRepo.Get(authUserID)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\n\t\tif !canAuthUserCreateUser(u.RoleConfigs, user, authUser) {\n\t\t\treturn \"\", newAuthorizationError(\"cannot create user with role\")\n\t\t}\n\t} else {\n\t\tfor _, r := range user.Roles {\n\t\t\trc := getRoleConfig(u.RoleConfigs, r)\n\n\t\t\tif !rc.Open {\n\t\t\t\treturn \"\", newAuthorizationError(\"cannot create user with role '\" + r + \"'\")\n\t\t\t}\n\t\t}\n\t}\n\n\tuser.UUID = uuid.New().String()\n\terr = u.UserRepo.Insert(user)\n\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"failed inserting user into db\")\n\t}\n\n\treturn user.UUID, nil\n}", "title": "" }, { "docid": "0b279d5334b97c48d02efa96cb5adc80", "score": "0.5740241", "text": "func (c *FakeClient) CreateRole(name, permissions string) (*Role, error) {\n\trole := Role{\n\t\tID: c.generateID(),\n\t\tName: name,\n\t\tPermissions: permissions,\n\t}\n\tc.OrganisationRoles = append(c.OrganisationRoles, role)\n\treturn &role, nil\n}", "title": "" }, { "docid": "340b2af3d958bc1d8435a0752b92b2a5", "score": "0.5720821", "text": "func (databaseService *DatabaseService) AddRole(roleName, description string) (role vars.Role, err error) {\n\tstmt, err := databaseService.Conn.Prepare(\"INSERT INTO `rbac_role` SET `name`= ?, description = ?\")\n\tif err != nil {\n\t\treturn role, err\n\t}\n\n\tresult, err := stmt.Exec(roleName, description)\n\tif err != nil {\n\t\treturn role, err\n\t}\n\n\tinsertId, err := result.LastInsertId()\n\tif err != nil {\n\t\treturn role, err\n\t}\n\n\trole.Id = int(insertId)\n\trole.Name = roleName\n\trole.Description = description\n\n\treturn role, nil\n}", "title": "" }, { "docid": "5288c9facc059de5bac6269a2b732ef1", "score": "0.5712104", "text": "func CreateUser(username, password, databaseName, databaseRole, environment string) (bool, error) {\n\tdeployment, err := GetDialInfo(environment)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tconnection, err := mgo.DialWithInfo(deployment)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tdbCollection := \"system.users\"\n\tusersData := connection.DB(\"admin\").C(dbCollection).Find(bson.M{})\n\tresult := make(map[string]interface{})\n\tuserItem := usersData.Iter()\n\tfound := false\n\tfor userItem.Next(result) && !found {\n\t\tif username == result[\"user\"] && result[\"db\"] == databaseName {\n\t\t\tfound = true\n\t\t}\n\t}\n\tif found {\n\t\treturn false, nil\n\t}\n\tinsertionUser := &mgo.User{Password: password, Username: username, Roles: []mgo.Role{mgo.Role(databaseRole)}}\n\terr = connection.DB(databaseName).UpsertUser(insertionUser)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\treturn true, nil\n}", "title": "" }, { "docid": "e759cf42d38b5ba45aef51d01c0295b6", "score": "0.5704855", "text": "func (s *Service) Create(ctx context.Context, f *Form, u *User) error {\n\tif err := s.Validater.Validate(ctx, f); err != nil {\n\t\treturn errors.Wrap(err, \"validater validate\")\n\t}\n\n\tif err := s.Repository.UniqueUsername(ctx, f.Username); err != nil {\n\t\treturn errors.Wrap(err, \"unique username\")\n\t}\n\n\tif err := s.Repository.UniqueEmail(ctx, f.Email); err != nil {\n\t\treturn errors.Wrap(err, \"unique email\")\n\t}\n\n\tpw, err := bcrypt.GenerateFromPassword([]byte(f.Password), bcrypt.DefaultCost)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"generating password hash\")\n\t}\n\n\tnu := NewUser{\n\t\tUsername: f.Username,\n\t\tEmail: f.Email,\n\t\tPasswordHash: string(pw),\n\t\tRoleID: f.RoleID,\n\t}\n\n\tif err := s.Repository.Create(ctx, &nu, u); err != nil {\n\t\treturn errors.Wrap(err, \"create user\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "9ab4c2f61c7e0f711496538c4d29611f", "score": "0.5687588", "text": "func (u *UserRepository) Create(ctx context.Context, user gosample.User) (int64, error) {\n\treturn 0, nil\n}", "title": "" }, { "docid": "ae07c2992a35638b357b9cee46d61f03", "score": "0.5679623", "text": "func CreateUser(w http.ResponseWriter, r *http.Request) {\n\n\tvar user User\n\n\tuser.Firstname = r.PostFormValue(\"first_name\")\n\tuser.Lastname = r.FormValue(\"last_name\")\n\tuser.Email = r.FormValue(\"email\")\n\tuser.Gender = r.FormValue(\"gender\")\n\n\t// Save to database\n\tsmt, err := db.Prepare(\"Insert into user(firstname, lastname, email, gender) values(?,?,?,?)\")\n\n\tif err != nil {\n\t\tfmt.Println(\"Prepare error\")\n\t\tpanic(err)\n\t}\n\n\t_, err = smt.Exec(user.Firstname, user.Lastname, user.Email, user.Gender)\n\n\tif err != nil {\n\t\tfmt.Println(\"me volvi a romper\")\n\t\tpanic(err)\n\t}\n\n\thttp.Redirect(w, r, \"/listUsers\", 301)\n\n}", "title": "" }, { "docid": "e673a65f17fd2d64894e98a867dc63ad", "score": "0.5676692", "text": "func AddRoleAction(c *gin.Context) {\n\tresult := render.NewResult()\n\tdefer c.JSON(http.StatusOK, result)\n\n\trole := &model.Role{}\n\tif err := c.BindJSON(role); nil != err {\n\t\tresult.Error(err)\n\n\t\treturn\n\t}\n\n\tsrv := service.FromContext(c)\n\tif err := srv.Roles.Create(c, role); nil != err {\n\t\tresult.Error(err)\n\t}\n}", "title": "" }, { "docid": "d7e33998bdf86241bb7196638046bff7", "score": "0.5667199", "text": "func (s Storer) Create(ctx context.Context, user authboss.User) error {\n\tusr := user.(*User)\n\tu := &User{}\n\n\tfindStatement := `SELECT * FROM users WHERE lower(email) = lower($1) OR name = $2`\n\terr := s.Db.Get(u, findStatement, usr.Email, usr.Name)\n\tif err != sql.ErrNoRows && err != nil {\n\t\treturn err\n\t}\n\tif u.ID != 0 {\n\t\treturn authboss.ErrUserFound\n\t}\n\n\t// Create user if OK\n\tinsertStatement := `INSERT INTO users (\n\t\tname,\n\t\temail,\n\t\tpassword,\n\t\tconfirmed,\n\t\tconfirm_selector,\n\t\tconfirm_verifier,\n\t\tupdated_at,\n\t\tcreated_at) VALUES\n\t\t (:name, lower(:email), :password, :confirmed, :confirm_selector, :confirm_verifier, NOW(), NOW())`\n\n\t_, err = s.Db.NamedExec(insertStatement,\n\t\tmap[string]interface{}{\n\t\t\t\"name\": usr.Name,\n\t\t\t\"email\": usr.Email,\n\t\t\t\"confirmed\": usr.Confirmed,\n\t\t\t\"password\": usr.Password,\n\t\t\t\"confirm_selector\": usr.ConfirmSelector,\n\t\t\t\"confirm_verifier\": usr.ConfirmVerifier,\n\t\t})\n\n\treturn err\n}", "title": "" }, { "docid": "2dfc0d9e5f3d042e0b3fd18cda85861b", "score": "0.56638014", "text": "func CreateAdmin(c *fiber.Ctx) error {\n\tif db.GetRoleFromToken(c.Locals(\"user\").(*jwt.Token)) != \"a\" {\n\t\treturn c.JSON(createAdminResponse{Error: 1})\n\t}\n\trequest := createAdminRequest{}\n\terr := c.BodyParser(&request)\n\tif err != nil {\n\t\treturn c.JSON(createAdminResponse{Error: 2})\n\t}\n\tif len(request.Username) < 5 {\n\t\treturn c.JSON(createAdminResponse{Error: 3})\n\t}\n\tif len(request.Password) < 8 {\n\t\treturn c.JSON(createAdminResponse{Error: 4})\n\t}\n\t// Add user to config\n\thash, err := bcrypt.GenerateFromPassword([]byte(request.Password), 7)\n\tif err != nil {\n\t\treturn c.SendStatus(500)\n\t}\n\t_, err = db.Db.Exec(\n\t\t\"insert into nusbiam.Users (user_id, password, role) VALUES (?,?,?)\",\n\t\tstrings.ToLower(request.Username),\n\t\tstring(hash),\n\t\t\"a\",\n\t)\n\tif err != nil {\n\t\tif strings.Contains(err.Error(),\"Error 1062\"){\n\t\t\treturn c.JSON(createUserResponse{Error: 5})\n\t\t}\n\t\treturn c.SendStatus(500)\n\t}\n\treturn c.JSON(createUserResponse{Error: -1})\n}", "title": "" }, { "docid": "3f1063cac656de5eacbff3a25d77ece5", "score": "0.56615007", "text": "func (db *UserUseCase) CreateAccount(user *models.UserPrivateInfo) (int, error) {\n\n\tvar (\n\t\tuserID int\n\t\terr error\n\t\ttx idb.TransactionI\n\t)\n\n\tif tx, err = db.Db.Begin(); err != nil {\n\t\treturn userID, err\n\t}\n\tdefer tx.Rollback()\n\n\tif userID, err = db.user.create(tx, user); err != nil {\n\t\treturn userID, err\n\t}\n\n\tif err = db.record.create(tx, userID); err != nil {\n\t\treturn userID, err\n\t}\n\n\terr = tx.Commit()\n\treturn userID, err\n}", "title": "" }, { "docid": "99a3d6ccf80d112aa68f218fd0c9daef", "score": "0.5659585", "text": "func (db Db) AddUser(login, email, hash string) (string, error) {\n\tvar id int\n\tvar err error\n\tif email == \"\" {\n\t\tquery := \"insert into users (login,hash,role_id) values ($1,$2,2) returning id;\"\n\t\terr = db.connection.QueryRow(db.context, query, login, hash).Scan(&id)\n\t} else {\n\t\tquery := \"insert into users (login,hash,role_id,email) values ($1,$2,2,$3) returning id;\"\n\t\terr = db.connection.QueryRow(db.context, query, login, hash, email).Scan(&id)\n\t}\n\tif err != nil {\n\t\tif err.Error() == `ERROR: duplicate key value violates unique constraint \"pk_users_login\" (SQLSTATE 23505)` {\n\t\t\treturn \"\", errors.New(\"User with this login already exists\")\n\t\t}\n\t\treturn \"\", err\n\t}\n\n\treturn strconv.Itoa(id), nil\n}", "title": "" }, { "docid": "2d3f50d1ee1f49312554b788320ceb94", "score": "0.5657869", "text": "func StoreUser(username string, password string, role string) (uuid string, err error) {\n\tuuid, err = randomstrings.GenerateRandomString(32)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// check to make sure our uuid is unique\n\tu := models.User{}\n\tfor u != users[uuid] {\n\t\tuuid, err = randomstrings.GenerateRandomString(32)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t}\n\n\t// generate the bcrypt password hash\n\tpasswordHash, hashErr := generateBcryptHash(password)\n\tif hashErr != nil {\n\t\terr = hashErr\n\t\treturn\n\t}\n\n\tusers[uuid] = models.User{username, passwordHash, role}\n\n\treturn uuid, err\n}", "title": "" }, { "docid": "145ee9b25829310e7e84c63a74380971", "score": "0.56535643", "text": "func createUser(userName string, identities []string, groups []string, h *helper.H) (*userv1.User, error) {\n\tuser := &userv1.User{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: userName,\n\t\t},\n\t\tIdentities: identities,\n\t\tGroups: groups,\n\t}\n\treturn h.User().UserV1().Users().Create(context.TODO(), user, metav1.CreateOptions{})\n}", "title": "" }, { "docid": "b7f3f7cb95c5f83dea6958684b96bb20", "score": "0.5648131", "text": "func (s Storer) Create(key string, attr authboss.Attributes) error {\n\tvar user models.User\n\tif err := attr.Bind(&user, true); err != nil {\n\t\treturn err\n\t}\n\n\treturn s.db.Create(&user).Error\n}", "title": "" }, { "docid": "f28def5011d481a6da05aee317222ab3", "score": "0.56438535", "text": "func (t *ACLUserRole) DBCreate(ctx context.Context, db DB) (sql.Result, error) {\n\tq := \"INSERT INTO `acl_user_role` (`acl_user_role`.`id`,`acl_user_role`.`checksum`,`acl_user_role`.`user_id`,`acl_user_role`.`role_id`,`acl_user_role`.`customer_id`,`acl_user_role`.`admin_user_id`,`acl_user_role`.`created_at`,`acl_user_role`.`updated_at`) VALUES (?,?,?,?,?,?,?,?)\"\n\tchecksum := t.CalculateChecksum()\n\tif t.GetChecksum() == checksum {\n\t\treturn nil, nil\n\t}\n\tt.Checksum = &checksum\n\treturn db.ExecContext(ctx, q,\n\t\torm.ToSQLString(t.ID),\n\t\torm.ToSQLString(t.Checksum),\n\t\torm.ToSQLString(t.UserID),\n\t\torm.ToSQLString(t.RoleID),\n\t\torm.ToSQLString(t.CustomerID),\n\t\torm.ToSQLString(t.AdminUserID),\n\t\torm.ToSQLInt64(t.CreatedAt),\n\t\torm.ToSQLInt64(t.UpdatedAt),\n\t)\n}", "title": "" }, { "docid": "7e1bff340d48daa645756cf53d02e13a", "score": "0.56422734", "text": "func CreateUserInDB(user request) string {\n\n\tvar id string\n\n\tdb, err := sql.Open(\"mssql\", dbconnection)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Holds the connection open until the surrounding function has finished executing\n\tdefer db.Close()\n\n\tdb.Query(\"USE antibuddies; GO\")\n\n\t// Execute db stored procedure to add a new user\n\t_, err = db.Query(`USE antibuddies; INSERT INTO Users (firstName, lastName, username, password, isAdmin) \n\t\t\t\t\t\t\t\t\t\t\t\t\tVALUES ('` + user.FirstName + `', '` + user.LastName + `', '` + user.Username + `', '` + user.PassHash + `', 0);`)\n\tif err != nil {\n\t\treturn \"Error in Adding Users\"\n\t}\n\n\t// Get the new UserID by matching on a unique combination of properties\n\terr = db.QueryRow(`USE antibuddies; SELECT user_id FROM dbo.Users WHERE username = '` + user.Username + `' AND password = '` + user.PassHash + `';`).Scan(&id)\n\tif err != nil {\n\t\treturn \"User created successfully but the ID request failed.\"\n\t}\n\n\t// Return new user's ID\n\treturn id\n}", "title": "" }, { "docid": "43adf7d01967061d4d4ec861e4beadfc", "score": "0.5641537", "text": "func createUser(w http.ResponseWriter, r *http.Request) {\n\n\tvar userData UserData\n\n\tdb := connectToDatabase()\n\tdefer db.Close()\n\n\terr := json.NewDecoder(r.Body).Decode(&userData)\n\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tuser := User{Name: userData.Name, Email: userData.Email}\n\n\t// Save new user in DB\n\tdb.Save(&user)\n\n\tjson.NewEncoder(w).Encode(user)\n\n}", "title": "" }, { "docid": "792bf2d37ea32b5a46db0335e21bd03b", "score": "0.56399655", "text": "func (u *ORM) Create(db *gorm.DB, usr model.Course) (user *model.Course, err error) {\n\n\tif err = db.Create(&usr).Error; err != nil {\n\t\terr = zaplog.ZLog(err)\n\t\treturn nil, err\n\t}\n\n\treturn &usr, nil\n}", "title": "" }, { "docid": "a991c174a942b4b64d5edfc168b74175", "score": "0.56349045", "text": "func (us *UserStore) Create(user *User) error {\n\tconst query = `INSERT INTO users (name, email) VALUES ($1, $2) RETURNING id`\n\terr := us.sql.QueryRow(query, user.Name, user.Email).Scan(&user.ID)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"psql: error creating new user\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6536164a189e79a958a1f71a6580212b", "score": "0.563246", "text": "func (r *UserRepository) Create(u *model.User) error {\n\tquery := `\n\t\tINSERT INTO restapi.users (\n\t\t\temail,\n\t\t\tencrypted_password\n\t\t) VALUES (\n\t\t\t$1,\n\t\t\t$2\n\t\t) RETURNING id\n\t`\n\n\tif err := u.Validate(); err != nil {\n\t\treturn err\n\t}\n\n\tif err := u.BeforeCreate(); err != nil {\n\t\treturn err\n\t}\n\n\tif err := r.store.db.QueryRow(\n\t\tquery,\n\t\tu.Email,\n\t\tu.EncryptedPassword,\n\t).Scan(&u.ID); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "f2d5bb5e09c023070df5eab261d49c1a", "score": "0.56309897", "text": "func (o *UCP) CreateTridentRole() (bool, error) {\n\n\tucpInfo, infoErr := o.GetInfo()\n\tif infoErr != nil {\n\t\treturn false, infoErr\n\t}\n\n\tucpTridentRoleName := defaultTridentRole\n\tjsonString := GetUCPRoleCreateJSON(ucpInfo.ServerVersion, ucpTridentRoleName)\n\n\t// verify what we have can be encoded into JSON\n\tucpRole := &UCPRole{}\n\tunmarshalError := json.Unmarshal([]byte(jsonString), ucpRole)\n\tif unmarshalError != nil {\n\t\treturn false, unmarshalError\n\t}\n\n\t_, err := o.client.PostForm(\"/roles\", jsonString)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\treturn true, nil\n}", "title": "" }, { "docid": "e6eb838fd466368a9fb6e571770325b9", "score": "0.56276834", "text": "func (r *mutationResolver) RoleCreate(ctx context.Context, input graphql.UpdateRole) (*db.Role, error) {\n\t// Create role\n\trole := &db.Role{}\n\n\tif input.Name != nil {\n\t\trole.Name = input.Name.String\n\t}\n\tif input.Permissions != nil {\n\t\tfor _, p := range input.Permissions {\n\t\t\tvalidPerm := false\n\t\t\tfor _, vp := range graphql.AllPerm {\n\t\t\t\tif p == vp.String() {\n\t\t\t\t\tvalidPerm = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !validPerm {\n\t\t\t\treturn nil, terror.New(fmt.Errorf(\"invalid permission\"), \"\")\n\t\t\t}\n\t\t}\n\t\trole.Permissions = input.Permissions\n\n\t\t// Prevent making roles equal to SUPERADMIN\n\t\tif len(role.Permissions) >= len(graphql.AllPerm) {\n\t\t\treturn nil, terror.New(terror.ErrUnauthorized, \"\")\n\t\t}\n\t}\n\n\t// get track actions\n\tvar errs []error\n\ttrackActions := db.TrackActionSlice{}\n\tif input.TrackActionIDs != nil && len(input.TrackActionIDs) > 0 {\n\t\ttrackActions, errs = r.TrackActionStore.GetMany(input.TrackActionIDs)\n\t\tif errs != nil {\n\t\t\treturn nil, terror.New(errs[0], \"create role\")\n\t\t}\n\t}\n\n\t// create\n\tcreated, err := r.RoleStore.Insert(role)\n\tif err != nil {\n\t\treturn nil, terror.New(err, \"create role\")\n\t}\n\n\t// set track actions\n\tif len(trackActions) > 0 {\n\t\terr = r.RoleStore.SetTrackActions(role, trackActions)\n\t\tif err != nil {\n\t\t\treturn nil, terror.New(err, \"set role track actions\")\n\t\t}\n\t}\n\n\tr.RecordUserActivity(ctx, \"Created Role\", graphql.ObjectTypeRole, &created.ID, &created.Name)\n\n\treturn created, nil\n}", "title": "" }, { "docid": "ec4e47025fa933d189d2f3a37dfe3d3d", "score": "0.56211925", "text": "func CreateUser(db *sql.DB, user entity.User) {\n\tstmt, err := db.Prepare(\"insert into public.\\\"users\\\" (id,name) values($1,$2)\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\t_, err = stmt.Exec(user.ID, user.Name)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t} else {\n\t\tlog.Println(\"insert into user_tbl success\")\n\t}\n}", "title": "" }, { "docid": "ef45dae2b8229dedd1060ecb7897ebba", "score": "0.56177074", "text": "func (u *User) Create(connection *sql.DB) error {\n\t_, err := connection.Exec(\"INSERT INTO users VALUES(?, ?, ?)\", u.ID, u.PasswordHash, u.Password)\n\treturn err\n}", "title": "" }, { "docid": "d4d4207c030929ec363fe8ef2241fb58", "score": "0.56034243", "text": "func (u *UsersRepos) Create(user entity.User, spheres []entity.Sphere, skills []entity.Skill, imageURL string) (int, error) {\n\tvar userID int\n\n\tquery := fmt.Sprintf(\"INSERT INTO %s \"+\n\t\t\"(first_name, last_name, birth_date, email, password_hash, in_search, registered_at, image_url) \"+\n\t\t\"values ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING id\",\n\t\tpostgres.UsersTable)\n\n\trow := u.db.QueryRow(query, user.FirstName, user.LastName, user.BirthDate, user.Email, user.Password, user.InSearch, user.RegisteredAt, imageURL)\n\n\tif err := row.Scan(&userID); err != nil {\n\t\treturn 0, errors.New(\"user already exists\")\n\t}\n\n\tfor _, sphere := range spheres {\n\t\tquery = fmt.Sprintf(\"INSERT INTO %s (user_id, sphere_id) VALUES ($1, $2)\", postgres.UsersSpheresTable)\n\t\t_, err := u.db.Exec(query, userID, sphere.ID)\n\t\tif err != nil {\n\t\t\tlogrus.Error(err)\n\t\t\tcontinue\n\t\t}\n\t}\n\n\tfor _, skill := range skills {\n\t\tquery = fmt.Sprintf(\"INSERT INTO %s (user_id, skill_id) VALUES ($1, $2)\", postgres.UsersSkillsTable)\n\t\t_, err := u.db.Exec(query, userID, skill.ID)\n\t\tif err != nil {\n\t\t\tlogrus.Error(err)\n\t\t\tcontinue\n\t\t}\n\t}\n\n\treturn userID, nil\n}", "title": "" }, { "docid": "8384ac58679866350050b3ecf4d0d07a", "score": "0.5603245", "text": "func Create(client *gophercloud.ServiceClient, opts CreateOpts) CreateResult {\n\ttype request struct {\n\t\tRole CreateOpts `json:\"role\"`\n\t}\n\n\treq := request{Role: opts}\n\n\tvar result CreateResult\n\t_, result.Err = client.Post(listURL(client), req, &result.Body, nil)\n\treturn result\n}", "title": "" }, { "docid": "6cee9b3a1703e97aa8be9117e2c54e4a", "score": "0.5601521", "text": "func (ur *UserRepository) Create(u *models.User) (*models.User, error) {\n\tquery := fmt.Sprintf(\"INSERT INTO %s (login, password) VALUES ($1, $2) RETURNING login\", tableUser)\n\trows, err := ur.store.db.Query(\n\t\tquery,\n\t\tu.Login,\n\t\tu.Password,\n\t)\n\tif err != nil {\n\t\tlog.Println(u, err)\n\t\treturn nil, err\n\t}\n\tdefer rows.Close()\n\treturn u, nil\n}", "title": "" }, { "docid": "9b36efbb8eb22fa4d1035e025c2c5887", "score": "0.56005853", "text": "func InsertTestcaseUser(ctx context.Context, db *sql.DB, data []map[string]interface{}) (rid int64, err error) {\n\treturn\n}", "title": "" }, { "docid": "ecb6ff8d4df453a7fb8db65cc2b4e34b", "score": "0.5599208", "text": "func (api *roleAPI) Create(obj *auth.Role) error {\n\tif api.ct.resolver != nil {\n\t\tapicl, err := api.ct.apiClient()\n\t\tif err != nil {\n\t\t\tapi.ct.logger.Errorf(\"Error creating API server clent. Err: %v\", err)\n\t\t\treturn err\n\t\t}\n\n\t\t_, err = apicl.AuthV1().Role().Create(context.Background(), obj)\n\t\tif err != nil && strings.Contains(err.Error(), \"AlreadyExists\") {\n\t\t\t_, err = apicl.AuthV1().Role().Update(context.Background(), obj)\n\n\t\t}\n\t\treturn err\n\t}\n\n\tapi.ct.handleRoleEvent(&kvstore.WatchEvent{Object: obj, Type: kvstore.Created})\n\treturn nil\n}", "title": "" }, { "docid": "4f17c94ed8508c5af7c922f20086617c", "score": "0.5595273", "text": "func (s *Service) Register(data *RegisterDTO) error {\n\thashedPassword, err := auth.Hash(data.Password)\n\tif err != nil {\n\t\treturn err\n\t}\n\tq := `INSERT INTO USERS (name, email, password, role) \n\t\t\t\tvalues (?, ?, ?, 2)` // default role is employeee\n\t_, err = s.DB.Conn.Exec(q, data.Name, data.Email, hashedPassword)\n\treturn err\n}", "title": "" }, { "docid": "fba37d6036b28b76d8f08d288a857255", "score": "0.5593708", "text": "func (ua *UserAccount) Create() error {\n\tdb := postgres.Db\n\tvar sqlInsertUser = \"INSERT INTO user_account\" +\n\t\t\"(phone,email, password, full_name, active, created_on, last_login)\" +\n\t\t\"VALUES ($1,$2,$3,$4,$5,$6,$7) RETURNING user_account_id;\"\n\n\terr := db.QueryRow(sqlInsertUser,\n\t\tua.Phone,\n\t\tua.Email,\n\t\tcrypt.HashPassword(ua.Password),\n\t\tua.FullName,\n\t\t//ua.Active,\n\t\tfalse,\n\t\ttime.Now(),\n\t\ttime.Now()).Scan(&ua.UserAccountID)\n\tif err != nil {\n\t\tlog.Println(\"Error creating user\")\n\t\tlog.Println(err)\n\t\treturn err\n\t}\n\n\treturn err\n}", "title": "" }, { "docid": "69f51a62c9585bf68f42ce2014a3a4f5", "score": "0.55916816", "text": "func CreateNewUser(newUser User) {\n\tconfig := LoadConfigurationFile(\"config.json\")\n\n\tdb, err := sql.Open(\"postgres\", config.DatabaseURI)\n\tif err != nil {\n\t\tlog.Fatal(\"Error while running sql.Open(): \", err)\n\t}\n\tdefer db.Close()\n\n\t// Begin a database transaction\n\ttx, err := db.Begin()\n\tif err != nil {\n\t\tlog.Fatal(\"Error in db.Being(): \", err)\n\t}\n\n\t// Prepare the statement\n\tstmt, err := tx.Prepare(\"INSERT INTO go_users (username, email, hash, bio, avatar_url, followers) VALUES ($1, $2, $3, $4, $5, $6)\")\n\tif err != nil {\n\t\tlog.Fatal(\"Error preparing statement: \", err)\n\t}\n\tdefer stmt.Close()\n\n\t// Execute the statement\n\t_, err = stmt.Exec(&newUser.Username, &newUser.Email, &newUser.Hash, &newUser.Bio, &newUser.AvatarURL, &newUser.Followers)\n\tif err != nil {\n\t\tlog.Fatal(\"Error executing statement: \", err)\n\t}\n\n\t// Commit the transaction\n\ttx.Commit()\n\n\t// Tell the User\n\tfmt.Println(\"New user added to database....\")\n\n\t// Update the Users slice\n\tGetUsers(db)\n}", "title": "" }, { "docid": "a76999667f3681c3df3dcc44c1713ce5", "score": "0.55906445", "text": "func (s *UserStorer) Create(ctx context.Context, user authboss.User) error {\n\treturn s.Save(ctx, user)\n}", "title": "" }, { "docid": "b577d16c22a750805a06fd4164673e75", "score": "0.5589725", "text": "func Create(context echo.Context) error{\n\tuser := new(models.User)\n\tdb := connections.GetConnection()\n\n\tif err := context.Bind(user); err != nil{\n\t\tlog.Printf(\"error: %s\", err)\n\n\t\treturn commons.DisplayMessage(\n\t\t\thttp.StatusBadRequest,\n\t\t\t\"La peticion no envio los parametros correctos para registrar el usuario\",\n\t\t\t\"no-content\",\n\t\t\tcontext,\n\t\t)\n\t}\n\n\tif user.Nombre == \"\" || user.Email == \"\" || user.Password == \"\" || user.Telefono == \"\"{\n\t\treturn commons.DisplayMessage(\n\t\t\thttp.StatusUnauthorized,\n\t\t\t\"El usuario que se desea registrar no envia datos importantes como el nombre,email, contraseña y telefono\",\n\t\t\t\"no-content\",\n\t\t\tcontext,\n\t\t)\n\t}\n\n\t// Encriptar contraseña\n\thash := sha256.Sum256([]byte(user.Password))\n\tpwd := fmt.Sprintf(\"%x\", hash )\n\tuser.Password = pwd\n\n\t// Crear registro\n\terr := db.Create(&user).Error\n\n\tif err != nil {\n\t\treturn commons.DisplayMessage(\n\t\t\thttp.StatusBadRequest,\n\t\t\t\"A ocurrido un error al momento de guardar el usuario: \\n Talvéz el email o el número de telefono que se envio ya estaba registrado\",\n\t\t\t\"no-content\",\n\t\t\tcontext,\n\t\t)\n\t}\n\n\treturn commons.DisplayMessage(\n\t\thttp.StatusCreated,\n\t\t\"El usuario fue creado exitosamente\",\n\t\t\"no-content\",\n\t\tcontext,\n\t)\n}", "title": "" }, { "docid": "88553c7a4a8e45a732225e561eb6c563", "score": "0.55860984", "text": "func (dynamo) CreateUser(email string, password string, token string) error {\n\tinput := &dynamodb.PutItemInput{\n\t\tConditionExpression: aws.String(\"attribute_not_exists(Email)\"),\n\t\tItem: map[string]*dynamodb.AttributeValue{\n\t\t\t\"Email\": {\n\t\t\t\tS: aws.String(email),\n\t\t\t},\n\t\t\t\"Password\": {\n\t\t\t\tS: aws.String(password),\n\t\t\t},\n\t\t\t\"SessionToken\": {\n\t\t\t\tS: aws.String(token),\n\t\t\t},\n\t\t\t// TODO: Remove this and dynamically create projects\n\t\t\t\"Projects\": {\n\t\t\t\tM: map[string]*dynamodb.AttributeValue{\n\t\t\t\t\t\"defaultProject\": {\n\t\t\t\t\t\tM: map[string]*dynamodb.AttributeValue{\n\t\t\t\t\t\t\t\"Id\": {S: aws.String(\"defaultProject\")},\n\t\t\t\t\t\t\t\"Name\": {S: aws.String(\"Default Project\")},\n\t\t\t\t\t\t\t\"Description\": {S: aws.String(defaultProjectDesc)},\n\t\t\t\t\t\t\t\"Objects\": {M: map[string]*dynamodb.AttributeValue{}},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTableName: aws.String(os.Getenv(\"TABLE_NAME\")),\n\t}\n\n\t_, err := putSvc.PutItem(input)\n\tif err != nil {\n\t\tif aerr, ok := err.(awserr.Error); ok {\n\t\t\tif aerr.Code() == dynamodb.ErrCodeConditionalCheckFailedException {\n\t\t\t\treturn errors.NewClient(\"Email already in use\")\n\t\t\t}\n\t\t}\n\t\treturn errors.Wrap(err, \"Failed DynamoDB PutItem call\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "57576dcb749b309eaee21be3e221d266", "score": "0.55794495", "text": "func CreateUser(writter http.ResponseWriter, request *http.Request) {\n\tvar usuario models.Usuario\n\thash := sha256.New()\n\terr := json.NewDecoder(request.Body).Decode(&usuario)\n\n\thash.Write([]byte(usuario.Clave))\n\tusuario.Clave = fmt.Sprintf(\"%x\", hash.Sum(nil))\n\n\tjson := simplejson.New()\n\tif err != nil {\n\t\tjson.Set(\"Exito\", false)\n\t\tjson.Set(\"Message\", err.Error())\n\t}\n\n\tuseStrings,userValues := utilities.ObjectFields(usuario)\n\n\tresult, err := utilities.InsertObject(\"Usuarios\", userValues, useStrings)\n\tif err != nil {\n\t\tjson.Set(\"Exito\", false)\n\t\tjson.Set(\"Message\", err.Error())\n\t}\n\n\tif result !=0{\n\t\tjson.Set(\"Exito\", true)\n\t\tjson.Set(\"Message\", \"Usuario Creado\")\n\t\tjson.Set(\"Id\", result)\n\t}\n\n\tpayload, err := json.MarshalJSON()\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\n\twritter.Header().Set(\"Content-Type\", \"application/json\")\n\twritter.Write(payload)\n\treturn\n}", "title": "" }, { "docid": "e9030d0ae836e8580d1485168aa3531e", "score": "0.5576199", "text": "func (a *ACLRoles) Create(role *ACLRole, w *WriteOptions) (*ACLRole, *WriteMeta, error) {\n\tif role.ID != \"\" {\n\t\treturn nil, nil, errors.New(\"cannot specify ACL role ID\")\n\t}\n\tvar resp ACLRole\n\twm, err := a.client.write(\"/v1/acl/role\", role, &resp, w)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treturn &resp, wm, nil\n}", "title": "" }, { "docid": "ee484f57a16d654efd66e4a656690207", "score": "0.5573945", "text": "func (u *User) Create() {\r\n\r\n\tu.MemberSince = time.Now().UTC()\r\n\tu.Admin = false\r\n\tdb.UsersBucket.Upsert(u.Username, u, 0)\r\n\tlog.Infof(\"User was created successefuly: %s\", u.Username)\r\n}", "title": "" }, { "docid": "a1a483466f5f883850fb135fcd40de2d", "score": "0.5561117", "text": "func (repo *UserRepoSqlite3) CreateUser(s *User) error {\n\n\tres, err := repo.insertStmt.Exec(s)\n\tif err == nil {\n\t\tvar id int64\n\t\tid, err = res.LastInsertId()\n\t\tif err == nil {\n\t\t\ts.ID = int(id)\n\t\t}\n\t}\n\treturn err\n}", "title": "" }, { "docid": "f070a4f31a904258db0846c88f5f5192", "score": "0.55495936", "text": "func (backend *JwtBackend) createRole(req *logical.Request, data *framework.FieldData) (*logical.Response, error) {\n\troleName := data.Get(\"name\").(string)\n\tif roleName == \"\" {\n\t\treturn logical.ErrorResponse(\"Role name not supplied\"), nil\n\t}\n\n\trole, err := backend.getRoleEntry(req.Storage, roleName)\n\tif err != nil {\n\t\treturn logical.ErrorResponse(\"Error reading role\"), err\n\t}\n\n\tvar secretEntry *secretStorageEntry\n\tsalt, _ := backend.Salt()\n\n\tif role == nil {\n\t\trole = new(RoleStorageEntry)\n\t\t// creating a new role\n\t\tif err := mapstructure.Decode(data.Raw, &role); err != nil {\n\t\t\treturn logical.ErrorResponse(\"creating role - Error decoding role\"), err\n\t\t}\n\n\t\t// set the role ID\n\t\troleID, _ := uuid.NewUUID()\n\t\trole.RoleID = roleID.String()\n\t\trole.HMAC = salt.GetHMAC(role.RoleID)\n\n\t\tsecretEntry, err = backend.createSecret(req.Storage, role.RoleID, role.TokenTTL)\n\t\tif err != nil {\n\t\t\treturn logical.ErrorResponse(fmt.Sprintf(\"Unable to create secret entry %#v\", err)), nil\n\t\t}\n\n\t\t// create the secret\n\t\tsecret := data.Get(\"secret\").(string)\n\t\tif secret != \"\" {\n\t\t\t// set the secret key to the specified key after its been encrypted\n\t\t\tsecretEntry.Key = salt.GetHMAC(secret)\n\t\t\t// remove the expiration on pre-set secrets\n\t\t\tsecretEntry.Expiration = time.Time{}\n\t\t\trole.SecretID = secretEntry.ID\n\t\t} else {\n\t\t\trole.SecretID = \"\"\n\t\t}\n\n\t\tbackend.setSecretEntry(req.Storage, secretEntry)\n\n\t} else {\n\t\t// update the role\n\t\tsecretEntry, err = backend.getSecretEntry(req.Storage, role.RoleID, role.SecretID)\n\t\tif err != nil {\n\t\t\treturn logical.ErrorResponse(fmt.Sprintf(\"Unable to retrieve secret entry %#v\", err)), nil\n\t\t}\n\n\t\tpolicies := data.Get(\"policies\").([]string)\n\t\tif len(policies) > 0 {\n\t\t\t// set the policies if they are provided\n\t\t\trole.Policies = policies\n\t\t}\n\n\t\tnamedClaims := data.Get(\"named_claims\").([]string)\n\t\tif len(namedClaims) > 0 {\n\t\t\trole.NamedClaims = namedClaims\n\t\t}\n\t}\n\n\t// if the user has a password we get the hmac and then save it\n\tpassword := data.Get(\"password\").(string)\n\tif password != \"\" {\n\t\tsecretEntry.Password = salt.GetHMAC(password)\n\t\tbackend.setSecretEntry(req.Storage, secretEntry)\n\t}\n\n\tif err := backend.setRoleEntry(req.Storage, *role); err != nil {\n\t\treturn logical.ErrorResponse(\"Error saving role\"), err\n\t}\n\n\troleDetails := map[string]interface{}{\n\t\t\"role_id\": role.RoleID,\n\t}\n\treturn &logical.Response{Data: roleDetails}, nil\n}", "title": "" }, { "docid": "6bb01e144f9ec7cd7190c9bd65dbae5a", "score": "0.55469036", "text": "func (s *Service) Create(ctx context.Context, u *User) (id string, err error) {\n\n\tuuid, err := uuid.NewRandom()\n\tif err != nil {\n\t\treturn\n\t}\n\tid = uuid.String()\n\n\tu.ID = id\n\tu.Created = time.Now().UTC().Unix()\n\n\tif err = s.repository.CreateUser(ctx, u); err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "331760d61cfc959d14996e20a010d996", "score": "0.5539199", "text": "func RepoCreateUser(t User) User {\n\t\n\tusers = append(users, t)\n\tname := t.Name\n\tfmt.Println(name)\n\tfmt.Println(t.Password)\n\t\n\tdb, err := sql.Open(\"mysql\", \"febin:hello123@tcp(127.0.0.1:3306)/testDb\")\n\tif err != nil {\n panic(err.Error())\n }\n defer db.Close()\n insert, err := db.Query(\"INSERT INTO user VALUES ( ? , SHA1(?) )\",t.Name,t.Password)\n if err != nil {\n panic(err.Error())\n }else{\n fmt.Println(\"Data added Successfully\\n\")\n }\n\tdefer insert.Close()\n\treturn t\n}", "title": "" }, { "docid": "b559ce2e85373b9ee38eae0d7af28a6d", "score": "0.55369276", "text": "func CreateTeacher(c *fiber.Ctx) error {\n\tif db.GetRoleFromToken(c.Locals(\"user\").(*jwt.Token)) != \"a\" {\n\t\treturn c.JSON(createAdminResponse{Error: 1})\n\t}\n\trequest := createTeacherRequest{}\n\tif err := c.BodyParser(&request); err != nil {\n\t\treturn c.JSON(createAdminResponse{Error: 2})\n\t}\n\tif len(request.Username) < 5 {\n\t\treturn c.JSON(createAdminResponse{Error: 3})\n\t}\n\tif len(request.Password) < 8 {\n\t\treturn c.JSON(createAdminResponse{Error: 4})\n\t}\n\thash, err := bcrypt.GenerateFromPassword([]byte(request.Password), 7)\n\tif err != nil {\n\t\treturn c.SendStatus(500)\n\t}\n\t_, err = db.Db.Exec(\n\t\t\"insert into Users (user_id, password, role) VALUES (?,?,?)\",\n\t\tstrings.ToLower(request.Username),\n\t\tstring(hash),\n\t\t\"t\",\n\t)\n\tif err != nil {\n\t\tif strings.Contains(err.Error(),\"Error 1062\"){\n\t\t\treturn c.JSON(createAdminResponse{Error: 5})\n\t\t}\n\t\treturn c.SendStatus(500)\n\t}\n\t_, err = db.Db.Exec(\"insert into nusbiam.Lecturers (lecturer_id,first_name,last_name,gender,dob,email,user_id)\"+\n\t\t\" value (?,?,?,?,?,?,?)\",\n\t\tuuid.New().String(), request.FirstName, request.LastName, request.Gender, request.Dob, request.Email, request.Username)\n\tif err!=nil{\n\t\treturn c.SendStatus(500)\n\t}\n\treturn c.JSON(createUserResponse{Error: -1})\n}", "title": "" }, { "docid": "085f9d77ec295ac1ba94eb105c4abd76", "score": "0.5535518", "text": "func CreateUser(login string, password string) (int, error) {\n\trows, err := db.Query(\"SELECT COUNT(*) FROM users WHERE login=$1 LIMIT 1;\", login)\n\tcheckErr(err)\n\tfor rows.Next() {\n\t\tvar userCount int\n\t\terr = rows.Scan(&userCount)\n\t\tcheckErr(err)\n\t\tif userCount != 0 {\n\t\t\treturn 0, errors.New(\"user already exists\")\n\t\t}\n\t}\n\n\thash, _ := hashPassword(password)\n\n\tvar lastInserted int\n\terr = db.QueryRow(\"INSERT INTO users(login,password) VALUES($1,$2) returning id;\", login, hash).Scan(&lastInserted)\n\tcheckErr(err)\n\n\treturn lastInserted, nil\n}", "title": "" }, { "docid": "3fc108ff81a866156f89bee3e035f528", "score": "0.55295444", "text": "func AddRole(w http.ResponseWriter, r *http.Request) {\n\tvar role_modification models.UserRoleModification\n\tjson.NewDecoder(r.Body).Decode(&role_modification)\n\n\tif role_modification.ID == \"\" {\n\t\terrors.WriteError(w, r, errors.MalformedRequestError(\"Must provide id parameter in request.\", \"Must provide id parameter in request.\"))\n\t\treturn\n\t}\n\n\terr := service.AddUserRole(role_modification.ID, role_modification.Role)\n\n\tif err != nil {\n\t\terrors.WriteError(w, r, errors.InternalError(err.Error(), \"Could not add user role.\"))\n\t\treturn\n\t}\n\n\troles, err := service.GetUserRoles(role_modification.ID, false)\n\n\tif err != nil {\n\t\terrors.WriteError(w, r, errors.InternalError(err.Error(), \"Could not get user's roles.\"))\n\t\treturn\n\t}\n\n\tupdated_roles := models.UserRoles{\n\t\tID: role_modification.ID,\n\t\tRoles: roles,\n\t}\n\n\tjson.NewEncoder(w).Encode(updated_roles)\n}", "title": "" }, { "docid": "e90fb794b6e08d532c269e39c841f675", "score": "0.55286443", "text": "func (o *orm) CreateUser(user *User) error {\n\tsql := \"INSERT INTO users (email, hashed_password, role, created_at, updated_at) VALUES ($1, $2, $3, now(), now()) RETURNING *\"\n\treturn o.q.Get(user, sql, strings.ToLower(user.Email), user.HashedPassword, user.Role)\n}", "title": "" }, { "docid": "d85f4795a57461aec477701abde4a8fd", "score": "0.55274415", "text": "func (user *User) AfterCreate(scope *gorm.Scope) error {\n\tif err := scope.DB().Table(\"role_user\").Create(struct {\n\t\tUserID uuid.UUID\n\t\tRoleID uuid.UUID\n\t}{\n\t\tUserID: user.ID,\n\t\tRoleID: uuid.FromStringOrNil(\"26841819-b845-4ecb-aa71-ebbbbfc60a6e\"),\n\t}).Error; err != nil {\n\t\treturn err\n\t}\n\tif user.Owner {\n\t\tif err := scope.DB().Table(\"role_user\").Create(struct {\n\t\t\tUserID uuid.UUID\n\t\t\tRoleID uuid.UUID\n\t\t}{\n\t\t\tUserID: user.ID,\n\t\t\tRoleID: uuid.FromStringOrNil(\"0109f277-66cd-46f0-9107-7aa4ecb2201d\"),\n\t\t}).Error; err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "76b84178446b1b0ce9002c4f9a90d1f6", "score": "0.5525004", "text": "func (user *User) Create() (err error) {\n\t// Postgres does not automatically return the last insert ID, because it would be wrong to assume\n\t// you're always using a sequence.You need to use the RETURNING keyword in your insert to get this\n\t// information from postgres.\n\terr = user.CheckIfExists()\n\tstatement := \"insert into users (uuid, username, email, password, created_at) values ($1, $2, $3, $4, $5) returning id, uuid, created_at\"\n\tstmt, err := Db.Prepare(statement)\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer stmt.Close()\n\n\t// use QueryRow to return a row and scan the returned ID into the User struct\n\terr = stmt.QueryRow(createUUID(), user.Username, user.Email, Encrypt(user.Password), time.Now()).Scan(&user.ID, &user.UUID, &user.CreatedAt)\n\tif err != nil {\n\t\treturn\n\t}\n\tl := LeaderBoardRow{}\n\terr = Db.QueryRow(\"INSERT INTO leaderboard (username, level, solve_time) values ($1,$2,$3) returning username, level\", user.Username, 0, time.Now()).Scan(&l.Username, &l.Level)\n\treturn\n}", "title": "" }, { "docid": "a06d553f95e22c26ea910ed375e625d6", "score": "0.5520102", "text": "func (c *Client) CreateRole(name, permissions string) (*Role, error) {\n\tdata := map[string]string{\"name\": name, \"permissions\": permissions}\n\tresp, err := c.SendPostRequest(\"/v2/roles\", data)\n\tif err != nil {\n\t\treturn nil, decodeError(err)\n\t}\n\n\trole := &Role{}\n\tif err := json.NewDecoder(bytes.NewReader(resp)).Decode(role); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn role, nil\n}", "title": "" }, { "docid": "5e93e020bf7206fa142d2632daeb4754", "score": "0.5519212", "text": "func manual_confirmation(ctx *iris.Context) {\n id, err := ctx.GetInt(\"userid\")\n userid := cast.ToUint(id)\n if err != nil {\n utils.WriteJSON(ctx, iris.StatusBadRequest, utils.Error(\"The userid is invalid\").Code(2145))\n return\n }\n user := &objects.User{}\n app.Database.Where(\"id = ?\", userid).First(user)\n if user.ID != userid {\n utils.WriteJSON(ctx, iris.StatusBadRequest, utils.Error(\"The userid is invalid\").Code(2145))\n return\n }\n\n // Everything is valid\n user.Confirmation = \"\"\n role := user.AddRole(user.Username)\n role.AddAbility(\"user-edit\")\n role.AddAbility(\"mods-add\")\n role.AddAbility(\"packs-add\")\n role.AddAbility(\"logged-in\")\n role.AddParam(\"user-edit\", \"userid\", strconv.Itoa(int(user.ID)))\n role.AddParam(\"mods-add\", \"gameshort\", \".*\")\n role.AddParam(\"packs-add\", \"gameshort\", \".*\")\n app.Database.Save(role)\n app.Database.Save(user)\n utils.WriteJSON(ctx, iris.StatusOK, iris.Map{\"error\": false})\n}", "title": "" }, { "docid": "42d6d0ad9b1ac8772757962b1c8d46ea", "score": "0.55184335", "text": "func CreateUser(username string, password string) error {\n\tdb := database.GetDB()\n\t// Insert処理\n\tdb.Create(&User{Username: username, Password: password})\n\treturn nil\n}", "title": "" } ]
10c0c6f3309c628ed30a58c44f45242b
Stat checks if we have anything waiting in stdin.
[ { "docid": "3a03dfadce91a91e4a050ca0a100c635", "score": "0.6465396", "text": "func Stat() bool {\n\tstat, err := os.Stdin.Stat()\n\tif err != nil || (stat.Mode()&os.ModeCharDevice) != 0 {\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" } ]
[ { "docid": "ff838efa5980f819920a03cdf2f182cb", "score": "0.6056147", "text": "func checkStdin(doneChan chan<- bool) {\n\tvar ch rune\n\tfmt.Scanf(\"%c\", &ch)\n\tdoneChan <- true\n}", "title": "" }, { "docid": "3e4a7fba1f813b0a479f88074ddab9fd", "score": "0.5897985", "text": "func WaitForStdin(v ...any) byte {\n\tif len(v) > 0 {\n\t\tfmt.Println(v...)\n\t}\n\tbuffer := make([]byte, 1)\n\t_, _ = os.Stdin.Read(buffer)\n\treturn buffer[0]\n}", "title": "" }, { "docid": "f9c8474271ee29147f96d8471f6b101a", "score": "0.5765882", "text": "func (p *pipe) inputWait() (int32, error) {\n\tfor {\n\t\tsafeFree := atomic.LoadInt32(&p.free)\n\n\t\t// If the buffer is full, spin lock to give it another chance\n\t\tfor i := 0; safeFree == 0 && i < maxSpin; i++ {\n\t\t\truntime.Gosched()\n\t\t\tsafeFree = atomic.LoadInt32(&p.free)\n\t\t}\n\t\t// If still full, go down into deep sleep\n\t\tif safeFree == 0 {\n\t\t\tselect {\n\t\t\tcase <-p.inWake: // wake signal from output, retry\n\t\t\t\tcontinue\n\n\t\t\tcase <-p.outQuit: // output dead, return\n\t\t\t\treturn safeFree, ErrClosedPipe\n\n\t\t\tcase <-p.inQuit: // input closed prematurely\n\t\t\t\treturn safeFree, ErrClosedPipe\n\t\t\t}\n\t\t}\n\t\treturn safeFree, nil\n\t}\n}", "title": "" }, { "docid": "42cf08e0a0aa3dac7afc4b6ab735e627", "score": "0.5748841", "text": "func (io IOHarness) Poll() (int64, bool) {\n\tselect {\n\tcase i := <-io.in:\n\t\treturn i, true\n\tdefault:\n\t\treturn 0, false\n\t}\n}", "title": "" }, { "docid": "cff8d6a9f4938cc3314367378005c5f1", "score": "0.5735639", "text": "func stdinValidates(stdin *os.File) bool {\n\tf, err := stdin.Stat()\n\tif err != nil { // unable to obtain file data with Stat() method call = fail\n\t\treturn false\n\t}\n\n\tsize := f.Size()\n\tif size == 0 { // there does not appear to be any data in the stdin stream = fail\n\t\treturn false\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "1ef6cfc35620494b3c5b32935e98c3e0", "score": "0.5716534", "text": "func CheckSTDIN() error {\n\tstat, err := os.Stdin.Stat()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error with STDIN\")\n\t}\n\tif (stat.Mode() & os.ModeNamedPipe) == 0 {\n\t\treturn fmt.Errorf(\"no STDIN found\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "24f01af428b42be6daf6d456b127815e", "score": "0.5661013", "text": "func HasStdin() bool {\n\tstat, err := os.Stdin.Stat()\n\tif err != nil {\n\t\treturn false\n\t}\n\n\tmode := stat.Mode()\n\n\tisPipedFromChrDev := (mode & os.ModeCharDevice) == 0\n\tisPipedFromFIFO := (mode & os.ModeNamedPipe) != 0\n\n\treturn isPipedFromChrDev || isPipedFromFIFO\n}", "title": "" }, { "docid": "24f01af428b42be6daf6d456b127815e", "score": "0.5661013", "text": "func HasStdin() bool {\n\tstat, err := os.Stdin.Stat()\n\tif err != nil {\n\t\treturn false\n\t}\n\n\tmode := stat.Mode()\n\n\tisPipedFromChrDev := (mode & os.ModeCharDevice) == 0\n\tisPipedFromFIFO := (mode & os.ModeNamedPipe) != 0\n\n\treturn isPipedFromChrDev || isPipedFromFIFO\n}", "title": "" }, { "docid": "5925b2609c4e7ee95a0c7e73520331bc", "score": "0.55799985", "text": "func (pts *pseudoTtys) isLastStdin(session uint64) bool {\n\tvar count int\n\n\tpts.lock.Lock()\n\tif ta, ok := pts.ttys[session]; ok {\n\t\tfor _, tty := range ta.attachments {\n\t\t\tif tty.Stdin != nil {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t}\n\tpts.lock.Unlock()\n\treturn count == 1\n}", "title": "" }, { "docid": "8e39599fd107416b58e980d1e875aeb2", "score": "0.5494338", "text": "func GetStdin() bool {\n\treturn nstdout\n}", "title": "" }, { "docid": "49a7309b80367de81b3d9999c62f383a", "score": "0.54875743", "text": "func watchForConsoleInput(conn net.Conn) {\n reader := bufio.NewReader(os.Stdin)\n\n for true {\n message, err := reader.ReadString('\\n')\n util.CheckForError(err, \"Lost console connection\")\n\n message = strings.TrimSpace(message)\n if (message != \"\") {\n command := parseInput(message)\n\n if (command.Command == \"\") {\n // there is no command so treat this as a simple message to be sent out\n sendCommand(\"message\", message, conn);\n } else {\n switch command.Command {\n\n // enter a room\n case \"enter\":\n sendCommand(\"enter\", command.Body, conn)\n\n // ignore someone\n case \"ignore\":\n sendCommand(\"ignore\", command.Body, conn)\n\n // leave a room\n case \"leave\":\n // leave the current room (we aren't allowing multiple rooms)\n sendCommand(\"leave\", \"\", conn)\n\n // disconnect from the chat server\n case \"disconnect\":\n sendCommand(\"disconnect\", \"\", conn)\n\n default:\n fmt.Printf(\"Unknown command \\\"%s\\\"\\n\", command.Command)\n }\n }\n }\n }\n}", "title": "" }, { "docid": "e86126b4a3ae2041c421316a94055643", "score": "0.5365354", "text": "func IsInputFromPipe() bool {\n\tfileInfo, _ := os.Stdin.Stat()\n\treturn fileInfo.Mode()&os.ModeCharDevice == 0\n}", "title": "" }, { "docid": "9439e121dc8af35d7a737c52f2b10b45", "score": "0.52932584", "text": "func supportsStdin() bool {\n\tfileInfo, err := os.Stdin.Stat()\n\tif err != nil {\n\t\treturn false\n\t}\n\treturn fileInfo.Mode()&(os.ModeCharDevice|os.ModeCharDevice) != 0\n}", "title": "" }, { "docid": "71138917868b6797e1422dbc92329c58", "score": "0.5257321", "text": "func isStdIO(reader io.Reader) bool {\n\treturn reader == os.Stdin || reader == os.Stdout || reader == os.Stderr\n}", "title": "" }, { "docid": "d9b1af8a993939c068d524fa9d500b49", "score": "0.5205895", "text": "func readStdin(out chan<- []byte) {\n\t//* copies some data from Stdin into data. Note that File.Read blocks until it receives data\n\tfor {\n\t\tdata := make([]byte, 1024)\n\t\tl, _ := os.Stdin.Read(data)\n\t\tif l > 0 {\n\t\t\t//* sends the buffered data over the channel\n\t\t\tout <- data\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f5cb6bf1adac0ef40877770fb2d15912", "score": "0.5198544", "text": "func StdinPiped() (bool, error) {\n\tfi, err := os.Stdin.Stat()\n\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\treturn fi.Mode()&os.ModeCharDevice == 0, nil\n}", "title": "" }, { "docid": "2484f39932d8f97fed0e4261a08fb2b7", "score": "0.5193219", "text": "func InputFunctionReturnsTrueAndNil(t *testing.T) {\n\terr := WaitFor(fiveMillisecond, oneMillisecond, func() (bool, error) {\n\t\ttime.Sleep(twoMillisecond)\n\t\treturn true, nil\n\t})\n\tassert.NotEqual(t, err, nil)\n\tassert.Equal(t, 0, strings.Compare(err.Error(), timeoutErrMsg))\n}", "title": "" }, { "docid": "31db9675d09d522c5c338c94ee8350f2", "score": "0.515039", "text": "func waitForInput(pipe chan string) {\n\tvar line string\n\tvar err error\n\n\tbuf := bufio.NewReader(os.Stdin)\n\n\tfor {\n\t\tfmt.Print(\"Enter a string (or \\\"exit\\\" to quit): \")\n\t\tline, err = buf.ReadString('\\n')\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t\treturn\n\t\t}\n\n\t\t// Send the string that was entered to the other goroutine\n\t\tpipe <- line\n\n\t\tif line == \"exit\\n\" {\n\t\t\t// Close the pipe on exit to avoid a deadlock\n\t\t\tclose(pipe)\n\t\t\tbreak\n\t\t}\n\n\t\t// Sleep for a 500ms to allow the other go routine print the string\n\t\ttime.Sleep(500 + time.Millisecond)\n\t}\n}", "title": "" }, { "docid": "de95d33de8640d4ed52e0c233328b523", "score": "0.51006645", "text": "func stdin(c chan<- string, mf string) {\n\tdefer close(c)\n\tscanner := bufio.NewScanner(os.Stdin)\n\tlog.Printf(\"Ready.\")\n\tfor scanner.Scan() {\n\t\tc <- mf + scanner.Text()\n\t}\n\tif err := scanner.Err(); err != nil {\n\t\tlog.Fatalf(\"Read error: %v\", err)\n\t}\n}", "title": "" }, { "docid": "c6189011281ccfec3e630fdc2f2026a1", "score": "0.50991434", "text": "func (r *terminal) Monitor(ctx context.Context) {\n\tif r == nil {\n\t\treturn\n\t}\n\tin := bufio.NewReader(stdin)\n\tfor {\n\t\tchar, err := in.ReadByte()\n\t\tif err != nil {\n\t\t\tlog.Warnf(\"failed to read input: %v\", err)\n\t\t\treturn\n\t\t}\n\t\tlog.Debugf(\"received byte %v (%v)\", char, string(char))\n\n\t\tchResume := make(chan struct{})\n\t\tswitch char {\n\t\tcase 'r':\n\t\t\tr.ch <- Event{resume: chResume, useLastPath: true}\n\t\tcase 'd':\n\t\t\tr.ch <- Event{resume: chResume, useLastPath: true, Debug: true}\n\t\tcase 'a':\n\t\t\tr.ch <- Event{resume: chResume, PkgPath: \"./...\"}\n\t\tcase 'l':\n\t\t\tr.ch <- Event{resume: chResume, reloadPaths: true}\n\t\tcase 'u':\n\t\t\tr.ch <- Event{resume: chResume, useLastPath: true, Args: []string{\"-update\"}}\n\t\tcase '\\n':\n\t\t\tfmt.Println()\n\t\t\tcontinue\n\t\tdefault:\n\t\t\tcontinue\n\t\t}\n\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn\n\t\tcase <-chResume:\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4fc0d679867805b367b0e40bb39671b2", "score": "0.50982505", "text": "func waitForExit() {\n\tbuf := bufio.NewReader(os.Stdin)\n\tbuf.ReadBytes('\\n')\n}", "title": "" }, { "docid": "6d8f289853e2e0c2001f423da88826b7", "score": "0.50878936", "text": "func IsStdin(r io.Reader) bool {\n\tif f, ok := r.(*os.File); ok {\n\t\treturn f.Fd() == uintptr(syscall.Stdin)\n\t}\n\treturn false\n}", "title": "" }, { "docid": "99bf22021bbda4017e15397de25f9f71", "score": "0.50866807", "text": "func (p *Port) InWaiting() (int, error) {\n\t// Funky time\n\tvar waiting int\n\terr := ioctl(unix.TIOCINQ, p.fd, uintptr(unsafe.Pointer(&waiting)))\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn waiting, nil\n}", "title": "" }, { "docid": "fba77c3aa82eb77276423a1f10ae1d2b", "score": "0.5062171", "text": "func LooksLikeStdin(s string) bool {\n\treturn !(FileExists(s) || IsDir(s))\n}", "title": "" }, { "docid": "ab6dcc62e847fd64bc31cb26c45f685a", "score": "0.49872613", "text": "func IsPipedInput() bool {\n\tfi, _ := os.Stdin.Stat()\n\n\treturn fi.Mode()&os.ModeNamedPipe != 0\n}", "title": "" }, { "docid": "050e8621e8be73096f0e6759a845c39e", "score": "0.49573034", "text": "func (q *queue) readReadiness(t *linux.KernelTermios) waiter.EventMask {\n\tq.mu.Lock()\n\tdefer q.mu.Unlock()\n\tif q.readBuf.Len() > 0 && q.readable {\n\t\treturn waiter.EventIn\n\t}\n\treturn waiter.EventMask(0)\n}", "title": "" }, { "docid": "0ed2c15ca4dc44f94716f22a2b2ad2f9", "score": "0.4921388", "text": "func waitForuserInput(scanner bufio.Scanner) {\n\tenter := \"wait for user\"\n\tfor enter != \"\" {\n\t\tfmt.Printf(\"\\nPlease press enter to continue: \")\n\t\tenter = scanWithValidation(scanner)\n\t}\n}", "title": "" }, { "docid": "d8ef86d5fa86b107ab899cd532b23962", "score": "0.48997042", "text": "func CheckInput(sc ServerConfig) {\n\tfor {\n\t\tenvelope, ok := <-sc.Input\n\t\tif !ok {\n\t\t\tpanic(\"channels closed..\")\n\t\t}\n\t\tfmt.Printf(\"Received msg from %d to %d\\n\", envelope.SendBy, envelope.SendTo)\n\t\tsc.N_msgRcvd++\n\t}\n}", "title": "" }, { "docid": "a97ad10803f29440eb4561b6f30163dd", "score": "0.4847478", "text": "func InputFunctionReturnsFalseAndNil(t *testing.T) {\n\terr := WaitFor(fiveMillisecond, oneMillisecond, func() (bool, error) {\n\t\ttime.Sleep(twoMillisecond)\n\t\treturn false, nil\n\t})\n\tassert.Equal(t, err, nil)\n}", "title": "" }, { "docid": "e5b28f1a68d9e36194ec459c9d813be3", "score": "0.48384202", "text": "func (s *BaseAmbigListener) EnterStat(ctx *StatContext) {}", "title": "" }, { "docid": "54f0846bc7e15589b91302d70cdec986", "score": "0.4823918", "text": "func readStdin() (count int, err error) {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tfor scanner.Scan() {\n\t\tvar p Policy\n\t\tline := []byte(strings.Trim(scanner.Text(), \"\\r\\n\"))\n\t\tfields := strings.Fields(string(line))\n\t\tminmax := strings.Split(fields[0], \"-\")\n\t\tp.min, err = strconv.Atoi(minmax[0])\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tp.min -= 1\n\t\tp.max, err = strconv.Atoi(minmax[1])\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tp.max -= 1\n\t\tp.char = fields[1][0]\n\t\tpassword := fields[2]\n\t\tif p.Complies(password) {\n\t\t\tcount++\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "fdb046bb021d2c59e3b02df2f0d9eef0", "score": "0.48122442", "text": "func (q *Queue) Stat(ctx context.Context) (*linux.MsqidDS, error) {\n\treturn q.stat(ctx, vfs.MayRead)\n}", "title": "" }, { "docid": "5185775d94d3cfe6444b63677ab647c3", "score": "0.4800145", "text": "func (t *Tail) Scan() bool {\n\tvar err error\n\tif t.done {\n\t\treturn false\n\t}\n\tif t.init {\n\t\t// there is no pos file Start reading from the end of the file\n\t\tif t.InitialReadPositionEnd && t.isCreatePosFile {\n\t\t\tt.fileFd.Seek(0, os.SEEK_END)\n\t\t}\n\t\tt.data = make(chan []byte, 1)\n\t\tt.scanner = bufio.NewScanner(t.fileFd)\n\t\tt.init = false\n\t}\n\n\tfor {\n\t\tif t.scanner.Scan() {\n\t\t\tt.data <- t.scanner.Bytes()\n\t\t\treturn true\n\t\t}\n\n\t\tif err := t.scanner.Err(); err != nil {\n\t\t\tt.err = err\n\t\t\treturn false\n\t\t}\n\n\t\tt.Stat.Offset, err = t.fileFd.Seek(0, os.SEEK_CUR)\n\t\tif err != nil {\n\t\t\tt.err = err\n\t\t\treturn false\n\t\t}\n\n\t\tfd, err := os.Open(t.file)\n\t\tif os.IsNotExist(err) {\n\t\t\ttime.Sleep(time.Millisecond * 10)\n\t\t} else if err != nil {\n\t\t\tt.err = err\n\t\t\treturn false\n\t\t}\n\t\tfdStat, err := fd.Stat()\n\t\tif err != nil {\n\t\t\tt.err = err\n\t\t\treturn false\n\t\t}\n\t\tstat := fdStat.Sys().(*syscall.Stat_t)\n\t\tif stat.Ino != t.Stat.Inode {\n\t\t\tt.Stat.Inode = stat.Ino\n\t\t\tt.Stat.Offset = 0\n\t\t\tt.Stat.Size = stat.Size\n\t\t\tt.fileFd.Close()\n\t\t\tt.fileFd = fd\n\t\t} else {\n\t\t\tif stat.Size < t.Stat.Size {\n\t\t\t\tt.fileFd.Seek(0, os.SEEK_SET)\n\t\t\t}\n\t\t\tt.Stat.Size = stat.Size\n\t\t\ttime.Sleep(time.Millisecond * 10)\n\t\t\tfd.Close()\n\t\t}\n\t\tt.scanner = bufio.NewScanner(t.fileFd)\n\n\t\terr = posUpdate(t)\n\t\tif err != nil {\n\t\t\tt.err = err\n\t\t\treturn false\n\t\t}\n\t}\n}", "title": "" }, { "docid": "34ba98ff271dabf521821bb0727e0741", "score": "0.47980407", "text": "func detectInput() (io.Reader, error) {\n\tstats, err := os.Stdin.Stat()\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"file.Stat() in detectInput\")\n\t}\n\n\tif stats.Mode()&os.ModeNamedPipe != 0 {\n\t\treturn os.Stdin, nil\n\t}\n\tif len(flag.Args()) < 1 {\n\t\treturn nil, errors.New(\"No inputs found\")\n\t}\n\tif len(flag.Args()) > 1 {\n\t\treturn nil, errors.Errorf(\"Multiple input files is not supported. Your choise is '%v'\", flag.Args()[1:])\n\t}\n\tf, err := os.Open(flag.Args()[0])\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"Coudn't open file\")\n\t}\n\treturn f, nil\n}", "title": "" }, { "docid": "31498d657c42ffcb45f047f22c6792a4", "score": "0.47692272", "text": "func waitForStart(server *Server) {\n\treader := bufio.NewReader(os.Stdin)\n\ttext, _ := reader.ReadString('\\n')\n\tfmt.Println(\"IS start exec :: \", text)\n\tserver.executor.summary.startTime = time.Now().UnixNano()\n\tif text == \"start\\n\" {\n\t\tcmd := pb.ExecutionCommand{\n\t\t\tType: startExec,\n\t\t}\n\t\tfor clinetID := range server.clientStreams {\n\t\t\tserver.sendCommand(clinetID, &cmd)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "67ace81f962636234dc0c57c7cd86069", "score": "0.47643185", "text": "func (c *actionTests) STDPipe(t *testing.T) {\n\te2e.EnsureImage(t, c.env)\n\n\tstdinTests := []struct {\n\t\tname string\n\t\tcommand string\n\t\targv []string\n\t\tinput string\n\t\texit int\n\t}{\n\t\t{\n\t\t\tname: \"TrueSTDIN\",\n\t\t\tcommand: \"exec\",\n\t\t\targv: []string{c.env.ImagePath, \"grep\", \"hi\"},\n\t\t\tinput: \"hi\",\n\t\t\texit: 0,\n\t\t},\n\t\t{\n\t\t\tname: \"FalseSTDIN\",\n\t\t\tcommand: \"exec\",\n\t\t\targv: []string{c.env.ImagePath, \"grep\", \"hi\"},\n\t\t\tinput: \"bye\",\n\t\t\texit: 1,\n\t\t},\n\t\t{\n\t\t\tname: \"TrueLibrary\",\n\t\t\tcommand: \"shell\",\n\t\t\targv: []string{\"library://busybox\"},\n\t\t\tinput: \"true\",\n\t\t\texit: 0,\n\t\t},\n\t\t{\n\t\t\tname: \"FalseLibrary\",\n\t\t\tcommand: \"shell\",\n\t\t\targv: []string{\"library://busybox\"},\n\t\t\tinput: \"false\",\n\t\t\texit: 1,\n\t\t},\n\t\t{\n\t\t\tname: \"TrueDocker\",\n\t\t\tcommand: \"shell\",\n\t\t\targv: []string{\"docker://busybox\"},\n\t\t\tinput: \"true\",\n\t\t\texit: 0,\n\t\t},\n\t\t{\n\t\t\tname: \"FalseDocker\",\n\t\t\tcommand: \"shell\",\n\t\t\targv: []string{\"docker://busybox\"},\n\t\t\tinput: \"false\",\n\t\t\texit: 1,\n\t\t},\n\t\t// TODO(mem): reenable this; disabled while shub is down\n\t\t// {\n\t\t// \tname: \"TrueShub\",\n\t\t// \tcommand: \"shell\",\n\t\t// \targv: []string{\"shub://singularityhub/busybox\"},\n\t\t// \tinput: \"true\",\n\t\t// \texit: 0,\n\t\t// },\n\t\t// TODO(mem): reenable this; disabled while shub is down\n\t\t// {\n\t\t// \tname: \"FalseShub\",\n\t\t// \tcommand: \"shell\",\n\t\t// \targv: []string{\"shub://singularityhub/busybox\"},\n\t\t// \tinput: \"false\",\n\t\t// \texit: 1,\n\t\t// },\n\t}\n\n\tvar input bytes.Buffer\n\n\tfor _, tt := range stdinTests {\n\t\tc.env.RunSingularity(\n\t\t\tt,\n\t\t\te2e.AsSubtest(tt.name),\n\t\t\te2e.WithProfile(e2e.UserProfile),\n\t\t\te2e.WithCommand(tt.command),\n\t\t\te2e.WithArgs(tt.argv...),\n\t\t\te2e.WithStdin(&input),\n\t\t\te2e.PreRun(func(t *testing.T) {\n\t\t\t\tinput.WriteString(tt.input)\n\t\t\t}),\n\t\t\te2e.ExpectExit(tt.exit),\n\t\t)\n\t\tinput.Reset()\n\t}\n\n\tuser := e2e.CurrentUser(t)\n\tstdoutTests := []struct {\n\t\tname string\n\t\tcommand string\n\t\targv []string\n\t\toutput string\n\t\texit int\n\t}{\n\t\t{\n\t\t\tname: \"AppsFoo\",\n\t\t\tcommand: \"run\",\n\t\t\targv: []string{\"--app\", \"foo\", c.env.ImagePath},\n\t\t\toutput: \"RUNNING FOO\",\n\t\t\texit: 0,\n\t\t},\n\t\t{\n\t\t\tname: \"PwdPath\",\n\t\t\tcommand: \"exec\",\n\t\t\targv: []string{\"--pwd\", \"/etc\", c.env.ImagePath, \"pwd\"},\n\t\t\toutput: \"/etc\",\n\t\t\texit: 0,\n\t\t},\n\t\t{\n\t\t\tname: \"Arguments\",\n\t\t\tcommand: \"run\",\n\t\t\targv: []string{c.env.ImagePath, \"foo\"},\n\t\t\toutput: \"Running command: foo\",\n\t\t\texit: 127,\n\t\t},\n\t\t{\n\t\t\tname: \"Permissions\",\n\t\t\tcommand: \"exec\",\n\t\t\targv: []string{c.env.ImagePath, \"id\", \"-un\"},\n\t\t\toutput: user.Name,\n\t\t\texit: 0,\n\t\t},\n\t}\n\tfor _, tt := range stdoutTests {\n\t\tc.env.RunSingularity(\n\t\t\tt,\n\t\t\te2e.AsSubtest(tt.name),\n\t\t\te2e.WithProfile(e2e.UserProfile),\n\t\t\te2e.WithCommand(tt.command),\n\t\t\te2e.WithArgs(tt.argv...),\n\t\t\te2e.ExpectExit(\n\t\t\t\ttt.exit,\n\t\t\t\te2e.ExpectOutput(e2e.ExactMatch, tt.output),\n\t\t\t),\n\t\t)\n\t}\n}", "title": "" }, { "docid": "96951d1131c612956f883c76bc8bcfaf", "score": "0.4749367", "text": "func (c *Client) Stat() (count, size int, err error) {\n\tline, err := c.Cmd(\"%s\\r\\n\", STAT)\n\tif err != nil {\n\t\treturn\n\t}\n\n\t// Number of messages in maildrop\n\tcount, err = strconv.Atoi(strings.Fields(line)[1])\n\tif err != nil {\n\t\treturn\n\t}\n\tif count == 0 {\n\t\treturn\n\t}\n\n\t// Total size of messages in bytes\n\tsize, err = strconv.Atoi(strings.Fields(line)[2])\n\tif err != nil {\n\t\treturn\n\t}\n\tif size == 0 {\n\t\treturn\n\t}\n\treturn\n}", "title": "" }, { "docid": "523e6609f52c3013dbb129de9bddfb01", "score": "0.47493178", "text": "func isInteractive() bool {\n\tfileInfo, err := os.Stdin.Stat()\n\tif err != nil {\n\t\treturn false\n\t}\n\treturn fileInfo.Mode()&(os.ModeCharDevice|os.ModeCharDevice) != 0\n}", "title": "" }, { "docid": "0e2df92e41294b5dd7913d900409006c", "score": "0.47466823", "text": "func confirm(stdin io.Reader, stdout io.Writer, s string, tries int) (bool, error) {\n\tr := bufio.NewReader(stdin)\n\n\tfor ; tries > 0; tries-- {\n\t\tfmt.Fprintf(stdout, \"%s [y/n]: \", s)\n\n\t\tres, err := r.ReadString('\\n')\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\n\t\t// Empty input (i.e. \"\\n\")\n\t\tif len(res) < 2 {\n\t\t\tcontinue\n\t\t}\n\n\t\tswitch strings.ToLower(strings.TrimSpace(res)) {\n\t\tcase \"y\":\n\t\t\treturn true, nil\n\t\tcase \"n\":\n\t\t\treturn false, nil\n\t\tdefault:\n\t\t\tcontinue\n\t\t}\n\t}\n\n\treturn false, nil\n}", "title": "" }, { "docid": "6512bca3071c6208de5807c8f344482b", "score": "0.47391903", "text": "func confirm(stdin io.Reader, stdout io.Writer, s string, tries int) (bool, error) {\n\tr := bufio.NewReader(stdin)\n\n\tfor ; tries > 0; tries-- {\n\t\tfmt.Fprintf(stdout, \"%s [y/n]: \", s)\n\n\t\tres, err := r.ReadString('\\n')\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\n\t\t// Empty input (i.e. \"\\n\")\n\t\tif len(res) < 2 {\n\t\t\tcontinue\n\t\t}\n\n\t\tswitch strings.ToLower(strings.TrimSpace(res)) {\n\t\tcase \"y\":\n\t\t\treturn true, nil\n\t\tcase \"n\":\n\t\t\treturn false, nil\n\t\tdefault:\n\t\t\tfmt.Fprintf(stdout, \"Invalid input.\\n\")\n\t\t\tcontinue\n\t\t}\n\t}\n\n\treturn false, nil\n}", "title": "" }, { "docid": "d1875c2289041752b4d6d4070552033a", "score": "0.47252342", "text": "func MustReadIn() string {\n\tfor i := 0; i < 3; i++ {\n\t\ttext, err := tryReadStdIn()\n\t\tif err == nil {\n\t\t\treturn strings.TrimSpace(text)\n\t\t}\n\t\t// TODO Theme\n\t\tfmt.Printf(\"Error while reading stdin:: %s. Failed %d/3\\n\", err, i)\n\t}\n\tfmt.Println(\"Could not read stdin. Aborting...\")\n\tos.Exit(1)\n\treturn \"\"\n}", "title": "" }, { "docid": "7f6afc2ed1d519567aa7aac4e0fceaef", "score": "0.47186813", "text": "func mockStdin(t *testing.T) (w *os.File, oldStdin *os.File) {\n\toldStdin = os.Stdin\n\tr, w, err := os.Pipe()\n\tassert.Nil(t, err)\n\tos.Stdin = r\n\treturn\n}", "title": "" }, { "docid": "245677443a446f19b7c45f5a164a3877", "score": "0.47119594", "text": "func isPiped() bool {\n\tstat, _ := os.Stdin.Stat()\n\treturn (stat.Mode() & os.ModeCharDevice) == 0\n}", "title": "" }, { "docid": "a42630b12c4f39caaf0ad2d75dc3f0b4", "score": "0.4701289", "text": "func (aio *AsyncIO) Stat() (os.FileInfo, error) {\n\treturn aio.fd.Stat()\n}", "title": "" }, { "docid": "e355021c41d8fe3083c4d80d35502ee1", "score": "0.46991068", "text": "func IoInProgress(diskd string) (uint64, error) {\n\t// Search whether given diskd is available on device or not\n\tfor i:=0; i<len(DiskStats); i++ {\n\t\tif DiskStats[i][2] == diskd {\n\t\t\tsectorsread,_ := strconv.ParseUint(DiskStats[i][11], 0, 64);\n\t\t\treturn sectorsread, nil;\n\t\t}\n\t}\n\t_, err := fmt.Sscanf(\"Disk %s not present on the device\", diskd)\n\treturn 0,err\n}", "title": "" }, { "docid": "47472efc98234b4f9b8ed295f57f7d6f", "score": "0.4694314", "text": "func wait(s *suite.Suite, data *runData, expectedExitStatus int) {\n\terr := data.cmd.Wait()\n\tif expectedExitStatus == 0 {\n\t\ts.NoError(err)\n\t} else {\n\t\tstatus := err.(*exec.ExitError).ProcessState.Sys().(syscall.WaitStatus)\n\t\ts.Equal(expectedExitStatus, status.ExitStatus())\n\t}\n}", "title": "" }, { "docid": "13cd4a06b8f44e4848d1dec3702e0f2b", "score": "0.46846095", "text": "func (p *Process) GetStat() (err error) {\n\tvar cl, sstat string\n\tvar nameStart, nameEnd int\n\n\tstats, err := os.Open(util.CreateProcPath(util.ProcLocation, strconv.Itoa(p.Pid), \"stat\"))\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer stats.Close()\n\n\tscanner := bufio.NewScanner(stats)\n\tfor scanner.Scan() {\n\t\tsstat = scanner.Text()\n\t\tnameStart = strings.IndexRune(sstat, '(')\n\t\tnameEnd = strings.IndexRune(sstat[nameStart:], ')')\n\t}\n\n\ts := &Stat{}\n\t_, err = fmt.Sscanf(strings.TrimSpace(sstat[nameStart+nameEnd+2:]), \"%s %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\", &s.State, &p.Ppid, &s.Pgrp, &s.Session, &s.TtyNr, &s.Tpgid, &s.Flags, &s.Minflt, &s.Cminflt, &s.Majflt, &s.Cmajflt, &s.Utime, &s.Stime, &s.Cutime, &s.Cstime, &s.Priority, &s.Nice, &s.NumThreads, &s.Itrealvalue, &s.Starttime, &s.Vsize, &s.Rss, &s.Rsslim, &s.Signal, &s.Blocked, &s.Sigignore, &s.Sigcatch, &s.Nswap, &s.Cnswap, &s.ExitSignal, &s.Processor, &s.RtPriority, &s.Policy, &s.DelayacctBlkioTicks, &s.GuestTime, &s.CguestTime, &s.StartData, &s.EndData, &s.StartBrk, &s.ArgStart, &s.ArgEnd, &s.EnvStart, &s.EnvEnd, &s.ExitCode)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcmdline, err := os.Open(util.CreateProcPath(util.ProcLocation, strconv.Itoa(p.Pid), \"cmdline\"))\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer cmdline.Close()\n\n\tcmdScanner := bufio.NewScanner(cmdline)\n\tfor cmdScanner.Scan() {\n\t\tcl = cmdScanner.Text()\n\t}\n\n\tp.Name = sstat[nameStart : nameStart+nameEnd+1]\n\tp.Cmdline = cl\n\tp.Stat = *s\n\n\treturn nil\n}", "title": "" }, { "docid": "b64c24b239bec486207c254a4b9d064a", "score": "0.46597242", "text": "func inTerminal() bool {\n\treturn term.IsTerminal(int(os.Stdin.Fd()))\n}", "title": "" }, { "docid": "cbd3c6e80f4546526a3873f741d8026f", "score": "0.46210948", "text": "func (cfg *config) wait(index int, n int, startTerm int) (bool, logEntry) {\n\tto := 10 * time.Millisecond\n\tfor iters := 0; iters < 30; iters++ {\n\t\tnd, _ := cfg.nCommitted(index)\n\t\tif nd >= n {\n\t\t\tbreak\n\t\t}\n\t\ttime.Sleep(to)\n\t\tif to < time.Second {\n\t\t\tto *= 2\n\t\t}\n\t\tif startTerm > -1 {\n\t\t\tfor _, r := range cfg.rafts {\n\t\t\t\tif t, _ := r.GetState(); t > startTerm {\n\t\t\t\t\t// someone has moved on\n\t\t\t\t\t// can no longer guarantee that we'll \"win\"\n\t\t\t\t\treturn false, logEntry{}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tnd, e := cfg.nCommitted(index)\n\tif nd < n {\n\t\tcfg.t.Fatalf(\"only %d decided for index %d; wanted %d\\n\",\n\t\t\tnd, index, n)\n\t}\n\treturn true, e\n}", "title": "" }, { "docid": "cfaf89aa3198b5d96d853ddeecfee61c", "score": "0.46114147", "text": "func (i *In) CheckTty(attachStdin, ttyMode bool) error {\n\t// In order to attach to a container tty, input stream for the client must\n\t// be a tty itself: redirecting or piping the client standard input is\n\t// incompatible with `docker run -t`, `docker exec -t` or `docker attach`.\n\tif ttyMode && attachStdin && !i.isTerminal {\n\t\tconst eText = \"the input device is not a TTY\"\n\t\tif runtime.GOOS == \"windows\" {\n\t\t\treturn errors.New(eText + \". If you are using mintty, try prefixing the command with 'winpty'\")\n\t\t}\n\t\treturn errors.New(eText)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "77841e36833bca23176ac0ba572a3c2d", "score": "0.4608423", "text": "func printTheInput(pipe chan string) {\n\tvar lineFromChannel string\n\n\tfor {\n\t\t// Block and then wait for the string\n\t\tlineFromChannel = <-pipe\n\t\tif lineFromChannel == \"exit\\n\" {\n\t\t\tbreak\n\t\t}\n\t\t// TrimSuffix chomps the newline off the end of the string\n\t\tfmt.Println(\"Got the string \\\"\" + strings.TrimSuffix(lineFromChannel, \"\\n\") + \"\\\" from the channel\")\n\t}\n}", "title": "" }, { "docid": "d75701c740ae0ff4a4f5170ce34cbccf", "score": "0.4572482", "text": "func (s *stream) isDone() bool {\n\tif s.limit == 0 {\n\t\treturn s.done\n\t}\n\n\treturn s.done || s.sent >= s.limit\n}", "title": "" }, { "docid": "5d4fba1d31b95aae3441e3ce18d61425", "score": "0.45646265", "text": "func (p *pipe) outputWait() (int32, error) {\n\tfor {\n\t\tsafeFree := atomic.LoadInt32(&p.free)\n\n\t\t// If there's no data available, spin lock to give it another chance\n\t\tfor i := 0; safeFree == p.size && i < maxSpin; i++ {\n\t\t\truntime.Gosched()\n\t\t\tsafeFree = atomic.LoadInt32(&p.free)\n\t\t}\n\t\t// If still no data, go down into deep sleep\n\t\tif safeFree == p.size {\n\t\t\tselect {\n\t\t\tcase <-p.outWake: // wake signal from input, retry\n\t\t\t\tcontinue\n\n\t\t\tcase <-p.inQuit: // input done, return\n\t\t\t\tsafeFree = atomic.LoadInt32(&p.free)\n\t\t\t\tif safeFree != p.size {\n\t\t\t\t\treturn safeFree, nil\n\t\t\t\t}\n\t\t\t\tp.outputClose(nil)\n\t\t\t\treturn safeFree, p.inErr\n\n\t\t\tcase <-p.outQuit: // output closed prematurely\n\t\t\t\treturn safeFree, ErrClosedPipe\n\t\t\t}\n\t\t}\n\t\treturn safeFree, nil\n\t}\n}", "title": "" }, { "docid": "3edf3cb252c8920589ec99b30937f778", "score": "0.4559143", "text": "func (tb *TextBuf) Stat() error {\n\ttb.ClearFlag(int(TextBufFileModOk))\n\terr := tb.Info.InitFile(string(tb.Filename))\n\tif err != nil {\n\t\treturn err\n\t}\n\ttb.ConfigSupported()\n\treturn nil\n}", "title": "" }, { "docid": "1b65b219d4b9e222039db9f6fedb6382", "score": "0.4544781", "text": "func (p *Input) Wait() {\n\tp.Stop()\n}", "title": "" }, { "docid": "116b257cc3eea459bab8af0754bf3504", "score": "0.45322165", "text": "func run(stdin []byte, argv []string) (stdout, stderr []byte, ok bool) {\n\tcmd, err := exec.LookPath(argv[0]);\n\tif err != nil {\n\t\tfatal(\"exec %s: %s\", argv[0], err)\n\t}\n\tr0, w0, err := os.Pipe();\n\tif err != nil {\n\t\tfatal(\"%s\", err)\n\t}\n\tr1, w1, err := os.Pipe();\n\tif err != nil {\n\t\tfatal(\"%s\", err)\n\t}\n\tr2, w2, err := os.Pipe();\n\tif err != nil {\n\t\tfatal(\"%s\", err)\n\t}\n\tpid, err := os.ForkExec(cmd, argv, os.Environ(), \"\", []*os.File{r0, w1, w2});\n\tif err != nil {\n\t\tfatal(\"%s\", err)\n\t}\n\tr0.Close();\n\tw1.Close();\n\tw2.Close();\n\tc := make(chan bool);\n\tgo func() {\n\t\tw0.Write(stdin);\n\t\tw0.Close();\n\t\tc <- true;\n\t}();\n\tvar xstdout []byte;\t// TODO(rsc): delete after 6g can take address of out parameter\n\tgo func() {\n\t\txstdout, _ = io.ReadAll(r1);\n\t\tr1.Close();\n\t\tc <- true;\n\t}();\n\tstderr, _ = io.ReadAll(r2);\n\tr2.Close();\n\t<-c;\n\t<-c;\n\tstdout = xstdout;\n\n\tw, err := os.Wait(pid, 0);\n\tif err != nil {\n\t\tfatal(\"%s\", err)\n\t}\n\tok = w.Exited() && w.ExitStatus() == 0;\n\treturn;\n}", "title": "" }, { "docid": "dd6239fa94da2fba08ebcf8c19e1a6ce", "score": "0.452611", "text": "func getInput(scanner *bufio.Scanner) bool {\n\tfmt.Print(\"Enter command (try 'help'): \")\n\n\tscanner.Scan()\n\tinput := scanner.Text()\n\n\tsplitInput := strings.Split(input, \" \")\n\tcommandName := splitInput[0]\n\tcommandArgs := splitInput[1:]\n\n\tcmd := commands[commandName]\n\n\tif cmd.execute != nil {\n\t\tcmd.execute(commandArgs[:]...)\n\t} else if strings.Compare(commandName, \"quit\") == 0 || strings.Compare(commandName, \"exit\") == 0 {\n\t\treturn false\n\t} else {\n\t\tfmt.Printf(\"Command '%v' unrecognized, try 'help'\\n\", commandName)\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "3b4d3a5a4e513b4cadcdcf1f42e1e14b", "score": "0.45239532", "text": "func askForConfirmation(prompt string) bool {\n\tvar retVal bool\n\n\tfor {\n\t\tfmt.Printf(\"%s \", prompt)\n\n\t\tvar response string\n\n\t\tscanner := bufio.NewScanner(os.Stdin)\n\t\tscanner.Split(bufio.ScanLines)\n\t\tif scanner.Scan() {\n\t\t\tresponse = scanner.Text()\n\t\t}\n\n\t\tif response == \"\" {\n\t\t\tresponse = \"n\"\n\t\t} else {\n\t\t\tresponse = strings.ToLower(response)\n\t\t}\n\n\t\tif response == \"no\" || response == \"n\" {\n\t\t\tbreak\n\t\t} else if response == \"yes\" || response == \"y\" {\n\t\t\tretVal = true\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn retVal\n}", "title": "" }, { "docid": "6349df015e1a308890de441d37530638", "score": "0.45211244", "text": "func (s *testSignaler) wait() bool {\n\tselect {\n\tcase s := <-s.nonBlockingStatus:\n\t\treturn s\n\tcase s := <-s.status:\n\t\treturn s\n\t}\n}", "title": "" }, { "docid": "a6e651ca7482ad805b619cdf0901033e", "score": "0.44837236", "text": "func waitForIPAM() bool {\n\tfor {\n\t\tcmd := exec.Command(\"./grpc-health-probe\", \"-addr\", \"127.0.0.1:50051\", \">\", \"/dev/null\", \"2>&1\")\n\t\tif err := cmd.Run(); err == nil {\n\t\t\treturn true\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4ad404d5942d89f354d6c469db890e7f", "score": "0.4481", "text": "func (w *wantConn) waiting() bool {\n\tselect {\n\tcase <-w.ready:\n\t\treturn false\n\tdefault:\n\t\treturn true\n\t}\n}", "title": "" }, { "docid": "489f266d3af565d70fb8955f31501ad0", "score": "0.44722602", "text": "func (r *MessageExecuteCommand) HasInput() bool {\n\treturn r.hasInput\n}", "title": "" }, { "docid": "ccbdd8bd89e574d2ddd50f4db88db9e2", "score": "0.44595322", "text": "func IsTerminal(fd int) bool {\n\t// FIXME(bp) implement this for BSD/Darwin to read from stdin.\n\treturn false\n}", "title": "" }, { "docid": "43f2aa06af95992f3195c6e196458aba", "score": "0.4443623", "text": "func IsTTY(fd any) bool {\n\tif s, ok := fd.(*sync.Writer); ok {\n\t\t// STDOUT is commonly wrapped in a sync.Writer, so here\n\t\t// we unwrap it to gain access to the underlying Writer/STDOUT.\n\t\tfd = s.W\n\t}\n\tif f, ok := fd.(*os.File); ok {\n\t\treturn term.IsTerminal(int(f.Fd()))\n\t}\n\treturn false\n}", "title": "" }, { "docid": "b34da0fe7eca2caafb3b94e95f905611", "score": "0.44417086", "text": "func lockStdIO() (stdin, stdout, stderr *os.File) {\n\tr, w, err := os.Pipe()\n\tif err != nil {\n\t\tpanic(fmt.Sprint(\"Failed to lock stdio: \", err))\n\t}\n\tr.Close()\n\tw.Close()\n\n\tstdin = os.Stdin\n\tstdout = os.Stdout\n\tstderr = os.Stderr\n\tos.Stdin = r\n\tos.Stdout = w\n\tos.Stderr = w\n\treturn stdin, stdout, stderr\n}", "title": "" }, { "docid": "28fe1e67a55ca5b1ab40894864c94510", "score": "0.44310188", "text": "func (b *testBroker) Stat(pipe *Pipeline) (stat *Stat, err error) {\n\tif err := b.isServing(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tq := b.queue(pipe)\n\tif q == nil {\n\t\treturn nil, fmt.Errorf(\"undefined testQueue `%s`\", pipe.Name())\n\t}\n\n\treturn q.stat(), nil\n}", "title": "" }, { "docid": "393c2642df3359abea3392bba9574f22", "score": "0.44206095", "text": "func StdinReader(input *ringbuffer.RingBuffer) {\n\tin := bufio.NewReader(os.Stdin)\n\tfor {\n\t\tby, err := in.ReadByte()\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t}\n\n\t\tinput.Write([]byte{by})\n\t}\n}", "title": "" }, { "docid": "21a3d18d8740097766628cd05a538f64", "score": "0.44191605", "text": "func watchForConnectionInput(username string, properties util.Properties, conn net.Conn) {\n reader := bufio.NewReader(conn)\n\n for true {\n message, err := reader.ReadString('\\n')\n util.CheckForError(err, \"Lost server connection\");\n message = strings.TrimSpace(message)\n if (message != \"\") {\n Command := parseCommand(message)\n switch Command.Command {\n\n // the handshake - send out our username\n case \"ready\":\n sendCommand(\"user\", username, conn)\n\n // the user has connected to the chat server\n case \"connect\":\n fmt.Printf(properties.HasEnteredTheLobbyMessage + \"\\n\", Command.Username)\n\n // the user has disconnected\n case \"disconnect\":\n fmt.Printf(properties.HasLeftTheLobbyMessage + \"\\n\", Command.Username)\n\n // the user has entered a room\n case \"enter\":\n fmt.Printf(properties.HasEnteredTheRoomMessage + \"\\n\", Command.Username, Command.Body)\n\n // the user has left a room\n case \"leave\":\n fmt.Printf(properties.HasLeftTheRoomMessage + \"\\n\", Command.Username, Command.Body)\n\n // the user has sent a message\n case \"message\":\n if (Command.Username != username) {\n fmt.Printf(properties.ReceivedAMessage + \"\\n\", Command.Username, Command.Body)\n }\n\n // the user has connected to the chat server\n case \"ignoring\":\n fmt.Printf(properties.IgnoringMessage + \"\\n\", Command.Body)\n }\n }\n }\n}", "title": "" }, { "docid": "a95bc9f70e1cae2802b8425371f02d03", "score": "0.4417768", "text": "func f(tester *exec.Cmd, testee *exec.Cmd, giveInput chan io.Writer) {\n var(\n testerBuf *bytes.Buffer\n testeeBuf *bytes.Buffer\n testerArr = make([]byte, 1024)\n testeeArr = make([]byte, 1024)\n )\n\n testerIn, err := tester.StdinPipe()\n testeeIn, err := testee.StdinPipe()\n testerOut, err := tester.StdoutPipe()\n testeeOut, err := testee.StdoutPipe()\n\n if err != nil {\n return nil\n }\n\n stdin := io.MultiWriter(testerIn, testeeIn)\n giveInput <- stdin\n\n for {\n a, err := io.ReadFull(testerOut, testerArr)\n b, err := io.ReadFull(testeeOut, testeeArr)\n\n switch(err) {\n case io.EOF:\n //do something\n case nil:\n //do nothing\n default:\n //??\n }\n\n if(flag && !bytes.Equal(testerArr, testeeArr)) {\n // error - wrong answer, send signals to other threads\n flag = false\n }\n }\n\n return\n}", "title": "" }, { "docid": "7ab2c320046c5ad0b375b6c1c40bf2be", "score": "0.44164273", "text": "func (p CustomScanTCP) StatInfo() (bool, int) {\r\n\treturn p.OK, p.NM\r\n}", "title": "" }, { "docid": "8eb7fb1ed2075cb940d5dd9082008583", "score": "0.44049552", "text": "func (v defaultTTYImpl) Isatty() bool {\n\tif config.MockNoTTY() {\n\t\treturn false\n\t}\n\tif isatty.IsTerminal(os.Stdin.Fd()) &&\n\t\tisatty.IsTerminal(os.Stdout.Fd()) {\n\t\treturn true\n\t} else if isatty.IsCygwinTerminal(os.Stdin.Fd()) &&\n\t\tisatty.IsCygwinTerminal(os.Stdout.Fd()) {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "75b58185a7559eae835c03f7c4583983", "score": "0.4403618", "text": "func On(callback func(string)) error {\n stdinScanner := bufio.NewScanner(os.Stdin)\n for stdinScanner.Scan() {\n text := stdinScanner.Text()\n callback(text)\n }\n\n return stdinScanner.Err()\n}", "title": "" }, { "docid": "21f3fa5ca922f14c836a2c6a15a7cd40", "score": "0.44004136", "text": "func input(cmd_chan chan string) {\n\tin := bufio.NewReader(os.Stdin)\n\n\tlog(\"\")\n\tfor {\n\t\tif cmd, err := in.ReadString('\\n'); err == nil && cmd != \"\\n\" {\n\t\t\tcmd_chan <- strings.Trim(cmd, \"\\n\")\n\t\t}\n\t\tlogPrompt()\n\t}\n}", "title": "" }, { "docid": "b933da558fa18136d17794293b06b07a", "score": "0.43994287", "text": "func isTerminal() bool {\n\treturn terminal.IsTerminal(syscall.Stdin)\n}", "title": "" }, { "docid": "bef6dc4e7a4f408bf07e2a9dc35776ef", "score": "0.43950057", "text": "func (s *BaseAspidaListener) EnterIfStat(ctx *IfStatContext) {}", "title": "" }, { "docid": "b5c6711a635342900d7d601cec060d02", "score": "0.43888846", "text": "func (cs cmdStatus) isDone() bool {\n\treturn cs&(1<<12 /*busy*/) == 0\n}", "title": "" }, { "docid": "453844f97295cc8a6ab23cab8f080978", "score": "0.4381624", "text": "func remoteCmdLoop(ctx *context.T, stdin io.Reader) func() {\n\tdone := make(chan struct{})\n\tgo func() {\n\t\tscanner := bufio.NewScanner(stdin)\n\t\tfor scanner.Scan() {\n\t\t\tif scanner.Text() == \"close\" {\n\t\t\t\tclose(done)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n\treturn func() { <-done }\n}", "title": "" }, { "docid": "92552fdc6e46565b01d167a6f2cb2d5a", "score": "0.4379903", "text": "func (d *portworx) IsIOsInProgressForTheVolume(n *node.Node, volumeNameOrID string) (bool, error) {\n\n\tlog.Infof(\"Got vol-id [%s] for checking IOs\", volumeNameOrID)\n\tcmd := fmt.Sprintf(\"%s v i %s| grep -e 'IOs in progress'\", d.getPxctlPath(*n), volumeNameOrID)\n\n\tout, err := d.nodeDriver.RunCommandWithNoRetry(*n, cmd, node.ConnectionOpts{\n\t\tTimeout: 2 * time.Minute,\n\t\tTimeBeforeRetry: 10 * time.Second,\n\t})\n\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tline := strings.Trim(out, \" \")\n\tdata := strings.Split(line, \":\")[1]\n\tdata = strings.Trim(data, \"\\n\")\n\tdata = strings.Trim(data, \" \")\n\tval, err := strconv.Atoi(data)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tif val > 0 {\n\t\treturn true, nil\n\t}\n\treturn false, nil\n}", "title": "" }, { "docid": "40c50a02b33ddae8598c9e2c03ac4716", "score": "0.4369594", "text": "func logIsAtty(file *os.File) bool {\n\tfd := file.Fd()\n\treturn C.isatty(C.int(fd)) == 1\n}", "title": "" }, { "docid": "431348d166fe26cd8914f92c481cf775", "score": "0.4367795", "text": "func (w *Watcher) isWatching(pid int, event uint32) bool {\r\n\tw.watchesMutex.Lock()\r\n\tdefer w.watchesMutex.Unlock()\r\n\r\n\tif watch, ok := w.watches[pid]; ok {\r\n\t\treturn (watch.flags & event) == event\r\n\t}\r\n\t//for any process\r\n\tif watch, ok := w.watches[-1]; ok {\r\n\t\treturn (watch.flags & event) == event\r\n\t}\r\n\treturn false\r\n}", "title": "" }, { "docid": "9c488110d16bba99851d196e7b73a5be", "score": "0.4363278", "text": "func getInput(trim bool) string {\n fi, err := os.Stdin.Stat()\n if err != nil {\n panic(err)\n }\n\n if fi.Mode() & os.ModeNamedPipe == 0 {\n fmt.Println(\"Nothing to draw\")\n os.Exit(0)\n }\n\n reader := bufio.NewReader(os.Stdin)\n var input []rune\n for {\n\t\tchunk, _, err := reader.ReadRune()\n\t\tif err != nil && err == io.EOF {\n\t\t\tbreak\n\t\t}\n\t\tinput = append(input, chunk)\n\t}\n\n if trim {\n return strings.TrimSpace(string(input))\n }\n\n return string(input)\n}", "title": "" }, { "docid": "b37f0b579c4dcb314151c070d563ebd3", "score": "0.43629864", "text": "func (r *Runner) Wait(t *time.Timer, signals []os.Signal) bool {\n\tif !r.Started() {\n\t\treturn true\n\t}\n\tfor _, sig := range signals {\n\t\tselect {\n\t\tcase err, ok := <-r.errCh:\n\t\t\tif ok {\n\t\t\t\tr.setError(err, ifNotSet)\n\t\t\t}\n\t\t\treturn true\n\t\tcase <-t.C:\n\t\t\tr.setError(timeoutErr, ifNotSet)\n\t\t\tr.Cmd.Process.Signal(sig)\n\t\t\tt.Reset(r.Killout)\n\t\t}\n\t}\n\tr.setError(fmt.Errorf(\"unkillable child: %v\", r.Cmd.Process))\n\treturn false\n}", "title": "" }, { "docid": "f114fe5b822d9ed671d066e80fe4349f", "score": "0.43551078", "text": "func ReadStdinWithTimeout(bufferSize int, timeoutSeconds time.Duration) []byte {\n\tc := make(chan []byte, 1)\n\n\t// Read in background to allow using a select for a timeout\n\tgo (func() {\n\t\tr := bufio.NewReader(os.Stdin)\n\t\tbuf := make([]byte, bufferSize)\n\n\t\tn, err := r.Read(buf)\n\t\tif err != nil && err != io.EOF {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\tc <- buf[:n]\n\t})()\n\n\tselect {\n\tcase b := <-c:\n\t\treturn b\n\t// Timeout\n\tcase <-time.After(timeoutSeconds * time.Second):\n\t\tfmt.Println(\"No input received\")\n\t\tos.Exit(1)\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "29f958ecdb6a3bf845ef2c044f759f42", "score": "0.43499792", "text": "func (t *simpleToken) Wait() bool {\n\treturn true\n}", "title": "" }, { "docid": "dd4795b74c0e8c509534d0ca9376b9de", "score": "0.43474823", "text": "func customPause() {\r\n\r\n fmt.Print(\"Press 'Enter' to continue...\")\r\n bufio.NewReader(os.Stdin).ReadBytes('\\n') \r\n}", "title": "" }, { "docid": "e940476d2c77a400b03992a36bf866c3", "score": "0.43376884", "text": "func (w *Watcher) readEvents() {\n\tvar (\n\t\tn uint32\n\t\tkey uintptr\n\t\tov *windows.Overlapped\n\t)\n\truntime.LockOSThread()\n\n\tfor {\n\t\tqErr := windows.GetQueuedCompletionStatus(w.port, &n, &key, &ov, windows.INFINITE)\n\t\t// This error is handled after the watch == nil check below. NOTE: this\n\t\t// seems odd, note sure if it's correct.\n\n\t\twatch := (*watch)(unsafe.Pointer(ov))\n\t\tif watch == nil {\n\t\t\tselect {\n\t\t\tcase ch := <-w.quit:\n\t\t\t\tw.mu.Lock()\n\t\t\t\tvar indexes []indexMap\n\t\t\t\tfor _, index := range w.watches {\n\t\t\t\t\tindexes = append(indexes, index)\n\t\t\t\t}\n\t\t\t\tw.mu.Unlock()\n\t\t\t\tfor _, index := range indexes {\n\t\t\t\t\tfor _, watch := range index {\n\t\t\t\t\t\tw.deleteWatch(watch)\n\t\t\t\t\t\tw.startRead(watch)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\terr := windows.CloseHandle(w.port)\n\t\t\t\tif err != nil {\n\t\t\t\t\terr = os.NewSyscallError(\"CloseHandle\", err)\n\t\t\t\t}\n\t\t\t\tclose(w.Events)\n\t\t\t\tclose(w.Errors)\n\t\t\t\tch <- err\n\t\t\t\treturn\n\t\t\tcase in := <-w.input:\n\t\t\t\tswitch in.op {\n\t\t\t\tcase opAddWatch:\n\t\t\t\t\tin.reply <- w.addWatch(in.path, uint64(in.flags))\n\t\t\t\tcase opRemoveWatch:\n\t\t\t\t\tin.reply <- w.remWatch(in.path)\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tswitch qErr {\n\t\tcase windows.ERROR_MORE_DATA:\n\t\t\tif watch == nil {\n\t\t\t\tw.sendError(errors.New(\"ERROR_MORE_DATA has unexpectedly null lpOverlapped buffer\"))\n\t\t\t} else {\n\t\t\t\t// The i/o succeeded but the buffer is full.\n\t\t\t\t// In theory we should be building up a full packet.\n\t\t\t\t// In practice we can get away with just carrying on.\n\t\t\t\tn = uint32(unsafe.Sizeof(watch.buf))\n\t\t\t}\n\t\tcase windows.ERROR_ACCESS_DENIED:\n\t\t\t// Watched directory was probably removed\n\t\t\tw.sendEvent(watch.path, watch.mask&sysFSDELETESELF)\n\t\t\tw.deleteWatch(watch)\n\t\t\tw.startRead(watch)\n\t\t\tcontinue\n\t\tcase windows.ERROR_OPERATION_ABORTED:\n\t\t\t// CancelIo was called on this handle\n\t\t\tcontinue\n\t\tdefault:\n\t\t\tw.sendError(os.NewSyscallError(\"GetQueuedCompletionPort\", qErr))\n\t\t\tcontinue\n\t\tcase nil:\n\t\t}\n\n\t\tvar offset uint32\n\t\tfor {\n\t\t\tif n == 0 {\n\t\t\t\tw.sendError(errors.New(\"short read in readEvents()\"))\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\t// Point \"raw\" to the event in the buffer\n\t\t\traw := (*windows.FileNotifyInformation)(unsafe.Pointer(&watch.buf[offset]))\n\n\t\t\t// Create a buf that is the size of the path name\n\t\t\tsize := int(raw.FileNameLength / 2)\n\t\t\tvar buf []uint16\n\t\t\t// TODO: Use unsafe.Slice in Go 1.17; https://stackoverflow.com/questions/51187973\n\t\t\tsh := (*reflect.SliceHeader)(unsafe.Pointer(&buf))\n\t\t\tsh.Data = uintptr(unsafe.Pointer(&raw.FileName))\n\t\t\tsh.Len = size\n\t\t\tsh.Cap = size\n\t\t\tname := windows.UTF16ToString(buf)\n\t\t\tfullname := filepath.Join(watch.path, name)\n\n\t\t\tvar mask uint64\n\t\t\tswitch raw.Action {\n\t\t\tcase windows.FILE_ACTION_REMOVED:\n\t\t\t\tmask = sysFSDELETESELF\n\t\t\tcase windows.FILE_ACTION_MODIFIED:\n\t\t\t\tmask = sysFSMODIFY\n\t\t\tcase windows.FILE_ACTION_RENAMED_OLD_NAME:\n\t\t\t\twatch.rename = name\n\t\t\tcase windows.FILE_ACTION_RENAMED_NEW_NAME:\n\t\t\t\t// Update saved path of all sub-watches.\n\t\t\t\told := filepath.Join(watch.path, watch.rename)\n\t\t\t\tw.mu.Lock()\n\t\t\t\tfor _, watchMap := range w.watches {\n\t\t\t\t\tfor _, ww := range watchMap {\n\t\t\t\t\t\tif strings.HasPrefix(ww.path, old) {\n\t\t\t\t\t\t\tww.path = filepath.Join(fullname, strings.TrimPrefix(ww.path, old))\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tw.mu.Unlock()\n\n\t\t\t\tif watch.names[watch.rename] != 0 {\n\t\t\t\t\twatch.names[name] |= watch.names[watch.rename]\n\t\t\t\t\tdelete(watch.names, watch.rename)\n\t\t\t\t\tmask = sysFSMOVESELF\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tsendNameEvent := func() {\n\t\t\t\tw.sendEvent(fullname, watch.names[name]&mask)\n\t\t\t}\n\t\t\tif raw.Action != windows.FILE_ACTION_RENAMED_NEW_NAME {\n\t\t\t\tsendNameEvent()\n\t\t\t}\n\t\t\tif raw.Action == windows.FILE_ACTION_REMOVED {\n\t\t\t\tw.sendEvent(fullname, watch.names[name]&sysFSIGNORED)\n\t\t\t\tdelete(watch.names, name)\n\t\t\t}\n\n\t\t\tw.sendEvent(fullname, watch.mask&w.toFSnotifyFlags(raw.Action))\n\t\t\tif raw.Action == windows.FILE_ACTION_RENAMED_NEW_NAME {\n\t\t\t\tfullname = filepath.Join(watch.path, watch.rename)\n\t\t\t\tsendNameEvent()\n\t\t\t}\n\n\t\t\t// Move to the next event in the buffer\n\t\t\tif raw.NextEntryOffset == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\toffset += raw.NextEntryOffset\n\n\t\t\t// Error!\n\t\t\tif offset >= n {\n\t\t\t\tw.sendError(errors.New(\n\t\t\t\t\t\"Windows system assumed buffer larger than it is, events have likely been missed.\"))\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif err := w.startRead(watch); err != nil {\n\t\t\tw.sendError(err)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1c76c63e64f3e1f3727947951dcb7435", "score": "0.4336567", "text": "func GetStats(sleep int, iterations int64) {\n\tfor j := int64(0); j < iterations; j++ {\n\t\tmatches, err := filepath.Glob(\"/proc/[0-9]*/stat\")\n\t\tif err != nil {\n\t\tif(debug) {\n\t\t\tfmt.Println(\"err in: func GetStats\")\n\t\t}\n\t\t\tcontinue\n//\t\t\tpanic(err)\n\t\t}\n\n\t\tfor i := range matches {\n\t\t\tif 1 == 0 {\n\t\t\t\tfmt.Printf(\"matches[%v]=\\t%v\\n\", i, matches[i])\n\t\t\t}\n\t\t\tProcRead(matches[i])\n\t\t}\n\t\ttime.Sleep(time.Duration(sleep) * time.Second)\n\t\t//time.Sleep(1000 * time.Millisecond)\n\t}\n}", "title": "" }, { "docid": "b6077e82e5885a8be255649b1ac00498", "score": "0.43335113", "text": "func (s *BaseCymbolListener) EnterStat(ctx *StatContext) {}", "title": "" }, { "docid": "a0bfcda5b807c43b038965a34e9d7a8a", "score": "0.43330407", "text": "func (p *Poller[T]) Done() bool {\n\treturn poller.IsTerminalState(p.FakeStatus)\n}", "title": "" }, { "docid": "8c62c2d445e39cdfcfbc97d501fd0649", "score": "0.43312725", "text": "func (f *FsWatcher) IsStarted() bool {\r\n\treturn f.started\r\n}", "title": "" }, { "docid": "f5ee92490f1e74faddfbdc2d37543eb3", "score": "0.4327415", "text": "func setupStdin() {\n\t// Create the pipe and swap stdin for the reader end\n\tr, w, _ := os.Pipe()\n\toriginalStdin := os.Stdin\n\tos.Stdin = r\n\n\t// Create a goroutine that copies data from the original stdin\n\t// into the writer end of the pipe forever.\n\tgo func() {\n\t\tdefer w.Close()\n\t\tio.Copy(w, originalStdin)\n\t}()\n\n\t// Register a signal handler for interrupt in order to close the\n\t// writer end of our pipe so that readers get EOF downstream.\n\tch := make(chan os.Signal, 1)\n\tsignal.Notify(ch, os.Interrupt)\n\n\tgo func() {\n\t\tdefer signal.Stop(ch)\n\t\tdefer w.Close()\n\t\t<-ch\n\t\tlog.Println(\"Closing stdin because interrupt received.\")\n\t}()\n}", "title": "" }, { "docid": "4be8dc3f0e0f602bf77ac72e2b6fb126", "score": "0.43258804", "text": "func isStdout(filename string) bool {\n\treturn filename == stdout\n}", "title": "" }, { "docid": "0b52e29dc756ef3dededb6d60fca7d4c", "score": "0.43221137", "text": "func listenForUserInput(blockWrapperChannel chan *BlockWrapper, packetChannel chan Packet, n *Node) {\n\treader := bufio.NewReader(os.Stdin) //constantly be reading in from std in\n\tinput, err := reader.ReadString('\\n')\n\tif err != nil || input == \"\\n\" {\n\t} else {\n\t\tfmt.Println()\n\t\tgo handleUserInput(input, blockWrapperChannel, packetChannel, n)\n\t}\n}", "title": "" }, { "docid": "8f7618200c1f394b92ffecc26c60ac60", "score": "0.4321122", "text": "func (svc *service) verifyStillRunning() (procStatData []string, stillRunning bool) {\n\tprocStatData, err := svc.readProcStatData()\n\tif err != nil {\n\t\tsvc.reset()\n\t\treturn nil, false\n\t}\n\tcurrentProcStartTime, err := strconv.ParseInt(procStatData[PROC_PID_STAT_STARTTIME], 10, 64)\n\tif err != nil {\n\t\tlog.Fatalf(\"garbage start_time for pid %d\", svc.pid)\n\t}\n\tif currentProcStartTime != svc.procStatStartTime {\n\t\tsvc.reset()\n\t\treturn nil, false\n\t}\n\treturn procStatData, true\n}", "title": "" }, { "docid": "c44b588f94de0cd35484dccc36428e46", "score": "0.43148294", "text": "func (fs *IPfsfs) Stat() (stat bool) {\n\t_, err := fs.Req(\"id\", \"\")\n\tif err != nil {\n\t\tlogger.Critical(\"IPFS stat , %s\", err)\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "1eb322fa78ae10962e320e9e715b3611", "score": "0.43108505", "text": "func hasChanges(dir string) (bool, error) {\n\t// Write command output to both os.Stderr and local, so that we can check\n\t// whether there are modified files.\n\tinmem := bytes.NewBuffer([]byte{}) // TODO(deklerk): Try `var inmem bytes.Buffer`.\n\tw := io.MultiWriter(os.Stderr, inmem)\n\n\tc := exec.Command(\"bash\", \"-c\", \"git status --short\")\n\tc.Dir = dir\n\tc.Stdout = w\n\tc.Stderr = os.Stderr\n\tc.Stdin = os.Stdin // Prevents \"the input device is not a TTY\" error.\n\terr := c.Run()\n\n\treturn inmem.Len() > 0, err\n}", "title": "" }, { "docid": "7b0b762d3cdd2b0ee992a1b2f4697b61", "score": "0.430512", "text": "func ReadStdin() <-chan string {\n\tc := make(chan string)\n\tif seenStdin {\n\t\tlog.Fatalf(\"Repeated - on command line; can't reread stdin.\")\n\t}\n\tseenStdin = true\n\tgo func() {\n\t\tscanner := bufio.NewScanner(os.Stdin)\n\t\tscanner.Split(bufio.ScanWords)\n\t\tfor scanner.Scan() {\n\t\t\ts := strings.TrimSpace(scanner.Text())\n\t\t\tif s != \"\" {\n\t\t\t\tc <- s\n\t\t\t}\n\t\t}\n\t\tif err := scanner.Err(); err != nil {\n\t\t\tlog.Fatalf(\"Error reading stdin: %s\", err)\n\t\t}\n\t\tclose(c)\n\t}()\n\treturn c\n}", "title": "" }, { "docid": "18bd2c604f560787a5e202927141cd04", "score": "0.42984483", "text": "func Isatty() bool {\n\treturn CapTTY.Isatty()\n}", "title": "" }, { "docid": "66be50a8dcd5e4b722c587de2bae66d0", "score": "0.42968497", "text": "func (suite *APIContainerAttachSuite) TestContainerAttachStdin(c *check.C) {\n\t// TODO: missing case\n\thelpwantedForMissingCase(c, \"container api attach 200 case\")\n}", "title": "" }, { "docid": "74f08d6f5f7df2343d9bbef2799ba5c4", "score": "0.4291822", "text": "func (c *CmdHandle) CmdHealthMonitor(){\n// log.Println(\"CmdHealthMonitor: Start\")\n\n //Check if any of the commands have been running for ever avg timout time 20s\n// log.Println(\"Monitored Cmd Processing Health\")\n\n // Check the system load if less send more commands for processing\n c.CmdProcessPendingCommands()\n\n// log.Println(\"CmdHealthMonitor: Complete\")\n}", "title": "" } ]
c38c51549d713a8240d081e6effdfb73
when troll client recieves message, sends the IncomingMessage to server to be handled
[ { "docid": "524aaedbaceba15cda971190af3b198b", "score": "0.59735864", "text": "func (s *Server) recieveMessage(msg *IncomingMessage) {\n\t//log.Println(\"incoming msg: \", msg)\n\n\tswitch msg.Type {\n\tcase \"ping\":\n\t\ts.recievePingMessage(msg.LocalTroll)\n\tcase \"items\":\n\t\ts.recieveItemsMessage(msg.LocalTroll)\n\tcase \"message\":\n\t\ts.recieveMessageMessage(msg.LocalTroll, msg.Data)\n\tcase \"move\":\n\t\ts.recieveMoveMessage(msg.LocalTroll, msg.Data)\n\tdefault:\n\t\tlog.Println(\"Unknown message type recieved: \", msg.Type)\n\t}\n}", "title": "" } ]
[ { "docid": "fb2df81d970694fdb76acac80ed797fe", "score": "0.6709544", "text": "func HandleIncoming(server *model.Server, client *ws.Client, msg *[]byte) {\n\tvar message model.BaseMessage\n\tif err := json.Unmarshal(*msg, &message); err != nil {\n\t\tlog.Println(fmt.Sprintf(\"Error unmarshaling, %s\", err))\n\t}\n\n\tif message.Msg == inMessageNick {\n\t\thandleInMessageNick(server, client, msg)\n\n\t} else if message.Msg == inMessageCreateGame {\n\t\thandleInMessageCreateGame(server, client)\n\n\t} else if message.Msg == inMessageJoinGame {\n\t\thandleInMessageJoinGame(server, client, msg)\n\n\t} else if message.Msg == inMessageStartGame {\n\t\thandleInMessageStartGame(server, client)\n\n\t} else if message.Msg == inMessageListOfGames {\n\t\thandleInMessageListOfGame(server, client)\n\n\t} else if message.Msg == inMessageMove {\n\t\thandleInMessageMove(server, client, msg)\n\n\t} else if message.Msg == inMessageChangeSeat {\n\t\thandleInMessageChangeSeat(server, client, msg)\n\n\t} else if message.Msg == inMessageDC {\n\t\thandleInMessageDC(server, client)\n\n\t} else {\n\t\tlog.Println(\"Unknown route: \", message.Msg)\n\t\tlog.Println(string(*msg))\n\t}\n\n}", "title": "" }, { "docid": "53601ce257fd401a6f4caf1c6121e584", "score": "0.65673167", "text": "func (webServer *WebServer) handleIncomingMessage(msg sockPacket) {\n\tmessage := core.Message{Text: msg.Message}\n\tif strings.Compare(msg.Type, \"PrivateMessage\") == 0 {\n\t\tmessage.Destination = &msg.Destination\n\t}\n\twebServer.sendMessageToGossiper(message)\n}", "title": "" }, { "docid": "fe5e6c8b68fb468e4cadf8c5f61f89d9", "score": "0.64999616", "text": "func (c *client) handleMessage() {\n\twsConn := c.chatsocket.Conn\n\tproxyID := c.chatsocket.UserID\n\thandler := c.handler\n\n\t<-wsConn.Observable().DoOnNext(func(i interface{}) {\n\t\tmessage := i.([]byte)\n\n\t\tvar rawMessage chatsocket.RawMessage\n\t\tif err := json.Unmarshal(message, &rawMessage); err != nil {\n\t\t\twsConn.SendJSON(wsErrorMessage(\"bad socket message structure\", err.Error()))\n\t\t\treturn\n\t\t}\n\n\t\tswitch rawMessage.Type {\n\t\tcase message_types.Chat:\n\t\t\tvar msg model.Message\n\t\t\tif err := json.Unmarshal(rawMessage.Payload, &msg); err != nil {\n\t\t\t\twsConn.SendJSON(wsErrorMessage(\"bad message payload format\", err.Error()))\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif ok, err := handler.chatService.IsProxyInRoom(proxyID, msg.RoomID.Hex()); err != nil {\n\t\t\t\twsConn.SendJSON(wsErrorMessage(\"can't check room\", err.Error()))\n\t\t\t\treturn\n\t\t\t} else if !ok {\n\t\t\t\twsConn.SendJSON(wsErrorMessage(\"unauthorized\"))\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Saving messag\n\t\t\tmsg.TimeStamp = time.Now()\n\t\t\tif msg.UserID == \"\" {\n\t\t\t\twsConn.SendJSON(wsErrorMessage(\"bad message: missing user ID\"))\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tmessageID, err := handler.chatService.SaveMessage(msg)\n\t\t\tif err != nil {\n\t\t\t\tfmt.Printf(\"error saving message %s\\n\", err.Error())\n\t\t\t\twsConn.SendJSON(wsErrorMessage(\"send failed: error saving message\"))\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tmsg.MessageID = bson.ObjectIdHex(messageID)\n\t\t\tif err = handler.chatService.BroadcastMessageToRoom(msg.RoomID.Hex(), chatsocket.Message{\n\t\t\t\tType: message_types.Chat,\n\t\t\t\tPayload: msg,\n\t\t\t}); err != nil {\n\t\t\t\tfmt.Printf(\"Error bcasting message: %s\\n\", err.Error())\n\t\t\t}\n\n\t\t\tif os.Getenv(\"DISABLE_NOTIF\") == \"\" {\n\t\t\t\thandler.chatService.SendNotificationToRoomExceptUser(msg.RoomID.Hex(), msg.UserID.Hex(), &model.Notification{\n\t\t\t\t\t// Title: \"New Message in room \" + msg.RoomID.Hex(),\n\t\t\t\t\t// Body: fmt.Sprintf(\"[%s]: %s\", msg.UserID.Hex(), msg.Data),\n\t\t\t\t\tData: map[string]string{\n\t\t\t\t\t\t\"roomId\": msg.RoomID.Hex(),\n\t\t\t\t\t\t\"msgId\": msg.MessageID.Hex(),\n\t\t\t\t\t\t\"userId\": msg.UserID.Hex(),\n\t\t\t\t\t\t\"timestamp\": msg.TimeStamp.Format(\"2006-01-02T15:04:05Z\"),\n\t\t\t\t\t},\n\t\t\t\t}, 1*time.Second)\n\t\t\t}\n\t\tdefault:\n\t\t\tfmt.Printf(\"INFO: unrecognized message\\n==\\n%s\\n==\\n\", message)\n\t\t}\n\n\t})\n\n}", "title": "" }, { "docid": "714b8f7288ee8ec76e0d976459978fd0", "score": "0.6414606", "text": "func (s *DiscordBot) incomingMessage(ds *discordgo.Session, m *discordgo.MessageCreate) {\n\ts.handleMessage(ds, m)\n}", "title": "" }, { "docid": "243a26876a4a5ad5ef0dae2bd1235ed9", "score": "0.63572955", "text": "func HandleInputMessage(from *Client, data []byte) {\n\tvar inputJSON map[string]string\n\tjson.Unmarshal(data, &inputJSON)\n\n\tlog.Printf(\"New %v from: %v -> %v\", inputJSON[\"action\"], from.username, inputJSON[\"message\"])\n\n\tvar newMessageToAll Message\n\n\tswitch inputJSON[\"action\"] {\n\tcase \"post_message\":\n\t\tnewMessageToAll = Message{\n\t\t\tSenderID: from.id,\n\t\t\tUsername: from.username,\n\t\t\tMessage: inputJSON[\"message\"],\n\t\t}\n\n\tcase \"initial_connection\":\n\t\tfrom.username = inputJSON[\"username\"]\n\t\tnewMessageToAll = Message{\n\t\t\tSenderID: \"System\",\n\t\t\tUsername: \"System\",\n\t\t\tMessage: fmt.Sprintf(\"%s joined the chat\", from.username),\n\t\t}\n\n\t\tchatHistory, _ := json.Marshal(messages)\n\n\t\tnewUserIDMessage := Message{\n\t\t\tSenderID: \"System\",\n\t\t\tUsername: \"System\",\n\t\t\tMessage: fmt.Sprintf(\"yourId:%v\", from.id),\n\t\t}\n\n\t\tnewUserIDMessage.BroadcastTo(from)\n\n\t\tfrom.ws.Write(chatHistory)\n\t}\n\n\tif len(newMessageToAll.Message) > 0 {\n\t\tnewMessageToAll.Post()\n\t}\n}", "title": "" }, { "docid": "c8cda252f30989ef0cbf37f350e48699", "score": "0.63495153", "text": "func handleMessage(conn *websocket.Conn, message []byte, code uint32, state *utils.State) {\n\tlog.WithFields(log.Fields{\n\t\t\"code\": code,\n\t}).Info(\"RECV:\")\n\n\tswitch code {\n\tcase messages.S_JOIN_RESPONSE:\n\t\t// Response against request to join dicemix transaction\n\t\tresponse := &messages.RegisterResponse{}\n\t\terr := proto.Unmarshal(message, response)\n\t\tcheckError(err)\n\t\thandleJoinResponse(conn, response, state)\n\tcase messages.S_START_DICEMIX:\n\t\t// Response to start DiceMix Run\n\t\tresponse := &messages.DiceMixResponse{}\n\t\terr := proto.Unmarshal(message, response)\n\t\tcheckError(err)\n\t\thandleStartDicemix(conn, response, state)\n\tcase messages.S_KEY_EXCHANGE:\n\t\t// Response against request for KeyExchange\n\t\tresponse := &messages.DiceMixResponse{}\n\t\terr := proto.Unmarshal(message, response)\n\t\tcheckError(err)\n\t\thandleKeyExchangeResponse(conn, response, state)\n\tcase messages.S_EXP_DC_VECTOR:\n\t\t// contains roots of DC-Combined\n\t\tresponse := &messages.DCExpResponse{}\n\t\terr := proto.Unmarshal(message, response)\n\t\tcheckError(err)\n\t\thandleDCExpResponse(conn, response, state)\n\tcase messages.S_SIMPLE_DC_VECTOR:\n\t\t// conatins peers DC-SIMPLE-VECTOR's\n\t\tresponse := &messages.DCSimpleResponse{}\n\t\terr := proto.Unmarshal(message, response)\n\t\tcheckError(err)\n\t\thandleDCSimpleResponse(conn, response, state)\n\tcase messages.S_TX_SUCCESSFUL:\n\t\t// conatins success message for TX\n\t\tresponse := &messages.TXDoneResponse{}\n\t\terr := proto.Unmarshal(message, response)\n\t\tcheckError(err)\n\t\thandleTXDoneResponse(conn, response, state)\n\tcase messages.S_KESK_REQUEST:\n\t\tresponse := &messages.InitiaiteKESK{}\n\t\terr := proto.Unmarshal(message, response)\n\t\tcheckError(err)\n\t\thandleKESKRequest(conn, response, state)\n\t}\n}", "title": "" }, { "docid": "27218d8523b3426ef691b83979b26244", "score": "0.63131565", "text": "func (cs *ClientServerImpl) handleMessage(data []byte) {\n\ttypedMessage, typeStr, err := DecodeData(data, cs.TypeDecoder)\n\tif err != nil {\n\t\tlogger.Warn(fmt.Sprintf(\"Unable to handle message from backend: %v\", err))\n\t\treturn\n\t}\n\n\tlogger.Debug(fmt.Sprintf(\"Received message of type: %s\", typeStr))\n\n\tif cs.AnyRequestHandler != nil {\n\t\treflect.ValueOf(cs.AnyRequestHandler).Call([]reflect.Value{reflect.ValueOf(typedMessage)})\n\t}\n\n\tif handler, ok := cs.RequestHandlers[typeStr]; ok {\n\t\treflect.ValueOf(handler).Call([]reflect.Value{reflect.ValueOf(typedMessage)})\n\t} else {\n\t\tlogger.Info(fmt.Sprintf(\"No handler for message type: %s %s\", typeStr, typedMessage))\n\t}\n}", "title": "" }, { "docid": "4e388b7eb8f44847e9cd232f98ec2805", "score": "0.6268813", "text": "func handleMessage(msg *sioclient.Message) error {\n\tif msg.Type != sioclient.MessageTypeEvent {\n\t\t// We don't care about anything but events\n\t\treturn nil\n\t}\n\n\tpType, err := msg.PayloadType()\n\tif err != nil {\n\t\tlog.Printf(\"Event message had no payload type: %#v - %s\", msg, err)\n\t\treturn nil\n\t}\n\n\tswitch pType {\n\n\tcase \"auth:failed\":\n\t\tlog.Fatal(\"Login failed\")\n\n\tcase \"auth:start\":\n\t\tmsg, err := sioclient.NewMessage(sioclient.MessageTypeEvent, 0, \"auth:perform\", map[string]string{\"user\": cfg.Username, \"password\": cfg.Password})\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"Unable to create auth:peform\")\n\t\t}\n\n\t\tif err := msg.Send(client); err != nil {\n\t\t\treturn errors.Wrap(err, \"Unable to create payload\")\n\t\t}\n\n\tcase \"auth:success\":\n\t\tlog.Info(\"Logged in successfully\")\n\n\tcase \"init\":\n\t\tif err := json.Unmarshal(msg.Payload[1], &initData); err != nil {\n\t\t\treturn errors.Wrap(err, \"Unable to parse init payload\")\n\t\t}\n\n\tcase \"msg\":\n\t\t// Message in channel\n\t\tvar payload chatMessage\n\t\tif err := json.Unmarshal(msg.Payload[1], &payload); err != nil {\n\t\t\treturn errors.Wrap(err, \"Unable to parse init payload\")\n\t\t}\n\n\t\tswitch payload.Msg.Type {\n\n\t\tcase \"join\", \"part\":\n\t\t\t// Don't care\n\n\t\tcase \"message\", \"notice\":\n\t\t\t//log.Infof(\"Msg: %#v\", payload)\n\n\t\tcase \"unhandled\":\n\t\t\tlog.Infof(\"CMD: %s\", msg.Payload[1])\n\n\t\tdefault:\n\t\t\tlog.Infof(\"Unhandled message %q: %#v\", payload.Msg.Type, payload)\n\n\t\t}\n\n\tcase \"commands\", \"configuration\", \"names\", \"open\", \"push:issubscribed\", \"users\":\n\t\t// Drop irrelevantt messages\n\n\tdefault:\n\t\tif len(msg.Payload) == 2 {\n\t\t\tlog.Warnf(\"Recieved unhandled message %q: %s\", pType, msg.Payload[1])\n\t\t\treturn nil\n\t\t}\n\t\tlog.Warnf(\"Recieved unhandled message %q: %#v\", pType, msg)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "6d3079badac178a044fc0f1db91fef88", "score": "0.6262695", "text": "func MsginHandle(party tss.Party, msg tss.Message, errCh chan<- *tss.Error) {\n\tif party.PartyID() == msg.GetFrom() {\n\t\treturn\n\t}\n\tbz, _, err := msg.WireBytes()\n\tif err != nil {\n\t\terrCh <- party.WrapError(err)\n\t\treturn\n\t}\n\tpMsg, err := tss.ParseWireMessage(bz, msg.GetFrom(), msg.IsBroadcast())\n\tif err != nil {\n\t\terrCh <- party.WrapError(err)\n\t\treturn\n\t}\n\t// fmt.Println(\"Update start\")\n\tif _, err := party.Update(pMsg); err != nil {\n\t\t// fmt.Println(\"handle the in msgs err:\", err)\n\t\terrCh <- err\n\t}\n}", "title": "" }, { "docid": "958ee7930b6d36afe6e8aa2de0242c57", "score": "0.6232154", "text": "func handleOutgoing() {\n\tfor {\n\t\t// Grab user input for message\n\t\tinput := bufio.NewReader(os.Stdin)\n\t\tmsg, _ := input.ReadString('\\n')\n\t\thistory = append(history, msg)\n\t\tfor _, client := range clients {\n\t\t\tclient.conn.Write([]byte(\"( SERVER ) : \" + msg))\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ebce792ebaca9ab6491660819139a398", "score": "0.6204701", "text": "func (s *Server) HandleClientRequest() {\n\tfor {\n\t\tmsg := <-s.handleMessage\n\t\tvar response common.ServerResponse\n\t\tswitch msg.MessageHeader.MessageType {\n\t\tcase common.GeneralRoom:\n\t\t\ts.general = append(s.general, msg)\n\t\t\taddrs := make([]string, 0, len(s.users))\n\t\t\tfor _, v := range s.users {\n\t\t\t\taddrs = append(addrs, v.Addr)\n\t\t\t}\n\t\t\tresponse = common.ServerResponse{\n\t\t\t\tMessage: common.Message{\n\t\t\t\t\tMessageHeader: common.MessageHeader{\n\t\t\t\t\t\tMessageType: common.GeneralRoom,\n\t\t\t\t\t\tResponseStatus: common.Ok,\n\t\t\t\t\t\tRemoteAddr: msg.MessageHeader.RemoteAddr,\n\t\t\t\t\t},\n\t\t\t\t\tAuthor: msg.Author,\n\t\t\t\t\tContent: msg.Content,\n\t\t\t\t},\n\t\t\t\tAddrs: addrs,\n\t\t\t}\n\t\tcase common.DialogueRoom:\n\t\t\tid := msg.MessageHeader.DestinationID\n\t\t\ts.dialogues[id].Messages = append(s.dialogues[id].Messages, msg)\n\t\t\tif len(s.dialogues[id].Users) == 1 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tvar receiver *common.User\n\t\t\tvar addrs string\n\t\t\tfor _, v := range s.dialogues[id].Users {\n\t\t\t\tif v.Addr != msg.MessageHeader.RemoteAddr {\n\t\t\t\t\treceiver = v\n\t\t\t\t\taddrs = receiver.Addr\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif !receiver.IsOnline {\n\t\t\t\ts.dialogues[id].LastMessageAddr = msg.MessageHeader.RemoteAddr\n\t\t\t} else {\n\t\t\t\tresponse = common.ServerResponse{\n\t\t\t\t\tMessage: common.Message{\n\t\t\t\t\t\tMessageHeader: common.MessageHeader{\n\t\t\t\t\t\t\tMessageType: common.DialogueRoom,\n\t\t\t\t\t\t\tDestinationID: id,\n\t\t\t\t\t\t\tResponseStatus: common.Ok,\n\t\t\t\t\t\t\tRemoteAddr: msg.MessageHeader.RemoteAddr,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tAuthor: msg.Author,\n\t\t\t\t\t\tContent: msg.Author + \" : \" + msg.Content + \"\\n\",\n\t\t\t\t\t},\n\t\t\t\t\tAddrs: []string{addrs},\n\t\t\t\t}\n\n\t\t\t\ts.sendMessage <- response\n\n\t\t\t\tresponse = common.ServerResponse{\n\t\t\t\t\tMessage: common.Message{\n\t\t\t\t\t\tMessageHeader: common.MessageHeader{\n\t\t\t\t\t\t\tMessageType: common.DialogueRoom,\n\t\t\t\t\t\t\tDestinationID: id,\n\t\t\t\t\t\t\tResponseStatus: common.Ok,\n\t\t\t\t\t\t\tRemoteAddr: msg.MessageHeader.RemoteAddr,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tAuthor: msg.Author,\n\t\t\t\t\t\tContent: \"*Message recieved*\\n\",\n\t\t\t\t\t},\n\t\t\t\t\tAddrs: []string{msg.MessageHeader.RemoteAddr},\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase common.GroupRoom:\n\t\t\tid := msg.MessageHeader.DestinationID\n\t\t\ts.groups[id].Messages = append(s.groups[id].Messages, msg)\n\t\t\taddrs := make([]string, 0)\n\t\t\tfor _, v := range s.groups[id].Users {\n\t\t\t\tif v.Addr == msg.MessageHeader.RemoteAddr {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif v.IsOnline {\n\t\t\t\t\taddrs = append(addrs, v.Addr)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// if nobody read message\n\t\t\tif len(addrs) == 0 {\n\t\t\t\ts.groups[id].LastMessageAddr = msg.MessageHeader.RemoteAddr\n\t\t\t} else {\n\t\t\t\tresponse = common.ServerResponse{\n\t\t\t\t\tMessage: common.Message{\n\t\t\t\t\t\tMessageHeader: common.MessageHeader{\n\t\t\t\t\t\t\tMessageType: common.GroupRoom,\n\t\t\t\t\t\t\tDestinationID: id,\n\t\t\t\t\t\t\tResponseStatus: common.Ok,\n\t\t\t\t\t\t\tRemoteAddr: msg.MessageHeader.RemoteAddr,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tAuthor: msg.Author,\n\t\t\t\t\t\tContent: \"*Message recieved*\\n\",\n\t\t\t\t\t},\n\t\t\t\t\tAddrs: []string{msg.MessageHeader.RemoteAddr},\n\t\t\t\t}\n\t\t\t\ts.sendMessage <- response\n\n\t\t\t\tresponse = common.ServerResponse{\n\t\t\t\t\tMessage: common.Message{\n\t\t\t\t\t\tMessageHeader: common.MessageHeader{\n\t\t\t\t\t\t\tMessageType: common.GroupRoom,\n\t\t\t\t\t\t\tDestinationID: id,\n\t\t\t\t\t\t\tResponseStatus: common.Ok,\n\t\t\t\t\t\t\tRemoteAddr: msg.MessageHeader.RemoteAddr,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tAuthor: msg.Author,\n\t\t\t\t\t\tContent: msg.Author + \" : \" + msg.Content + \"\\n\",\n\t\t\t\t\t},\n\t\t\t\t\tAddrs: addrs,\n\t\t\t\t}\n\t\t\t}\n\t\tcase common.Instruction:\n\t\t\tswitch msg.MessageHeader.Function {\n\t\t\tcase common.LogIn:\n\t\t\t\tvar content string\n\t\t\t\tvar status common.ResponseStatus\n\t\t\t\t_, ok := s.users[msg.Author]\n\t\t\t\tif !ok {\n\t\t\t\t\ts.users[msg.Author] = &common.User{\n\t\t\t\t\t\tUsername: msg.Author,\n\t\t\t\t\t\tAddr: msg.MessageHeader.RemoteAddr,\n\t\t\t\t\t}\n\t\t\t\t\tlogrus.Info(\"a new user was registered\")\n\t\t\t\t\tstatus = common.Ok\n\t\t\t\t\tcontent = \"\\nYou have been succesfully registered!\\n\" + common.CommandsInfo + common.InputArrows\n\t\t\t\t} else {\n\t\t\t\t\tstatus = common.Fail\n\t\t\t\t\tcontent = \"\\nSuch user exist\\n\"\n\t\t\t\t\tlogrus.Error(\"was not registered new user\")\n\t\t\t\t}\n\t\t\t\taddrs := make([]string, 0)\n\t\t\t\taddrs = append(addrs, msg.MessageHeader.RemoteAddr)\n\t\t\t\tresponse = common.ServerResponse{\n\t\t\t\t\tMessage: common.Message{\n\t\t\t\t\t\tMessageHeader: common.MessageHeader{\n\t\t\t\t\t\t\tMessageType: msg.MessageHeader.MessageType,\n\t\t\t\t\t\t\tFunction: msg.MessageHeader.Function,\n\t\t\t\t\t\t\tResponseStatus: status,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tAuthor: msg.Author,\n\t\t\t\t\t\tContent: content,\n\t\t\t\t\t},\n\t\t\t\t\tAddrs: addrs,\n\t\t\t\t}\n\t\t\tcase common.CreateDialogue:\n\t\t\t\tusers := make(map[string]*common.User)\n\t\t\t\tfor _, v := range msg.MessageHeader.RequestCreateConf.UserNames {\n\t\t\t\t\tusers[v] = s.users[v]\n\t\t\t\t}\n\t\t\t\tnewID := len(s.dialogues) + 1\n\t\t\t\ts.dialogues[newID] = &common.Conf{\n\t\t\t\t\tName: msg.MessageHeader.RequestCreateConf.Name,\n\t\t\t\t\tMessages: make([]common.Message, 0),\n\t\t\t\t\tUsers: users,\n\t\t\t\t}\n\t\t\t\taddrs := make([]string, 0)\n\t\t\t\tfor _, v := range users {\n\t\t\t\t\taddrs = append(addrs, v.Addr)\n\t\t\t\t}\n\t\t\t\tstatusStr := \"Dialogue created successfully, dialogue name : \" + s.dialogues[newID].Name + common.InputArrows\n\t\t\t\tresponse = common.ServerResponse{\n\t\t\t\t\tMessage: common.Message{\n\t\t\t\t\t\tMessageHeader: common.MessageHeader{\n\t\t\t\t\t\t\tMessageType: msg.MessageHeader.MessageType,\n\t\t\t\t\t\t\tFunction: msg.MessageHeader.Function,\n\t\t\t\t\t\t\tResponseStatus: common.Ok,\n\t\t\t\t\t\t\tRemoteAddr: msg.MessageHeader.RemoteAddr,\n\t\t\t\t\t\t\tResponseCreateConf: common.ResponseCreateConf{\n\t\t\t\t\t\t\t\tName: msg.MessageHeader.RequestCreateConf.Name,\n\t\t\t\t\t\t\t\tID: newID,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tContent: statusStr,\n\t\t\t\t\t\tAuthor: msg.Author,\n\t\t\t\t\t},\n\t\t\t\t\tAddrs: addrs,\n\t\t\t\t}\n\t\t\t\tfmt.Println(s.dialogues[1])\n\t\t\tcase common.CreateGroup:\n\t\t\t\tusers := make(map[string]*common.User)\n\t\t\t\tfor _, v := range msg.MessageHeader.RequestCreateConf.UserNames {\n\t\t\t\t\tusers[v] = s.users[v]\n\t\t\t\t}\n\t\t\t\tnewID := len(s.groups) + 1\n\t\t\t\ts.groups[newID] = &common.Conf{\n\t\t\t\t\tName: msg.MessageHeader.RequestCreateConf.Name,\n\t\t\t\t\tMessages: make([]common.Message, 0),\n\t\t\t\t\tUsers: users,\n\t\t\t\t\tLastMessageAddr: \"\",\n\t\t\t\t}\n\t\t\t\taddrs := make([]string, 0)\n\t\t\t\tfor _, v := range users {\n\t\t\t\t\taddrs = append(addrs, v.Addr)\n\t\t\t\t}\n\t\t\t\tstatusStr := \"Group created successfully, group name : \" + s.groups[newID].Name + common.InputArrows\n\t\t\t\tresponse = common.ServerResponse{\n\t\t\t\t\tMessage: common.Message{\n\t\t\t\t\t\tMessageHeader: common.MessageHeader{\n\t\t\t\t\t\t\tMessageType: msg.MessageHeader.MessageType,\n\t\t\t\t\t\t\tFunction: msg.MessageHeader.Function,\n\t\t\t\t\t\t\tResponseStatus: common.Ok,\n\t\t\t\t\t\t\tRemoteAddr: msg.MessageHeader.RemoteAddr,\n\t\t\t\t\t\t\tResponseCreateConf: common.ResponseCreateConf{\n\t\t\t\t\t\t\t\tName: msg.MessageHeader.RequestCreateConf.Name,\n\t\t\t\t\t\t\t\tID: newID,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tContent: statusStr,\n\t\t\t\t\t\tAuthor: msg.Author,\n\t\t\t\t\t},\n\t\t\t\t\tAddrs: addrs,\n\t\t\t\t}\n\t\t\t\tlogrus.Info(\"a new group was created\")\n\n\t\t\tcase common.ConnectGroup:\n\t\t\t\t//template of response\n\t\t\t\tresponse = common.ServerResponse{\n\t\t\t\t\tMessage: common.Message{\n\t\t\t\t\t\tMessageHeader: common.MessageHeader{\n\t\t\t\t\t\t\tMessageType: msg.MessageHeader.MessageType,\n\t\t\t\t\t\t\tFunction: msg.MessageHeader.Function,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tAuthor: msg.Author,\n\t\t\t\t\t},\n\t\t\t\t\tAddrs: []string{msg.MessageHeader.RemoteAddr},\n\t\t\t\t}\n\n\t\t\t\t//check if such group exists\n\t\t\t\tvar isNotExist bool\n\t\t\t\tvar confKey int\n\t\t\t\tfor key := range s.groups {\n\t\t\t\t\tif s.groups[key].Name == msg.Content {\n\t\t\t\t\t\tisNotExist = true\n\t\t\t\t\t\tconfKey = key\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif !isNotExist {\n\t\t\t\t\tresponse.Message.Content = \"No group with such name\" + common.InputArrows\n\t\t\t\t\tresponse.Message.MessageHeader.ResponseStatus = common.Fail\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\t//check user member of conf\n\t\t\t\t_, ok := s.groups[confKey].Users[msg.Author]\n\t\t\t\tif !ok {\n\t\t\t\t\tresponse.Message.Content = \"You're not member of this group\" + common.InputArrows\n\t\t\t\t\tresponse.Message.MessageHeader.ResponseStatus = common.Fail\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\t//make this user online in chat\n\t\t\t\ts.groups[confKey].Users[msg.Author].IsOnline = true\n\n\t\t\t\t//collect all messages from group\n\t\t\t\tvar content string = \"*You are in \" + s.groups[confKey].Name + \" group*\\n\"\n\t\t\t\tfor _, message := range s.groups[confKey].Messages {\n\t\t\t\t\tcontent += message.Author + \": \" + message.Content + \"\\n\"\n\t\t\t\t}\n\n\t\t\t\t//if there unread messages\n\t\t\t\tif s.groups[confKey].LastMessageAddr != \"\" {\n\t\t\t\t\tvar res = common.ServerResponse{\n\t\t\t\t\t\tMessage: common.Message{\n\t\t\t\t\t\t\tMessageHeader: common.MessageHeader{\n\t\t\t\t\t\t\t\tMessageType: common.GroupRoom,\n\t\t\t\t\t\t\t\tDestinationID: confKey,\n\t\t\t\t\t\t\t\tResponseStatus: common.Ok,\n\t\t\t\t\t\t\t\tRemoteAddr: msg.MessageHeader.RemoteAddr,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tAuthor: msg.Author,\n\t\t\t\t\t\t\tContent: \"*Message recieved*\\n\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\tAddrs: []string{s.groups[confKey].LastMessageAddr},\n\t\t\t\t\t}\n\t\t\t\t\ts.sendMessage <- res\n\t\t\t\t\ts.groups[confKey].LastMessageAddr = \"\"\n\t\t\t\t}\n\n\t\t\t\tresponse.Message.Content = content\n\t\t\t\tresponse.Message.MessageHeader.DestinationID = confKey\n\t\t\t\tresponse.Message.MessageHeader.ResponseStatus = common.Ok\n\t\t\t\tresponse.Message.MessageHeader.ResponseCreateConf.Name = s.groups[confKey].Name\n\n\t\t\tcase common.ConnectDialogue:\n\t\t\t\t//template of response\n\t\t\t\tresponse = common.ServerResponse{\n\t\t\t\t\tMessage: common.Message{\n\t\t\t\t\t\tMessageHeader: common.MessageHeader{\n\t\t\t\t\t\t\tMessageType: msg.MessageHeader.MessageType,\n\t\t\t\t\t\t\tFunction: msg.MessageHeader.Function,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tAuthor: msg.Author,\n\t\t\t\t\t},\n\t\t\t\t\tAddrs: []string{msg.MessageHeader.RemoteAddr},\n\t\t\t\t}\n\n\t\t\t\t//check if such group exists\n\t\t\t\tvar isNotExist bool\n\t\t\t\tvar confKey int\n\t\t\t\tfor key := range s.dialogues {\n\t\t\t\t\tif s.dialogues[key].Name == msg.Content {\n\t\t\t\t\t\tisNotExist = true\n\t\t\t\t\t\tconfKey = key\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif !isNotExist {\n\t\t\t\t\tresponse.Message.Content = \"No dialogue with such name\" + common.InputArrows\n\t\t\t\t\tresponse.Message.MessageHeader.ResponseStatus = common.Fail\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\t//check user member of conf\n\t\t\t\t_, ok := s.dialogues[confKey].Users[msg.Author]\n\t\t\t\tif !ok {\n\t\t\t\t\tresponse.Message.Content = \"You're not member of this dialogue\" + common.InputArrows\n\t\t\t\t\tresponse.Message.MessageHeader.ResponseStatus = common.Fail\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\t//make this user online in chat\n\t\t\t\ts.dialogues[confKey].Users[msg.Author].IsOnline = true\n\n\t\t\t\t//collect all messages from group\n\t\t\t\tvar content string = \"*You are in \" + s.dialogues[confKey].Name + \" dialogue*\\n\"\n\t\t\t\tfor _, message := range s.dialogues[confKey].Messages {\n\t\t\t\t\tcontent += message.Author + \": \" + message.Content + \"\\n\"\n\t\t\t\t}\n\n\t\t\t\t//if there unread messages\n\t\t\t\tif s.dialogues[confKey].LastMessageAddr != \"\" {\n\t\t\t\t\tvar res = common.ServerResponse{\n\t\t\t\t\t\tMessage: common.Message{\n\t\t\t\t\t\t\tMessageHeader: common.MessageHeader{\n\t\t\t\t\t\t\t\tMessageType: common.DialogueRoom,\n\t\t\t\t\t\t\t\tDestinationID: confKey,\n\t\t\t\t\t\t\t\tResponseStatus: common.Ok,\n\t\t\t\t\t\t\t\tRemoteAddr: msg.MessageHeader.RemoteAddr,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tAuthor: msg.Author,\n\t\t\t\t\t\t\tContent: \"*Message recieved*\\n\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\tAddrs: []string{s.dialogues[confKey].LastMessageAddr},\n\t\t\t\t\t}\n\t\t\t\t\ts.sendMessage <- res\n\t\t\t\t\ts.dialogues[confKey].LastMessageAddr = \"\"\n\t\t\t\t}\n\n\t\t\t\tresponse.Message.Content = content\n\t\t\t\tresponse.Message.MessageHeader.DestinationID = confKey\n\t\t\t\tresponse.Message.MessageHeader.ResponseStatus = common.Ok\n\t\t\t\tresponse.Message.MessageHeader.ResponseCreateConf.Name = s.dialogues[confKey].Name\n\n\t\t\tcase common.InviteToDialogue:\n\t\t\t\t//template of response\n\t\t\t\tresponse = common.ServerResponse{\n\t\t\t\t\tMessage: common.Message{\n\t\t\t\t\t\tMessageHeader: common.MessageHeader{\n\t\t\t\t\t\t\tMessageType: msg.MessageHeader.MessageType,\n\t\t\t\t\t\t\tFunction: msg.MessageHeader.Function,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tAuthor: msg.Author,\n\t\t\t\t\t},\n\t\t\t\t\tAddrs: []string{msg.MessageHeader.RemoteAddr},\n\t\t\t\t}\n\n\t\t\t\t//check if user with such username exists\n\t\t\t\tusr, ok := s.users[msg.Content]\n\t\t\t\tif !ok {\n\t\t\t\t\tresponse.Message.Content = \"There is no such user registered.\\n\"\n\t\t\t\t\tresponse.Message.MessageHeader.ResponseStatus = common.Fail\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\t//check if there is more than 2 users\n\t\t\t\tif len(s.dialogues[msg.MessageHeader.DestinationID].Users) == 2 {\n\t\t\t\t\tresponse.Message.Content = \"*There are also 2 users in dialogue*\\n\"\n\t\t\t\t\tresponse.Message.MessageHeader.ResponseStatus = common.Fail\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\t//adding new user to conf\n\t\t\t\ts.dialogues[msg.MessageHeader.DestinationID].Users[usr.Username] = usr\n\t\t\t\tresponse.Message.Content = \"*User \" + usr.Username + \" sucesfully added!*\\n\"\n\n\t\t\tcase common.InviteToGroup:\n\t\t\t\t//template of response\n\t\t\t\tresponse = common.ServerResponse{\n\t\t\t\t\tMessage: common.Message{\n\t\t\t\t\t\tMessageHeader: common.MessageHeader{\n\t\t\t\t\t\t\tMessageType: msg.MessageHeader.MessageType,\n\t\t\t\t\t\t\tFunction: msg.MessageHeader.Function,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tAuthor: msg.Author,\n\t\t\t\t\t},\n\t\t\t\t\tAddrs: []string{msg.MessageHeader.RemoteAddr},\n\t\t\t\t}\n\n\t\t\t\t//check if such user exists\n\t\t\t\tusr, ok := s.users[msg.Content]\n\t\t\t\tif !ok {\n\t\t\t\t\tresponse.Message.Content = \"*There is no such user registered*\\n\"\n\t\t\t\t\tresponse.Message.MessageHeader.ResponseStatus = common.Fail\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\t//TODO : check if user already invited\n\n\t\t\t\t//adding new user to conf\n\t\t\t\ts.groups[msg.MessageHeader.DestinationID].Users[usr.Username] = usr\n\t\t\t\tresponse.Message.Content = \"*User \" + usr.Username + \" sucesfully added!*\\n\"\n\n\t\t\tcase common.Disconnect:\n\t\t\t\tresponse = common.ServerResponse{\n\t\t\t\t\tMessage: common.Message{\n\t\t\t\t\t\tMessageHeader: common.MessageHeader{\n\t\t\t\t\t\t\tMessageType: msg.MessageHeader.MessageType,\n\t\t\t\t\t\t\tFunction: msg.MessageHeader.Function,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tAuthor: msg.Author,\n\t\t\t\t\t},\n\t\t\t\t\tAddrs: []string{msg.MessageHeader.RemoteAddr},\n\t\t\t\t}\n\n\t\t\t\tif msg.Content == string(common.CommandGroupConnect) {\n\t\t\t\t\ts.groups[msg.MessageHeader.DestinationID].Users[msg.Author].IsOnline = false\n\t\t\t\t} else if msg.Content == string(common.CommandDialogueConnect) {\n\t\t\t\t\ts.dialogues[msg.MessageHeader.DestinationID].Users[msg.Author].IsOnline = false\n\t\t\t\t}\n\t\t\t\tresponse.Message.Content = common.InputArrows\n\t\t\t}\n\t\t}\n\t\ts.sendMessage <- response\n\t}\n}", "title": "" }, { "docid": "5520010b23dde6729bec6df663b0ca90", "score": "0.6199846", "text": "func (s *Server) RecieveClientMessage() {\n\tfor {\n\t\tbuff := make([]byte, 1024)\n\t\tbytes, _, err := s.listener.ReadFromUDP(buff)\n\t\tcommon.HandleError(err, common.ErrorFatal)\n\t\tvar msg common.Message\n\t\terr = json.Unmarshal(buff[:bytes-1], &msg)\n\t\tcommon.HandleError(err, common.ErrorFatal)\n\t\ts.handleMessage <- msg\n\t}\n}", "title": "" }, { "docid": "4f934babb1642515394f82e830ba5085", "score": "0.61975574", "text": "func (tm *TreadMarks) messageHandler() {\n\ttm.group.Add(1)\nLoop:\n\tfor {\n\t\ttime.Sleep(0)\n\t\tvar msg []byte\n\t\tselect {\n\t\tcase msg = <-tm.in:\n\t\tcase <-tm.shutdown:\n\t\t\tbreak Loop\n\t\t}\n\t\tbuf := msg[2:]\n\t\tevent := \"Receive \" + msgName[msg[1]]\n\t\topt:= govec.GetDefaultLogOptions()\n\t\tswitch msg[1] {\n\t\tcase LOCKREQ: //lock acquire request\n\t\t\tvar req LockAcquireRequest\n\t\t\ttm.vecLog.UnpackReceive(event, buf, &req, opt)\n\t\t\ttm.lockAcquireRequestHandler(req)\n\t\tcase LOCKRSP: //lock acquire response\n\t\t\tvar resp LockAcquireResponse\n\t\t\ttm.vecLog.UnpackReceive(event, buf, &resp, opt)\n\t\t\ttm.lockAcquireResponseHandler(resp)\n\t\tcase BARRREQ: //Barrier Request\n\t\t\tvar req BarrierRequest\n\t\t\ttm.vecLog.UnpackReceive(event, buf, &req, opt)\n\t\t\ttm.barrierRequestHandler(req)\n\t\tcase BARRRSP: //Barrier response\n\t\t\tvar resp BarrierResponse\n\t\t\ttm.vecLog.UnpackReceive(event, buf, &resp, opt)\n\t\t\ttm.barrierResponseHandler(resp)\n\t\tcase COPYREQ: //Copy request\n\t\t\tvar req CopyRequest\n\t\t\ttm.vecLog.UnpackReceive(event, buf, &req, opt)\n\t\t\ttm.copyRequestHandler(req)\n\t\tcase COPYRSP: //Copy response\n\t\t\tvar resp CopyResponse\n\t\t\ttm.vecLog.UnpackReceive(event, buf, &resp, opt)\n\t\t\ttm.copyResponseHandler(resp)\n\t\tcase DIFFREQ: // Diff request\n\t\t\tvar req DiffRequest\n\t\t\treq.From = uint8(msg[0])\n\t\t\ttm.vecLog.UnpackReceive(event, buf, &req, opt)\n\t\t\ttm.diffRequestHandler(req)\n\t\tcase DIFFRSP: //Diff response\n\t\t\tvar resp DiffResponse\n\t\t\ttm.vecLog.UnpackReceive(event, buf, &resp, opt)\n\t\t\ttm.diffResponseHandler(resp)\n\t\t}\n\t}\n\ttm.group.Done()\n}", "title": "" }, { "docid": "dcf03b9809e263e33df0280785e134a9", "score": "0.61937153", "text": "func (tcp *TCPServer) clientHandler(conn net.Conn) {\n\t// read first 1024 bytes\n\tbuffer := make([]byte, 1024)\n\n\t// read first 1024 bytes\n\tb, err := conn.Read(buffer)\n\tif err != nil {\n\t\treturn\n\t}\n\n\t// split message into payload length, identifier, and payload\n\tpayloadLength, _ := binary.Uvarint(buffer[:4])\n\tid := int(buffer[4])\n\tpayload := make([]byte, b-5)\n\tcopy(payload, buffer[5:b])\n\n\t// read rest of payload, 1024 bytes at a time\n\t// TODO: add a timeout\n\tbytesRead := len(payload)\n\tfor uint64(bytesRead) != payloadLength {\n\t\tb, err = conn.Read(buffer)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tpayload = append(payload, buffer[:b]...)\n\t\tbytesRead += b\n\t}\n\n\t// Message sent directly to TCPServer\n\t// for now, just send it to the first message handler\n\tif id == 0 {\n\t\ttcp.MessageHandlers[1].HandleMessage(payload)\n\t\treturn\n\t}\n\n\t// look up message handler and call it\n\tif id < len(tcp.MessageHandlers) {\n\t\ttcp.MessageHandlers[id].HandleMessage(payload)\n\t}\n}", "title": "" }, { "docid": "2c1670122dd3de3f5939b187704f2b43", "score": "0.61719525", "text": "func (c *Client) handleRequest(data []byte, tx server.Stream) error {\n\tc.instruments.Log(octo.LOGINFO, c.info.UUID, \"tcp.Client.handleRequest\", \"Started\")\n\n\t// c.sg.Add(1)\n\t// defer c.sg.Done()\n\n\tif bytes.Equal(data, consts.PONGCTRLByte) {\n\t\treturn nil\n\t}\n\n\t// Trim Suffix from data.\n\tif bytes.HasSuffix(data, consts.PONGCTRLByte) {\n\t\tdata = bytes.TrimSuffix(data, consts.PONGCTRLByte)\n\t}\n\n\t// Trim Prefix from data.\n\tif bytes.HasPrefix(data, consts.PONGCTRLByte) {\n\t\tdata = bytes.TrimPrefix(data, consts.PONGCTRLByte)\n\t}\n\n\tif err := c.system.Serve(data, tx); err != nil {\n\t\tc.instruments.Log(octo.LOGINFO, c.info.UUID, \"tcp.Client.handleRequest\", \"Completed : System Serve : Error : %+s\", err)\n\t\treturn err\n\t}\n\n\tc.instruments.Log(octo.LOGINFO, c.info.UUID, \"tcp.Client.handleRequest\", \"Completed\")\n\treturn nil\n}", "title": "" }, { "docid": "48065cbaa259befc95f5cdad513302a5", "score": "0.61552095", "text": "func (client *Client) Message() {\n\tfor data := range client.inbound {\n\t\tswitch data.Command {\n\t\tcase \"authenticate\":\n\t\t\t{\n\t\t\t\tclient.secret = data.Payload\n\t\t\t\tInfo.Printf(\"Client %v authenticated\\n\", client.ID)\n\t\t\t\tm := Message{\"authenticated\", client.ID}\n\t\t\t\tclient.outbound <- m\n\t\t\t\tgo client.AttachHandler()\n\t\t\t}\n\t\tcase \"heartbeat\":\n\t\t\t{\n\t\t\t\tm := Message{\"heartbeat\", \"\"}\n\t\t\t\tclient.outbound <- m\n\t\t\t}\n\t\tcase \"image\":\n\t\t\t{\n\t\t\t\tif !client.image_write_locked {\n\t\t\t\t\tbin, _ := base64.StdEncoding.DecodeString(data.Payload)\n\t\t\t\t\tclient.image_stream <- bin\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "67ad1401eda226436909e4375de4c646", "score": "0.6145372", "text": "func handleClientMessage(buf []byte, remoteaddr *net.UDPAddr, g *Gossiper) {\n\tvar pkt common.ClientPacket\n\terr := protobuf.Decode(buf, &pkt)\n\n\tif common.CheckRead(err) {\n\t\treturn\n\t}\n\n\tg.ClientAddress = remoteaddr\n\n\t// demultiplex packet\n\n\tif pkt.NewNode != nil {\n\t\t// process new node\n\t\tprocessNewNode(pkt.NewNode, g)\n\t}\n\tif pkt.NewMessage != nil {\n\t\t// process new message\n\t\tprocessNewMessage(pkt.NewMessage, g, remoteaddr)\n\t}\n\tif pkt.NewPrivateMessage != nil {\n\t\t// process new private message\n\t\tprocessNewPrivateMessage(pkt.NewPrivateMessage, g)\n\t}\n\tif pkt.RequestUpdate != nil {\n\t\t// process update request\n\t\tprocessRequestUpdate(pkt.RequestUpdate, g, remoteaddr)\n\t}\n\tif pkt.NewFile != nil {\n\t\t// process new file\n\t\tprocessNewFile(pkt.NewFile, g)\n\t}\n\tif pkt.FileRequest != nil {\n\t\t// process file request\n\t\tprocessFileRequest(pkt.FileRequest, g)\n\t}\n}", "title": "" }, { "docid": "815c720309de772bcf89b461fe7b64e5", "score": "0.6133433", "text": "func (c *Client) handleIncomingMessages() {\n\tmessage := new(types.WebsocketMessage)\n\tgo func() {\n\t\tfor {\n\t\t\terr := c.connection.ReadJSON(&message)\n\t\t\tif err != nil {\n\t\t\t\tif websocket.IsUnexpectedCloseError(err, websocket.CloseGoingAway, websocket.CloseAbnormalClosure) {\n\t\t\t\t\tlog.Print(err)\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tc.Responses <- message\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "336829dda4816c40e9a29eb1f4ba1123", "score": "0.6128073", "text": "func (c *Client) read() {\n // log.Println(\"Starting cli read\")\n defer func() {\n c.party.unregister <- c\n c.conn.Close()\n }()\n\n c.conn.SetReadLimit(maxMesasgeSize)\n c.conn.SetReadDeadline(time.Now().Add(pongWait))\n c.conn.SetPongHandler(func(string) error {\n c.conn.SetReadDeadline(time.Now().Add(pongWait))\n return nil\n })\n for {\n // _, message, err := c.conn.ReadMessage()\n message := Payload{}\n err := c.conn.ReadJSON(&message)\n if err != nil {\n log.Printf(\"Error reading JSON:\", err)\n if websocket.IsUnexpectedCloseError(err, websocket.CloseGoingAway,\n websocket.CloseAbnormalClosure,\n websocket.CloseNormalClosure) {\n log.Printf(\"Socket closed error: %v\", err)\n // c.conn.Close()\n }\n break //quit read\n }\n\n // log.Println(\"Message received from client:\", message)\n // message = bytes.TrimSpace(bytes.Replace(message, newline, space, -1))\n //send messsage we received from client to the party\n c.party.broadcast <- message\n }\n\n}", "title": "" }, { "docid": "f59dd84e090bf4d262c986e0a6fe795a", "score": "0.61215335", "text": "func (h Handler) SendMessage(w http.ResponseWriter, r *http.Request) {\n\t// converting io.ReadCloser to string to pass pass around to server\n\tbuff := new(bytes.Buffer)\n\tbuff.ReadFrom(r.Body)\n\tsendMessageStr := buff.String()\n\tlog.Debug(\"converted request payload to string: \", sendMessageStr)\n\n\n\tid, timeStamp := models.MessengerMain(r.Header.Get(\"token\"), sendMessageStr)\n\thelpers.RespondJSON(w, models.ResponseMessage{ID: id, Timestamp: timeStamp})\n}", "title": "" }, { "docid": "c139d498f9acc422da931a1853e0e845", "score": "0.6112196", "text": "func (cs *ClientServerImpl) handleMessage(data []byte) {\n\ttypedMessage, typeStr, err := DecodeData(data, cs.TypeDecoder)\n\tif err != nil {\n\t\tlog.Warn(\"Unable to handle message from backend\", \"err\", err)\n\t\treturn\n\t}\n\n\tif cs.AnyRequestHandler != nil {\n\t\treflect.ValueOf(cs.AnyRequestHandler).Call([]reflect.Value{reflect.ValueOf(typedMessage)})\n\t}\n\n\tif handler, ok := cs.RequestHandlers[typeStr]; ok {\n\t\treflect.ValueOf(handler).Call([]reflect.Value{reflect.ValueOf(typedMessage)})\n\t} else {\n\t\tlog.Info(\"No handler for message type\", \"type\", typeStr)\n\t}\n}", "title": "" }, { "docid": "bd3ef066403997d9b3890a67abec3d08", "score": "0.6097933", "text": "func guestHandler(conn net.Conn){\n\tfmt.Print(\"Send message: \")\n\treader := bufio.NewReader(os.Stdin)\n\tmsg, err := reader.ReadString('\\n')\n\n\tif err != nil{\n\t\tlog.Fatal(\"Error reading string\", err)\n\t}\n\n\tfmt.Fprint(conn, msg)\n\n\treplyReader := bufio.NewReader(conn)\n\treplyMsg, err := replyReader.ReadString('\\n')\n\n\tif err != nil{\n\t\tlog.Fatal(\"Error reading string: \", err)\n\t}\n\n\tfmt.Println(\"Message received: \", replyMsg)\n}", "title": "" }, { "docid": "519561f77e32127628aba47f98734177", "score": "0.60885096", "text": "func (s *server) handleMessage(buf []byte, raddr net.Addr) {\n\tatomic.AddUint64(&s.stats.received, 1)\n\tm, err := s.parseMessage(buf)\n\n\tif err != nil {\n\t\tif *debug {\n\t\t\tlog.Println(\"DEBUG: Error parsing message: \", err)\n\t\t\tfmt.Printf(\"%v\", string(buf))\n\t\t}\n\n\t\tatomic.AddUint64(&s.stats.dropped, 1)\n\n\t\treturn\n\t}\n\n\thost, _, err := net.SplitHostPort(raddr.String())\n\n\tif err != nil {\n\t\tif *debug {\n\t\t\tlog.Println(\"DEBUG: Error parsing host from remote addr: \", err)\n\t\t}\n\t}\n\n\tm.Host = host\n\tmsg, err := s.encodeMessage(m)\n\n\tif err != nil {\n\t\tif *debug {\n\t\t\tlog.Println(\"DEBUG: Error encoding message: \", err)\n\t\t\tfmt.Printf(\"%v\", string(buf))\n\t\t}\n\n\t\tatomic.AddUint64(&s.stats.dropped, 1)\n\n\t\treturn\n\t}\n\n\tatomic.AddUint64(&s.stats.parsed, 1)\n\n\tif *debug {\n\t\tlog.Printf(\"DEBUG: Sending message to Kafka: %+v\", msg)\n\t}\n\n\ts.Inputs <- msg\n}", "title": "" }, { "docid": "ea880e8b4508e62ab4aa5622a07c35b8", "score": "0.608428", "text": "func sendMessageHandler(w http.ResponseWriter, r *http.Request) {\n\tctx := context.Background()\n\n\t//get conversation id\n\tcid := r.URL.Path[len(\"/api/conversation/send/:\"):]\n\tvar msg SendMessage\n\n\t//decode json\n\tdecoder := json.NewDecoder(r.Body)\n\terr := decoder.Decode(&msg)\n\tif err != nil {\n\t log.Printf(\"Decode failure! %v\", err)\n\t return\n\t}\n\n//\t//get and verify userid\n\tuserToken, err := checkUserAuthentication(msg.Auth)\n\tif err != nil {\n\t log.Printf(\"Authentication failure!\", err)\n\t return\n }\n\n //initializing database\n client, err := app.Database(ctx)\n\tif err != nil{\n\t\tlog.Printf(\"Initialization Error!\")\n\t\treturn\n\t}\n\n\taddress := \"chatRooms/\"+cid\n //sending message to database\n chatRef := client.NewRef(address)\n\n _, err = chatRef.Push(ctx, &Message{\n\t\t UserID : userToken.UID, \n Message : msg.Text,\n Timestamp: time.Now().Format(\"Mon, 02 Jan 2006 15:04:05 MST\"),\n\t})\n if err != nil {\n log.Printf(\"Error setting value\")\n return\n }\n w.WriteHeader(http.StatusOK)\n}", "title": "" }, { "docid": "bf61f5c81b10d2ec006d99e9fb007a50", "score": "0.6071183", "text": "func processInbound(m *Manager) {\n\tticker := time.NewTicker(time.Millisecond * 250)\n\tdefer ticker.Stop()\n\tfor range ticker.C {\n\t\tmsg := <-m.server.Inbound\n\t\tif msg.Type == \"command\" {\n\t\t\tgo processCommand(m, msg.Content)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "349eb90c5cddc6f561e2a268b174571c", "score": "0.6069183", "text": "func (c *MsgClient) OnMessage(handler WebEventHandler){\n\tc.message = handler\n}", "title": "" }, { "docid": "427740611e0c5ce3b1cc627b08d3a0ee", "score": "0.6062035", "text": "func (conn *QuicConnection) handleMessage(stream *smgr.Stream) {\n\tmsg := &model.Message{}\n\tfor {\n\t\terr := lane.NewLane(api.ProtocolTypeQuic, stream.Stream).ReadMessage(msg)\n\t\tif err != nil {\n\t\t\tif !errors.Is(err, io.EOF) {\n\t\t\t\tklog.Errorf(\"failed to read message, error: %+v\", err)\n\t\t\t}\n\t\t\tconn.streamManager.FreeStream(stream)\n\t\t\treturn\n\t\t}\n\n\t\t// to check whether the message is a response or not\n\t\tif matched := conn.syncKeeper.MatchAndNotify(*msg); matched {\n\t\t\tcontinue\n\t\t}\n\n\t\t// put the messages into fifo and wait for reading\n\t\tif !conn.autoRoute {\n\t\t\tconn.messageFifo.Put(msg)\n\t\t\tcontinue\n\t\t}\n\n\t\t// user do not set message handle, use the default mux\n\t\tif conn.handler == nil {\n\t\t\t// use default mux\n\t\t\tconn.handler = mux.MuxDefault\n\t\t}\n\t\tconn.handler.ServeConn(&mux.MessageRequest{\n\t\t\tHeader: conn.state.Headers,\n\t\t\tMessage: msg,\n\t\t}, &responseWriter{\n\t\t\tType: api.ProtocolTypeQuic,\n\t\t\tVan: stream.Stream,\n\t\t})\n\t}\n}", "title": "" }, { "docid": "f01d0a3543eaaa598cd6e8d6e8243e9f", "score": "0.6059649", "text": "func (session *Session) Handle() {\n\tfor {\n\t\t//fmt.Println(\"mock msg: \", nhcMessage.Cmd, nhcMessage.Event, nhcMessage.Data)\n\t\tmessage, _ := bufio.NewReader(session.connection).ReadBytes('\\n')\n\t\tif len(message) > 0 {\n\t\t\t_ = json.Unmarshal(message, &nhcMessage)\n\t\t\tif nhcMessage.Cmd == \"startevents\" {\n\t\t\t\t//fmt.Println(\"Listener session\")\n\t\t\t\tsession.sType = \"listener\"\n\t\t\t\tsession.connection.Write([]byte(startEvents))\n\t\t\t\t//session.connection.Write([]byte(invalidMsg))\n\t\t\t} else if nhcMessage.Cmd == \"listactions\" {\n\t\t\t\t//fmt.Println(\"Actions: \", nhcMessage.Cmd, nhcMessage.Event, session.sType)\n\t\t\t\tsession.connection.Write([]byte(actions))\n\t\t\t\tnhcMessage.Cmd = \"dropme\"\n\t\t\t} else if nhcMessage.Cmd == \"listlocations\" {\n\t\t\t\t//fmt.Println(\"Location: \", nhcMessage.Cmd, nhcMessage.Event, session.sType)\n\t\t\t\tsession.connection.Write([]byte(locations))\n\t\t\t\tnhcMessage.Cmd = \"dropme\"\n\t\t\t} else if nhcMessage.Cmd == \"executeactions\" {\n\t\t\t\t//fmt.Println(\"Event: \", nhcMessage.Cmd, nhcMessage.Event, session.sType)\n\t\t\t\tfor _, cli := range Clients {\n\t\t\t\t\tif cli.sType == \"listener\" {\n\t\t\t\t\t\tcli.connection.Write([]byte(actionEvent))\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "630b24d96c9f09afb7998263b1193a3c", "score": "0.604406", "text": "func handleCommandMessage(client MQTT.Client, msg MQTT.Message) {\n\tcommands.incoming <- string(msg.Payload())\n}", "title": "" }, { "docid": "47526e28d178f1ec51cbff49df0bc514", "score": "0.60116184", "text": "func (t *transport) SendMessage(server TransportService_SendMessageServer) error {\n\tfor {\n\t\t// Receive message.\n\t\tbytes, err := server.Recv()\n\t\tif nil != err {\n\t\t\tlogger.Errorf(\"receive message failed:%v\", err)\n\t\t\treturn err\n\t\t}\n\t\t// Unmarshal raft message.\n\t\tvar msg raftpb.Message\n\t\tpbutil.MustUnmarshal(&msg, bytes.Data)\n\t\t// Send message to raft.\n\t\tt.gmap.raft.Step(t.ctx, msg)\n\t}\n}", "title": "" }, { "docid": "0245bd2579016c2de2e209ff50377e3e", "score": "0.6010956", "text": "func (nr *NsqReader) HandleMessage(msg *nsq.Message) error {\n\tmessage := Message{}\n\terr := json.Unmarshal(msg.Body, &message)\n\tif err != nil {\n\t\tlog.Println(\"NSQ HandleMessage ERROR: invalid JSON subscribe data\")\n\t\treturn err\n\t}\n\tfor r := range nr.rooms {\n\t\tr.forward <- &message\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a3e55c924ab45cb2ae981a4dc15fcd5c", "score": "0.6002441", "text": "func (c *Client) processResponse(msg Message) {\n\t// check for errors returned by server\n\tif msg.Error != \"\" {\n\t\tstdout <- \"> Request error: \" + msg.Error + \"\\n\"\n\t\treturn\n\t}\n\n\tswitch msg.Type {\n\t// join server for the first time\n\tcase \"set_name\":\n\t\tstdout <- msg.Text + \"\\n\"\n\n\t// create a chat room\n\tcase \"create\":\n\t\tstdout <- msg.Text + \"\\n\"\n\n\t// destroy a chat room\n\tcase \"destroy\":\n\t\tif msg.Username == c.username {\n\t\t\tstdout <- fmt.Sprintf(\"[%s]: You have destroyed the room.\\n\", msg.Room)\n\t\t\treturn\n\t\t}\n\t\tstdout <- fmt.Sprintf(\"[%s]: This room has been destroyed by '%s'.\\n\", msg.Room, msg.Username)\n\n\t// join server for the first time\n\tcase \"list\":\n\t\tif len(msg.Text) == 0 {\n\t\t\tstdout <- \"No rooms available\\n\"\n\t\t}\n\t\tstdout <- \"Available chat rooms: \" + msg.Text + \"\\n\"\n\n\t// join a chat room\n\tcase \"join\":\n\t\tif msg.Username == c.username {\n\t\t\tstdout <- fmt.Sprintf(\"[%s] %s: %s\\n\", msg.Room, msg.Username, \"You have joined the room.\")\n\t\t\treturn\n\t\t}\n\t\tstdout <- fmt.Sprintf(\"[%s] %s: %s\\n\", msg.Room, msg.Username, \"Joined the room.\")\n\n\t// leave chat room\n\tcase \"leave\":\n\t\tif msg.Username == c.username {\n\t\t\tstdout <- fmt.Sprintf(\"[%s] %s: %s\\n\", msg.Room, msg.Username, \"You are leaving the room.\")\n\t\t\treturn\n\t\t}\n\t\tstdout <- fmt.Sprintf(\"[%s] %s: %s\\n\", msg.Room, msg.Username, \"Left the room.\")\n\n\t// a standard message to a server room\n\tcase \"new_msg\":\n\t\tstdout <- fmt.Sprintf(\"[%s] %s: %s\\n\", msg.Room, msg.Username, msg.Text)\n\n\tdefault:\n\t\tstdout <- \"> Request message type not recognised\\n\"\n\t}\n}", "title": "" }, { "docid": "74435a38d39f69f79d51dcbb78ca47c4", "score": "0.5991913", "text": "func ReceiveMessageFromLogstash(w http.ResponseWriter, r *http.Request) {\n body, _ := ioutil.ReadAll(r.Body)\n\n if IsSocketOn == true {\n _ = Socket.Emit(\"message:received\", string(body[:]))\n }\n}", "title": "" }, { "docid": "2608fc17b53292f848d2b0a705e25399", "score": "0.59849864", "text": "func (server *Server) SendMessage(msg *message.Message) {\n\tserver.QueuePacket(protocol.ServerMessage{msg.JSONString()})\n}", "title": "" }, { "docid": "9da7e45de3e70bdc68d0dc6199068fea", "score": "0.5982858", "text": "func (s *natsServer) handleClient(msg *nats.Msg) {\n\thandler := s.chooseClientHandler(msg.Subject)\n\n\tif handler == nil {\n\t\tlog.Println(\"Handler not found for\", msg.Subject)\n\t\treturn\n\t}\n\n\t// Here we call the handler - it can do whatever and return us\n\t// some kind of wyc.Marshalable result\n\tresult := handler(msg)\n\n\t// Pass whatever the result was to our func to be turned back into\n\t// a []byte and sent off.\n\ts.sendReply(msg.Reply, result)\n}", "title": "" }, { "docid": "37c43a13d82d303521c815c3d1345d5b", "score": "0.59779614", "text": "func (s *Service) HandleInbound(msg service.DIDCommMsg, ctx service.DIDCommContext) (string, error) {\n\tlogger.Debugf(\"receive inbound message : %s\", msg)\n\n\t// fetch the thread id\n\tthID, err := msg.ThreadID()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// valid state transition and get the next state\n\tnext, err := s.nextState(msg.Type(), thID)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"handle inbound - next state : %w\", err)\n\t}\n\n\t// connection record\n\tconnRecord, err := s.connectionRecord(msg)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to fetch connection record : %w\", err)\n\t}\n\n\tlogger.Debugf(\"connection record: %+v\", connRecord)\n\n\tinternalMsg := &message{\n\t\tOptions: &options{routerConnections: retrievingRouterConnections(msg)},\n\t\tMsg: msg.Clone(),\n\t\tThreadID: thID,\n\t\tNextStateName: next.Name(),\n\t\tConnRecord: connRecord,\n\t}\n\n\tgo func(msg *message, aEvent chan<- service.DIDCommAction) {\n\t\tif err = s.handle(msg, aEvent); err != nil {\n\t\t\tlogutil.LogError(logger, DIDExchange, \"processMessage\", err.Error(),\n\t\t\t\tlogutil.CreateKeyValueString(\"msgType\", msg.Msg.Type()),\n\t\t\t\tlogutil.CreateKeyValueString(\"msgID\", msg.Msg.ID()),\n\t\t\t\tlogutil.CreateKeyValueString(\"connectionID\", msg.ConnRecord.ConnectionID))\n\t\t}\n\n\t\tlogutil.LogDebug(logger, DIDExchange, \"processMessage\", \"success\",\n\t\t\tlogutil.CreateKeyValueString(\"msgType\", msg.Msg.Type()),\n\t\t\tlogutil.CreateKeyValueString(\"msgID\", msg.Msg.ID()),\n\t\t\tlogutil.CreateKeyValueString(\"connectionID\", msg.ConnRecord.ConnectionID))\n\t}(internalMsg, s.ActionEvent())\n\n\tlogutil.LogDebug(logger, DIDExchange, \"handleInbound\", \"success\",\n\t\tlogutil.CreateKeyValueString(\"msgType\", msg.Type()),\n\t\tlogutil.CreateKeyValueString(\"msgID\", msg.ID()),\n\t\tlogutil.CreateKeyValueString(\"connectionID\", internalMsg.ConnRecord.ConnectionID))\n\n\treturn connRecord.ConnectionID, nil\n}", "title": "" }, { "docid": "30f1325fb18bf66a688df9c36086ad2c", "score": "0.5972846", "text": "func (c *chat) handle(w http.ResponseWriter, r *http.Request) {\n\tdefer r.Body.Close()\n\n\tsc, err := getServerContext(r.Context())\n\tif err != nil {\n\t\tlog.Info(fmt.Sprintf(\"[%s](%s:%s) Can't find server: %s\", sc.requestUUID, sc.account.ID.Hex(), sc.serverKey, err.Error()))\n\t\thandleError(w, types.RESTError{\n\t\t\tError: \"Error finding server identity\",\n\t\t\tStatusCode: http.StatusForbidden,\n\t\t})\n\t\treturn\n\t}\n\n\tswitch r.Method {\n\tcase http.MethodGet:\n\t\tm, found := c.cqs.GetGameServerMessage(sc.serverKey, \"chat\", c.timeout)\n\t\tif !found {\n\t\t\tw.WriteHeader(http.StatusNoContent)\n\t\t\treturn\n\t\t}\n\n\t\tb, err := json.Marshal(newDiscordChat(m))\n\t\tif err != nil {\n\t\t\tlog.Printf(\"[%s] %s\", sc.requestUUID, err.Error())\n\t\t\treturn\n\t\t}\n\n\t\tw.Write(b)\n\t}\n}", "title": "" }, { "docid": "7f9e2230f5951da233eb83bed40e767a", "score": "0.59649587", "text": "func (s *Service) HandleInbound(msg service.DIDCommMsg, myDID, theirDID string) (string, error) { //nolint:funlen\n\tlogger.Debugf(\"receive inbound message : %s\", msg)\n\n\tif !s.Accept(msg.Type()) {\n\t\treturn \"\", fmt.Errorf(\"unsupported message type %s\", msg.Type())\n\t}\n\n\tevents := s.ActionEvent()\n\tif events == nil {\n\t\treturn \"\", fmt.Errorf(\"no clients registered to handle action events for %s protocol\", Name)\n\t}\n\n\t// TODO should request messages with no attachments be rejected?\n\t// https://github.com/hyperledger/aries-rfcs/issues/451\n\n\tpiid, err := msg.ThreadID()\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"threadID: %w\", err)\n\t}\n\n\terr = s.saveTransitionalPayload(piid, &transitionalPayload{\n\t\tAction: Action{\n\t\t\tPIID: piid,\n\t\t\tMsg: msg.Clone(),\n\t\t\tMyDID: myDID,\n\t\t\tTheirDID: theirDID,\n\t\t\tProtocolName: Name,\n\t\t},\n\t})\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"save transitional payload: %w\", err)\n\t}\n\n\tgo func() {\n\t\tsendMsgEvent(service.PreState, &s.Message, msg, &eventProps{})\n\n\t\tevent := service.DIDCommAction{\n\t\t\tProtocolName: Name,\n\t\t\tMessage: msg,\n\t\t\tContinue: func(args interface{}) {\n\t\t\t\tvar opts Options\n\n\t\t\t\tswitch t := args.(type) {\n\t\t\t\tcase Options:\n\t\t\t\t\topts = t\n\t\t\t\tdefault:\n\t\t\t\t\topts = &userOptions{}\n\t\t\t\t}\n\n\t\t\t\tif err := s.deleteTransitionalPayload(piid); err != nil {\n\t\t\t\t\tlogger.Errorf(\"delete transitional payload: %s\", err)\n\t\t\t\t}\n\n\t\t\t\ts.callbackChannel <- &callback{\n\t\t\t\t\tmsg: msg,\n\t\t\t\t\tmyDID: myDID,\n\t\t\t\t\ttheirDID: theirDID,\n\t\t\t\t\toptions: opts,\n\t\t\t\t}\n\t\t\t},\n\t\t\tStop: func(_ error) {\n\t\t\t\tif err := s.deleteTransitionalPayload(piid); err != nil {\n\t\t\t\t\tlogger.Errorf(\"delete transitional payload: %s\", err)\n\t\t\t\t}\n\t\t\t},\n\t\t}\n\n\t\tevents <- event\n\n\t\tlogger.Debugf(\"dispatched event: %+v\", event)\n\t}()\n\n\treturn \"\", nil\n}", "title": "" }, { "docid": "5bd0e0edaa75d6ac7a0aa6de23df212e", "score": "0.59632456", "text": "func hostHandler(conn net.Conn){\n\treader := bufio.NewReader(conn)\n\tmsg , err := reader.ReadString('\\n') //return key\n\n\tif err != nil{\n\t\tlog.Fatal(\"Error reading string: \", err)\n\t}\n\n\tfmt.Println(\"Message received: \", msg)\n\n\tfmt.Print(\"Send message: \")\n\treplyReader := bufio.NewReader(os.Stdin)\n\treplyMsg, err := replyReader.ReadString('\\n')\n\n\tif err != nil{\n\t\tlog.Fatal(\"Error replying messsage: \", err)\n\t}\n\n\tfmt.Fprint(conn, replyMsg)\n}", "title": "" }, { "docid": "ce4b2e52b0548b9cd01e3bf2d023ed9f", "score": "0.59425265", "text": "func (client *Client) ReadMessage(key string) {\n\tdefer func() {\n\t\tclient.ClientService.MainService.UnRegister<- client\n\t\t// println(\"I Am Leaving nigga\")\n\t\t(client.Conns[key]).Conn.Close()\n\t\t// close(client.Message)\n\t\tclient.MainService.DeleteClientConn <- &entity.ClientConnExistance{\n\t\t\tIP: key,\n\t\t\tID: client.ID,\n\t\t}\n\t\t// recover if error happened...\n\t\trecover()\n\t}()\n\tclient.Conns[key].Conn.SetReadLimit(maxMessageSize)\n\t// client.Conns[key].Conn.SetReadDeadline(time.Now().Add(pongWait))\n\tclient.Conns[key].Conn.SetPongHandler(func(string) error { /*client.Conns[key].Conn.SetReadDeadline(time.Now().Add(pongWait)); */return nil })\n\tfor {\n\t\t// print(\"Im running\")\n\t\tmessage := &entity.InMess{}\n\t\terr := client.Conns[key].Conn.ReadJSON(message)\n\t\tif err != nil {\n\t\t\tif websocket.IsUnexpectedCloseError(err, websocket.CloseAbnormalClosure) {\n\t\t\t\tlog.Printf(\"error: %v\", err)\n\t\t\t}\n\t\t\t// websocket.\n\t\t\t// println(err.Error())\n\t\t\tbreak\n\t\t}\n\t\t// println(string(Helper.MarshalThis(message)))\n\t\tif message == nil {\n\t\t\tcontinue\n\t\t}\n\t\t// Brodcast the message\n\t\tif message.GetStatus() <= 0 || message.GetStatus() > 13 {\n\t\t\t// println(\"Not A Valid Message ... \")\n\t\t\tcontinue\n\t\t}\n\n\t\t// the Message has passed\n\t\t// the first stage of chackmessageg whether\n\t\t// they are a valid message or not\n\t\t// now i am gonna map the message to their specific Object\n\t\tvar body entity.XMessage\n\t\tbody = client.FilterMessage(message)\n\t\tif body == nil {\n\t\t\tcontinue\n\t\t}\n\t\tswitch body.GetStatus() {\n\t\tcase entity.MsgSeen:\n\t\t\t{\n\n\t\t\t\t// print(\" Incomming Seen message .................\" , body);\n\t\t\t\tif body.(*entity.SeenMessage).Body.SenderID == \"\" {\n\t\t\t\t\tbody = nil\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tbody.(*entity.SeenMessage).SenderID = client.User.ID\n\t\t\t\tclient.ClientService.Message <- body\n\t\t\t}\n\t\tcase entity.MsgTyping, entity.MsgStopTyping:\n\t\t\t{\n\t\t\t\tbody.(*entity.TypingMessage).Body.TyperID = client.User.ID\n\t\t\t\tif body.(*entity.TypingMessage).Body.ReceiverID == \"\" {\n\t\t\t\t\tbody = nil\n\t\t\t\t\tbreak\n\n\t\t\t\t}\n\t\t\t\tbody.(*entity.TypingMessage).SenderID = client.User.ID\n\t\t\t\tclient.ClientService.Message <- body\n\t\t\t}\n\t\tcase entity.MsgIndividualTxt:\n\t\t\t{\n\t\t\t\tif body.(*entity.EEMessage).Body.ReceiverID == \"\" ||\n\t\t\t\t\tbody.(*entity.EEMessage).Body.Text == \"\" {\n\t\t\t\t\tbody = nil\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tbody.(*entity.EEMessage).SenderID = client.User.ID\n\t\t\t\t// Send the Message and if the Message Sendmessageg was succesful sent it to\n\t\t\t\t// both the Users\n\t\t\t\t// Since the ClientService may have a lot of Call i will handle the Sending or saving of the message to\n\t\t\t\t// the database here message the client ReadMessage service loop\n\t\t\t\talie, messaj := client.SendAlieMessage(body.(*entity.EEMessage))\n\t\t\t\tif alie != nil {\n\t\t\t\t\tme := client.ClientService.UserSer.GetUserByID(func() string {\n\t\t\t\t\t\tif alie.A == client.ID {\n\t\t\t\t\t\t\treturn client.ID\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn alie.B\n\t\t\t\t\t}())\n\t\t\t\t\tif me == nil {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\thim := client.ClientService.UserSer.GetUserByID(func() string {\n\t\t\t\t\t\tif alie.A == client.ID {\n\t\t\t\t\t\t\treturn alie.B\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn alie.A\n\t\t\t\t\t}())\n\t\t\t\t\tif him == nil {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\tclient.ClientService.Message <- &entity.NewAlie{\n\t\t\t\t\t\tStatus: entity.MsgNewAlie,\n\t\t\t\t\t\tBody: entity.NewAlieBody{\n\t\t\t\t\t\t\tReceiverID: client.ID,\n\t\t\t\t\t\t\tUser: him,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tSenderID: client.ID,\n\t\t\t\t\t}\n\t\t\t\t\tclient.ClientService.Message <- &entity.NewAlie{\n\t\t\t\t\t\tStatus: entity.MsgNewAlie,\n\t\t\t\t\t\tBody: entity.NewAlieBody{\n\t\t\t\t\t\t\tReceiverID: him.ID,\n\t\t\t\t\t\t\tUser: me,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tSenderID: client.ID,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// sending the message if the message in not nil\n\t\t\t\tif messaj != nil {\n\t\t\t\t\t// println(\" Seending the Message to the Clients \\n\\n\\n\")\n\t\t\t\t\tmessaj.SenderID = client.ID\n\t\t\t\t\tclient.ClientService.Message <- messaj\n\t\t\t\t}\n\t\t\t}\n\t\tcase entity.MsgGroupTxt:\n\t\t\t{\n\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5bb397d72276d62d7e32fb656a802aa7", "score": "0.5938272", "text": "func (t *Tracker) handleClient(conn net.Conn) {\n\tt.Delegate.LogMessage(\"Serving\", conn.RemoteAddr().String())\n\ttNow := time.Now()\n\tdefer t.Delegate.LogMessage(\"Finished with\", conn.RemoteAddr().String(), \"in\", time.Since(tNow).String())\n\n\tdefer conn.Close()\n\t// Read in the Message Sent from the Client\n\tnewMessage, err := message.ReadMessageFromConnection(conn)\n\tif err != nil {\n\t\tt.handleError(\"Handle Client (Reading in Message)\", err)\n\t\tadErrors.CreateError(adErrors.UnexpectedError, \"Unable to read message.\", t.Key.Address).Send(t.Key, conn)\n\t\treturn\n\t}\n\n\ts, err := newMessage.Decrypt(t.Key)\n\tif err != nil {\n\t\tt.handleError(\"Unable to decrypt message.\", err)\n\t\tadErrors.CreateError(adErrors.UnexpectedError, \"Unable to decrypt message.\", t.Key.Address).Send(t.Key, conn)\n\t\treturn\n\t}\n\n\tif !s.Verify() {\n\t\tt.handleError(\"Unable to verify message.\", nil)\n\t\tadErrors.CreateError(adErrors.InvalidSignature, \"Unable to verify message.\", t.Key.Address).Send(t.Key, conn)\n\t\treturn\n\t}\n\n\tmes, typ, header, err := s.ReconstructMessageWithTimestamp()\n\tif err != nil {\n\t\tt.handleError(\"Unable to reconstruct message.\", err)\n\t\tadErrors.CreateError(adErrors.UnexpectedError, \"Unable to reconstruct message.\", t.Key.Address).Send(t.Key, conn)\n\t\treturn\n\t}\n\n\t// Determine how to Proceed based on the Message Type\n\tswitch typ {\n\n\t// Handle Registration\n\tcase wire.RegistrationCode:\n\t\t// Unmarshal the Sent Data\n\t\tassigned := &wire.TrackerRegister{}\n\t\terr := proto.Unmarshal(mes, assigned)\n\t\tif err != nil {\n\t\t\tt.handleError(\"Handle Client (Unloading Registration Payload)\", err)\n\t\t\tadErrors.CreateError(adErrors.UnexpectedError, \"Unable to unload message payload.\", t.Key.Address).Send(t.Key, conn)\n\t\t\treturn\n\t\t}\n\n\t\tif assigned.GetAddress() != header.From.String() {\n\t\t\tt.handleError(\"Unable to verify message integrity.\", errors.New(\"Unable to verify message integrity.\"))\n\t\t\tadErrors.CreateError(adErrors.InvalidSignature, \"Signature doesn't match registration address.\", t.Key.Address).Send(t.Key, conn)\n\t\t\treturn\n\t\t}\n\n\t\tt.Delegate.SaveRecord(header.From, s, assigned.GetUsername())\n\n\t// Handle Query\n\tcase wire.QueryCode:\n\t\t// Unmarshall the Sent Data\n\t\tassigned := &wire.TrackerQuery{}\n\t\terr := proto.Unmarshal(mes, assigned)\n\n\t\tif err != nil {\n\t\t\tt.handleError(\"Handle Client (Unloading Query Payload)\", err)\n\t\t\tadErrors.CreateError(adErrors.UnexpectedError, \"Unable to unload message payload.\", t.Key.Address).Send(t.Key, conn)\n\t\t\treturn\n\t\t}\n\n\t\tt.handleQuery(header.From, assigned, conn)\n\t}\n}", "title": "" }, { "docid": "d1ad1528399def10b752e73cc708cb49", "score": "0.5935475", "text": "func RouteRecievedMessage(connection *net.TCPConn, messageContent string){\n\n\turlRequest, err := url.Parse(messageContent)\n\tif err != nil {\n panic(err)\n }\n path := urlRequest.Path\n splitPath := strings.Split(path, \"/\")\n\t\n\tparameters, _ := url.ParseQuery(urlRequest.RawQuery)\n\n\n\tif len(splitPath) != 0 {\n\t\tif splitPath[0] == \"msg\" && len(parameters[\"string\"]) > 0{\n\t\t\tfmt.Println(\"Display message\")\n\t\t\tfmt.Println(connection.RemoteAddr().String() + \": \" + parameters[\"string\"][0])\n\t\t\tresondBack(\"displayMessage\", connection, true)\n\t\t} else if splitPath[0] == \"auth\" {\n\t\t\tauthRouter(splitPath, parameters, connection)\n\t\t\t\n\t\t} else if splitPath[0] == \"get\" {\n\t\t\tgetRouter(splitPath, parameters, connection)\n\t\t\t\n\t\t}else if splitPath[0] == \"game\" {\n\t\t\tgameRouter(splitPath, parameters, connection)\n\t\t\t\n\t\t} else if splitPath[0] == \"echo\" && len(parameters[\"string\"]) > 0{\n\t\t\tfmt.Println(\"Echo message to all\")\n\t\t\tSendMessageToAll(parameters[\"string\"][0])\n\t\t\tresondBack(\"echo message\", connection, true)\n\t\t} else if splitPath[0] == \"hardwareConnection\" {\n\t\t\tfmt.Println(\"Hardware device has connected\")\n\t\t\tSetHardwareConnection(connection)\n\t\t\t// resondBack(\"echo message\", connection, true)\n\t\t} else{\n\t\t\tresondBack(\"bad api call\", connection, false)\n\t\t}\n\t} else{\n\t\tresondBack(\"bad api call\", connection, false)\n\t}\n}", "title": "" }, { "docid": "c6bbcb4ea82b1749a8a671977e00eed2", "score": "0.5935198", "text": "func (c *client) read(){\n\tdefer c.socket.Close()\n\n\tfor {\n\t\tvar msg *message\n\t\terr := c.socket.ReadJSON(&msg)\n\t\tif err != nil {\n\t\t\tcustlog.Trace.Println(err)\n\t\t\treturn\n\t\t}\n\t\t// send msg to the forward channel of the client\n\t\tcustlog.Info.Printf(\"Message received from %s: %s\", c.color, msg.Message)\n\t\tmsg.When = time.Now()\n\t\tmsg.Code = c.color\n\t\tc.room.forward <- msg\n\t}\n}", "title": "" }, { "docid": "a079c83fb12de9f5a166f9d1c98d2b3a", "score": "0.5934843", "text": "func (c *Client) handleMessage(msg message.Message) {\n\tswitch m := msg.(type) {\n\tcase *message.GameState:\n\t\tc.ID = m.ID\n\n\t\tfor _, ent := range m.World.Entities {\n\t\t\tif player, ok := ent.(*entity.Player); ok && player.ID == m.ID {\n\t\t\t\tc.Player = player\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif c.Player != nil {\n\t\t\t// Initialise the game from the server's information.\n\t\t\tc.Game = game.New(m.World, 0, 0)\n\n\t\t\tgo c.handleInput()\n\t\t} else {\n\t\t\tlog.Fatalln(\"client: player with id\", m.ID, \"not found\")\n\t\t}\n\n\t\tc.infoText = &ui.Text{}\n\t\tc.setInfo()\n\n\t\tc.Display(c.u)\n\t\tc.u.Widgets = append(c.u.Widgets, c.infoText)\n\n\tcase *message.NewPlayer:\n\t\tc.World.Entities = append(c.World.Entities, m.Player)\n\n\tcase *message.Disconnect:\n\t\tif ok := c.World.DeletePlayer(m.ID); !ok {\n\t\t\tlog.Println(\"client: couldn't find player to delete\")\n\t\t}\n\n\tcase *message.Movement:\n\t\tplayer := c.World.GetPlayer(m.ID)\n\n\t\tswitch m.Direction {\n\t\tcase 0:\n\t\t\tplayer.Up()\n\n\t\tcase 1:\n\t\t\tplayer.Down()\n\n\t\tcase 2:\n\t\t\tplayer.Left()\n\n\t\tcase 3:\n\t\t\tplayer.Right()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "89e375e2794d9cd489674ed153658a14", "score": "0.5934719", "text": "func (coord *Coordinator) HandleMessages(conn net.Conn) {\n}", "title": "" }, { "docid": "18a9de0177fdf9697084bee2996baea1", "score": "0.5934035", "text": "func clientHandler(session *ClientSession) {\n\tdefer session.Conn.Close()\n\tlog.Info(\"Connection established for\", session.Conn.RemoteAddr())\n\n\tvar msg string\n\tvar incoming ReadResult\n\treadChan := make(chan ReadResult, 10)\n\tdefer close(readChan)\n\tgo readToChan(session.Conn, readChan)\n\tfor {\n\t\t// https://stackoverflow.com/questions/34717331/why-does-conn-read-write-nothing-into-a-byte-but-bufio-reader-readstring\n\t\tselect {\n\t\tcase incoming = <-readChan:\n\t\t\t// handle stuff received from the connected client\n\n\t\t\tif incoming.Err != nil {\n\t\t\t\tlog.Error(incoming.Err)\n\t\t\t\tsession.State = Disconnected\n\t\t\t\tsession.Transmit <- fmt.Sprintf(\"%s disconnected\\n\", session.Conn.RemoteAddr())\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tmsg = string(incoming.Data)\n\t\t\tlog.Info(\"received: \", msg)\n\t\t\t// echo it back to all clients\n\t\t\tresponse := fmt.Sprintf(\"%s: %s\", session.Conn.RemoteAddr(), msg)\n\t\t\tsession.Transmit <- response\n\n\t\tcase msg = <-session.Receive:\n\t\t\t// write received stuff from other clients to *this* client\n\t\t\tlog.Info(\"got:\", msg)\n\t\t\tif _, err := session.Conn.Write([]byte(msg)); err != nil {\n\t\t\t\t// probably dead connection?\n\t\t\t\tsession.State = Disconnected\n\t\t\t\tsession.Transmit <- fmt.Sprintf(\"%s disconnected\\n\", session.Conn.RemoteAddr())\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0977eb56993a3d971de359bcf017a598", "score": "0.592893", "text": "func (h *Handler) handle(c *Conn, config uint32) {\n\n // Set initial handshake packet.\n c.sendHandshake(HANDSHAKEv10)\n // fmt.Println(c.GetSequenceID())\n\n // Read handshake response packet from client.\n c.readPacket(true)\n // fmt.Println(c.GetSequenceID())\n\n // Send OK packet.\n c.sendOKPacket(\"Welcome!\")\n\n // Switch over to command phase to receive commands from the client.\n // receiveCommand is what 'handles' the commands, so nothing else\n // needs to be done out here.\n for {\n if !c.receiveCommand() { break }\n }\n fmt.Println(\"Closing connection.\")\n c.CloseConnection()\n}", "title": "" }, { "docid": "25812d192345773a60b65bfee155ca00", "score": "0.5925", "text": "func (m *messenger) startReader() {\n\tdefer func() {\n\t\tm.server.Remove(m.clientID)\n\t\tm.conn.Close()\n\t}()\n\tm.conn.SetReadDeadline(time.Now().UTC().Add(pongWait))\n\tfor {\n\t\tselect {\n\t\tcase <-m.doneCh:\n\t\t\treturn\n\t\tdefault:\n\t\t\tvar msg []byte\n\t\t\tif err := websocket.Message.Receive(m.conn, &msg); err == io.EOF {\n\t\t\t\tm.doneCh <- true\n\t\t\t} else if err != nil {\n\t\t\t\tm.server.err(err)\n\t\t\t} else {\n\t\t\t\tm.server.dispatch(msg, m.clientID)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5fd41079f1376aece3de33718be0a1ab", "score": "0.5914866", "text": "func (cl *Client) readMessage() {\n\tdefer func() {\n\t\tcl.server.removeClient <- cl\n\t\tcl.webSocket.Close()\n\t}()\n\n\tfor {\n\t\tvar msg InputMessage\n\t\terr := cl.webSocket.ReadJSON(&msg)\n\t\tif err != nil {\n\t\t\tlog.Printf(\"client %s %v\", cl.name, err)\n\t\t\tbreak\n\t\t}\n\t\toutMsg := OutputMessage{cl.name, msg.Body}\n\t\tcl.server.broadcast <- &outMsg\n\t}\n}", "title": "" }, { "docid": "69c3f30f31aeb8fa83972d71a7844d8a", "score": "0.58974475", "text": "func handlerSendMessage(writer http.ResponseWriter, request *http.Request) {\n\tmessage := mux.Vars(request)[\"msg\"]\n\tmessages = append(messages, message)\n\t_, _ = fmt.Fprintf(writer, \"OK\")\n\n\tgo writeToChannel(message)\n}", "title": "" }, { "docid": "67f2bbdcc0b0bb272b34e674f6337a00", "score": "0.5878788", "text": "func onMessageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {\n\n\t// Ignore all messages posted by ourselves\n\tif m.Author.ID == app.Discord.State.User.ID {\n\t\treturn\n\t}\n\n\t// Ignore all messages outside of our specified channel\n\tif m.ChannelID != Settings.Channel {\n\t\treturn\n\t}\n\n\t// I have no idea how exactly Text To Speech works in Discord, I think it is good to ignore it here\n\tif m.Tts {\n\t\treturn\n\t}\n\n\t// Only transmit normal messages, no fancy things\n\tif m.Type != discordgo.MessageTypeDefault {\n\t\treturn\n\t}\n\n\t// Get a list of all attachments and transform them to their URLs\n\tattachments := \"\"\n\tfor _, item := range m.Attachments {\n\t\tattachments = attachments + item.URL + \" \"\n\t}\n\n\t// Replace the Kerbal Emojis with their forum version\n\tmessage := emoji.DiscordToForumEmoji(m.ContentWithMentionsReplaced())\n\n\t// Format links so they get displayed correctly in the shoutbox\n\tmessage = utils.AddLinkCodes(message + \" \" + attachments)\n\n\t// Obtain the timestamp of the message\n\tt, err := m.Timestamp.Parse()\n\tif utils.HandleError(err) {\n\t\treturn\n\t}\n\n\t// The message was valid, get the content and post it to the endpoint\n\tjsonValue, _ := json.Marshal(map[string]interface{}{\n\t\t\"discordId\": cast.ToInt(m.Author.ID),\n\t\t\"username\": m.Author.Username,\n\t\t\"time\": t.Unix(),\n\t\t\"message\": message,\n\t})\n\t_, err = utils.PostHTTP(Settings.Endpoint+\"/shoutbox\", \"application/json\", bytes.NewBuffer(jsonValue),\n\t\tSettings.ApiKey)\n\n\t// If the endpoint had an error, quit\n\tif utils.HandleError(err) {\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "b089d15cf0fc3c4098b56e26a22d3307", "score": "0.58544904", "text": "func (server *Server) handleClient(conn *net.Conn) {\n\n\tfmt.Printf(\"Adding new client\\n\")\n\n\tclient := Client{\n\t\tconn: conn,\n\t}\n\n\t//read the init message\n\t//the init message will not need more than 100 bytes\n\tvar err error\n\tvar msg []byte\n\tmsg, err = handler.read(&client)\n\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\tfmt.Println(\"Cannot read from the client\\n\")\n\t\treturn\n\t}\n\n\t//decode the message\n\tmessage, err := _messsageDecode(&msg)\n\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\tfmt.Printf(\"\\n\\n ## msg ========================================= >||||\\n %s \\n |||<<<< ========================================= \\n\\n\", msg)\n\t\tfmt.Println(\"Cannot read from the client\\n\")\n\t\treturn\n\t}\n\n\t// if there is no clientId its not the valid message\n\tif message.ClientID == \"\" {\n\t\tfmt.Println(\"Error message sent for init\")\n\t\treturn\n\t}\n\n\terr = server.handleMessage(message, &client)\n\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n}", "title": "" }, { "docid": "b72b43c59c64e7be7d7783ebf069cd52", "score": "0.58523786", "text": "func (s *sse) HandlePost(w http.ResponseWriter, r *http.Request) {\n\tif r.Method != http.MethodPost {\n\t\thttp.Error(w, \"Invalid method\", http.StatusMethodNotAllowed)\n\t\treturn\n\t}\n\tmessage := &message{}\n\tbody, err := ioutil.ReadAll(r.Body)\n\tdefer r.Body.Close()\n\n\tif err != nil {\n\t\thttp.Error(w, \"Unable to read content\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tif err = json.Unmarshal(body, message); err != nil {\n\t\thttp.Error(w, \"Invalid body\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\ts.broadcast <- message\n\tif s.config.Discovery && r.URL.Query().Get(\"propagate\") == \"\" {\n\t\ts.peers <- message\n\t}\n\tlog.Printf(\"got new message: %v\\n\", message)\n\tw.WriteHeader(http.StatusOK)\n}", "title": "" }, { "docid": "11f848f82a2875d78c03383769451dd1", "score": "0.5849779", "text": "func (f *fNatsServer) handler(msg *nats.Msg) {\n\tif msg.Reply == \"\" {\n\t\tlogger().Warn(\"frugal: discarding invalid NATS request (no reply)\")\n\t\treturn\n\t}\n\tselect {\n\tcase f.workC <- &frameWrapper{frameBytes: msg.Data, timestamp: time.Now(), reply: msg.Reply}:\n\tcase <-f.quit:\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "01264563b779fc3ed011c9089f9544f4", "score": "0.5849759", "text": "func (s *Server) Handle(c net.Conn) {\n\tscn := bufio.NewScanner(c)\n\tmsg := &message{origin: c}\n\n\tfor scn.Scan() {\n\t\txml.Unmarshal(scn.Bytes(), msg)\n\t\ts.bcast <- *msg\n\t}\n\n\ts.leave <- c\n}", "title": "" }, { "docid": "041cd2b4a85edd2cf9930dc6b8fdef13", "score": "0.58484876", "text": "func (i *Instance) Handler(w http.ResponseWriter, r *http.Request) {\n\tsocket, err := upgrader.Upgrade(w, r, nil)\n\tif err != nil {\n\t\tlog.Println(\"Socket Upgrade Error:\", err)\n\t}\n\n\tc := &Client{\n\t\tsocket: socket,\n\t\tSend: make(chan *MessagePayload),\n\t\tUser: context.Get(r, \"User\").(*security.User),\n\t}\n\ti.Register <- c\n\n\tif c.User.Username != \"\" {\n\t\tlog.Println(\"New user just connected\", c.User.Username)\n\t} else {\n\t\tlog.Println(\"New guest just connected\")\n\t}\n\n\tgo c.read(i)\n\tgo c.write(i)\n}", "title": "" }, { "docid": "48cff7fe22d361d025f490d4324786ef", "score": "0.58388734", "text": "func handleMessage(backend Backend, peer *Peer) error {\n\t// Read the next message from the remote peer, and ensure it's fully consumed\n\tmsg, err := peer.rw.ReadMsg()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif msg.Size > maxMessageSize {\n\t\treturn fmt.Errorf(\"%w: %v > %v\", errMsgTooLarge, msg.Size, maxMessageSize)\n\t}\n\tdefer msg.Discard()\n\n\tvar handlers = eth65\n\tif peer.Version() >= ETH66 {\n\t\thandlers = eth66\n\t}\n\t// Track the amount of time it takes to serve the request and run the handler\n\tif metrics.Enabled {\n\t\th := fmt.Sprintf(\"%s/%s/%d/%#02x\", p2p.HandleHistName, ProtocolName, peer.Version(), msg.Code)\n\t\tdefer func(start time.Time) {\n\t\t\tsampler := func() metrics.Sample {\n\t\t\t\treturn metrics.ResettingSample(\n\t\t\t\t\tmetrics.NewExpDecaySample(1028, 0.015),\n\t\t\t\t)\n\t\t\t}\n\t\t\tmetrics.GetOrRegisterHistogramLazy(h, nil, sampler).Update(time.Since(start).Microseconds())\n\t\t}(time.Now())\n\t}\n\tif handler := handlers[msg.Code]; handler != nil {\n\t\treturn handler(backend, msg, peer)\n\t}\n\treturn fmt.Errorf(\"%w: %v\", errInvalidMsgCode, msg.Code)\n}", "title": "" }, { "docid": "f4e7e562356f18e4ab58e190a6fa0fd0", "score": "0.5838737", "text": "func (l *Leader) handleMessage(msg common.Packet, follower string) (err error) {\n\n\terr = nil\n\tswitch request := msg.(type) {\n\tcase RequestMsg:\n\t\tif common.IsCustomOpCode(common.OpCode(request.GetOpCode())) {\n\t\t\tif l.reqHandler != nil {\n\t\t\t\tl.reqHandler.OnNewRequest(follower, request)\n\t\t\t} else {\n\t\t\t\tlog.Current.Debugf(\"Leader.handleMessage(): No custom request handler registered to handle custom request.\")\n\t\t\t\tresponse := l.factory.CreateResponse(follower, request.GetReqId(), \"No custom request handler\", nil)\n\t\t\t\tl.sendResponse(response)\n\t\t\t}\n\t\t} else {\n\t\t\terr = l.createProposal(follower, request)\n\t\t}\n\tcase AcceptMsg:\n\t\terr = l.handleAccept(request)\n\tcase ResponseMsg:\n\t\tl.sendResponse(request)\n\tdefault:\n\t\t// TODO: Should throw exception. There is a possiblity that there is another leader.\n\t\tlog.Current.Infof(\"Leader.handleMessage(): Leader unable to process message of type %s. Ignore message.\", request.Name())\n\t}\n\treturn err\n}", "title": "" }, { "docid": "512ef39f95938c887621de41d3b6e810", "score": "0.58334833", "text": "func (s *SMServiceImpl) OnMessage(rmtAddr *skymesh.Addr, data []byte) {\n\thead := &SMRpcHead{}\n\thead.Init()\n\terr,unpackLen := head.Unpack(data)\n\tif err != nil {\n\t\tlog.Errorf(\"unpack SMService failed:%v\\n\", err)\n\t\treturn\n\t}\n\n\tif head.msgType == kMsgTypeRsp {\n\t\terr := s.rpcFramework.WakeUp(head.seq, data[unpackLen:])\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"wake up session %d failed:%v\\n\", head.seq, err)\n\t\t}\n\t\treturn\n\t}\n\n\tif head.msgType == kMsgTypeReq {\n\t\tmethod := string(head.method[:head.methodLen])\n\t\thandler := s.methods[method]\n\t\tif handler == nil {\n\t\t\tlog.Errorf(\"can not find method(%s)\\n\", method)\n\t\t\treturn\n\t\t}\n\t\trsp, err := handler.onMethod(context.Background(), data[unpackLen:])\n\t\tif err != nil { //Todo: 错误是否要做返回处理???\n\t\t\tlog.Errorf(\"handle method(%s) failed:%v\\n\", method, err)\n\t\t\treturn\n\t\t}\n\t\tif head.seq != 0 { //need response\n\t\t\ts.SendResponse(context.Background(), rmtAddr, head.seq, rsp.([]byte))\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0a8ee6654e49e936bb51941993458e02", "score": "0.5831677", "text": "func (client *Client) handleTypingEvent(message model.ReceivedMessage, action string) {\n\troomID := message.Room\n\tif room := client.hub.findRoomById(roomID); room != nil {\n\t\tmsg := model.WebsocketMessage{\n\t\t\tAction: action,\n\t\t\tData: message.Message,\n\t\t}\n\t\troom.broadcast <- &msg\n\t}\n}", "title": "" }, { "docid": "9000de9efa18f999758569f792098b15", "score": "0.58307964", "text": "func (c *wsClient) inHandler() {\nout:\n\tfor {\n\t\t// Break out of the loop once the quit channel has been closed.\n\t\t// Use a non-blocking select here so we fall through otherwise.\n\t\tselect {\n\t\tcase <-c.quit:\n\t\t\tbreak out\n\t\tdefault:\n\t\t}\n\n\t\t_, msg, err := c.conn.ReadMessage()\n\t\tif err != nil {\n\t\t\t// Log the error if it's not due to disconnecting.\n\t\t\tif err != io.EOF {\n\t\t\t\tfmt.Printf(\"Websocket receive error from %s: %v\\n\", c.addr, err)\n\t\t\t}\n\t\t\tbreak out\n\t\t}\n\n\t\tvar request btcjson.Request\n\t\terr = json.Unmarshal(msg, &request)\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"Failed to parse request: %v\\n\", err)\n\t\t\tjsonErr := &btcjson.RPCError{\n\t\t\t\tCode: btcjson.ErrRPCParse.Code,\n\t\t\t\tMessage: \"Failed to parse request: \" + err.Error(),\n\t\t\t}\n\t\t\treply, err := createMarshalledReply(nil, nil, jsonErr)\n\t\t\tif err != nil {\n\t\t\t\tfmt.Printf(\"Failed to marshal parse failure reply: %v\\n\", err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tc.SendMessage(reply, nil)\n\t\t\tcontinue\n\t\t}\n\n\t\tcmd := parseCmd(&request)\n\t\tif cmd.err != nil {\n\t\t\tfmt.Printf(\"Failed to parse command: %v\\n\", cmd.err)\n\t\t\treply, err := createMarshalledReply(cmd.id, nil, cmd.err)\n\t\t\tif err != nil {\n\t\t\t\tfmt.Printf(\"Failed to marshal parse failure reply: %v\\n\", err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tc.SendMessage(reply, nil)\n\t\t\tcontinue\n\t\t}\n\t\tfmt.Printf(\"Received command <%s> from %s\\n\", cmd.method, c.addr)\n\n\t\t// Asynchronously handle the request. A semaphore is used to\n\t\t// limit the number of concurrent requests currently being\n\t\t// serviced. If the semaphore can not be acquired, simply wait\n\t\t// until a request finished before reading the next RPC request\n\t\t// from the websocket client.\n\t\t//\n\t\t// This could be a little fancier by timing out and erroring\n\t\t// when it takes too long to service the request, but if that is\n\t\t// done, the read of the next request should not be blocked by\n\t\t// this semaphore, otherwise the next request will be read and\n\t\t// will probably sit here for another few seconds before timing\n\t\t// out as well. This will cause the total timeout duration for\n\t\t// later requests to be much longer than the check here would\n\t\t// imply.\n\t\t//\n\t\t// If a timeout is added, the semaphore acquiring should be\n\t\t// moved inside of the new goroutine with a select statement\n\t\t// that also reads a time.After channel. This will unblock the\n\t\t// read of the next request from the websocket client and allow\n\t\t// many requests to be waited on concurrently.\n\t\tc.serviceRequestSem.acquire()\n\t\tgo func() {\n\t\t\tc.serviceRequest(cmd)\n\t\t\tc.serviceRequestSem.release()\n\t\t}()\n\t}\n\n\t// Ensure the connection is closed.\n\tc.Disconnect()\n\tc.wg.Done()\n\tfmt.Printf(\"Websocket client input handler done for %s\\n\", c.addr)\n}", "title": "" }, { "docid": "81dea5fe77021d036354f31ef5181b45", "score": "0.58287764", "text": "func (s *Server) handleRelayRequest(sc *serverClient, mesg *msg.Message) {\n\t// Iterate through all clients' buffered channels, and send the message to each of them,\n\t// if it can be done without blocking. Otherwise, fail with NO_BUFFER.\n\trsp := msg.Message{\n\t\tVersion: msg.MyVersion,\n\t\tMessageId: mesg.MessageId,\n\t\tRelayRes: &msg.RelayResponse{\n\t\t\tStatus: msg.SUCCESS,\n\t\t\tStatusMap: make(msg.ClientStatusMap),\n\t\t},\n\t}\n\tif len(mesg.RelayReq.Dest) > 255 || len(mesg.RelayReq.Msg) > 1024 {\n\t\trsp.RelayRes.Status = msg.TOO_LONG\n\t} else {\n\t\trsp.RelayRes.StatusMap = s.sendRelays(sc, mesg)\n\t}\n\tsc.responseMsgs <- rsp\n}", "title": "" }, { "docid": "3633e021908d3d9fb9afc950cc32a095", "score": "0.58263445", "text": "func (c *Client) handleRemote() {\n\tlog.Println(\"A connection has been estabilished.\")\n\tc.handler.clientsCH <- c\n\n\tvar p Packet\n\tp.client = c\n\n\tfor {\n\t\tvar err error\n\t\tvar msg []byte\n\n\t\tif _, msg, err = c.conn.ReadMessage(); err != nil {\n\t\t\tbreak\n\t\t}\n\n\t\tvar objmap map[string]*json.RawMessage\n\t\tjson.Unmarshal(msg, &objmap)\n\n\t\tjson.Unmarshal(*objmap[\"header\"], &p.message.Header)\n\t\tp.message.Body = objmap[\"body\"]\n\n\t\t//time.Sleep(time.Second / 4)\n\t\tc.handler.pktCH <- p\n\t}\n\n\tc.conn.Close()\n\tc.handler.clientsCH <- c\n}", "title": "" }, { "docid": "5bad777e34171335a220f5f2468050e7", "score": "0.58251953", "text": "func handleClient(conn *net.UDPConn) {\n\n\t// close connection on exit\n\tdefer conn.Close()\n\n\t// buf variable to save data from client\n\tvar buf [512]byte\n\n\t// read data from client up to 512 byte buffer\n\t_, addr, err := conn.ReadFromUDP(buf[0:])\n\tif err != nil {\n\t\treturn\n\t}\n\n\tfmt.Println(\"Accept connection from \", conn.LocalAddr())\n\n\tdaytime := time.Now().String()\n\n\t// give response to client\n\tconn.WriteToUDP([]byte(daytime), addr)\n}", "title": "" }, { "docid": "83391a306367fdfe6311c168e1439b02", "score": "0.5821049", "text": "func handler(c net.Conn) {\n\tlog.Printf(\"Client connected [%s]\", c.RemoteAddr().Network())\n\tbuff := make([]byte, 512)\n\tn, err := c.Read(buff)\n\tif err != nil {\n\t\tlog.Print(\"Error copying data into buffer\")\n\t\tlog.Error(err)\n\t\treturn\n\t}\n\tlog.Printf(\"We have received about %d bytes of data\", n)\n\tmessage := struct {\n\t\tInterrupt bool `json:\"interrupt\"`\n\t}{}\n\terr = json.Unmarshal(buff[0:n], &message)\n\tif err != nil {\n\t\tlog.Print(\"failed to unmarshal message on the connection\")\n\t\tlog.Error(err)\n\t\treturn\n\t}\n\tlog.Printf(\"%v\", message)\n\tc.Close()\n}", "title": "" }, { "docid": "f4cec3c19766a9fa0b5f550d8da391a2", "score": "0.58208966", "text": "func handle_in_conn(usr *user, reader *bufio.Reader) {\n\tfor { //When a message comes in, parse it \n\t\tn:=false\n\t\tbuf, n, err := reader.ReadLine()\n \tif err != nil { break } //on error break and force the outbound to fail\n \tif (!n) {\n \t\tparse_input(string(buf), usr)\n \t} else {\n \t\tfmt.Println(\"Message larger than buffer :-/ \")\n\t \tparse_input(string(buf), usr)\n\t }\n }\n\t //We are no longer reading due to a read error\n\t //send a message to the conn_hanler to force an error on\n\t //write which ensures a quick disconnection\n\t var msg message\n msg.message = []byte(\"Bye! I'm not listening any more!\")\n defer func() {recover()}() //If someone typed /quit,the channel will be closed so recover to keep from blowing up\n usr.channel <- msg\n}", "title": "" }, { "docid": "0624e5704eb3132cd56795982d0f3d0f", "score": "0.5814539", "text": "func Handler(connection net.Conn, log *logs.CompositeLog) {\n\tlog.Infof(\"%s has connected to the server\", connection.RemoteAddr().String())\n\n\t// Infinite loop until exited from inside\n\tfor {\n\t\tdata, err := bufio.NewReader(connection).ReadString('\\n')\n\t\tif err != nil {\n\t\t\tlog.Error(\"Listening of \" + connection.RemoteAddr().String() + \" has stopped (disconnected)?...\")\n\t\t\treturn\n\t\t}\n\n\t\tstringdata := strings.TrimSpace(string(data))\n\t\tif len(stringdata) == 0 {\n\t\t\tresult := \"Server responds : Empty input...\" + \"\\n\"\n\t\t\tlog.Info(\"Client sent empty string, ignoring\")\n\t\t\tconnection.Write([]byte(string(result)))\n\t\t} else {\n\t\t\ttemp := strings.TrimSpace(\"Address : \" + connection.RemoteAddr().String() + \" says : \" + stringdata)\n\t\t\tlog.Info(temp)\n\t\t\tresult := \"Server has received your message\" + \"\\n\"\n\t\t\tconnection.Write([]byte(string(result)))\n\t\t}\n\t\tdefer connection.Close()\n\t}\n}", "title": "" }, { "docid": "be2caf62767a325f5472a00852d0ee6c", "score": "0.58089703", "text": "func (ctrl *Control) HandleWebMessage(msg server.ServerCommand) {\r\n\r\n\t//name := strings.ReplaceAll(msg.DeviceName, \"_\", \" \")\r\n\tname := msg.DeviceName\r\n\tswitch msg.Cmd {\r\n\tcase server.CmdSetRelay:\r\n\t\trelay, ok := ctrl.actors[name]\r\n\t\tif ok {\r\n\t\t\tsVal := string(msg.Value)\r\n\t\t\tif sVal == \"ON\" {\r\n\t\t\t\trelay.On()\r\n\t\t\t} else {\r\n\t\t\t\trelay.Off()\r\n\t\t\t}\r\n\t\t\tstate := relay.GetState()\r\n\t\t\tif state == StateOn {\r\n\t\t\t\tmsg.ChanReturn <- \"ON\"\r\n\t\t\t} else {\r\n\t\t\t\tmsg.ChanReturn <- \"OFF\"\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tmsg.ChanReturn <- \"ack\"\r\n\t\t}\r\n\tcase server.CmdRelayOn:\r\n\t\tif relay, ok := ctrl.actors[name]; ok {\r\n\t\t\trelay.On()\r\n\t\t}\r\n\t\tmsg.ChanReturn <- \"ack\"\r\n\tcase server.CmdRelayOff:\r\n\t\tif relay, ok := ctrl.actors[name]; ok {\r\n\t\t\trelay.Off()\r\n\t\t}\r\n\t\tmsg.ChanReturn <- \"ack\"\r\n\tcase server.CmdGetSensorValue:\r\n\t\tif sensor, ok := ctrl.sensorValues[name]; ok {\r\n\t\t\tval := fmt.Sprintf(\"%.2f\", sensor)\r\n\t\t\tmsg.ChanReturn <- val\r\n\t\t} else {\r\n\t\t\tmsg.ChanReturn <- \"bad\"\r\n\t\t}\r\n\tcase server.CmdGetActorValue:\r\n\t\tif relay, ok := ctrl.actors[name]; ok {\r\n\t\t\tstate := relay.GetState()\r\n\t\t\tif state == StateOn {\r\n\t\t\t\tctrl.logger.LogDebug(\"server.CmdGetActorValue %s ON\", name)\r\n\t\t\t\tmsg.ChanReturn <- \"ON\"\r\n\t\t\t} else {\r\n\t\t\t\tctrl.logger.LogDebug(\"server.CmdGetActorValue %s OFF\", name)\r\n\t\t\t\tmsg.ChanReturn <- \"OFF\"\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tmsg.ChanReturn <- \"bad\"\r\n\t\t}\r\n\tcase server.CmdGetSetpointValue:\r\n\t\tif eq, ok := ctrl.equipment[name]; ok {\r\n\t\t\tsetpoint, err := eq.GetSetpoint()\r\n\t\t\tif err != nil {\r\n\t\t\t\tmsg.ChanReturn <- \"bad\"\r\n\t\t\t} else {\r\n\t\t\t\tval := fmt.Sprintf(\"%0.2f\", setpoint)\r\n\t\t\t\tmsg.ChanReturn <- val\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tmsg.ChanReturn <- \"bad\"\r\n\t\t}\r\n\tdefault:\r\n\t\tmsg.ChanReturn <- \"Unknown\"\r\n\t}\r\n}", "title": "" }, { "docid": "e6eb90ac2e5ae29d25f503c0d25aafdf", "score": "0.579419", "text": "func handlePostMessage(ctx context.Context, req *websocket.Request) (\n\tres websocket.Response,\n) {\n\tuid := ctx.Value(websocket.CtxKeyUID).(int64)\n\tuser := examples.Users[uid]\n\n\tlog.Printf(\"server: message from %s: %q\\n\", user.Name, req.Body)\n\n\tbody := user.Name + \": \" + req.Body\n\tpacket, err := websocket.NewBroadcast(examples.BroadcastMessage, body)\n\tif err != nil {\n\t\tres.Code = http.StatusInternalServerError\n\t\tres.Body = err.Error()\n\t\treturn res\n\t}\n\n\t// Broadcast the message to all connected clients, including our\n\t// connections. Remember, that user could connected through many\n\t// application.\n\tfor _, conn := range server.Clients.All() {\n\t\tif conn == req.Conn {\n\t\t\tcontinue\n\t\t}\n\t\terr = websocket.Send(conn, packet)\n\t\tif err != nil {\n\t\t\tlog.Println(err)\n\t\t}\n\t}\n\n\t// Set the response status to success.\n\tres.Code = http.StatusOK\n\n\treturn res\n}", "title": "" }, { "docid": "3a007d4f054a4c33273e09f83ba58d41", "score": "0.5791483", "text": "func (t *svrTransHandler) OnMessage(ctx context.Context, args, result remote.Message) (context.Context, error) {\n\terr := t.inkHdlFunc(ctx, args.Data(), result.Data())\n\treturn ctx, err\n}", "title": "" }, { "docid": "dd1bfdf2800aa6812323e8435f1de3b7", "score": "0.57821", "text": "func (ln *LocalNode) handleRemoteMessage(remoteMsg *RemoteMessage) error {\n\tif remoteMsg.RemoteNode == nil && remoteMsg.Msg.MessageType != protobuf.BYTES {\n\t\treturn errors.New(\"Message is sent by local node\")\n\t}\n\n\tswitch remoteMsg.Msg.MessageType {\n\tcase protobuf.PING:\n\t\treplyMsg, err := ln.NewPingReply(remoteMsg.Msg.MessageId)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\terr = remoteMsg.RemoteNode.SendMessageAsync(replyMsg)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\tcase protobuf.EXCHANGE_NODE:\n\t\tmsgBody := &protobuf.ExchangeNode{}\n\t\terr := proto.Unmarshal(remoteMsg.Msg.Message, msgBody)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\terr = remoteMsg.RemoteNode.setNode(msgBody.Node)\n\t\tif err != nil {\n\t\t\tremoteMsg.RemoteNode.Stop(err)\n\t\t\treturn err\n\t\t}\n\n\t\treplyMsg, err := ln.NewExchangeNodeReply(remoteMsg.Msg.MessageId)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\terr = remoteMsg.RemoteNode.SendMessageAsync(replyMsg)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\tcase protobuf.STOP:\n\t\tlog.Infof(\"Received stop message from remote node %v\", remoteMsg.RemoteNode)\n\t\tremoteMsg.RemoteNode.Stop(nil)\n\n\tcase protobuf.BYTES:\n\t\tmsgBody := &protobuf.Bytes{}\n\t\terr := proto.Unmarshal(remoteMsg.Msg.Message, msgBody)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tdata := msgBody.Data\n\t\tvar shouldCallNextMiddleware bool\n\t\tfor _, mw := range ln.middlewareStore.bytesReceived {\n\t\t\tdata, shouldCallNextMiddleware = mw.Func(data, remoteMsg.Msg.MessageId, remoteMsg.Msg.SrcId, remoteMsg.RemoteNode)\n\t\t\tif !shouldCallNextMiddleware {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\tdefault:\n\t\treturn errors.New(\"Unknown message type\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "b72ac5535f90e1a89d734ac5ac81e870", "score": "0.5780377", "text": "func (this *MuxManager) DispatchIncoming() {\n\n}", "title": "" }, { "docid": "7503b6fe8d22372cc58deaef1b4d5152", "score": "0.57778287", "text": "func (sm *SessionManager) HandleTextMessage(msg whatsapp.TextMessage) {\n\tsm.TextChannel <- msg\n}", "title": "" }, { "docid": "9282b717135b322ce831fb3e192af727", "score": "0.5768837", "text": "func handleMessages (conn net.Conn) {\n\treader := bufio.NewReader(conn)\n\tscanner := bufio.NewScanner(reader)\n\n\tdefer conn.Close()\n\n\tscanner.Split(ScanCRLF)\n\n\tfor scanner.Scan() {\n\t\t// Pass newMessage into TCPMessageChannel\n\t\tCommunicationChannelTCPMessages <- TCPMessageChannel{scanner.Bytes(), conn.RemoteAddr().String()}\n\t}\n\n}", "title": "" }, { "docid": "5eb388756f50b36b42ef870994396ccd", "score": "0.57674253", "text": "func (s *server) readRoutine() {\n\tgo s.mapRequestHandler()\n\tfor {\n\t\tselect {\n\t\tcase <-s.readingClose:\n\t\t\treturn\n\t\tdefault:\n\t\t\tvar packet [2000]byte\n\t\t\tbytesRead, addr, _ := s.conn.ReadFromUDP(packet[0:])\n\n\t\t\tvar data Message\n\t\t\tjson.Unmarshal(packet[:bytesRead], &data)\n\n\t\t\t//check if its a connection message\n\t\t\tif data.Type == MsgConnect {\n\t\t\t\tnewWindow := &serverSlidingWindow{\n\t\t\t\t\tstart: 1,\n\t\t\t\t\tpendingMsgs: list.New(),\n\t\t\t\t}\n\t\t\t\tnc := &clientInfo{\n\t\t\t\t\tcurrSN: 1,\n\t\t\t\t\tclientSN: 1,\n\t\t\t\t\tack: make(chan Message),\n\t\t\t\t\taddr: addr,\n\t\t\t\t\tstoredMessages: make(map[int]Message),\n\t\t\t\t\tslidingWin: newWindow,\n\t\t\t\t\tlost: false,\n\t\t\t\t\tserverClosed: make(chan bool),\n\t\t\t\t\tcxnClosed: make(chan bool),\n\t\t\t\t}\n\t\t\t\treq := request{\n\t\t\t\t\treqType: AddClient,\n\t\t\t\t\tnewClient: nc,\n\t\t\t\t}\n\t\t\t\ts.reqChan <- req\n\t\t\t} else {\n\t\t\t\t// check if data message and need to send ack\n\t\t\t\tif data.Type == MsgData {\n\t\t\t\t\t// verify checksum\n\t\t\t\t\tif data.Size < len(data.Payload) {\n\t\t\t\t\t\tdata.Payload = data.Payload[:data.Size]\n\t\t\t\t\t}\n\t\t\t\t\t//chksum := s.checksum(data.ConnID, data.SeqNum, data.Size, data.Payload)\n\t\t\t\t\tif data.Size > len(data.Payload) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\t// send ack\n\t\t\t\t\tack, _ := json.Marshal(NewAck(data.ConnID, data.SeqNum))\n\t\t\t\t\ts.conn.WriteToUDP(ack, addr)\n\t\t\t\t}\n\t\t\t\treq := request{\n\t\t\t\t\treqType: AddMsg,\n\t\t\t\t\tclientID: data.ConnID,\n\t\t\t\t\taddMsg: &data,\n\t\t\t\t}\n\t\t\t\ts.reqChan <- req\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "8b9347b2ff8dd780b8360ceb3578e549", "score": "0.576696", "text": "func handleTCPClient(conn net.Conn) {\n\tdefer conn.Close()\n\tdefer fmt.Println(\"closing connection for \", conn.RemoteAddr())\n\n\tvar buf [2048]byte\n\tfor {\n\t\t// read input \n\t\t_, err := conn.Read(buf[0:])\t\t\n\t\t// if there was an error exit\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\n\t\t// convert message to string\n\t\tmessage := string(buf[0:])\n\t\tfmt.Println(message)\t\t\n\n\t\t// compose reponse to message\n\t\tresponse := composeResponse(message, strings.Split(conn.LocalAddr().String(), \":\")[0])\n\t\t// write the response to the socket\n\t\t_, err2 := conn.Write(response.ToBytes())\n\t\tif err2 != nil {\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a8b68e53ba7e84bcd45d9f3f3215c383", "score": "0.57623875", "text": "func messageHandler(ctx *context.AppContext) {\n\tgo func() {\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase rtmEvent := <-ctx.Service.RTM.IncomingEvents:\n\t\t\t\tswitch ev := rtmEvent.Data.(type) {\n\t\t\t\tcase *slack.MessageEvent:\n\n\t\t\t\t\t// Construct message\n\t\t\t\t\tmsg, err := ctx.Service.CreateMessageFromMessageEvent(ev, ev.Channel)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\t// Add message to the selected channel\n\t\t\t\t\tchn, ok := ctx.View.Channels.GetSelectedChannel()\n\t\t\t\t\tif ok && ev.Channel == chn.ID {\n\n\t\t\t\t\t\t// Get the thread timestamp of the event, we need to\n\t\t\t\t\t\t// check the previous message as well, because edited\n\t\t\t\t\t\t// message don't have the thread timestamp\n\t\t\t\t\t\tvar threadTimestamp string\n\t\t\t\t\t\tif ev.ThreadTimestamp != \"\" {\n\t\t\t\t\t\t\tthreadTimestamp = ev.ThreadTimestamp\n\t\t\t\t\t\t} else if ev.PreviousMessage != nil && ev.PreviousMessage.ThreadTimestamp != \"\" {\n\t\t\t\t\t\t\tthreadTimestamp = ev.PreviousMessage.ThreadTimestamp\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthreadTimestamp = \"\"\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// When timestamp isn't set this is a thread reply,\n\t\t\t\t\t\t// handle as such\n\t\t\t\t\t\tif threadTimestamp != \"\" {\n\t\t\t\t\t\t\tctx.View.Chat.AddReply(threadTimestamp, msg)\n\t\t\t\t\t\t} else if threadTimestamp == \"\" && ctx.Focus == context.ChatFocus {\n\t\t\t\t\t\t\tctx.View.Chat.AddMessage(msg)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// we (mis)use actionChangeChannel, to rerender, the\n\t\t\t\t\t\t// view when a new thread has been started\n\t\t\t\t\t\tif ctx.Service.IsNewThread(msg.ThreadID) {\n\t\t\t\t\t\t\tactionChangeChannel(ctx)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttermui.Render(ctx.View.Chat)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// TODO: set Chat.Offset to 0, to automatically scroll\n\t\t\t\t\t\t// down?\n\t\t\t\t\t}\n\n\t\t\t\t\t// Set new message indicator for channel, I'm leaving\n\t\t\t\t\t// this here because I also want to be notified when\n\t\t\t\t\t// I'm currently in a channel but not in the terminal\n\t\t\t\t\t// window (tmux). But only create a notification when\n\t\t\t\t\t// it comes from someone else but the current user.\n\t\t\t\t\tif ev.User != ctx.Service.CurrentUserID {\n\t\t\t\t\t\tactionNewMessage(ctx, ev)\n\t\t\t\t\t}\n\t\t\t\tcase *slack.PresenceChangeEvent:\n\t\t\t\t\tactionSetPresence(ctx, ev.User, ev.Presence)\n\t\t\t\tcase *slack.RTMError:\n\t\t\t\t\tctx.View.Debug.Println(\n\t\t\t\t\t\tev.Error(),\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "a36120c4a7186ca7f6c497a94951c0ce", "score": "0.5760275", "text": "func (p *ProxyContext) HandleClient(c net.Conn, d *Conn) error {\n\n\tmsg := make([]byte, MaxMsgBytes)\n\tc.SetDeadline(time.Now().Add(p.timeout))\n\tbytes, err := c.Read(msg)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err = p.SendMessage(d, msg[:bytes]); err != nil {\n\t\treturn err\n\t}\n\n\treply, err := p.ReceiveMessage(d)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tc.SetDeadline(time.Now().Add(p.timeout))\n\tif _, err = c.Write(reply); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "8749fe34cf9a9d67f0de1a1aeef39fe3", "score": "0.5755717", "text": "func (rcvHand *RcvHandler) ReceiveHandler(from int, to int, username string,\n\tcontent string) {\t\n\t// DONOT CHANGE PARAMENTERS OR FUNCTION HEADER.\n\t// TODO: Implement handling a message received.\n\t//if (username == \"user16\") && (content != \"\") {\n\t\tgo updateGraph(content)\n\t\tgo sendAgain(from,content)\n\t\t//student := new(student.Student)\n\n\t//}\n}", "title": "" }, { "docid": "b72b7ed75706a2bdbe14be63fdd1e3e5", "score": "0.57548076", "text": "func onMessage(sess *dg.Session, msg *dg.MessageCreate) {\n\tdefer func() {\n\t\tif perr := recover(); perr != nil {\n\t\t\tfmt.Println(\"Recovered from panic: \", perr)\n\t\t}\n\t}()\n\n\tcmdPrefix := viper.GetString(\"COMMAND_PREFIX\")\n\tstart := time.Now()\n\n\t// Ruling out messages that are not commands\n\tif msg.Author.ID == sess.State.User.ID ||\n\t\tmsg.Author.Bot ||\n\t\t!strings.HasPrefix(msg.Content, cmdPrefix) {\n\t\treturn\n\t}\n\n\t// Splitting message into command parts and leaving out the prefix\n\tparts, err := shlex.Split(msg.Content[1:])\n\tif err != nil {\n\t\treturn\n\t}\n\n\t// Creating parser\n\tparser, err := kong.New(&commands.Root{},\n\t\tkong.Exit(func(int) {}),\n\t\tkong.Help(createHelpPrinter(sess, msg)),\n\n\t\t// Binding all the things\n\t\tkong.Bind(sess),\n\t\tkong.Bind(msg),\n\t\tkong.Bind(routeService),\n\t\tkong.Bind(start),\n\t)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Trying to find a command to execute with the message content\n\tcmd, err := parser.Parse(parts)\n\tif err != nil {\n\t\tif embed := errorToEmbed(err); embed != nil {\n\t\t\tsess.ChannelMessageSendEmbed(msg.ChannelID, embed)\n\t\t} else {\n\t\t\tfmt.Println(err)\n\t\t}\n\n\t\treturn\n\t}\n\n\t// Executing the command\n\terr = cmd.Run()\n\tif err != nil {\n\t\tif embed := errorToEmbed(err); embed != nil {\n\t\t\tsess.ChannelMessageSendEmbed(msg.ChannelID, embed)\n\t\t} else {\n\t\t\tfmt.Println(err)\n\t\t}\n\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "a8b0a40e80b0d8362406c0425e81484f", "score": "0.57434076", "text": "func handleMessages() {\n\t// An infinite loop is needed here because the goroutine is constantly\n\t// reading things from the broadcast variable\n\tfor {\n\t\t// Grab the next message from the broadcast channel\n\t\tmsg := <-broadcast\n\t\t//Log the message to the console\n\t\tlog.Println(msg)\n\t\t// Send it out to every client that is currently connected\n\t\tfor client := range clients {\n\t\t\terr := client.WriteJSON(msg)\n\t\t\tif err != nil {\n\t\t\t\tlog.Printf(\"error: %v\", err)\n\t\t\t\tclient.Close()\n\t\t\t\tdelete(clients, client)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "8edeba176a1cce022e034584788c6547", "score": "0.57399637", "text": "func (mh *MqttTransport) onMessage(client MQTT.Client, msg MQTT.Message) {\n\tlog.Debugf(\" New msg from TOPIC: %s\", msg.Topic())\n\t// log.Debug(\"MSG: %s\\n\", msg.Payload())\n\tvar domain , topic string\n\tif mh.useDomains {\n\t\tdomain, topic = DetachDomainFromTopic(msg.Topic())\n\t}else {\n\t\ttopic = msg.Topic()\n\t}\n\tiotMsg, err := iotmsglibgo.ConvertBytesToIotMsg(topic, msg.Payload(), nil)\n\tif err == nil {\n\t\tmh.msgHandler(topic, iotMsg, domain)\n\t} else {\n\t\tlog.Error(err)\n\n\t}\n}", "title": "" }, { "docid": "3a252bf5222abae3b4b81abaf79a6d6b", "score": "0.57393414", "text": "func messageRecieved(w http.ResponseWriter, r *http.Request) {\r\n\tfmt.Printf(\"Message Recieved!!\\n\")\r\n\r\n\tdefer r.Body.Close()\r\n\r\n\tbody, err := ioutil.ReadAll(r.Body)\r\n\r\n\tif (err != nil) {\r\n\t\tfmt.Printf(\"Error reading request body: %v\\n\", err)\r\n\t\treturn\r\n\t}\r\n\r\n\tbodyMap := make(map[string] interface{})\r\n\terr = json.Unmarshal(body, &bodyMap)\r\n\r\n\tif (err != nil) {\r\n\t\tfmt.Printf(\"Error unmarshalling body into map; %v\", err)\r\n\t\treturn\r\n\t}\r\n\r\n\tlogMessage(bodyMap)\r\n\tmessage := buildMessageStruct(bodyMap)\r\n\r\n\t// Only process messages from humans\r\n\tif (message.SenderType != \"user\") {\r\n\t\treturn\r\n\t}\r\n\r\n\tfor _, skill := range skills.GetActiveSkills() {\r\n\t\tif (skill(message)) {\r\n\t\t\tbreak\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "9dfcdebcbd3884b4539d2578c963adea", "score": "0.5736669", "text": "func sendHandler(w http.ResponseWriter, r *http.Request) {\n\tlog.Println(\"Entered Send Handler\")\n\n\tdecoder := json.NewDecoder(r.Body)\n\tvar message Message\n\terr := decoder.Decode(&message)\n\tif err != nil {\n\t\tlog.Println(err.Error())\n\t}\n\n\tt := time.Now()\n\tt = t.AddDate(0, 0, 1)\n\t_, err = db.Exec(\n\t\t\"INSERT INTO message (text, location, expiry) VALUES ($1, point($2, $3), $4)\",\n\t\tmessage.Text,\n\t\tmessage.Latitude,\n\t\tmessage.Longitude,\n\t\tt,\n\t)\n\n\tif err != nil {\n\t\tlog.Println(err.Error())\n\t}\n\n\tw.Header().Set(\"Access-Control-Allow-Origin\", r.Header.Get(\"Origin\"))\n\tw.Header().Set(\"Access-Control-Allow-Credentials\", \"true\")\n\tw.WriteHeader(200)\n}", "title": "" }, { "docid": "a842cc1128961577a0a0b7c2da4d6983", "score": "0.57366186", "text": "func (handler EchoHandler) HandleMessage(m margelet.Message) error {\n\t_, err := m.QuickSend(m.Message().Text, nil)\n\treturn err\n}", "title": "" }, { "docid": "248371f1433e9067e5ccbf9c74f29464", "score": "0.573157", "text": "func (serverRequestHandler *SRH) Send(msgToClient []byte) {\n\tdefer serverRequestHandler.conn.Close()\n\tdefer serverRequestHandler.listener.Close()\n\n\t// send message size\n\tsize := make([]byte, 4)\n\tlength := uint32(len(msgToClient))\n\tbinary.LittleEndian.PutUint32(size, length)\n\t_, err := serverRequestHandler.conn.Write(size)\n\tutils.PrintError(err, \"unable to send message size on SRH\")\n\n\t// send message\n\t_, err = serverRequestHandler.conn.Write(msgToClient)\n\tutils.PrintError(err, \"unable to send message on SRH\")\n}", "title": "" }, { "docid": "eb59e2a24b2d9d48c8f5bdbf85bf3b49", "score": "0.57270294", "text": "func messageHandler(mel *Melodious, connInfo *ConnInfo, message BaseMessage, send func(BaseMessage)) {\n\tdefer func() {\n\t\tif err := recover(); err != nil {\n\t\t\tsend(&MessageFatal{Message: fmt.Sprintf(\"%v\", err)})\n\t\t\tlog.WithFields(log.Fields{\n\t\t\t\t\"addr\": connInfo.connection.RemoteAddr().String(),\n\t\t\t\t\"name\": connInfo.username,\n\t\t\t\t\"err\": err,\n\t\t\t}).Error(\"panic while receiving a message\")\n\t\t\tdebug.PrintStack()\n\t\t}\n\t}()\n\n\tif !connInfo.loggedIn {\n\t\tswitch message.(type) {\n\t\tcase *MessageRegister:\n\t\t\thandleRegisterMessage(mel, connInfo, message, send)\n\t\tcase *MessageLogin:\n\t\t\thandleLoginMessage(mel, connInfo, message, send)\n\t\t}\n\t} else {\n\t\tswitch message.(type) {\n\t\tcase *MessageNewChannel:\n\t\t\thandleNewChannelMessage(mel, connInfo, message, send)\n\t\tcase *MessageChannelTopic:\n\t\t\thandleChannelTopicMessage(mel, connInfo, message, send)\n\t\tcase *MessageDeleteChannel:\n\t\t\thandleDeleteChannelMessage(mel, connInfo, message, send)\n\t\tcase *MessageQuit:\n\t\t\thandleQuitMessage(mel, connInfo, message, send)\n\t\tcase *MessageSubscribe:\n\t\t\thandleSubscribeMessage(mel, connInfo, message, send)\n\t\tcase *MessagePostMsg:\n\t\t\thandlePostMsgMessage(mel, connInfo, message, send)\n\t\tcase *MessageGetMsgs:\n\t\t\thandleGetMsgsMessage(mel, connInfo, message, send)\n\t\tcase *MessageListChannels:\n\t\t\thandleListChannelsMessage(mel, connInfo, message, send)\n\t\tcase *MessageListUsers:\n\t\t\thandleListUsersMessage(mel, connInfo, message, send)\n\t\tcase *MessageKick:\n\t\t\thandleKickMessage(mel, connInfo, message, send)\n\t\tcase *MessageNewGroup:\n\t\t\thandleNewGroupMessage(mel, connInfo, message, send)\n\t\tcase *MessageDeleteGroup:\n\t\t\thandleDeleteGroupMessage(mel, connInfo, message, send)\n\t\tcase *MessageSetFlag:\n\t\t\thandleSetFlagMessage(mel, connInfo, message, send)\n\t\tcase *MessageDeleteFlag:\n\t\t\thandleDeleteFlagMessage(mel, connInfo, message, send)\n\t\tcase *MessageTyping:\n\t\t\thandleTypingMessage(mel, connInfo, message, send)\n\t\tcase *MessageNewGroupHolder:\n\t\t\thandleNewGroupHolderMessage(mel, connInfo, message, send)\n\t\tcase *MessageDeleteGroupHolder:\n\t\t\thandleDeleteGroupHolderMessage(mel, connInfo, message, send)\n\t\tcase *MessageDeleteMsg:\n\t\t\thandleDeleteMsgMessage(mel, connInfo, message, send)\n\t\tcase *MessageGetGroupHolders:\n\t\t\thandleGetGroupHoldersMessage(mel, connInfo, message, send)\n\t\tcase *MessageGetGroups:\n\t\t\thandleGetGroupsMessage(mel, connInfo, message, send)\n\t\tcase *MessageGetFlags:\n\t\t\thandleGetFlagsMessage(mel, connInfo, message, send)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9bb5d70e71ce1687b0f095f56a11b9a5", "score": "0.57266057", "text": "func messageHandler(res http.ResponseWriter, req *http.Request) {\n\tif req.Method != \"POST\" {\n\t\thttp.Error(res, \"Bad request\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\t// Parse out from id\n\t// Parse out to id\n\tpeerIDValues, peerExists := req.URL.Query()[peerIDParamName]\n\ttoIDValues, toExists := req.URL.Query()[toParamName]\n\n\tif !peerExists || !toExists {\n\t\thttp.Error(res, \"Missing Peer or To ID\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tpeerID := peerIDValues[0]\n\ttoID := toIDValues[0]\n\n\tfrom, peerInfoExists := peers[peerID]\n\tto, toInfoExists := peers[toID]\n\n\tif !peerInfoExists || !toInfoExists || from == nil || to == nil {\n\t\thttp.Error(res, \"Invalid Peer or To ID\", http.StatusBadRequest)\n\t\treturn\n\t}\n\t// Update the last time we heard from peer\n\tfrom.LastContact = time.Now().UTC()\n\n\tif from.ConnectedWith == \"\" {\n\t\tfmt.Printf(\"Connecting %s with %s\\n\", from, to)\n\t\tfrom.ConnectedWith = to.ID\n\t}\n\n\tif to.ConnectedWith == \"\" {\n\t\tfmt.Printf(\"Connecting %s with %s\\n\", to, from)\n\t\tto.ConnectedWith = from.ID\n\t}\n\n\tif from.ConnectedWith != to.ID {\n\t\tfmt.Printf(\"WARNING: Peer sending message to recipient outside room\\n\")\n\t}\n\n\t// Must set pragma to peer id of sender\n\tsetPragmaHeader(res.Header(), peerID)\n\n\t// Read message data as a string and send it to the recipients channel\n\trequestData, err := ioutil.ReadAll(req.Body)\n\tif err != nil {\n\t\thttp.Error(res, err.Error(), http.StatusInternalServerError)\n\t}\n\trequestString := string(requestData)\n\tdefer req.Body.Close()\n\t// Look up channel for to id\n\tif len(to.Channel) == cap(to.Channel) {\n\t\thttp.Error(res, \"Peer is backed up\", http.StatusServiceUnavailable)\n\t\treturn\n\t}\n\t// channel gets message + sender id\n\tto.Channel <- &peerMsg{peerID, requestString}\n\n\tres.WriteHeader(http.StatusOK)\n\tfmt.Printf(\"message: %s -> %s: \\n\\t%s\\n\", from, to, requestString)\n}", "title": "" }, { "docid": "ed592515fac3a412153f08a6f2e000c1", "score": "0.5724457", "text": "func clientsender(client *ClientChat) {\n Log(\"clientsender(): start for: \", client.Name);\n for {\n Log(\"clientsender(): wait for input to send\");\n select {\n case buf := <- client.IN:\n Log(\"clientsender(): send to \\\"\", client.Name, \"\\\": \", string(buf));\n client.Con.Write(strings.Bytes(buf));\n case <-client.Quit:\n Log(\"clientsender(): client want to quit\");\n client.Con.Close();\n break;\n }\n }\n Log(\"clientsender(): stop for: \", client.Name);\n}", "title": "" }, { "docid": "ff457bd3f2e6a768df23ea0412b894d6", "score": "0.5723298", "text": "func (s *Session) ProcessIncomingMessage(ctx context.Context) error {\n\tbuffer := make([]byte, MaxMsgSize)\n\n\tbytesRead, err := s.Conn.Read(buffer)\n\tif err != nil {\n\t\t// This indicates that we have reached a bad state\n\t\t// for the connection and we need to terminate the handler.\n\t\treturn err\n\t}\n\n\tresponse, err := s.mod.ProcessMessage(ctx, s, buffer[:bytesRead])\n\tif err != nil {\n\t\t// The only way we hit here is if we fail to marshal the module's\n\t\t// response. Should not actually be possible. ProcessMessage\n\t\t// will generate a valid Response structure for any bad input.\n\t\treturn err\n\t}\n\n\t_, err = s.Conn.Write(response)\n\tif err != nil {\n\t\t// This should only happen if we're shutting down while\n\t\t// trying to send our response.\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "b07247d258c948b26d3aa7de9b1683b3", "score": "0.57226163", "text": "func (s *session) OnMessage(typ proto.Type, body proto.Body) error {\n\tatomic.AddInt64(&s.internal.stats.recv, int64(body.Len()))\n\ts.keepalive()\n\treturn s.handler.onMessage(s, typ, body)\n}", "title": "" }, { "docid": "43936e88af43b7e70ff18b8b1dfe5e25", "score": "0.57212114", "text": "func OnMessage(session disgord.Session, evt *disgord.MessageCreate) {\n\tmsg := Msg{\n\t\tMsg: evt.Message,\n\t\tSession: session,\n\t}\n\tCommandChannel <- msg\n}", "title": "" }, { "docid": "3d1b77fb1e8ff705ef35275e5f4f51c7", "score": "0.57185596", "text": "func MsgHandler(msg *nats.Msg) {\n}", "title": "" }, { "docid": "ece31b06180812cb29d2852c1b48ccb4", "score": "0.5717102", "text": "func (r *FCPClient) reciever() {\n\tscanner := bufio.NewScanner(r.socket)\n\tstarted := false\n\tmsg := message{}\n\tparams := []string{}\n\tvar datalen int64 = 0\n\tvar data []byte = nil\n\n\tfor {\n\t\tif ok := scanner.Scan(); !ok {\n\t\t\tbreak\n\t\t}\n\t\tif !started {\n\t\t\tmsg.name = scanner.Text()\n\t\t\tstarted = true\n\t\t\tif ok := scanner.Scan(); !ok {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tparam, val := SplitParam(scanner.Text())\n\t\tswitch param {\n\t\tcase \"EndMessage\":\n\t\t\tparams = append(params, scanner.Text())\n\t\t\tmsg.params = make([]string, len(params))\n\t\t\tcopy(msg.params, params)\n\t\t\tr.msgHandler <- msg\n\t\t\tstarted = false\n\t\t\tparams = []string{\"\"}\n\t\t\tdatalen = 0\n\t\t\tdata = nil\n\t\tcase \"DataLength\":\n\t\t\tparams = append(params, scanner.Text())\n\t\t\tdatalen, _ = strconv.ParseInt(val, 10, 64)\n\t\tcase \"Data\":\n\t\t\tparams = append(params, scanner.Text())\n\t\t\tdata = make([]byte, datalen)\n\t\t\trb, err := io.ReadFull(r.socket, data)\n\t\t\tif int64(rb) < datalen {\n\t\t\t\tfmt.Println(\"Was expecting\", datalen, \"bytes, got\", rb, \"Bytes instead. \", err)\n\t\t\t}\n\t\t\tmsg.data = make([]byte, datalen)\n\t\t\tcopy(msg.data, data)\n\n\t\t\tmsg.params = make([]string, len(params))\n\t\t\tcopy(msg.params, params)\n\t\t\tr.msgHandler <- msg\n\t\t\tstarted = false\n\t\t\tparams = []string{\"\"}\n\t\t\tdatalen = 0\n\t\t\tdata = nil\n\n\t\tdefault:\n\t\t\tparams = append(params, scanner.Text())\n\n\t\t}\n\n\t\tfmt.Println(\"RAW DUMP:\", scanner.Text())\n\t}\n\tfmt.Println(\"Connection Closed\")\n\tos.Exit(1)\n}", "title": "" }, { "docid": "4c13201513ec8472a59765eb4e5e276a", "score": "0.5711243", "text": "func SendMessage(msg io.Reader, c client.Client) {\n\tif err := c.Connection().SendMessage(msg); err != nil {\n\t\tlog.Println(err)\n\t}\n}", "title": "" }, { "docid": "8fc3e4a705f2bd4053eda1dae5727d39", "score": "0.5708135", "text": "func SockServer(ws *websocket.Conn) {\n\tvar err error\n\t//var clientMessage string\n\t// use []byte if websocket binary type is blob or arraybuffer\n\tvar clientMessage []byte\n\n\t// cleanup on server side\n\tdefer func() {\n\t\tif err = ws.Close(); err != nil {\n\t\t\tlog.Print(err)\n\t\t}\n\t}()\n\n\tclient := ws.Request().RemoteAddr\n\tlog.Printf(\"client connected: %v\", client)\n\tclientSock := WebsockConn{ws, client}\n\tactiveClients[clientSock] = 0\n\tlog.Printf(\"number of clients connected: %v\", len(activeClients))\n\n\t// for loop so the websocket stays open otherwise\n\t// it'll close after one Receieve and Send\n\tfor {\n\t\tif err = websocket.Message.Receive(ws, &clientMessage); err != nil {\n\t\t\t// If we cannot Read then the connection is closed\n\t\t\tlog.Printf(\"websocket Disconnected waiting %v\", err.Error())\n\t\t\t// remove the ws client conn from our active clients\n\t\t\tdelete(activeClients, clientSock)\n\t\t\tlog.Printf(\"number of clients still connected ... %v\", len(activeClients))\n\t\t\treturn\n\t\t}\n\n\t\t//clientMessage = clientSock.clientIP + \" Said: \" + clientMessage\n\n\t\t// Parse the JSON\n\t\tm := WebsocketMessage{}\n\t\tif err = json.Unmarshal(clientMessage, &m); err != nil {\n\t\t\tlog.Print(err)\n\t\t}\n\n\t\t// Handle the command\n\t\t// Compose result struct containing proper parameters\n\t\t// TODO: separate actions into functions\n\t\tswitch m.UpdateType {\n\t\tcase \"add\":\n\t\t\tm.UpdateType = ReqAddTag(m.UpdateType, []llrp.TagRecord{m.Tag})\n\t\tcase \"delete\":\n\t\t\tm.UpdateType = ReqDeleteTag(m.UpdateType, []llrp.TagRecord{m.Tag})\n\t\tcase \"retrieve\":\n\t\t\ttagList := ReqRetrieveTag()\n\t\t\tm = WebsocketMessage{\n\t\t\t\tUpdateType: \"retrieval\",\n\t\t\t\tTag: llrp.TagRecord{},\n\t\t\t\tTags: tagList}\n\t\t\tclientMessage, err = json.Marshal(m)\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\tBroadcast(clientMessage)\n\t\tdefault:\n\t\t\tlog.Printf(\"unknown UpdateType: %v\", m.UpdateType)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a8b3abdcf6603044763de727260f4b02", "score": "0.57064474", "text": "func (c *SockerClientConnection) Handle() {\n\tselect {\n\tcase message, ok := <-c.inboundTCPChannel:\n\t\tif ok {\n\t\t\tif message != nil && c.ReadHandlers[c.index](message) {\n\t\t\t\tif err := c.Next(); err != nil {\n\t\t\t\t\tpanic(err)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tdefault:\n\t}\n}", "title": "" }, { "docid": "0c440a17f95ec9f353efc309ac9d9cb0", "score": "0.5698986", "text": "func (c *Client) Consume() {\n\tdefer func() {\n\t\tc.World.Leave <- c\n\t\tc.Conn.Close()\n\t}()\n\tc.Conn.SetReadLimit(maxMessageSize)\n\tc.Conn.SetReadDeadline(time.Now().Add(pongWait))\n\tc.Conn.SetPongHandler(func(string) error { c.Conn.SetReadDeadline(time.Now().Add(pongWait)); return nil })\n\tfor {\n\t\t_, message, err := c.Conn.ReadMessage()\n\t\tif err != nil {\n\t\t\tif websocket.IsUnexpectedCloseError(err, websocket.CloseGoingAway, websocket.CloseAbnormalClosure) {\n\t\t\t\tlog.Printf(\"error: %v\", err)\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tmessage = bytes.TrimSpace(bytes.Replace(message, []byte{'\\n'}, []byte{' '}, -1))\n\t\tmessageNativePacket := &Packet{}\n\t\tmessageNativePacket.Data.Chat.From = strconv.Itoa(c.ID)\n\t\terr = json.Unmarshal([]byte(message), &messageNativePacket)\n\t\tif err != nil {\n\t\t\tlog.Println(\"JSON Conversion err\", err)\n\t\t}\n\t\toutMessage := messageNativePacket.GetOutputPacket(c)\n\t\toutJSONMessage, err := json.Marshal(outMessage)\n\t\tc.World.Broadcast <- outJSONMessage\n\n\t}\n}", "title": "" }, { "docid": "3332e0b2ea6d14945a81ba1a0ef6b82e", "score": "0.56981575", "text": "func handleConnection(client net.Conn, u chat.User, newmsg chan<- string) {\n\tch_recv := make(chan chat.Message)\n\tch_send := make(chan chat.Message)\n\n\tgo chat.MessageReceiver(client, ch_recv)\n\tgo chat.MessageSender(client, ch_send)\n\n\tfor {\n\t\tselect {\n\t\tcase m, ok := <-ch_recv:\n\t\t\tif !ok {\n\t\t\t\t//client disconnected, close sender helper and quit\n\t\t\t\tclose(ch_send)\n\t\t\t\treturn\n\t\t\t} else {\n\t\t\t\t//new message from client\n\t\t\t\tnewmsg<- u.Name\n\t\t\t\tu.In <- m\n\t\t\t}\n\t\tcase m := <-u.Out:\n\t\t\t//new message to client\n\t\t\tch_send<- m\n\t\t}\n\t}\n}", "title": "" }, { "docid": "bcd1f9aa4c1bda84f044ba0ec5c694da", "score": "0.5697756", "text": "func OnMSG(c diam.Conn, m *diam.Message) {\n log.Printf(\"Receiving message from %s\", c.RemoteAddr().String())\n log.Println(m)\n}", "title": "" } ]